@limble/limble-tree 0.12.4 → 1.0.0-alpha.1

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 (165) hide show
  1. package/README.md +42 -149
  2. package/esm2020/lib/components/branch/branch.component.mjs +87 -0
  3. package/esm2020/lib/components/dropzone/dropzone.component.mjs +35 -0
  4. package/esm2020/lib/components/host-component.interface.mjs +2 -0
  5. package/esm2020/lib/components/node-component.interface.mjs +2 -0
  6. package/esm2020/lib/components/root/root.component.mjs +37 -0
  7. package/esm2020/lib/core/branch-options.interface.mjs +2 -0
  8. package/esm2020/lib/core/configuration/configuration.mjs +17 -0
  9. package/esm2020/lib/core/configuration/tree-options.interface.mjs +2 -0
  10. package/esm2020/lib/core/index.mjs +6 -0
  11. package/esm2020/lib/core/relationship.interface.mjs +2 -0
  12. package/esm2020/lib/core/tree-branch/tree-branch.mjs +246 -0
  13. package/esm2020/lib/core/tree-node-base.mjs +68 -0
  14. package/esm2020/lib/core/tree-root/tree-root.mjs +69 -0
  15. package/esm2020/lib/core/tree-service/tree.service.mjs +19 -0
  16. package/esm2020/lib/errors/index.mjs +2 -0
  17. package/esm2020/lib/errors/tree-error.mjs +3 -0
  18. package/esm2020/lib/events/drag/drag-end-event.mjs +28 -0
  19. package/esm2020/lib/events/drag/drag-start-event.mjs +12 -0
  20. package/esm2020/lib/events/drag/drop-event.mjs +20 -0
  21. package/esm2020/lib/events/drag/index.mjs +4 -0
  22. package/esm2020/lib/events/index.mjs +3 -0
  23. package/esm2020/lib/events/relational/graft-event.mjs +24 -0
  24. package/esm2020/lib/events/relational/index.mjs +4 -0
  25. package/esm2020/lib/events/relational/prune-event.mjs +24 -0
  26. package/esm2020/lib/events/relational/relational-tree-event.interface.mjs +2 -0
  27. package/esm2020/lib/extras/collapse/collapse.mjs +33 -0
  28. package/esm2020/lib/extras/collapse/collapse.module.mjs +15 -0
  29. package/esm2020/lib/extras/collapse/collapse.service.mjs +20 -0
  30. package/esm2020/lib/extras/collapse/index.mjs +3 -0
  31. package/esm2020/lib/extras/drag-and-drop/drag-and-drop.mjs +89 -0
  32. package/esm2020/lib/extras/drag-and-drop/drag-and-drop.module.mjs +19 -0
  33. package/esm2020/lib/extras/drag-and-drop/drag-and-drop.service.mjs +28 -0
  34. package/esm2020/lib/extras/drag-and-drop/drag-state.mjs +47 -0
  35. package/esm2020/lib/extras/drag-and-drop/draggable.directive.mjs +30 -0
  36. package/esm2020/lib/extras/drag-and-drop/dragover-no-change-detect.mjs +40 -0
  37. package/esm2020/lib/extras/drag-and-drop/dropzone-renderer.mjs +176 -0
  38. package/esm2020/lib/extras/drag-and-drop/index.mjs +5 -0
  39. package/esm2020/lib/legacy/index.mjs +7 -0
  40. package/esm2020/lib/legacy/legacy-component-obj.interface.mjs +2 -0
  41. package/esm2020/lib/legacy/legacy-tree-data.interface.mjs +2 -0
  42. package/esm2020/lib/legacy/legacy-tree-options.interface.mjs +2 -0
  43. package/esm2020/lib/legacy/legacy-tree.mjs +74 -0
  44. package/esm2020/lib/legacy/limble-tree-legacy.module.mjs +20 -0
  45. package/esm2020/lib/legacy/limble-tree-root/limble-tree-root.component.mjs +78 -0
  46. package/esm2020/lib/limble-tree.module.mjs +21 -0
  47. package/esm2020/lib/structure/branchable.interface.mjs +2 -0
  48. package/esm2020/lib/structure/container-tree-node.interface.mjs +2 -0
  49. package/esm2020/lib/structure/content-container.interface.mjs +2 -0
  50. package/esm2020/lib/structure/event-conduit.interface.mjs +2 -0
  51. package/esm2020/lib/structure/graftable.interface.mjs +2 -0
  52. package/esm2020/lib/structure/index.mjs +12 -0
  53. package/esm2020/lib/structure/tree-branch-node.interface.mjs +2 -0
  54. package/esm2020/lib/structure/tree-event.interface.mjs +2 -0
  55. package/esm2020/lib/structure/tree-node.interface.mjs +2 -0
  56. package/esm2020/lib/structure/tree-plot.mjs +2 -0
  57. package/esm2020/lib/structure/tree-relationship.interface.mjs +2 -0
  58. package/esm2020/lib/structure/tree-root.node.interface.mjs +2 -0
  59. package/{esm2015/limble-limble-tree.js → esm2020/limble-limble-tree.mjs} +4 -4
  60. package/esm2020/public-api.mjs +12 -0
  61. package/esm2020/shared/assert.mjs +7 -0
  62. package/fesm2015/limble-limble-tree.mjs +1310 -0
  63. package/fesm2015/limble-limble-tree.mjs.map +1 -0
  64. package/fesm2020/limble-limble-tree.mjs +1300 -0
  65. package/fesm2020/limble-limble-tree.mjs.map +1 -0
  66. package/{limble-limble-tree.d.ts → index.d.ts} +5 -5
  67. package/lib/components/branch/branch.component.d.ts +26 -0
  68. package/lib/components/dropzone/dropzone.component.d.ts +13 -0
  69. package/lib/components/host-component.interface.d.ts +6 -0
  70. package/lib/components/node-component.interface.d.ts +5 -0
  71. package/lib/components/root/root.component.d.ts +14 -0
  72. package/lib/core/branch-options.interface.d.ts +14 -0
  73. package/lib/core/configuration/configuration.d.ts +11 -0
  74. package/lib/core/configuration/tree-options.interface.d.ts +35 -0
  75. package/lib/core/index.d.ts +5 -0
  76. package/lib/core/relationship.interface.d.ts +6 -0
  77. package/lib/core/tree-branch/tree-branch.d.ts +44 -0
  78. package/lib/core/tree-node-base.d.ts +26 -0
  79. package/lib/core/tree-root/tree-root.d.ts +28 -0
  80. package/lib/core/tree-service/tree.service.d.ts +9 -0
  81. package/lib/errors/index.d.ts +1 -0
  82. package/lib/errors/tree-error.d.ts +2 -0
  83. package/lib/events/drag/drag-end-event.d.ts +25 -0
  84. package/lib/events/drag/drag-start-event.d.ts +8 -0
  85. package/lib/events/drag/drop-event.d.ts +16 -0
  86. package/lib/events/drag/index.d.ts +3 -0
  87. package/lib/events/index.d.ts +2 -0
  88. package/lib/events/relational/graft-event.d.ts +15 -0
  89. package/lib/events/relational/index.d.ts +3 -0
  90. package/lib/events/relational/prune-event.d.ts +15 -0
  91. package/lib/events/relational/relational-tree-event.interface.d.ts +6 -0
  92. package/lib/extras/collapse/collapse.d.ts +11 -0
  93. package/lib/extras/collapse/collapse.module.d.ts +6 -0
  94. package/lib/extras/collapse/collapse.service.d.ts +9 -0
  95. package/lib/extras/collapse/index.d.ts +2 -0
  96. package/lib/extras/drag-and-drop/drag-and-drop.d.ts +17 -0
  97. package/lib/extras/drag-and-drop/drag-and-drop.module.d.ts +8 -0
  98. package/lib/extras/drag-and-drop/drag-and-drop.service.d.ts +16 -0
  99. package/lib/extras/drag-and-drop/drag-state.d.ts +23 -0
  100. package/lib/extras/drag-and-drop/draggable.directive.d.ts +12 -0
  101. package/lib/{custom-event-bindings/dragover-no-change-detect.directive.d.ts → extras/drag-and-drop/dragover-no-change-detect.d.ts} +14 -14
  102. package/lib/extras/drag-and-drop/dropzone-renderer.d.ts +28 -0
  103. package/lib/extras/drag-and-drop/index.d.ts +4 -0
  104. package/lib/legacy/index.d.ts +6 -0
  105. package/lib/legacy/legacy-component-obj.interface.d.ts +13 -0
  106. package/lib/legacy/legacy-tree-data.interface.d.ts +18 -0
  107. package/lib/legacy/legacy-tree-options.interface.d.ts +34 -0
  108. package/lib/legacy/legacy-tree.d.ts +14 -0
  109. package/lib/legacy/limble-tree-legacy.module.d.ts +8 -0
  110. package/lib/legacy/limble-tree-root/limble-tree-root.component.d.ts +28 -0
  111. package/lib/limble-tree.module.d.ts +9 -14
  112. package/lib/structure/branchable.interface.d.ts +5 -0
  113. package/lib/structure/container-tree-node.interface.d.ts +3 -0
  114. package/lib/structure/content-container.interface.d.ts +3 -0
  115. package/lib/structure/event-conduit.interface.d.ts +6 -0
  116. package/lib/structure/graftable.interface.d.ts +6 -0
  117. package/lib/structure/index.d.ts +11 -0
  118. package/lib/structure/tree-branch-node.interface.d.ts +5 -0
  119. package/lib/structure/tree-event.interface.d.ts +5 -0
  120. package/lib/structure/tree-node.interface.d.ts +9 -0
  121. package/lib/structure/tree-plot.d.ts +1 -0
  122. package/lib/structure/tree-relationship.interface.d.ts +7 -0
  123. package/lib/structure/tree-root.node.interface.d.ts +2 -0
  124. package/package.json +24 -19
  125. package/public-api.d.ts +8 -3
  126. package/shared/assert.d.ts +1 -0
  127. package/bundles/limble-limble-tree.umd.js +0 -2910
  128. package/bundles/limble-limble-tree.umd.js.map +0 -1
  129. package/esm2015/lib/classes/Branch.js +0 -153
  130. package/esm2015/lib/classes/DropZone.js +0 -71
  131. package/esm2015/lib/classes/DropZoneLocation.js +0 -16
  132. package/esm2015/lib/custom-event-bindings/dragleave-no-change-detect.directive.js +0 -33
  133. package/esm2015/lib/custom-event-bindings/dragover-no-change-detect.directive.js +0 -39
  134. package/esm2015/lib/drop-zone/drop-zone.component.js +0 -81
  135. package/esm2015/lib/limble-tree-branch/limble-tree-branch.component.js +0 -116
  136. package/esm2015/lib/limble-tree-node/limble-tree-node.component.js +0 -484
  137. package/esm2015/lib/limble-tree-placeholder/limble-tree-placeholder.component.js +0 -75
  138. package/esm2015/lib/limble-tree-root/drop-zone.service.js +0 -377
  139. package/esm2015/lib/limble-tree-root/limble-tree-root.component.js +0 -178
  140. package/esm2015/lib/limble-tree-root/tree-construction-status.service.js +0 -33
  141. package/esm2015/lib/limble-tree-root/tree.service.js +0 -301
  142. package/esm2015/lib/limble-tree.module.js +0 -47
  143. package/esm2015/lib/singletons/component-creator.service.js +0 -19
  144. package/esm2015/lib/singletons/drag-state.service.js +0 -64
  145. package/esm2015/lib/singletons/global-events.service.js +0 -137
  146. package/esm2015/lib/util.js +0 -74
  147. package/esm2015/public-api.js +0 -6
  148. package/fesm2015/limble-limble-tree.js +0 -2209
  149. package/fesm2015/limble-limble-tree.js.map +0 -1
  150. package/lib/classes/Branch.d.ts +0 -26
  151. package/lib/classes/DropZone.d.ts +0 -27
  152. package/lib/classes/DropZoneLocation.d.ts +0 -9
  153. package/lib/custom-event-bindings/dragleave-no-change-detect.directive.d.ts +0 -13
  154. package/lib/drop-zone/drop-zone.component.d.ts +0 -18
  155. package/lib/limble-tree-branch/limble-tree-branch.component.d.ts +0 -28
  156. package/lib/limble-tree-node/limble-tree-node.component.d.ts +0 -53
  157. package/lib/limble-tree-placeholder/limble-tree-placeholder.component.d.ts +0 -21
  158. package/lib/limble-tree-root/drop-zone.service.d.ts +0 -62
  159. package/lib/limble-tree-root/limble-tree-root.component.d.ts +0 -37
  160. package/lib/limble-tree-root/tree-construction-status.service.d.ts +0 -15
  161. package/lib/limble-tree-root/tree.service.d.ts +0 -132
  162. package/lib/singletons/component-creator.service.d.ts +0 -9
  163. package/lib/singletons/drag-state.service.d.ts +0 -35
  164. package/lib/singletons/global-events.service.d.ts +0 -13
  165. package/lib/util.d.ts +0 -13
