@progress/kendo-angular-treelist 13.0.0-develop.2 → 13.0.0-develop.21

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 (196) 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/autocomplete-filter-cell.component.mjs +12 -1
  64. package/esm2020/filtering/cell/boolean-filter-cell.component.mjs +29 -12
  65. package/esm2020/filtering/cell/date-filter-cell.component.mjs +23 -12
  66. package/esm2020/filtering/cell/filter-cell-operators.component.mjs +36 -1
  67. package/esm2020/filtering/cell/filter-cell-wrapper.component.mjs +3 -1
  68. package/esm2020/filtering/cell/numeric-filter-cell.component.mjs +25 -13
  69. package/esm2020/filtering/cell/string-filter-cell.component.mjs +26 -14
  70. package/esm2020/filtering/date-filter.component.mjs +6 -1
  71. package/esm2020/filtering/filter-input.directive.mjs +29 -3
  72. package/esm2020/filtering/menu/boolean-filter-menu.component.mjs +33 -19
  73. package/esm2020/filtering/menu/date-filter-menu-input.component.mjs +1 -1
  74. package/esm2020/filtering/menu/date-filter-menu.component.mjs +12 -12
  75. package/esm2020/filtering/menu/filter-menu.component.mjs +1 -1
  76. package/esm2020/filtering/menu/numeric-filter-menu-input.component.mjs +1 -1
  77. package/esm2020/filtering/menu/numeric-filter-menu.component.mjs +12 -12
  78. package/esm2020/filtering/menu/string-filter-menu-input.component.mjs +19 -8
  79. package/esm2020/filtering/menu/string-filter-menu.component.mjs +15 -0
  80. package/esm2020/filtering/numeric-filter.component.mjs +4 -1
  81. package/esm2020/filtering/operators/after-eq-filter-operator.component.mjs +2 -5
  82. package/esm2020/filtering/operators/after-filter-operator.component.mjs +2 -5
  83. package/esm2020/filtering/operators/before-eq-filter-operator.component.mjs +2 -5
  84. package/esm2020/filtering/operators/before-filter-operator.component.mjs +3 -6
  85. package/esm2020/filtering/operators/contains-filter-operator.component.mjs +1 -4
  86. package/esm2020/filtering/operators/ends-with-filter-operator.component.mjs +1 -4
  87. package/esm2020/filtering/operators/eq-filter-operator.component.mjs +1 -4
  88. package/esm2020/filtering/operators/gt-filter-operator.component.mjs +1 -4
  89. package/esm2020/filtering/operators/gte-filter-operator.component.mjs +1 -4
  90. package/esm2020/filtering/operators/is-empty-filter-operator.component.mjs +1 -4
  91. package/esm2020/filtering/operators/is-not-empty-filter-operator.component.mjs +1 -4
  92. package/esm2020/filtering/operators/is-not-null-filter-operator.component.mjs +1 -4
  93. package/esm2020/filtering/operators/isnull-filter-operator.component.mjs +1 -4
  94. package/esm2020/filtering/operators/lt-filter-operator.component.mjs +2 -5
  95. package/esm2020/filtering/operators/lte-filter-operator.component.mjs +1 -4
  96. package/esm2020/filtering/operators/neq-filter-operator.component.mjs +1 -4
  97. package/esm2020/filtering/operators/not-contains-filter-operator.component.mjs +1 -4
  98. package/esm2020/filtering/operators/starts-with-filter-operator.component.mjs +1 -4
  99. package/esm2020/filtering/string-filter.component.mjs +2 -1
  100. package/esm2020/index.mjs +2 -0
  101. package/esm2020/localization/custom-messages.component.mjs +1 -1
  102. package/esm2020/localization/messages.mjs +13 -1
  103. package/esm2020/package-metadata.mjs +2 -2
  104. package/esm2020/pager/pager-element.component.mjs +17 -0
  105. package/esm2020/pager/pager-next-buttons.component.mjs +8 -11
  106. package/esm2020/pager/pager-numeric-buttons.component.mjs +1 -1
  107. package/esm2020/pager/pager-page-sizes.component.mjs +1 -1
  108. package/esm2020/pager/pager-prev-buttons.component.mjs +8 -11
  109. package/esm2020/pager/pager-template.directive.mjs +1 -1
  110. package/esm2020/pdf/pdf-command.directive.mjs +2 -2
  111. package/esm2020/pdf/pdf-margin.component.mjs +9 -0
  112. package/esm2020/rendering/cell-template.directive.mjs +1 -1
  113. package/esm2020/rendering/cell.component.mjs +73 -20
  114. package/esm2020/rendering/common/spacer.component.mjs +1 -1
  115. package/esm2020/rendering/constants.mjs +4 -0
  116. package/esm2020/rendering/header/header.component.mjs +6 -1
  117. package/esm2020/rendering/list.component.mjs +20 -18
  118. package/esm2020/rendering/table-body.component.mjs +5 -3
  119. package/esm2020/row-reordering/flat-reorder.service.mjs +48 -0
  120. package/esm2020/row-reordering/hierarchical-reorder.service.mjs +55 -0
  121. package/esm2020/row-reordering/row-reorder.service.mjs +220 -0
  122. package/esm2020/row-reordering/types.mjs +5 -0
  123. package/esm2020/row-reordering/utils.mjs +129 -0
  124. package/esm2020/shared.module.mjs +8 -3
  125. package/esm2020/treelist.component.mjs +229 -321
  126. package/esm2020/treelist.module.mjs +71 -66
  127. package/excel/excel-command.directive.d.ts +1 -1
  128. package/excel/excel-export-data.interface.d.ts +1 -1
  129. package/excel/excel.component.d.ts +9 -8
  130. package/fesm2015/progress-kendo-angular-treelist.mjs +1434 -832
  131. package/fesm2020/progress-kendo-angular-treelist.mjs +1426 -833
  132. package/filtering/cell/autocomplete-filter-cell.component.d.ts +4 -0
  133. package/filtering/cell/boolean-filter-cell.component.d.ts +19 -11
  134. package/filtering/cell/date-filter-cell.component.d.ts +15 -11
  135. package/filtering/cell/filter-cell-operators.component.d.ts +29 -1
  136. package/filtering/cell/numeric-filter-cell.component.d.ts +17 -12
  137. package/filtering/cell/string-filter-cell.component.d.ts +16 -11
  138. package/filtering/date-filter.component.d.ts +7 -11
  139. package/filtering/filter-input.directive.d.ts +7 -1
  140. package/filtering/menu/boolean-filter-menu.component.d.ts +19 -13
  141. package/filtering/menu/date-filter-menu.component.d.ts +12 -12
  142. package/filtering/menu/numeric-filter-menu.component.d.ts +12 -12
  143. package/filtering/menu/string-filter-menu-input.component.d.ts +4 -0
  144. package/filtering/menu/string-filter-menu.component.d.ts +15 -0
  145. package/filtering/numeric-filter.component.d.ts +4 -1
  146. package/filtering/operators/after-eq-filter-operator.component.d.ts +4 -0
  147. package/filtering/operators/after-filter-operator.component.d.ts +4 -0
  148. package/filtering/operators/before-eq-filter-operator.component.d.ts +4 -0
  149. package/filtering/operators/before-filter-operator.component.d.ts +4 -0
  150. package/filtering/operators/contains-filter-operator.component.d.ts +1 -4
  151. package/filtering/operators/ends-with-filter-operator.component.d.ts +1 -4
  152. package/filtering/operators/eq-filter-operator.component.d.ts +1 -4
  153. package/filtering/operators/gte-filter-operator.component.d.ts +1 -4
  154. package/filtering/operators/is-empty-filter-operator.component.d.ts +1 -4
  155. package/filtering/operators/is-not-empty-filter-operator.component.d.ts +1 -4
  156. package/filtering/operators/is-not-null-filter-operator.component.d.ts +1 -4
  157. package/filtering/operators/isnull-filter-operator.component.d.ts +1 -4
  158. package/filtering/operators/lt-filter-operator.component.d.ts +4 -0
  159. package/filtering/operators/neq-filter-operator.component.d.ts +1 -4
  160. package/filtering/operators/not-contains-filter-operator.component.d.ts +1 -4
  161. package/filtering/operators/starts-with-filter-operator.component.d.ts +1 -4
  162. package/filtering/string-filter.component.d.ts +2 -1
  163. package/index.d.ts +2 -0
  164. package/localization/custom-messages.component.d.ts +1 -1
  165. package/localization/messages.d.ts +42 -2
  166. package/navigation/navigation-cell.interface.d.ts +1 -4
  167. package/navigation/navigation-row.interface.d.ts +1 -4
  168. package/package.json +16 -15
  169. package/pager/pager-element.component.d.ts +9 -0
  170. package/pager/pager-next-buttons.component.d.ts +0 -3
  171. package/pager/pager-numeric-buttons.component.d.ts +1 -1
  172. package/pager/pager-prev-buttons.component.d.ts +0 -3
  173. package/pager/pager-settings.d.ts +1 -15
  174. package/pager/pager-template.directive.d.ts +1 -1
  175. package/pdf/pdf-command.directive.d.ts +1 -1
  176. package/pdf/pdf-margin.component.d.ts +9 -0
  177. package/rendering/cell-template.directive.d.ts +1 -1
  178. package/rendering/cell.component.d.ts +10 -1
  179. package/rendering/common/spacer.component.d.ts +1 -1
  180. package/rendering/constants.d.ts +4 -0
  181. package/rendering/header/header.component.d.ts +1 -0
  182. package/row-reordering/flat-reorder.service.d.ts +16 -0
  183. package/row-reordering/hierarchical-reorder.service.d.ts +16 -0
  184. package/row-reordering/row-reorder.service.d.ts +61 -0
  185. package/row-reordering/types.d.ts +39 -0
  186. package/row-reordering/utils.d.ts +85 -0
  187. package/schematics/ngAdd/index.js +3 -3
  188. package/scrolling/content-scroll-event.d.ts +1 -1
  189. package/scrolling/scroll-bottom-event.d.ts +1 -1
  190. package/scrolling/scroll-request.service.d.ts +6 -0
  191. package/selection/selectable-settings.d.ts +5 -15
  192. package/selection/selectable.directive.d.ts +1 -1
  193. package/selection/selection-change-event.d.ts +1 -1
  194. package/shared.module.d.ts +5 -4
  195. package/treelist.component.d.ts +66 -289
  196. package/treelist.module.d.ts +68 -66
