@progress/kendo-angular-grid 6.1.0-dev.202202251406 → 6.1.0-dev.202203010950
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.
- package/dist/cdn/js/kendo-angular-grid.js +1 -1
- package/dist/cdn/main.js +1 -1
- package/dist/es/columns/sort-settings.js +2 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/rendering/header/header.component.js +31 -6
- package/dist/es2015/columns/sort-settings.d.ts +33 -69
- package/dist/es2015/columns/sort-settings.js +2 -1
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/main.d.ts +1 -1
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/rendering/header/header.component.d.ts +14 -2
- package/dist/es2015/rendering/header/header.component.js +30 -6
- package/dist/fesm2015/index.js +33 -8
- package/dist/fesm5/index.js +34 -8
- package/dist/npm/columns/sort-settings.js +2 -1
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/rendering/header/header.component.js +31 -6
- package/dist/systemjs/kendo-angular-grid.js +1 -1
- package/package.json +1 -1
|
@@ -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:
|
|
12
|
+
publishDate: 1646127685,
|
|
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 (
|
|
144
|
-
this.sortService.sort(
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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)));
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* Defines the settings for sorting the Grid column.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
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
|
-
*
|
|
23
|
+
* Specifies settings for sorting by single column.
|
|
24
24
|
*/
|
|
25
|
-
export
|
|
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'
|
|
34
|
-
|
|
35
|
-
* Enables the sort-sequence indicators for sorting multiple columns.
|
|
36
|
-
*/
|
|
37
|
-
showIndexes?: boolean;
|
|
38
|
-
};
|
|
29
|
+
mode?: 'single';
|
|
30
|
+
}
|
|
39
31
|
/**
|
|
40
|
-
*
|
|
32
|
+
* Specifies a modifier key.
|
|
41
33
|
*/
|
|
42
|
-
export declare
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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?:
|
|
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
|
-
*
|
|
48
|
+
* Specifies the modifier key for sorting by 2nd or more columns.
|
|
71
49
|
*
|
|
72
|
-
* The
|
|
73
|
-
*
|
|
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
|
-
*
|
|
90
|
-
*
|
|
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
|
|
99
|
-
*
|
|
100
|
-
*
|
|
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
|
-
|
|
107
|
-
}
|
|
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;
|