@progress/kendo-angular-grid 19.0.0-develop.3 → 19.0.0-develop.30
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/adaptiveness/adaptive-mode.d.ts +12 -0
- package/adaptiveness/adaptive-renderer.component.d.ts +84 -0
- package/codemods/template-transformer/index.js +94 -0
- package/codemods/utils.js +553 -0
- package/codemods/v19/grid-kendogridgroupbinding.js +51 -0
- package/column-menu/column-chooser.component.d.ts +4 -0
- package/column-menu/column-list.component.d.ts +10 -3
- package/column-menu/column-menu-item.component.d.ts +48 -3
- package/column-menu/column-menu-item.directive.d.ts +5 -2
- package/column-menu/column-menu.component.d.ts +4 -2
- package/columns/column-base.d.ts +5 -0
- package/columns/span-column.component.d.ts +2 -2
- package/common/adaptiveness.service.d.ts +50 -0
- package/common/single-popup.service.d.ts +3 -1
- package/common/toolbar-tool-base.directive.d.ts +26 -0
- package/directives.d.ts +12 -5
- package/dragdrop/drag-hint.service.d.ts +3 -2
- package/editing/add-command-tool.directive.d.ts +7 -6
- package/editing/cancel-command-tool.directive.d.ts +38 -0
- package/editing/edit-command-tool.directive.d.ts +38 -0
- package/editing/edit.service.d.ts +1 -1
- package/editing/remove-command-tool.directive.d.ts +39 -0
- package/editing/save-command-tool.directive.d.ts +38 -0
- package/editing/toolbar-editing-tool-base.directive.d.ts +29 -0
- package/editing-directives/editing-directive-base.d.ts +4 -1
- package/editing-directives/external-editing.directive.d.ts +3 -1
- package/esm2022/adaptiveness/adaptive-mode.mjs +5 -0
- package/esm2022/adaptiveness/adaptive-renderer.component.mjs +1108 -0
- package/esm2022/column-menu/column-chooser.component.mjs +13 -11
- package/esm2022/column-menu/column-list.component.mjs +51 -8
- package/esm2022/column-menu/column-menu-autosize-all.component.mjs +1 -1
- package/esm2022/column-menu/column-menu-autosize.component.mjs +1 -1
- package/esm2022/column-menu/column-menu-chooser.component.mjs +1 -1
- package/esm2022/column-menu/column-menu-container.component.mjs +1 -1
- package/esm2022/column-menu/column-menu-filter.component.mjs +1 -1
- package/esm2022/column-menu/column-menu-item.component.mjs +123 -12
- package/esm2022/column-menu/column-menu-item.directive.mjs +14 -5
- package/esm2022/column-menu/column-menu-lock.component.mjs +1 -1
- package/esm2022/column-menu/column-menu-position.component.mjs +1 -1
- package/esm2022/column-menu/column-menu-sort.component.mjs +1 -1
- package/esm2022/column-menu/column-menu-stick.component.mjs +1 -1
- package/esm2022/column-menu/column-menu.component.mjs +68 -44
- package/esm2022/column-resizing/column-handle.directive.mjs +2 -2
- package/esm2022/columns/column-base.mjs +9 -0
- package/esm2022/columns/columns-container.mjs +1 -1
- package/esm2022/columns/span-column.component.mjs +9 -9
- package/esm2022/common/adaptiveness.service.mjs +72 -0
- package/esm2022/common/single-popup.service.mjs +9 -3
- package/esm2022/common/toolbar-tool-base.directive.mjs +81 -0
- package/esm2022/directives.mjs +18 -3
- package/esm2022/dragdrop/drag-hint.service.mjs +7 -4
- package/esm2022/editing/add-command-tool.directive.mjs +12 -15
- package/esm2022/editing/cancel-command-tool.directive.mjs +64 -0
- package/esm2022/editing/edit-command-tool.directive.mjs +59 -0
- package/esm2022/editing/form/form-formfield.component.mjs +1 -1
- package/esm2022/editing/remove-command-tool.directive.mjs +60 -0
- package/esm2022/editing/remove-command.directive.mjs +1 -0
- package/esm2022/editing/save-command-tool.directive.mjs +64 -0
- package/esm2022/editing/toolbar-editing-tool-base.directive.mjs +94 -0
- package/esm2022/editing-directives/editing-directive-base.mjs +5 -2
- package/esm2022/editing-directives/external-editing.directive.mjs +28 -14
- package/esm2022/excel/excel-command-tool.directive.mjs +12 -17
- package/esm2022/filtering/cell/autocomplete-filter-cell.component.mjs +1 -1
- package/esm2022/filtering/cell/boolean-filter-cell.component.mjs +1 -1
- package/esm2022/filtering/cell/date-filter-cell.component.mjs +1 -1
- package/esm2022/filtering/cell/filter-cell-operators.component.mjs +1 -1
- package/esm2022/filtering/filter-input.directive.mjs +14 -2
- package/esm2022/filtering/menu/boolean-filter-menu.component.mjs +4 -2
- package/esm2022/filtering/menu/date-filter-menu-input.component.mjs +5 -1
- package/esm2022/filtering/menu/date-filter-menu.component.mjs +7 -1
- package/esm2022/filtering/menu/filter-menu-container.component.mjs +21 -10
- package/esm2022/filtering/menu/filter-menu-input-wrapper.component.mjs +27 -5
- package/esm2022/filtering/menu/filter-menu.component.mjs +44 -29
- package/esm2022/filtering/menu/numeric-filter-menu-input.component.mjs +2 -0
- package/esm2022/filtering/menu/numeric-filter-menu.component.mjs +7 -1
- package/esm2022/filtering/menu/string-filter-menu-input.component.mjs +2 -0
- package/esm2022/filtering/menu/string-filter-menu.component.mjs +11 -2
- package/esm2022/grid.component.mjs +358 -82
- package/esm2022/grid.module.mjs +114 -101
- package/esm2022/index.mjs +10 -1
- package/esm2022/localization/messages.mjs +104 -2
- package/esm2022/navigation/navigation.service.mjs +1 -1
- package/esm2022/navigation/toolbar-tool-name.mjs +17 -0
- package/esm2022/package-metadata.mjs +2 -2
- package/esm2022/pdf/pdf-command-tool.directive.mjs +12 -15
- package/esm2022/rendering/cell.component.mjs +4 -4
- package/esm2022/rendering/header/header.component.mjs +1 -1
- package/esm2022/rendering/list.component.mjs +1 -1
- package/esm2022/rendering/table-body.component.mjs +11 -3
- package/esm2022/rendering/toolbar/tools/column-chooser-tool.directive.mjs +203 -0
- package/esm2022/rendering/toolbar/tools/filter-command-tool.directive.mjs +61 -34
- package/esm2022/rendering/toolbar/tools/filter-tool-wrapper.component.mjs +29 -8
- package/esm2022/rendering/toolbar/tools/filter-toolbar-tool.component.mjs +73 -8
- package/esm2022/rendering/toolbar/tools/sort-command-tool.directive.mjs +46 -20
- package/esm2022/rendering/toolbar/tools/sort-toolbar-tool.component.mjs +24 -8
- package/esm2022/row-reordering/row-reorder.service.mjs +15 -0
- package/esm2022/selection/selection.service.mjs +11 -0
- package/esm2022/state-management/grid-state.models.mjs +26 -0
- package/esm2022/state-management/redo-command-tool.mjs +66 -0
- package/esm2022/state-management/undo-command-tool.mjs +66 -0
- package/esm2022/state-management/undo-redo.directive.mjs +178 -0
- package/esm2022/state-management/undo-redo.service.mjs +22 -0
- package/esm2022/state-management/undo-redo.stack.mjs +232 -0
- package/esm2022/utils.mjs +13 -13
- package/excel/excel-command-tool.directive.d.ts +5 -5
- package/fesm2022/progress-kendo-angular-grid.mjs +4672 -1798
- package/filtering/filter-input.directive.d.ts +1 -0
- package/filtering/menu/date-filter-menu-input.component.d.ts +1 -1
- package/filtering/menu/filter-menu-container.component.d.ts +14 -4
- package/filtering/menu/filter-menu-input-wrapper.component.d.ts +8 -3
- package/filtering/menu/filter-menu.component.d.ts +6 -3
- package/filtering/menu/numeric-filter-menu-input.component.d.ts +1 -1
- package/filtering/menu/string-filter-menu-input.component.d.ts +1 -1
- package/filtering/menu/string-filter-menu.component.d.ts +1 -0
- package/grid.component.d.ts +86 -33
- package/grid.module.d.ts +107 -100
- package/index.d.ts +9 -1
- package/localization/messages.d.ts +70 -2
- package/navigation/toolbar-tool-name.d.ts +17 -0
- package/package.json +36 -20
- package/pdf/pdf-command-tool.directive.d.ts +6 -5
- package/rendering/cell.component.d.ts +1 -1
- package/{column-menu → rendering/toolbar/tools}/column-chooser-tool.directive.d.ts +17 -6
- package/rendering/toolbar/tools/filter-command-tool.directive.d.ts +9 -1
- package/rendering/toolbar/tools/filter-tool-wrapper.component.d.ts +6 -5
- package/rendering/toolbar/tools/filter-toolbar-tool.component.d.ts +11 -2
- package/rendering/toolbar/tools/sort-command-tool.directive.d.ts +9 -1
- package/rendering/toolbar/tools/sort-toolbar-tool.component.d.ts +5 -1
- package/row-reordering/row-reorder.service.d.ts +2 -0
- package/schematics/ngAdd/index.js +4 -4
- package/selection/selection.service.d.ts +1 -0
- package/state-management/grid-state.models.d.ts +58 -0
- package/state-management/redo-command-tool.d.ts +38 -0
- package/state-management/undo-command-tool.d.ts +38 -0
- package/state-management/undo-redo.directive.d.ts +51 -0
- package/state-management/undo-redo.service.d.ts +19 -0
- package/state-management/undo-redo.stack.d.ts +104 -0
- package/utils.d.ts +11 -5
- package/esm2022/column-menu/column-chooser-tool.directive.mjs +0 -172
package/esm2022/directives.mjs
CHANGED
|
@@ -73,7 +73,7 @@ import { FilterRowComponent } from "./filtering/filter-row.component";
|
|
|
73
73
|
// COLUMN MENU
|
|
74
74
|
import { ColumnMenuChooserItemCheckedDirective } from "./column-menu/column-chooser-item-checked.directive";
|
|
75
75
|
import { ColumnChooserComponent } from "./column-menu/column-chooser.component";
|
|
76
|
-
import { ColumnChooserToolbarDirective } from "./
|
|
76
|
+
import { ColumnChooserToolbarDirective } from "./rendering/toolbar/tools/column-chooser-tool.directive";
|
|
77
77
|
import { ColumnListComponent } from "./column-menu/column-list.component";
|
|
78
78
|
import { ColumnMenuAutoSizeAllColumnsComponent } from "./column-menu/column-menu-autosize-all.component";
|
|
79
79
|
import { ColumnMenuAutoSizeColumnComponent } from "./column-menu/column-menu-autosize.component";
|
|
@@ -148,8 +148,15 @@ import { AddCommandToolbarDirective } from "./editing/add-command-tool.directive
|
|
|
148
148
|
import { RowDragHandleTemplateDirective } from "./row-reordering/drag-handle-template.directive";
|
|
149
149
|
import { RowDragHintTemplateDirective } from "./row-reordering/drag-hint-template.directive";
|
|
150
150
|
import { DialogFormComponent, FormComponent, FormFormFieldComponent } from "./editing/form";
|
|
151
|
+
import { UndoRedoDirective } from "./state-management/undo-redo.directive";
|
|
152
|
+
import { UndoCommandToolbarDirective } from "./state-management/undo-command-tool";
|
|
153
|
+
import { RedoCommandToolbarDirective } from "./state-management/redo-command-tool";
|
|
151
154
|
import { SortCommandToolbarDirective } from "./rendering/toolbar/tools/sort-command-tool.directive";
|
|
152
155
|
import { FilterCommandToolbarDirective } from "./rendering/toolbar/tools/filter-command-tool.directive";
|
|
156
|
+
import { EditCommandToolbarDirective } from "./editing/edit-command-tool.directive";
|
|
157
|
+
import { SaveCommandToolbarDirective } from "./editing/save-command-tool.directive";
|
|
158
|
+
import { RemoveCommandToolbarDirective } from "./editing/remove-command-tool.directive";
|
|
159
|
+
import { CancelCommandToolbarDirective } from "./editing/cancel-command-tool.directive";
|
|
153
160
|
/**
|
|
154
161
|
* @hidden
|
|
155
162
|
*
|
|
@@ -369,6 +376,10 @@ export const KENDO_GRID_BODY_EXPORTS = [
|
|
|
369
376
|
RemoveCommandDirective,
|
|
370
377
|
AddCommandDirective,
|
|
371
378
|
AddCommandToolbarDirective,
|
|
379
|
+
EditCommandToolbarDirective,
|
|
380
|
+
SaveCommandToolbarDirective,
|
|
381
|
+
RemoveCommandToolbarDirective,
|
|
382
|
+
CancelCommandToolbarDirective,
|
|
372
383
|
CellLoadingTemplateDirective,
|
|
373
384
|
LoadingTemplateDirective,
|
|
374
385
|
RowReorderColumnComponent,
|
|
@@ -404,7 +415,8 @@ export const KENDO_GRID_DECLARATIONS = [
|
|
|
404
415
|
GridClipboardDirective,
|
|
405
416
|
FormComponent,
|
|
406
417
|
DialogFormComponent,
|
|
407
|
-
FormFormFieldComponent
|
|
418
|
+
FormFormFieldComponent,
|
|
419
|
+
UndoRedoDirective,
|
|
408
420
|
];
|
|
409
421
|
/**
|
|
410
422
|
* @hidden
|
|
@@ -436,7 +448,10 @@ export const KENDO_GRID_EXPORTS = [
|
|
|
436
448
|
...KENDO_GRID_FILTER_OPERATORS,
|
|
437
449
|
...KENDO_GRID_FILTER_MENU_EXPORTS,
|
|
438
450
|
...KENDO_GRID_COLUMN_MENU_EXPORTS,
|
|
439
|
-
GridClipboardDirective
|
|
451
|
+
GridClipboardDirective,
|
|
452
|
+
UndoRedoDirective,
|
|
453
|
+
UndoCommandToolbarDirective,
|
|
454
|
+
RedoCommandToolbarDirective,
|
|
440
455
|
];
|
|
441
456
|
/**
|
|
442
457
|
* @hidden
|
|
@@ -65,21 +65,24 @@ const fontIconsMarkup = (safeTitle) => `
|
|
|
65
65
|
* @hidden
|
|
66
66
|
*/
|
|
67
67
|
export class DragHintService {
|
|
68
|
-
|
|
68
|
+
sanitizer;
|
|
69
69
|
iconsService;
|
|
70
70
|
dom;
|
|
71
71
|
cancelIcon = cancelIcon;
|
|
72
|
-
constructor(
|
|
73
|
-
this.
|
|
72
|
+
constructor(sanitizer, iconsService) {
|
|
73
|
+
this.sanitizer = sanitizer;
|
|
74
74
|
this.iconsService = iconsService;
|
|
75
75
|
}
|
|
76
|
+
ngOnDestroy() {
|
|
77
|
+
this.remove();
|
|
78
|
+
}
|
|
76
79
|
create(title) {
|
|
77
80
|
if (!isDocumentAvailable()) {
|
|
78
81
|
return;
|
|
79
82
|
}
|
|
80
83
|
this.dom = document.createElement("div");
|
|
81
84
|
decorate(this.dom);
|
|
82
|
-
const safeTitle = this.
|
|
85
|
+
const safeTitle = this.sanitizer.sanitize(SecurityContext.HTML, title);
|
|
83
86
|
const innerHtml = this.isSVG ?
|
|
84
87
|
svgIconsMarkup(this.cancelIcon.viewBox, this.cancelIcon.content, safeTitle) :
|
|
85
88
|
fontIconsMarkup(safeTitle);
|
|
@@ -2,14 +2,16 @@
|
|
|
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 } from '@angular/core';
|
|
5
|
+
import { ChangeDetectorRef, Directive, NgZone } from '@angular/core';
|
|
6
6
|
import { EditService } from './edit.service';
|
|
7
7
|
import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { ContextService } from '../common/provider.service';
|
|
9
|
+
import { ToolbarEditingToolBase } from './toolbar-editing-tool-base.directive';
|
|
10
|
+
import { ToolbarToolName } from '../navigation/toolbar-tool-name';
|
|
10
11
|
import * as i0 from "@angular/core";
|
|
11
12
|
import * as i1 from "./edit.service";
|
|
12
13
|
import * as i2 from "@progress/kendo-angular-toolbar";
|
|
14
|
+
import * as i3 from "../common/provider.service";
|
|
13
15
|
/**
|
|
14
16
|
* Represents the command for adding a new item to the Grid.
|
|
15
17
|
* You can apply this directive to any `kendo-toolbar-button` element inside a
|
|
@@ -28,22 +30,17 @@ import * as i2 from "@progress/kendo-angular-toolbar";
|
|
|
28
30
|
* </kendo-grid>
|
|
29
31
|
* ```
|
|
30
32
|
*/
|
|
31
|
-
export class AddCommandToolbarDirective {
|
|
33
|
+
export class AddCommandToolbarDirective extends ToolbarEditingToolBase {
|
|
32
34
|
editService;
|
|
33
35
|
host;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
constructor(editService, host, ctx, zone, cdr) {
|
|
37
|
+
super(host, ToolbarToolName.add, ctx, zone, cdr, editService);
|
|
36
38
|
this.editService = editService;
|
|
37
39
|
this.host = host;
|
|
38
40
|
}
|
|
39
41
|
ngOnInit() {
|
|
40
|
-
|
|
42
|
+
super.ngOnInit();
|
|
41
43
|
this.host.className = 'k-grid-add-command';
|
|
42
|
-
this.host.svgIcon = plusIcon;
|
|
43
|
-
this.host.icon = 'plus';
|
|
44
|
-
}
|
|
45
|
-
ngOnDestroy() {
|
|
46
|
-
this.clickSub.unsubscribe();
|
|
47
44
|
}
|
|
48
45
|
/**
|
|
49
46
|
* @hidden
|
|
@@ -52,8 +49,8 @@ export class AddCommandToolbarDirective {
|
|
|
52
49
|
e.preventDefault();
|
|
53
50
|
this.editService.beginAdd();
|
|
54
51
|
}
|
|
55
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AddCommandToolbarDirective, deps: [{ token: i1.EditService }, { token: i2.ToolBarButtonComponent }], target: i0.ɵɵFactoryTarget.Directive });
|
|
56
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: AddCommandToolbarDirective, isStandalone: true, selector: "[kendoGridAddTool]", ngImport: i0 });
|
|
52
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AddCommandToolbarDirective, deps: [{ token: i1.EditService }, { token: i2.ToolBarButtonComponent }, { token: i3.ContextService }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
53
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: AddCommandToolbarDirective, isStandalone: true, selector: "[kendoGridAddTool]", usesInheritance: true, ngImport: i0 });
|
|
57
54
|
}
|
|
58
55
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AddCommandToolbarDirective, decorators: [{
|
|
59
56
|
type: Directive,
|
|
@@ -61,4 +58,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
61
58
|
selector: '[kendoGridAddTool]',
|
|
62
59
|
standalone: true
|
|
63
60
|
}]
|
|
64
|
-
}], ctorParameters: function () { return [{ type: i1.EditService }, { type: i2.ToolBarButtonComponent }]; } });
|
|
61
|
+
}], ctorParameters: function () { return [{ type: i1.EditService }, { type: i2.ToolBarButtonComponent }, { type: i3.ContextService }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }]; } });
|
|
@@ -0,0 +1,64 @@
|
|
|
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 { ChangeDetectorRef, Directive, NgZone } from '@angular/core';
|
|
6
|
+
import { EditService } from './edit.service';
|
|
7
|
+
import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
|
|
8
|
+
import { SelectionService } from '../selection/selection.service';
|
|
9
|
+
import { ContextService } from '../common/provider.service';
|
|
10
|
+
import { ToolbarEditingToolBase } from './toolbar-editing-tool-base.directive';
|
|
11
|
+
import { ToolbarToolName } from '../navigation/toolbar-tool-name';
|
|
12
|
+
import * as i0 from "@angular/core";
|
|
13
|
+
import * as i1 from "./edit.service";
|
|
14
|
+
import * as i2 from "@progress/kendo-angular-toolbar";
|
|
15
|
+
import * as i3 from "../selection/selection.service";
|
|
16
|
+
import * as i4 from "../common/provider.service";
|
|
17
|
+
/**
|
|
18
|
+
* Represents the `cancel` command in the Grid.
|
|
19
|
+
* You can apply this directive to any `kendo-toolbar-button` element inside a
|
|
20
|
+
* ToolbarComponent used in the Grid.
|
|
21
|
+
*
|
|
22
|
+
* When the user clicks the toolbar button that is associated with the directive, the
|
|
23
|
+
* [cancel]({% slug api_grid_gridcomponent %}#toc-cancel) event is triggered.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```html-no-run
|
|
27
|
+
* <kendo-grid>
|
|
28
|
+
* <kendo-toolbar>
|
|
29
|
+
* <kendo-toolbar-button text="Cancel" kendoGridCancelTool></kendo-toolbar-button>
|
|
30
|
+
* </kendo-toolbar>
|
|
31
|
+
* </kendo-grid>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export class CancelCommandToolbarDirective extends ToolbarEditingToolBase {
|
|
35
|
+
editService;
|
|
36
|
+
constructor(editService, host, selection, ctx, zone, cdr) {
|
|
37
|
+
super(host, ToolbarToolName.cancel, ctx, zone, cdr, editService, selection);
|
|
38
|
+
this.editService = editService;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @hidden
|
|
42
|
+
*/
|
|
43
|
+
onClick(e) {
|
|
44
|
+
e.preventDefault();
|
|
45
|
+
if (this.editService.hasNewItem) {
|
|
46
|
+
this.editService.endEdit();
|
|
47
|
+
}
|
|
48
|
+
else if (this.isSelectionPresent && this.editService.isEdited(this.lastSelectionIndex)) {
|
|
49
|
+
this.editService.endEdit(this.lastSelectionIndex);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
this.editService.editedIndices.forEach(i => this.editService.endEdit(i.index));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CancelCommandToolbarDirective, deps: [{ token: i1.EditService }, { token: i2.ToolBarButtonComponent }, { token: i3.SelectionService }, { token: i4.ContextService }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
56
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: CancelCommandToolbarDirective, isStandalone: true, selector: "[kendoGridCancelTool]", usesInheritance: true, ngImport: i0 });
|
|
57
|
+
}
|
|
58
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CancelCommandToolbarDirective, decorators: [{
|
|
59
|
+
type: Directive,
|
|
60
|
+
args: [{
|
|
61
|
+
selector: '[kendoGridCancelTool]',
|
|
62
|
+
standalone: true
|
|
63
|
+
}]
|
|
64
|
+
}], ctorParameters: function () { return [{ type: i1.EditService }, { type: i2.ToolBarButtonComponent }, { type: i3.SelectionService }, { type: i4.ContextService }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }]; } });
|
|
@@ -0,0 +1,59 @@
|
|
|
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 { ChangeDetectorRef, Directive, NgZone } from '@angular/core';
|
|
6
|
+
import { EditService } from './edit.service';
|
|
7
|
+
import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
|
|
8
|
+
import { SelectionService } from '../selection/selection.service';
|
|
9
|
+
import { ContextService } from '../common/provider.service';
|
|
10
|
+
import { ToolbarEditingToolBase } from './toolbar-editing-tool-base.directive';
|
|
11
|
+
import { ToolbarToolName } from '../navigation/toolbar-tool-name';
|
|
12
|
+
import * as i0 from "@angular/core";
|
|
13
|
+
import * as i1 from "./edit.service";
|
|
14
|
+
import * as i2 from "@progress/kendo-angular-toolbar";
|
|
15
|
+
import * as i3 from "../selection/selection.service";
|
|
16
|
+
import * as i4 from "../common/provider.service";
|
|
17
|
+
/**
|
|
18
|
+
* Represents the `edit` command in the Grid.
|
|
19
|
+
* You can apply this directive to any `kendo-toolbar-button` element inside a
|
|
20
|
+
* ToolbarComponent used in the Grid.
|
|
21
|
+
*
|
|
22
|
+
* When the user clicks the toolbar button that is associated with the directive, the
|
|
23
|
+
* [edit]({% slug api_grid_gridcomponent %}#toc-edit) event is triggered.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```html-no-run
|
|
27
|
+
* <kendo-grid>
|
|
28
|
+
* <kendo-toolbar>
|
|
29
|
+
* <kendo-toolbar-button text="Edit" kendoGridEditTool></kendo-toolbar-button>
|
|
30
|
+
* </kendo-toolbar>
|
|
31
|
+
* </kendo-grid>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export class EditCommandToolbarDirective extends ToolbarEditingToolBase {
|
|
35
|
+
editService;
|
|
36
|
+
constructor(editService, host, selection, ctx, zone, cdr) {
|
|
37
|
+
super(host, ToolbarToolName.edit, ctx, zone, cdr, editService, selection);
|
|
38
|
+
this.editService = editService;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @hidden
|
|
42
|
+
*/
|
|
43
|
+
onClick(e) {
|
|
44
|
+
e.preventDefault();
|
|
45
|
+
if (!this.isSelectionPresent) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
this.editService.beginEdit(this.lastSelectionIndex);
|
|
49
|
+
}
|
|
50
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EditCommandToolbarDirective, deps: [{ token: i1.EditService }, { token: i2.ToolBarButtonComponent }, { token: i3.SelectionService }, { token: i4.ContextService }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
51
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: EditCommandToolbarDirective, isStandalone: true, selector: "[kendoGridEditTool]", usesInheritance: true, ngImport: i0 });
|
|
52
|
+
}
|
|
53
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EditCommandToolbarDirective, decorators: [{
|
|
54
|
+
type: Directive,
|
|
55
|
+
args: [{
|
|
56
|
+
selector: '[kendoGridEditTool]',
|
|
57
|
+
standalone: true
|
|
58
|
+
}]
|
|
59
|
+
}], ctorParameters: function () { return [{ type: i1.EditService }, { type: i2.ToolBarButtonComponent }, { type: i3.SelectionService }, { type: i4.ContextService }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }]; } });
|
|
@@ -89,7 +89,7 @@ export class FormFormFieldComponent {
|
|
|
89
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
90
|
</ng-container>
|
|
91
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", "
|
|
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", "adaptiveTitle", "adaptiveSubtitle", "rangeValidation", "disabledDatesValidation", "weekNumber", "size", "rounded", "fillMode", "adaptiveMode"], outputs: ["valueChange", "focus", "blur", "open", "close", "escape"], exportAs: ["kendo-datepicker"] }] });
|
|
93
93
|
}
|
|
94
94
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormFormFieldComponent, decorators: [{
|
|
95
95
|
type: Component,
|
|
@@ -0,0 +1,60 @@
|
|
|
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 { ChangeDetectorRef, Directive, NgZone } from '@angular/core';
|
|
6
|
+
import { EditService } from './edit.service';
|
|
7
|
+
import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
|
|
8
|
+
import { SelectionService } from '../selection/selection.service';
|
|
9
|
+
import { ContextService } from '../common/provider.service';
|
|
10
|
+
import { ToolbarEditingToolBase } from './toolbar-editing-tool-base.directive';
|
|
11
|
+
import { ToolbarToolName } from '../navigation/toolbar-tool-name';
|
|
12
|
+
import * as i0 from "@angular/core";
|
|
13
|
+
import * as i1 from "./edit.service";
|
|
14
|
+
import * as i2 from "@progress/kendo-angular-toolbar";
|
|
15
|
+
import * as i3 from "../selection/selection.service";
|
|
16
|
+
import * as i4 from "../common/provider.service";
|
|
17
|
+
/**
|
|
18
|
+
* Represents the `remove` command in the Grid.
|
|
19
|
+
* You can apply this directive to any `kendo-toolbar-button` element inside a
|
|
20
|
+
* ToolbarComponent used in the Grid.
|
|
21
|
+
*
|
|
22
|
+
* When the user clicks the toolbar button that is associated with the directive, the
|
|
23
|
+
* [remove]({% slug api_grid_gridcomponent %}#toc-remove) event is triggered.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```html-no-run
|
|
27
|
+
* <kendo-grid>
|
|
28
|
+
* <kendo-toolbar>
|
|
29
|
+
* <kendo-toolbar-button text="Remove row" kendoGridRemoveTool></kendo-toolbar-button>
|
|
30
|
+
* </kendo-toolbar>
|
|
31
|
+
* </kendo-grid>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export class RemoveCommandToolbarDirective extends ToolbarEditingToolBase {
|
|
35
|
+
editService;
|
|
36
|
+
selection;
|
|
37
|
+
constructor(editService, host, selection, ctx, zone, cdr) {
|
|
38
|
+
super(host, ToolbarToolName.remove, ctx, zone, cdr, editService, selection);
|
|
39
|
+
this.editService = editService;
|
|
40
|
+
this.selection = selection;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @hidden
|
|
44
|
+
*/
|
|
45
|
+
onClick(e) {
|
|
46
|
+
e.preventDefault();
|
|
47
|
+
if (this.isSelectionPresent) {
|
|
48
|
+
this.editService.remove(this.lastSelectionIndex);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RemoveCommandToolbarDirective, deps: [{ token: i1.EditService }, { token: i2.ToolBarButtonComponent }, { token: i3.SelectionService }, { token: i4.ContextService }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
52
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: RemoveCommandToolbarDirective, isStandalone: true, selector: "[kendoGridRemoveTool]", usesInheritance: true, ngImport: i0 });
|
|
53
|
+
}
|
|
54
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RemoveCommandToolbarDirective, decorators: [{
|
|
55
|
+
type: Directive,
|
|
56
|
+
args: [{
|
|
57
|
+
selector: '[kendoGridRemoveTool]',
|
|
58
|
+
standalone: true
|
|
59
|
+
}]
|
|
60
|
+
}], ctorParameters: function () { return [{ type: i1.EditService }, { type: i2.ToolBarButtonComponent }, { type: i3.SelectionService }, { type: i4.ContextService }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }]; } });
|
|
@@ -0,0 +1,64 @@
|
|
|
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 { ChangeDetectorRef, Directive, NgZone } from '@angular/core';
|
|
6
|
+
import { EditService } from './edit.service';
|
|
7
|
+
import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
|
|
8
|
+
import { SelectionService } from '../selection/selection.service';
|
|
9
|
+
import { ContextService } from '../common/provider.service';
|
|
10
|
+
import { ToolbarEditingToolBase } from './toolbar-editing-tool-base.directive';
|
|
11
|
+
import { ToolbarToolName } from '../navigation/toolbar-tool-name';
|
|
12
|
+
import * as i0 from "@angular/core";
|
|
13
|
+
import * as i1 from "./edit.service";
|
|
14
|
+
import * as i2 from "@progress/kendo-angular-toolbar";
|
|
15
|
+
import * as i3 from "../selection/selection.service";
|
|
16
|
+
import * as i4 from "../common/provider.service";
|
|
17
|
+
/**
|
|
18
|
+
* Represents the `save` command in the Grid.
|
|
19
|
+
* You can apply this directive to any `kendo-toolbar-button` element inside a
|
|
20
|
+
* ToolbarComponent used in the Grid.
|
|
21
|
+
*
|
|
22
|
+
* When the user clicks the toolbar button that is associated with the directive, the
|
|
23
|
+
* [save]({% slug api_grid_gridcomponent %}#toc-save) event is triggered.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```html-no-run
|
|
27
|
+
* <kendo-grid>
|
|
28
|
+
* <kendo-toolbar>
|
|
29
|
+
* <kendo-toolbar-button text="Save" kendoGridSaveTool></kendo-toolbar-button>
|
|
30
|
+
* </kendo-toolbar>
|
|
31
|
+
* </kendo-grid>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export class SaveCommandToolbarDirective extends ToolbarEditingToolBase {
|
|
35
|
+
editService;
|
|
36
|
+
constructor(editService, host, selection, ctx, zone, cdr) {
|
|
37
|
+
super(host, ToolbarToolName.save, ctx, zone, cdr, editService, selection);
|
|
38
|
+
this.editService = editService;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @hidden
|
|
42
|
+
*/
|
|
43
|
+
onClick(e) {
|
|
44
|
+
e.preventDefault();
|
|
45
|
+
if (this.editService.hasNewItem) {
|
|
46
|
+
this.editService.save();
|
|
47
|
+
}
|
|
48
|
+
else if (this.isSelectionPresent && this.editService.isEdited(this.lastSelectionIndex)) {
|
|
49
|
+
this.editService.save(this.lastSelectionIndex);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
this.editService.editedIndices.forEach(i => this.editService.save(i.index));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SaveCommandToolbarDirective, deps: [{ token: i1.EditService }, { token: i2.ToolBarButtonComponent }, { token: i3.SelectionService }, { token: i4.ContextService }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
56
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SaveCommandToolbarDirective, isStandalone: true, selector: "[kendoGridSaveTool]", usesInheritance: true, ngImport: i0 });
|
|
57
|
+
}
|
|
58
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SaveCommandToolbarDirective, decorators: [{
|
|
59
|
+
type: Directive,
|
|
60
|
+
args: [{
|
|
61
|
+
selector: '[kendoGridSaveTool]',
|
|
62
|
+
standalone: true
|
|
63
|
+
}]
|
|
64
|
+
}], ctorParameters: function () { return [{ type: i1.EditService }, { type: i2.ToolBarButtonComponent }, { type: i3.SelectionService }, { type: i4.ContextService }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }]; } });
|
|
@@ -0,0 +1,94 @@
|
|
|
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 { ChangeDetectorRef, Directive, Inject, NgZone } from '@angular/core';
|
|
6
|
+
import { take } from 'rxjs/operators';
|
|
7
|
+
import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
|
|
8
|
+
import { isPresent } from '@progress/kendo-angular-common';
|
|
9
|
+
import { SelectionService } from '../selection/selection.service';
|
|
10
|
+
import { EditService } from '../editing/edit.service';
|
|
11
|
+
import { ContextService } from '../common/provider.service';
|
|
12
|
+
import { ToolbarToolBase } from '../common/toolbar-tool-base.directive';
|
|
13
|
+
import { ToolbarToolName } from '../navigation/toolbar-tool-name';
|
|
14
|
+
import * as i0 from "@angular/core";
|
|
15
|
+
import * as i1 from "@progress/kendo-angular-toolbar";
|
|
16
|
+
import * as i2 from "../common/provider.service";
|
|
17
|
+
import * as i3 from "../editing/edit.service";
|
|
18
|
+
import * as i4 from "../selection/selection.service";
|
|
19
|
+
/**
|
|
20
|
+
* @hidden
|
|
21
|
+
*/
|
|
22
|
+
export class ToolbarEditingToolBase extends ToolbarToolBase {
|
|
23
|
+
host;
|
|
24
|
+
commandName;
|
|
25
|
+
ctx;
|
|
26
|
+
editService;
|
|
27
|
+
selection;
|
|
28
|
+
isEdited = false;
|
|
29
|
+
lastToolState = null;
|
|
30
|
+
constructor(host, commandName, ctx, zone, cdr, editService, selection) {
|
|
31
|
+
super(host, commandName, ctx, zone, cdr);
|
|
32
|
+
this.host = host;
|
|
33
|
+
this.commandName = commandName;
|
|
34
|
+
this.ctx = ctx;
|
|
35
|
+
this.editService = editService;
|
|
36
|
+
this.selection = selection;
|
|
37
|
+
}
|
|
38
|
+
ngDoCheck() {
|
|
39
|
+
if (!isPresent(this.editService)) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
this.isEdited = this.editService.isEditing();
|
|
43
|
+
let isToolInactive = false;
|
|
44
|
+
let formGroup;
|
|
45
|
+
const selectionPresent = isPresent(this.lastSelectionIndex);
|
|
46
|
+
const editServiceCtx = this.editService.context(this.lastSelectionIndex);
|
|
47
|
+
if (this.isEdited && isPresent(editServiceCtx)) {
|
|
48
|
+
formGroup = this.editService.context(this.lastSelectionIndex).group;
|
|
49
|
+
}
|
|
50
|
+
switch (this.commandName) {
|
|
51
|
+
case ToolbarToolName.edit:
|
|
52
|
+
isToolInactive = this.isEdited || !selectionPresent;
|
|
53
|
+
break;
|
|
54
|
+
case ToolbarToolName.save:
|
|
55
|
+
isToolInactive = !(this.isEdited || this.editService.hasNewItem) || !formGroup?.valid;
|
|
56
|
+
break;
|
|
57
|
+
case ToolbarToolName.remove:
|
|
58
|
+
isToolInactive = this.isEdited || !selectionPresent;
|
|
59
|
+
break;
|
|
60
|
+
case ToolbarToolName.cancel:
|
|
61
|
+
isToolInactive = !(this.isEdited || this.editService.hasNewItem);
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
if (this.lastToolState !== isToolInactive) {
|
|
65
|
+
this.lastToolState = isToolInactive;
|
|
66
|
+
if (this.ctx.grid.showInactiveTools) {
|
|
67
|
+
this.host.disabled = isToolInactive;
|
|
68
|
+
}
|
|
69
|
+
else if (this.host.isHidden !== isToolInactive) {
|
|
70
|
+
this.host.isHidden = isToolInactive;
|
|
71
|
+
const toolbar = this.host.host;
|
|
72
|
+
toolbar.refreshService.refresh(this.host);
|
|
73
|
+
this.zone.onStable.pipe(take(1)).subscribe(() => {
|
|
74
|
+
toolbar.onResize();
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
get lastSelectionIndex() {
|
|
80
|
+
return this.selection?.selected[this.selection?.selected.length - 1];
|
|
81
|
+
}
|
|
82
|
+
get isSelectionPresent() {
|
|
83
|
+
return isPresent(this.lastSelectionIndex) && this.lastSelectionIndex > -1;
|
|
84
|
+
}
|
|
85
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ToolbarEditingToolBase, deps: [{ token: i1.ToolBarButtonComponent }, { token: 'command' }, { token: i2.ContextService }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: i3.EditService }, { token: i4.SelectionService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
86
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: ToolbarEditingToolBase, usesInheritance: true, ngImport: i0 });
|
|
87
|
+
}
|
|
88
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ToolbarEditingToolBase, decorators: [{
|
|
89
|
+
type: Directive,
|
|
90
|
+
args: [{}]
|
|
91
|
+
}], ctorParameters: function () { return [{ type: i1.ToolBarButtonComponent }, { type: undefined, decorators: [{
|
|
92
|
+
type: Inject,
|
|
93
|
+
args: ['command']
|
|
94
|
+
}] }, { type: i2.ContextService }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: i3.EditService }, { type: i4.SelectionService }]; } });
|
|
@@ -55,9 +55,12 @@ export class EditingDirectiveBase {
|
|
|
55
55
|
};
|
|
56
56
|
/**
|
|
57
57
|
* A function that is called to confirm if the `dataItem` will be removed.
|
|
58
|
-
*
|
|
58
|
+
* By default, the Grid displays its built-in confirmation dialog. To use a custom dialog, provide a `RemoveConfirmationCallback` function.
|
|
59
|
+
* To prevent showing a confirmation dialog, set the `removeConfirmation` property to `false`.
|
|
60
|
+
*
|
|
61
|
+
* @default true
|
|
59
62
|
*/
|
|
60
|
-
removeConfirmation =
|
|
63
|
+
removeConfirmation = true;
|
|
61
64
|
subscriptions = new Subscription();
|
|
62
65
|
defaultEditService;
|
|
63
66
|
userEditService;
|
|
@@ -9,9 +9,11 @@ import { markAllAsTouched } from './utils';
|
|
|
9
9
|
import { EditingDirectiveBase } from './editing-directive-base';
|
|
10
10
|
import { DialogFormComponent } from '../editing/form';
|
|
11
11
|
import { isPresent } from '@progress/kendo-angular-common';
|
|
12
|
+
import { AdaptiveGridService } from '../common/adaptiveness.service';
|
|
12
13
|
import * as i0 from "@angular/core";
|
|
13
14
|
import * as i1 from "../grid.component";
|
|
14
15
|
import * as i2 from "../editing/local-data-changes.service";
|
|
16
|
+
import * as i3 from "../common/adaptiveness.service";
|
|
15
17
|
/**
|
|
16
18
|
* A directive which encapsulates the editing operations of the Grid when using the
|
|
17
19
|
* External Form ([see example](slug:editing_directives_grid#external-editing)).
|
|
@@ -19,6 +21,7 @@ import * as i2 from "../editing/local-data-changes.service";
|
|
|
19
21
|
export class ExternalEditingDirective extends EditingDirectiveBase {
|
|
20
22
|
grid;
|
|
21
23
|
localDataChangesService;
|
|
24
|
+
adaptiveGridService;
|
|
22
25
|
/**
|
|
23
26
|
* The function that creates the `FormGroup` for the edited model.
|
|
24
27
|
*/
|
|
@@ -31,10 +34,11 @@ export class ExternalEditingDirective extends EditingDirectiveBase {
|
|
|
31
34
|
* Allows you to customize the Dialog that contains the edit form.
|
|
32
35
|
*/
|
|
33
36
|
dialogSettings;
|
|
34
|
-
constructor(grid, localDataChangesService) {
|
|
37
|
+
constructor(grid, localDataChangesService, adaptiveGridService) {
|
|
35
38
|
super(grid, localDataChangesService);
|
|
36
39
|
this.grid = grid;
|
|
37
40
|
this.localDataChangesService = localDataChangesService;
|
|
41
|
+
this.adaptiveGridService = adaptiveGridService;
|
|
38
42
|
}
|
|
39
43
|
ngOnInit() {
|
|
40
44
|
super.ngOnInit();
|
|
@@ -46,19 +50,29 @@ export class ExternalEditingDirective extends EditingDirectiveBase {
|
|
|
46
50
|
* Opens a Dialog that contains the edit form.
|
|
47
51
|
*/
|
|
48
52
|
openEditFormDialog(editEventArgs, formGroup, formSettings) {
|
|
49
|
-
const settings = { appendTo: this.grid.dialogContainer, content: DialogFormComponent, title: this.localization.get('externalEditingTitle'), ...this.dialogSettings };
|
|
50
|
-
const dialog = this.dialogService.open(settings);
|
|
51
53
|
const formControls = this.normalizeFormSettings(formGroup, editEventArgs);
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if (resultType === this.localization.get('externalEditingSaveText')) {
|
|
58
|
-
this.saveHandler({ ...editEventArgs, formGroup });
|
|
54
|
+
if (this.grid.adaptiveMode === 'auto' && this.adaptiveGridService.windowSize !== 'large') {
|
|
55
|
+
if (!this.grid.isActionSheetExpanded) {
|
|
56
|
+
this.adaptiveGridService.viewType = 'externalEditing';
|
|
57
|
+
this.grid.adaptiveRenderer.externalEditingSettings = { formControls, formGroup, formSettings, event: editEventArgs, externalEditingDirective: this };
|
|
58
|
+
this.grid.adaptiveRenderer.actionSheet.toggle(true);
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
const settings = { appendTo: this.grid.dialogContainer, content: DialogFormComponent, title: this.localization.get('externalEditingTitle'), ...this.dialogSettings };
|
|
63
|
+
const dialog = this.dialogService.open(settings);
|
|
64
|
+
this.adaptiveGridService.popupRef = dialog;
|
|
65
|
+
dialog.content.setInput('controls', formControls);
|
|
66
|
+
formSettings && dialog.content.setInput('formSettings', formSettings);
|
|
67
|
+
dialog.content.setInput('formGroup', formGroup);
|
|
68
|
+
dialog.result.subscribe((r) => {
|
|
69
|
+
const resultType = r['text'];
|
|
70
|
+
if (resultType === this.localization.get('externalEditingSaveText')) {
|
|
71
|
+
this.saveHandler({ ...editEventArgs, formGroup });
|
|
72
|
+
}
|
|
73
|
+
dialog.close();
|
|
74
|
+
});
|
|
75
|
+
}
|
|
62
76
|
}
|
|
63
77
|
createModel(args) {
|
|
64
78
|
return this.createFormGroup(args);
|
|
@@ -111,7 +125,7 @@ export class ExternalEditingDirective extends EditingDirectiveBase {
|
|
|
111
125
|
});
|
|
112
126
|
return settings.filter(item => isPresent(item));
|
|
113
127
|
}
|
|
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 });
|
|
128
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ExternalEditingDirective, deps: [{ token: i1.GridComponent }, { token: i2.LocalDataChangesService }, { token: i3.AdaptiveGridService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
115
129
|
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
130
|
}
|
|
117
131
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ExternalEditingDirective, decorators: [{
|
|
@@ -120,7 +134,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
120
134
|
selector: '[kendoGridExternalEditing]',
|
|
121
135
|
standalone: true
|
|
122
136
|
}]
|
|
123
|
-
}], ctorParameters: function () { return [{ type: i1.GridComponent }, { type: i2.LocalDataChangesService }]; }, propDecorators: { createFormGroup: [{
|
|
137
|
+
}], ctorParameters: function () { return [{ type: i1.GridComponent }, { type: i2.LocalDataChangesService }, { type: i3.AdaptiveGridService }]; }, propDecorators: { createFormGroup: [{
|
|
124
138
|
type: Input,
|
|
125
139
|
args: ['kendoGridExternalEditing']
|
|
126
140
|
}], formSettings: [{
|