@progress/kendo-angular-grid 12.0.0-develop.8 → 12.0.0

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.
Files changed (111) hide show
  1. package/column-menu/column-menu-item-content-template.directive.d.ts +13 -24
  2. package/column-menu/column-menu-template.directive.d.ts +14 -28
  3. package/column-menu/column-menu.service.d.ts +9 -21
  4. package/columns/column-base.d.ts +18 -369
  5. package/columns/reorder-column.component.d.ts +31 -0
  6. package/columns/sort-settings.d.ts +20 -4
  7. package/common/fetch-data-callback.d.ts +1 -1
  8. package/common/preventable-event.d.ts +1 -1
  9. package/common/single-popup.service.d.ts +1 -1
  10. package/common/size-options.d.ts +1 -2
  11. package/data/grid-item.interface.d.ts +6 -3
  12. package/databinding.directive.d.ts +15 -1
  13. package/editing/add-command.directive.d.ts +1 -1
  14. package/editing/cancel-command.directive.d.ts +4 -16
  15. package/editing/edit-template.directive.d.ts +2 -3
  16. package/editing/remove-command.directive.d.ts +6 -6
  17. package/editing/save-command.directive.d.ts +3 -15
  18. package/editing-directives/in-cell-editing.directive.d.ts +1 -1
  19. package/editing-directives/template-editing.directive.d.ts +1 -1
  20. package/esm2020/column-menu/column-menu-item-content-template.directive.mjs +13 -24
  21. package/esm2020/column-menu/column-menu-template.directive.mjs +14 -28
  22. package/esm2020/column-menu/column-menu.service.mjs +9 -21
  23. package/esm2020/columns/column-base.mjs +10 -40
  24. package/esm2020/columns/reorder-column.component.mjs +55 -0
  25. package/esm2020/common/preventable-event.mjs +1 -1
  26. package/esm2020/common/single-popup.service.mjs +1 -1
  27. package/esm2020/databinding.directive.mjs +30 -3
  28. package/esm2020/editing/add-command.directive.mjs +1 -1
  29. package/esm2020/editing/cancel-command.directive.mjs +4 -16
  30. package/esm2020/editing/edit-template.directive.mjs +2 -3
  31. package/esm2020/editing/remove-command.directive.mjs +6 -6
  32. package/esm2020/editing/save-command.directive.mjs +3 -15
  33. package/esm2020/editing-directives/in-cell-editing.directive.mjs +1 -1
  34. package/esm2020/editing-directives/template-editing.directive.mjs +1 -1
  35. package/esm2020/excel/excel-command.directive.mjs +2 -2
  36. package/esm2020/excel/excel.module.mjs +5 -15
  37. package/esm2020/grid.component.mjs +195 -38
  38. package/esm2020/grid.module.mjs +76 -81
  39. package/esm2020/grouping/group-footer-template.directive.mjs +9 -35
  40. package/esm2020/grouping/group-header-column-template.directive.mjs +2 -2
  41. package/esm2020/grouping/group-header-template.directive.mjs +9 -37
  42. package/esm2020/index.mjs +1 -0
  43. package/esm2020/layout/sizing-options.service.mjs +3 -0
  44. package/esm2020/localization/messages.mjs +3 -1
  45. package/esm2020/navigation/focusable.directive.mjs +10 -41
  46. package/esm2020/package-metadata.mjs +2 -2
  47. package/esm2020/pager/pager-template.directive.mjs +13 -46
  48. package/esm2020/pdf/pdf-template.directive.mjs +10 -38
  49. package/esm2020/pdf/pdf.module.mjs +7 -16
  50. package/esm2020/rendering/body.module.mjs +9 -4
  51. package/esm2020/rendering/cell-loading.template.directive.mjs +11 -8
  52. package/esm2020/rendering/cell-template.directive.mjs +11 -35
  53. package/esm2020/rendering/cell.component.mjs +43 -10
  54. package/esm2020/rendering/details/detail-template.directive.mjs +10 -58
  55. package/esm2020/rendering/details-expand.directive.mjs +1 -1
  56. package/esm2020/rendering/footer/footer-template.directive.mjs +8 -35
  57. package/esm2020/rendering/header/header-template.directive.mjs +9 -36
  58. package/esm2020/rendering/loading-template.directive.mjs +1 -1
  59. package/esm2020/rendering/no-records-template.directive.mjs +11 -58
  60. package/esm2020/rendering/toolbar/toolbar-position.mjs +17 -0
  61. package/esm2020/rendering/toolbar/toolbar-template.directive.mjs +10 -56
  62. package/esm2020/row-reordering/row-reorder.service.mjs +233 -0
  63. package/esm2020/row-reordering/types.mjs +5 -0
  64. package/esm2020/row-reordering/utils.mjs +87 -0
  65. package/esm2020/selection/selectall-checkbox.directive.mjs +12 -1
  66. package/esm2020/selection/selection-checkbox.directive.mjs +11 -44
  67. package/esm2020/selection/selection-default.mjs +1 -0
  68. package/esm2020/selection/selection.directive.mjs +1 -1
  69. package/excel/excel-command.directive.d.ts +2 -2
  70. package/excel/excel.module.d.ts +5 -15
  71. package/fesm2015/progress-kendo-angular-grid.mjs +869 -792
  72. package/fesm2020/progress-kendo-angular-grid.mjs +869 -796
  73. package/filtering/filterable.d.ts +10 -0
  74. package/grid.component.d.ts +46 -4
  75. package/grid.module.d.ts +93 -101
  76. package/grouping/group-footer-template.directive.d.ts +9 -35
  77. package/grouping/group-header-column-template.directive.d.ts +2 -2
  78. package/grouping/group-header-template.directive.d.ts +9 -37
  79. package/index.d.ts +2 -0
  80. package/layout/sizing-options.service.d.ts +3 -0
  81. package/localization/messages.d.ts +5 -1
  82. package/navigation/focusable.directive.d.ts +10 -41
  83. package/navigation/navigable-settings.d.ts +15 -1
  84. package/package.json +15 -14
  85. package/pager/pager-settings.d.ts +8 -12
  86. package/pager/pager-template.directive.d.ts +13 -46
  87. package/pdf/pdf-template.directive.d.ts +10 -38
  88. package/pdf/pdf.module.d.ts +7 -16
  89. package/rendering/body.module.d.ts +9 -8
  90. package/rendering/cell-loading.template.directive.d.ts +11 -8
  91. package/rendering/cell-template.directive.d.ts +11 -35
  92. package/rendering/cell.component.d.ts +5 -0
  93. package/rendering/common/row-class.d.ts +4 -4
  94. package/rendering/details/detail-template.directive.d.ts +10 -58
  95. package/rendering/details-expand.directive.d.ts +1 -1
  96. package/rendering/footer/footer-template.directive.d.ts +8 -35
  97. package/rendering/header/header-template.directive.d.ts +9 -36
  98. package/rendering/loading-template.directive.d.ts +1 -1
  99. package/rendering/no-records-template.directive.d.ts +11 -58
  100. package/rendering/toolbar/toolbar-position.d.ts +18 -1
  101. package/rendering/toolbar/toolbar-template.directive.d.ts +10 -56
  102. package/row-reordering/row-reorder.service.d.ts +57 -0
  103. package/row-reordering/types.d.ts +40 -0
  104. package/row-reordering/utils.d.ts +78 -0
  105. package/schematics/ngAdd/index.js +2 -2
  106. package/scrolling/scrollmode.d.ts +4 -4
  107. package/selection/selectall-checkbox.directive.d.ts +12 -1
  108. package/selection/selection-checkbox.directive.d.ts +11 -44
  109. package/selection/selection-default.d.ts +1 -0
  110. package/selection/selection.directive.d.ts +1 -1
  111. package/selection/types.d.ts +24 -2
