@progress/kendo-angular-grid 6.1.0-dev.202202221518 → 6.1.0-dev.202203011011

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.
@@ -9,7 +9,8 @@ var DEFAULTS = {
9
9
  allowUnsort: true,
10
10
  mode: 'single',
11
11
  showIndexes: true,
12
- initialDirection: 'asc'
12
+ initialDirection: 'asc',
13
+ multiSortKey: 'none'
13
14
  };
14
15
  /**
15
16
  * @hidden
@@ -9,7 +9,7 @@ export var packageMetadata = {
9
9
  name: '@progress/kendo-angular-grid',
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1645542579,
12
+ publishDate: 1646129010,
13
13
  version: '',
14
14
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
15
15
  };
@@ -90,6 +90,7 @@ var lockable = function (_a) {
90
90
  };
91
91
  var ɵ10 = lockable;
92
92
  var rules = and(ofColumnType, reorderable, notInSpanColumn, notSameElement, sameParent, not(lastNonLocked), lockable);
93
+ var modifierKeys = ['alt', 'ctrl', 'shift', 'meta'];
93
94
  /**
94
95
  * @hidden
95
96
  */
@@ -140,8 +141,8 @@ var HeaderComponent = /** @class */ (function () {
140
141
  enumerable: true,
141
142
  configurable: true
142
143
  });
