@progress/kendo-angular-grid 19.3.0-develop.22 → 19.3.0-develop.24

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 (65) hide show
  1. package/columns/columns-container.d.ts +2 -0
  2. package/common/data-layout-mode.d.ts +19 -0
  3. package/common/stacked-layout-settings.d.ts +24 -0
  4. package/directives.d.ts +4 -3
  5. package/editing-directives/editing-directive-base.d.ts +3 -0
  6. package/esm2022/columns/column-base.mjs +4 -4
  7. package/esm2022/columns/column.component.mjs +1 -1
  8. package/esm2022/columns/columns-container.mjs +3 -0
  9. package/esm2022/common/column-info.service.mjs +1 -1
  10. package/esm2022/common/data-layout-mode.mjs +5 -0
  11. package/esm2022/common/stacked-layout-settings.mjs +5 -0
  12. package/esm2022/directives.mjs +3 -1
  13. package/esm2022/editing-directives/editing-directive-base.mjs +17 -2
  14. package/esm2022/editing-directives/in-cell-editing.directive.mjs +2 -1
  15. package/esm2022/filtering/filter-row.component.mjs +5 -2
  16. package/esm2022/grid.component.mjs +111 -33
  17. package/esm2022/grid.module.mjs +101 -100
  18. package/esm2022/grouping/group-header.component.mjs +39 -4
  19. package/esm2022/index.mjs +1 -0
  20. package/esm2022/localization/messages.mjs +2 -2
  21. package/esm2022/navigation/default-focusable-element.mjs +14 -2
  22. package/esm2022/navigation/focusable.directive.mjs +1 -1
  23. package/esm2022/navigation/navigation-cursor.mjs +7 -1
  24. package/esm2022/navigation/navigation-metadata.mjs +3 -1
  25. package/esm2022/navigation/navigation.service.mjs +136 -5
  26. package/esm2022/package-metadata.mjs +2 -2
  27. package/esm2022/pdf/export-element.mjs +14 -5
  28. package/esm2022/pdf/pdf.component.mjs +3 -1
  29. package/esm2022/rendering/cell.component.mjs +466 -188
  30. package/esm2022/rendering/common/col-group.component.mjs +20 -7
  31. package/esm2022/rendering/footer/footer.component.mjs +117 -54
  32. package/esm2022/rendering/header/header.component.mjs +5 -2
  33. package/esm2022/rendering/list.component.mjs +13 -8
  34. package/esm2022/rendering/table-body.component.mjs +384 -171
  35. package/esm2022/rendering/toolbar/tools/ai-assistant/ai-assistant.component.mjs +7 -3
  36. package/esm2022/rendering/toolbar/tools/ai-assistant/ai-tool.directive.mjs +1 -1
  37. package/esm2022/rendering/toolbar/tools/select-all-command-tool.directive.mjs +93 -0
  38. package/esm2022/row-reordering/row-reorder.service.mjs +2 -2
  39. package/esm2022/row-reordering/utils.mjs +6 -4
  40. package/esm2022/selection/cell-selection.service.mjs +6 -3
  41. package/fesm2022/progress-kendo-angular-grid.mjs +1515 -567
  42. package/filtering/filter-row.component.d.ts +1 -0
  43. package/grid.component.d.ts +22 -1
  44. package/grid.module.d.ts +100 -99
  45. package/grouping/group-header.component.d.ts +1 -0
  46. package/index.d.ts +3 -0
  47. package/localization/messages.d.ts +2 -2
  48. package/navigation/default-focusable-element.d.ts +3 -1
  49. package/navigation/focus-group.d.ts +1 -1
  50. package/navigation/navigation-metadata.d.ts +2 -1
  51. package/navigation/navigation.service.d.ts +6 -0
  52. package/package.json +21 -21
  53. package/rendering/cell.component.d.ts +32 -17
  54. package/rendering/common/col-group.component.d.ts +5 -0
  55. package/rendering/footer/footer.component.d.ts +4 -1
  56. package/rendering/header/header.component.d.ts +1 -0
  57. package/rendering/list.component.d.ts +4 -1
  58. package/rendering/table-body.component.d.ts +2 -1
  59. package/rendering/toolbar/tools/ai-assistant/ai-assistant.component.d.ts +1 -0
  60. package/rendering/toolbar/tools/ai-assistant/ai-tool.directive.d.ts +1 -1
  61. package/rendering/toolbar/tools/select-all-command-tool.directive.d.ts +36 -0
  62. package/row-reordering/row-reorder.service.d.ts +1 -1
  63. package/row-reordering/utils.d.ts +1 -1
  64. package/schematics/ngAdd/index.js +4 -4
  65. package/selection/cell-selection.service.d.ts +1 -0