@@ -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
@@ -19,7 +19,7 @@ import * as i4 from "@angular/common";
19
19
  * ([see example]({% slug basics_editing_grid %})).
20
20
  *
21
21
  * @example
22
- * ```html-no-run
22
+ * ```html
23
23
  * <kendo-grid>
24
24
  * <ng-template kendoGridToolbarTemplate>
25
25
  * <button kendoGridAddCommand>Add new</button>
@@ -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 ([see example]({% slug basics_editing_grid %})).
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-no-run
26
+ * ```html
39
27
  * <kendo-grid>
40
28
  * <kendo-grid-command-column title="command">
41
29
  * <ng-template kendoGridCellTemplate let-isNew="isNew">
@@ -5,13 +5,12 @@
5
5
  import { Directive, TemplateRef, Optional } 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]({% slug inline_editing_grid %}#toc-using-reactive-forms)).
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`&mdash;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&mdash;for example, `let-formGroup`.
13
+ * - `formGroup`&mdash;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&mdash;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`&mdash;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`&mdash;The current data item. Use it as an alias for a template variable by utilizing the `let-dataItem="dataItem"` syntax.
@@ -14,15 +14,15 @@ import * as i3 from "@progress/kendo-angular-icons";
14
14
  import * as i4 from "@angular/common";
