@progress/kendo-angular-treeview 5.4.2 → 6.0.0-dev.202201111033

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.
Files changed (56) hide show
  1. package/dist/cdn/js/kendo-angular-treeview.js +18 -18
  2. package/dist/cdn/main.js +1 -1
  3. package/dist/es/check.directive.js +30 -39
  4. package/dist/es/checkbox/checkbox.component.js +17 -1
  5. package/dist/es/drag-and-drop/drag-and-drop-utils.js +3 -3
  6. package/dist/es/drag-and-drop/drag-and-drop.directive.js +2 -2
  7. package/dist/es/expand.directive.js +40 -41
  8. package/dist/es/package-metadata.js +1 -1
  9. package/dist/es/selection/select.directive.js +22 -28
  10. package/dist/es/size.js +4 -0
  11. package/dist/es/treeview-group.component.js +7 -2
  12. package/dist/es/treeview-item-content.directive.js +2 -2
  13. package/dist/es/treeview-item.directive.js +1 -1
  14. package/dist/es/treeview.component.js +58 -13
  15. package/dist/es/utils.js +21 -11
  16. package/dist/es2015/check.directive.d.ts +8 -1
  17. package/dist/es2015/check.directive.js +30 -35
  18. package/dist/es2015/checkbox/checkbox.component.d.ts +6 -0
  19. package/dist/es2015/checkbox/checkbox.component.js +13 -1
  20. package/dist/es2015/drag-and-drop/drag-and-drop-utils.js +3 -3
  21. package/dist/es2015/drag-and-drop/drag-and-drop.directive.js +2 -2
  22. package/dist/es2015/expand.directive.d.ts +12 -3
  23. package/dist/es2015/expand.directive.js +39 -36
  24. package/dist/es2015/index.metadata.json +1 -1
  25. package/dist/es2015/main.d.ts +1 -0
  26. package/dist/es2015/package-metadata.js +1 -1
  27. package/dist/es2015/selection/select.directive.d.ts +11 -3
  28. package/dist/es2015/selection/select.directive.js +22 -24
  29. package/dist/es2015/size.d.ts +14 -0
  30. package/dist/es2015/size.js +4 -0
  31. package/dist/es2015/treeview-filter-settings.d.ts +2 -0
  32. package/dist/es2015/treeview-group.component.d.ts +2 -0
  33. package/dist/es2015/treeview-group.component.js +49 -35
  34. package/dist/es2015/treeview-item-content.directive.js +2 -2
  35. package/dist/es2015/treeview-item.directive.js +1 -1
  36. package/dist/es2015/treeview.component.d.ts +33 -5
  37. package/dist/es2015/treeview.component.js +70 -24
  38. package/dist/es2015/utils.d.ts +9 -4
  39. package/dist/es2015/utils.js +21 -11
  40. package/dist/fesm2015/index.js +248 -174
  41. package/dist/fesm5/index.js +199 -143
  42. package/dist/npm/check.directive.js +30 -39
  43. package/dist/npm/checkbox/checkbox.component.js +17 -1
  44. package/dist/npm/drag-and-drop/drag-and-drop-utils.js +3 -3
  45. package/dist/npm/drag-and-drop/drag-and-drop.directive.js +2 -2
  46. package/dist/npm/expand.directive.js +40 -41
  47. package/dist/npm/package-metadata.js +1 -1
  48. package/dist/npm/selection/select.directive.js +22 -28
  49. package/dist/npm/size.js +6 -0
  50. package/dist/npm/treeview-group.component.js +7 -2
  51. package/dist/npm/treeview-item-content.directive.js +2 -2
  52. package/dist/npm/treeview-item.directive.js +1 -1
  53. package/dist/npm/treeview.component.js +57 -12
  54. package/dist/npm/utils.js +21 -11
  55. package/dist/systemjs/kendo-angular-treeview.js +1 -1
  56. package/package.json +9 -8
@@ -8,6 +8,7 @@ import { TreeItem } from './treeitem.interface';
8
8
  import { TreeItemLookup } from './treeitem-lookup.interface';
9
9
  import { TreeItemFilterState } from './drag-and-drop/models/tree-item-filter-state';
10
10
  import { TreeViewFilterSettings } from './treeview-filter-settings';
11
+ import { TreeViewSize } from './size';
11
12
  /**
12
13
  * @hidden
13
14
  */
@@ -55,7 +56,7 @@ export declare const isContent: (element: any) => boolean;
55
56
  /**
56
57
  * @hidden
57
58
  *
58
- * Returns the nested .k-in:not(.k-treeview-load-more-button) element.
59
+ * Returns the nested .k-treeview-leaf:not(.k-treeview-load-more-button) element.
59
60
  * If the passed parent item is itself a content node, it is returned.
60
61
  */
