@progress/kendo-angular-dropdowns 6.0.1 → 6.0.2-dev.202202171128

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.
@@ -245,7 +245,8 @@ export declare class MultiSelectComponent implements OnDestroy, OnChanges, OnIni
245
245
  */
246
246
  clearButton: boolean;
247
247
  /**
248
- * A user-defined callback function which receives an array of selected data items and maps them to an array of tags.
248
+ * A user-defined callback function which receives an array of selected data items and maps them to an array of tags
249
+ * ([see examples]({% slug summarytagmode_multiselect %}#toc-rendering-of-tags)).
249
250
  *
250
251
  * @param { Any[] } dataItems - The selected data items from the list.
251
252
  * @returns { Any[] } - The tags that will be rendered by the component.
@@ -120,7 +120,8 @@ let MultiSelectComponent = MultiSelectComponent_1 = class MultiSelectComponent {
120
120
  */
121
121
  this.clearButton = true;
122
122
  /**
123
- * A user-defined callback function which receives an array of selected data items and maps them to an array of tags.
123
+ * A user-defined callback function which receives an array of selected data items and maps them to an array of tags
124
+ * ([see examples]({% slug summarytagmode_multiselect %}#toc-rendering-of-tags)).
124
125
  *
125
126
  * @param { Any[] } dataItems - The selected data items from the list.
126
127
  * @returns { Any[] } - The tags that will be rendered by the component.
@@ -9,7 +9,7 @@ export const packageMetadata = {
9
9
  name: '@progress/kendo-angular-dropdowns',
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1642685068,
12
+ publishDate: 1645097139,
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
  };
@@ -23,7 +23,7 @@ const packageMetadata = {
23
23
  name: '@progress/kendo-angular-dropdowns',
24
24
  productName: 'Kendo UI for Angular',
25
25
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
26
- publishDate: 1642685068,
26
+ publishDate: 1645097139,
27
27
  version: '',
28
28
  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'
29
29
  };
@@ -6627,7 +6627,8 @@ let MultiSelectComponent = MultiSelectComponent_1 = class MultiSelectComponent {
6627
6627
  */
6628
6628
  this.clearButton = true;
6629
6629
  /**
6630
- * A user-defined callback function which receives an array of selected data items and maps them to an array of tags.
6630
+ * A user-defined callback function which receives an array of selected data items and maps them to an array of tags
6631
+ * ([see examples]({% slug summarytagmode_multiselect %}#toc-rendering-of-tags)).
6631
6632
  *
6632
6633
  * @param { Any[] } dataItems - The selected data items from the list.
6633
6634
  * @returns { Any[] } - The tags that will be rendered by the component.
@@ -12528,7 +12529,7 @@ class BaseCheckDirective {
12528
12529
  const level = getHierarchicalItemLevel(item.index);
12529
12530
  const candidate = Object.assign({}, item, { level });
12530
12531
  this.checkedItems.push(candidate);
12531
- this.checkedKeys.add(valueFrom(candidate, this.valueField));
12532
+ this.checkedKeys.add(this.getKey(candidate));
12532
12533
  }
12533
12534
  removeItem(item) {
12534
12535
  if (!this.isItemChecked(item)) {
@@ -12538,14 +12539,28 @@ class BaseCheckDirective {
12538
12539
  const candidate = Object.assign({}, item, { level });
12539
12540
  this.checkedItems = this.checkedItems
12540
12541
  .filter(item => valueFrom(item, this.valueField) !== valueFrom(candidate, this.valueField));
12541
- this.checkedKeys.delete(valueFrom(candidate, this.valueField));
12542
+ this.checkedKeys.delete(this.getKey(candidate));
12542
12543
  }
12543
12544
  isItemChecked(item) {
12544
- return this.checkedKeys.has(valueFrom(item, this.valueField));
12545
+ const level = item.index.split('_').length - 1;
12546
+ item.level = level;
12547
+ return this.checkedKeys.has(this.getKey(item));
12545
12548
  }
12546
12549
  updateItems() {
12547
12550
  this.checkedItems = this.checkedItems || [];
12548
- this.checkedKeys = new Set(this.checkedItems.map(item => valueFrom(item, this.valueField)));
12551
+ this.checkedKeys = new Set(this.checkedItems.map(item => this.getKey(item)));
12552
+ }
12553
+ /**
12554
+ * Adds the item's depth to the item's value to allow duplicate values on different levels.
12555
+ *
12556
+ * @param item - The checked key.
12557
+ * @returns { string } - A string key consisting of the item's `valueField` value and its depth.
12558
+ */
12559
+ getKey(item) {
12560
+ if (isArray(this.valueField)) {
12561
+ return valueFrom(item, this.valueField) + '_' + item.level;
12562
+ }
12563
+ return valueFrom(item, this.valueField);
12549
12564
  }