@@ -0,0 +1,220 @@
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 { EventEmitter, Injectable, Output, Renderer2 } from '@angular/core';
6
+ import { isDocumentAvailable, isPresent } from '@progress/kendo-angular-common';
7
+ import { getOffset, isNextSibling, isPreviousSibling, dropPosition, hintIcons, hintSVGIcons, hintClasses, hintStyles, dropIndicatorClasses, dropIndicatorStyles, defaultSelectors, rowIndexAttr } from './utils';
8
+ import * as i0 from "@angular/core";
9
+ /**
10
+ * @hidden
11
+ */
12
+ export class RowReorderService {
13
+ constructor(renderer) {
14
+ this.renderer = renderer;
15
+ this.defaultSelectors = defaultSelectors;
16
+ this.dragTarget = null;
17
+ this.dropTarget = null;
18
+ this.lastDropPosition = dropPosition.forbidden;
19
+ this.hintElement = null;
20
+ this.rowReorder = new EventEmitter();
21
+ }
22
+ press(ev) {
23
+ this.dragTarget = ev.dragTarget;
24
+ this.offsetY = ev.dragEvent.offsetY;
25
+ }
26
+ dragStart() {
27
+ this.createDropIndicator();
28
+ }
29
+ drag(ev) {
30
+ if (isPresent(ev.hintElement) && !isPresent(this.hintElement)) {
31
+ this.hintElement = ev.hintElement;
32
+ this.decorateHint();
33
+ }
34
+ const position = {
35
+ x: ev.dragEvent.clientX,
36
+ y: ev.dragEvent.clientY - this.offsetY
37
+ };
38
+ if (isPresent(this.hintElement)) {
39
+ this.renderer.setStyle(this.hintElement, 'left', `${position.x}px`);
40
+ this.renderer.setStyle(this.hintElement, 'top', `${position.y}px`);
41
+ }
42
+ this.positionDropIndicator(ev);
43
+ }
44
+ dragEnter(ev) {
45
+ this.dropTarget = ev.dropTarget;
46
+ this.view = ev.dragData;
47
+ }
48
+ dragLeave() {
49
+ this.dropTarget = null;
50
+ this.lastDropPosition === dropPosition.forbidden && this.hide();
51
+ }
52
+ dragEnd() {
53
+ this.destroyDropIndicator();
54
+ this.dragTarget = null;
55
+ this.dropTarget = null;
56
+ this.hintElement = null;
57
+ }
58
+ drop() {
59
+ this.destroyDropIndicator();
60
+ const rowReorderArgs = this.rowReorderArgs(this.dragTarget, this.dropTarget, this.view);
61
+ this.rowReorder.emit(rowReorderArgs);
62
+ }
63
+ get hintIcon() {
64
+ return hintIcons[this.lastDropPosition];
65
+ }
66
+ get hintSVGIcon() {
67
+ return hintSVGIcons[this.lastDropPosition];
68
+ }
69
+ getDefaultHintText(columns, data) {
70
+ let hintText = '';
71
+ const columnFieldsArray = columns
72
+ .toArray()
73
+ .filter(column => !column.hidden && isPresent(column.field))
74
+ .map(column => column.field);
75
+ const draggedDragRow = this.getDragRowPerElement(this.dragTarget, data);
76
+ const draggedDataItem = draggedDragRow?.dataItem;
77
+ isPresent(draggedDataItem) && columnFieldsArray.forEach(column => {
78
+ const columnValue = draggedDataItem[column];
79
+ isPresent(columnValue) ? hintText += `${columnValue} ` : null;
80
+ });
81
+ return hintText.trim();
82
+ }
83
+ rowReorderArgs(dragRow, dropRow, data) {
84
+ const dragRowData = this.getDragRowPerElement(dragRow, data);
85
+ const dropRowData = this.getDragRowPerElement(dropRow, data);
86
+ return {
87
+ draggedRows: [dragRowData],
88
+ dropTargetRow: dropRowData,
89
+ dropPosition: this.lastDropPosition
90
+ };
91
+ }
92
+ isOverChild(_item) { return false; }
93
+ reorderRows(_ev, _collection, _field) { }
94
+ get parentIdField() {
95
+ return this.bindingDirective.parentIdField;
96
+ }
97
+ get idField() {
98
+ return this.bindingDirective.idField;
99
+ }
100
+ get childrenField() {
101
+ return this.bindingDirective.childrenField;
102
+ }
103
+ get data() {
104
+ return this.bindingDirective.data;
105
+ }
106
+ getDragRowPerElement(row, data) {
107
+ let rowIndex = row?.getAttribute(rowIndexAttr);
108
+ rowIndex = rowIndex ? parseInt(rowIndex, 10) : -1;
109
+ const dataItem = rowIndex === -1 ? null : data?.at(rowIndex)?.data;
110
+ return {
111
+ dataItem,
112
+ rowIndex,
113
+ element: row
114
+ };
115
+ }
116
+ createDropIndicator() {
117
+ if (!isDocumentAvailable()) {
118
+ return;
119
+ }
120
+ this.dropIndicator = document.createElement('div');
121
+ this.decorateDropIndicator();
122
+ this.dropIndicator.innerHTML = `
123
+ <div class="k-drop-hint-start"></div>
124
+ <div class="k-drop-hint-line"></div>
125
+ `;
126
+ document.body.appendChild(this.dropIndicator);
127
+ this.hide();
128
+ }
129
+ destroyDropIndicator() {
130
+ if (!isDocumentAvailable()) {
131
+ return;
132
+ }
133
+ ;
134
+ if (this.dropIndicator && this.dropIndicator.parentElement) {
135
+ document.body.removeChild(this.dropIndicator);
136
+ this.dropIndicator = null;
137
+ }
138
+ }
139
+ decorateHint() {
140
+ hintClasses.forEach(className => this.renderer.addClass(this.hintElement, className));
141
+ Object.keys(hintStyles)
142
+ .forEach(style => this.renderer.setStyle(this.hintElement, style, hintStyles[style]));
143
+ }
144
+ positionDropIndicator(ev) {
145
+ this.lastDropPosition = this.getDropPosition(ev.dragEvent);
146
+ this.updateDropIndicatorPosition();
147
+ }
148
+ decorateDropIndicator() {
149
+ dropIndicatorClasses.forEach(className => this.renderer.addClass(this.dropIndicator, className));
150
+ Object.keys(dropIndicatorStyles)
151
+ .forEach(style => this.renderer.setStyle(this.dropIndicator, style, dropIndicatorStyles[style]));
152
+ }
153
+ getDropPosition(e) {
154
+ if (this.dropTarget === this.dragTarget || !isPresent(this.dropTarget)) {
155
+ return dropPosition.forbidden;
156
+ }
157
+ ;
158
+ const itemViewPortCoords = this.dropTarget.getBoundingClientRect();
159
+ const itemDivisionsCount = 3;
160
+ const itemDivisionHeight = itemViewPortCoords.height / itemDivisionsCount;
161
+ const { dropTargetRow } = this.rowReorderArgs(this.dragTarget, this.dropTarget, this.view);
162
+ const pointerPosition = e.clientY;
163
+ const itemTop = itemViewPortCoords.top;
164
+ let currentDropPosition = null;
165
+ if (pointerPosition <= itemTop + itemDivisionHeight) {
166
+ currentDropPosition = dropPosition.before;
167
+ }
168
+ else if (pointerPosition >= itemTop + itemViewPortCoords.height - itemDivisionHeight) {
169
+ currentDropPosition = dropPosition.after;
170
+ }
171
+ else {
172
+ currentDropPosition = dropPosition.over;
173
+ }
174
+ if (currentDropPosition === dropPosition.before && isNextSibling(this.dropTarget, this.dragTarget)) {
175
+ currentDropPosition = dropPosition.forbidden;
176
+ }
177
+ else if (currentDropPosition === dropPosition.after && isPreviousSibling(this.dropTarget, this.dragTarget)) {
178
+ currentDropPosition = dropPosition.forbidden;
179
+ }
180
+ if (this.isOverChild(dropTargetRow.dataItem)) {
181
+ currentDropPosition = dropPosition.forbidden;
182
+ }
183
+ return currentDropPosition;
184
+ }
185
+ updateDropIndicatorPosition() {
186
+ if (this.shouldHideDropIndicator() || !this.dropTarget) {
187
+ this.hide();
188
+ return;
189
+ }
190
+ this.show();
191
+ const destinationItemOffset = getOffset(this.dropTarget);
192
+ let indicatorOffsetTop = destinationItemOffset.top;
193
+ const indicatorOffsetLeft = destinationItemOffset.left + this.dropIndicator.offsetWidth / 2;
194
+ if (this.lastDropPosition === dropPosition.after) {
195
+ indicatorOffsetTop += this.dropTarget.offsetHeight;
196
+ }
197
+ this.renderer.setStyle(this.dropIndicator, 'left', `${indicatorOffsetLeft}px`);
198
+ this.renderer.setStyle(this.dropIndicator, 'top', `${indicatorOffsetTop}px`);
199
+ }
200
+ shouldHideDropIndicator() {
201
+ return this.lastDropPosition === dropPosition.forbidden || this.lastDropPosition === dropPosition.over;
202
+ }
203
+ hide() {
204
+ if (isPresent(this.dropIndicator)) {
205
+ this.renderer.setStyle(this.dropIndicator, 'display', 'none');
206
+ }
207
+ }
208
+ show() {
209
+ if (isPresent(this.dropIndicator)) {
210
+ this.renderer.removeStyle(this.dropIndicator, 'display');
211
+ }
212
+ }
213
+ }
214
+ RowReorderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: RowReorderService, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Injectable });
215
+ RowReorderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: RowReorderService });
216
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: RowReorderService, decorators: [{
217
+ type: Injectable
218
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }]; }, propDecorators: { rowReorder: [{
219
+ type: Output
220
+ }] } });
@@ -0,0 +1,5 @@
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
+ export {};
@@ -0,0 +1,129 @@
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 { cancelIcon, insertMiddleIcon, plusIcon } from '@progress/kendo-svg-icons';
6
+ /**
7
+ * @hidden
8
+ */
9
+ export const isNextSibling = (dropTarget, dragTarget) => dropTarget === dragTarget.nextElementSibling;
10
+ /**
11
+ * @hidden
12
+ */
13
+ export const isPreviousSibling = (dropTarget, dragTarget) => dropTarget === dragTarget.previousElementSibling;
14
+ /**
15
+ * @hidden
16
+ */
17
+ export function getOffset(element) {
18
+ const { clientTop, clientLeft } = getDocument(element);
19
+ const { pageYOffset, pageXOffset } = getWindow(element);
20
+ const { top, left } = element.getBoundingClientRect();
21
+ return {
22
+ top: top + pageYOffset - clientTop,
23
+ left: left + pageXOffset - clientLeft
24
+ };
25
+ }
26
+ ;
27
+ /**
28
+ * @hidden
29
+ */
30
+ export const hintIcons = {
31
+ forbidden: 'cancel',
32
+ before: 'insert-middle',
33
+ after: 'insert-middle',
34
+ over: 'plus'
35
+ };
36
+ /**
37
+ * @hidden
38
+ */
39
+ export const hintSVGIcons = {
40
+ forbidden: cancelIcon,
41
+ before: insertMiddleIcon,
42
+ after: insertMiddleIcon,
43
+ over: plusIcon
44
+ };
45
+ /**
46
+ * @hidden
47
+ */
48
+ export const dropPosition = {
49
+ forbidden: 'forbidden',
50
+ before: 'before',
51
+ after: 'after',
52
+ over: 'over'
53
+ };
54
+ /**
55
+ * @hidden
56
+ */
57
+ export const hintStyles = {
58
+ zIndex: '20000',
59
+ display: 'flex',
60
+ position: 'fixed'
61
+ };
62
+ /**
63
+ * @hidden
64
+ */
65
+ export const hintClasses = ['k-drag-clue', 'k-reorder-clue'];
66
+ /**
67
+ * @hidden
68
+ */
69
+ export const dropIndicatorStyles = {
70
+ zIndex: '19000',
71
+ position: 'absolute'
72
+ };
73
+ /**
74
+ * @hidden
75
+ */
76
+ export const dropIndicatorClasses = ['k-drop-hint', 'k-drop-hint-h'];
77
+ /**
78
+ * @hidden
79
+ */
80
+ export const defaultSelectors = {
81
+ handle: '.k-table-td.k-drag-cell',
82
+ dragTarget: '.k-table-row[data-treelist-view-index]',
83
+ dropTarget: '.k-table-row[data-treelist-view-index]'
84
+ };
85
+ /**
86
+ * @hidden
87
+ */
88
+ export const rowIndexAttr = 'data-treelist-view-index';
89
+ /**
90
+ * @hidden
91
+ */
92
+ export const findParent = (collection, searchItem, field) => {
93
+ let parent = null;
94
+ for (const item of collection) {
95
+ if (searchItem === item) {
96
+ return null;
97
+ }
98
+ const checked = [];
99
+ const queue = [];
100
+ queue.push(item);
101
+ while (queue.length !== 0) {
102
+ const current = queue.shift();
103
+ if (!current) {
104
+ continue;
105
+ }
106
+ checked.push(current);
107
+ if (current === searchItem) {
108
+ return item;
109
+ }
110
+ if (current.hasOwnProperty(field)) {
111
+ current[field].forEach(node => {
112
+ if (checked.indexOf(node) === -1) {
113
+ checked.push(node);
114
+ queue.push(node);
115
+ if (node === searchItem) {
116
+ parent = current;
117
+ return;
118
+ }
119
+ }
120
+ });
121
+ }
122
+ if (parent) {
123
+ return parent;
124
+ }
125
+ }
126
+ }
127
+ };
128
+ const getDocument = element => element?.ownerDocument.documentElement;
129
+ const getWindow = element => element?.ownerDocument.defaultView;
@@ -19,6 +19,7 @@ import { FieldAccessorPipe } from "./rendering/common/field-accessor.pipe";
19
19
  import { TableDirective } from "./column-resizing/table.directive";
