@progress/kendo-angular-treeview 15.1.0-develop.1 → 15.1.0-develop.3

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.
@@ -63,6 +63,7 @@ export declare class CheckDirective implements OnChanges, OnDestroy {
63
63
  protected toggleCheckOnClick(): void;
64
64
  private unsubscribeClick;
65
65
  private checkNode;
66
+ private uncheckChildren;
66
67
  private checkParents;
67
68
  private allChildrenSelected;
68
69
  private notify;
@@ -22,33 +22,45 @@ export interface CheckableSettings {
22
22
  /**
23
23
  * The available values are:
24
24
  * * `"single"`
25
- * * (Default) `"multiple"`
25
+ * * `"multiple"`
26
+ *
27
+ * @default 'multiple'
26
28
  */
27
29
  mode?: CheckMode;
28
30
  /**
29
31
  * Determines whether to automatically check the children nodes.
30
- * Defaults to `true`.
32
+ * @default true
31
33
  *
32
34
  * > The option works only together with the multiple selection mode.
33
35
  */
34
36
  checkChildren?: boolean;
35
37
  /**
36
38
  * Determines whether to display the indeterminate state for the parent nodes.
37
- * Defaults to `true`.
39
+ * @default true
38
40
  *
39
41
  * > The option works only together with the multiple selection mode.
40
42
  */
41
43
  checkParents?: boolean;
42
44
  /**
43
45
  * Specifies if on clicking the node, the item will be checked or unchecked.
44
- * Defaults to `false`.
46
+ * @default false
45
47
  */
46
48
  checkOnClick?: boolean;
47
49
  /**
48
50
  * Determines whether disabled children will be checked if their parent is checked.
49
- * Defaults to `false`
51
+ *
52
+ * @default false
50
53
  *
51
54
  * > The option works only together with the multiple selection mode and `checkChildren: true`.
52
55
  */
53
56
  checkDisabledChildren?: boolean;
57
+ /**
58
+ * Determines whether collapsed children should be unchecked when unchecking their parent.
59
+ *
60
+ * @default false
61
+ *
62
+ * > The option works only together with the multiple selection mode and when
63
+ * [`loadOnDemand`]({% slug api_treeview_treeviewcomponent %}#toc-loadondemand) is `true`.
64
+ */
65
+ uncheckCollapsedChildren?: boolean;
54
66
  }
@@ -67,7 +67,8 @@ export class CheckDirective {
67
67
  checkChildren: true,
68
68
  checkParents: true,
69
69
  enabled: true,
70
- mode: "multiple"
70
+ mode: "multiple",
71
+ uncheckCollapsedChildren: false
71
72
  };
72
73
  if (!isPresent(this.checkable) || typeof this.checkable === 'string') {
73
74
  return defaultOptions;
@@ -189,9 +190,29 @@ export class CheckDirective {
189
190
  }
190
191
  else {
191
192
  this.state.delete(key);
193
+ if (this.options.uncheckCollapsedChildren &&
194
+ this.options.mode === 'multiple' &&
195
+ this.treeView.loadOnDemand) {
196
+ if (this.checkKey && this.treeView.hasChildren(node.item.dataItem)) {
197
+ this.uncheckChildren(node.item.dataItem, node.item.index);
198
+ return;
199
+ }
200
+ const checkedKeys = Array.from(this.state).filter(matchKey(node.item.index));
201
+ checkedKeys.forEach(key => this.state.delete(key));
202
+ }
192
203
  }
193
204
  });
194
205
  }