143
- HeaderComponent.prototype.sortColumn = function (column) {
144
- this.sortService.sort(this.toggleSort(column));
144
+ HeaderComponent.prototype.sortColumn = function (descriptor) {
145
+ this.sortService.sort(descriptor);
145
146
  };
146
147
  HeaderComponent.prototype.onSortClick = function (column, event, link) {
147
148
  var target = event.target;
@@ -152,7 +153,9 @@ var HeaderComponent = /** @class */ (function () {
152
153
  return;
153
154
  }
154
155
  }
155
- this.sortColumn(column);
156
+ var modifier = this.matchModifier(event);
157
+ var toggledColumn = this.toggleSort(column, modifier);
158
+ this.sortColumn(toggledColumn);
156
159
  };
157
160
  HeaderComponent.prototype.onHeaderKeydown = function (column, args) {
158
161
  if (args.keyCode === Keys.ArrowDown && args.altKey && this.showFilterMenu) {
@@ -171,7 +174,8 @@ var HeaderComponent = /** @class */ (function () {
171
174
  return;
172
175
  }
173
176
  if (args.keyCode === Keys.Enter && isPresent(column.field)) {
174
- this.sortService.sort(this.toggleSort(column));
177
+ var modifier = this.matchModifier(args);
178
+ this.sortService.sort(this.toggleSort(column, modifier));
175
179
  }
176
180
  };
177
181
  HeaderComponent.prototype.showSortNumbering = function (column) {
@@ -227,14 +231,35 @@ var HeaderComponent = /** @class */ (function () {
227
231
  }
228
232
  return this.localization.get(msg);
229
233
  };
230
- HeaderComponent.prototype.toggleSort = function (column) {
234
+ /**
235
+ *
236
+ * @param column
237
+ * @param modifier - Indicates whether the client-defined `multiSortKey` modifier is met. Defaults to `true`.
238
+ * @returns - SortDescriptor[]
239
+ */
240
+ HeaderComponent.prototype.toggleSort = function (column, modifier) {
241
+ if (modifier === void 0) { modifier = true; }
231
242
  var _a = normalize(this.sortable, column.sortable), allowUnsort = _a.allowUnsort, mode = _a.mode, initialDirection = _a.initialDirection;
232
243
  var descriptor = this.toggleDirection(column.field, allowUnsort, initialDirection);
233
- if (mode === 'single') {
244
+ if (mode === 'single' || !modifier) {
234
245
  return [descriptor];
235
246
  }
236
247
  return this.sort.filter(function (desc) { return desc.field !== column.field; }).concat([descriptor]);
237
248
  };
249
+ /**
250
+ *
251
+ * Determines whether the modifier key (if any) passed
252
+ * with a click/keyboard event matches the user-defined multiSortKey.
253
+ */
254
+ HeaderComponent.prototype.matchModifier = function (event) {
255
+ var multiSortKey = normalize(this.sortable).multiSortKey;
256
+ if (multiSortKey === 'none') {
257
+ return modifierKeys.every(function (key) { return !event[key + "Key"]; });
258
+ }
259
+ return multiSortKey === 'ctrl'
260
+ ? event.ctrlKey || event.metaKey
261
+ : event[multiSortKey + "Key"];
262
+ };
238
263
  HeaderComponent.prototype.ngAfterViewInit = function () {
239
264
  this.subscription.add(observe(this.dropTargets)
240
265
  .subscribe(this.attachTargets.bind(this)));
@@ -772,7 +772,7 @@ var ListComponent = /** @class */ (function () {
772
772
  }
773
773
  ],
774
774
  selector: 'kendo-grid-list',
775
- template: "\n <div #lockedContainer class=\"k-grid-content-locked\" role=\"presentation\"\n *ngIf=\"isLocked\" [style.width.px]=\"lockedWidth\"\n [kendoEventsOutsideAngular]=\"{\n keydown: lockedKeydown,\n scroll: lockedScroll,\n mousewheel: lockedMousewheel,\n DOMMouseScroll: lockedMousewheel\n }\"\n [scope]=\"this\"\n >\n <div role=\"presentation\" class=\"k-grid-table-wrap\">\n <table [locked]=\"true\" #lockedTable class=\"k-grid-table\" role=\"presentation\" [style.width.px]=\"lockedWidth\">\n <colgroup kendoGridColGroup\n role=\"presentation\"\n [groups]=\"groups\"\n [columns]=\"lockedLeafColumns\"\n [detailTemplate]=\"detailTemplate\">\n </colgroup>\n <tbody kendoGridTableBody\n role=\"presentation\"\n [groups]=\"groups\"\n [isLocked]=\"true\"\n [data]=\"data\"\n [noRecordsText]=\"''\"\n [columns]=\"lockedLeafColumns\"\n [totalColumnsCount]=\"leafColumns.length\"\n [detailTemplate]=\"detailTemplate\"\n [showGroupFooters]=\"showFooter\"\n [skip]=\"skip\"\n [selectable]=\"selectable\"\n [trackBy]=\"trackBy\"\n [filterable]=\"filterable\"\n [rowClass]=\"rowClass\"\n [isLoading]=\"loading\"\n [isVirtual]=\"isVirtual\"\n [cellLoadingTemplate]=\"cellLoadingTemplate\">\n </tbody>\n </table>\n <kendo-resize-sensor></kendo-resize-sensor>\n </div>\n <div class=\"k-height-container\" role=\"presentation\">\n <div [style.height.px]=\"totalHeight\"></div>\n </div>\n </div><div #container\n class=\"k-grid-content k-virtual-content\"\n role=\"presentation\" tabindex=\"-1\"\n [kendoGridResizableContainer]=\"lockedLeafColumns.length\"\n [lockedWidth]=\"lockedWidth + 1\">\n <div role=\"presentation\" class=\"k-grid-table-wrap\">\n <table [style.width.px]=\"nonLockedWidth\" #table [virtualColumns]=\"virtualColumns\"\n class=\"k-grid-table\" role=\"presentation\">\n <colgroup kendoGridColGroup\n role=\"presentation\"\n [groups]=\"isLocked ? [] : groups\"\n [columns]=\"nonLockedColumnsToRender\"\n [detailTemplate]=\"detailTemplate\">\n </colgroup>\n <tbody kendoGridTableBody\n role=\"presentation\"\n [skipGroupDecoration]=\"isLocked\"\n [data]=\"data\"\n [groups]=\"groups\"\n [showGroupFooters]=\"showFooter\"\n [columns]=\"nonLockedColumnsToRender\"\n [allColumns]=\"nonLockedLeafColumns\"\n [detailTemplate]=\"detailTemplate\"\n [noRecordsTemplate]=\"noRecordsTemplate\"\n [lockedColumnsCount]=\"lockedLeafColumns.length\"\n [totalColumnsCount]=\"leafColumns.length\"\n [skip]=\"skip\"\n [selectable]=\"selectable\"\n [trackBy]=\"trackBy\"\n [filterable]=\"filterable\"\n [rowClass]=\"rowClass\"\n [rowSticky]=\"rowSticky\"\n [virtualColumns]=\"virtualColumns\"\n [isLoading]=\"loading\"\n [isVirtual]=\"isVirtual\"\n [cellLoadingTemplate]=\"cellLoadingTemplate\">\n </tbody>\n </table>\n <kendo-resize-sensor *ngIf=\"isLocked\"></kendo-resize-sensor>\n </div>\n <kendo-resize-sensor *ngIf=\"isLocked || virtualColumns\"></kendo-resize-sensor>\n <div class=\"k-height-container\" role=\"presentation\">\n <div [style.height.px]=\"totalHeight\"></div>\n </div>\n <div *ngIf=\"virtualColumns\" class=\"k-width-container\" role=\"presentation\">\n <div [style.width.px]=\"totalWidth\"></div>\n </div>\n </div>\n <div [loadingTemplate]=\"loadingTemplate\" *ngIf=\"loading\" kendoGridLoading>\n </div>\n "
775
+ template: "\n <div #lockedContainer class=\"k-grid-content-locked\" role=\"presentation\"\n *ngIf=\"isLocked\" [style.width.px]=\"lockedWidth\" tabindex=\"-1\"\n [kendoEventsOutsideAngular]=\"{\n keydown: lockedKeydown,\n scroll: lockedScroll,\n mousewheel: lockedMousewheel,\n DOMMouseScroll: lockedMousewheel\n }\"\n [scope]=\"this\"\n >\n <div role=\"presentation\" class=\"k-grid-table-wrap\">\n <table [locked]=\"true\" #lockedTable class=\"k-grid-table\" role=\"presentation\" [style.width.px]=\"lockedWidth\">\n <colgroup kendoGridColGroup\n role=\"presentation\"\n [groups]=\"groups\"\n [columns]=\"lockedLeafColumns\"\n [detailTemplate]=\"detailTemplate\">\n </colgroup>\n <tbody kendoGridTableBody\n role=\"presentation\"\n [groups]=\"groups\"\n [isLocked]=\"true\"\n [data]=\"data\"\n [noRecordsText]=\"''\"\n [columns]=\"lockedLeafColumns\"\n [totalColumnsCount]=\"leafColumns.length\"\n [detailTemplate]=\"detailTemplate\"\n [showGroupFooters]=\"showFooter\"\n [skip]=\"skip\"\n [selectable]=\"selectable\"\n [trackBy]=\"trackBy\"\n [filterable]=\"filterable\"\n [rowClass]=\"rowClass\"\n [isLoading]=\"loading\"\n [isVirtual]=\"isVirtual\"\n [cellLoadingTemplate]=\"cellLoadingTemplate\">\n </tbody>\n </table>\n <kendo-resize-sensor></kendo-resize-sensor>\n </div>\n <div class=\"k-height-container\" role=\"presentation\">\n <div [style.height.px]=\"totalHeight\"></div>\n </div>\n </div><div #container\n class=\"k-grid-content k-virtual-content\"\n role=\"presentation\" tabindex=\"-1\"\n [kendoGridResizableContainer]=\"lockedLeafColumns.length\"\n [lockedWidth]=\"lockedWidth + 1\">\n <div role=\"presentation\" class=\"k-grid-table-wrap\">\n <table [style.width.px]=\"nonLockedWidth\" #table [virtualColumns]=\"virtualColumns\"\n class=\"k-grid-table\" role=\"presentation\">\n <colgroup kendoGridColGroup\n role=\"presentation\"\n [groups]=\"isLocked ? [] : groups\"\n [columns]=\"nonLockedColumnsToRender\"\n [detailTemplate]=\"detailTemplate\">\n </colgroup>\n <tbody kendoGridTableBody\n role=\"presentation\"\n [skipGroupDecoration]=\"isLocked\"\n [data]=\"data\"\n [groups]=\"groups\"\n [showGroupFooters]=\"showFooter\"\n [columns]=\"nonLockedColumnsToRender\"\n [allColumns]=\"nonLockedLeafColumns\"\n [detailTemplate]=\"detailTemplate\"\n [noRecordsTemplate]=\"noRecordsTemplate\"\n [lockedColumnsCount]=\"lockedLeafColumns.length\"\n [totalColumnsCount]=\"leafColumns.length\"\n [skip]=\"skip\"\n [selectable]=\"selectable\"\n [trackBy]=\"trackBy\"\n [filterable]=\"filterable\"\n [rowClass]=\"rowClass\"\n [rowSticky]=\"rowSticky\"\n [virtualColumns]=\"virtualColumns\"\n [isLoading]=\"loading\"\n [isVirtual]=\"isVirtual\"\n [cellLoadingTemplate]=\"cellLoadingTemplate\">\n </tbody>\n </table>\n <kendo-resize-sensor *ngIf=\"isLocked\"></kendo-resize-sensor>\n </div>\n <kendo-resize-sensor *ngIf=\"isLocked || virtualColumns\"></kendo-resize-sensor>\n <div class=\"k-height-container\" role=\"presentation\">\n <div [style.height.px]=\"totalHeight\"></div>\n </div>\n <div *ngIf=\"virtualColumns\" class=\"k-width-container\" role=\"presentation\">\n <div [style.width.px]=\"totalWidth\"></div>\n </div>\n </div>\n <div [loadingTemplate]=\"loadingTemplate\" *ngIf=\"loading\" kendoGridLoading>\n </div>\n "
776
776
  }),
777
777
  tslib_1.__param(0, Inject(SCROLLER_FACTORY_TOKEN)),
778
778
  tslib_1.__metadata("design:paramtypes", [Object, DetailsService,
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Defines the settings for sorting the Grid column.
7
7
  */
8
- export declare type ColumnSortSettings = boolean | {
8
+ export interface ColumnSortSettings {
9
9
  /**
10
10
  * Enables the removal of the column sorting.
11
11
  */
@@ -18,90 +18,54 @@ export declare type ColumnSortSettings = boolean | {
18
18
  * - `desc`
19
19
  */
20
20
  initialDirection?: 'asc' | 'desc';
21
- };
21
+ }
22
22
  /**
23
- * Defines the settings for sorting the Grid.
23
+ * Specifies settings for sorting by single column.
24
24
  */
25
- export declare type SortSettings = boolean | ColumnSortSettings & {
25
+ export interface SingleSortSettings extends ColumnSortSettings {
26
26
  /**
27
27
  * The sort mode of the Grid.
28
- *
29
- * The available values for setting the sort modes are:
30
- * - `single`
31
- * - `multiple`
32
28
  */
33
- mode?: 'single' | 'multiple';
34
- /**
35
- * Enables the sort-sequence indicators for sorting multiple columns.
36
- */
37
- showIndexes?: boolean;
38
- };
29
+ mode?: 'single';
30
+ }
39
31
  /**
40
- * @hidden
32
+ * Specifies a modifier key.
41
33
  */
42
- export declare const normalize: (...settings: (boolean | {
43
- /**
44
- * Enables the removal of the column sorting.
45
- */
46
- allowUnsort?: boolean;
47
- /**
48
- * Determines the initial (from the unsorted to the sorted state) sort direction.
49
- *
50
- * The available values for setting the initial sort direction are:
51
- * - `asc` (default)
52
- * - `desc`
53
- */
54
- initialDirection?: "desc" | "asc";
55
- } | (false & {
34
+ export declare type ModifierKey = 'none' | 'ctrl' | 'shift' | 'alt';
35
+ /**
36
+ * Specifies settings for sorting by multiple columns.
37
+ */
38
+ export interface MultipleSortSettings extends ColumnSortSettings {
56
39
  /**
57
40
  * The sort mode of the Grid.
58
- *
59
- * The available values for setting the sort modes are:
60
- * - `single`
61
- * - `multiple`
62
41
  */
63
- mode?: "single" | "multiple";
42
+ mode?: 'multiple';
64
43
  /**
65
44
  * Enables the sort-sequence indicators for sorting multiple columns.
66
45
  */
67
46
  showIndexes?: boolean;
68
- }) | (true & {
69
47
  /**
70
- * The sort mode of the Grid.
48
+ * Specifies the modifier key for sorting by 2nd or more columns.
71
49
  *
72
- * The available values for setting the sort modes are:
73
- * - `single`
74
- * - `multiple`
75
- */
76
- mode?: "single" | "multiple";
77
- /**
78
- * Enables the sort-sequence indicators for sorting multiple columns.
79
- */
80
- showIndexes?: boolean;
81
- }) | ({
82
- /**
83
- * Enables the removal of the column sorting.
84
- */
85
- allowUnsort?: boolean;
86
- /**
87
- * Determines the initial (from the unsorted to the sorted state) sort direction.
50
+ * The default value is 'none', meaning that clicking a column will add it to the sort order.
51
+ * Selecting a key modifier along with the click will remove sorting from all other columns.
88
52
  *
89
- * The available values for setting the initial sort direction are:
90
- * - `asc` (default)
91
- * - `desc`
92
- */
93
- initialDirection?: "desc" | "asc";
94
- } & {
95
- /**
96
- * The sort mode of the Grid.
53
+ * If the key is set to 'ctrl', 'shift' or 'alt', clicking a column will remove sorting from all other columns.
54
+ * The specified key must be pressed to add the column to the sort order instead.
97
55
  *
98
- * The available values for setting the sort modes are:
99
- * - `single`
100
- * - `multiple`
101
- */
102
- mode?: "single" | "multiple";
103
- /**
104
- * Enables the sort-sequence indicators for sorting multiple columns.
56
+ * > The `ctrl` value corresponds to the `Command` key in a macOS environment.
57
+ *
58
+ * @default 'none'
105
59
  */
106
- showIndexes?: boolean;
107
- }))[]) => any;
60
+ multiSortKey?: ModifierKey;
61
+ }
62
+ /**
63
+ * Defines the settings for sorting the Grid.
64
+ * Can be of type `boolean`, [SingleSortSettings]({% slug api_grid_singlesortsettings %}),
65
+ * or [MultipleSortSettings]({% slug api_grid_multiplesortsettings %}).
66
+ */
67
+ export declare type SortSettings = boolean | SingleSortSettings | MultipleSortSettings;
68
+ /**
69
+ * @hidden
70
+ */
71
+ export declare const normalize: (...settings: (boolean | ColumnSortSettings | SingleSortSettings | MultipleSortSettings)[]) => any;
@@ -9,7 +9,8 @@ const DEFAULTS = {
9
9
  allowUnsort: true,
10
10
  mode: 'single',
11
11
  showIndexes: true,
12
- initialDirection: 'asc'
12
+ initialDirection: 'asc',
13
+ multiSortKey: 'none'
13
14
  };
14
15
  /**
15
16
  * @hidden