@progress/kendo-angular-grid 21.0.0-develop.11 → 21.0.0-develop.13

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.
@@ -511,6 +511,13 @@ export class NavigationService {
511
511
  const row = this.cursor.row;
512
512
  // on some keyboards arrow keys, PageUp/Down, and Home/End are mapped to Numpad keys
513
513
  const code = normalizeNumpadKeys(args);
514
+ // Handle row reordering keyboard shortcuts (Ctrl/Cmd + Shift + Up/Down Arrow)
515
+ if (modifier && args.shiftKey && (code === Keys.ArrowUp || code === Keys.ArrowDown)) {
516
+ if (this.handleRowReorderKeyboard(args, code, row)) {
517
+ args.preventDefault();
518
+ return;
519
+ }
520
+ }
514
521
  const dir = code === Keys.ArrowDown ? 'Down' : 'Up';
515
522
  const right = code === Keys.ArrowRight;
516
523
  const isArrowKey = code === Keys.ArrowDown || code === Keys.ArrowUp || code === Keys.ArrowLeft || code === Keys.ArrowRight;
@@ -518,6 +525,9 @@ export class NavigationService {
518
525
  startNewSelection = true;
519
526
  this.isShiftPressed = true;
520
527
  }
528
+ const cellElement = args.target;
529
+ const isDragCell = cellElement ? closest(cellElement, (el) => hasClasses(el, 'k-drag-cell')) : false;
530
+ const isRowReorderable = this.ctx.grid.rowReorderable;
521
531
  switch (code) {
522
532
  case Keys.ArrowDown:
523
533
  case Keys.ArrowUp:
@@ -525,7 +535,7 @@ export class NavigationService {
525
535
  rowspanOffset = this.calculateRowspanOffset(dir, rowspan);
526
536
  step += rowspanOffset;
527
537
  }
528
- if (args.shiftKey) {
538
+ if (args.shiftKey && !(isDragCell && isRowReorderable)) {
529
539
  if (this.ctx.grid.blockArrowSelection) {
530
540
  return;
531
541
  }
@@ -873,6 +883,42 @@ export class NavigationService {
873
883
  get isStackedMode() {
874
884
  return this.ctx?.grid?.isStacked;
875
885
  }
886
+ handleRowReorderKeyboard(args, code, row) {
887
+ if (!this.ctx.grid.rowReorderable || !this.activeCell) {
888
+ return false;
889
+ }
890
+ const cell = this.activeCell;
891
+ const cellElement = args.target;
892
+ if (!cellElement) {
893
+ return false;
894
+ }
895
+ const dragCell = closest(cellElement, (el) => hasClasses(el, 'k-drag-cell'));
896
+ if (!dragCell || row.dataRowIndex < 0 || !row.dataItem) {
897
+ return false;
898
+ }
899
+ const isUpArrow = code === Keys.ArrowUp;
900
+ const currentRowIndex = row.dataRowIndex;
901
+ const data = this.ctx.grid.flatData;
902
+ if (!data || data.length === 0) {
903
+ return false;
904
+ }
905
+ const targetRowIndex = currentRowIndex + (isUpArrow ? -1 : 1);
906
+ if (targetRowIndex < 0 || targetRowIndex >= data.length) {
907
+ return false;
908
+ }
909
+ const dropPosition = isUpArrow ? 'before' : 'after';
910
+ this.zone.run(() => {
911
+ const skip = this.ctx.grid.skip || 0;
912
+ this.ctx.grid.rowReorderService.reorderViaKeyboard(currentRowIndex + skip, targetRowIndex + skip, dropPosition, data);
913
+ // Move focus to follow the reordered row
914
+ // After reordering, the row will be at the target position
915
+ this.zone.onStable.pipe(take(1)).subscribe(() => {
916
+ const newRowIndex = this.meta.headerRows + targetRowIndex;
917
+ this.cursor.reset(newRowIndex, cell.colIndex);
918
+ });
919
+ });
920
+ return true;
921
+ }
876
922
  handleStackedKeydown(args) {
877
923
  const target = args.target;
878
924
  const stackedCell = closest(target, (el) => hasClasses(el, 'k-grid-stack-cell'));
@@ -10,7 +10,7 @@ export const packageMetadata = {
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCode: 'KENDOUIANGULAR',
12
12
  productCodes: ['KENDOUIANGULAR'],
13
- publishDate: 1761916614,
14
- version: '21.0.0-develop.11',
13
+ publishDate: 1761925681,
14
+ version: '21.0.0-develop.13',
15
15
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
16
16
  };
@@ -108,6 +108,34 @@ export class RowReorderService {
108
108
  getDraggedRow(data) {
109
109
  return this.getDragRowPerElement(this.dragTarget, data);
110
110
  }
111
+ /**
112
+ * Triggers row reordering programmatically via keyboard shortcut.
113
+ * @param dragRowIndex - The index of the row to move
114
+ * @param dropRowIndex - The index of the target row
115
+ * @param dropPosition - The position relative to the target row ('before' or 'after')
116
+ * @param data - The data array
117
+ */
118
+ reorderViaKeyboard(dragRowIndex, dropRowIndex, dropPosition, data) {
119
+ if (dropPosition === 'forbidden') {
120
+ return;
121
+ }
122
+ const dragRow = this.createVirtualRowElement(dragRowIndex);
123
+ const dropRow = this.createVirtualRowElement(dropRowIndex);
124
+ this.lastDropPosition = dropPosition;
125
+ const rowReorderArgs = this.rowReorderArgs(dragRow, dropRow, data);
126
+ this.rowReorder.emit(rowReorderArgs);
127
+ }
128
+ createVirtualRowElement(rowIndex) {
129
+ const virtualElement = {
130
+ getAttribute: (attr) => {
131
+ if (attr === 'data-kendo-grid-item-index') {
132
+ return String(rowIndex);
133
+ }
134
+ return null;
135
+ }
136
+ };
137
+ return virtualElement;
138
+ }
111
139
  rowReorderArgs(dragRow, dropRow, data) {
112
140
  const dragRowData = this.getDragRowPerElement(dragRow, data);
113
141
  const dropRowData = this.getDragRowPerElement(dropRow, data);
@@ -3926,6 +3926,13 @@ class NavigationService {
3926
3926
  const row = this.cursor.row;
3927
3927
  // on some keyboards arrow keys, PageUp/Down, and Home/End are mapped to Numpad keys
3928
3928
  const code = normalizeNumpadKeys(args);
3929
+ // Handle row reordering keyboard shortcuts (Ctrl/Cmd + Shift + Up/Down Arrow)
3930
+ if (modifier && args.shiftKey && (code === Keys.ArrowUp || code === Keys.ArrowDown)) {
3931
+ if (this.handleRowReorderKeyboard(args, code, row)) {
3932
+ args.preventDefault();
3933
+ return;
3934
+ }
3935
+ }
3929
3936
  const dir = code === Keys.ArrowDown ? 'Down' : 'Up';
3930
3937
  const right = code === Keys.ArrowRight;
3931
3938
  const isArrowKey = code === Keys.ArrowDown || code === Keys.ArrowUp || code === Keys.ArrowLeft || code === Keys.ArrowRight;
@@ -3933,6 +3940,9 @@ class NavigationService {
3933
3940
  startNewSelection = true;
3934
3941
  this.isShiftPressed = true;
3935
3942
  }
3943
+ const cellElement = args.target;
3944
+ const isDragCell = cellElement ? closest(cellElement, (el) => hasClasses$1(el, 'k-drag-cell')) : false;
3945
+ const isRowReorderable = this.ctx.grid.rowReorderable;
3936
3946
  switch (code) {
3937
3947
  case Keys.ArrowDown:
3938
3948
  case Keys.ArrowUp:
@@ -3940,7 +3950,7 @@ class NavigationService {
3940
3950
  rowspanOffset = this.calculateRowspanOffset(dir, rowspan);
3941
3951
  step += rowspanOffset;
3942
3952
  }
3943
- if (args.shiftKey) {
3953
+ if (args.shiftKey && !(isDragCell && isRowReorderable)) {
3944
3954
  if (this.ctx.grid.blockArrowSelection) {
3945
3955
  return;
3946
3956
  }
@@ -4288,6 +4298,42 @@ class NavigationService {
4288
4298
  get isStackedMode() {
4289
4299
  return this.ctx?.grid?.isStacked;
4290
4300
  }
4301
+ handleRowReorderKeyboard(args, code, row) {
4302
+ if (!this.ctx.grid.rowReorderable || !this.activeCell) {
4303
+ return false;
4304
+ }
4305
+ const cell = this.activeCell;
4306
+ const cellElement = args.target;
4307
+ if (!cellElement) {
4308
+ return false;
4309
+ }
4310
+ const dragCell = closest(cellElement, (el) => hasClasses$1(el, 'k-drag-cell'));
4311
+ if (!dragCell || row.dataRowIndex < 0 || !row.dataItem) {
4312
+ return false;
4313
+ }
4314
+ const isUpArrow = code === Keys.ArrowUp;
4315
+ const currentRowIndex = row.dataRowIndex;
4316
+ const data = this.ctx.grid.flatData;
4317
+ if (!data || data.length === 0) {
4318
+ return false;
4319
+ }
4320
+ const targetRowIndex = currentRowIndex + (isUpArrow ? -1 : 1);
4321
+ if (targetRowIndex < 0 || targetRowIndex >= data.length) {
4322
+ return false;
4323
+ }
4324
+ const dropPosition = isUpArrow ? 'before' : 'after';
4325
+ this.zone.run(() => {
4326
+ const skip = this.ctx.grid.skip || 0;
4327
+ this.ctx.grid.rowReorderService.reorderViaKeyboard(currentRowIndex + skip, targetRowIndex + skip, dropPosition, data);
4328
+ // Move focus to follow the reordered row
4329
+ // After reordering, the row will be at the target position
4330
+ this.zone.onStable.pipe(take(1)).subscribe(() => {
4331
+ const newRowIndex = this.meta.headerRows + targetRowIndex;
4332
+ this.cursor.reset(newRowIndex, cell.colIndex);
4333
+ });
4334
+ });
4335
+ return true;
4336
+ }
4291
4337
  handleStackedKeydown(args) {
4292
4338
  const target = args.target;
4293
4339
  const stackedCell = closest(target, (el) => hasClasses$1(el, 'k-grid-stack-cell'));
@@ -22896,8 +22942,8 @@ const packageMetadata = {
22896
22942
  productName: 'Kendo UI for Angular',
22897
22943
  productCode: 'KENDOUIANGULAR',
22898
22944
  productCodes: ['KENDOUIANGULAR'],
22899
- publishDate: 1761916614,
22900
- version: '21.0.0-develop.11',
22945
+ publishDate: 1761925681,
22946
+ version: '21.0.0-develop.13',
22901
22947
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
22902
22948
  };
22903
22949
 
@@ -24069,6 +24115,34 @@ class RowReorderService {
24069
24115
  getDraggedRow(data) {
24070
24116
  return this.getDragRowPerElement(this.dragTarget, data);
24071
24117
  }
24118
+ /**
24119
+ * Triggers row reordering programmatically via keyboard shortcut.
24120
+ * @param dragRowIndex - The index of the row to move
24121
+ * @param dropRowIndex - The index of the target row
24122
+ * @param dropPosition - The position relative to the target row ('before' or 'after')
24123
+ * @param data - The data array
24124
+ */
24125
+ reorderViaKeyboard(dragRowIndex, dropRowIndex, dropPosition, data) {
24126
+ if (dropPosition === 'forbidden') {
24127
+ return;
24128
+ }
24129
+ const dragRow = this.createVirtualRowElement(dragRowIndex);
24130
+ const dropRow = this.createVirtualRowElement(dropRowIndex);
24131
+ this.lastDropPosition = dropPosition;
24132
+ const rowReorderArgs = this.rowReorderArgs(dragRow, dropRow, data);
24133
+ this.rowReorder.emit(rowReorderArgs);
24134
+ }
24135
+ createVirtualRowElement(rowIndex) {
24136
+ const virtualElement = {
24137
+ getAttribute: (attr) => {
24138
+ if (attr === 'data-kendo-grid-item-index') {
24139
+ return String(rowIndex);
24140
+ }
24141
+ return null;
24142
+ }
24143
+ };
24144
+ return virtualElement;
24145
+ }
24072
24146
  rowReorderArgs(dragRow, dropRow, data) {
24073
24147
  const dragRowData = this.getDragRowPerElement(dragRow, data);
24074
24148
  const dropRowData = this.getDragRowPerElement(dropRow, data);
@@ -126,6 +126,7 @@ export declare class NavigationService implements OnDestroy {
126
126
  private handleMultipleArrowRowSelection;
127
127
  private calculateRowspanOffset;
128
128
  private get isStackedMode();
129
+ private handleRowReorderKeyboard;
129
130
  private handleStackedKeydown;
130
131
  stackedFocusedCellIndex: number;
131
132
  tableCellEntered: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-angular-grid",
3
- "version": "21.0.0-develop.11",
3
+ "version": "21.0.0-develop.13",
4
4
  "description": "Kendo UI Grid for Angular - high performance data grid with paging, filtering, virtualization, CRUD, and more.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",
@@ -41,7 +41,7 @@
41
41
  "package": {
42
42
  "productName": "Kendo UI for Angular",
43
43
  "productCode": "KENDOUIANGULAR",
44
- "publishDate": 1761916614,
44
+ "publishDate": 1761925681,
45
45
  "licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
46
46
  }
47
47
  },
@@ -54,32 +54,32 @@
54
54
  "@progress/kendo-data-query": "^1.0.0",
55
55
  "@progress/kendo-drawing": "^1.21.0",
56
56
  "@progress/kendo-licensing": "^1.7.0",
57
- "@progress/kendo-angular-buttons": "21.0.0-develop.11",
58
- "@progress/kendo-angular-common": "21.0.0-develop.11",
59
- "@progress/kendo-angular-dateinputs": "21.0.0-develop.11",
60
- "@progress/kendo-angular-layout": "21.0.0-develop.11",
61
- "@progress/kendo-angular-navigation": "21.0.0-develop.11",
62
- "@progress/kendo-angular-dropdowns": "21.0.0-develop.11",
63
- "@progress/kendo-angular-excel-export": "21.0.0-develop.11",
64
- "@progress/kendo-angular-icons": "21.0.0-develop.11",
65
- "@progress/kendo-angular-indicators": "21.0.0-develop.11",
66
- "@progress/kendo-angular-inputs": "21.0.0-develop.11",
67
- "@progress/kendo-angular-conversational-ui": "21.0.0-develop.11",
68
- "@progress/kendo-angular-intl": "21.0.0-develop.11",
69
- "@progress/kendo-angular-l10n": "21.0.0-develop.11",
70
- "@progress/kendo-angular-label": "21.0.0-develop.11",
71
- "@progress/kendo-angular-menu": "21.0.0-develop.11",
72
- "@progress/kendo-angular-pager": "21.0.0-develop.11",
73
- "@progress/kendo-angular-pdf-export": "21.0.0-develop.11",
74
- "@progress/kendo-angular-popup": "21.0.0-develop.11",
75
- "@progress/kendo-angular-toolbar": "21.0.0-develop.11",
76
- "@progress/kendo-angular-upload": "21.0.0-develop.11",
77
- "@progress/kendo-angular-utils": "21.0.0-develop.11",
57
+ "@progress/kendo-angular-buttons": "21.0.0-develop.13",
58
+ "@progress/kendo-angular-common": "21.0.0-develop.13",
59
+ "@progress/kendo-angular-dateinputs": "21.0.0-develop.13",
60
+ "@progress/kendo-angular-layout": "21.0.0-develop.13",
61
+ "@progress/kendo-angular-navigation": "21.0.0-develop.13",
62
+ "@progress/kendo-angular-dropdowns": "21.0.0-develop.13",
63
+ "@progress/kendo-angular-excel-export": "21.0.0-develop.13",
64
+ "@progress/kendo-angular-icons": "21.0.0-develop.13",
65
+ "@progress/kendo-angular-indicators": "21.0.0-develop.13",
66
+ "@progress/kendo-angular-inputs": "21.0.0-develop.13",
67
+ "@progress/kendo-angular-conversational-ui": "21.0.0-develop.13",
68
+ "@progress/kendo-angular-intl": "21.0.0-develop.13",
69
+ "@progress/kendo-angular-l10n": "21.0.0-develop.13",
70
+ "@progress/kendo-angular-label": "21.0.0-develop.13",
71
+ "@progress/kendo-angular-menu": "21.0.0-develop.13",
72
+ "@progress/kendo-angular-pager": "21.0.0-develop.13",
73
+ "@progress/kendo-angular-pdf-export": "21.0.0-develop.13",
74
+ "@progress/kendo-angular-popup": "21.0.0-develop.13",
75
+ "@progress/kendo-angular-toolbar": "21.0.0-develop.13",
76
+ "@progress/kendo-angular-upload": "21.0.0-develop.13",
77
+ "@progress/kendo-angular-utils": "21.0.0-develop.13",
78
78
  "rxjs": "^6.5.3 || ^7.0.0"
79
79
  },
80
80
  "dependencies": {
81
81
  "tslib": "^2.3.1",
82
- "@progress/kendo-angular-schematics": "21.0.0-develop.11",
82
+ "@progress/kendo-angular-schematics": "21.0.0-develop.13",
83
83
  "@progress/kendo-common": "^1.0.1",
84
84
  "@progress/kendo-file-saver": "^1.0.0"
85
85
  },
@@ -4,7 +4,7 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { DragTargetPressEvent, DragTargetDragEvent, DropTargetEvent } from '@progress/kendo-angular-utils';
6
6
  import { EventEmitter, Renderer2 } from '@angular/core';
7
- import { RowReorderEvent } from './types';
7
+ import { DropPosition, RowReorderEvent } from './types';
8
8
  import { SVGIcon } from '@progress/kendo-svg-icons';
9
9
  import { ColumnList } from '../columns/column-list';
10
10
  import * as i0 from "@angular/core";
@@ -41,6 +41,15 @@ export declare class RowReorderService {
41
41
  get hintSVGIcon(): SVGIcon;
42
42
  getDefaultHintText(columns: ColumnList, data: any[]): string;
43
43
  getDraggedRow(data: any): any;
44
+ /**
45
+ * Triggers row reordering programmatically via keyboard shortcut.
46
+ * @param dragRowIndex - The index of the row to move
47
+ * @param dropRowIndex - The index of the target row
48
+ * @param dropPosition - The position relative to the target row ('before' or 'after')
49
+ * @param data - The data array
50
+ */
51
+ reorderViaKeyboard(dragRowIndex: number, dropRowIndex: number, dropPosition: DropPosition, data: Array<any>): void;
52
+ private createVirtualRowElement;
44
53
  private rowReorderArgs;
45
54
  private getDragRowPerElement;
46
55
  private createDropIndicator;
@@ -5,19 +5,19 @@ const schematics_1 = require("@angular-devkit/schematics");
5
5
  function default_1(options) {
6
6
  const finalOptions = Object.assign(Object.assign({}, options), { mainNgModule: 'GridModule', package: 'grid', peerDependencies: {
7
7
  // peer deps of the dropdowns
8
- '@progress/kendo-angular-treeview': '21.0.0-develop.11',
9
- '@progress/kendo-angular-navigation': '21.0.0-develop.11',
8
+ '@progress/kendo-angular-treeview': '21.0.0-develop.13',
9
+ '@progress/kendo-angular-navigation': '21.0.0-develop.13',
10
10
  // peer dependency of kendo-angular-inputs
11
- '@progress/kendo-angular-dialog': '21.0.0-develop.11',
11
+ '@progress/kendo-angular-dialog': '21.0.0-develop.13',
12
12
  // peer dependency of kendo-angular-icons
13
13
  '@progress/kendo-svg-icons': '^4.0.0',
14
14
  // peer dependency of kendo-angular-layout
15
- '@progress/kendo-angular-progressbar': '21.0.0-develop.11',
15
+ '@progress/kendo-angular-progressbar': '21.0.0-develop.13',
16
16
  // transitive peer dependencies from toolbar
17
- '@progress/kendo-angular-indicators': '21.0.0-develop.11',
17
+ '@progress/kendo-angular-indicators': '21.0.0-develop.13',
18
18
  // transitive peer dependencies from conversational-ui
19
- '@progress/kendo-angular-menu': '21.0.0-develop.11',
20
- '@progress/kendo-angular-upload': '21.0.0-develop.11'
19
+ '@progress/kendo-angular-menu': '21.0.0-develop.13',
20
+ '@progress/kendo-angular-upload': '21.0.0-develop.13'
21
21
  } });
22
22
  return (0, schematics_1.externalSchematic)('@progress/kendo-angular-schematics', 'ng-add', finalOptions);
23
23
  }