15
15
  /**
16
16
  * Represents the `remove` command of the Grid. You can apply this directive to any `button` element
17
- * inside a [CommandColumnComponent]({% slug api_grid_commandcolumncomponent %}).
17
+ * 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
- * [remove event]({% slug api_grid_gridcomponent %}#toc-remove)
20
- * is triggered ([see example]({% slug inline_editing_grid %}#toc-using-reactive-forms))).
21
- *
22
- * > When the row is in the edit mode, the button with the `kendoGridRemoveCommand` is automatically hidden.
20
+ * [remove]({% slug api_grid_gridcomponent %}#toc-remove) event
21
+ * is triggered.
22
+ * When the row is in the edit mode, the button with the `kendoGridRemoveCommand` is automatically hidden.
23
23
  *
24
24
  * @example
25
- * ```html-no-run
25
+ * ```html
26
26
  * <kendo-grid>
27
27
  * <kendo-grid-command-column title="command">
28
28
  * <ng-template kendoGridCellTemplate>
@@ -14,23 +14,11 @@ import * as i3 from "@progress/kendo-angular-icons";
14
14
  import * as i4 from "@angular/common";
15
15
  /**
16
16
  * Represents the `save` 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
  * [save]({% slug api_grid_gridcomponent %}#toc-save) event
20
- * is triggered ([see example]({% slug basics_editing_grid %})).
21
- *
22
- * > When the row is not in the edit mode, the button with `kendoGridSaveCommand` 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 kendoGridSaveCommand>Save 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 `kendoGridSaveCommand` is automatically hidden.
34
22
  *
35
23
  * You can control the content of the button based on the state of the row.
36
24
  *
@@ -13,7 +13,7 @@ import * as i1 from "../grid.component";
13
13
  import * as i2 from "../editing/local-data-changes.service";
14
14
  /**
15
15
  * A directive which encapsulates the editing operations of the Grid when using the in-cell
16
- * editing with Reactive Forms ([see example]({% slug editing_directives_grid %}#toc-the-incell-directive)).
16
+ * editing with Reactive Forms ([see example]({% slug editing_directives_grid %}#toc-in-cell-editing)).
17
17
  */
18
18
  export class InCellEditingDirective extends EditingDirectiveBase {
19
19
  constructor(grid, localDataChangesService, cdr) {
@@ -11,7 +11,7 @@ import * as i1 from "../grid.component";
11
11
  import * as i2 from "../editing/local-data-changes.service";
12
12
  /**
13
13
  * A directive which encapsulates the editing operations of the Grid when using
14
- * the Template-Driven Angular Forms ([see example]({% slug editing_directives_grid %}#toc-the-template-directive)).
14
+ * the Template-Driven Angular Forms ([see example]({% slug editing_directives_grid %}#toc-template-editing-directive)).
15
15
  */
16
16
  export class TemplateEditingDirective extends RowEditingDirectiveBase {
17
17
  constructor(grid, localDataChangesService) {
@@ -14,13 +14,13 @@ import * as i4 from "@angular/common";
14
14
  /**
15
15
  * Represents the `export-to-Excel` command of the Grid. You can apply this
16
16
  * directive to any `button` element inside a
17
- * [ToolbarTemplate]({% slug api_grid_commandcolumncomponent %}).
17
+ * [ToolbarTemplate]({% slug api_grid_toolbartemplatedirective %}).
18
18
  * When the user clicks a button associated with the directive, the
19
19
  * [excelExport]({% slug api_grid_gridcomponent %}#toc-excelexport) event
20
20
  * fires ([see example]({% slug excelexport_grid %})).
21
21
  *
22
22
  * @example
23
- * ```html-no-run
23
+ * ```html
24
24
  * <kendo-grid>
25
25
  * <ng-template kendoGridToolbarTemplate>
26
26
  * <button kendoGridExcelCommand>Export to PDF</button>
@@ -15,29 +15,19 @@ const declarations = [ExcelComponent, ExcelCommandDirective];
15
15
  *
16
16
  * @example
17
17
  *
18
- * ```ts-no-run
19
- * // Import the Grid and Excel modules
20
- * import { GridModule, ExcelModule } from '@progress/kendo-angular-grid';
21
- *
22
- * // The browser platform with a compiler
23
- * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
24
- *
18
+ * ```ts
25
19
  * import { NgModule } from '@angular/core';
26
- *
27
- * // Import the app component
20
+ * import { BrowserModule } from "@angular/platform-browser";
21
+ * import { GridModule, ExcelModule } from '@progress/kendo-angular-grid';
28
22
  * import { AppComponent } from './app.component';
29
23
  *
30
- * // Define the app module
31
24
  * _@NgModule({
32
- * declarations: [AppComponent], // declare app component
33
- * imports: [BrowserModule, GridModule, ExcelModule], // import Grid and Excel modules
25
+ * declarations: [AppComponent],
26
+ * imports: [BrowserModule, GridModule, ExcelModule],
34
27
  * bootstrap: [AppComponent]
35
28
  * })
36
29
  * export class AppModule {}
37
30
  *
38
- * // Compile and launch the module
39
- * platformBrowserDynamic().bootstrapModule(AppModule);
40
- *
41
31
  * ```
42
32
  */
43
33
  export class ExcelModule {