@progress/kendo-angular-grid 6.0.2 → 6.0.3-dev.202202141635
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/package-metadata.js +1 -1
- package/dist/es/selection/selectall-checkbox.directive.js +18 -11
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/selection/selectall-checkbox.directive.d.ts +1 -1
- package/dist/es2015/selection/selectall-checkbox.directive.js +18 -11
- package/dist/fesm2015/index.js +17 -11
- package/dist/fesm5/index.js +17 -11
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/selection/selectall-checkbox.directive.js +17 -10
- 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: 1644856057,
|
|
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
|
};
|
|
@@ -6,7 +6,8 @@ import * as tslib_1 from "tslib";
|
|
|
6
6
|
import { detectIE } from './../utils';
|
|
7
7
|
import { Directive, HostBinding, Renderer2, ElementRef, Input, Output, EventEmitter, NgZone } from '@angular/core';
|
|
8
8
|
import { SelectionService } from './selection.service';
|
|
9
|
-
import { isPresent } from
|
|
9
|
+
import { isPresent } from '../utils';
|
|
10
|
+
import { hasObservers } from '@progress/kendo-angular-common';
|
|
10
11
|
/**
|
|
11
12
|
* Represents the select-all checkbox feature of the Grid ([see example]({% slug selection_grid %}#toc-select-all-feature)).
|
|
12
13
|
*/
|
|
@@ -22,10 +23,10 @@ var SelectAllCheckboxDirective = /** @class */ (function () {
|
|
|
22
23
|
* ([see example]({% slug selection_grid %}#toc-select-all-feature)).
|
|
23
24
|
*/
|
|
24
25
|
this.selectAllChange = new EventEmitter();
|
|
25
|
-
this.type =
|
|
26
|
+
this.type = 'checkbox';
|
|
26
27
|
this.stateSet = false;
|
|
27
28
|
this.ngZone.runOutsideAngular(function () {
|
|
28
|
-
_this.destroyClick = _this.renderer.listen(_this.el.nativeElement,
|
|
29
|
+
_this.destroyClick = _this.renderer.listen(_this.el.nativeElement, 'click', _this.onClick.bind(_this));
|
|
29
30
|
});
|
|
30
31
|
}
|
|
31
32
|
SelectAllCheckboxDirective.prototype.ngAfterContentChecked = function () {
|
|
@@ -44,14 +45,20 @@ var SelectAllCheckboxDirective = /** @class */ (function () {
|
|
|
44
45
|
*/
|
|
45
46
|
SelectAllCheckboxDirective.prototype.onClick = function () {
|
|
46
47
|
var _this = this;
|
|
47
|
-
// yields consistent cross-browser behavior when clicking an
|
|
48
|
+
// yields consistent cross-browser behavior when clicking an indeterminate checkbox
|
|
48
49
|
var undefinedCheckedStateInIE = detectIE() && this.selectionService.selectAllState === undefined;
|
|
49
50
|
var isChecked = undefinedCheckedStateInIE ? true : this.el.nativeElement.checked;
|
|
50
51
|
var options = this.selectionService.options;
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
var enabledAndMultiple = options.enabled && options.mode === 'multiple';
|
|
53
|
+
var shouldEmitSelectAll = hasObservers(this.selectAllChange);
|
|
54
|
+
if (enabledAndMultiple || shouldEmitSelectAll) {
|
|
53
55
|
this.ngZone.run(function () {
|
|
54
|
-
|
|
56
|
+
if (enabledAndMultiple) {
|
|
57
|
+
_this.selectionService.updateAll(isChecked);
|
|
58
|
+
}
|
|
59
|
+
if (shouldEmitSelectAll) {
|
|
60
|
+
_this.selectAllChange.emit(isChecked ? 'checked' : 'unchecked');
|
|
61
|
+
}
|
|
55
62
|
});
|
|
56
63
|
}
|
|
57
64
|
};
|
|
@@ -61,17 +68,17 @@ var SelectAllCheckboxDirective = /** @class */ (function () {
|
|
|
61
68
|
SelectAllCheckboxDirective.prototype.setState = function () {
|
|
62
69
|
var state = this.stateSet ? this.stateToBool() : this.selectionService.selectAllState;
|
|
63
70
|
var elem = this.el.nativeElement;
|
|
64
|
-
this.renderer.setProperty(elem,
|
|
65
|
-
this.renderer.setProperty(elem,
|
|
71
|
+
this.renderer.setProperty(elem, 'indeterminate', !isPresent(state));
|
|
72
|
+
this.renderer.setProperty(elem, 'checked', isPresent(state) ? state : false);
|
|
66
73
|
};
|
|
67
74
|
/**
|
|
68
75
|
* @hidden
|
|
69
76
|
*/
|
|
70
77
|
SelectAllCheckboxDirective.prototype.stateToBool = function () {
|
|
71
78
|
switch (this.state) {
|
|
72
|
-
case
|
|
79
|
+
case 'checked':
|
|
73
80
|
return true;
|
|
74
|
-
case
|
|
81
|
+
case 'unchecked':
|
|
75
82
|
return false;
|
|
76
83
|
default:
|
|
77
84
|
return undefined;
|