@@ -11,7 +11,7 @@ import { GridFocusableElement } from './grid-focusable-element';
11
11
  import { NavigationCursor } from './navigation-cursor';
12
12
  import { NavigationModel } from './navigation-model';
13
13
  import { DomEventsService } from '../common/dom-events.service';
14
- import { isDocumentAvailable, isPresent, Keys } from '@progress/kendo-angular-common';
14
+ import { hasClasses, isDocumentAvailable, isPresent, Keys } from '@progress/kendo-angular-common';
15
15
  import { EditService } from '../editing/edit.service';
16
16
  import { GroupsService } from '../grouping/groups.service';
17
17
  import { PagerContextService } from '@progress/kendo-angular-pager';
@@ -212,7 +212,12 @@ export class NavigationService {
212
212
  // Closing the editor will not always trigger focusout in Firefox.
213
213
  // To get around this, we ensure that the cell is closed after editing.
214
214
  this.editService.changes.pipe(filter(e => e.action !== 'edit' && this.mode === 2 /* NavigationMode.Content */), filter((e) => e.action === 'cellClose' && !e.prevented), switchMap(onStable))
215
- .subscribe(() => this.leaveCell()));
215
+ .subscribe((e) => {
216
+ const isInStackedCell = closest(e.originalEvent?.target, (el) => hasClasses(el, 'k-grid-stack-content'));
217
+ if (!isInStackedCell) {
218
+ this.leaveCell();
219
+ }
220
+ }));
216
221
  this.subs.add(this.pagerContextService.pageChange
217
222
  .subscribe(() => this.cursor.reset(0, 0)));
