@dugararchit/cdk 0.0.0-dugararchit

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 (206) hide show
  1. package/_index.scss +8 -0
  2. package/a11y/_index.import.scss +2 -0
  3. package/a11y/_index.scss +102 -0
  4. package/a11y/a11y-prebuilt.scss +3 -0
  5. package/fesm2022/stagefright5-cdk-a11y.mjs +2381 -0
  6. package/fesm2022/stagefright5-cdk-a11y.mjs.map +1 -0
  7. package/fesm2022/stagefright5-cdk-accordion.mjs +267 -0
  8. package/fesm2022/stagefright5-cdk-accordion.mjs.map +1 -0
  9. package/fesm2022/stagefright5-cdk-bidi.mjs +185 -0
  10. package/fesm2022/stagefright5-cdk-bidi.mjs.map +1 -0
  11. package/fesm2022/stagefright5-cdk-clipboard.mjs +250 -0
  12. package/fesm2022/stagefright5-cdk-clipboard.mjs.map +1 -0
  13. package/fesm2022/stagefright5-cdk-coercion.mjs +128 -0
  14. package/fesm2022/stagefright5-cdk-coercion.mjs.map +1 -0
  15. package/fesm2022/stagefright5-cdk-collections.mjs +472 -0
  16. package/fesm2022/stagefright5-cdk-collections.mjs.map +1 -0
  17. package/fesm2022/stagefright5-cdk-drag-drop.mjs +3690 -0
  18. package/fesm2022/stagefright5-cdk-drag-drop.mjs.map +1 -0
  19. package/fesm2022/stagefright5-cdk-keycodes.mjs +159 -0
  20. package/fesm2022/stagefright5-cdk-keycodes.mjs.map +1 -0
  21. package/fesm2022/stagefright5-cdk-layout.mjs +246 -0
  22. package/fesm2022/stagefright5-cdk-layout.mjs.map +1 -0
  23. package/fesm2022/stagefright5-cdk-observers.mjs +203 -0
  24. package/fesm2022/stagefright5-cdk-observers.mjs.map +1 -0
  25. package/fesm2022/stagefright5-cdk-overlay.mjs +3033 -0
  26. package/fesm2022/stagefright5-cdk-overlay.mjs.map +1 -0
  27. package/fesm2022/stagefright5-cdk-platform.mjs +375 -0
  28. package/fesm2022/stagefright5-cdk-platform.mjs.map +1 -0
  29. package/fesm2022/stagefright5-cdk-portal.mjs +672 -0
  30. package/fesm2022/stagefright5-cdk-portal.mjs.map +1 -0
  31. package/fesm2022/stagefright5-cdk-scrolling.mjs +1399 -0
  32. package/fesm2022/stagefright5-cdk-scrolling.mjs.map +1 -0
  33. package/fesm2022/stagefright5-cdk-stepper.mjs +624 -0
  34. package/fesm2022/stagefright5-cdk-stepper.mjs.map +1 -0
  35. package/fesm2022/stagefright5-cdk-table.mjs +2346 -0
  36. package/fesm2022/stagefright5-cdk-table.mjs.map +1 -0
  37. package/fesm2022/stagefright5-cdk-testing-protractor.mjs +324 -0
  38. package/fesm2022/stagefright5-cdk-testing-protractor.mjs.map +1 -0
  39. package/fesm2022/stagefright5-cdk-testing-selenium-webdriver.mjs +364 -0
  40. package/fesm2022/stagefright5-cdk-testing-selenium-webdriver.mjs.map +1 -0
  41. package/fesm2022/stagefright5-cdk-testing-testbed.mjs +806 -0
  42. package/fesm2022/stagefright5-cdk-testing-testbed.mjs.map +1 -0
  43. package/fesm2022/stagefright5-cdk-testing.mjs +740 -0
  44. package/fesm2022/stagefright5-cdk-testing.mjs.map +1 -0
  45. package/fesm2022/stagefright5-cdk-text-field.mjs +453 -0
  46. package/fesm2022/stagefright5-cdk-text-field.mjs.map +1 -0
  47. package/fesm2022/stagefright5-cdk-tree.mjs +945 -0
  48. package/fesm2022/stagefright5-cdk-tree.mjs.map +1 -0
  49. package/fesm2022/stagefright5-cdk.mjs +26 -0
  50. package/fesm2022/stagefright5-cdk.mjs.map +1 -0
  51. package/overlay/_index-deprecated.scss +13 -0
  52. package/overlay/_index.import.scss +13 -0
  53. package/overlay/_index.scss +148 -0
  54. package/overlay/overlay-prebuilt.scss +3 -0
  55. package/package.json +159 -0
  56. package/schematics/ng-update/test-cases/misc/global-stylesheets-test.scss +3 -0
  57. package/schematics/schematics/BUILD.bazel +104 -0
  58. package/schematics/schematics/README.md +4 -0
  59. package/schematics/schematics/collection.json +18 -0
  60. package/schematics/schematics/index.ts +22 -0
  61. package/schematics/schematics/migration.json +50 -0
  62. package/schematics/schematics/ng-add/index.spec.ts +50 -0
  63. package/schematics/schematics/ng-add/index.ts +39 -0
  64. package/schematics/schematics/ng-add/package-config.ts +62 -0
  65. package/schematics/schematics/ng-add/schema.json +16 -0
  66. package/schematics/schematics/ng-add/schema.ts +12 -0
  67. package/schematics/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template +53 -0
  68. package/schematics/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +17 -0
  69. package/schematics/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template +29 -0
  70. package/schematics/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +43 -0
  71. package/schematics/schematics/ng-generate/drag-drop/index.spec.ts +205 -0
  72. package/schematics/schematics/ng-generate/drag-drop/index.ts +35 -0
  73. package/schematics/schematics/ng-generate/drag-drop/schema.json +93 -0
  74. package/schematics/schematics/ng-generate/drag-drop/schema.ts +11 -0
  75. package/schematics/schematics/ng-update/data/attribute-selectors.ts +29 -0
  76. package/schematics/schematics/ng-update/data/class-names.ts +50 -0
  77. package/schematics/schematics/ng-update/data/constructor-checks.ts +75 -0
  78. package/schematics/schematics/ng-update/data/css-selectors.ts +33 -0
  79. package/schematics/schematics/ng-update/data/element-selectors.ts +21 -0
  80. package/schematics/schematics/ng-update/data/index.ts +18 -0
  81. package/schematics/schematics/ng-update/data/input-names.ts +118 -0
  82. package/schematics/schematics/ng-update/data/method-call-checks.ts +63 -0
  83. package/schematics/schematics/ng-update/data/output-names.ts +42 -0
  84. package/schematics/schematics/ng-update/data/property-names.ts +151 -0
  85. package/schematics/schematics/ng-update/data/symbol-removal.ts +22 -0
  86. package/schematics/schematics/ng-update/devkit-file-system.ts +87 -0
  87. package/schematics/schematics/ng-update/devkit-migration-rule.ts +185 -0
  88. package/schematics/schematics/ng-update/devkit-migration.ts +47 -0
  89. package/schematics/schematics/ng-update/find-stylesheets.ts +43 -0
  90. package/schematics/schematics/ng-update/html-parsing/angular.ts +49 -0
  91. package/schematics/schematics/ng-update/html-parsing/elements.ts +66 -0
  92. package/schematics/schematics/ng-update/index.ts +113 -0
  93. package/schematics/schematics/ng-update/migrations/attribute-selectors.ts +83 -0
  94. package/schematics/schematics/ng-update/migrations/class-inheritance.ts +63 -0
  95. package/schematics/schematics/ng-update/migrations/class-names.ts +107 -0
  96. package/schematics/schematics/ng-update/migrations/constructor-signature.ts +170 -0
  97. package/schematics/schematics/ng-update/migrations/css-selectors.ts +83 -0
  98. package/schematics/schematics/ng-update/migrations/element-selectors.ts +75 -0
  99. package/schematics/schematics/ng-update/migrations/input-names.ts +83 -0
  100. package/schematics/schematics/ng-update/migrations/method-call-arguments.ts +70 -0
  101. package/schematics/schematics/ng-update/migrations/misc-template.ts +36 -0
  102. package/schematics/schematics/ng-update/migrations/output-names.ts +61 -0
  103. package/schematics/schematics/ng-update/migrations/property-names.ts +61 -0
  104. package/schematics/schematics/ng-update/migrations/symbol-removal.ts +51 -0
  105. package/schematics/schematics/ng-update/migrations/tilde-import-v13/tilde-import-migration.ts +40 -0
  106. package/schematics/schematics/ng-update/public-api.ts +18 -0
  107. package/schematics/schematics/ng-update/test-cases/index.spec.ts +18 -0
  108. package/schematics/schematics/ng-update/test-cases/misc/external-resource-resolution.spec.ts +32 -0
  109. package/schematics/schematics/ng-update/test-cases/misc/external-resource-resolution_input.ts +22 -0
  110. package/schematics/schematics/ng-update/test-cases/misc/global-stylesheets-test.scss +3 -0
  111. package/schematics/schematics/ng-update/test-cases/misc/global-stylesheets.spec.ts +50 -0
  112. package/schematics/schematics/ng-update/test-cases/misc/global-stylesheets_input.ts +8 -0
  113. package/schematics/schematics/ng-update/test-cases/misc/method-call-checks.spec.ts +20 -0
  114. package/schematics/schematics/ng-update/test-cases/misc/method-call-checks_input.ts +18 -0
  115. package/schematics/schematics/ng-update/test-cases/misc/module-resolution.spec.ts +27 -0
  116. package/schematics/schematics/ng-update/test-cases/v13/misc/tilde-import-v13.spec.ts +149 -0
  117. package/schematics/schematics/ng-update/test-cases/v6/attribute-selectors_expected_output.ts +36 -0
  118. package/schematics/schematics/ng-update/test-cases/v6/attribute-selectors_input.ts +36 -0
  119. package/schematics/schematics/ng-update/test-cases/v6/class-names_expected_output.ts +8 -0
  120. package/schematics/schematics/ng-update/test-cases/v6/class-names_input.ts +8 -0
  121. package/schematics/schematics/ng-update/test-cases/v6/input-names_expected_output.ts +22 -0
  122. package/schematics/schematics/ng-update/test-cases/v6/input-names_input.ts +22 -0
  123. package/schematics/schematics/ng-update/test-cases/v6/property-names_expected_output.ts +64 -0
  124. package/schematics/schematics/ng-update/test-cases/v6/property-names_input.ts +64 -0
  125. package/schematics/schematics/ng-update/test-cases/v7/property-names_expected_output.ts +28 -0
  126. package/schematics/schematics/ng-update/test-cases/v7/property-names_input.ts +28 -0
  127. package/schematics/schematics/ng-update/typescript/base-types.ts +22 -0
  128. package/schematics/schematics/ng-update/typescript/imports.ts +54 -0
  129. package/schematics/schematics/ng-update/typescript/literal.ts +32 -0
  130. package/schematics/schematics/ng-update/typescript/module-specifiers.ts +39 -0
  131. package/schematics/schematics/ng-update/update-schematic.md +209 -0
  132. package/schematics/schematics/ng-update/upgrade-data.ts +79 -0
  133. package/schematics/schematics/paths.ts +15 -0
  134. package/schematics/schematics/testing/BUILD.bazel +27 -0
  135. package/schematics/schematics/testing/file-content.ts +20 -0
  136. package/schematics/schematics/testing/index.ts +14 -0
  137. package/schematics/schematics/testing/post-scheduled-tasks.ts +45 -0
  138. package/schematics/schematics/testing/resolve-bazel-path.ts +46 -0
  139. package/schematics/schematics/testing/test-app.ts +21 -0
  140. package/schematics/schematics/testing/test-case-setup.ts +236 -0
  141. package/schematics/schematics/testing/test-library.ts +21 -0
  142. package/schematics/schematics/testing/test-project.ts +40 -0
  143. package/schematics/schematics/testing/tsconfig.json +7 -0
  144. package/schematics/schematics/tsconfig.json +28 -0
  145. package/schematics/schematics/update-tool/BUILD.bazel +19 -0
  146. package/schematics/schematics/update-tool/component-resource-collector.ts +195 -0
  147. package/schematics/schematics/update-tool/file-system.ts +78 -0
  148. package/schematics/schematics/update-tool/index.ts +191 -0
  149. package/schematics/schematics/update-tool/logger.ts +23 -0
  150. package/schematics/schematics/update-tool/migration.ts +88 -0
  151. package/schematics/schematics/update-tool/public-api.ts +16 -0
  152. package/schematics/schematics/update-tool/target-version.ts +31 -0
  153. package/schematics/schematics/update-tool/tsconfig.json +7 -0
  154. package/schematics/schematics/update-tool/update-recorder.ts +14 -0
  155. package/schematics/schematics/update-tool/utils/decorators.ts +54 -0
  156. package/schematics/schematics/update-tool/utils/functions.ts +18 -0
  157. package/schematics/schematics/update-tool/utils/imports.ts +128 -0
  158. package/schematics/schematics/update-tool/utils/line-mappings.ts +84 -0
  159. package/schematics/schematics/update-tool/utils/parse-tsconfig.ts +25 -0
  160. package/schematics/schematics/update-tool/utils/property-name.ts +28 -0
  161. package/schematics/schematics/update-tool/utils/virtual-host.ts +116 -0
  162. package/schematics/schematics/update-tool/version-changes.ts +49 -0
  163. package/schematics/schematics/utils/ast/ng-module-imports.spec.ts +43 -0
  164. package/schematics/schematics/utils/ast/ng-module-imports.ts +102 -0
  165. package/schematics/schematics/utils/ast.ts +88 -0
  166. package/schematics/schematics/utils/build-component.ts +252 -0
  167. package/schematics/schematics/utils/get-project.ts +27 -0
  168. package/schematics/schematics/utils/html-manipulation.ts +105 -0
  169. package/schematics/schematics/utils/index.ts +19 -0
  170. package/schematics/schematics/utils/parse5-element.ts +34 -0
  171. package/schematics/schematics/utils/project-index-file.ts +21 -0
  172. package/schematics/schematics/utils/project-main-file.ts +26 -0
  173. package/schematics/schematics/utils/project-style-file.ts +53 -0
  174. package/schematics/schematics/utils/project-targets.ts +43 -0
  175. package/schematics/schematics/utils/project-tsconfig-paths.spec.ts +91 -0
  176. package/schematics/schematics/utils/project-tsconfig-paths.ts +49 -0
  177. package/schematics/schematics/utils/schematic-options.ts +65 -0
  178. package/schematics/schematics/utils/vendored-ast-utils/index.ts +599 -0
  179. package/scrolling/virtual-scroll-viewport.scss +87 -0
  180. package/table/table.scss +3 -0
  181. package/text-field/_index.import.scss +2 -0
  182. package/text-field/_index.scss +89 -0
  183. package/text-field/text-field-prebuilt.scss +4 -0
  184. package/types/stagefright5-cdk-a11y.d.ts +1160 -0
  185. package/types/stagefright5-cdk-accordion.d.ts +95 -0
  186. package/types/stagefright5-cdk-bidi.d.ts +95 -0
  187. package/types/stagefright5-cdk-clipboard.d.ts +116 -0
  188. package/types/stagefright5-cdk-coercion.d.ts +101 -0
  189. package/types/stagefright5-cdk-collections.d.ts +405 -0
  190. package/types/stagefright5-cdk-drag-drop.d.ts +1471 -0
  191. package/types/stagefright5-cdk-keycodes.d.ts +142 -0
  192. package/types/stagefright5-cdk-layout.d.ts +96 -0
  193. package/types/stagefright5-cdk-observers.d.ts +91 -0
  194. package/types/stagefright5-cdk-overlay.d.ts +1258 -0
  195. package/types/stagefright5-cdk-platform.d.ts +130 -0
  196. package/types/stagefright5-cdk-portal.d.ts +327 -0
  197. package/types/stagefright5-cdk-scrolling.d.ts +631 -0
  198. package/types/stagefright5-cdk-stepper.d.ts +302 -0
  199. package/types/stagefright5-cdk-table.d.ts +1128 -0
  200. package/types/stagefright5-cdk-testing-protractor.d.ts +146 -0
  201. package/types/stagefright5-cdk-testing-selenium-webdriver.d.ts +161 -0
  202. package/types/stagefright5-cdk-testing-testbed.d.ts +168 -0
  203. package/types/stagefright5-cdk-testing.d.ts +735 -0
  204. package/types/stagefright5-cdk-text-field.d.ts +171 -0
  205. package/types/stagefright5-cdk-tree.d.ts +522 -0
  206. package/types/stagefright5-cdk.d.ts +14 -0
