@progress/kendo-angular-grid 12.0.0-develop.1 → 12.0.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-menu-item-content-template.directive.d.ts +13 -24
- package/column-menu/column-menu-template.directive.d.ts +14 -28
- package/columns/column-base.d.ts +4 -0
- package/columns/reorder-column.component.d.ts +31 -0
- package/databinding.directive.d.ts +15 -1
- package/editing/add-command.directive.d.ts +1 -1
- package/editing/cancel-command.directive.d.ts +4 -16
- package/editing/edit-template.directive.d.ts +2 -3
- package/editing/remove-command.directive.d.ts +6 -6
- package/editing/save-command.directive.d.ts +3 -15
- package/editing-directives/in-cell-editing.directive.d.ts +1 -1
- package/editing-directives/template-editing.directive.d.ts +1 -1
- package/esm2020/column-menu/column-menu-item-content-template.directive.mjs +13 -24
- package/esm2020/column-menu/column-menu-template.directive.mjs +14 -28
- package/esm2020/columns/column-base.mjs +4 -0
- package/esm2020/columns/reorder-column.component.mjs +55 -0
- package/esm2020/databinding.directive.mjs +30 -3
- package/esm2020/editing/add-command.directive.mjs +1 -1
- package/esm2020/editing/cancel-command.directive.mjs +4 -16
- package/esm2020/editing/edit-template.directive.mjs +2 -3
- package/esm2020/editing/remove-command.directive.mjs +6 -6
- package/esm2020/editing/save-command.directive.mjs +3 -15
- package/esm2020/editing-directives/in-cell-editing.directive.mjs +1 -1
- package/esm2020/editing-directives/template-editing.directive.mjs +1 -1
- package/esm2020/excel/excel-command.directive.mjs +2 -2
- package/esm2020/filtering/cell/autocomplete-filter-cell.component.mjs +1 -1
- package/esm2020/filtering/cell/boolean-filter-cell.component.mjs +1 -1
- package/esm2020/filtering/cell/filter-cell-operators.component.mjs +1 -1
- package/esm2020/filtering/menu/date-filter-menu.component.mjs +1 -1
- package/esm2020/filtering/menu/filter-menu-input-wrapper.component.mjs +1 -1
- package/esm2020/filtering/menu/numeric-filter-menu.component.mjs +1 -1
- package/esm2020/filtering/menu/string-filter-menu.component.mjs +1 -1
- package/esm2020/grid.component.mjs +195 -38
- package/esm2020/grid.module.mjs +70 -65
- package/esm2020/grouping/group-footer-template.directive.mjs +9 -35
- package/esm2020/grouping/group-header-column-template.directive.mjs +2 -2
- package/esm2020/grouping/group-header-template.directive.mjs +9 -37
- package/esm2020/index.mjs +1 -0
- package/esm2020/localization/messages.mjs +3 -1
- package/esm2020/navigation/focusable.directive.mjs +10 -41
- package/esm2020/package-metadata.mjs +2 -2
- package/esm2020/pager/pager-page-sizes.component.mjs +1 -1
- package/esm2020/pager/pager-template.directive.mjs +13 -46
- package/esm2020/pdf/pdf-template.directive.mjs +10 -38
- package/esm2020/rendering/body.module.mjs +9 -4
- package/esm2020/rendering/cell-loading.template.directive.mjs +11 -8
- package/esm2020/rendering/cell-template.directive.mjs +11 -35
- package/esm2020/rendering/cell.component.mjs +43 -10
- package/esm2020/rendering/details/detail-template.directive.mjs +10 -58
- package/esm2020/rendering/details-expand.directive.mjs +1 -1
- package/esm2020/rendering/footer/footer-template.directive.mjs +8 -35
- package/esm2020/rendering/header/header-template.directive.mjs +9 -36
- package/esm2020/rendering/loading-template.directive.mjs +1 -1
- package/esm2020/rendering/no-records-template.directive.mjs +11 -58
- package/esm2020/rendering/toolbar/toolbar-template.directive.mjs +10 -56
- package/esm2020/row-reordering/row-reorder.service.mjs +232 -0
- package/esm2020/row-reordering/types.mjs +5 -0
- package/esm2020/row-reordering/utils.mjs +87 -0
- package/esm2020/selection/selectall-checkbox.directive.mjs +12 -1
- package/esm2020/selection/selection-checkbox.directive.mjs +11 -44
- package/esm2020/selection/selection-default.mjs +1 -0
- package/esm2020/selection/selection.directive.mjs +1 -1
- package/excel/excel-command.directive.d.ts +2 -2
- package/fesm2015/progress-kendo-angular-grid.mjs +838 -690
- package/fesm2020/progress-kendo-angular-grid.mjs +834 -690
- package/grid.component.d.ts +46 -4
- package/grid.module.d.ts +87 -85
- package/grouping/group-footer-template.directive.d.ts +9 -35
- package/grouping/group-header-column-template.directive.d.ts +2 -2
- package/grouping/group-header-template.directive.d.ts +9 -37
- package/index.d.ts +2 -0
- package/localization/messages.d.ts +5 -1
- package/navigation/focusable.directive.d.ts +10 -41
- package/package.json +15 -14
- package/pager/pager-template.directive.d.ts +13 -46
- package/pdf/pdf-template.directive.d.ts +10 -38
- package/rendering/body.module.d.ts +9 -8
- package/rendering/cell-loading.template.directive.d.ts +11 -8
- package/rendering/cell-template.directive.d.ts +11 -35
- package/rendering/cell.component.d.ts +5 -0
- package/rendering/details/detail-template.directive.d.ts +10 -58
- package/rendering/details-expand.directive.d.ts +1 -1
- package/rendering/footer/footer-template.directive.d.ts +8 -35
- package/rendering/header/header-template.directive.d.ts +9 -36
- package/rendering/loading-template.directive.d.ts +1 -1
- package/rendering/no-records-template.directive.d.ts +11 -58
- package/rendering/toolbar/toolbar-template.directive.d.ts +10 -56
- package/row-reordering/row-reorder.service.d.ts +56 -0
- package/row-reordering/types.d.ts +40 -0
- package/row-reordering/utils.d.ts +78 -0
- package/schematics/ngAdd/index.js +2 -2
- package/selection/selectall-checkbox.directive.d.ts +12 -1
- package/selection/selection-checkbox.directive.d.ts +11 -44
- package/selection/selection-default.d.ts +1 -0
- package/selection/selection.directive.d.ts +1 -1
|
@@ -6,35 +6,24 @@ import { TemplateRef } from '@angular/core';
|
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
/**
|
|
8
8
|
* Represents the content template of the
|
|
9
|
-
* [
|
|
9
|
+
* [`ColumnMenuItemComponent`]({% slug api_grid_columnmenuitemcomponent %}) component.
|
|
10
10
|
* Provides an option for specifying the content of a column item.
|
|
11
11
|
* To define the content template, nest an `<ng-template>` tag with the
|
|
12
12
|
* `kendoGridColumnMenuItemContentTemplate` directive inside a `<kendo-grid-columnmenu-item>`.
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* </ng-template>
|
|
28
|
-
* <kendo-grid-column field="Field1"></kendo-grid-column>
|
|
29
|
-
* <kendo-grid-column field="Field2"></kendo-grid-column>
|
|
30
|
-
* </kendo-grid>
|
|
31
|
-
* `
|
|
32
|
-
* })
|
|
33
|
-
*
|
|
34
|
-
* class AppComponent {
|
|
35
|
-
* public data: any[] = [{ Field1: 'Foo', Field2: 'Bar' }];
|
|
36
|
-
* }
|
|
37
|
-
*
|
|
15
|
+
* ```html
|
|
16
|
+
* <kendo-grid [data]="data" [columnMenu]="true" ...>
|
|
17
|
+
* <ng-template kendoGridColumnMenuTemplate>
|
|
18
|
+
* <kendo-grid-columnmenu-item text="Item Text" [expanded]="true">
|
|
19
|
+
* <ng-template kendoGridColumnMenuItemContentTemplate>
|
|
20
|
+
* Item Content
|
|
21
|
+
* </ng-template>
|
|
22
|
+
* </kendo-grid-columnmenu-item>
|
|
23
|
+
* </ng-template>
|
|
24
|
+
* <kendo-grid-column field="Field1"></kendo-grid-column>
|
|
25
|
+
* ...
|
|
26
|
+
* </kendo-grid>
|
|
38
27
|
* ```
|
|
39
28
|
*/
|
|
40
29
|
export declare class ColumnMenuItemContentTemplateDirective {
|
|
@@ -8,40 +8,26 @@ import * as i0 from "@angular/core";
|
|
|
8
8
|
* Represents the template for the column menu in the Grid. Provides an option for
|
|
9
9
|
* customizing the content of the column menu for all or for specific columns.
|
|
10
10
|
* To define the content template, nest an `<ng-template>` tag with the
|
|
11
|
-
* `kendoGridColumnMenuTemplate` directive inside the
|
|
11
|
+
* `kendoGridColumnMenuTemplate` directive inside the `<kendo-grid>` or the `<kendo-grid-column>` component.
|
|
12
12
|
*
|
|
13
13
|
* The template context is passes through the following fields:
|
|
14
14
|
* - `service`—Represents the [ColumnMenuService]({% slug api_grid_columnmenuservice %}).
|
|
15
15
|
* - `column`—Represents the Grid column.
|
|
16
16
|
*
|
|
17
17
|
* @example
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* </kendo-grid-columnmenu-lock>
|
|
32
|
-
* <kendo-grid-columnmenu-sort [service]="service">
|
|
33
|
-
* </kendo-grid-columnmenu-sort>
|
|
34
|
-
* </ng-template>
|
|
35
|
-
* </kendo-grid-column>
|
|
36
|
-
* <kendo-grid-column field="Field2" [width]="100"></kendo-grid-column>
|
|
37
|
-
* </kendo-grid>
|
|
38
|
-
* `
|
|
39
|
-
* })
|
|
40
|
-
*
|
|
41
|
-
* class AppComponent {
|
|
42
|
-
* public data: any[] = [{ Field1: 'Foo', Field2: 'Bar' }, { Field1: 'Foo1', Field2: 'Bar1' }];
|
|
43
|
-
* }
|
|
44
|
-
*
|
|
18
|
+
* ```html
|
|
19
|
+
* <kendo-grid [kendoGridBinding]="data" [sortable]="true" [columnMenu]="true">
|
|
20
|
+
* <ng-template kendoGridColumnMenuTemplate let-service="service">
|
|
21
|
+
* <kendo-grid-columnmenu-sort [service]="service"></kendo-grid-columnmenu-sort>
|
|
22
|
+
* </ng-template>
|
|
23
|
+
* <kendo-grid-column field="Field1">
|
|
24
|
+
* <ng-template kendoGridColumnMenuTemplate let-service="service">
|
|
25
|
+
* <kendo-grid-columnmenu-lock [service]="service"></kendo-grid-columnmenu-lock>
|
|
26
|
+
* <kendo-grid-columnmenu-sort [service]="service"></kendo-grid-columnmenu-sort>
|
|
27
|
+
* </ng-template>
|
|
28
|
+
* </kendo-grid-column>
|
|
29
|
+
* <kendo-grid-column field="Field2"></kendo-grid-column>
|
|
30
|
+
* </kendo-grid>
|
|
45
31
|
* ```
|
|
46
32
|
*/
|
|
47
33
|
export declare class ColumnMenuTemplateDirective {
|
package/columns/column-base.d.ts
CHANGED
|
@@ -16,6 +16,10 @@ export declare const isSpanColumn: (column: any) => any;
|
|
|
16
16
|
* @hidden
|
|
17
17
|
*/
|
|
18
18
|
export declare const isCheckboxColumn: (column: any) => any;
|
|
19
|
+
/**
|
|
20
|
+
* @hidden
|
|
21
|
+
*/
|
|
22
|
+
export declare const isRowReorderColumn: (column: any) => any;
|
|
19
23
|
/**
|
|
20
24
|
* The base class for the column components of the Grid.
|
|
21
25
|
*/
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { ColumnBase } from './column-base';
|
|
6
|
+
import { IdService } from '../common/id.service';
|
|
7
|
+
import { SVGIcon } from '@progress/kendo-svg-icons';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
/**
|
|
10
|
+
* Represents the drag handle for reordering rows in the Grid.
|
|
11
|
+
*/
|
|
12
|
+
export declare class RowReorderColumnComponent extends ColumnBase {
|
|
13
|
+
parent?: ColumnBase;
|
|
14
|
+
/**
|
|
15
|
+
* Defines the name for an existing font icon in the Kendo UI theme.
|
|
16
|
+
* @hidden
|
|
17
|
+
*/
|
|
18
|
+
dragHandleIcon: string;
|
|
19
|
+
/**
|
|
20
|
+
* Defines an SVGIcon to be rendered as a drag handle.
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
dragHandleSVGIcon: SVGIcon;
|
|
24
|
+
/**
|
|
25
|
+
* @hidden
|
|
26
|
+
*/
|
|
27
|
+
readonly isRowReorderColumn: boolean;
|
|
28
|
+
constructor(parent?: ColumnBase, idService?: IdService);
|
|
29
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RowReorderColumnComponent, [{ optional: true; host: true; skipSelf: true; }, { optional: true; }]>;
|
|
30
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RowReorderColumnComponent, "kendo-grid-rowreorder-column", never, { "dragHandleIcon": "dragHandleIcon"; "dragHandleSVGIcon": "dragHandleSVGIcon"; }, {}, never, never>;
|
|
31
|
+
}
|
|
@@ -8,18 +8,27 @@ import { GridComponent } from './grid.component';
|
|
|
8
8
|
import { DataStateChangeEvent } from './data/change-event-args.interface';
|
|
9
9
|
import { GridDataResult } from './data/data.collection';
|
|
10
10
|
import { LocalDataChangesService } from './editing/local-data-changes.service';
|
|
11
|
+
import { RowReorderEvent } from './row-reordering/types';
|
|
12
|
+
import { RowReorderService } from './row-reordering/row-reorder.service';
|
|
11
13
|
import * as i0 from "@angular/core";
|
|
12
14
|
/**
|
|
13
15
|
* A directive which encapsulates the in-memory handling of data operations such as [paging]({% slug paging_grid %}),
|
|
14
16
|
* [sorting]({% slug sorting_grid %}), and [grouping]({% slug grouping_grid %})
|
|
15
17
|
* ([more information and examples]({% slug local_data_grid %}#toc-using-the-data-binding-directive)).
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```html
|
|
21
|
+
* <kendo-grid [kendoGridBinding]="gridData" ...></kendo-grid>
|
|
22
|
+
* ```
|
|
16
23
|
*/
|
|
17
24
|
export declare class DataBindingDirective implements OnInit, OnDestroy, DoCheck, OnChanges {
|
|
18
25
|
protected grid: GridComponent;
|
|
19
26
|
protected changeDetector?: ChangeDetectorRef;
|
|
20
27
|
protected localDataChangesService?: LocalDataChangesService;
|
|
28
|
+
private rowReorderService?;
|
|
21
29
|
/**
|
|
22
30
|
* Defines the number of records that will be skipped by the pager.
|
|
31
|
+
* @default 0
|
|
23
32
|
*/
|
|
24
33
|
set skip(value: number);
|
|
25
34
|
/**
|
|
@@ -47,7 +56,8 @@ export declare class DataBindingDirective implements OnInit, OnDestroy, DoCheck,
|
|
|
47
56
|
protected dataChanged: boolean;
|
|
48
57
|
private stateChangeSubscription;
|
|
49
58
|
private dataChangedSubscription;
|
|
50
|
-
|
|
59
|
+
private rowReorderSubscription;
|
|
60
|
+
constructor(grid: GridComponent, changeDetector?: ChangeDetectorRef, localDataChangesService?: LocalDataChangesService, rowReorderService?: RowReorderService);
|
|
51
61
|
/**
|
|
52
62
|
* @hidden
|
|
53
63
|
*/
|
|
@@ -67,6 +77,10 @@ export declare class DataBindingDirective implements OnInit, OnDestroy, DoCheck,
|
|
|
67
77
|
* @hidden
|
|
68
78
|
*/
|
|
69
79
|
onStateChange(state: DataStateChangeEvent): void;
|
|
80
|
+
/**
|
|
81
|
+
* @hidden
|
|
82
|
+
*/
|
|
83
|
+
onRowReorder(ev: RowReorderEvent): void;
|
|
70
84
|
/**
|
|
71
85
|
* @hidden
|
|
72
86
|
*/
|
|
@@ -10,28 +10,16 @@ import { CellContext } from '../rendering/common/cell-context';
|
|
|
10
10
|
import * as i0 from "@angular/core";
|
|
11
11
|
/**
|
|
12
12
|
* Represents the `cancel` command of the Grid. You can apply this directive to any `button`
|
|
13
|
-
* element inside a [CommandColumnComponent]({% slug api_grid_commandcolumncomponent %})
|
|
13
|
+
* element inside a [CommandColumnComponent]({% slug api_grid_commandcolumncomponent %})
|
|
14
|
+
* ([see example](slug:editing_directives_grid#toc-command-column-directives)).
|
|
14
15
|
* When an associated button with the directive is clicked, the
|
|
15
16
|
* [cancel]({% slug api_grid_gridcomponent %}#toc-cancel) event
|
|
16
|
-
* is triggered
|
|
17
|
-
*
|
|
18
|
-
* > When the row is not in the edit mode, the button with the `kendoGridCancelCommand` is automatically hidden.
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```html-no-run
|
|
22
|
-
* <kendo-grid>
|
|
23
|
-
* <kendo-grid-command-column title="command">
|
|
24
|
-
* <ng-template kendoGridCellTemplate>
|
|
25
|
-
* <button kendoGridCancelCommand>Cancel changes</button>
|
|
26
|
-
* </ng-template>
|
|
27
|
-
* </kendo-grid-command-column>
|
|
28
|
-
* </kendo-grid>
|
|
29
|
-
* ```
|
|
17
|
+
* is triggered. When the row is not in the edit mode, the button with the `kendoGridCancelCommand` is automatically hidden.
|
|
30
18
|
*
|
|
31
19
|
* You can control the content of the button based on the state of the row.
|
|
32
20
|
*
|
|
33
21
|
* @example
|
|
34
|
-
* ```html
|
|
22
|
+
* ```html
|
|
35
23
|
* <kendo-grid>
|
|
36
24
|
* <kendo-grid-command-column title="command">
|
|
37
25
|
* <ng-template kendoGridCellTemplate let-isNew="isNew">
|
|
@@ -5,13 +5,12 @@
|
|
|
5
5
|
import { TemplateRef } from '@angular/core';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
/**
|
|
8
|
-
* Represents the column edit-cell template of the Grid ([see example](
|
|
8
|
+
* Represents the column edit-cell template of the Grid ([see example](slug:custom_reactive_editing_grid#toc-setting-up-custom-inputs)).
|
|
9
9
|
* Helps to customize the content of the edited cells. To define the cell template, nest an `<ng-template>`
|
|
10
10
|
* tag with the `kendoGridEditTemplate` directive inside a `<kendo-grid-column>` tag.
|
|
11
11
|
*
|
|
12
12
|
* The template context is set to the current form group and the following additional fields are passed:
|
|
13
|
-
* - `formGroup`—The current [FormGroup](link:site.data.urls.angular['formgroupapi']).
|
|
14
|
-
* Represents the default context that will be assigned to any template variable which utilizes the `let-x` syntax—for example, `let-formGroup`.
|
|
13
|
+
* - `formGroup`—The current [FormGroup](link:site.data.urls.angular['formgroupapi']). Represents the default context that will be assigned to any template variable which utilizes the `let-x` syntax—for example, `let-formGroup`.
|
|
15
14
|
* If you use the Grid inside [Template-Driven Forms](link:site.data.urls.angular['forms']), it will be `undefined`.
|
|
16
15
|
* - `rowIndex`—The current data row index. If inside a new item row, `rowIndex` is `-1`. Use it as an alias for a template variable by utilizing the `let-rowIndex="rowIndex"` syntax.
|
|
17
16
|
* - `dataItem`—The current data item. Use it as an alias for a template variable by utilizing the `let-dataItem="dataItem"` syntax.
|
|
@@ -10,15 +10,15 @@ import { CellContext } from '../rendering/common/cell-context';
|
|
|
10
10
|
import * as i0 from "@angular/core";
|
|
11
11
|
/**
|
|
12
12
|
* Represents the `remove` command of the Grid. You can apply this directive to any `button` element
|
|
13
|
-
* inside a [CommandColumnComponent]({% slug api_grid_commandcolumncomponent %})
|
|
13
|
+
* inside a [CommandColumnComponent]({% slug api_grid_commandcolumncomponent %})
|
|
14
|
+
* ([see example](slug:editing_directives_grid#toc-command-column-directives)).
|
|
14
15
|
* When an associated button with the directive is clicked, the
|
|
15
|
-
* [remove
|
|
16
|
-
* is triggered
|
|
17
|
-
*
|
|
18
|
-
* > When the row is in the edit mode, the button with the `kendoGridRemoveCommand` is automatically hidden.
|
|
16
|
+
* [remove]({% slug api_grid_gridcomponent %}#toc-remove) event
|
|
17
|
+
* is triggered.
|
|
18
|
+
* When the row is in the edit mode, the button with the `kendoGridRemoveCommand` is automatically hidden.
|
|
19
19
|
*
|
|
20
20
|
* @example
|
|
21
|
-
* ```html
|
|
21
|
+
* ```html
|
|
22
22
|
* <kendo-grid>
|
|
23
23
|
* <kendo-grid-command-column title="command">
|
|
24
24
|
* <ng-template kendoGridCellTemplate>
|
|
@@ -10,23 +10,11 @@ import { CellContext } from '../rendering/common/cell-context';
|
|
|
10
10
|
import * as i0 from "@angular/core";
|
|
11
11
|
/**
|
|
12
12
|
* Represents the `save` command of the Grid. You can apply this directive to any `button`
|
|
13
|
-
* element inside a [CommandColumnComponent]({% slug api_grid_commandcolumncomponent %})
|
|
13
|
+
* element inside a [CommandColumnComponent]({% slug api_grid_commandcolumncomponent %})
|
|
14
|
+
* ([see example](slug:editing_directives_grid#toc-command-column-directives)).
|
|
14
15
|
* When an associated button with the directive is clicked, the
|
|
15
16
|
* [save]({% slug api_grid_gridcomponent %}#toc-save) event
|
|
16
|
-
* is triggered
|
|
17
|
-
*
|
|
18
|
-
* > When the row is not in the edit mode, the button with `kendoGridSaveCommand` is automatically hidden.
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```html-no-run
|
|
22
|
-
* <kendo-grid>
|
|
23
|
-
* <kendo-grid-command-column title="command">
|
|
24
|
-
* <ng-template kendoGridCellTemplate>
|
|
25
|
-
* <button kendoGridSaveCommand>Save changes</button>
|
|
26
|
-
* </ng-template>
|
|
27
|
-
* </kendo-grid-command-column>
|
|
28
|
-
* </kendo-grid>
|
|
29
|
-
* ```
|
|
17
|
+
* is triggered. When the row is not in the edit mode, the button with `kendoGridSaveCommand` is automatically hidden.
|
|
30
18
|
*
|
|
31
19
|
* You can control the content of the button based on the state of the row.
|
|
32
20
|
*
|
|
@@ -10,7 +10,7 @@ import { CreateFormGroup } from '../common/create-form-group';
|
|
|
10
10
|
import * as i0 from "@angular/core";
|
|
11
11
|
/**
|
|
12
12
|
* A directive which encapsulates the editing operations of the Grid when using the in-cell
|
|
13
|
-
* editing with Reactive Forms ([see example]({% slug editing_directives_grid %}#toc-
|
|
13
|
+
* editing with Reactive Forms ([see example]({% slug editing_directives_grid %}#toc-in-cell-editing)).
|
|
14
14
|
*/
|
|
15
15
|
export declare class InCellEditingDirective extends EditingDirectiveBase {
|
|
16
16
|
protected grid: GridComponent;
|
|
@@ -8,7 +8,7 @@ import { LocalDataChangesService } from '../editing/local-data-changes.service';
|
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
/**
|
|
10
10
|
* A directive which encapsulates the editing operations of the Grid when using
|
|
11
|
-
* the Template-Driven Angular Forms ([see example]({% slug editing_directives_grid %}#toc-
|
|
11
|
+
* the Template-Driven Angular Forms ([see example]({% slug editing_directives_grid %}#toc-template-editing-directive)).
|
|
12
12
|
*/
|
|
13
13
|
export declare class TemplateEditingDirective extends RowEditingDirectiveBase {
|
|
14
14
|
protected grid: GridComponent;
|
|
@@ -6,35 +6,24 @@ import { Directive, Optional, TemplateRef } from '@angular/core';
|
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
/**
|
|
8
8
|
* Represents the content template of the
|
|
9
|
-
* [
|
|
9
|
+
* [`ColumnMenuItemComponent`]({% slug api_grid_columnmenuitemcomponent %}) component.
|
|
10
10
|
* Provides an option for specifying the content of a column item.
|
|
11
11
|
* To define the content template, nest an `<ng-template>` tag with the
|
|
12
12
|
* `kendoGridColumnMenuItemContentTemplate` directive inside a `<kendo-grid-columnmenu-item>`.
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* </ng-template>
|
|
28
|
-
* <kendo-grid-column field="Field1"></kendo-grid-column>
|
|
29
|
-
* <kendo-grid-column field="Field2"></kendo-grid-column>
|
|
30
|
-
* </kendo-grid>
|
|
31
|
-
* `
|
|
32
|
-
* })
|
|
33
|
-
*
|
|
34
|
-
* class AppComponent {
|
|
35
|
-
* public data: any[] = [{ Field1: 'Foo', Field2: 'Bar' }];
|
|
36
|
-
* }
|
|
37
|
-
*
|
|
15
|
+
* ```html
|
|
16
|
+
* <kendo-grid [data]="data" [columnMenu]="true" ...>
|
|
17
|
+
* <ng-template kendoGridColumnMenuTemplate>
|
|
18
|
+
* <kendo-grid-columnmenu-item text="Item Text" [expanded]="true">
|
|
19
|
+
* <ng-template kendoGridColumnMenuItemContentTemplate>
|
|
20
|
+
* Item Content
|
|
21
|
+
* </ng-template>
|
|
22
|
+
* </kendo-grid-columnmenu-item>
|
|
23
|
+
* </ng-template>
|
|
24
|
+
* <kendo-grid-column field="Field1"></kendo-grid-column>
|
|
25
|
+
* ...
|
|
26
|
+
* </kendo-grid>
|
|
38
27
|
* ```
|
|
39
28
|
*/
|
|
40
29
|
export class ColumnMenuItemContentTemplateDirective {
|
|
@@ -8,40 +8,26 @@ import * as i0 from "@angular/core";
|
|
|
8
8
|
* Represents the template for the column menu in the Grid. Provides an option for
|
|
9
9
|
* customizing the content of the column menu for all or for specific columns.
|
|
10
10
|
* To define the content template, nest an `<ng-template>` tag with the
|
|
11
|
-
* `kendoGridColumnMenuTemplate` directive inside the
|
|
11
|
+
* `kendoGridColumnMenuTemplate` directive inside the `<kendo-grid>` or the `<kendo-grid-column>` component.
|
|
12
12
|
*
|
|
13
13
|
* The template context is passes through the following fields:
|
|
14
14
|
* - `service`—Represents the [ColumnMenuService]({% slug api_grid_columnmenuservice %}).
|
|
15
15
|
* - `column`—Represents the Grid column.
|
|
16
16
|
*
|
|
17
17
|
* @example
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* </kendo-grid-columnmenu-lock>
|
|
32
|
-
* <kendo-grid-columnmenu-sort [service]="service">
|
|
33
|
-
* </kendo-grid-columnmenu-sort>
|
|
34
|
-
* </ng-template>
|
|
35
|
-
* </kendo-grid-column>
|
|
36
|
-
* <kendo-grid-column field="Field2" [width]="100"></kendo-grid-column>
|
|
37
|
-
* </kendo-grid>
|
|
38
|
-
* `
|
|
39
|
-
* })
|
|
40
|
-
*
|
|
41
|
-
* class AppComponent {
|
|
42
|
-
* public data: any[] = [{ Field1: 'Foo', Field2: 'Bar' }, { Field1: 'Foo1', Field2: 'Bar1' }];
|
|
43
|
-
* }
|
|
44
|
-
*
|
|
18
|
+
* ```html
|
|
19
|
+
* <kendo-grid [kendoGridBinding]="data" [sortable]="true" [columnMenu]="true">
|
|
20
|
+
* <ng-template kendoGridColumnMenuTemplate let-service="service">
|
|
21
|
+
* <kendo-grid-columnmenu-sort [service]="service"></kendo-grid-columnmenu-sort>
|
|
22
|
+
* </ng-template>
|
|
23
|
+
* <kendo-grid-column field="Field1">
|
|
24
|
+
* <ng-template kendoGridColumnMenuTemplate let-service="service">
|
|
25
|
+
* <kendo-grid-columnmenu-lock [service]="service"></kendo-grid-columnmenu-lock>
|
|
26
|
+
* <kendo-grid-columnmenu-sort [service]="service"></kendo-grid-columnmenu-sort>
|
|
27
|
+
* </ng-template>
|
|
28
|
+
* </kendo-grid-column>
|
|
29
|
+
* <kendo-grid-column field="Field2"></kendo-grid-column>
|
|
30
|
+
* </kendo-grid>
|
|
45
31
|
* ```
|
|
46
32
|
*/
|
|
47
33
|
export class ColumnMenuTemplateDirective {
|
|
@@ -17,6 +17,10 @@ export const isSpanColumn = column => column.isSpanColumn;
|
|
|
17
17
|
* @hidden
|
|
18
18
|
*/
|
|
19
19
|
export const isCheckboxColumn = column => column.isCheckboxColumn;
|
|
20
|
+
/**
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
export const isRowReorderColumn = column => column.isRowReorderColumn;
|
|
20
24
|
const isColumnContainer = column => column.isColumnGroup || isSpanColumn(column);
|
|
21
25
|
/**
|
|
22
26
|
* The base class for the column components of the Grid.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 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, forwardRef, SkipSelf, Host, Optional, Input } from '@angular/core';
|
|
6
|
+
import { ColumnBase } from './column-base';
|
|
7
|
+
import { IdService } from '../common/id.service';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
import * as i1 from "./column-base";
|
|
10
|
+
import * as i2 from "../common/id.service";
|
|
11
|
+
/**
|
|
12
|
+
* Represents the drag handle for reordering rows in the Grid.
|
|
13
|
+
*/
|
|
14
|
+
export class RowReorderColumnComponent extends ColumnBase {
|
|
15
|
+
constructor(parent, idService) {
|
|
16
|
+
super(parent, idService);
|
|
17
|
+
this.parent = parent;
|
|
18
|
+
/**
|
|
19
|
+
* @hidden
|
|
20
|
+
*/
|
|
21
|
+
this.isRowReorderColumn = true;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
RowReorderColumnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: RowReorderColumnComponent, deps: [{ token: i1.ColumnBase, host: true, optional: true, skipSelf: true }, { token: i2.IdService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
25
|
+
RowReorderColumnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: RowReorderColumnComponent, selector: "kendo-grid-rowreorder-column", inputs: { dragHandleIcon: "dragHandleIcon", dragHandleSVGIcon: "dragHandleSVGIcon" }, providers: [
|
|
26
|
+
{
|
|
27
|
+
provide: ColumnBase,
|
|
28
|
+
useExisting: forwardRef(() => RowReorderColumnComponent)
|
|
29
|
+
}
|
|
30
|
+
], usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
31
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: RowReorderColumnComponent, decorators: [{
|
|
32
|
+
type: Component,
|
|
33
|
+
args: [{
|
|
34
|
+
providers: [
|
|
35
|
+
{
|
|
36
|
+
provide: ColumnBase,
|
|
37
|
+
useExisting: forwardRef(() => RowReorderColumnComponent)
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
selector: 'kendo-grid-rowreorder-column',
|
|
41
|
+
template: ``
|
|
42
|
+
}]
|
|
43
|
+
}], ctorParameters: function () { return [{ type: i1.ColumnBase, decorators: [{
|
|
44
|
+
type: SkipSelf
|
|
45
|
+
}, {
|
|
46
|
+
type: Host
|
|
47
|
+
}, {
|
|
48
|
+
type: Optional
|
|
49
|
+
}] }, { type: i2.IdService, decorators: [{
|
|
50
|
+
type: Optional
|
|
51
|
+
}] }]; }, propDecorators: { dragHandleIcon: [{
|
|
52
|
+
type: Input
|
|
53
|
+
}], dragHandleSVGIcon: [{
|
|
54
|
+
type: Input
|
|
55
|
+
}] } });
|
|
@@ -7,19 +7,27 @@ import { process } from '@progress/kendo-data-query';
|
|
|
7
7
|
import { GridComponent } from './grid.component';
|
|
8
8
|
import { anyChanged, isPresent } from './utils';
|
|
9
9
|
import { LocalDataChangesService } from './editing/local-data-changes.service';
|
|
10
|
+
import { RowReorderService } from './row-reordering/row-reorder.service';
|
|
10
11
|
import * as i0 from "@angular/core";
|
|
11
12
|
import * as i1 from "./grid.component";
|
|
12
13
|
import * as i2 from "./editing/local-data-changes.service";
|
|
14
|
+
import * as i3 from "./row-reordering/row-reorder.service";
|
|
13
15
|
/**
|
|
14
16
|
* A directive which encapsulates the in-memory handling of data operations such as [paging]({% slug paging_grid %}),
|
|
15
17
|
* [sorting]({% slug sorting_grid %}), and [grouping]({% slug grouping_grid %})
|
|
16
18
|
* ([more information and examples]({% slug local_data_grid %}#toc-using-the-data-binding-directive)).
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```html
|
|
22
|
+
* <kendo-grid [kendoGridBinding]="gridData" ...></kendo-grid>
|
|
23
|
+
* ```
|
|
17
24
|
*/
|
|
18
25
|
export class DataBindingDirective {
|
|
19
|
-
constructor(grid, changeDetector, localDataChangesService) {
|
|
26
|
+
constructor(grid, changeDetector, localDataChangesService, rowReorderService) {
|
|
20
27
|
this.grid = grid;
|
|
21
28
|
this.changeDetector = changeDetector;
|
|
22
29
|
this.localDataChangesService = localDataChangesService;
|
|
30
|
+
this.rowReorderService = rowReorderService;
|
|
23
31
|
this.state = {
|
|
24
32
|
skip: 0
|
|
25
33
|
};
|
|
@@ -30,12 +38,16 @@ export class DataBindingDirective {
|
|
|
30
38
|
}
|
|
31
39
|
/**
|
|
32
40
|
* Defines the number of records that will be skipped by the pager.
|
|
41
|
+
* @default 0
|
|
33
42
|
*/
|
|
34
43
|
set skip(value) {
|
|
35
44
|
if (!isPresent(value)) {
|
|
36
45
|
value = 0;
|
|
37
46
|
}
|
|
38
47
|
this.grid.skip = this.state.skip = value;
|
|
48
|
+
if (this.rowReorderService) {
|
|
49
|
+
this.rowReorderService.skip = value;
|
|
50
|
+
}
|
|
39
51
|
}
|
|
40
52
|
/**
|
|
41
53
|
* Defines the descriptors by which the data will be sorted.
|
|
@@ -79,6 +91,11 @@ export class DataBindingDirective {
|
|
|
79
91
|
this.stateChangeSubscription = this.grid
|
|
80
92
|
.dataStateChange
|
|
81
93
|
.subscribe(this.onStateChange.bind(this));
|
|
94
|
+
if (this.rowReorderService) {
|
|
95
|
+
this.rowReorderSubscription = this.grid
|
|
96
|
+
.rowReorder
|
|
97
|
+
.subscribe(this.onRowReorder.bind(this));
|
|
98
|
+
}
|
|
82
99
|
}
|
|
83
100
|
/**
|
|
84
101
|
* @hidden
|
|
@@ -90,6 +107,9 @@ export class DataBindingDirective {
|
|
|
90
107
|
if (this.dataChangedSubscription) {
|
|
91
108
|
this.dataChangedSubscription.unsubscribe();
|
|
92
109
|
}
|
|
110
|
+
if (this.rowReorderSubscription) {
|
|
111
|
+
this.rowReorderSubscription.unsubscribe();
|
|
112
|
+
}
|
|
93
113
|
}
|
|
94
114
|
/**
|
|
95
115
|
* @hidden
|
|
@@ -111,6 +131,13 @@ export class DataBindingDirective {
|
|
|
111
131
|
this.applyState(state);
|
|
112
132
|
this.rebind();
|
|
113
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* @hidden
|
|
136
|
+
*/
|
|
137
|
+
onRowReorder(ev) {
|
|
138
|
+
this.rowReorderService.reorderRows(ev, this.originalData);
|
|
139
|
+
this.rebind();
|
|
140
|
+
}
|
|
114
141
|
/**
|
|
115
142
|
* @hidden
|
|
116
143
|
*/
|
|
@@ -143,14 +170,14 @@ export class DataBindingDirective {
|
|
|
143
170
|
this.dataChanged = false;
|
|
144
171
|
}
|
|
145
172
|
}
|
|
146
|
-
DataBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DataBindingDirective, deps: [{ token: i1.GridComponent }, { token: i0.ChangeDetectorRef }, { token: i2.LocalDataChangesService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
173
|
+
DataBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DataBindingDirective, deps: [{ token: i1.GridComponent }, { token: i0.ChangeDetectorRef }, { token: i2.LocalDataChangesService }, { token: i3.RowReorderService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
147
174
|
DataBindingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: DataBindingDirective, selector: "[kendoGridBinding]", inputs: { skip: "skip", sort: "sort", filter: "filter", pageSize: "pageSize", group: "group", data: ["kendoGridBinding", "data"] }, usesOnChanges: true, ngImport: i0 });
|
|
148
175
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DataBindingDirective, decorators: [{
|
|
149
176
|
type: Directive,
|
|
150
177
|
args: [{
|
|
151
178
|
selector: '[kendoGridBinding]'
|
|
152
179
|
}]
|
|
153
|
-
}], ctorParameters: function () { return [{ type: i1.GridComponent }, { type: i0.ChangeDetectorRef }, { type: i2.LocalDataChangesService }]; }, propDecorators: { skip: [{
|
|
180
|
+
}], ctorParameters: function () { return [{ type: i1.GridComponent }, { type: i0.ChangeDetectorRef }, { type: i2.LocalDataChangesService }, { type: i3.RowReorderService }]; }, propDecorators: { skip: [{
|
|
154
181
|
type: Input
|
|
155
182
|
}], sort: [{
|
|
156
183
|
type: Input
|
|
@@ -14,28 +14,16 @@ import * as i3 from "@progress/kendo-angular-icons";
|
|
|
14
14
|
import * as i4 from "@angular/common";
|
|
15
15
|
/**
|
|
16
16
|
* Represents the `cancel` command of the Grid. You can apply this directive to any `button`
|
|
17
|
-
* element inside a [CommandColumnComponent]({% slug api_grid_commandcolumncomponent %})
|
|
17
|
+
* element inside a [CommandColumnComponent]({% slug api_grid_commandcolumncomponent %})
|
|
18
|
+
* ([see example](slug:editing_directives_grid#toc-command-column-directives)).
|
|
18
19
|
* When an associated button with the directive is clicked, the
|
|
19
20
|
* [cancel]({% slug api_grid_gridcomponent %}#toc-cancel) event
|
|
20
|
-
* is triggered
|
|
21
|
-
*
|
|
22
|
-
* > When the row is not in the edit mode, the button with the `kendoGridCancelCommand` is automatically hidden.
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```html-no-run
|
|
26
|
-
* <kendo-grid>
|
|
27
|
-
* <kendo-grid-command-column title="command">
|
|
28
|
-
* <ng-template kendoGridCellTemplate>
|
|
29
|
-
* <button kendoGridCancelCommand>Cancel changes</button>
|
|
30
|
-
* </ng-template>
|
|
31
|
-
* </kendo-grid-command-column>
|
|
32
|
-
* </kendo-grid>
|
|
33
|
-
* ```
|
|
21
|
+
* is triggered. When the row is not in the edit mode, the button with the `kendoGridCancelCommand` is automatically hidden.
|
|
34
22
|
*
|
|
35
23
|
* You can control the content of the button based on the state of the row.
|
|
36
24
|
*
|
|
37
25
|
* @example
|
|
38
|
-
* ```html
|
|
26
|
+
* ```html
|
|
39
27
|
* <kendo-grid>
|
|
40
28
|
* <kendo-grid-command-column title="command">
|
|
41
29
|
* <ng-template kendoGridCellTemplate let-isNew="isNew">
|