12550
12565
  }
12551
12566
  __decorate([
@@ -23,7 +23,7 @@ var packageMetadata = {
23
23
  name: '@progress/kendo-angular-dropdowns',
24
24
  productName: 'Kendo UI for Angular',
25
25
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
26
- publishDate: 1642685068,
26
+ publishDate: 1645097139,
27
27
  version: '',
28
28
  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'
29
29
  };
@@ -6646,7 +6646,8 @@ var MultiSelectComponent = /** @class */ (function () {
6646
6646
  */
6647
6647
  this.clearButton = true;
6648
6648
  /**
6649
- * A user-defined callback function which receives an array of selected data items and maps them to an array of tags.
6649
+ * A user-defined callback function which receives an array of selected data items and maps them to an array of tags
6650
+ * ([see examples]({% slug summarytagmode_multiselect %}#toc-rendering-of-tags)).
6650
6651
  *
6651
6652
  * @param { Any[] } dataItems - The selected data items from the list.
6652
6653
  * @returns { Any[] } - The tags that will be rendered by the component.
@@ -12384,7 +12385,7 @@ var BaseCheckDirective = /** @class */ (function () {
12384
12385
  var level = getHierarchicalItemLevel(item.index);
12385
12386
  var candidate = __assign({}, item, { level: level });
12386
12387
  this.checkedItems.push(candidate);
12387
- this.checkedKeys.add(valueFrom(candidate, this.valueField));
12388
+ this.checkedKeys.add(this.getKey(candidate));
12388
12389
  };
12389
12390
  BaseCheckDirective.prototype.removeItem = function (item) {
12390
12391
  var _this = this;
@@ -12395,15 +12396,29 @@ var BaseCheckDirective = /** @class */ (function () {
12395
12396
  var candidate = __assign({}, item, { level: level });
12396
12397
  this.checkedItems = this.checkedItems
12397
12398
  .filter(function (item) { return valueFrom(item, _this.valueField) !== valueFrom(candidate, _this.valueField); });
12398
- this.checkedKeys.delete(valueFrom(candidate, this.valueField));
12399
+ this.checkedKeys.delete(this.getKey(candidate));
12399
12400
  };
12400
12401
  BaseCheckDirective.prototype.isItemChecked = function (item) {
12401
- return this.checkedKeys.has(valueFrom(item, this.valueField));
12402
+ var level = item.index.split('_').length - 1;
12403
+ item.level = level;
12404
+ return this.checkedKeys.has(this.getKey(item));
12402
12405
  };
12403
12406
  BaseCheckDirective.prototype.updateItems = function () {
12404
12407
  var _this = this;
12405
12408
  this.checkedItems = this.checkedItems || [];
12406
- this.checkedKeys = new Set(this.checkedItems.map(function (item) { return valueFrom(item, _this.valueField); }));
12409
+ this.checkedKeys = new Set(this.checkedItems.map(function (item) { return _this.getKey(item); }));
12410
+ };
12411
+ /**
12412
+ * Adds the item's depth to the item's value to allow duplicate values on different levels.
12413
+ *
12414
+ * @param item - The checked key.
12415
+ * @returns { string } - A string key consisting of the item's `valueField` value and its depth.
12416
+ */
12417
+ BaseCheckDirective.prototype.getKey = function (item) {
12418
+ if (isArray(this.valueField)) {
12419
+ return valueFrom(item, this.valueField) + '_' + item.level;
12420
+ }
12421
+ return valueFrom(item, this.valueField);
12407
12422
  };
12408
12423
  __decorate([
12409
12424
  Input(),
@@ -22,7 +22,7 @@ var BaseCheckDirective = /** @class */ (function () {
22
22
  var level = util_1.getHierarchicalItemLevel(item.index);
23
23
  var candidate = tslib_1.__assign({}, item, { level: level });
24
24
  this.checkedItems.push(candidate);
25
- this.checkedKeys.add(util_1.valueFrom(candidate, this.valueField));
25
+ this.checkedKeys.add(this.getKey(candidate));
26
26
  };
27
27
  BaseCheckDirective.prototype.removeItem = function (item) {
28
28
  var _this = this;
@@ -33,15 +33,29 @@ var BaseCheckDirective = /** @class */ (function () {
33
33
  var candidate = tslib_1.__assign({}, item, { level: level });
34
34
  this.checkedItems = this.checkedItems
35
35
  .filter(function (item) { return util_1.valueFrom(item, _this.valueField) !== util_1.valueFrom(candidate, _this.valueField); });
36
- this.checkedKeys.delete(util_1.valueFrom(candidate, this.valueField));
36
+ this.checkedKeys.delete(this.getKey(candidate));
37
37
  };
38
38
  BaseCheckDirective.prototype.isItemChecked = function (item) {
39
- return this.checkedKeys.has(util_1.valueFrom(item, this.valueField));
39
+ var level = item.index.split('_').length - 1;
40
+ item.level = level;
41
+ return this.checkedKeys.has(this.getKey(item));
40
42
  };
41
43
  BaseCheckDirective.prototype.updateItems = function () {
42
44
  var _this = this;
43
45
  this.checkedItems = this.checkedItems || [];
44
- this.checkedKeys = new Set(this.checkedItems.map(function (item) { return util_1.valueFrom(item, _this.valueField); }));
46
+ this.checkedKeys = new Set(this.checkedItems.map(function (item) { return _this.getKey(item); }));
47
+ };
48
+ /**
49
+ * Adds the item's depth to the item's value to allow duplicate values on different levels.
50
+ *
51
+ * @param item - The checked key.
52
+ * @returns { string } - A string key consisting of the item's `valueField` value and its depth.
53
+ */
54
+ BaseCheckDirective.prototype.getKey = function (item) {
55
+ if (util_1.isArray(this.valueField)) {
56
+ return util_1.valueFrom(item, this.valueField) + '_' + item.level;
57
+ }
58
+ return util_1.valueFrom(item, this.valueField);
45
59
  };
46
60
  tslib_1.__decorate([
47
61
  core_1.Input(),
@@ -122,7 +122,8 @@ var MultiSelectComponent = /** @class */ (function () {
122
122
  */
123
123
  this.clearButton = true;
124
124
  /**
125
- * A user-defined callback function which receives an array of selected data items and maps them to an array of tags.
125
+ * A user-defined callback function which receives an array of selected data items and maps them to an array of tags
126
+ * ([see examples]({% slug summarytagmode_multiselect %}#toc-rendering-of-tags)).
126
127
  *
127
128
  * @param { Any[] } dataItems - The selected data items from the list.
128
129
  * @returns { Any[] } - The tags that will be rendered by the component.
@@ -11,7 +11,7 @@ exports.packageMetadata = {
11
11
  name: '@progress/kendo-angular-dropdowns',
12
12
  productName: 'Kendo UI for Angular',
13
13
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
14
- publishDate: 1642685068,
14
+ publishDate: 1645097139,
15
15
  version: '',
16
16
  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'
17
17
  };