20
20
  import { FocusableDirective } from "./navigation/focusable.directive";
21
21
  import { IconsModule } from '@progress/kendo-angular-icons';
22
+ import { RowReorderColumnComponent } from './columns/rowreorder-column.component';
22
23
  import * as i0 from "@angular/core";
23
24
  const exportedModules = [
24
25
  ColumnComponent,
@@ -33,7 +34,8 @@ const exportedModules = [
33
34
  SpanColumnComponent,
34
35
  TableDirective,
35
36
  LoadingComponent,
36
- CheckboxColumnComponent
37
+ CheckboxColumnComponent,
38
+ RowReorderColumnComponent
37
39
  ];
38
40
  /**
39
41
  * @hidden
@@ -44,6 +46,7 @@ export class SharedModule {
44
46
  ColumnComponent,
45
47
  SpanColumnComponent,
46
48
  CheckboxColumnComponent,
49
+ RowReorderColumnComponent,
47
50
  ColumnGroupComponent,
48
51
  FocusableDirective
49
52
  ];
@@ -62,7 +65,8 @@ SharedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "
62
65
  SpanColumnComponent,
63
66
  TableDirective,
64
67
  LoadingComponent,
65
- CheckboxColumnComponent], imports: [CommonModule, IconsModule], exports: [ColumnComponent,
68
+ CheckboxColumnComponent,
69
+ RowReorderColumnComponent], imports: [CommonModule, IconsModule], exports: [ColumnComponent,
66
70
  ColumnGroupComponent,
67
71
  LogicalCellDirective,
68
72
  LogicalRowDirective,
@@ -74,7 +78,8 @@ SharedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "
74
78
  SpanColumnComponent,
75
79
  TableDirective,
76
80
  LoadingComponent,
77
- CheckboxColumnComponent, DraggableModule, IconsModule] });
81
+ CheckboxColumnComponent,
82
+ RowReorderColumnComponent, DraggableModule, IconsModule] });
78
83
  SharedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SharedModule, imports: [[CommonModule, IconsModule], DraggableModule, IconsModule] });
79
84
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SharedModule, decorators: [{
80
85
  type: NgModule,