@@ -1,62 +0,0 @@
1
- import { Branch, BranchCoordinates } from "../classes/Branch";
2
- import { DragStateService } from "../singletons/drag-state.service";
3
- import type { ProcessedOptions } from "./tree.service";
4
- import { DropZone } from "../classes/DropZone";
5
- import { TreeConstructionStatus } from "./tree-construction-status.service";
6
- import * as i0 from "@angular/core";
7
- export interface DropZoneFamily {
8
- /** The deepest member of the family */
9
- founder: DropZone;
10
- /** All the drop zones that belong to this family */
11
- members: Array<DropZone>;
12
- }
13
- export declare class DropZoneService {
14
- private readonly dragStateService;
15
- private readonly dropZoneArchive;
16
- private readonly dropZoneInventory;
17
- private readonly dropZoneFamilies;
18
- private visibleFamily;
19
- private activeDropZone;
20
- private tree;
21
- private treeOptions;
22
- private tempFamilies;
23
- private readonly update$;
24
- constructor(dragStateService: DragStateService, treeConstructionStatus: TreeConstructionStatus);
25
- addDropZone(newDropZone: DropZone): void;
26
- /** hides all drop zones */
27
- clearVisibleZones(): void;
28
- getActiveDropZone(): DropZoneService["activeDropZone"];
29
- getDropZone(coordinates: BranchCoordinates): DropZone | undefined;
30
- init(tree: Branch<any>, treeOptions: ProcessedOptions): void;
31
- removeDropZone(dropZone: DropZone): void;
32
- /** hides all drop zones, deletes all the family assignments,
33
- * and empties the dropZoneInventory
34
- */
35
- reset(): void;
36
- /**
37
- * Restores the service to its initial state: hides all drop zones,
38
- * deletes all the family assignments, and empties the dropZoneInventory
39
- * and dropZoneArchive.
40
- */
41
- restart(): void;
42
- restoreFamilies(): void;
43
- /**
44
- * Shows the drop zone family of the drop zone indicated by `coordinates`.
45
- */
46
- showDropZoneFamily(
47
- /** Note: this drop zone may not exist in the dropZoneInventory; we have to search the inventory based on its location */
48
- dropZone: DropZone, options?: {
49
- joinFamilies?: boolean;
50
- activateLowestInsteadOfFounder?: boolean;
51
- }): void;
52
- swapActiveDropZone(newActiveDropZone: DropZone): void;
53
- update(): void;
54
- private assignFamilies;
55
- private buildInventory;
56
- private setActiveDropZone;
57
- private showDropZone;
58
- private updateDropZones;
59
- private zoneIsAllowed;
60
- static ɵfac: i0.ɵɵFactoryDeclaration<DropZoneService, never>;
61
- static ɵprov: i0.ɵɵInjectableDeclaration<DropZoneService>;
62
- }
@@ -1,37 +0,0 @@
1
- import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, NgZone, OnChanges, OnDestroy } from "@angular/core";
2
- import { DropZoneService } from "./drop-zone.service";
3
- import { LimbleTreeData, LimbleTreeOptions, TreeDrop } from "../limble-tree-root/tree.service";
4
- import { TreeService } from "./tree.service";
5
- import { DragStateService } from "../singletons/drag-state.service";
6
- import { GlobalEventsService } from "../singletons/global-events.service";
7
- import * as i0 from "@angular/core";
8
- export declare class LimbleTreeRootComponent implements AfterViewInit, OnChanges, OnDestroy {
9
- private readonly treeService;
10
- private readonly dropZoneService;
11
- private readonly dragStateService;
12
- private readonly globalEventsService;
13
- private readonly ngZone;
14
- private readonly changeDetectorRef;
15
- private readonly el;
16
- data: LimbleTreeData | undefined;
17
- options: LimbleTreeOptions | undefined;
18
- itemsPerPage: number | undefined;
19
- page: number | undefined;
20
- private host;
21
- readonly treeChange: EventEmitter<null>;
22
- readonly treeDrop: EventEmitter<TreeDrop>;
23
- private readonly changesSubscription;
24
- private readonly dropSubscription;
25
- placeholder: boolean;
26
- constructor(treeService: TreeService, dropZoneService: DropZoneService, dragStateService: DragStateService, globalEventsService: GlobalEventsService, ngZone: NgZone, changeDetectorRef: ChangeDetectorRef, el: ElementRef<Element>);
27
- ngAfterViewInit(): void;
28
- ngOnChanges(): void;
29
- /** Rebuild the tree */
30
- update(): void;
31
- dragoverHandler(event: DragEvent): void;
32
- dragleaveHandler(event: DragEvent): void;
33
- dropHandler(event: DragEvent): void;
34
- ngOnDestroy(): void;
35
- static ɵfac: i0.ɵɵFactoryDeclaration<LimbleTreeRootComponent, never>;
36
- static ɵcmp: i0.ɵɵComponentDeclaration<LimbleTreeRootComponent, "limble-tree-root", never, { "data": "data"; "options": "options"; "itemsPerPage": "itemsPerPage"; "page": "page"; }, { "treeChange": "treeChange"; "treeDrop": "treeDrop"; }, never, never>;
37
- }
@@ -1,15 +0,0 @@
1
- import { BehaviorSubject } from "rxjs";
2
- import * as i0 from "@angular/core";
3
- export declare class TreeConstructionStatus {
4
- private beingBuilt;
5
- private isReady;
6
- readonly stable$: BehaviorSubject<boolean>;
7
- constructor();
8
- constructing(): void;
9
- doneConstructing(): void;
10
- treeIsStable(): boolean;
11
- ready(val: boolean): void;
12
- emit(): void;
13
- static ɵfac: i0.ɵɵFactoryDeclaration<TreeConstructionStatus, never>;
14
- static ɵprov: i0.ɵɵInjectableDeclaration<TreeConstructionStatus>;
15
- }
@@ -1,132 +0,0 @@
1
- import { Type, ViewContainerRef } from "@angular/core";
2
- import { ComponentCreatorService } from "../singletons/component-creator.service";
3
- import { DropZoneService } from "./drop-zone.service";
4
- import { Branch, BranchCoordinates } from "../classes/Branch";
5
- import { DragStateService } from "../singletons/drag-state.service";
6
- import { BehaviorSubject, Subject } from "rxjs";
7
- import { TreeConstructionStatus } from "./tree-construction-status.service";
8
- import * as i0 from "@angular/core";
9
- /** An object describing a node of the tree */
10
- export interface LimbleTreeNode {
11
- /** A list of nodes to be rendered "under" this one, one level deeper in the tree. */
12
- nodes?: LimbleTreeData;
13
- /** An object that describes the component which will represent this node in the visual tree */
14
- component?: ComponentObj;
15
- collapsed?: boolean;
16
- [index: string]: unknown;
17
- }
18
- /** An object that the limble-tree-root component uses to build the tree */
19
- export declare type LimbleTreeData = Array<LimbleTreeNode>;
20
- /** A group of settings for changing the functionality of the tree */
21
- export interface LimbleTreeOptions {
22
- /** The component object to use if one is not specified for a particular node */
23
- defaultComponent?: ComponentObj;
24
- /** The number of pixels to indent each level of the tree. Defaults to 45 */
25
- indent?: number;
26
- /**
27
- * Whether to allow "nesting" (placing a node one level deeper than currently exists on the branch).
28
- * When this is a boolean, it applies to all nodes. When this is a function, the node in question
29
- * is passed in. Defaults to true.
30
- */
31
- allowNesting?: boolean | ((nodeData: LimbleTreeNode) => boolean);
32
- /**
33
- * Whether to allow a node to be dragged. When this is a boolean, it applies to all nodes. When this
34
- * is a function, the node in question is passed in. Defaults to true.
35
- */
36
- allowDragging?: boolean | ((nodeData: LimbleTreeNode) => boolean);
37
- /** A callback to determine whether a sourceNode can be dropped at a particular location. */
38
- allowDrop?: (sourceNode: LimbleTreeNode, proposedParent: LimbleTreeNode | null, proposedIndex: number) => boolean;
39
- /** When set to true, list mode will enforce a flat tree structure, meaning there
40
- * can only be one level of the tree. `allowNesting` is automatically set to `false`
41
- * and any children will be deleted.
42
- *
43
- * This mode can be used when the same dynamic drag and drop functionality of
44
- * the tree is desired, but the tree structure itself is not necessary. This
45
- * also opens up the pagination API on the limble-tree-root component. See the
46
- * README for details on pagination.
47
- */
48
- listMode?: boolean;
49
- }
50
- /** An object that references the component to be rendered and its bindings */
51
- export interface ComponentObj {
52
- /** The component class */
53
- class: Type<unknown>;
54
- /** The bindings (inputs and outputs) of the class */
55
- bindings?: {
56
- [index: string]: unknown;
57
- };
58
- }
59
- /** The default value for the `indent` option */
60
- export declare const INDENT = 45;
61
- /** An options object with default values loaded where applicable */
62
- export interface ProcessedOptionsBase extends LimbleTreeOptions {
63
- defaultComponent?: ComponentObj;
64
- indent: number;
65
- allowNesting: boolean | ((nodeData: LimbleTreeNode) => boolean);
66
- allowDragging: boolean | ((nodeData: LimbleTreeNode) => boolean);
67
- allowDrop: (sourceNode: LimbleTreeNode, proposedParent: LimbleTreeNode | null, proposedIndex: number) => boolean;
68
- listMode: boolean;
69
- itemsPerPage: number | undefined;
70
- page: number | undefined;
71
- }
72
- export interface ProcessedOptionsWithPagination extends ProcessedOptionsBase {
73
- listMode: true;
74
- itemsPerPage: number;
75
- page: number;
76
- }
77
- export interface ProcessedOptionsWithoutPagination extends ProcessedOptionsBase {
78
- listMode: false;
79
- itemsPerPage: undefined;
80
- page: undefined;
81
- }
82
- export declare type ProcessedOptions = ProcessedOptionsWithPagination | ProcessedOptionsWithoutPagination;
83
- /** the value emitted from the root component after a node is dropped */
84
- export interface TreeDrop {
85
- /** The node that was dropped */
86
- target: LimbleTreeNode;
87
- /** the target's parent before the drag and drop, or null if it was a top-level node */
88
- oldParent: LimbleTreeNode | null;
89
- /** the index of the node before the drag and drop relative to its old siblings */
90
- oldIndex: number;
91
- /** the target's parent after the drag and drop, or null if it is now a top-level node */
92
- newParent: LimbleTreeNode | null;
93
- /** the index of the node after the drag and drop relative to its new siblings */
94
- newIndex: number;
95
- }
96
- export declare class TreeService {
97
- private readonly componentCreatorService;
98
- private readonly dropZoneService;
99
- private readonly dragStateService;
100
- private readonly treeConstructionStatus;
101
- readonly changes$: Subject<null>;
102
- readonly drops$: Subject<TreeDrop>;
103
- host: ViewContainerRef | undefined;
104
- treeData: LimbleTreeData | undefined;
105
- /** This should never be reassigned. It is assigned in init() and no where else. We need to keep the reference from breaking. */
106
- private originalData;
107
- treeOptions: ProcessedOptions | undefined;
108
- treeModel: Branch<any>;
109
- private placeholder;
110
- captured: boolean;
111
- readonly cleanupSignal$: Subject<boolean>;
112
- placeholder$: BehaviorSubject<boolean>;
113
- constructor(componentCreatorService: ComponentCreatorService, dropZoneService: DropZoneService, dragStateService: DragStateService, treeConstructionStatus: TreeConstructionStatus);
114
- drop(source: Branch<any>, targetCoordinates: BranchCoordinates): void;
115
- /** Initializes the service and renders the tree.
116
- * @param host - The ViewContainerRef into which the tree will be rendered.
117
- * @param data - The data array that was passed in to LimbleTreeRoot, which is
118
- * the users' representation of the tree
119
- * @param options - The options object that was passed in to LimbleTreeRoot
120
- */
121
- init(host: ViewContainerRef, data: LimbleTreeData, options?: LimbleTreeOptions, itemsPerPage?: number, page?: number): void;
122
- private cleanup;
123
- /** Renders the entire tree from root to leaves */
124
- private render;
125
- /** Renders a branch of the tree and all of its descendants */
126
- renderBranch(host: ViewContainerRef, branch: Branch<any>): void;
127
- private processOptions;
128
- private rebuildTreeData;
129
- private rebuildBranch;
130
- static ɵfac: i0.ɵɵFactoryDeclaration<TreeService, never>;
131
- static ɵprov: i0.ɵɵInjectableDeclaration<TreeService>;
132
- }
@@ -1,9 +0,0 @@
1
- import { ComponentFactoryResolver, Type, ViewContainerRef } from "@angular/core";
2
- import * as i0 from "@angular/core";
3
- export declare class ComponentCreatorService {
4
- private readonly factoryResolver;
5
- constructor(factoryResolver: ComponentFactoryResolver);
6
- appendComponent<T = unknown>(component: Type<T>, viewContainerRef: ViewContainerRef, index?: number | undefined): import("@angular/core").ComponentRef<T>;
7
- static ɵfac: i0.ɵɵFactoryDeclaration<ComponentCreatorService, never>;
8
- static ɵprov: i0.ɵɵInjectableDeclaration<ComponentCreatorService>;
9
- }
@@ -1,35 +0,0 @@
1
- import { ViewContainerRef } from "@angular/core";
2
- import { BehaviorSubject } from "rxjs";
3
- import type { Branch } from "../classes/Branch";
4
- import * as i0 from "@angular/core";
5
- export declare type DragState = "idle" | "dragging" | "droppable" | "captured";
6
- interface TempData {
7
- branch: Branch<any>;
8
- parentContainer: ViewContainerRef;
9
- }
10
- export declare class DragStateService {
11
- /** pushes the new state whenever the state changes */
12
- state$: BehaviorSubject<DragState>;
13
- /** holds data about the thing being dragged */
14
- private _tempData;
15
- /** the current state of the drag process */
16
- private state;
17
- constructor();
18
- /** Called to indicate that something is being dragged. Stores that something for later. */
19
- dragging(branch: Branch<any>, parentContainer: ViewContainerRef): void;
20
- /** Called to indicate that there is a valid active drop zone. Drop is now possible. */
21
- droppable(): void;
22
- /** Called to indicate that there is no longer a valid active drop zone. Drop is no longer possible. */
23
- notDroppable(): void;
24
- /** Called to indicate that a drop into a valid drop zone has occurred. Returns the item that was dropped. */
25
- capture(): Branch<any> | undefined;
26
- /** Called to reset the service for future drags */
27
- release(): void;
28
- /** gets the current thing being dragged, if any. */
29
- getData(): TempData | undefined;
30
- /** gets the current state */
31
- getState(): DragState;
32
- static ɵfac: i0.ɵɵFactoryDeclaration<DragStateService, never>;
33
- static ɵprov: i0.ɵɵInjectableDeclaration<DragStateService>;
34
- }
35
- export {};
@@ -1,13 +0,0 @@
1
- import { NgZone } from "@angular/core";
2
- import * as i0 from "@angular/core";
3
- export declare class GlobalEventsService {
4
- private readonly ngZone;
5
- private globalDrag$;
6
- private globalDragSubscription;
7
- scrolling: boolean;
8
- constructor(ngZone: NgZone);
9
- addScrolling(): void;
10
- removeScrolling(): void;
11
- static ɵfac: i0.ɵɵFactoryDeclaration<GlobalEventsService, never>;
12
- static ɵprov: i0.ɵɵInjectableDeclaration<GlobalEventsService>;
13
- }
package/lib/util.d.ts DELETED
@@ -1,13 +0,0 @@
1
- import type { LimbleTreeNode, ProcessedOptions } from "./limble-tree-root/tree.service";
2
- export declare function arraysAreEqual(array1: Array<unknown>, array2: Array<unknown>): boolean;
3
- export declare function isElementDescendant(potentialAncestor: Node, potentialDescendant: Node): boolean | undefined;
4
- export declare function isNestingAllowed(options?: ProcessedOptions, nodeData?: LimbleTreeNode): boolean;
5
- export declare function isDraggingAllowed(options?: ProcessedOptions, nodeData?: LimbleTreeNode): boolean;
6
- export declare function isFirefox(): boolean;
7
- /** Because drop zones can disappear when the mouse moves, sometimes
8
- * moving the mouse just a little bit inside the tree causes the tree to
9
- * shrink such that the mouse is no longer over the tree. In this case,
10
- * a dragleave event may not fire, and we can't clear the drop zones. This
11
- * function is used to catch this edge case.
12
- */
13
- export declare function suddenTreeExit(event: DragEvent): boolean;