@@ -0,0 +1,522 @@
1
+ import { SelectionModel, CollectionViewer, DataSource } from '@dugararchit/cdk/collections';
2
+ import { Observable, BehaviorSubject, Subject } from 'rxjs';
3
+ import * as i0 from '@angular/core';
4
+ import { InjectionToken, ViewContainerRef, TemplateRef, OnDestroy, OnInit, ElementRef, AfterContentChecked, TrackByFunction, QueryList, IterableDiffers, ChangeDetectorRef, IterableDiffer, AfterContentInit } from '@angular/core';
5
+ import { FocusableOption } from '@dugararchit/cdk/a11y';
6
+ import { Directionality } from '@dugararchit/cdk/bidi';
7
+ import { NumberInput, BooleanInput } from '@dugararchit/cdk/coercion';
8
+
9
+ /**
10
+ * @license
11
+ * Copyright Google LLC All Rights Reserved.
12
+ *
13
+ * Use of this source code is governed by an MIT-style license that can be
14
+ * found in the LICENSE file at https://angular.io/license
15
+ */
16
+
17
+ /**
18
+ * Tree control interface. User can implement TreeControl to expand/collapse dataNodes in the tree.
19
+ * The CDKTree will use this TreeControl to expand/collapse a node.
20
+ * User can also use it outside the `<cdk-tree>` to control the expansion status of the tree.
21
+ */
22
+ interface TreeControl<T, K = T> {
23
+ /** The saved tree nodes data for `expandAll` action. */
24
+ dataNodes: T[];
25
+ /** The expansion model */
26
+ expansionModel: SelectionModel<K>;
27
+ /** Whether the data node is expanded or collapsed. Return true if it's expanded. */
28
+ isExpanded(dataNode: T): boolean;
29
+ /** Get all descendants of a data node */
30
+ getDescendants(dataNode: T): any[];
31
+ /** Expand or collapse data node */
32
+ toggle(dataNode: T): void;
33
+ /** Expand one data node */
34
+ expand(dataNode: T): void;
35
+ /** Collapse one data node */
36
+ collapse(dataNode: T): void;
37
+ /** Expand all the dataNodes in the tree */
38
+ expandAll(): void;
39
+ /** Collapse all the dataNodes in the tree */
40
+ collapseAll(): void;
41
+ /** Toggle a data node by expand/collapse it and all its descendants */
42
+ toggleDescendants(dataNode: T): void;
43
+ /** Expand a data node and all its descendants */
44
+ expandDescendants(dataNode: T): void;
45
+ /** Collapse a data node and all its descendants */
46
+ collapseDescendants(dataNode: T): void;
47
+ /** Get depth of a given data node, return the level number. This is for flat tree node. */
48
+ readonly getLevel: (dataNode: T) => number;
49
+ /**
50
+ * Whether the data node is expandable. Returns true if expandable.
51
+ * This is for flat tree node.
52
+ */
53
+ readonly isExpandable: (dataNode: T) => boolean;
54
+ /** Gets a stream that emits whenever the given data node's children change. */
55
+ readonly getChildren: (dataNode: T) => Observable<T[]> | T[] | undefined | null;
56
+ }
57
+
58
+ /**
59
+ * @license
60
+ * Copyright Google LLC All Rights Reserved.
61
+ *
62
+ * Use of this source code is governed by an MIT-style license that can be
63
+ * found in the LICENSE file at https://angular.io/license
64
+ */
65
+
66
+ /** Base tree control. It has basic toggle/expand/collapse operations on a single data node. */
67
+ declare abstract class BaseTreeControl<T, K = T> implements TreeControl<T, K> {
68
+ /** Gets a list of descendent data nodes of a subtree rooted at given data node recursively. */
69
+ abstract getDescendants(dataNode: T): T[];
70
+ /** Expands all data nodes in the tree. */
71
+ abstract expandAll(): void;
72
+ /** Saved data node for `expandAll` action. */
73
+ dataNodes: T[];
74
+ /** A selection model with multi-selection to track expansion status. */
75
+ expansionModel: SelectionModel<K>;
76
+ /**
77
+ * Returns the identifier by which a dataNode should be tracked, should its
78
+ * reference change.
79
+ *
80
+ * Similar to trackBy for *ngFor
81
+ */
82
+ trackBy?: (dataNode: T) => K;
83
+ /** Get depth of a given data node, return the level number. This is for flat tree node. */
84
+ getLevel: (dataNode: T) => number;
85
+ /**
86
+ * Whether the data node is expandable. Returns true if expandable.
87
+ * This is for flat tree node.
88
+ */
89
+ isExpandable: (dataNode: T) => boolean;
90
+ /** Gets a stream that emits whenever the given data node's children change. */
91
+ getChildren: (dataNode: T) => Observable<T[]> | T[] | undefined | null;
92
+ /** Toggles one single data node's expanded/collapsed state. */
93
+ toggle(dataNode: T): void;
94
+ /** Expands one single data node. */
95
+ expand(dataNode: T): void;
96
+ /** Collapses one single data node. */
97
+ collapse(dataNode: T): void;
98
+ /** Whether a given data node is expanded or not. Returns true if the data node is expanded. */
99
+ isExpanded(dataNode: T): boolean;
100
+ /** Toggles a subtree rooted at `node` recursively. */
101
+ toggleDescendants(dataNode: T): void;
102
+ /** Collapse all dataNodes in the tree. */
103
+ collapseAll(): void;
104
+ /** Expands a subtree rooted at given data node recursively. */
105
+ expandDescendants(dataNode: T): void;
106
+ /** Collapses a subtree rooted at given data node recursively. */
107
+ collapseDescendants(dataNode: T): void;
108
+ protected _trackByValue(value: T | K): K;
109
+ }
110
+
111
+ /**
112
+ * @license
113
+ * Copyright Google LLC All Rights Reserved.
114
+ *
115
+ * Use of this source code is governed by an MIT-style license that can be
116
+ * found in the LICENSE file at https://angular.io/license
117
+ */
118
+
119
+ /** Optional set of configuration that can be provided to the FlatTreeControl. */
120
+ interface FlatTreeControlOptions<T, K> {
121
+ trackBy?: (dataNode: T) => K;
122
+ }
123
+ /** Flat tree control. Able to expand/collapse a subtree recursively for flattened tree. */
124
+ declare class FlatTreeControl<T, K = T> extends BaseTreeControl<T, K> {
125
+ getLevel: (dataNode: T) => number;
126
+ isExpandable: (dataNode: T) => boolean;
127
+ options?: FlatTreeControlOptions<T, K> | undefined;
128
+ /** Construct with flat tree data node functions getLevel and isExpandable. */
129
+ constructor(getLevel: (dataNode: T) => number, isExpandable: (dataNode: T) => boolean, options?: FlatTreeControlOptions<T, K> | undefined);
130
+ /**
131
+ * Gets a list of the data node's subtree of descendent data nodes.
132
+ *
133
+ * To make this working, the `dataNodes` of the TreeControl must be flattened tree nodes
134
+ * with correct levels.
135
+ */
136
+ getDescendants(dataNode: T): T[];
137
+ /**
138
+ * Expands all data nodes in the tree.
139
+ *
140
+ * To make this working, the `dataNodes` variable of the TreeControl must be set to all flattened
141
+ * data nodes of the tree.
142
+ */
143
+ expandAll(): void;
144
+ }
145
+
146
+ /**
147
+ * @license
148
+ * Copyright Google LLC All Rights Reserved.
149
+ *
150
+ * Use of this source code is governed by an MIT-style license that can be
151
+ * found in the LICENSE file at https://angular.io/license
152
+ */
153
+
154
+ /** Optional set of configuration that can be provided to the NestedTreeControl. */
155
+ interface NestedTreeControlOptions<T, K> {
156
+ trackBy?: (dataNode: T) => K;
157
+ }
158
+ /** Nested tree control. Able to expand/collapse a subtree recursively for NestedNode type. */
159
+ declare class NestedTreeControl<T, K = T> extends BaseTreeControl<T, K> {
160
+ getChildren: (dataNode: T) => Observable<T[]> | T[] | undefined | null;
161
+ options?: NestedTreeControlOptions<T, K> | undefined;
162
+ /** Construct with nested tree function getChildren. */
163
+ constructor(getChildren: (dataNode: T) => Observable<T[]> | T[] | undefined | null, options?: NestedTreeControlOptions<T, K> | undefined);
164
+ /**
165
+ * Expands all dataNodes in the tree.
166
+ *
167
+ * To make this working, the `dataNodes` variable of the TreeControl must be set to all root level
168
+ * data nodes of the tree.
169
+ */
170
+ expandAll(): void;
171
+ /** Gets a list of descendant dataNodes of a subtree rooted at given data node recursively. */
172
+ getDescendants(dataNode: T): T[];
173
+ /** A helper function to get descendants recursively. */
174
+ protected _getDescendants(descendants: T[], dataNode: T): void;
175
+ }
176
+
177
+ /**
178
+ * @license
179
+ * Copyright Google LLC All Rights Reserved.
180
+ *
181
+ * Use of this source code is governed by an MIT-style license that can be
182
+ * found in the LICENSE file at https://angular.io/license
183
+ */
184
+
185
+ /**
186
+ * Injection token used to provide a `CdkTreeNode` to its outlet.
187
+ * Used primarily to avoid circular imports.
188
+ * @docs-private
189
+ */
190
+ declare const CDK_TREE_NODE_OUTLET_NODE: InjectionToken<{}>;
191
+ /**
192
+ * Outlet for nested CdkNode. Put `[cdkTreeNodeOutlet]` on a tag to place children dataNodes
193
+ * inside the outlet.
194
+ */
195
+ declare class CdkTreeNodeOutlet {
196
+ viewContainer: ViewContainerRef;
197
+ _node?: any | undefined;
198
+ constructor(viewContainer: ViewContainerRef, _node?: any | undefined);
199
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkTreeNodeOutlet, [null, { optional: true; }]>;
200
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkTreeNodeOutlet, "[cdkTreeNodeOutlet]", never, {}, {}, never, never, false, never>;
201
+ }
202
+
203
+ /**
204
+ * @license
205
+ * Copyright Google LLC All Rights Reserved.
206
+ *
207
+ * Use of this source code is governed by an MIT-style license that can be
208
+ * found in the LICENSE file at https://angular.io/license
209
+ */
210
+
211
+ /** Context provided to the tree node component. */
212
+ declare class CdkTreeNodeOutletContext<T> {
213
+ /** Data for the node. */
214
+ $implicit: T;
215
+ /** Depth of the node. */
216
+ level: number;
217
+ /** Index location of the node. */
218
+ index?: number;
219
+ /** Length of the number of total dataNodes. */
220
+ count?: number;
221
+ constructor(data: T);
222
+ }
223
+ /**
224
+ * Data node definition for the CdkTree.
225
+ * Captures the node's template and a when predicate that describes when this node should be used.
226
+ */
227
+ declare class CdkTreeNodeDef<T> {
228
+ template: TemplateRef<any>;
229
+ /**
230
+ * Function that should return true if this node template should be used for the provided node
231
+ * data and index. If left undefined, this node will be considered the default node template to
232
+ * use when no other when functions return true for the data.
233
+ * For every node, there must be at least one when function that passes or an undefined to
234
+ * default.
235
+ */
236
+ when: (index: number, nodeData: T) => boolean;
237
+ /** @docs-private */
238
+ constructor(template: TemplateRef<any>);
239
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkTreeNodeDef<any>, never>;
240
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkTreeNodeDef<any>, "[cdkTreeNodeDef]", never, { "when": { "alias": "cdkTreeNodeDefWhen"; "required": false; }; }, {}, never, never, false, never>;
241
+ }
242
+
243
+ /**
244
+ * @license
245
+ * Copyright Google LLC All Rights Reserved.
246
+ *
247
+ * Use of this source code is governed by an MIT-style license that can be
248
+ * found in the LICENSE file at https://angular.io/license
249
+ */
250
+
251
+ /**
252
+ * CDK tree component that connects with a data source to retrieve data of type `T` and renders
253
+ * dataNodes with hierarchy. Updates the dataNodes when new data is provided by the data source.
254
+ */
255
+ declare class CdkTree<T, K = T> implements AfterContentChecked, CollectionViewer, OnDestroy, OnInit {
256
+ private _differs;
257
+ private _changeDetectorRef;
258
+ /** Subject that emits when the component has been destroyed. */
259
+ private readonly _onDestroy;
260
+ /** Differ used to find the changes in the data provided by the data source. */
261
+ private _dataDiffer;
262
+ /** Stores the node definition that does not have a when predicate. */
263
+ private _defaultNodeDef;
264
+ /** Data subscription */
265
+ private _dataSubscription;
266
+ /** Level of nodes */
267
+ private _levels;
268
+ /**
269
+ * Provides a stream containing the latest data array to render. Influenced by the tree's
270
+ * stream of view window (what dataNodes are currently on screen).
271
+ * Data source can be an observable of data array, or a data array to render.
272
+ */
273
+ get dataSource(): DataSource<T> | Observable<T[]> | T[];
274
+ set dataSource(dataSource: DataSource<T> | Observable<T[]> | T[]);
275
+ private _dataSource;
276
+ /** The tree controller */
277
+ treeControl: TreeControl<T, K>;
278
+ /**
279
+ * Tracking function that will be used to check the differences in data changes. Used similarly
280
+ * to `ngFor` `trackBy` function. Optimize node operations by identifying a node based on its data
281
+ * relative to the function to know if a node should be added/removed/moved.
282
+ * Accepts a function that takes two parameters, `index` and `item`.
283
+ */
284
+ trackBy: TrackByFunction<T>;
285
+ _nodeOutlet: CdkTreeNodeOutlet;
286
+ /** The tree node template for the tree */
287
+ _nodeDefs: QueryList<CdkTreeNodeDef<T>>;
288
+ /**
289
+ * Stream containing the latest information on what rows are being displayed on screen.
290
+ * Can be used by the data source to as a heuristic of what data should be provided.
291
+ */
292
+ readonly viewChange: BehaviorSubject<{
293
+ start: number;
294
+ end: number;
295
+ }>;
296
+ constructor(_differs: IterableDiffers, _changeDetectorRef: ChangeDetectorRef);
297
+ ngOnInit(): void;
298
+ ngOnDestroy(): void;
299
+ ngAfterContentChecked(): void;
300
+ /**
301
+ * Switch to the provided data source by resetting the data and unsubscribing from the current
302
+ * render change subscription if one exists. If the data source is null, interpret this by
303
+ * clearing the node outlet. Otherwise start listening for new data.
304
+ */
305
+ private _switchDataSource;
306
+ /** Set up a subscription for the data provided by the data source. */
307
+ private _observeRenderChanges;
308
+ /** Check for changes made in the data and render each change (node added/removed/moved). */
309
+ renderNodeChanges(data: readonly T[], dataDiffer?: IterableDiffer<T>, viewContainer?: ViewContainerRef, parentData?: T): void;
310
+ /**
311
+ * Finds the matching node definition that should be used for this node data. If there is only
312
+ * one node definition, it is returned. Otherwise, find the node definition that has a when
313
+ * predicate that returns true with the data. If none return true, return the default node
314
+ * definition.
315
+ */
316
+ _getNodeDef(data: T, i: number): CdkTreeNodeDef<T>;
317
+ /**
318
+ * Create the embedded view for the data node template and place it in the correct index location
319
+ * within the data node view container.
320
+ */
321
+ insertNode(nodeData: T, index: number, viewContainer?: ViewContainerRef, parentData?: T): void;
322
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkTree<any, any>, never>;
323
+ static ɵcmp: i0.ɵɵComponentDeclaration<CdkTree<any, any>, "cdk-tree", ["cdkTree"], { "dataSource": { "alias": "dataSource"; "required": false; }; "treeControl": { "alias": "treeControl"; "required": false; }; "trackBy": { "alias": "trackBy"; "required": false; }; }, {}, ["_nodeDefs"], never, false, never>;
324
+ }
325
+ /**
326
+ * Tree node for CdkTree. It contains the data in the tree node.
327
+ */
328
+ declare class CdkTreeNode<T, K = T> implements FocusableOption, OnDestroy, OnInit {
329
+ protected _elementRef: ElementRef<HTMLElement>;
330
+ protected _tree: CdkTree<T, K>;
331
+ /**
332
+ * The role of the tree node.
333
+ * @deprecated The correct role is 'treeitem', 'group' should not be used. This input will be
334
+ * removed in a future version.
335
+ * @breaking-change 12.0.0 Remove this input
336
+ */
337
+ get role(): 'treeitem' | 'group';
338
+ set role(_role: 'treeitem' | 'group');
339
+ /**
340
+ * The most recently created `CdkTreeNode`. We save it in static variable so we can retrieve it
341
+ * in `CdkTree` and set the data to it.
342
+ */
343
+ static mostRecentTreeNode: CdkTreeNode<any> | null;
344
+ /** Subject that emits when the component has been destroyed. */
345
+ protected readonly _destroyed: Subject<void>;
346
+ /** Emits when the node's data has changed. */
347
+ readonly _dataChanges: Subject<void>;
348
+ private _parentNodeAriaLevel;
349
+ /** The tree node's data. */
350
+ get data(): T;
351
+ set data(value: T);
352
+ protected _data: T;
353
+ get isExpanded(): boolean;
354
+ get level(): number;
355
+ constructor(_elementRef: ElementRef<HTMLElement>, _tree: CdkTree<T, K>);
356
+ ngOnInit(): void;
357
+ ngOnDestroy(): void;
358
+ /** Focuses the menu item. Implements for FocusableOption. */
359
+ focus(): void;
360
+ protected _setRoleFromData(): void;
361
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkTreeNode<any, any>, never>;
362
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkTreeNode<any, any>, "cdk-tree-node", ["cdkTreeNode"], { "role": { "alias": "role"; "required": false; }; }, {}, never, never, false, never>;
363
+ }
364
+
365
+ /**
366
+ * @license
367
+ * Copyright Google LLC All Rights Reserved.
368
+ *
369
+ * Use of this source code is governed by an MIT-style license that can be
370
+ * found in the LICENSE file at https://angular.io/license
371
+ */
372
+
373
+ /**
374
+ * Nested node is a child of `<cdk-tree>`. It works with nested tree.
375
+ * By using `cdk-nested-tree-node` component in tree node template, children of the parent node will
376
+ * be added in the `cdkTreeNodeOutlet` in tree node template.
377
+ * The children of node will be automatically added to `cdkTreeNodeOutlet`.
378
+ */
379
+ declare class CdkNestedTreeNode<T, K = T> extends CdkTreeNode<T, K> implements AfterContentInit, OnDestroy, OnInit {
380
+ protected _differs: IterableDiffers;
381
+ /** Differ used to find the changes in the data provided by the data source. */
382
+ private _dataDiffer;
383
+ /** The children data dataNodes of current node. They will be placed in `CdkTreeNodeOutlet`. */
384
+ protected _children: T[];
385
+ /** The children node placeholder. */
386
+ nodeOutlet: QueryList<CdkTreeNodeOutlet>;
387
+ constructor(elementRef: ElementRef<HTMLElement>, tree: CdkTree<T, K>, _differs: IterableDiffers);
388
+ ngAfterContentInit(): void;
389
+ ngOnInit(): void;
390
+ ngOnDestroy(): void;
391
+ /** Add children dataNodes to the NodeOutlet */
392
+ protected updateChildrenNodes(children?: T[]): void;
393
+ /** Clear the children dataNodes. */
394
+ protected _clear(): void;
395
+ /** Gets the outlet for the current node. */
396
+ private _getNodeOutlet;
397
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkNestedTreeNode<any, any>, never>;
398
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkNestedTreeNode<any, any>, "cdk-nested-tree-node", ["cdkNestedTreeNode"], { "role": { "alias": "role"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; }, {}, ["nodeOutlet"], never, false, never>;
399
+ }
400
+
401
+ /**
402
+ * @license
403
+ * Copyright Google LLC All Rights Reserved.
404
+ *
405
+ * Use of this source code is governed by an MIT-style license that can be
406
+ * found in the LICENSE file at https://angular.io/license
407
+ */
408
+
409
+ /**
410
+ * Indent for the children tree dataNodes.
411
+ * This directive will add left-padding to the node to show hierarchy.
412
+ */
413
+ declare class CdkTreeNodePadding<T, K = T> implements OnDestroy {
414
+ private _treeNode;
415
+ private _tree;
416
+ private _element;
417
+ private _dir;
418
+ /** Current padding value applied to the element. Used to avoid unnecessarily hitting the DOM. */
419
+ private _currentPadding;
420
+ /** Subject that emits when the component has been destroyed. */
421
+ private readonly _destroyed;
422
+ /** CSS units used for the indentation value. */
423
+ indentUnits: string;
424
+ /** The level of depth of the tree node. The padding will be `level * indent` pixels. */
425
+ get level(): number;
426
+ set level(value: NumberInput);
427
+ _level: number;
428
+ /**
429
+ * The indent for each level. Can be a number or a CSS string.
430
+ * Default number 40px from material design menu sub-menu spec.
431
+ */
432
+ get indent(): number | string;
433
+ set indent(indent: number | string);
434
+ _indent: number;
435
+ constructor(_treeNode: CdkTreeNode<T, K>, _tree: CdkTree<T, K>, _element: ElementRef<HTMLElement>, _dir: Directionality);
436
+ ngOnDestroy(): void;
437
+ /** The padding indent value for the tree node. Returns a string with px numbers if not null. */
438
+ _paddingIndent(): string | null;
439
+ _setPadding(forceChange?: boolean): void;
440
+ /**
441
+ * This has been extracted to a util because of TS 4 and VE.
442
+ * View Engine doesn't support property rename inheritance.
443
+ * TS 4.0 doesn't allow properties to override accessors or vice-versa.
444
+ * @docs-private
445
+ */
446
+ protected _setLevelInput(value: NumberInput): void;
447
+ /**
448
+ * This has been extracted to a util because of TS 4 and VE.
449
+ * View Engine doesn't support property rename inheritance.
450
+ * TS 4.0 doesn't allow properties to override accessors or vice-versa.
451
+ * @docs-private
452
+ */
453
+ protected _setIndentInput(indent: number | string): void;
454
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkTreeNodePadding<any, any>, [null, null, null, { optional: true; }]>;
455
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkTreeNodePadding<any, any>, "[cdkTreeNodePadding]", never, { "level": { "alias": "cdkTreeNodePadding"; "required": false; }; "indent": { "alias": "cdkTreeNodePaddingIndent"; "required": false; }; }, {}, never, never, false, never>;
456
+ }
457
+
458
+ /**
459
+ * @license
460
+ * Copyright Google LLC All Rights Reserved.
461
+ *
462
+ * Use of this source code is governed by an MIT-style license that can be
463
+ * found in the LICENSE file at https://angular.io/license
464
+ */
465
+ /**
466
+ * Returns an error to be thrown when there is no usable data.
467
+ * @docs-private
468
+ */
469
+ declare function getTreeNoValidDataSourceError(): Error;
470
+ /**
471
+ * Returns an error to be thrown when there are multiple nodes that are missing a when function.
472
+ * @docs-private
473
+ */
474
+ declare function getTreeMultipleDefaultNodeDefsError(): Error;
475
+ /**
476
+ * Returns an error to be thrown when there are no matching node defs for a particular set of data.
477
+ * @docs-private
478
+ */
479
+ declare function getTreeMissingMatchingNodeDefError(): Error;
480
+ /**
481
+ * Returns an error to be thrown when there are tree control.
482
+ * @docs-private
483
+ */
484
+ declare function getTreeControlMissingError(): Error;
485
+ /**
486
+ * Returns an error to be thrown when tree control did not implement functions for flat/nested node.
487
+ * @docs-private
488
+ */
489
+ declare function getTreeControlFunctionsMissingError(): Error;
490
+
491
+ /**
492
+ * @license
493
+ * Copyright Google LLC All Rights Reserved.
494
+ *
495
+ * Use of this source code is governed by an MIT-style license that can be
496
+ * found in the LICENSE file at https://angular.io/license
497
+ */
498
+
499
+ /**
500
+ * Node toggle to expand/collapse the node.
501
+ */
502
+ declare class CdkTreeNodeToggle<T, K = T> {
503
+ protected _tree: CdkTree<T, K>;
504
+ protected _treeNode: CdkTreeNode<T, K>;
505
+ /** Whether expand/collapse the node recursively. */
506
+ get recursive(): boolean;
507
+ set recursive(value: BooleanInput);
508
+ protected _recursive: boolean;
509
+ constructor(_tree: CdkTree<T, K>, _treeNode: CdkTreeNode<T, K>);
510
+ _toggle(event: Event): void;
511
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkTreeNodeToggle<any, any>, never>;
512
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkTreeNodeToggle<any, any>, "[cdkTreeNodeToggle]", never, { "recursive": { "alias": "cdkTreeNodeToggleRecursive"; "required": false; }; }, {}, never, never, false, never>;
513
+ }
514
+
515
+ declare class CdkTreeModule {
516
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkTreeModule, never>;
517
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CdkTreeModule, [typeof CdkNestedTreeNode, typeof CdkTreeNodeDef, typeof CdkTreeNodePadding, typeof CdkTreeNodeToggle, typeof CdkTree, typeof CdkTreeNode, typeof CdkTreeNodeOutlet], never, [typeof CdkNestedTreeNode, typeof CdkTreeNodeDef, typeof CdkTreeNodePadding, typeof CdkTreeNodeToggle, typeof CdkTree, typeof CdkTreeNode, typeof CdkTreeNodeOutlet]>;
518
+ static ɵinj: i0.ɵɵInjectorDeclaration<CdkTreeModule>;
519
+ }
520
+
521
+ export { BaseTreeControl, CDK_TREE_NODE_OUTLET_NODE, CdkNestedTreeNode, CdkTree, CdkTreeModule, CdkTreeNode, CdkTreeNodeDef, CdkTreeNodeOutlet, CdkTreeNodeOutletContext, CdkTreeNodePadding, CdkTreeNodeToggle, FlatTreeControl, NestedTreeControl, getTreeControlFunctionsMissingError, getTreeControlMissingError, getTreeMissingMatchingNodeDefError, getTreeMultipleDefaultNodeDefsError, getTreeNoValidDataSourceError };
522
+ export type { FlatTreeControlOptions, NestedTreeControlOptions, TreeControl };
@@ -0,0 +1,14 @@
1
+ import { Version } from '@angular/core';
2
+
3
+ /**
4
+ * @license
5
+ * Copyright Google LLC All Rights Reserved.
6
+ *
7
+ * Use of this source code is governed by an MIT-style license that can be
8
+ * found in the LICENSE file at https://angular.io/license
9
+ */
10
+
11
+ /** Current version of the Angular Component Development Kit. */
12
+ declare const VERSION: Version;
13
+
14
+ export { VERSION };