61
62
  export declare const getContentElement: (parent: HTMLElement) => HTMLElement;
@@ -125,9 +126,13 @@ export declare const fetchLoadedDescendants: (lookup: TreeItemLookup, filterExpr
125
126
  /**
126
127
  * @hidden
127
128
  *
128
- * Compares two arrays to determine whether all unique elements in one, are present in the other.
129
+ * Compares two Seets to determine whether all unique elements in one, are present in the other.
129
130
  * Important:
130
131
  * - it disregards the element order
131
- * - it disregards element repetitions - sameValues([1, 1, 2], [1, 2, 2]) will return true
132
132
  */
133
- export declare const sameValues: (a: any[], b: any[]) => boolean;
133
+ export declare const sameValues: (as: Set<any>, bs: Set<any>) => boolean;
134
+ /**
135
+ * @hidden
136
+ * Returns the size class based on the component and size input.
137
+ */
138
+ export declare const getSizeClass: (component: string, size: TreeViewSize) => string;
@@ -90,7 +90,7 @@ export const isFocusable = (element) => {
90
90
  * @hidden
91
91
  */
92
92
  export const isContent = (element) => {
93
- const scopeSelector = '.k-in:not(.k-treeview-load-more-button),.k-treeview-item,.k-treeview';
93
+ const scopeSelector = '.k-treeview-leaf:not(.k-treeview-load-more-button),.k-treeview-item,.k-treeview';
94
94
  if (!isDocumentAvailable()) {
95
95
  return null;
96
96
  }
@@ -99,20 +99,20 @@ export const isContent = (element) => {
99
99
  node = node.parentNode;
100
100
  }
101
101
  if (node) {
102
- return match(node, '.k-in:not(.k-treeview-load-more-button)');
102
+ return match(node, '.k-treeview-leaf:not(.k-treeview-load-more-button)');
103
103
  }
104
104
  };
105
105
  /**
106
106
  * @hidden
107
107
  *
108
- * Returns the nested .k-in:not(.k-treeview-load-more-button) element.
108
+ * Returns the nested .k-treeview-leaf:not(.k-treeview-load-more-button) element.
109
109
  * If the passed parent item is itself a content node, it is returned.
110
110
  */
111
111
  export const getContentElement = (parent) => {
112
112
  if (!isPresent(parent)) {
113
113
  return null;
114
114
  }
115
- const selector = '.k-in:not(.k-treeview-load-more-button)';
115
+ const selector = '.k-treeview-leaf:not(.k-treeview-load-more-button)';
116
116
  if (match(parent, selector)) {
117
117
  return parent;
118
118
  }
@@ -122,7 +122,7 @@ export const getContentElement = (parent) => {
122
122
  * @hidden
123
123
  */
124
124
  export const isLoadMoreButton = (element) => {
125
- return isPresent(closestWithMatch(element, '.k-in.k-treeview-load-more-button'));
125
+ return isPresent(closestWithMatch(element, '.k-treeview-leaf.k-treeview-load-more-button'));
126
126
  };
127
127
  /**
128
128
  * @hidden
@@ -282,16 +282,26 @@ export const fetchLoadedDescendants = (lookup, filterExpression) => {
282
282
  /**
283
283
  * @hidden
284
284
  *
285
- * Compares two arrays to determine whether all unique elements in one, are present in the other.
285
+ * Compares two Seets to determine whether all unique elements in one, are present in the other.
286
286
  * Important:
287
287
  * - it disregards the element order
288
- * - it disregards element repetitions - sameValues([1, 1, 2], [1, 2, 2]) will return true
289
288
  */
290
- export const sameValues = (a, b) => {
291
- if (a.length !== b.length) {
289
+ export const sameValues = (as, bs) => {
290
+ if (as.size !== bs.size) {
292
291
  return false;
293
292
  }
294
- const values = new Set(b);
295
- return a.every(v => values.has(v));
293
+ return Array.from(as).every(v => bs.has(v));
294
+ };
295
+ /**
296
+ * @hidden
297
+ * Returns the size class based on the component and size input.
298
+ */
299
+ export const getSizeClass = (component, size) => {
300
+ const SIZE_CLASSES = {
301
+ 'small': `k-${component}-sm`,
302
+ 'medium': `k-${component}-md`,
303
+ 'large': `k-${component}-lg`
304
+ };
305
+ return SIZE_CLASSES[size];
296
306
  };
297
307
  export { ɵ0, ɵ1, ɵ2, ɵ3, ɵ4, ɵ5, ɵ6, ɵ7, ɵ8, ɵ9 };