@progress/kendo-angular-treelist 13.0.0-develop.1 → 13.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.
Files changed (185) hide show
  1. package/binding-directives/base-binding.directive.d.ts +5 -1
  2. package/binding-directives/data-bound-tree-component.d.ts +9 -0
  3. package/binding-directives/flat-binding.directive.d.ts +14 -3
  4. package/binding-directives/hierarchy-binding.directive.d.ts +12 -3
  5. package/column-menu/column-chooser.component.d.ts +10 -6
  6. package/column-menu/column-menu-chooser.component.d.ts +6 -10
  7. package/column-menu/column-menu-filter.component.d.ts +6 -10
  8. package/column-menu/column-menu-item-content-template.directive.d.ts +1 -1
  9. package/column-menu/column-menu-item.component.d.ts +8 -6
  10. package/column-menu/column-menu-lock.component.d.ts +5 -11
  11. package/column-menu/column-menu-settings.interface.d.ts +7 -10
  12. package/column-menu/column-menu-sort.component.d.ts +5 -11
  13. package/column-menu/column-menu.component.d.ts +1 -1
  14. package/column-menu/column-menu.service.d.ts +1 -1
  15. package/column-resizing/column-resize.interface.d.ts +1 -1
  16. package/columns/checkbox-column.component.d.ts +1 -1
  17. package/columns/column-base.d.ts +4 -0
  18. package/columns/column-group.component.d.ts +9 -6
  19. package/columns/column.component.d.ts +16 -66
  20. package/columns/command-column.component.d.ts +13 -15
  21. package/columns/rowreorder-column.component.d.ts +19 -0
  22. package/columns/span-column.component.d.ts +10 -81
  23. package/data/change-event-args.interface.d.ts +2 -2
  24. package/data/data.collection.d.ts +6 -0
  25. package/dragdrop/column-reorder-config.d.ts +1 -1
  26. package/editing/add-command.directive.d.ts +1 -1
  27. package/editing/cancel-command.directive.d.ts +1 -1
  28. package/editing/edit-command.directive.d.ts +1 -1
  29. package/editing/edit-event-args.interface.d.ts +1 -1
  30. package/editing/edit-template.directive.d.ts +11 -0
  31. package/editing/remove-command.directive.d.ts +1 -1
  32. package/editing/remove-event-args.interface.d.ts +1 -1
  33. package/editing/save-command.directive.d.ts +1 -1
  34. package/editing/save-event-args.interface.d.ts +1 -1
  35. package/esm2020/binding-directives/base-binding.directive.mjs +9 -3
  36. package/esm2020/binding-directives/flat-binding.directive.mjs +56 -6
  37. package/esm2020/binding-directives/hierarchy-binding.directive.mjs +46 -6
  38. package/esm2020/column-menu/column-chooser.component.mjs +10 -6
  39. package/esm2020/column-menu/column-menu-chooser.component.mjs +8 -12
  40. package/esm2020/column-menu/column-menu-filter.component.mjs +6 -10
  41. package/esm2020/column-menu/column-menu-item-content-template.directive.mjs +1 -1
  42. package/esm2020/column-menu/column-menu-item.component.mjs +9 -7
  43. package/esm2020/column-menu/column-menu-lock.component.mjs +5 -11
  44. package/esm2020/column-menu/column-menu-sort.component.mjs +5 -11
  45. package/esm2020/column-menu/column-menu.component.mjs +2 -2
  46. package/esm2020/column-menu/column-menu.service.mjs +1 -1
  47. package/esm2020/columns/checkbox-column.component.mjs +1 -1
  48. package/esm2020/columns/column-base.mjs +4 -0
  49. package/esm2020/columns/column-group.component.mjs +9 -6
  50. package/esm2020/columns/column.component.mjs +16 -39
  51. package/esm2020/columns/command-column.component.mjs +13 -15
  52. package/esm2020/columns/rowreorder-column.component.mjs +47 -0
  53. package/esm2020/columns/span-column.component.mjs +10 -81
  54. package/esm2020/data/data.collection.mjs +41 -28
  55. package/esm2020/editing/add-command.directive.mjs +2 -2
  56. package/esm2020/editing/base-command.directive.mjs +1 -1
  57. package/esm2020/editing/cancel-command.directive.mjs +2 -2
  58. package/esm2020/editing/edit-command.directive.mjs +2 -2
  59. package/esm2020/editing/edit-template.directive.mjs +11 -0
  60. package/esm2020/editing/remove-command.directive.mjs +2 -2
  61. package/esm2020/editing/save-command.directive.mjs +2 -2
  62. package/esm2020/excel/excel-command.directive.mjs +2 -2
  63. package/esm2020/filtering/cell/boolean-filter-cell.component.mjs +11 -11
  64. package/esm2020/filtering/cell/date-filter-cell.component.mjs +11 -11
  65. package/esm2020/filtering/cell/filter-cell-operators.component.mjs +15 -0
  66. package/esm2020/filtering/cell/numeric-filter-cell.component.mjs +13 -12
  67. package/esm2020/filtering/cell/string-filter-cell.component.mjs +14 -13
  68. package/esm2020/filtering/date-filter.component.mjs +6 -1
  69. package/esm2020/filtering/menu/boolean-filter-menu.component.mjs +11 -12
  70. package/esm2020/filtering/menu/date-filter-menu.component.mjs +12 -12
  71. package/esm2020/filtering/menu/filter-menu.component.mjs +1 -1
  72. package/esm2020/filtering/menu/numeric-filter-menu.component.mjs +12 -12
  73. package/esm2020/filtering/menu/string-filter-menu.component.mjs +15 -0
  74. package/esm2020/filtering/numeric-filter.component.mjs +4 -1
  75. package/esm2020/filtering/operators/after-eq-filter-operator.component.mjs +2 -5
  76. package/esm2020/filtering/operators/after-filter-operator.component.mjs +2 -5
  77. package/esm2020/filtering/operators/before-eq-filter-operator.component.mjs +2 -5
  78. package/esm2020/filtering/operators/before-filter-operator.component.mjs +3 -6
  79. package/esm2020/filtering/operators/contains-filter-operator.component.mjs +1 -4
  80. package/esm2020/filtering/operators/ends-with-filter-operator.component.mjs +1 -4
  81. package/esm2020/filtering/operators/eq-filter-operator.component.mjs +1 -4
  82. package/esm2020/filtering/operators/gt-filter-operator.component.mjs +1 -4
  83. package/esm2020/filtering/operators/gte-filter-operator.component.mjs +1 -4
  84. package/esm2020/filtering/operators/is-empty-filter-operator.component.mjs +1 -4
  85. package/esm2020/filtering/operators/is-not-empty-filter-operator.component.mjs +1 -4
  86. package/esm2020/filtering/operators/is-not-null-filter-operator.component.mjs +1 -4
  87. package/esm2020/filtering/operators/isnull-filter-operator.component.mjs +1 -4
  88. package/esm2020/filtering/operators/lt-filter-operator.component.mjs +2 -5
  89. package/esm2020/filtering/operators/lte-filter-operator.component.mjs +1 -4
  90. package/esm2020/filtering/operators/neq-filter-operator.component.mjs +1 -4
  91. package/esm2020/filtering/operators/not-contains-filter-operator.component.mjs +1 -4
  92. package/esm2020/filtering/operators/starts-with-filter-operator.component.mjs +1 -4
  93. package/esm2020/filtering/string-filter.component.mjs +2 -1
  94. package/esm2020/index.mjs +2 -0
  95. package/esm2020/localization/custom-messages.component.mjs +1 -1
  96. package/esm2020/localization/messages.mjs +3 -1
  97. package/esm2020/package-metadata.mjs +2 -2
  98. package/esm2020/pager/pager-element.component.mjs +17 -0
  99. package/esm2020/pager/pager-next-buttons.component.mjs +8 -11
  100. package/esm2020/pager/pager-numeric-buttons.component.mjs +1 -1
  101. package/esm2020/pager/pager-page-sizes.component.mjs +1 -1
  102. package/esm2020/pager/pager-prev-buttons.component.mjs +8 -11
  103. package/esm2020/pager/pager-template.directive.mjs +1 -1
  104. package/esm2020/pdf/pdf-command.directive.mjs +2 -2
  105. package/esm2020/pdf/pdf-margin.component.mjs +9 -0
  106. package/esm2020/rendering/cell-template.directive.mjs +1 -1
  107. package/esm2020/rendering/cell.component.mjs +68 -20
  108. package/esm2020/rendering/common/spacer.component.mjs +1 -1
  109. package/esm2020/rendering/constants.mjs +4 -0
  110. package/esm2020/rendering/header/header.component.mjs +1 -1
  111. package/esm2020/rendering/table-body.component.mjs +5 -3
  112. package/esm2020/row-reordering/flat-reorder.service.mjs +48 -0
  113. package/esm2020/row-reordering/hierarchical-reorder.service.mjs +55 -0
  114. package/esm2020/row-reordering/row-reorder.service.mjs +220 -0
  115. package/esm2020/row-reordering/types.mjs +5 -0
  116. package/esm2020/row-reordering/utils.mjs +129 -0
  117. package/esm2020/shared.module.mjs +8 -3
  118. package/esm2020/treelist.component.mjs +185 -311
  119. package/esm2020/treelist.module.mjs +71 -66
  120. package/excel/excel-command.directive.d.ts +1 -1
  121. package/excel/excel-export-data.interface.d.ts +1 -1
  122. package/excel/excel.component.d.ts +9 -8
  123. package/fesm2015/progress-kendo-angular-treelist.mjs +1215 -792
  124. package/fesm2020/progress-kendo-angular-treelist.mjs +1205 -791
  125. package/filtering/cell/boolean-filter-cell.component.d.ts +11 -11
  126. package/filtering/cell/date-filter-cell.component.d.ts +11 -11
  127. package/filtering/cell/filter-cell-operators.component.d.ts +15 -0
  128. package/filtering/cell/numeric-filter-cell.component.d.ts +13 -12
  129. package/filtering/cell/string-filter-cell.component.d.ts +12 -11
  130. package/filtering/date-filter.component.d.ts +7 -11
  131. package/filtering/menu/boolean-filter-menu.component.d.ts +11 -12
  132. package/filtering/menu/date-filter-menu.component.d.ts +12 -12
  133. package/filtering/menu/numeric-filter-menu.component.d.ts +12 -12
  134. package/filtering/menu/string-filter-menu.component.d.ts +15 -0
  135. package/filtering/numeric-filter.component.d.ts +4 -1
  136. package/filtering/operators/after-eq-filter-operator.component.d.ts +4 -0
  137. package/filtering/operators/after-filter-operator.component.d.ts +4 -0
  138. package/filtering/operators/before-eq-filter-operator.component.d.ts +4 -0
  139. package/filtering/operators/before-filter-operator.component.d.ts +4 -0
  140. package/filtering/operators/contains-filter-operator.component.d.ts +1 -4
  141. package/filtering/operators/ends-with-filter-operator.component.d.ts +1 -4
  142. package/filtering/operators/eq-filter-operator.component.d.ts +1 -4
  143. package/filtering/operators/gte-filter-operator.component.d.ts +1 -4
  144. package/filtering/operators/is-empty-filter-operator.component.d.ts +1 -4
  145. package/filtering/operators/is-not-empty-filter-operator.component.d.ts +1 -4
  146. package/filtering/operators/is-not-null-filter-operator.component.d.ts +1 -4
  147. package/filtering/operators/isnull-filter-operator.component.d.ts +1 -4
  148. package/filtering/operators/lt-filter-operator.component.d.ts +4 -0
  149. package/filtering/operators/neq-filter-operator.component.d.ts +1 -4
  150. package/filtering/operators/not-contains-filter-operator.component.d.ts +1 -4
  151. package/filtering/operators/starts-with-filter-operator.component.d.ts +1 -4
  152. package/filtering/string-filter.component.d.ts +2 -1
  153. package/index.d.ts +2 -0
  154. package/localization/custom-messages.component.d.ts +1 -1
  155. package/localization/messages.d.ts +6 -2
  156. package/navigation/navigation-cell.interface.d.ts +1 -4
  157. package/navigation/navigation-row.interface.d.ts +1 -4
  158. package/package.json +16 -15
  159. package/pager/pager-element.component.d.ts +9 -0
  160. package/pager/pager-next-buttons.component.d.ts +0 -3
  161. package/pager/pager-numeric-buttons.component.d.ts +1 -1
  162. package/pager/pager-prev-buttons.component.d.ts +0 -3
  163. package/pager/pager-settings.d.ts +1 -15
  164. package/pager/pager-template.directive.d.ts +1 -1
  165. package/pdf/pdf-command.directive.d.ts +1 -1
  166. package/pdf/pdf-margin.component.d.ts +9 -0
  167. package/rendering/cell-template.directive.d.ts +1 -1
  168. package/rendering/cell.component.d.ts +9 -1
  169. package/rendering/common/spacer.component.d.ts +1 -1
  170. package/rendering/constants.d.ts +4 -0
  171. package/row-reordering/flat-reorder.service.d.ts +16 -0
  172. package/row-reordering/hierarchical-reorder.service.d.ts +16 -0
  173. package/row-reordering/row-reorder.service.d.ts +61 -0
  174. package/row-reordering/types.d.ts +39 -0
  175. package/row-reordering/utils.d.ts +85 -0
  176. package/schematics/ngAdd/index.js +3 -3
  177. package/scrolling/content-scroll-event.d.ts +1 -1
  178. package/scrolling/scroll-bottom-event.d.ts +1 -1
  179. package/scrolling/scroll-request.service.d.ts +6 -0
  180. package/selection/selectable-settings.d.ts +5 -15
  181. package/selection/selectable.directive.d.ts +1 -1
  182. package/selection/selection-change-event.d.ts +1 -1
  183. package/shared.module.d.ts +5 -4
  184. package/treelist.component.d.ts +66 -289
  185. package/treelist.module.d.ts +68 -66
