@progress/kendo-angular-grid 18.0.0-develop.5 → 18.0.0-develop.7

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.
@@ -20,11 +20,13 @@ export declare class ColumnHandleDirective implements OnInit, OnDestroy {
20
20
  private cdr;
21
21
  private ctx;
22
22
  private columnInfoService;
23
+ isLast: boolean;
23
24
  columns: Array<ColumnBase>;
24
25
  column: ColumnBase;
25
26
  get visible(): string;
26
27
  get leftStyle(): number | null;
27
28
  get rightStyle(): number | null;
29
+ private get isConstrainedMode();
28
30
  private subscriptions;
29
31
  private rtl;
30
32
  autoFit(): void;
@@ -39,6 +41,7 @@ export declare class ColumnHandleDirective implements OnInit, OnDestroy {
39
41
  private updateWidth;
40
42
  private columnsForLevel;
41
43
  private getTableDelta;
44
+ private stopPropagation;
42
45
  static ɵfac: i0.ɵɵFactoryDeclaration<ColumnHandleDirective, [{ host: true; }, null, null, null, null, null, null]>;
43
- static ɵdir: i0.ɵɵDirectiveDeclaration<ColumnHandleDirective, "[kendoGridColumnHandle]", never, { "columns": { "alias": "columns"; "required": false; }; "column": { "alias": "column"; "required": false; }; }, {}, never, never, true, never>;
46
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ColumnHandleDirective, "[kendoGridColumnHandle]", never, { "isLast": { "alias": "isLast"; "required": false; }; "columns": { "alias": "columns"; "required": false; }; "column": { "alias": "column"; "required": false; }; }, {}, never, never, true, never>;
44
47
  }
@@ -4,6 +4,22 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { Observable } from 'rxjs';
6
6
  import { ColumnBase } from '../columns/column-base';
7
+ /**
8
+ * The type of the [`resizable`](slug:api_grid_gridcomponent#toc-resizable) property. [See example](slug:resizing_columns_grid#constrained-mode)
9
+ *
10
+ * The possible values are:
11
+ *
12
+ * * `constrained` - Adjacent columns resize only up to their outer borders.
13
+ * * `unconstrained` - Columns are resized relative to the entire component.
14
+ *
15
+ * ```html
16
+ * <kendo-grid [kendoGridBinding]="gridData" [height]="370" resizable="constrained">
17
+ * <kendo-grid-column field="ProductID" title="ID"> </kendo-grid-column>
18
+ * ...
19
+ * </kendo-grid>
20
+ * ```
21
+ */
22
+ export type ResizeMode = 'unconstrained' | 'constrained';
7
23
  /**
8
24
  * The returned type of the [`columnResize`](slug:api_grid_gridcomponent#toc-columnresize) event.
9
25
  */
@@ -11,6 +11,10 @@ import * as i0 from "@angular/core";
11
11
  */
12
12
  export declare class ColumnResizingService {
13
13
  changes: EventEmitter<ColumnResizeAction>;
14
+ adjacentColumn: ColumnBase;
15
+ areColumnsReordered: boolean;
16
+ isShiftPressed: boolean;
17
+ originalWidth: number;
14
18
  private column;
15
19
  private resizedColumns;
16
20
  private tables;
@@ -4,6 +4,7 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { ChangeDetectorRef, ElementRef, NgZone, OnDestroy, OnInit, Renderer2 } from '@angular/core';
6
6
  import { ColumnResizingService } from './column-resizing.service';
7
+ import { ContextService } from '../common/provider.service';
7
8
  import * as i0 from "@angular/core";
8
9
  /**
9
10
  * @hidden
@@ -14,14 +15,14 @@ export declare class TableDirective implements OnInit, OnDestroy {
14
15
  private service;
15
16
  private zone;
16
17
  private cdr;
18
+ private ctx;
17
19
  locked: boolean;
18
20
  virtualColumns: boolean;
19
21
  get minWidth(): number | null;
20
- private originalWidth;
21
22
  private firstResize;
22
23
  private subscription;
23
24
  private autoFitSubscription;
24
- constructor(element: ElementRef, renderer: Renderer2, service: ColumnResizingService, zone: NgZone, cdr: ChangeDetectorRef);
25
+ constructor(element: ElementRef, renderer: Renderer2, service: ColumnResizingService, zone: NgZone, cdr: ChangeDetectorRef, ctx: ContextService);
25
26
  ngOnInit(): void;
26
27
  ngOnDestroy(): void;
27
28
  private initState;
@@ -35,15 +35,12 @@ const headerWidth = (handle) => handle.nativeElement.parentElement.offsetWidth;
35
35
  /**
36
36
  * @hidden
37
37
  */
38
- const allLeafColumns = columns => expandColumns(columns)
39
- .filter(c => !c.isColumnGroup);
38
+ const adjacentColumnWidth = (handle) => handle.nativeElement.parentElement.nextElementSibling?.offsetWidth;
40
39
  /**
41
40
  * @hidden
42
41
  */
43
- const stopPropagation = ({ originalEvent: event }) => {
44
- event.stopPropagation();
45
- event.preventDefault();
46
- };
42
+ const allLeafColumns = columns => expandColumns(columns)
43
+ .filter(c => !c.isColumnGroup);
47
44
  /**
48
45
  * @hidden
49
46
  */
@@ -94,9 +91,13 @@ export class ColumnHandleDirective {
94
91
  cdr;
95
92
  ctx;
96
93
  columnInfoService;
94
+ isLast;
97
95
  columns = [];
98
96
  column;
99
97
  get visible() {
98
+ if (this.isConstrainedMode && this.isLast) {
99
+ return 'none';
100
+ }
100
101
  return this.column.resizable ? 'block' : 'none';
101
102
  }
102
103
  get leftStyle() {
@@ -105,6 +106,13 @@ export class ColumnHandleDirective {
105
106
  get rightStyle() {
106
107
  return isTruthy(this.rtl) ? null : 0;
107
108
  }
109
+ get isConstrainedMode() {
110
+ const isConstrainedMode = this.ctx.grid?.resizable === 'constrained';
111
+ const isUnconstrainedMode = this.ctx.grid?.resizable === true || this.ctx.grid?.resizable === 'unconstrained';
112
+ const constrainedNoShift = isConstrainedMode && !this.service.isShiftPressed;
113
+ const unconstrainedWithShift = isUnconstrainedMode && this.service.isShiftPressed;
114
+ return constrainedNoShift || unconstrainedWithShift;
115
+ }
108
116
  subscriptions = new Subscription();
109
117
  rtl = false;
110
118
  autoFit() {
@@ -146,7 +154,7 @@ export class ColumnHandleDirective {
146
154
  .subscribe(this.resize.bind(this)));
147
155
  this.subscriptions.add(this.service.changes.pipe(filter(e => e.type === 'start'), filter(this.shouldUpdate.bind(this)), take(1) //on first resize only
148
156
  ).subscribe(this.initColumnWidth.bind(this)));
149
- this.subscriptions.add(this.zone.runOutsideAngular(() => this.draggable.kendoPress.pipe(tap(stopPropagation), tap(() => this.service.start(this.column)), switchMap(preventOnDblClick(this.draggable.kendoRelease)), switchMap(createMoveStream(this.service, this.draggable)))
157
+ this.subscriptions.add(this.zone.runOutsideAngular(() => this.draggable.kendoPress.pipe(tap(this.stopPropagation), tap(() => this.service.start(this.column)), switchMap(preventOnDblClick(this.draggable.kendoRelease)), switchMap(createMoveStream(this.service, this.draggable)))
150
158
  .subscribe(({ pageX, originalX }) => {
151
159
  const delta = pageX - originalX;
152
160
  const percent = toPercentage(delta, this.column.resizeStartWidth || this.column.width);
@@ -173,6 +181,28 @@ export class ColumnHandleDirective {
173
181
  }
174
182
  initState() {
175
183
  this.column.resizeStartWidth = headerWidth(this.element);
184
+ let columns = [];
185
+ if (this.ctx.grid?.columns) {
186
+ columns = Array.from(this.ctx.grid?.columns) || [];
187
+ }
188
+ if (this.isConstrainedMode) {
189
+ if (this.service.areColumnsReordered) {
190
+ this.service.adjacentColumn = columns.find(c => c.orderIndex === this.column.orderIndex + 1);
191
+ this.service.adjacentColumn.resizeStartWidth = adjacentColumnWidth(this.element);
192
+ this.service.resizedColumn({
193
+ column: this.service.adjacentColumn,
194
+ oldWidth: this.service.adjacentColumn.resizeStartWidth
195
+ });
196
+ }
197
+ else {
198
+ this.service.adjacentColumn = columns[this.column.leafIndex + 1];
199
+ this.service.adjacentColumn.resizeStartWidth = adjacentColumnWidth(this.element);
200
+ this.service.resizedColumn({
201
+ column: this.service.adjacentColumn,
202
+ oldWidth: this.service.adjacentColumn.resizeStartWidth
203
+ });
204
+ }
205
+ }
176
206
  this.service.resizedColumn({
177
207
  column: this.column,
178
208
  oldWidth: this.column.resizeStartWidth
@@ -187,6 +217,14 @@ export class ColumnHandleDirective {
187
217
  if (isPresent(this.column.maxResizableWidth)) {
188
218
  newWidth = Math.min(newWidth, this.column.maxResizableWidth);
189
219
  }
220
+ if (this.isConstrainedMode) {
221
+ const maxAllowedResizableWidth = this.column.resizeStartWidth + this.service.adjacentColumn.resizeStartWidth - this.service.adjacentColumn.minResizableWidth;
222
+ newWidth = Math.min(newWidth, maxAllowedResizableWidth);
223
+ }
224
+ if (this.isConstrainedMode && isPresent(this.service.adjacentColumn.maxResizableWidth)) {
225
+ const maxAllowedResizableWidth = this.column.resizeStartWidth + this.service.adjacentColumn.resizeStartWidth - this.service.adjacentColumn.maxResizableWidth;
226
+ newWidth = Math.max(newWidth, maxAllowedResizableWidth);
227
+ }
190
228
  const tableDelta = this.getTableDelta(newWidth, delta);
191
229
  this.updateWidth(this.column, newWidth);
192
230
  this.service.resizeTable(this.column, tableDelta);
@@ -199,6 +237,12 @@ export class ColumnHandleDirective {
199
237
  this.service.resizeTable(this.column, tableDelta);
200
238
  }
201
239
  updateWidth(column, width) {
240
+ if (this.isConstrainedMode && this.service.adjacentColumn) {
241
+ const adjacentColumnNewWidth = column.resizeStartWidth + this.service.adjacentColumn.resizeStartWidth - width;
242
+ if (adjacentColumnNewWidth < (column.resizeStartWidth + this.service.adjacentColumn.resizeStartWidth)) {
243
+ this.service.adjacentColumn.width = adjacentColumnNewWidth;
244
+ }
245
+ }
202
246
  column.width = width;
203
247
  this.columnInfoService.hiddenColumns.forEach((col) => {
204
248
  if (isBlank(col.width) && isPresent(col.implicitWidth)) {
@@ -231,8 +275,13 @@ export class ColumnHandleDirective {
231
275
  return startWidth - maxWidth;
232
276
  }
233
277
  }
278
+ stopPropagation = ({ originalEvent: event }) => {
279
+ this.service.isShiftPressed = event.shiftKey;
280
+ event.stopPropagation();
281
+ event.preventDefault();
282
+ };
234
283
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColumnHandleDirective, deps: [{ token: i1.DraggableDirective, host: true }, { token: i0.ElementRef }, { token: i2.ColumnResizingService }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: i3.ContextService }, { token: i4.ColumnInfoService }], target: i0.ɵɵFactoryTarget.Directive });
235
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: ColumnHandleDirective, isStandalone: true, selector: "[kendoGridColumnHandle]", inputs: { columns: "columns", column: "column" }, host: { listeners: { "dblclick": "autoFit()" }, properties: { "style.display": "this.visible", "style.left": "this.leftStyle", "style.right": "this.rightStyle" } }, ngImport: i0 });
284
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: ColumnHandleDirective, isStandalone: true, selector: "[kendoGridColumnHandle]", inputs: { isLast: "isLast", columns: "columns", column: "column" }, host: { listeners: { "dblclick": "autoFit()" }, properties: { "style.display": "this.visible", "style.left": "this.leftStyle", "style.right": "this.rightStyle" } }, ngImport: i0 });
236
285
  }
237
286
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColumnHandleDirective, decorators: [{
238
287
  type: Directive,
@@ -242,7 +291,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
242
291
  }]
243
292
  }], ctorParameters: function () { return [{ type: i1.DraggableDirective, decorators: [{
244
293
  type: Host
245
- }] }, { type: i0.ElementRef }, { type: i2.ColumnResizingService }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: i3.ContextService }, { type: i4.ColumnInfoService }]; }, propDecorators: { columns: [{
294
+ }] }, { type: i0.ElementRef }, { type: i2.ColumnResizingService }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: i3.ContextService }, { type: i4.ColumnInfoService }]; }, propDecorators: { isLast: [{
295
+ type: Input
296
+ }], columns: [{
246
297
  type: Input
247
298
  }], column: [{
248
299
  type: Input
@@ -23,6 +23,10 @@ const resizeArgs = (column, extra) => Object.assign({
23
23
  */
24
24
  export class ColumnResizingService {
25
25
  changes = new EventEmitter();
26
+ adjacentColumn;
27
+ areColumnsReordered = false;
28
+ isShiftPressed = false;
29
+ originalWidth;
26
30
  column;
27
31
  resizedColumns;
28
32
  tables = [];
@@ -60,6 +64,7 @@ export class ColumnResizingService {
60
64
  resizedColumns: this.resizedColumns,
61
65
  type: 'end'
62
66
  });
67
+ this.adjacentColumn = null;
63
68
  }
64
69
  registerTable(tableMetadata) {
65
70
  this.tables.push(tableMetadata);
@@ -7,12 +7,14 @@ import { Observable } from 'rxjs';
7
7
  import { resizableColumns } from '../columns/column-common';
8
8
  import { ColumnResizingService } from './column-resizing.service';
9
9
  import { filter, tap, map, switchMap, bufferCount } from 'rxjs/operators';
10
+ import { ContextService } from '../common/provider.service';
10
11
  import * as i0 from "@angular/core";
11
12
  import * as i1 from "./column-resizing.service";
13
+ import * as i2 from "../common/provider.service";
12
14
  /**
13
15
  * @hidden
14
16
  */
15
- const columnsToResize = ({ columns }) => Math.max(1, resizableColumns(columns).length);
17
+ const columnsToResize = ({ columns }) => Math.max(1, resizableColumns(columns).filter(c => !c.isColumnGroup).length);
16
18
  /**
17
19
  * @hidden
18
20
  */
@@ -42,21 +44,22 @@ export class TableDirective {
42
44
  service;
43
45
  zone;
44
46
  cdr;
47
+ ctx;
45
48
  locked = false;
46
49
  virtualColumns;
47
50
  get minWidth() {
48
51
  return this.firstResize ? 0 : null;
49
52
  }
50
- originalWidth;
51
53
  firstResize = false;
52
54
  subscription;
53
55
  autoFitSubscription;
54
- constructor(element, renderer, service, zone, cdr) {
56
+ constructor(element, renderer, service, zone, cdr, ctx) {
55
57
  this.element = element;
56
58
  this.renderer = renderer;
57
59
  this.service = service;
58
60
  this.zone = zone;
59
61
  this.cdr = cdr;
62
+ this.ctx = ctx;
60
63
  }
61
64
  ngOnInit() {
62
65
  const obs = this.service
@@ -79,15 +82,24 @@ export class TableDirective {
79
82
  }
80
83
  initState() {
81
84
  this.firstResize = true;
82
- if (!this.virtualColumns || this.locked) {
83
- this.originalWidth = offsetWidth(this.element.nativeElement);
85
+ const constrainedWithVirtualColumns = this.ctx.grid?.resizable === 'constrained' && this.virtualColumns;
86
+ if ((!this.virtualColumns || this.locked) || constrainedWithVirtualColumns) {
87
+ this.service.originalWidth = offsetWidth(this.element.nativeElement);
84
88
  }
85
89
  }
86
90
  resize(deltas) {
87
- if (!this.virtualColumns || this.locked) {
88
- const delta = deltas.reduce((sum, item) => sum + item, 0);
89
- const width = this.originalWidth + delta;
90
- this.renderer.setStyle(this.element.nativeElement, 'width', width + 'px');
91
+ const constrainedModeNoShift = this.ctx.grid?.resizable === 'constrained' && !this.service.isShiftPressed;
92
+ const unconstrainedModeShift = (this.ctx.grid?.resizable === true || this.ctx.grid?.resizable === 'unconstrained') && this.service.isShiftPressed;
93
+ const isConstrainedMode = constrainedModeNoShift || unconstrainedModeShift;
94
+ if (isConstrainedMode) {
95
+ this.renderer.setStyle(this.element.nativeElement, 'width', this.service.originalWidth + 'px');
96
+ }
97
+ else {
98
+ if (!this.virtualColumns || this.locked) {
99
+ const delta = deltas.reduce((sum, item) => sum + item, 0);
100
+ const width = this.service.originalWidth + delta;
101
+ this.renderer.setStyle(this.element.nativeElement, 'width', width + 'px');
102
+ }
91
103
  }
92
104
  this.cdr.detectChanges();
93
105
  }
@@ -112,7 +124,7 @@ export class TableDirective {
112
124
  const footer = pipe(row('tfoot>tr'), cell(info.index), offsetWidth)(dom);
113
125
  return Math.max(header, data, footer);
114
126
  }
115
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TableDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.ColumnResizingService }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
127
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TableDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.ColumnResizingService }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: i2.ContextService }], target: i0.ɵɵFactoryTarget.Directive });
116
128
  static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: TableDirective, isStandalone: true, selector: "[kendoGridResizableTable]", inputs: { locked: "locked", virtualColumns: "virtualColumns" }, host: { properties: { "style.min-width": "this.minWidth" } }, ngImport: i0 });
117
129
  }
118
130
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TableDirective, decorators: [{
@@ -121,7 +133,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
121
133
  selector: '[kendoGridResizableTable]',
122
134
  standalone: true
123
135
  }]
124
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1.ColumnResizingService }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { locked: [{
136
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1.ColumnResizingService }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: i2.ContextService }]; }, propDecorators: { locked: [{
125
137
  type: Input
126
138
  }], virtualColumns: [{
127
139
  type: Input
@@ -1718,6 +1718,7 @@ export class GridComponent {
1718
1718
  expandedColumns[i].orderIndex = nextSourceIndex++;
1719
1719
  }
1720
1720
  this.updateIndicesForLevel(source.level + 1);
1721
+ this.columnResizingService.areColumnsReordered = true;
1721
1722
  }
1722
1723
  updateIndicesForLevel(level) {
1723
1724
  const colsForParentLevel = this.allColumnsForLevel(level - 1);
@@ -19,6 +19,7 @@ import { closest, contains, findFocusableChild, isVisible, matchesNodeName } fro
19
19
  import { DetailsService } from '../rendering/details/details.service';
20
20
  import { ScrollRequestService } from '../scrolling/scroll-request.service';
21
21
  import { ContextService } from '../common/provider.service';
22
+ import { ColumnResizingService } from '../column-resizing/column-resizing.service';
22
23
  import * as i0 from "@angular/core";
23
24
  import * as i1 from "../common/dom-events.service";
24
25
  import * as i2 from "@progress/kendo-angular-pager";
@@ -28,7 +29,8 @@ import * as i5 from "../rendering/details/details.service";
28
29
  import * as i6 from "./focus-root";
29
30
  import * as i7 from "../editing/edit.service";
30
31
  import * as i8 from "../common/provider.service";
31
- import * as i9 from "./focusable.directive";
32
+ import * as i9 from "../column-resizing/column-resizing.service";
33
+ import * as i10 from "./focusable.directive";
32
34
  const isInSameGrid = (element, gridElement) => closest(element, matchesNodeName('kendo-grid')) === gridElement;
33
35
  const matchHeaderCell = matchesNodeName('th');
34
36
  const matchDataCell = matchesNodeName('td');
@@ -62,6 +64,7 @@ const isNavigationKey = keyCode => isArrowKey(keyCode) ||
62
64
  const isInput = matchesNodeName('input');
63
65
  const isTextInput = element => element && isInput(element) && element.type.toLowerCase() === 'text';
64
66
  const isPrintableCharacter = (str) => str.length === 1 && str.match(/\S/);
67
+ const resizeStep = 10;
65
68
  /**
66
69
  * @hidden
67
70
  */
@@ -96,6 +99,7 @@ export class NavigationService {
96
99
  editService;
97
100
  cd;
98
101
  ctx;
102
+ resizeService;
99
103
  focusableParent;
100
104
  changes;
101
105
  cellKeydown = new EventEmitter();
@@ -130,6 +134,9 @@ export class NavigationService {
130
134
  });
131
135
  }
132
136
  }
137
+ get isColumnResizable() {
138
+ return this.activeCell.colIndex !== this.ctx.grid.columnsContainer.leafColumnsToRender.length - 1;
139
+ }
133
140
  viewport;
134
141
  columnViewport;
135
142
  activeRowIndex = 0;
@@ -148,7 +155,7 @@ export class NavigationService {
148
155
  get activeDataRow() {
149
156
  return Math.max(0, this.activeRowIndex - this.meta.headerRows);
150
157
  }
151
- constructor(zone, domEvents, pagerContextService, scrollRequestService, groupsService, detailsService, focusRoot, editService, cd, ctx, focusableParent) {
158
+ constructor(zone, domEvents, pagerContextService, scrollRequestService, groupsService, detailsService, focusRoot, editService, cd, ctx, resizeService, focusableParent) {
152
159
  this.zone = zone;
153
160
  this.domEvents = domEvents;
154
161
  this.pagerContextService = pagerContextService;
@@ -159,6 +166,7 @@ export class NavigationService {
159
166
  this.editService = editService;
160
167
  this.cd = cd;
161
168
  this.ctx = ctx;
169
+ this.resizeService = resizeService;
162
170
  this.focusableParent = focusableParent;
163
171
  this.changes = this.cursor.changes;
164
172
  }
@@ -455,6 +463,10 @@ export class NavigationService {
455
463
  }
456
464
  break;
457
465
  case Keys.ArrowRight:
466
+ if (args.altKey && this.ctx.grid.resizable && this.isColumnResizable) {
467
+ this.columnResize(true);
468
+ break;
469
+ }
458
470
  if (args.shiftKey) {
459
471
  if (this.ctx.grid.blockArrowSelection) {
460
472
  return;
@@ -467,6 +479,10 @@ export class NavigationService {
467
479
  }
468
480
  break;
469
481
  case Keys.ArrowLeft:
482
+ if (args.altKey && this.ctx.grid.resizable && this.isColumnResizable) {
483
+ this.columnResize(false);
484
+ break;
485
+ }
470
486
  if (args.shiftKey) {
471
487
  if (this.ctx.grid.blockArrowSelection) {
472
488
  return;
@@ -575,6 +591,15 @@ export class NavigationService {
575
591
  args.preventDefault();
576
592
  }
577
593
  }
594
+ columnResize(onRightArrow) {
595
+ const column = this.ctx.grid.columnsContainer.leafColumnsToRender[this.activeCell.colIndex];
596
+ column.resizeStartWidth = Array.from(this.ctx.grid.wrapper.nativeElement.querySelectorAll('.k-grid-header th.k-header'))[this.activeCell.colIndex]['offsetWidth'];
597
+ this.resizeService.start(column);
598
+ this.resizeService.resizeColumns(onRightArrow ? resizeStep : -1 * resizeStep);
599
+ if (this.resizeService.resizeColumns.length > 0) {
600
+ this.resizeService.end();
601
+ }
602
+ }
578
603
  onContentKeydown(args) {
579
604
  if (!this.onCellKeydown(args)) {
580
605
  return;
@@ -719,11 +744,11 @@ export class NavigationService {
719
744
  const ev = rowSelectionService.selectRange(startRowIndex, endRowIndex);
720
745
  rowSelectionService.changes.emit(ev);
721
746
  }
722
- 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.FocusableDirective, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
747
+ 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 });
723
748
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NavigationService });
724
749
  }
725
750
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NavigationService, decorators: [{
726
751
  type: Injectable
727
- }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i1.DomEventsService }, { type: i2.PagerContextService }, { type: i3.ScrollRequestService }, { type: i4.GroupsService }, { type: i5.DetailsService }, { type: i6.FocusRoot }, { type: i7.EditService }, { type: i0.ChangeDetectorRef }, { type: i8.ContextService }, { type: i9.FocusableDirective, decorators: [{
752
+ }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i1.DomEventsService }, { type: i2.PagerContextService }, { type: i3.ScrollRequestService }, { type: i4.GroupsService }, { type: i5.DetailsService }, { type: i6.FocusRoot }, { type: i7.EditService }, { type: i0.ChangeDetectorRef }, { type: i8.ContextService }, { type: i9.ColumnResizingService }, { type: i10.FocusableDirective, decorators: [{
728
753
  type: Optional
729
754
  }] }]; } });
@@ -9,7 +9,7 @@ export const packageMetadata = {
9
9
  name: '@progress/kendo-angular-grid',
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1736357981,
13
- version: '18.0.0-develop.5',
12
+ publishDate: 1736519762,
13
+ version: '18.0.0-develop.7',
14
14
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
15
15
  };
@@ -634,6 +634,7 @@ export class HeaderComponent {
634
634
  kendoDraggable
635
635
  class="k-column-resizer"
636
636
  *ngIf="resizable"
637
+ [isLast]="last"
637
638
  [column]="column"
638
639
  [columns]="columns">
639
640
  </span>
@@ -688,6 +689,7 @@ export class HeaderComponent {
688
689
  kendoDraggable
689
690
  class="k-column-resizer"
690
691
  *ngIf="resizable"
692
+ [isLast]="last"
691
693
  [column]="column"
692
694
  [columns]="columns">
693
695
  </span>
@@ -709,7 +711,7 @@ export class HeaderComponent {
709
711
  [totalColumns]="totalColumns"
710
712
  ></tr>
711
713
  </ng-container>
712
- `, isInline: true, dependencies: [{ kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: LogicalRowDirective, selector: "[kendoGridLogicalRow]", inputs: ["logicalRowIndex", "logicalSlaveRow", "logicalCellsCount", "logicalSlaveCellsCount", "dataRowIndex", "dataItem", "totalColumns"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: LogicalCellDirective, selector: "[kendoGridLogicalCell]", inputs: ["logicalColIndex", "logicalRowIndex", "logicalSlaveCell", "colIndex", "colSpan", "rowSpan", "groupItem", "dataRowIndex", "dataItem", "detailExpandCell", "headerLabelText"] }, { kind: "directive", type: DropTargetDirective, selector: "[kendoDropTarget]", inputs: ["context"], outputs: ["enter", "leave", "drop"] }, { kind: "directive", type: DraggableDirective, selector: "[kendoDraggable]", inputs: ["enableDrag"], outputs: ["kendoPress", "kendoDrag", "kendoRelease"] }, { kind: "directive", type: DraggableColumnDirective, selector: "[kendoDraggableColumn]", inputs: ["context", "enableDrag"], outputs: ["drag"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }, { kind: "component", type: FilterMenuComponent, selector: "kendo-grid-filter-menu", inputs: ["column", "filter", "tabIndex"] }, { kind: "component", type: ColumnMenuComponent, selector: "kendo-grid-column-menu", inputs: ["standalone", "column", "settings", "sort", "filter", "sortable", "columnMenuTemplate", "tabIndex"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "directive", type: SelectAllCheckboxDirective, selector: "[kendoGridSelectAllCheckbox]", inputs: ["state"], outputs: ["selectAllChange"] }, { kind: "directive", type: FocusableDirective, selector: "[kendoGridFocusable],\n [kendoGridEditCommand],\n [kendoGridRemoveCommand],\n [kendoGridSaveCommand],\n [kendoGridCancelCommand],\n [kendoGridSelectionCheckbox]\n ", inputs: ["kendoGridFocusable"] }, { kind: "directive", type: ColumnHandleDirective, selector: "[kendoGridColumnHandle]", inputs: ["columns", "column"] }, { kind: "component", type: FilterRowComponent, selector: "[kendoGridFilterRow]", inputs: ["columns", "filter", "groups", "detailTemplate", "logicalRowIndex", "lockedColumnsCount"] }, { kind: "component", type: CheckBoxComponent, selector: "kendo-checkbox", inputs: ["checkedState", "rounded"], outputs: ["checkedStateChange"], exportAs: ["kendoCheckBox"] }] });
714
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: LogicalRowDirective, selector: "[kendoGridLogicalRow]", inputs: ["logicalRowIndex", "logicalSlaveRow", "logicalCellsCount", "logicalSlaveCellsCount", "dataRowIndex", "dataItem", "totalColumns"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: LogicalCellDirective, selector: "[kendoGridLogicalCell]", inputs: ["logicalColIndex", "logicalRowIndex", "logicalSlaveCell", "colIndex", "colSpan", "rowSpan", "groupItem", "dataRowIndex", "dataItem", "detailExpandCell", "headerLabelText"] }, { kind: "directive", type: DropTargetDirective, selector: "[kendoDropTarget]", inputs: ["context"], outputs: ["enter", "leave", "drop"] }, { kind: "directive", type: DraggableDirective, selector: "[kendoDraggable]", inputs: ["enableDrag"], outputs: ["kendoPress", "kendoDrag", "kendoRelease"] }, { kind: "directive", type: DraggableColumnDirective, selector: "[kendoDraggableColumn]", inputs: ["context", "enableDrag"], outputs: ["drag"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }, { kind: "component", type: FilterMenuComponent, selector: "kendo-grid-filter-menu", inputs: ["column", "filter", "tabIndex"] }, { kind: "component", type: ColumnMenuComponent, selector: "kendo-grid-column-menu", inputs: ["standalone", "column", "settings", "sort", "filter", "sortable", "columnMenuTemplate", "tabIndex"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "directive", type: SelectAllCheckboxDirective, selector: "[kendoGridSelectAllCheckbox]", inputs: ["state"], outputs: ["selectAllChange"] }, { kind: "directive", type: FocusableDirective, selector: "[kendoGridFocusable],\n [kendoGridEditCommand],\n [kendoGridRemoveCommand],\n [kendoGridSaveCommand],\n [kendoGridCancelCommand],\n [kendoGridSelectionCheckbox]\n ", inputs: ["kendoGridFocusable"] }, { kind: "directive", type: ColumnHandleDirective, selector: "[kendoGridColumnHandle]", inputs: ["isLast", "columns", "column"] }, { kind: "component", type: FilterRowComponent, selector: "[kendoGridFilterRow]", inputs: ["columns", "filter", "groups", "detailTemplate", "logicalRowIndex", "lockedColumnsCount"] }, { kind: "component", type: CheckBoxComponent, selector: "kendo-checkbox", inputs: ["checkedState", "rounded"], outputs: ["checkedStateChange"], exportAs: ["kendoCheckBox"] }] });
713
715
  }
714
716
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: HeaderComponent, decorators: [{
715
717
  type: Component,
@@ -859,6 +861,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
859
861
  kendoDraggable
860
862
  class="k-column-resizer"
861
863
  *ngIf="resizable"
864
+ [isLast]="last"
862
865
  [column]="column"
863
866
  [columns]="columns">
864
867
  </span>
@@ -913,6 +916,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
913
916
  kendoDraggable
914
917
  class="k-column-resizer"
915
918
  *ngIf="resizable"
919
+ [isLast]="last"
916
920
  [column]="column"
917
921
  [columns]="columns">
918
922
  </span>