218
223
  this.subs.add(this.domEvents.keydown
@@ -394,7 +399,7 @@ export class NavigationService {
394
399
  success = fwd ? this.cursor.moveDown(1) : this.cursor.moveUp(1);
395
400
  if (success) {
396
401
  const row = this.cursor.row;
397
- const colIdx = fwd ? 0 : this.cursor.lastCellIndex(row);
402
+ const colIdx = fwd || this.isStackedMode ? 0 : this.cursor.lastCellIndex(row);
398
403
  this.cursor.reset(row.index, colIdx);
399
404
  }
400
405
  }
@@ -412,6 +417,12 @@ export class NavigationService {
412
417
  if (!cell) {
413
418
  return;
414
419
  }
420
+ if (this.tableCellEntered && this.isStackedMode) {
421
+ this.stackedCellEntered = true;
422
+ }
423
+ else {
424
+ this.tableCellEntered = true;
425
+ }
415
426
  const group = cell.focusGroup;
416
427
  const focusable = group && group.canFocus();
417
428
  this.mode = focusable ? 2 /* NavigationMode.Content */ : 1 /* NavigationMode.Cursor */;
@@ -419,6 +430,9 @@ export class NavigationService {
419
430
  if (focusable) {
420
431
  this.activateRow();
421
432
  group.focus();
433
+ if (this.isStackedMode && this.stackedFocusedCellIndex === -1) {
434
+ this.stackedFocusedCellIndex = 0;
435
+ }
422
436
  }
423
437
  }
424
438
  leaveCell() {
@@ -426,11 +440,22 @@ export class NavigationService {
426
440
  if (!cell) {
427
441
  return;
428
442
  }
443
+ if (this.tableCellEntered) {
444
+ if (this.stackedCellEntered) {
445
+ this.stackedCellEntered = false;
446
+ }
447
+ else {
448
+ this.tableCellEntered = false;
449
+ }
450
+ }
429
451
  const group = cell.focusGroup;
430
452
  const focusable = group && group.canFocus();
431
453
  if (!focusable) {
432
454
  this.deactivateElements();
433
455
  }
456
+ if (this.isStackedMode && this.stackedFocusedCellIndex > -1) {
457
+ this.stackedFocusedCellIndex = -1;
458
+ }
434
459
  this.mode = 1 /* NavigationMode.Cursor */;
435
460
  this.cursor.announce();
436
461
  }
@@ -445,11 +470,11 @@ export class NavigationService {
445
470
  .forEach(cell => cell.focusGroup && cell.focusGroup.activate());
446
471
  }
447
472
  moveCursorFwd() {
448
- this.lastCellRowIndex = this.activeCell.rowIndex;
473
+ this.lastCellRowIndex = this.activeCell?.rowIndex;
449
474
  return this.ctx.localization.rtl ? this.cursor.moveLeft() : this.cursor.moveRight();
450
475
  }
451
476
  moveCursorBwd() {
452
- this.lastCellRowIndex = this.activeCell.rowIndex;
477
+ this.lastCellRowIndex = this.activeCell?.rowIndex;
453
478
  return this.ctx.localization.rtl ? this.cursor.moveRight() : this.cursor.moveLeft();
454
479
  }
455
480
  onCursorKeydown(args) {
@@ -589,6 +614,15 @@ export class NavigationService {
589
614
  break;
590
615
  case Keys.Enter:
591
616
  case Keys.F2: {
617
+ if (this.stackedCellEntered) {
618
+ if (args.keyCode === Keys.F2 && row.dataRowIndex > -1) {
619
+ this.zone.run(() => {
620
+ this.editService.beginEdit(row.dataRowIndex);
621
+ });
622
+ this.enterCell();
623
+ }
624
+ break;
625
+ }
592
626
  const groupItem = row.groupItem;
593
627
  if (groupItem) {
594
628
  this.zone.run(() => this.groupsService.toggleRow(groupItem));
@@ -597,6 +631,11 @@ export class NavigationService {
597
631
  this.zone.run(() => this.detailsService.toggleRow(row.dataRowIndex, row.dataItem));
598
632
  }
599
633
  else {
634
+ if (args.keyCode === Keys.F2 && row.dataRowIndex > -1) {
635
+ this.zone.run(() => {
636
+ this.editService.beginEdit(row.dataRowIndex);
637
+ });
638
+ }
600
639
  this.enterCell();
601
640
  if (!this.cursor.cell.focusGroup.isNavigable()) {
602
641
  preventDefault = true;
@@ -604,6 +643,17 @@ export class NavigationService {
604
643
  }
605
644
  break;
606
645
  }
646
+ case Keys.Backspace:
647
+ case Keys.Delete:
648
+ if (this.activeRow && this.activeRow.dataRowIndex >= 0 && this.activeRow.dataItem) {
649
+ if (!row.groupItem && !this.cursor.cell.detailExpandCell) {
650
+ this.zone.run(() => {
651
+ this.editService.remove(this.activeRow.dataRowIndex);
652
+ });
653
+ preventDefault = true;
654
+ }
655
+ }
656
+ break;
607
657
  default:
608
658
  if (!args.ctrlKey && !args.altKey && isPrintableCharacter(args.key)) {
609
659
  this.enterCell();
@@ -627,6 +677,13 @@ export class NavigationService {
627
677
  }
628
678
  const confirm = !args.defaultPrevented && args.keyCode === Keys.Enter && isTextInput(args.target);
629
679
  if (args.keyCode === Keys.Escape || args.keyCode === Keys.F2 || confirm) {
680
+ if (this.tableCellEntered && args.keyCode === Keys.F2 && this.activeRow.dataRowIndex > -1) {
681
+ this.zone.run(() => {
682
+ this.editService.beginEdit(this.activeRow.dataRowIndex);
683
+ });
684
+ this.enterCell();
685
+ return;
686
+ }
630
687
  this.leaveCell();
631
688
  this.cursor.reset();
632
689
  args.stopPropagation();
@@ -695,6 +752,12 @@ export class NavigationService {
695
752
  this.cursor.announce();
696
753
  }
697
754
  onKeydown(args) {
755
+ if (this.isStackedMode) {
756
+ this.handleStackedKeydown(args);
757
+ if (args.defaultPrevented) {
758
+ return;
759
+ }
760
+ }
698
761
  if (this.mode === 1 /* NavigationMode.Cursor */) {
699
762
  this.onCursorKeydown(args);
700
763
  }
@@ -783,6 +846,74 @@ export class NavigationService {
783
846
  const offset = direction === 'Up' ? Math.abs(this.lastCellRowIndex - this.activeRowIndex) : (this.activeRowIndex + cellRowspan - this.lastCellRowIndex - 1);
784
847
  return offset;
785
848
  }
849
+ get isStackedMode() {
850
+ return this.ctx?.grid?.isStacked;
851
+ }
852
+ handleStackedKeydown(args) {
853
+ const target = args.target;
854
+ const stackedCell = closest(target, (el) => hasClasses(el, 'k-grid-stack-cell'));
855
+ const tableCell = closest(target, (el) => hasClasses(el, 'k-table-td'));
856
+ const isInStackedCell = closest(target, (el) => hasClasses(el, 'k-grid-stack-content'));
857
+ if (!stackedCell || !tableCell) {
858
+ return;
859
+ }
860
+ if (args.keyCode === Keys.Tab) {
861
+ this.handleStackedTabNavigation(args);
862
+ }
863
+ else if (args.keyCode === Keys.Backspace || args.keyCode === Keys.Delete) {
864
+ if (this.activeRow && this.activeRow.dataRowIndex >= 0 && this.activeRow.dataItem) {
865
+ const row = this.cursor.row;
866
+ if (!row.groupItem && !this.cursor.cell.detailExpandCell) {
867
+ this.zone.run(() => {
868
+ this.editService.remove(this.activeRow.dataRowIndex);
869
+ });
870
+ args.preventDefault();
871
+ }
872
+ }
873
+ }
874
+ else if (isInStackedCell && (args.keyCode === Keys.Enter || args.keyCode === Keys.Escape)) {
875
+ this.editService.closeCell(args);
876
+ this.activeCell.focusGroup.activate();
877
+ this.activeCell.focusGroup.focusableChildren[this.stackedFocusedCellIndex]?.focus();
878
+ args.preventDefault();
879
+ }
880
+ }
881
+ stackedFocusedCellIndex = -1;
882
+ tableCellEntered = false;
883
+ stackedCellEntered = false;
884
+ handleStackedTabNavigation(args) {
885
+ if (!isPresent(this.activeCell.focusGroup)) {
886
+ return;
887
+ }
888
+ if (this.stackedFocusedCellIndex === -1) {
889
+ return;
890
+ }
891
+ const stackedCells = this.activeCell.focusGroup.focusableChildren;
892
+ let nextIndex;
893
+ if (args.shiftKey) {
894
+ nextIndex = this.stackedFocusedCellIndex - 1;
895
+ if (nextIndex < 0) {
896
+ nextIndex = stackedCells.length - 1;
897
+ }
898
+ }
899
+ else {
900
+ nextIndex = this.stackedFocusedCellIndex + 1;
901
+ if (nextIndex >= stackedCells.length) {
902
+ nextIndex = 0;
903
+ }
904
+ }
905
+ let nextStackedCell = stackedCells[nextIndex];
906
+ if (nextStackedCell) {
907
+ if (nextStackedCell.hasFocus() || (isDocumentAvailable() && document.activeElement === nextStackedCell.hostElement.nativeElement)) {
908
+ // next cell is already focused (as a focusable child of the previous one), skip to the next one
909
+ nextIndex = args.shiftKey ? this.stackedFocusedCellIndex - 2 : this.stackedFocusedCellIndex + 2;
910
+ nextStackedCell = stackedCells[nextIndex];
911
+ }
912
+ nextStackedCell.focus();
913
+ this.stackedFocusedCellIndex = nextIndex;
914
+ args.preventDefault();
915
+ }
916
+ }
786
917
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NavigationService, deps: [{ token: i0.NgZone }, { token: i1.DomEventsService }, { token: i2.PagerContextService }, { token: i3.ScrollRequestService }, { token: i4.GroupsService }, { token: i5.DetailsService }, { token: i6.FocusRoot }, { token: i7.EditService }, { token: i0.ChangeDetectorRef }, { token: i8.ContextService }, { token: i9.ColumnResizingService }, { token: i10.FocusableDirective, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
787
918
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NavigationService });
788
919
  }
@@ -10,7 +10,7 @@ export const packageMetadata = {
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCode: 'KENDOUIANGULAR',
12
12
  productCodes: ['KENDOUIANGULAR'],
13
- publishDate: 1754479136,
14
- version: '19.3.0-develop.22',
13
+ publishDate: 1754485381,
14
+ version: '19.3.0-develop.24',
15
15
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
16
16
  };
@@ -80,11 +80,14 @@ const createTable = (colGroups, headers, bodies, footers, size) => {
80
80
  for (let idx = 1; idx < colGroups.length; idx++) {
81
81
  appendNodes(colGroup, colGroups[idx].querySelectorAll('col'));
82
82
  }
83
- const header = createTableElement(headers);
84
83
  const body = createTableElement(bodies);
85
- setFirstCellClass(header, headers);
84
+ let header;
85
+ if (headers.length > 0) {
86
+ header = createTableElement(headers);
87
+ setFirstCellClass(header, headers);
88
+ }
86
89
  table.appendChild(colGroup);
87
- table.appendChild(header);
90
+ header && table.appendChild(header);
88
91
  table.appendChild(body);
89
92
  if (footers.length) {
90
93
  const footer = createTableElement(footers);
@@ -101,17 +104,23 @@ export const exportElement = (wrapper, size) => {
101
104
  let result;
102
105
  if (content) {
103
106
  const colGroups = [content.querySelector('colgroup')];
104
- const headers = [query.header().querySelector('thead')];
105
107
  const bodies = [content.querySelector('tbody')];
108
+ const header = query.header();
106
109
  const footer = query.footer();
110
+ const headers = [];
107
111
  const footers = [];
112
+ if (header) {
113
+ headers.push(header.querySelector('thead'));
114
+ }
108
115
  if (footer) {
109
116
  footers.push(footer.querySelector('tfoot'));
110
117
  }
111
118
  const lockedContent = query.content(true);
112
119
  if (lockedContent) {
120
+ if (headers.length > 0) {
121
+ headers.unshift(query.header(true).querySelector('thead'));
122
+ }
113
123
  colGroups.unshift(lockedContent.querySelector('colgroup'));
114
- headers.unshift(query.header(true).querySelector('thead'));
115
124
  bodies.unshift(lockedContent.querySelector('tbody'));
116
125
  if (footer) {
117
126
  footers.unshift(query.footer(true).querySelector('tfoot'));
@@ -164,7 +164,9 @@ export class PDFComponent extends PDFExportComponent {
164
164
  const overlayContent = overlayQuery.content();
165
165
  overlayContent.scrollTop = content.scrollTop;
166
166
  overlayContent.scrollLeft = content.scrollLeft;
167
- overlayQuery.header().scrollLeft = query.header().scrollLeft;
167
+ if (!this.ctx?.grid?.isStacked) {
168
+ overlayQuery.header().scrollLeft = query.header().scrollLeft;
169
+ }
168
170
  const footer = query.footer();
169
171
  if (footer) {
170
172
  overlayQuery.footer().scrollLeft = footer.scrollLeft;