206
+ uncheckChildren(dataItem, parentNodeIndex) {
207
+ this.treeView.children(dataItem).subscribe(children => children.forEach((item, index) => {
208
+ const nodeIndex = `${parentNodeIndex}_${index}`;
209
+ this.state.delete(this.itemKey({ dataItem: item, index: nodeIndex }));
210
+ if (this.treeView.hasChildren(item)) {
211
+ this.uncheckChildren(item, nodeIndex);
212
+ }
213
+ }));
214
+ }
215
+ ;
195
216
  checkParents(parent) {
196
217
  if (!isPresent(parent)) {
197
218
  return;
@@ -9,7 +9,7 @@ export const packageMetadata = {
9
9
  name: '@progress/kendo-angular-treeview',
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1708505111,
13
- version: '15.1.0-develop.1',
12
+ publishDate: 1708526974,
13
+ version: '15.1.0-develop.3',
14
14
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
15
15
  };
@@ -28,8 +28,8 @@ const packageMetadata = {
28
28
  name: '@progress/kendo-angular-treeview',
29
29
  productName: 'Kendo UI for Angular',
30
30
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
31
- publishDate: 1708505111,
32
- version: '15.1.0-develop.1',
31
+ publishDate: 1708526974,
32
+ version: '15.1.0-develop.3',
33
33
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
34
34
  };
35
35
 
@@ -3111,7 +3111,8 @@ class CheckDirective {
3111
3111
  checkChildren: true,
3112
3112
  checkParents: true,
3113
3113
  enabled: true,
3114
- mode: "multiple"
3114
+ mode: "multiple",
3115
+ uncheckCollapsedChildren: false
3115
3116
  };
3116
3117
  if (!isPresent(this.checkable) || typeof this.checkable === 'string') {
3117
3118
  return defaultOptions;
@@ -3233,9 +3234,29 @@ class CheckDirective {
3233
3234
  }
3234
3235
  else {
3235
3236
  this.state.delete(key);
3237
+ if (this.options.uncheckCollapsedChildren &&
3238
+ this.options.mode === 'multiple' &&
3239
+ this.treeView.loadOnDemand) {
3240
+ if (this.checkKey && this.treeView.hasChildren(node.item.dataItem)) {
3241
+ this.uncheckChildren(node.item.dataItem, node.item.index);
3242
+ return;
3243
+ }
3244
+ const checkedKeys = Array.from(this.state).filter(matchKey(node.item.index));
3245
+ checkedKeys.forEach(key => this.state.delete(key));
3246
+ }
3236
3247
  }
3237
3248
  });
3238
3249
  }
3250
+ uncheckChildren(dataItem, parentNodeIndex) {
3251
+ this.treeView.children(dataItem).subscribe(children => children.forEach((item, index) => {
3252
+ const nodeIndex = `${parentNodeIndex}_${index}`;
3253
+ this.state.delete(this.itemKey({ dataItem: item, index: nodeIndex }));
3254
+ if (this.treeView.hasChildren(item)) {
3255
+ this.uncheckChildren(item, nodeIndex);
3256
+ }
3257
+ }));
3258
+ }
3259
+ ;
3239
3260
  checkParents(parent) {
3240
3261
  if (!isPresent(parent)) {
3241
3262
  return;
@@ -28,8 +28,8 @@ const packageMetadata = {
28
28
  name: '@progress/kendo-angular-treeview',
29
29
  productName: 'Kendo UI for Angular',
30
30
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
31
- publishDate: 1708505111,
32
- version: '15.1.0-develop.1',
31
+ publishDate: 1708526974,
32
+ version: '15.1.0-develop.3',
33
33
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
34
34
  };
35
35
 
@@ -3107,7 +3107,8 @@ class CheckDirective {
3107
3107
  checkChildren: true,
3108
3108
  checkParents: true,
3109
3109
  enabled: true,
3110
- mode: "multiple"
3110
+ mode: "multiple",
3111
+ uncheckCollapsedChildren: false
3111
3112
  };
3112
3113
  if (!isPresent(this.checkable) || typeof this.checkable === 'string') {
3113
3114
  return defaultOptions;
@@ -3229,9 +3230,29 @@ class CheckDirective {
3229
3230
  }
3230
3231
  else {
3231
3232
  this.state.delete(key);
3233
+ if (this.options.uncheckCollapsedChildren &&
3234
+ this.options.mode === 'multiple' &&
3235
+ this.treeView.loadOnDemand) {
3236
+ if (this.checkKey && this.treeView.hasChildren(node.item.dataItem)) {
3237
+ this.uncheckChildren(node.item.dataItem, node.item.index);
3238
+ return;
3239
+ }
3240
+ const checkedKeys = Array.from(this.state).filter(matchKey(node.item.index));
3241
+ checkedKeys.forEach(key => this.state.delete(key));
3242
+ }
3232
3243
  }
3233
3244
  });
3234
3245
  }
