@progress/kendo-angular-dropdowns 18.1.0-develop.6 → 18.1.0-develop.7

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.
@@ -22,8 +22,8 @@ export declare abstract class BaseCheckDirective {
22
22
  /**
23
23
  * @hidden
24
24
  * The flag is needed in order to determine how to construct the items map keys.
25
- * If `true`, then the key consists of the item's value and 0 (no leveling required),
26
- * else the key consists of the item's value and level (depth)
25
+ * If `true`, then the key consists of the item's value and level (depth),
26
+ * else the key consists of the item's value and 0 (no leveling required)
27
27
  */
28
28
  isHeterogeneous: boolean;
29
29
  /**
@@ -489,8 +489,8 @@ export declare class MultiSelectTreeComponent implements OnInit, OnDestroy, OnCh
489
489
  /**
490
490
  * @hidden
491
491
  * The flag is needed in order to determine how to construct the items map keys.
492
- * If `true`, then the key consists of the item's value and 0 (no leveling required),
493
- * else the key consists of the item's value and level (depth)
492
+ * If `true`, then the key consists of the item's value and level (depth),
493
+ * else the key consists of the item's value and 0 (no leveling required)
494
494
  */
495
495
  isHeterogeneous: boolean;
496
496
  /**
@@ -14,8 +14,8 @@ export class BaseCheckDirective {
14
14
  /**
15
15
  * @hidden
16
16
  * The flag is needed in order to determine how to construct the items map keys.
17
- * If `true`, then the key consists of the item's value and 0 (no leveling required),
18
- * else the key consists of the item's value and level (depth)
17
+ * If `true`, then the key consists of the item's value and level (depth),
18
+ * else the key consists of the item's value and 0 (no leveling required)
19
19
  */
20
20
  isHeterogeneous;
21
21
  addItem(item) {
@@ -36,7 +36,11 @@ export class BaseCheckDirective {
36
36
  const key = this.getKey(item, level);
37
37
  const candidate = { ...item, level, key };
38
38
  this.checkedItems = this.checkedItems
39
- .filter(item => valueFrom(item, this.valueField) !== valueFrom(candidate, this.valueField));
39
+ .filter(item => {
40
+ const valueMatch = valueFrom(item, this.valueField) === valueFrom(candidate, this.valueField);
41
+ const levelMatch = item.level === candidate.level;
42
+ return this.isHeterogeneous ? !(valueMatch && levelMatch) : !valueMatch;
43
+ });
40
44
  this.checkedKeys.delete(key);
41
45
  }
42
46
  isItemChecked(item) {
@@ -768,8 +768,8 @@ export class MultiSelectTreeComponent {
768
768
  /**
769
769
  * @hidden
770
770
  * The flag is needed in order to determine how to construct the items map keys.
771
- * If `true`, then the key consists of the item's value and 0 (no leveling required),
772
- * else the key consists of the item's value and level (depth)
771
+ * If `true`, then the key consists of the item's value and level (depth),
772
+ * else the key consists of the item's value and 0 (no leveling required)
773
773
  */
774
774
  isHeterogeneous;
775
775
  /**
@@ -1116,7 +1116,7 @@ export class MultiSelectTreeComponent {
1116
1116
  }
1117
1117
  else {
1118
1118
  // Remove single tag when the child items are pre-fetched
1119
- const dataItem = this.dataItems[index];
1119
+ const dataItem = this.dataItems.find(item => item.tagPositionIndex === index);
1120
1120
  const itemKey = dataItem.key;
1121
1121
  const lookup = this.lookup.itemLookup(itemKey);
1122
1122
  const pendingCheck = [lookup.item];
@@ -1126,10 +1126,20 @@ export class MultiSelectTreeComponent {
1126
1126
  pendingCheck.push(...this.removeParents(lookup.parent));
1127
1127
  }
1128
1128
  const keysToRemove = pendingCheck.map(item => item.key);
1129
+ // Holds the position indexes of the items to be removed
1130
+ const valueDepthIndices = [];
1129
1131
  this.dataItems = this.dataItems.filter((_item, i) => {
1130
- return !keysToRemove.includes(_item.key) || this.disabledIndices.has(i);
1132
+ const shouldStay = !keysToRemove.includes(_item.key) || this.disabledIndices.has(i);
1133
+ if (!shouldStay) {
1134
+ // We need to know the index position of the data item to be able to update the valueDepth array accordignly
1135
+ // as each data item's position is corresponding to the same position in valueDepth
1136
+ valueDepthIndices.push(i);
1137
+ }
1138
+ return shouldStay;
1139
+ });
1140
+ this.valueDepth = this.valueDepth.filter((_item, i) => {
1141
+ return !valueDepthIndices.includes(i) || this.disabledIndices.has(i);
1131
1142
  });
1132
- this.valueDepth = this.dataItems.map(i => i.level);
1133
1143
  }
1134
1144
  this.updateValue(this.dataItems);
1135
1145
  if (!this.isFocused) {
@@ -1538,7 +1548,15 @@ export class MultiSelectTreeComponent {
1538
1548
  const source = this.dataItems.map(item => item.dataItem);
1539
1549
  this.tags = this.tagMapper(source);
1540
1550
  this.disabledIndices = this.disabledItemsMapper();
1541
- this.dataItems.sort((a, b) => this.tags.indexOf(a.dataItem) - this.tags.indexOf(b.dataItem));
1551
+ // Create a mapping of tags to position indices
1552
+ const tagIndexMap = new Map(this.tags.map((tag, index) => [JSON.stringify(tag), index]));
1553
+ // Modify dataItems by adding a property to hold the item's position as displayed in the tags
1554
+ this.dataItems.forEach(item => {
1555
+ const serializedDataItem = JSON.stringify(item.dataItem);
1556
+ item.tagPositionIndex = tagIndexMap.has(serializedDataItem)
1557
+ ? tagIndexMap.get(serializedDataItem) // Use the index from tags if it exists
1558
+ : null; // Assign a null value if the dataItem is not visible in the tags
1559
+ });
1542
1560
  }
1543
1561
  updateValue(value) {
1544
1562
  const newValue = this.valuePrimitive ?
@@ -10,7 +10,7 @@ export const packageMetadata = {
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCode: 'KENDOUIANGULAR',
12
12
  productCodes: ['KENDOUIANGULAR'],
13
- publishDate: 1738335146,
14
- version: '18.1.0-develop.6',
13
+ publishDate: 1738336350,
14
+ version: '18.1.0-develop.7',
15
15
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
16
16
  };
@@ -37,8 +37,8 @@ const packageMetadata = {
37
37
  productName: 'Kendo UI for Angular',
38
38
  productCode: 'KENDOUIANGULAR',
39
39
  productCodes: ['KENDOUIANGULAR'],
40
- publishDate: 1738335146,
41
- version: '18.1.0-develop.6',
40
+ publishDate: 1738336350,
41
+ version: '18.1.0-develop.7',
42
42
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
43
43
  };
44
44
 
@@ -14687,8 +14687,8 @@ class BaseCheckDirective {
14687
14687
  /**
14688
14688
  * @hidden
14689
14689
  * The flag is needed in order to determine how to construct the items map keys.
14690
- * If `true`, then the key consists of the item's value and 0 (no leveling required),
14691
- * else the key consists of the item's value and level (depth)
14690
+ * If `true`, then the key consists of the item's value and level (depth),
14691
+ * else the key consists of the item's value and 0 (no leveling required)
14692
14692
  */
14693
14693
  isHeterogeneous;
14694
14694
  addItem(item) {
@@ -14709,7 +14709,11 @@ class BaseCheckDirective {
14709
14709
  const key = this.getKey(item, level);
14710
14710
  const candidate = { ...item, level, key };
14711
14711
  this.checkedItems = this.checkedItems
14712
- .filter(item => valueFrom(item, this.valueField) !== valueFrom(candidate, this.valueField));
14712
+ .filter(item => {
14713
+ const valueMatch = valueFrom(item, this.valueField) === valueFrom(candidate, this.valueField);
14714
+ const levelMatch = item.level === candidate.level;
14715
+ return this.isHeterogeneous ? !(valueMatch && levelMatch) : !valueMatch;
14716
+ });
14713
14717
  this.checkedKeys.delete(key);
14714
14718
  }
14715
14719
  isItemChecked(item) {
@@ -15795,8 +15799,8 @@ class MultiSelectTreeComponent {
15795
15799
  /**
15796
15800
  * @hidden
15797
15801
  * The flag is needed in order to determine how to construct the items map keys.
15798
- * If `true`, then the key consists of the item's value and 0 (no leveling required),
15799
- * else the key consists of the item's value and level (depth)
15802
+ * If `true`, then the key consists of the item's value and level (depth),
15803
+ * else the key consists of the item's value and 0 (no leveling required)
15800
15804
  */
15801
15805
  isHeterogeneous;
15802
15806
  /**
@@ -16143,7 +16147,7 @@ class MultiSelectTreeComponent {
16143
16147
  }
16144
16148
  else {
16145
16149
  // Remove single tag when the child items are pre-fetched
16146
- const dataItem = this.dataItems[index];
16150
+ const dataItem = this.dataItems.find(item => item.tagPositionIndex === index);
16147
16151
  const itemKey = dataItem.key;
16148
16152
  const lookup = this.lookup.itemLookup(itemKey);
16149
16153
  const pendingCheck = [lookup.item];
@@ -16153,10 +16157,20 @@ class MultiSelectTreeComponent {
16153
16157
  pendingCheck.push(...this.removeParents(lookup.parent));
16154
16158
  }
16155
16159
  const keysToRemove = pendingCheck.map(item => item.key);
16160
+ // Holds the position indexes of the items to be removed
16161
+ const valueDepthIndices = [];
16156
16162
  this.dataItems = this.dataItems.filter((_item, i) => {
16157
- return !keysToRemove.includes(_item.key) || this.disabledIndices.has(i);
16163
+ const shouldStay = !keysToRemove.includes(_item.key) || this.disabledIndices.has(i);
16164
+ if (!shouldStay) {
16165
+ // We need to know the index position of the data item to be able to update the valueDepth array accordignly
16166
+ // as each data item's position is corresponding to the same position in valueDepth
16167
+ valueDepthIndices.push(i);
16168
+ }
16169
+ return shouldStay;
16170
+ });
16171
+ this.valueDepth = this.valueDepth.filter((_item, i) => {
16172
+ return !valueDepthIndices.includes(i) || this.disabledIndices.has(i);
16158
16173
  });
16159
- this.valueDepth = this.dataItems.map(i => i.level);
16160
16174
  }
16161
16175
  this.updateValue(this.dataItems);
16162
16176
  if (!this.isFocused) {
@@ -16565,7 +16579,15 @@ class MultiSelectTreeComponent {
16565
16579
  const source = this.dataItems.map(item => item.dataItem);
16566
16580
  this.tags = this.tagMapper(source);
16567
16581
  this.disabledIndices = this.disabledItemsMapper();
16568
- this.dataItems.sort((a, b) => this.tags.indexOf(a.dataItem) - this.tags.indexOf(b.dataItem));
16582
+ // Create a mapping of tags to position indices
16583
+ const tagIndexMap = new Map(this.tags.map((tag, index) => [JSON.stringify(tag), index]));
16584
+ // Modify dataItems by adding a property to hold the item's position as displayed in the tags
16585
+ this.dataItems.forEach(item => {
16586
+ const serializedDataItem = JSON.stringify(item.dataItem);
16587
+ item.tagPositionIndex = tagIndexMap.has(serializedDataItem)
16588
+ ? tagIndexMap.get(serializedDataItem) // Use the index from tags if it exists
16589
+ : null; // Assign a null value if the dataItem is not visible in the tags
16590
+ });
16569
16591
  }
16570
16592
  updateValue(value) {
16571
16593
  const newValue = this.valuePrimitive ?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-angular-dropdowns",
3
- "version": "18.1.0-develop.6",
3
+ "version": "18.1.0-develop.7",
4
4
  "description": "A wide variety of native Angular dropdown components including AutoComplete, ComboBox, DropDownList, DropDownTree, MultiColumnComboBox, MultiSelect, and MultiSelectTree ",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",
@@ -20,7 +20,7 @@
20
20
  "package": {
21
21
  "productName": "Kendo UI for Angular",
22
22
  "productCode": "KENDOUIANGULAR",
23
- "publishDate": 1738335146,
23
+ "publishDate": 1738336350,
24
24
  "licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
25
25
  }
26
26
  },
@@ -31,18 +31,18 @@
31
31
  "@angular/forms": "16 - 19",
32
32
  "@angular/platform-browser": "16 - 19",
33
33
  "@progress/kendo-licensing": "^1.0.2",
34
- "@progress/kendo-angular-common": "18.1.0-develop.6",
35
- "@progress/kendo-angular-utils": "18.1.0-develop.6",
36
- "@progress/kendo-angular-l10n": "18.1.0-develop.6",
37
- "@progress/kendo-angular-navigation": "18.1.0-develop.6",
38
- "@progress/kendo-angular-popup": "18.1.0-develop.6",
39
- "@progress/kendo-angular-icons": "18.1.0-develop.6",
40
- "@progress/kendo-angular-treeview": "18.1.0-develop.6",
34
+ "@progress/kendo-angular-common": "18.1.0-develop.7",
35
+ "@progress/kendo-angular-utils": "18.1.0-develop.7",
36
+ "@progress/kendo-angular-l10n": "18.1.0-develop.7",
37
+ "@progress/kendo-angular-navigation": "18.1.0-develop.7",
38
+ "@progress/kendo-angular-popup": "18.1.0-develop.7",
39
+ "@progress/kendo-angular-icons": "18.1.0-develop.7",
40
+ "@progress/kendo-angular-treeview": "18.1.0-develop.7",
41
41
  "rxjs": "^6.5.3 || ^7.0.0"
42
42
  },
43
43
  "dependencies": {
44
44
  "tslib": "^2.3.1",
45
- "@progress/kendo-angular-schematics": "18.1.0-develop.6",
45
+ "@progress/kendo-angular-schematics": "18.1.0-develop.7",
46
46
  "@progress/kendo-common": "^1.0.1"
47
47
  },
48
48
  "schematics": "./schematics/collection.json",
@@ -4,9 +4,9 @@ const schematics_1 = require("@angular-devkit/schematics");
4
4
  function default_1(options) {
5
5
  const finalOptions = Object.assign(Object.assign({}, options), { mainNgModule: 'DropDownsModule', package: 'dropdowns', peerDependencies: {
6
6
  // peers of the treeview
7
- '@progress/kendo-angular-inputs': '18.1.0-develop.6',
7
+ '@progress/kendo-angular-inputs': '18.1.0-develop.7',
8
8
  // peers of inputs
9
- '@progress/kendo-angular-intl': '18.1.0-develop.6',
9
+ '@progress/kendo-angular-intl': '18.1.0-develop.7',
10
10
  '@progress/kendo-drawing': '^1.17.2',
11
11
  // Peer dependency of icons
12
12
  '@progress/kendo-svg-icons': '^4.0.0'