@progress/kendo-angular-grid 18.0.0-develop.2 → 18.0.0-develop.4

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.
@@ -83,6 +83,12 @@ export class CellComponent {
83
83
  this._editTemplateContext.rowIndex = this.rowIndex;
84
84
  return this._editTemplateContext;
85
85
  }
86
+ get rowReorderTemplateContext() {
87
+ this._rowReorderTemplateContext.$implicit = this.dataItem;
88
+ this._rowReorderTemplateContext.columnIndex = this.columnIndex;
89
+ this._rowReorderTemplateContext.rowIndex = this.rowIndex;
90
+ return this._rowReorderTemplateContext;
91
+ }
86
92
  get format() {
87
93
  if (isColumnComponent(this.column) && !isNullOrEmptyString(this.column.format)) {
88
94
  return extractFormat(this.column.format);
@@ -122,6 +128,7 @@ export class CellComponent {
122
128
  }
123
129
  _templateContext = {};
124
130
  _editTemplateContext = {};
131
+ _rowReorderTemplateContext = {};
125
132
  constructor(editService, idService, ctx, cellContext) {
126
133
  this.editService = editService;
127
134
  this.idService = idService;
@@ -199,10 +206,14 @@ export class CellComponent {
199
206
  </ng-template>
200
207
  </ng-container>
201
208
  <ng-container *ngIf="isRowReorderColumn && !isNew">
202
- <kendo-icon-wrapper
209
+ <kendo-icon-wrapper *ngIf="!column.dragHandleTemplate?.first"
203
210
  name="reorder"
204
211
  [svgIcon]="reorderIcon">
205
212
  </kendo-icon-wrapper>
213
+ <ng-template *ngIf="column.dragHandleTemplate?.first"
214
+ [ngTemplateOutlet]="column.rowDragHandleTemplateRef"
215
+ [ngTemplateOutletContext]="rowReorderTemplateContext">
216
+ </ng-template>
206
217
  </ng-container>
207
218
  </ng-container>
208
219
  <ng-template #loading>
@@ -287,10 +298,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
287
298
  </ng-template>
288
299
  </ng-container>
289
300
  <ng-container *ngIf="isRowReorderColumn && !isNew">
290
- <kendo-icon-wrapper
301
+ <kendo-icon-wrapper *ngIf="!column.dragHandleTemplate?.first"
291
302
  name="reorder"
292
303
  [svgIcon]="reorderIcon">
293
304
  </kendo-icon-wrapper>
305
+ <ng-template *ngIf="column.dragHandleTemplate?.first"
306
+ [ngTemplateOutlet]="column.rowDragHandleTemplateRef"
307
+ [ngTemplateOutletContext]="rowReorderTemplateContext">
308
+ </ng-template>
294
309
  </ng-container>
295
310
  </ng-container>
296
311
  <ng-template #loading>
@@ -0,0 +1,45 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { Directive, TemplateRef, Optional } from '@angular/core';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * Represents the column row reorder cell template of the Grid.
9
+ * Helps to customize the content of the drag handle cells. To define the cell template, nest an `<ng-template>`
10
+ * tag with the `kendoGridRowDragHandleTemplate` directive inside the `<kendo-grid-rowreorder-column>` tag.
11
+ *
12
+ * The template context is set to the current data item and the following additional fields are passed:
13
+ * - `columnIndex`&mdash;The current column index. Use it as an alias for a template variable by utilizing the `let-columnIndex="columnIndex"` syntax.
14
+ * - `rowIndex`&mdash;The provided data row index. Use it as an alias for a template variable by utilizing the `let-rowIndex="rowIndex"` syntax.
15
+ *
16
+ * @example
17
+ * ```html
18
+ * <kendo-grid [kendoGridBinding]="data" [rowReorderable]="true">
19
+ * <kendo-grid-rowreorder-column>
20
+ * <ng-template kendoGridRowDragHandleTemplate>
21
+ * <span>Drag here</span>
22
+ * </ng-template>
23
+ * </kendo-grid-rowreorder-column>
24
+ * <kendo-grid-column field="Field1"></kendo-grid-column>
25
+ * <kendo-grid-column field="Field2"></kendo-grid-column>
26
+ * </kendo-grid>
27
+ * ```
28
+ */
29
+ export class RowDragHandleTemplateDirective {
30
+ templateRef;
31
+ constructor(templateRef) {
32
+ this.templateRef = templateRef;
33
+ }
34
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RowDragHandleTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
35
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: RowDragHandleTemplateDirective, isStandalone: true, selector: "[kendoGridRowDragHandleTemplate]", ngImport: i0 });
36
+ }
37
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RowDragHandleTemplateDirective, decorators: [{
38
+ type: Directive,
39
+ args: [{
40
+ selector: '[kendoGridRowDragHandleTemplate]',
41
+ standalone: true,
42
+ }]
43
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
44
+ type: Optional
45
+ }] }]; } });
@@ -0,0 +1,44 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { Directive, TemplateRef, Optional } from '@angular/core';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * Represents the drag hint template of the Grid.
9
+ * Helps to customize the content of the hint during row reordering. To define the hint template, nest an `<ng-template>`
10
+ * tag with the `kendoGridRowDragHintTemplate` directive inside the `<kendo-grid-rowreorder-column>` tag.
11
+ *
12
+ * The template context is set to the current data item.
13
+ * The provided data row index is passed as an additional field. Use it as an alias for a template variable by utilizing the `let-rowIndex="rowIndex"` syntax.
14
+ *
15
+ * @example
16
+ * ```html
17
+ * <kendo-grid [kendoGridBinding]="data" [rowReorderable]="true">
18
+ * <kendo-grid-rowreorder-column>
19
+ * <ng-template kendoGridRowDragHintTemplate>
20
+ * <span>Custom hint</span>
21
+ * </ng-template>
22
+ * </kendo-grid-rowreorder-column>
23
+ * <kendo-grid-column field="Field1"></kendo-grid-column>
24
+ * <kendo-grid-column field="Field2"></kendo-grid-column>
25
+ * </kendo-grid>
26
+ * ```
27
+ */
28
+ export class RowDragHintTemplateDirective {
29
+ templateRef;
30
+ constructor(templateRef) {
31
+ this.templateRef = templateRef;
32
+ }
33
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RowDragHintTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
34
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: RowDragHintTemplateDirective, isStandalone: true, selector: "[kendoGridRowDragHintTemplate]", ngImport: i0 });
35
+ }
36
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RowDragHintTemplateDirective, decorators: [{
37
+ type: Directive,
38
+ args: [{
39
+ selector: '[kendoGridRowDragHintTemplate]',
40
+ standalone: true,
41
+ }]
42
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
43
+ type: Optional
44
+ }] }]; } });
@@ -97,6 +97,9 @@ export class RowReorderService {
97
97
  });
98
98
  return hintText.trim();
99
99
  }
100
+ getDraggedRow(data) {
101
+ return this.getDragRowPerElement(this.dragTarget, data);
102
+ }
100
103
  rowReorderArgs(dragRow, dropRow, data) {
101
104
  const dragRowData = this.getDragRowPerElement(dragRow, data);
102
105
  const dropRowData = this.getDragRowPerElement(dropRow, data);