@@ -20,25 +20,15 @@ export declare function isSpanColumnComponent(column: any): column is SpanColumn
20
20
  * [sorting]({% slug sorting_treelist %}) and [filtering]({% slug filtering_treelist %}). Wrap the columns that will be
21
21
  * merged inside the `<kendo-treelist-span-column>` tag.
22
22
  *
23
- * {% meta height:570 %}
24
- * {% embed_file configuration/span-column/app.component.ts preview %}
25
- * {% embed_file configuration/span-column/app.module.ts %}
26
- * {% embed_file shared/main.ts %}
27
- * {% embed_file shared/employees.ts %}
28
- * {% endmeta %}
29
- *
30
- * By default, the data cell displays the data for the specified fields. To further customize
31
- * the span-column functionality, use a [cell template]({% slug api_treelist_celltemplatedirective %}).
32
- *
33
- * ```html-no-run
23
+ * ```html
34
24
  * <kendo-treelist-span-column>
35
- * <kendo-treelist-column field="field1" title="Field 1"></kendo-treelist-column>
36
- * <kendo-treelist-column field="field2" title="Field 2"></kendo-treelist-column>
37
- * <ng-template kendoTreeListCellTemplate let-dataItem>
38
- * <h5>{{ dataItem.field1 }}</h5>
39
- * <p>{{ dataItem.field2 }}</p>
40
- * </ng-template>
41
- * </kendo-treelist-span-column>
25
+ * <kendo-treelist-column field="field1" ></kendo-treelist-column>
26
+ * <kendo-treelist-column field="field2" ></kendo-treelist-column>
27
+ * <ng-template kendoTreeListCellTemplate let-dataItem>
28
+ * <h5>{{ dataItem.field1 }}</h5>
29
+ * <p>{{ dataItem.field2 }}</p>
30
+ * </ng-template>
31
+ * </kendo-treelist-span-column>
42
32
  * ```
43
33
  */
44
34
  export declare class SpanColumnComponent extends ColumnBase {
@@ -89,22 +79,8 @@ export declare class SpanColumnComponent extends ColumnBase {
89
79
  /**
90
80
  * Defines whether the edit template of the column will be rendered. The default value is `false`.
91
81
  *
92
- * > To enable the editing functionality for a spanned column, set an edit template for it.
82
+ * To enable the editing functionality for a spanned column, set an edit template for it.
93
83
  *
94
- * @example
95
- * ```html-no-run
96
- * <kendo-treelist>
97
- * <kendo-treelist-span-column [editable]="false">
98
- * <kendo-treelist-column field="UnitPrice">
99
- * </kendo-treelist-column>
100
- * <kendo-treelist-column field="ProductName">
101
- * </kendo-treelist-column>
102
- * <ng-template kendoTreeListEditTemplate>
103
- * .....
104
- * </ng-template>
105
- * </kendo-treelist-span-column>
106
- * </kendo-treelist>
107
- * ```
108
84
  */
109
85
  set editable(value: boolean);
110
86
  get editable(): boolean;
@@ -134,56 +110,9 @@ export declare class SpanColumnComponent extends ColumnBase {
134
110
  get colspan(): number;
135
111
  /**
136
112
  * Toggles the locked (frozen) state of the columns. Locked columns are visible
137
- * at all times during the horizontal scrolling of the TreeList.
138
- *
139
- * For the option to work properly, make sure that:
140
- * - Scrolling is enabled.
141
- * - The `height` option of the TreeList is set.
142
- * - The widths of all TreeList columns are explicitly set in pixels. In this way,
143
- * the TreeList adjusts the layout of the locked and unlocked columns.
113
+ * at all times during the horizontal scrolling of the TreeList. [See example](slug:locked_columns_treelist).
144
114
  *
145
115
  * @default false
146
- *
147
- * @example
148
- * ```ts
149
- * _@Component({
150
- * selector: 'my-app',
151
- * template: `
152
- * <kendo-treelist [data]="treelistData" [scrollable]="scrollable" style="height: 200px">
153
- * <kendo-treelist-span-column [locked]="true">
154
- * <kendo-treelist-column field="ProductID" title="Product ID" [width]="120">
155
- * </kendo-treelist-column>
156
- * <kendo-treelist-column field="ProductName" title="Product Name" [width]="200">
157
- * </kendo-treelist-column>
158
- * </kendo-treelist-span-column>
159
- * <kendo-treelist-column field="UnitPrice" title="Unit Price" [width]="230">
160
- * </kendo-treelist-column>
161
- * </kendo-treelist>
162
- * `
163
- * })
164
- *
165
- * class AppComponent {
166
- * public treelistData: any[];
167
- *
168
- * constructor() {
169
- * this.treelistData = products;
170
- * }
171
- * }
172
- *
173
- * const products = [{
174
- * "ProductID": 1,
175
- * "ProductName": "Chai",
176
- * "UnitPrice": 18.0000,
177
- * "Discontinued": true
178
- * }, {
179
- * "ProductID": 2,
180
- * "ProductName": "Chang",
181
- * "UnitPrice": 19.0000,
182
- * "Discontinued": false
183
- * }
184
- * ];
185
- *
186
- * ```
187
116
  */
188
117
  set locked(value: boolean);
189
118
  get locked(): boolean;
@@ -4,7 +4,7 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { SortDescriptor, CompositeFilterDescriptor } from '@progress/kendo-data-query';
6
6
  /**
7
- * Arguments for the `pageChange` event.
7
+ * Arguments for the [`pageChange`](slug:api_treelist_treelistcomponent#toc-pagechange) event.
8
8
  */
9
9
  export interface PageChangeEvent {
10
10
  /**
@@ -17,7 +17,7 @@ export interface PageChangeEvent {
17
17
  take: number;
18
18
  }
19
19
  /**
20
- * Arguments for the `dataStateChange` event
20
+ * Arguments for the [`dataStateChange`](slug:api_treelist_treelistcomponent#toc-datastatechange) event
21
21
  * ([more information and examples]({% slug databinding_treelist %})).
22
22
  */
23
23
  export interface DataStateChangeEvent {
@@ -8,7 +8,13 @@ import { EventEmitter } from '@angular/core';
8
8
  * The data type that is expected by the TreeList.
9
9
  */
10
10
  export interface TreeListDataResult {
11
+ /**
12
+ * The data that will be rendered by the TreeList as an array.
13
+ */
11
14
  data: any[];
15
+ /**
16
+ * The aggregated values for the group. An [`AggregateResult`](slug:treelist_with_aggregates) instance.
17
+ */
12
18
  aggregates?: any;
13
19
  }
14
20
  /**
@@ -3,7 +3,7 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  /**
6
- * Additional configuration for the `reorderColumn` method.
6
+ * Additional configuration for the [`reorderColumn`](slug:api_treelist_treelistcomponent#toc-reordercolumn) method.
7
7
  */
8
8
  export interface ColumnReorderConfig {
9
9
  /**
@@ -22,7 +22,7 @@ import * as i0 from "@angular/core";
22
22
  *
23
23
  * @example
24
24
  * ```html
