@progress/kendo-angular-grid 13.0.0-develop.13 → 13.0.0-develop.15

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.
@@ -23,6 +23,8 @@ import { FooterModule } from "./rendering/footer/footer.module";
23
23
  import { SharedModule } from './shared.module';
24
24
  import { ToolbarTemplateDirective } from "./rendering/toolbar/toolbar-template.directive";
25
25
  import { ToolbarComponent } from "./rendering/toolbar/toolbar.component";
26
+ import { StatusBarTemplateDirective } from './aggregates/status-bar-template.directive';
27
+ import { StatusBarComponent } from './aggregates/status-bar.component';
26
28
  import { ResizeSensorModule } from '@progress/kendo-angular-common';
27
29
  import { TemplateEditingDirective } from './editing-directives/template-editing.directive';
28
30
  import { ReactiveEditingDirective } from './editing-directives/reactive-editing.directive';
@@ -123,6 +125,7 @@ const exportedModules = [
123
125
  ToolbarTemplateDirective,
124
126
  ToolbarComponent,
125
127
  GridSpacerComponent,
128
+ StatusBarTemplateDirective,
126
129
  DataBindingDirective,
127
130
  SelectionDirective,
128
131
  CustomMessagesComponent,
@@ -160,7 +163,9 @@ const declarations = [
160
163
  GroupBindingDirective,
161
164
  GridMarqueeDirective,
162
165
  GridSpacerComponent,
163
- GridToolbarFocusableDirective
166
+ GridToolbarFocusableDirective,
167
+ StatusBarComponent,
168
+ StatusBarTemplateDirective
164
169
  ];
165
170
  /**
166
171
  * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
@@ -202,7 +207,9 @@ GridModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13
202
207
  GroupBindingDirective,
203
208
  GridMarqueeDirective,
204
209
  GridSpacerComponent,
205
- GridToolbarFocusableDirective], imports: [CommonModule,
210
+ GridToolbarFocusableDirective,
211
+ StatusBarComponent,
212
+ StatusBarTemplateDirective], imports: [CommonModule,
206
213
  GroupModule,
207
214
  SharedModule,
208
215
  BodyModule,
@@ -217,6 +224,7 @@ GridModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13
217
224
  ToolbarTemplateDirective,
218
225
  ToolbarComponent,
219
226
  GridSpacerComponent,
227
+ StatusBarTemplateDirective,
220
228
  DataBindingDirective,
221
229
  SelectionDirective,
222
230
  CustomMessagesComponent,
package/esm2020/index.mjs CHANGED
@@ -25,6 +25,7 @@ export { FooterTemplateDirective } from './rendering/footer/footer-template.dire
25
25
  export { PagerTemplateDirective } from './pager/pager-template.directive';
26
26
  export { GridSpacerComponent } from './rendering/common/spacer.component';
27
27
  export { ExpandDetailsDirective } from './rendering/details-expand.directive';
28
+ export { StatusBarTemplateDirective } from './aggregates/status-bar-template.directive';
28
29
  export { ExpandGroupDirective } from './rendering/groups-expand.directive';
29
30
  export { defaultTrackBy } from './common/default-track-by';
30
31
  export { DetailTemplateDirective } from './rendering/details/detail-template.directive';
@@ -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: 1685375852,
13
- version: '13.0.0-develop.13',
12
+ publishDate: 1685453775,
13
+ version: '13.0.0-develop.15',
14
14
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
15
15
  };
@@ -21,6 +21,7 @@ export class CellSelectionService {
21
21
  this.localDataChangesService = localDataChangesService;
22
22
  this.navigationService = navigationService;
23
23
  this.changes = new EventEmitter();
24
+ this.aggregateChanges = new EventEmitter();
24
25
  this.mouseUpEvent = new EventEmitter();
25
26
  this.currentSelection = [];
26
27
  this.active = false;
@@ -106,6 +107,16 @@ export class CellSelectionService {
106
107
  }
107
108
  ev.ctrlKey = ctrlKey;
108
109
  ev.shiftKey = event.shiftKey;
110
+ if (this.options.cellAggregates) {
111
+ this.aggregateChanges.emit(ev);
112
+ ev.cellAggregates = this.aggregates;
113
+ }
114
+ if (ev.shiftKey) {
115
+ ev.rangeStartCell = this.lastSelectionItem;
116
+ ev.rangeEndCell = {
117
+ ...this.settings.cellSelected({ dataItem: item.data, index: item.index }, item.column, item.column.leafIndex).item
118
+ };
119
+ }
109
120
  this.changes.emit(ev);
110
121
  }
111
122
  toggle(item) {
@@ -209,13 +220,20 @@ export class CellSelectionService {
209
220
  }
210
221
  next = iterator.next();
211
222
  }
223
+ let cellAggregates;
224
+ if (this.options.cellAggregates) {
225
+ this.aggregateChanges.emit({ selectedCells, deselectedCells });
226
+ cellAggregates = this.aggregates;
227
+ }
212
228
  return {
213
229
  deselectedCells,
214
- selectedCells
230
+ selectedCells,
231
+ cellAggregates
215
232
  };
216
233
  }
217
234
  get options() {
218
235
  const defaultOptions = {
236
+ cellAggregates: false,
219
237
  checkboxOnly: false,
220
238
  enabled: true,
221
239
  mode: "multiple"
@@ -225,6 +243,7 @@ export class CellSelectionService {
225
243
  }
226
244
  if (typeof this.settings.selectable === 'boolean') {
227
245
  return {
246
+ cellAggregates: false,
228
247
  checkboxOnly: false,
229
248
  enabled: this.settings.selectable,
230
249
  mode: "multiple"
@@ -54,6 +54,8 @@ export class SelectionCheckboxDirective {
54
54
  const ev = this.selectionService.toggleByIndex(this.itemIndex);
55
55
  ev.ctrlKey = true;
56
56
  ev.shiftKey = false;
57
+ this.selectionService.aggregateChanges.emit(ev);
58
+ ev.cellAggregates = this.selectionService.aggregates;
57
59
  this.selectionService.changes.emit(ev);
58
60
  });
59
61
  }
@@ -20,6 +20,12 @@ export class Selection {
20
20
  * @default []
21
21
  */
22
22
  this.selectedKeys = [];
23
+ /**
24
+ * Defines the initial shift-click range selection starting column index when cell selection is enabled.
25
+ *
26
+ * @default 0
27
+ */
28
+ this.rangeSelectionStartColumnIndex = 0;
23
29
  /**
24
30
  * Fires when the `selectedKeys` collection has been updated.
25
31
  */
@@ -67,6 +73,9 @@ export class Selection {
67
73
  this.rowSelectionState.clear();
68
74
  this.cellSelectionState.clear();
69
75
  }
76
+ /**
77
+ * @hidden
78
+ */
70
79
  getItemKey(row) {
71
80
  if (this.selectionKey) {
72
81
  if (typeof this.selectionKey === "string") {
@@ -145,7 +154,7 @@ export class Selection {
145
154
  }
146
155
  }
147
156
  Selection.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: Selection, deps: [{ token: i1.ContextService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
148
- Selection.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: Selection, selector: "kendo-grid-selection-base", inputs: { selectedKeys: "selectedKeys", selectionKey: ["kendoGridSelectBy", "selectionKey"], columnKey: "columnKey" }, outputs: { selectedKeysChange: "selectedKeysChange" }, usesOnChanges: true, ngImport: i0 });
157
+ Selection.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: Selection, selector: "kendo-grid-selection-base", inputs: { selectedKeys: "selectedKeys", rangeSelectionStartRow: "rangeSelectionStartRow", rangeSelectionStartColumnIndex: "rangeSelectionStartColumnIndex", selectionKey: ["kendoGridSelectBy", "selectionKey"], columnKey: "columnKey" }, outputs: { selectedKeysChange: "selectedKeysChange" }, usesOnChanges: true, ngImport: i0 });
149
158
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: Selection, decorators: [{
150
159
  type: Directive,
151
160
  args: [{
@@ -154,6 +163,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
154
163
  }]
155
164
  }], ctorParameters: function () { return [{ type: i1.ContextService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { selectedKeys: [{
156
165
  type: Input
166
+ }], rangeSelectionStartRow: [{
167
+ type: Input
168
+ }], rangeSelectionStartColumnIndex: [{
169
+ type: Input
157
170
  }], selectionKey: [{
158
171
  type: Input,
159
172
  args: ["kendoGridSelectBy"]
@@ -8,24 +8,28 @@ import { isPresent } from '../utils';
8
8
  import { DomEventsService } from '../common/dom-events.service';
9
9
  import { LocalDataChangesService } from '../editing/local-data-changes.service';
10
10
  import { NavigationService } from '../navigation/navigation.service';
11
+ import { ContextService } from '../common/provider.service';
11
12
  import * as i0 from "@angular/core";
12
13
  import * as i1 from "../common/dom-events.service";
13
14
  import * as i2 from "../editing/local-data-changes.service";
14
15
  import * as i3 from "../navigation/navigation.service";
16
+ import * as i4 from "../common/provider.service";
15
17
  /**
16
18
  * @hidden
17
19
  */
18
20
  export class SelectionService {
19
- constructor(domEvents, localDataChangesService, navigationService) {
21
+ constructor(domEvents, localDataChangesService, navigationService, ctxService) {
20
22
  this.domEvents = domEvents;
21
23
  this.localDataChangesService = localDataChangesService;
22
24
  this.navigationService = navigationService;
25
+ this.ctxService = ctxService;
23
26
  this.changes = new EventEmitter();
24
- this.lastSelectionStartIndex = 0;
27
+ this.aggregateChanges = new EventEmitter();
25
28
  this.currentSelection = [];
26
29
  this.selectAllChecked = false;
27
30
  this.active = false;
28
31
  this.dragging = false;
32
+ this.lastSelectionData = {};
29
33
  this.addSubscriptions();
30
34
  }
31
35
  get enableMarquee() {
@@ -44,6 +48,10 @@ export class SelectionService {
44
48
  }
45
49
  init(settings) {
46
50
  this.settings = settings;
51
+ if (!isPresent(this.lastSelectionStartIndex)) {
52
+ this.lastSelectionStartIndex = this.ctxService?.grid.selectionDirective?.rangeSelectionStartRow?.index || 0;
53
+ this.lastSelectionData = this.ctxService?.grid.selectionDirective?.rangeSelectionStartRow?.dataItem || {};
54
+ }
47
55
  this.currentSelection = [];
48
56
  if (settings.selectable && settings.selectable.enabled !== false) {
49
57
  const iterator = this.getIterator();
@@ -104,12 +112,21 @@ export class SelectionService {
104
112
  }
105
113
  ev.ctrlKey = ctrlKey;
106
114
  ev.shiftKey = event.shiftKey;
115
+ if (this.options.cellAggregates) {
116
+ this.aggregateChanges.emit(ev);
117
+ ev.cellAggregates = this.aggregates;
118
+ }
119
+ if (ev.shiftKey) {
120
+ ev.rangeStartRow = { dataItem: this.lastSelectionData, index: this.lastSelectionStartIndex };
121
+ ev.rangeEndRow = { dataItem: item.data, index: item.index };
122
+ }
107
123
  this.changes.emit(ev);
108
124
  }
109
125
  toggle(item) {
110
126
  const selectedRows = [];
111
127
  const deselectedRows = [];
112
128
  this.lastSelectionStartIndex = item.index;
129
+ this.lastSelectionData = item.data;
113
130
  const rowArgs = { dataItem: item.data, index: item.index };
114
131
  if (this.isSelected(item.index)) {
115
132
  deselectedRows.push(rowArgs);
@@ -148,6 +165,7 @@ export class SelectionService {
148
165
  const deselectedRows = [];
149
166
  const selectedRows = [];
150
167
  this.lastSelectionStartIndex = item.index;
168
+ this.lastSelectionData = item.data;
151
169
  if (!this.isSelected(item.index)) {
152
170
  selectedRows.push({ dataItem: item.data, index: item.index });
153
171
  }
@@ -258,9 +276,15 @@ export class SelectionService {
258
276
  }
259
277
  next = iterator.next();
260
278
  }
279
+ let cellAggregates;
280
+ if (this.options.cellAggregates) {
281
+ this.aggregateChanges.emit({ selectedRows, deselectedRows });
282
+ cellAggregates = this.aggregates;
283
+ }
261
284
  return {
262
285
  deselectedRows: deselectedRows,
263
- selectedRows: selectedRows
286
+ selectedRows: selectedRows,
287
+ cellAggregates
264
288
  };
265
289
  }
266
290
  get selectAllState() {
@@ -273,6 +297,7 @@ export class SelectionService {
273
297
  }
274
298
  get options() {
275
299
  const defaultOptions = {
300
+ cellAggregates: false,
276
301
  checkboxOnly: false,
277
302
  enabled: true,
278
303
  mode: "multiple"
@@ -282,6 +307,7 @@ export class SelectionService {
282
307
  }
283
308
  if (typeof this.settings.selectable === 'boolean') {
284
309
  return {
310
+ cellAggregates: false,
285
311
  checkboxOnly: false,
286
312
  enabled: this.settings.selectable,
287
313
  mode: "multiple"
@@ -354,8 +380,8 @@ export class SelectionService {
354
380
  }
355
381
  }
356
382
  }
357
- SelectionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SelectionService, deps: [{ token: i1.DomEventsService }, { token: i2.LocalDataChangesService }, { token: i3.NavigationService }], target: i0.ɵɵFactoryTarget.Injectable });
383
+ SelectionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SelectionService, deps: [{ token: i1.DomEventsService }, { token: i2.LocalDataChangesService }, { token: i3.NavigationService }, { token: i4.ContextService }], target: i0.ɵɵFactoryTarget.Injectable });
358
384
  SelectionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SelectionService });
359
385
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SelectionService, decorators: [{
360
386
  type: Injectable
361
- }], ctorParameters: function () { return [{ type: i1.DomEventsService }, { type: i2.LocalDataChangesService }, { type: i3.NavigationService }]; } });
387
+ }], ctorParameters: function () { return [{ type: i1.DomEventsService }, { type: i2.LocalDataChangesService }, { type: i3.NavigationService }, { type: i4.ContextService }]; } });