3246
+ uncheckChildren(dataItem, parentNodeIndex) {
3247
+ this.treeView.children(dataItem).subscribe(children => children.forEach((item, index) => {
3248
+ const nodeIndex = `${parentNodeIndex}_${index}`;
3249
+ this.state.delete(this.itemKey({ dataItem: item, index: nodeIndex }));
3250
+ if (this.treeView.hasChildren(item)) {
3251
+ this.uncheckChildren(item, nodeIndex);
3252
+ }
3253
+ }));
3254
+ }
3255
+ ;
3235
3256
  checkParents(parent) {
3236
3257
  if (!isPresent(parent)) {
3237
3258
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-angular-treeview",
3
- "version": "15.1.0-develop.1",
3
+ "version": "15.1.0-develop.3",
4
4
  "description": "Kendo UI TreeView for Angular",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",
@@ -23,15 +23,15 @@
23
23
  "@angular/core": "13 - 17",
24
24
  "@angular/platform-browser": "13 - 17",
25
25
  "@progress/kendo-licensing": "^1.0.2",
26
- "@progress/kendo-angular-common": "15.1.0-develop.1",
27
- "@progress/kendo-angular-inputs": "15.1.0-develop.1",
28
- "@progress/kendo-angular-icons": "15.1.0-develop.1",
29
- "@progress/kendo-angular-l10n": "15.1.0-develop.1",
26
+ "@progress/kendo-angular-common": "15.1.0-develop.3",
27
+ "@progress/kendo-angular-inputs": "15.1.0-develop.3",
28
+ "@progress/kendo-angular-icons": "15.1.0-develop.3",
29
+ "@progress/kendo-angular-l10n": "15.1.0-develop.3",
30
30
  "rxjs": "^6.5.3 || ^7.0.0"
31
31
  },
32
32
  "dependencies": {
33
33
  "tslib": "^2.3.1",
34
- "@progress/kendo-angular-schematics": "15.1.0-develop.1",
34
+ "@progress/kendo-angular-schematics": "15.1.0-develop.3",
35
35
  "@progress/kendo-common": "^0.2.0",
36
36
  "@progress/kendo-draggable": "^3.0.2"
37
37
  },
@@ -4,10 +4,10 @@ const schematics_1 = require("@angular-devkit/schematics");
4
4
  function default_1(options) {
5
5
  const finalOptions = Object.assign(Object.assign({}, options), { mainNgModule: 'TreeViewModule', package: 'treeview', peerDependencies: {
6
6
  // Peers of kendo-angular-inputs
7
- '@progress/kendo-angular-buttons': '15.1.0-develop.1',
8
- '@progress/kendo-angular-dialog': '15.1.0-develop.1',
9
- '@progress/kendo-angular-intl': '15.1.0-develop.1',
10
- '@progress/kendo-angular-popup': '15.1.0-develop.1',
7
+ '@progress/kendo-angular-buttons': '15.1.0-develop.3',
8
+ '@progress/kendo-angular-dialog': '15.1.0-develop.3',
9
+ '@progress/kendo-angular-intl': '15.1.0-develop.3',
10
+ '@progress/kendo-angular-popup': '15.1.0-develop.3',
11
11
  '@progress/kendo-drawing': '^1.9.3',
12
12
  // Peer dependency of icons
13
13
  '@progress/kendo-svg-icons': '^2.0.0'