25
- * <kendo-treelist>
25
+ * <kendo-treelist ...>
26
26
  * <kendo-treelist-command-column title="command">
27
27
  * <ng-template kendoTreeListCellTemplate let-cellContext="cellContext">
28
28
  * <button [kendoTreeListAddCommand]="cellContext" class="k-primary">Edit</button>
@@ -19,7 +19,7 @@ import * as i0 from "@angular/core";
19
19
  *
20
20
  * @example
21
21
  * ```html
22
- * <kendo-treelist>
22
+ * <kendo-treelist ...>
23
23
  * <kendo-treelist-command-column title="command">
24
24
  * <ng-template kendoTreeListCellTemplate let-cellContext="cellContext">
25
25
  * <button [kendoTreeListCancelCommand]="cellContext">Cancel changes</button>
@@ -19,7 +19,7 @@ import * as i0 from "@angular/core";
19
19
  *
20
20
  * @example
21
21
  * ```html
22
- * <kendo-treelist>
22
+ * <kendo-treelist ...>
23
23
  * <kendo-treelist-command-column title="command">
24
24
  * <ng-template kendoTreeListCellTemplate let-cellContext="cellContext">
25
25
  * <button [kendoTreeListEditCommand]="cellContext">Edit</button>
@@ -4,7 +4,7 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import type { TreeListComponent } from "../treelist.component";
6
6
  /**
7
- * Arguments for the `remove` event.
7
+ * Arguments for the [`edit`](slug:api_treelist_treelistcomponent#toc-edit) event.
8
8
  */
9
9
  export interface EditEvent {
10
10
  /**
@@ -16,6 +16,17 @@ import * as i0 from "@angular/core";
16
16
  * - `formGroup`&mdash;The current [`FormGroup`](link:site.data.urls.angular['formgroupapi']). If you use the TreeList inside [Template-Driven Forms](link:site.data.urls.angular['forms']), `formGroup` will be `undefined`.
17
17
  * - `isNew`&mdash;The state of the current item.
18
18
  * - `rowIndex`&mdash;The current row index. If inside a new item row, `rowIndex` is `-1`.
19
+ *
20
+ * * @example
21
+ * ```html
22
+ * <kendo-treelist ...>
23
+ * <kendo-treelist-command-column title="command">
24
+ * <ng-template kendoTreeListEditTemplate let-rowIndex="rowIndex">
25
+ * {{rowIndex}}
26
+ * </ng-template>
27
+ * </kendo-treelist-command-column>
28
+ * </kendo-treelist>
29
+ * ```
19
30
  */
20
31
  export declare class EditTemplateDirective {
21
32
  templateRef: TemplateRef<any>;
@@ -19,7 +19,7 @@ import * as i0 from "@angular/core";
19
19
  *
20
20
  * @example
21
21
  * ```html
22
- * <kendo-treelist>
22
+ * <kendo-treelist ...>
23
23
  * <kendo-treelist-command-column title="command">
24
24
  * <ng-template kendoTreeListCellTemplate let-cellContext="cellContext">
25
25
  * <button [kendoTreeListRemoveCommand]="cellContext">Remove row</button>
@@ -4,7 +4,7 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { EditEvent } from "./edit-event-args.interface";
6
6
  /**
7
- * Arguments for the `remove` event.
7
+ * Arguments for the [`remove`](slug:api_treelist_treelistcomponent#toc-remove) event.
8
8
  */
9
9
  export interface RemoveEvent extends EditEvent {
10
10
  /**
@@ -19,7 +19,7 @@ import * as i0 from "@angular/core";
19
19
  *
20
20
  * @example
21
21
  * ```html
22
- * <kendo-treelist>
22
+ * <kendo-treelist ...>
23
23
  * <kendo-treelist-command-column title="command">
24
24
  * <ng-template kendoTreeListCellTemplate let-cellContext="cellContext">
25
25
  * <button [kendoTreeListSaveCommand]="cellContext">Save changes</button>
@@ -5,7 +5,7 @@
5
5
  import { EditEvent } from "./edit-event-args.interface";
6
6
  import { FormGroup } from "@angular/forms";
7
7
  /**
8
- * Arguments for the `save` event.
8
+ * Arguments for the [`save`](slug:api_treelist_treelistcomponent#toc-save) event.
9
9
  */
10
10
  export interface SaveEvent extends EditEvent {
11
11
  /**
@@ -8,11 +8,14 @@ import { process, aggregateBy } from '@progress/kendo-data-query';
8
8
  import { isChanged } from '@progress/kendo-angular-common';
9
9
  import { DataBoundTreeComponent } from './data-bound-tree-component';
10
10
  import { anyChanged } from '../utils';
11
+ import { RowReorderService } from './../row-reordering/row-reorder.service';
11
12
  import * as i0 from "@angular/core";
12
13
  import * as i1 from "./data-bound-tree-component";
14
+ import * as i2 from "./../row-reordering/row-reorder.service";
13
15
  export class BaseBindingDirective {
14
- constructor(component) {
16
+ constructor(component, rowReorderService) {
15
17
  this.component = component;
18
+ this.rowReorderService = rowReorderService;
16
19
  this.state = {};
17
20
  this.cache = new Map();
18
21
  this.originalData = [];
@@ -45,6 +48,8 @@ export class BaseBindingDirective {
45
48
  this.applyState(this.state);
46
49
  this.subscriptions.add(this.component.dataStateChange
47
50
  .subscribe(this.onStateChange.bind(this)));
51
+ this.component.rowReorderable && this.subscriptions.add(this.rowReorderService.rowReorder
52
+ .subscribe(this.onRowReorder.bind(this)));
48
53
  }
49
54
  /**
50
55
  * @hidden
@@ -85,6 +90,7 @@ export class BaseBindingDirective {
85
90
  this.cache.clear();
86
91
  this.component.data = this.fetchChildren();
87
92
  }
93
+ onRowReorder(_event) { }
88
94
  applyState({ sort, filter }) {
89
95
  this.sort = sort;
90
96
  this.filter = filter;
@@ -153,12 +159,12 @@ export class BaseBindingDirective {
153
159
  this.dataChanged = true;
154
160
  }
155
161
  }
156
- BaseBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaseBindingDirective, deps: [{ token: i1.DataBoundTreeComponent }], target: i0.ɵɵFactoryTarget.Directive });
162
+ BaseBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaseBindingDirective, deps: [{ token: i1.DataBoundTreeComponent }, { token: i2.RowReorderService }], target: i0.ɵɵFactoryTarget.Directive });
157
163
  BaseBindingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: BaseBindingDirective, inputs: { sort: "sort", filter: "filter", aggregate: "aggregate" }, usesOnChanges: true, ngImport: i0 });
158
164
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaseBindingDirective, decorators: [{
159
165
  type: Directive,
160
166
  args: [{}]
161
- }], ctorParameters: function () { return [{ type: i1.DataBoundTreeComponent }]; }, propDecorators: { sort: [{
167
+ }], ctorParameters: function () { return [{ type: i1.DataBoundTreeComponent }, { type: i2.RowReorderService }]; }, propDecorators: { sort: [{
162
168
  type: Input
163
169
  }], filter: [{
164
170
  type: Input
@@ -2,14 +2,17 @@
2
2
  * Copyright © 2023 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, Input } from '@angular/core';
5
+ import { Directive, Input, Optional } from '@angular/core';
6
6
  import { getter, setter } from '@progress/kendo-common';
7
7
  import { BaseBindingDirective } from './base-binding.directive';
8
8
  import { FlatEditService } from '../editing-directives/flat-edit.service';
9
9
  import { DataBoundTreeComponent } from './data-bound-tree-component';
10
10
  import { isPresent } from '../utils';
11
+ import { RowReorderService } from '../row-reordering/row-reorder.service';
12
+ import { FlatRowReorderService } from '../row-reordering/flat-reorder.service';
11
13
  import * as i0 from "@angular/core";
12
14
  import * as i1 from "./data-bound-tree-component";
15
+ import * as i2 from "../row-reordering/row-reorder.service";
13
16
  const ROOT_ID = null;
14
17
  /**
15
18
  * A directive which binds the TreeList to an array of objects by using
@@ -20,14 +23,18 @@ const ROOT_ID = null;
20
23
  * and [filtering]({% slug filtering_treelist %}) ([more information and examples]({% slug databinding_treelist %})).
21
24
  */
22
25
  export class FlatBindingDirective extends BaseBindingDirective {
23
- constructor(component) {
26
+ constructor(component, rowReorderService) {
24
27
  super(component);
25
28
  this.component = component;
29
+ this.rowReorderService = rowReorderService;
26
30
  this.idGetter = getter('id');
27
31
  this.idSetter = setter('id');
28
32
  this.parentIdGetter = getter('parentId');
29
33
  this.parentIdSetter = setter('parentId');
30
34
  component.localEditService = new FlatEditService(this);
35
+ if (this.rowReorderService) {
36
+ this.rowReorderService.bindingDirective = this;
37
+ }
31
38
  }
32
39
  /**
33
40
  * The name of the field which contains the identifier of the parent node.
@@ -35,6 +42,10 @@ export class FlatBindingDirective extends BaseBindingDirective {
35
42
  set parentIdField(value) {
36
43
  this.parentIdGetter = getter(value);
37
44
  this.parentIdSetter = setter(value);
45
+ this._parentIdField = value;
46
+ }
47
+ get parentIdField() {
48
+ return this._parentIdField;
38
49
  }
39
50
  /**
40
51
  * The name of the field which contains the unique identifier of the node.
@@ -42,7 +53,14 @@ export class FlatBindingDirective extends BaseBindingDirective {
42
53
  set idField(value) {
43
54
  this.idGetter = getter(value);
44
55
  this.idSetter = setter(value);
56
+ this._idField = value;
57
+ }
58
+ get idField() {
59
+ return this._idField;
45
60
  }
61
+ /**
62
+ * @hidden
63
+ */
46
64
  getChildren(item) {
47
65
  const id = this.itemKey(item);
48
66
  const children = id === ROOT_ID ?
@@ -53,16 +71,48 @@ export class FlatBindingDirective extends BaseBindingDirective {
53
71
  itemKey(item) {
54
72
  return item ? this.idGetter(item) : ROOT_ID;
55
73
  }
74
+ onRowReorder(ev) {
75
+ if (ev.dropPosition === 'forbidden') {
76
+ return;
77
+ }
78
+ const draggedItem = ev.draggedRows[0].dataItem;
79
+ const dropTargetItem = ev.dropTargetRow.dataItem;
80
+ if (ev.dropPosition === 'over') {
81
+ const dropItemId = this.itemKey(dropTargetItem);
82
+ if (draggedItem[this.parentIdField] !== dropItemId) {
83
+ draggedItem[this.parentIdField] = dropItemId;
84
+ }
85
+ }
86
+ else {
87
+ const dropItemParentId = dropTargetItem[this.parentIdField];
88
+ draggedItem[this.parentIdField] = dropItemParentId;
89
+ this.rowReorderService.reorderRows(ev, this.originalData);
90
+ }
91
+ this.rebind();
92
+ }
56
93
  }
57
- FlatBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FlatBindingDirective, deps: [{ token: i1.DataBoundTreeComponent }], target: i0.ɵɵFactoryTarget.Directive });
58
- FlatBindingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: FlatBindingDirective, selector: "[kendoTreeListFlatBinding]", inputs: { parentIdField: "parentIdField", idField: "idField", data: ["kendoTreeListFlatBinding", "data"] }, exportAs: ["kendoTreeListFlatBinding"], usesInheritance: true, ngImport: i0 });
94
+ FlatBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FlatBindingDirective, deps: [{ token: i1.DataBoundTreeComponent }, { token: i2.RowReorderService, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
95
+ FlatBindingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: FlatBindingDirective, selector: "[kendoTreeListFlatBinding]", inputs: { parentIdField: "parentIdField", idField: "idField", data: ["kendoTreeListFlatBinding", "data"] }, providers: [
96
+ {
97
+ provide: RowReorderService,
98
+ useClass: FlatRowReorderService
99
+ }
100
+ ], exportAs: ["kendoTreeListFlatBinding"], usesInheritance: true, ngImport: i0 });
59
101
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FlatBindingDirective, decorators: [{
60
102
  type: Directive,
61
103
  args: [{
62
104
  exportAs: 'kendoTreeListFlatBinding',
63
- selector: '[kendoTreeListFlatBinding]'
105
+ selector: '[kendoTreeListFlatBinding]',
106
+ providers: [
107
+ {
108
+ provide: RowReorderService,
109
+ useClass: FlatRowReorderService
110
+ }
111
+ ]
64
112
  }]
65
- }], ctorParameters: function () { return [{ type: i1.DataBoundTreeComponent }]; }, propDecorators: { parentIdField: [{
113
+ }], ctorParameters: function () { return [{ type: i1.DataBoundTreeComponent }, { type: i2.RowReorderService, decorators: [{
114
+ type: Optional
115
+ }] }]; }, propDecorators: { parentIdField: [{
66
116
  type: Input
67
117
  }], idField: [{
68
118
  type: Input
@@ -2,13 +2,16 @@
2
2
  * Copyright © 2023 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, Input } from '@angular/core';
5
+ import { Directive, Input, Optional } from '@angular/core';
6
6
  import { getter, setter } from '@progress/kendo-common';
7
7
  import { BaseBindingDirective } from './base-binding.directive';
8
8
  import { HierarchyEditService } from '../editing-directives/hierarchy-edit.service';
9
9
  import { DataBoundTreeComponent } from './data-bound-tree-component';
10
+ import { RowReorderService } from '../row-reordering/row-reorder.service';
11
+ import { HierarchicalRowReorderService } from '../row-reordering/hierarchical-reorder.service';
10
12
  import * as i0 from "@angular/core";
11
13
  import * as i1 from "./data-bound-tree-component";
14
+ import * as i2 from "../row-reordering/row-reorder.service";
12
15
  /**
13
16
  * A directive which binds the TreeList to a tree of objects.
14
17
  *
@@ -17,12 +20,16 @@ import * as i1 from "./data-bound-tree-component";
17
20
  * and [filtering]({% slug filtering_treelist %}) ([more information and examples](slug:databinding_treelist#toc-binding-to-hierarchical-data)).
18
21
  */
19
22
  export class HierarchyBindingDirective extends BaseBindingDirective {
20
- constructor(component) {
23
+ constructor(component, rowReorderService) {
21
24
  super(component);
22
25
  this.component = component;
26
+ this.rowReorderService = rowReorderService;
23
27
  this.childrenGetter = getter('items');
24
28
  this.childrenSetter = setter('items');
25
29
  component.localEditService = new HierarchyEditService(this);
30
+ if (this.rowReorderService) {
31
+ this.rowReorderService.bindingDirective = this;
32
+ }
26
33
  }
27
34
  /**
28
35
  * The name of the field which holds the child data items of the node.
@@ -30,23 +37,56 @@ export class HierarchyBindingDirective extends BaseBindingDirective {
30
37
  set childrenField(value) {
31
38
  this.childrenGetter = getter(value);
32
39
  this.childrenSetter = setter(value);
40
+ this._childrenField = value;
33
41
  }
42
+ get childrenField() {
43
+ return this._childrenField;
44
+ }
45
+ /**
46
+ * @hidden
47
+ */
34
48
  getChildren(item) {
35
49
  return item ? this.childrenGetter(item) || [] : this.originalData;
36
50
  }
37
51
  itemKey(item) {
38
52
  return item;
39
53
  }
54
+ onRowReorder(ev) {
55
+ if (ev.dropPosition === 'forbidden') {
56
+ return;
57
+ }
58
+ const dropTargetItem = ev.dropTargetRow.dataItem;
59
+ if (ev.dropPosition === 'over') {
60
+ if (!dropTargetItem.hasOwnProperty(this.childrenField)) {
61
+ dropTargetItem[this.childrenField] = [];
62
+ }
63
+ }
64
+ this.rowReorderService.reorderRows(ev, this.originalData, this.childrenField);
65
+ this.rebind();
66
+ }
40
67
  }
41
- HierarchyBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: HierarchyBindingDirective, deps: [{ token: i1.DataBoundTreeComponent }], target: i0.ɵɵFactoryTarget.Directive });
42
- HierarchyBindingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: HierarchyBindingDirective, selector: "[kendoTreeListHierarchyBinding]", inputs: { childrenField: "childrenField", data: ["kendoTreeListHierarchyBinding", "data"] }, exportAs: ["kendoTreeListHierarchyBinding"], usesInheritance: true, ngImport: i0 });
68
+ HierarchyBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: HierarchyBindingDirective, deps: [{ token: i1.DataBoundTreeComponent }, { token: i2.RowReorderService, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
69
+ HierarchyBindingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: HierarchyBindingDirective, selector: "[kendoTreeListHierarchyBinding]", inputs: { childrenField: "childrenField", data: ["kendoTreeListHierarchyBinding", "data"] }, providers: [
70
+ {
71
+ provide: RowReorderService,
72
+ useClass: HierarchicalRowReorderService
73
+ }
74
+ ], exportAs: ["kendoTreeListHierarchyBinding"], usesInheritance: true, ngImport: i0 });
43
75
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: HierarchyBindingDirective, decorators: [{
44
76
  type: Directive,
45
77
  args: [{
46
78
  exportAs: 'kendoTreeListHierarchyBinding',
47
- selector: '[kendoTreeListHierarchyBinding]'
79
+ selector: '[kendoTreeListHierarchyBinding]',
80
+ providers: [
81
+ {
82
+ provide: RowReorderService,
83
+ useClass: HierarchicalRowReorderService
84
+ }
85
+ ]
48
86
  }]
49
- }], ctorParameters: function () { return [{ type: i1.DataBoundTreeComponent }]; }, propDecorators: { childrenField: [{
87
+ }], ctorParameters: function () { return [{ type: i1.DataBoundTreeComponent }, { type: i2.RowReorderService, decorators: [{
88
+ type: Optional
89
+ }] }]; }, propDecorators: { childrenField: [{
50
90
  type: Input
51
91
  }], data: [{
52
92
  type: Input,
@@ -19,12 +19,14 @@ import * as i5 from "./column-list.component";
19
19
  * Represents the component for selecting columns in the TreeList. To enable the user to show or hide columns,
20
20
  * add the component inside a [`ToolbarTemplate`]({% slug api_treelist_toolbartemplatedirective %}) directive.
21
21
  *
22
- * {% meta height:500 %}
23
- * {% embed_file column-menu/chooser-toolbar/app.component.ts preview %}
24
- * {% embed_file column-menu/chooser-toolbar/app.module.ts %}
25
- * {% embed_file shared/main.ts %}
26
- * {% embed_file shared/employees.ts %}
27
- * {% endmeta %}
22
+ * @example
23
+ * ```html
24
+ * <kendo-treelist ...>
25
+ * <ng-template kendoTreeListToolbarTemplate>
26
+ * <kendo-treelist-column-chooser> </kendo-treelist-column-chooser>
27
+ * </ng-template>
28
+ * </kendo-treelist>
29
+ * ```
28
30
  */
29
31
  export class ColumnChooserComponent {
30
32
  constructor(localization, columnInfoService, popupService, ngZone, renderer, changeDetector) {
@@ -36,10 +38,12 @@ export class ColumnChooserComponent {
36
38
  this.changeDetector = changeDetector;
37
39
  /**
38
40
  * Specifies if the changes in the visibility of the column will be immediately applied.
41
+ * @default false
39
42
  */
40
43
  this.autoSync = false;
41
44
  /**
42
45
  * Specifies if all columns can be hidden.
46
+ * @default true
43
47
  */
44
48
  this.allowHideAll = true;
45
49
  this.columnsIcon = columnsIcon;
@@ -14,18 +14,13 @@ import * as i3 from "./column-menu-item.component";
14
14
  import * as i4 from "./column-list.component";
15
15
  import * as i5 from "./column-menu-item-content-template.directive";
16
16
  /**
17
- * Represents the component for selecting columns in the TreeList that can be placed
18
- * inside a [`ColumnMenuTemplate`]({% slug api_treelist_columnmenutemplatedirective %}) directive.
17
+ * Represents the column-menu item for selecting columns in the TreeList. [See example](slug:columnmenu_treelist#toc-column-chooser-item).
19
18
  *
20
- * > You have to set the [ColumnMenuService]({% slug api_treelist_columnmenuservice %}) that is passed by
21
- * > the template to the service input of the `kendo-treelist-columnmenu-chooser` component.
19
+ * The component can be placed inside a [`ColumnMenuTemplate`]({% slug api_treelist_columnmenutemplatedirective %}) directive.
20
+ *
21
+ * To register the component as a known column menu item, set the [`ColumnMenuService`]({% slug api_treelist_columnmenuservice %})
22
+ * that is passed by the template to the service input of the `kendo-treelist-columnmenu-chooser` component.
22
23
  *
23
- * {% meta height:500 %}
24
- * {% embed_file column-menu/template-chooser/app.component.ts preview %}
25
- * {% embed_file column-menu/template-chooser/app.module.ts %}
26
- * {% embed_file shared/main.ts %}
27
- * {% embed_file shared/employees.ts %}
28
- * {% endmeta %}
29
24
  */
30
25
  export class ColumnMenuChooserComponent extends ColumnMenuItemBase {
31
26
  constructor(localization, columnInfoService, changeDetector) {
@@ -43,6 +38,7 @@ export class ColumnMenuChooserComponent extends ColumnMenuItemBase {
43
38
  this.collapse = new EventEmitter();
44
39
  /**
45
40
  * Specifies if the content is expanded.
41
+ * @default false
46
42
  */
47
43
  this.expanded = false;
48
44
  /**
@@ -67,7 +63,7 @@ export class ColumnMenuChooserComponent extends ColumnMenuItemBase {
67
63
  }
68
64
  ColumnMenuChooserComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ColumnMenuChooserComponent, deps: [{ token: i1.LocalizationService }, { token: i2.ColumnInfoService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
69
65
  ColumnMenuChooserComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: ColumnMenuChooserComponent, selector: "kendo-treelist-columnmenu-chooser", inputs: { expanded: "expanded" }, outputs: { expand: "expand", collapse: "collapse" }, usesInheritance: true, ngImport: i0, template: `
70
- <kendo-treelist-columnmenu-item
66
+ <kendo-treelist-columnmenu-item
71
67
  [text]="localization.get('columns')"
72
68
  icon="columns"
73
69
  [svgIcon]="columnsIcon"
@@ -92,7 +88,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
92
88
  args: [{
93
89
  selector: 'kendo-treelist-columnmenu-chooser',
94
90
  template: `
95
- <kendo-treelist-columnmenu-item
91
+ <kendo-treelist-columnmenu-item
96
92
  [text]="localization.get('columns')"
97
93
  icon="columns"
98
94
  [svgIcon]="columnsIcon"
@@ -12,18 +12,13 @@ import * as i2 from "./column-menu-item.component";
12
12
  import * as i3 from "../filtering/menu/filter-menu-container.component";
13
13
  import * as i4 from "./column-menu-item-content-template.directive";
14
14
  /**
15
- * Represents the component for editing column filters in the TreeList that can be placed
16
- * inside a [`ColumnMenuTemplate`]({% slug api_treelist_columnmenutemplatedirective %}) directive.
15
+ * Represents the column-menu item for editing column filters in the TreeList.
17
16
  *
18
- * > You have to set the [ColumnMenuService]({% slug api_treelist_columnmenuservice %}) that is passed by
19
- * > the template to the service input of the `kendo-treelist-columnmenu-filter` component.
17
+ * The component can be placed inside a [`ColumnMenuTemplate`]({% slug api_treelist_columnmenutemplatedirective %}) directive.
18
+ *
19
+ * To register the component as a known column menu item, set the [`ColumnMenuService`]({% slug api_treelist_columnmenuservice %})
20
+ * that is passed by the template to the service input of the `kendo-treelist-columnmenu-filter` component.
20
21
  *
21
- * {% meta height:500 %}
22
- * {% embed_file column-menu/template-filter/app.component.ts preview %}
23
- * {% embed_file column-menu/template-filter/app.module.ts %}
24
- * {% embed_file shared/main.ts %}
25
- * {% embed_file shared/employees.ts %}
26
- * {% endmeta %}
27
22
  */
28
23
  export class ColumnMenuFilterComponent extends ColumnMenuItemBase {
29
24
  constructor(localization) {
@@ -39,6 +34,7 @@ export class ColumnMenuFilterComponent extends ColumnMenuItemBase {
39
34
  this.collapse = new EventEmitter();
40
35
  /**
41
36
  * Specifies if the content is expanded.
37
+ * @default false
42
38
  */
43
39
  this.expanded = false;
44
40
  /**
@@ -13,7 +13,7 @@ import * as i0 from "@angular/core";
13
13
  *
14
14
  * @example
15
15
  * ```html
16
- * <kendo-treelist>
16
+ * <kendo-treelist ...>
17
17
  * <kendo-treelist-column field="ProductName">
18
18
  * <ng-template kendoTreeListColumnMenuTemplate>
19
19
  * <kendo-treelist-columnmenu-item text="Item Text" [expanded]="true">