@limble/limble-tree 1.0.0-beta.2 → 1.0.0-beta.3

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 (126) hide show
  1. package/esm2020/lib/components/branch/branch.component.mjs +4 -4
  2. package/esm2020/lib/components/branch/index.mjs +2 -0
  3. package/esm2020/lib/components/dragover-no-change-detect.mjs +39 -0
  4. package/esm2020/lib/components/dropzone/dropzone.component.mjs +2 -2
  5. package/esm2020/lib/components/dropzone/index.mjs +2 -0
  6. package/esm2020/lib/components/host-component.interface.mjs +1 -1
  7. package/esm2020/lib/components/index.mjs +7 -0
  8. package/esm2020/lib/components/node-component.interface.mjs +1 -1
  9. package/esm2020/lib/components/root/index.mjs +2 -0
  10. package/esm2020/lib/components/root/root.component.mjs +3 -3
  11. package/esm2020/lib/core/branch-options.interface.mjs +1 -1
  12. package/esm2020/lib/core/branchable.interface.mjs +2 -0
  13. package/esm2020/lib/core/component-container.interface.mjs +2 -0
  14. package/esm2020/lib/core/configuration/configuration.mjs +1 -1
  15. package/esm2020/lib/core/configuration/index.mjs +3 -0
  16. package/esm2020/lib/core/configuration/tree-options.interface.mjs +1 -1
  17. package/esm2020/lib/core/index.mjs +11 -5
  18. package/esm2020/lib/core/tree-branch/branch-controller.mjs +4 -4
  19. package/esm2020/lib/core/tree-branch/graftable.interface.mjs +2 -0
  20. package/esm2020/lib/core/tree-branch/index.mjs +4 -0
  21. package/esm2020/lib/core/tree-branch/tree-branch.mjs +8 -8
  22. package/esm2020/lib/core/tree-node-base.mjs +3 -4
  23. package/esm2020/lib/core/tree-node.interface.mjs +2 -0
  24. package/esm2020/lib/core/tree-plot.interface.mjs +2 -0
  25. package/esm2020/lib/core/tree-root/index.mjs +3 -0
  26. package/esm2020/lib/core/tree-root/root-controller.mjs +4 -4
  27. package/esm2020/lib/core/tree-root/tree-root.mjs +5 -5
  28. package/esm2020/lib/core/tree-service/index.mjs +2 -0
  29. package/esm2020/lib/core/tree-service/tree.service.mjs +3 -3
  30. package/esm2020/lib/events/drag/drag-end-event.mjs +1 -1
  31. package/esm2020/lib/events/drag/drag-start-event.mjs +1 -1
  32. package/esm2020/lib/events/drag/drop-event.mjs +1 -1
  33. package/esm2020/lib/events/general/destruction-event.mjs +1 -1
  34. package/esm2020/lib/events/index.mjs +3 -2
  35. package/esm2020/lib/events/relational/graft-event.mjs +1 -1
  36. package/esm2020/lib/events/relational/index.mjs +2 -1
  37. package/esm2020/lib/events/relational/prune-event.mjs +1 -1
  38. package/esm2020/lib/events/relational/relational-tree-event.interface.mjs +1 -1
  39. package/esm2020/lib/events/relational/tree-relationship.interface.mjs +2 -0
  40. package/esm2020/lib/events/tree-event.interface.mjs +2 -0
  41. package/esm2020/lib/extras/collapse/collapse.mjs +1 -1
  42. package/esm2020/lib/extras/collapse/index.mjs +2 -1
  43. package/esm2020/lib/extras/drag-and-drop/drag-and-drop.mjs +4 -6
  44. package/esm2020/lib/extras/drag-and-drop/drag-and-drop.module.mjs +4 -5
  45. package/esm2020/lib/extras/drag-and-drop/drag-and-drop.service.mjs +1 -1
  46. package/esm2020/lib/extras/drag-and-drop/drag-state.mjs +2 -2
  47. package/esm2020/lib/extras/drag-and-drop/dropzone-renderer.mjs +6 -8
  48. package/esm2020/lib/extras/drag-and-drop/index.mjs +4 -2
  49. package/esm2020/lib/legacy/legacy-tree.mjs +3 -4
  50. package/esm2020/lib/legacy/limble-tree-legacy.module.mjs +2 -2
  51. package/esm2020/lib/legacy/limble-tree-root/limble-tree-root.component.mjs +2 -2
  52. package/esm2020/public-api.mjs +9 -9
  53. package/esm2020/shared/index.mjs +3 -0
  54. package/fesm2015/limble-limble-tree.mjs +241 -241
  55. package/fesm2015/limble-limble-tree.mjs.map +1 -1
  56. package/fesm2020/limble-limble-tree.mjs +239 -239
  57. package/fesm2020/limble-limble-tree.mjs.map +1 -1
  58. package/lib/components/branch/branch.component.d.ts +4 -4
  59. package/lib/components/branch/index.d.ts +1 -0
  60. package/lib/components/dropzone/index.d.ts +1 -0
  61. package/lib/components/host-component.interface.d.ts +1 -1
  62. package/lib/components/index.d.ts +6 -0
  63. package/lib/components/node-component.interface.d.ts +1 -1
  64. package/lib/components/root/index.d.ts +1 -0
  65. package/lib/components/root/root.component.d.ts +3 -3
  66. package/lib/core/branch-options.interface.d.ts +1 -1
  67. package/lib/core/branchable.interface.d.ts +8 -0
  68. package/lib/core/configuration/configuration.d.ts +1 -1
  69. package/lib/core/configuration/index.d.ts +2 -0
  70. package/lib/core/configuration/tree-options.interface.d.ts +2 -2
  71. package/lib/core/index.d.ts +10 -4
  72. package/lib/core/tree-branch/branch-controller.d.ts +4 -4
  73. package/lib/core/tree-branch/graftable.interface.d.ts +7 -0
  74. package/lib/core/tree-branch/index.d.ts +3 -0
  75. package/lib/core/tree-branch/tree-branch.d.ts +13 -11
  76. package/lib/core/tree-node-base.d.ts +9 -10
  77. package/lib/core/tree-node.interface.d.ts +16 -0
  78. package/lib/core/tree-root/index.d.ts +2 -0
  79. package/lib/core/tree-root/root-controller.d.ts +4 -4
  80. package/lib/core/tree-root/tree-root.d.ts +10 -9
  81. package/lib/core/tree-service/index.d.ts +1 -0
  82. package/lib/core/tree-service/tree.service.d.ts +2 -2
  83. package/lib/events/drag/drag-end-event.d.ts +9 -11
  84. package/lib/events/drag/drag-start-event.d.ts +5 -6
  85. package/lib/events/drag/drop-event.d.ts +6 -7
  86. package/lib/events/general/destruction-event.d.ts +5 -5
  87. package/lib/events/index.d.ts +2 -1
  88. package/lib/events/relational/graft-event.d.ts +7 -6
  89. package/lib/events/relational/index.d.ts +1 -0
  90. package/lib/events/relational/prune-event.d.ts +7 -6
  91. package/lib/events/relational/relational-tree-event.interface.d.ts +5 -4
  92. package/lib/events/relational/tree-relationship.interface.d.ts +6 -0
  93. package/lib/events/tree-event.interface.d.ts +5 -0
  94. package/lib/extras/collapse/collapse.d.ts +1 -1
  95. package/lib/extras/collapse/index.d.ts +1 -0
  96. package/lib/extras/drag-and-drop/drag-and-drop.d.ts +2 -4
  97. package/lib/extras/drag-and-drop/drag-and-drop.module.d.ts +1 -2
  98. package/lib/extras/drag-and-drop/drag-and-drop.service.d.ts +3 -3
  99. package/lib/extras/drag-and-drop/drag-state.d.ts +1 -1
  100. package/lib/extras/drag-and-drop/dropzone-renderer.d.ts +8 -9
  101. package/lib/extras/drag-and-drop/index.d.ts +3 -1
  102. package/package.json +1 -1
  103. package/public-api.d.ts +8 -8
  104. package/shared/index.d.ts +2 -0
  105. package/esm2020/lib/core/relationship.interface.mjs +0 -2
  106. package/esm2020/lib/extras/drag-and-drop/dragover-no-change-detect.mjs +0 -39
  107. package/esm2020/lib/structure/branchable.interface.mjs +0 -2
  108. package/esm2020/lib/structure/component-container.interface.mjs +0 -2
  109. package/esm2020/lib/structure/graftable.interface.mjs +0 -2
  110. package/esm2020/lib/structure/index.mjs +0 -9
  111. package/esm2020/lib/structure/tree-branch-node.interface.mjs +0 -2
  112. package/esm2020/lib/structure/tree-event.interface.mjs +0 -2
  113. package/esm2020/lib/structure/tree-node.interface.mjs +0 -2
  114. package/esm2020/lib/structure/tree-plot.mjs +0 -2
  115. package/esm2020/lib/structure/tree-relationship.interface.mjs +0 -2
  116. package/lib/core/relationship.interface.d.ts +0 -5
  117. package/lib/structure/branchable.interface.d.ts +0 -4
  118. package/lib/structure/graftable.interface.d.ts +0 -6
  119. package/lib/structure/index.d.ts +0 -8
  120. package/lib/structure/tree-branch-node.interface.d.ts +0 -5
  121. package/lib/structure/tree-event.interface.d.ts +0 -5
  122. package/lib/structure/tree-node.interface.d.ts +0 -15
  123. package/lib/structure/tree-relationship.interface.d.ts +0 -7
  124. /package/lib/{extras/drag-and-drop → components}/dragover-no-change-detect.d.ts +0 -0
  125. /package/lib/{structure → core}/component-container.interface.d.ts +0 -0
  126. /package/lib/{structure/tree-plot.d.ts → core/tree-plot.interface.d.ts} +0 -0
@@ -1,7 +1,7 @@
1
- import { AfterViewInit, ApplicationRef, ComponentRef, EventEmitter, OnDestroy, QueryList, Type, ViewContainerRef } from "@angular/core";
2
- import { DropzoneComponent } from "../dropzone/dropzone.component";
3
- import { HostComponent } from "../host-component.interface";
4
- import { NodeComponent } from "../node-component.interface";
1
+ import { type AfterViewInit, ApplicationRef, type ComponentRef, EventEmitter, type OnDestroy, type QueryList, type Type, ViewContainerRef } from "@angular/core";
2
+ import type { HostComponent } from "../host-component.interface";
3
+ import type { NodeComponent } from "../node-component.interface";
4
+ import { DropzoneComponent } from "../dropzone";
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class BranchComponent<T> implements NodeComponent, HostComponent<T>, AfterViewInit, OnDestroy {
7
7
  private readonly appRef;
@@ -0,0 +1 @@
1
+ export * from "./branch.component";
@@ -0,0 +1 @@
1
+ export * from "./dropzone.component";
@@ -1,4 +1,4 @@
1
- import { ComponentRef, EventEmitter, Type } from "@angular/core";
1
+ import type { ComponentRef, EventEmitter, Type } from "@angular/core";
2
2
  export interface HostComponent<UserlandComponent> {
3
3
  contentCreated: EventEmitter<UserlandComponent>;
4
4
  contentToHost?: Type<UserlandComponent>;
@@ -0,0 +1,6 @@
1
+ export * from "./branch";
2
+ export * from "./root";
3
+ export * from "./dropzone";
4
+ export * from "./host-component.interface";
5
+ export * from "./node-component.interface";
6
+ export * from "./dragover-no-change-detect";
@@ -1,4 +1,4 @@
1
- import { ViewContainerRef } from "@angular/core";
1
+ import type { ViewContainerRef } from "@angular/core";
2
2
  export interface NodeComponent {
3
3
  branchesContainer: ViewContainerRef | undefined;
4
4
  showInnerDropzone: boolean;
@@ -0,0 +1 @@
1
+ export * from "./root.component";
@@ -1,6 +1,6 @@
1
- import { AfterViewInit, EventEmitter, ViewContainerRef } from "@angular/core";
2
- import { DropzoneComponent } from "../dropzone/dropzone.component";
3
- import { NodeComponent } from "../node-component.interface";
1
+ import { type AfterViewInit, EventEmitter, ViewContainerRef } from "@angular/core";
2
+ import { DropzoneComponent } from "../dropzone";
3
+ import type { NodeComponent } from "../node-component.interface";
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class RootComponent implements NodeComponent, AfterViewInit {
6
6
  branchesContainer: ViewContainerRef | undefined;
@@ -1,4 +1,4 @@
1
- import { EventEmitter, Type } from "@angular/core";
1
+ import type { EventEmitter, Type } from "@angular/core";
2
2
  export interface BranchOptions<Component> {
3
3
  inputBindings?: {
4
4
  [K in keyof Component]?: Component[K];
@@ -0,0 +1,8 @@
1
+ import type { Type } from "@angular/core";
2
+ import type { TreeBranch } from "./tree-branch";
3
+ import type { BranchOptions } from "./branch-options.interface";
4
+ export interface Branchable<UserlandComponent> {
5
+ branches: () => Array<TreeBranch<UserlandComponent>>;
6
+ getBranch: (index: number) => TreeBranch<UserlandComponent> | undefined;
7
+ grow: (component: Type<UserlandComponent>, options?: BranchOptions<UserlandComponent>) => TreeBranch<UserlandComponent>;
8
+ }
@@ -1,4 +1,4 @@
1
- import type { TreeRoot } from "../tree-root/tree-root";
1
+ import type { TreeRoot } from "../tree-root";
2
2
  import type { TreeOptions } from "./tree-options.interface";
3
3
  declare class Configuration {
4
4
  private readonly configStorage;
@@ -0,0 +1,2 @@
1
+ export * from "./configuration";
2
+ export * from "./tree-options.interface";
@@ -1,5 +1,5 @@
1
- import type { TreeBranch } from "../tree-branch/tree-branch";
2
- import type { TreeRoot } from "../tree-root/tree-root";
1
+ import type { TreeBranch } from "../tree-branch";
2
+ import type { TreeRoot } from "../tree-root";
3
3
  /** The configuration options for a tree, as identified by a TreeRoot */
4
4
  export interface TreeOptions {
5
5
  dragAndDrop?: {
@@ -1,4 +1,10 @@
1
- export * from "./tree-service/tree.service";
2
- export * from "./tree-root/tree-root";
3
- export * from "./tree-branch/tree-branch";
4
- export * from "./configuration/tree-options.interface";
1
+ export * from "./configuration";
2
+ export * from "./tree-branch";
3
+ export * from "./tree-root";
4
+ export * from "./tree-service";
5
+ export * from "./branch-options.interface";
6
+ export * from "./branchable.interface";
7
+ export * from "./component-container.interface";
8
+ export * from "./tree-node-base";
9
+ export * from "./tree-node.interface";
10
+ export * from "./tree-plot.interface";
@@ -1,7 +1,7 @@
1
- import { ComponentRef, ViewContainerRef, ViewRef } from "@angular/core";
2
- import { BranchComponent } from "../../components/branch/branch.component";
3
- import { ComponentContainer } from "../../structure";
4
- import { TreeBranch } from "./tree-branch";
1
+ import { type ComponentRef, type ViewContainerRef, type ViewRef } from "@angular/core";
2
+ import { BranchComponent } from "../../components";
3
+ import type { ComponentContainer } from "../component-container.interface";
4
+ import type { TreeBranch } from "./tree-branch";
5
5
  /**
6
6
  * A wrapper around the BranchComponent that helps instantiate it and handles its events.
7
7
  */
@@ -0,0 +1,7 @@
1
+ import type { TreeNode } from "../tree-node.interface";
2
+ export interface Graftable<UserlandComponent> {
3
+ graftTo: (newParent: TreeNode<UserlandComponent>, index?: number) => number;
4
+ index: () => number | undefined;
5
+ parent: () => TreeNode<UserlandComponent> | undefined;
6
+ prune: () => void;
7
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./branch-controller";
2
+ export * from "./tree-branch";
3
+ export * from "./graftable.interface";
@@ -1,10 +1,12 @@
1
1
  import type { Observable } from "rxjs";
2
2
  import type { ComponentRef, Type, ViewContainerRef, ViewRef } from "@angular/core";
3
- import { BranchComponent } from "../../components/branch/branch.component";
4
- import type { NodeComponent } from "../../components/node-component.interface";
3
+ import { BranchComponent } from "../../components";
4
+ import { TreeRoot } from "../tree-root";
5
+ import type { TreeNode } from "../tree-node.interface";
6
+ import type { TreePlot } from "../tree-plot.interface";
5
7
  import type { BranchOptions, FullBranchOptions } from "../branch-options.interface";
6
- import { TreeRoot } from "..";
7
- import type { TreeNode, TreePlot, TreeEvent, TreeBranchNode } from "../../structure";
8
+ import type { Graftable } from "./graftable.interface";
9
+ import { type TreeEvent } from "../../events";
8
10
  /** Represents a standard node in a tree. Renders a BranchComponent.
9
11
  *
10
12
  * @remarks
@@ -14,13 +16,13 @@ import type { TreeNode, TreePlot, TreeEvent, TreeBranchNode } from "../../struct
14
16
  * 3. Contains two Dropzones: one for dropping branches below this branch (as a
15
17
  * sibling), and one for dropping branches as a first child of this branch.
16
18
  */
17
- export declare class TreeBranch<UserlandComponent> implements TreeBranchNode<BranchComponent<UserlandComponent>, TreeBranch<UserlandComponent>, NodeComponent> {
19
+ export declare class TreeBranch<UserlandComponent> implements TreeNode<UserlandComponent>, Graftable<UserlandComponent> {
18
20
  readonly branchOptions: FullBranchOptions<UserlandComponent>;
19
21
  private readonly branchController;
20
22
  private detachedView;
21
23
  private _parent;
22
24
  private readonly treeNodeBase;
23
- constructor(parent: TreeNode<TreeBranch<UserlandComponent>, NodeComponent>, branchOptions: FullBranchOptions<UserlandComponent>);
25
+ constructor(parent: TreeNode<UserlandComponent>, branchOptions: FullBranchOptions<UserlandComponent>);
24
26
  /** @returns All child branches as an array of TreeBranch instances, in order. */
25
27
  branches(): Array<TreeBranch<UserlandComponent>>;
26
28
  /**
@@ -47,13 +49,13 @@ export declare class TreeBranch<UserlandComponent> implements TreeBranchNode<Bra
47
49
  *
48
50
  * @param event - The TreeEvent that will be emitted.
49
51
  */
50
- dispatch(event: TreeEvent): void;
52
+ dispatch(event: TreeEvent<UserlandComponent>): void;
51
53
  /**
52
54
  * @returns
53
55
  * An observable that emits TreeEvents whenever an event is dispatched
54
56
  * in this branch or any of its descendant branches.
55
57
  */
56
- events(): Observable<TreeEvent>;
58
+ events(): Observable<TreeEvent<UserlandComponent>>;
57
59
  /**
58
60
  * @param index - The index of the child branch to retrieve.
59
61
  *
@@ -93,7 +95,7 @@ export declare class TreeBranch<UserlandComponent> implements TreeBranchNode<Bra
93
95
  *
94
96
  * @returns The index at which this branch was grafted.
95
97
  */
96
- graftTo(newParent: TreeNode<TreeBranch<UserlandComponent>, NodeComponent>, index?: number): number;
98
+ graftTo(newParent: TreeNode<UserlandComponent>, index?: number): number;
97
99
  /**
98
100
  * Appends a new child branch to this branch. The child branch will render
99
101
  * the specified component according to the (optional) configuration parameter.
@@ -133,7 +135,7 @@ export declare class TreeBranch<UserlandComponent> implements TreeBranchNode<Bra
133
135
  * If this branch has no parent, (eg, if this branch has been pruned) this
134
136
  * method will return undefined.
135
137
  */
136
- parent(): TreeNode<TreeBranch<UserlandComponent>, NodeComponent> | undefined;
138
+ parent(): TreeNode<UserlandComponent> | undefined;
137
139
  /**
138
140
  * Provides a model describing this branch's descendants.
139
141
  *
@@ -211,7 +213,7 @@ export declare class TreeBranch<UserlandComponent> implements TreeBranchNode<Bra
211
213
  *
212
214
  * @param callback - A function to execute on each node.
213
215
  */
214
- traverse(callback: (node: TreeNode<TreeBranch<UserlandComponent>, NodeComponent>) => void): void;
216
+ traverse(callback: (node: TreeBranch<UserlandComponent>) => void): void;
215
217
  private checkGraftLocationValidity;
216
218
  private handleUserlandError;
217
219
  private indexIsOutOfRange;
@@ -1,10 +1,9 @@
1
- import { Observable } from "rxjs";
2
- import { NodeComponent } from "../components/node-component.interface";
3
- import { TreeEvent } from "../structure/tree-event.interface";
4
- import { TreeNode } from "../structure/tree-node.interface";
5
- import { TreePlot } from "../structure/tree-plot";
6
- import { TreeBranch } from "./tree-branch/tree-branch";
7
- export declare class TreeNodeBase<UserlandComponent> implements Partial<TreeNode<TreeBranch<UserlandComponent>, NodeComponent>> {
1
+ import { type Observable } from "rxjs";
2
+ import { type TreeEvent } from "../events";
3
+ import { TreeBranch } from "./tree-branch";
4
+ import type { TreePlot } from "./tree-plot.interface";
5
+ import type { TreeNode } from "./tree-node.interface";
6
+ export declare class TreeNodeBase<UserlandComponent> implements Partial<TreeNode<UserlandComponent>> {
8
7
  private readonly _branches;
9
8
  private readonly events$;
10
9
  private destroyed;
@@ -12,13 +11,13 @@ export declare class TreeNodeBase<UserlandComponent> implements Partial<TreeNode
12
11
  constructor();
13
12
  branches(): Array<TreeBranch<UserlandComponent>>;
14
13
  destroy(): void;
15
- dispatch(event: TreeEvent): void;
16
- events(): Observable<TreeEvent>;
14
+ dispatch(event: TreeEvent<UserlandComponent>): void;
15
+ events(): Observable<TreeEvent<UserlandComponent>>;
17
16
  getBranch(index: number): TreeBranch<UserlandComponent> | undefined;
18
17
  handleUserlandError(error: unknown): never;
19
18
  isDestroyed(): boolean;
20
19
  plot(): TreePlot;
21
- traverse(callback: (node: TreeNode<TreeBranch<UserlandComponent>, NodeComponent>) => void): void;
20
+ traverse(callback: (node: TreeBranch<UserlandComponent>) => void): void;
22
21
  private deregisterChildRelationship;
23
22
  private graftsToSelf;
24
23
  private prunesToSelf;
@@ -0,0 +1,16 @@
1
+ import type { TreeRoot } from "./tree-root";
2
+ import type { TreePlot } from "./tree-plot.interface";
3
+ import type { Branchable } from "./branchable.interface";
4
+ import type { ComponentContainer } from "./component-container.interface";
5
+ import type { Observable } from "rxjs";
6
+ import type { TreeEvent } from "../events";
7
+ import type { NodeComponent } from "../components";
8
+ export interface TreeNode<UserlandComponent> extends Branchable<UserlandComponent>, ComponentContainer<NodeComponent> {
9
+ destroy: () => void;
10
+ dispatch: (event: TreeEvent<UserlandComponent>) => void;
11
+ events: () => Observable<TreeEvent<UserlandComponent>>;
12
+ isDestroyed: () => boolean;
13
+ plot: () => TreePlot;
14
+ root: () => TreeRoot<any> | undefined;
15
+ traverse: (callback: (node: TreeNode<UserlandComponent>) => void) => void;
16
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./tree-root";
2
+ export * from "./root-controller";
@@ -1,7 +1,7 @@
1
- import { ViewContainerRef, ViewRef } from "@angular/core";
2
- import { RootComponent } from "../../components/root/root.component";
3
- import { ComponentContainer } from "../../structure";
4
- import { TreeRoot } from "./tree-root";
1
+ import type { ViewContainerRef, ViewRef } from "@angular/core";
2
+ import { RootComponent } from "../../components";
3
+ import type { TreeRoot } from "./tree-root";
4
+ import type { ComponentContainer } from "../component-container.interface";
5
5
  /**
6
6
  * A wrapper around the BranchComponent that helps instantiate it and handles its events.
7
7
  */
@@ -1,16 +1,17 @@
1
1
  import type { Observable } from "rxjs";
2
- import { TreeBranch } from "../tree-branch/tree-branch";
3
- import type { Type, ViewContainerRef, ViewRef } from "@angular/core";
4
- import { RootComponent } from "../../components/root/root.component";
5
- import type { NodeComponent } from "../../components/node-component.interface";
2
+ import { TreeBranch } from "../tree-branch";
3
+ import type { TreePlot } from "../tree-plot.interface";
4
+ import type { TreeNode } from "../tree-node.interface";
6
5
  import type { BranchOptions } from "../branch-options.interface";
7
- import type { TreeNode, TreePlot, TreeEvent } from "../../structure";
6
+ import type { Type, ViewContainerRef, ViewRef } from "@angular/core";
7
+ import { RootComponent } from "../../components";
8
+ import { TreeEvent } from "../../events";
8
9
  /**
9
10
  * Represents the base of the tree. It renders a very simple container for child
10
11
  * branches. It has methods for creating and accessing those branches. It emits
11
12
  * events when things happen in the tree.
12
13
  */
13
- export declare class TreeRoot<UserlandComponent> implements TreeNode<TreeBranch<UserlandComponent>, RootComponent> {
14
+ export declare class TreeRoot<UserlandComponent> implements TreeNode<UserlandComponent> {
14
15
  private readonly viewContainerRef;
15
16
  private readonly rootController;
16
17
  private readonly treeNodeBase;
@@ -42,13 +43,13 @@ export declare class TreeRoot<UserlandComponent> implements TreeNode<TreeBranch<
42
43
  *
43
44
  * @param event - The TreeEvent that will be emitted.
44
45
  */
45
- dispatch(event: TreeEvent): void;
46
+ dispatch(event: TreeEvent<UserlandComponent>): void;
46
47
  /**
47
48
  * @returns
48
49
  * An observable that emits TreeEvents whenever an event is dispatched
49
50
  * in the root or any of its descendant branches.
50
51
  */
51
- events(): Observable<TreeEvent>;
52
+ events(): Observable<TreeEvent<UserlandComponent>>;
52
53
  /**
53
54
  * @returns
54
55
  * The child branch at the specified index, or undefined if there is
@@ -119,6 +120,6 @@ export declare class TreeRoot<UserlandComponent> implements TreeNode<TreeBranch<
119
120
  *
120
121
  * @param callback - A function to execute on each node.
121
122
  */
122
- traverse(callback: (node: TreeNode<TreeBranch<UserlandComponent>, NodeComponent>) => void): void;
123
+ traverse(callback: (node: TreeNode<UserlandComponent>) => void): void;
123
124
  private handleUserlandError;
124
125
  }
@@ -0,0 +1 @@
1
+ export * from "./tree.service";
@@ -1,6 +1,6 @@
1
1
  import { type ViewContainerRef } from "@angular/core";
2
- import type { TreeOptions } from "../configuration/tree-options.interface";
3
- import { TreeRoot } from "../tree-root/tree-root";
2
+ import { type TreeOptions } from "../configuration";
3
+ import { TreeRoot } from "../tree-root";
4
4
  import * as i0 from "@angular/core";
5
5
  /** Responsible for the creation of new trees. */
6
6
  export declare class TreeService {
@@ -1,27 +1,25 @@
1
- import type { NodeComponent } from "../../components/node-component.interface";
2
- import type { TreeBranch } from "../../core";
3
- import type { TreeNode } from "../../structure";
4
- import type { TreeEvent } from "../../structure/tree-event.interface";
1
+ import type { TreeNode } from "../../core";
2
+ import type { TreeEvent } from "../../events";
5
3
  /** Emitted when a drag-and-drop operation has completed */
6
- export declare class DragEndEvent<T> implements TreeEvent {
4
+ export declare class DragEndEvent<T> implements TreeEvent<T> {
7
5
  private readonly _source;
8
6
  private readonly _newParent;
9
7
  private readonly _newIndex;
10
8
  private readonly _oldParent;
11
9
  private readonly _oldIndex;
12
- constructor(source: TreeNode<TreeBranch<T>, NodeComponent>, endpoints: {
13
- oldParent: TreeNode<TreeBranch<T>, NodeComponent>;
10
+ constructor(source: TreeNode<T>, endpoints: {
11
+ oldParent: TreeNode<T>;
14
12
  oldIndex: number;
15
- newParent: TreeNode<TreeBranch<T>, NodeComponent>;
13
+ newParent: TreeNode<T>;
16
14
  newIndex: number;
17
15
  });
18
16
  /** @returns The new index of the dropped branch */
19
17
  newIndex(): number;
20
18
  /** @returns The new parent of the dropped branch */
21
- newParent(): TreeNode<TreeBranch<T>, NodeComponent>;
19
+ newParent(): TreeNode<T>;
22
20
  /** @returns The index of the dropped branch before it was dragged */
23
21
  oldIndex(): number;
24
22
  /** @returns The parent of the dropped branch before it was dragged */
25
- oldParent(): TreeNode<TreeBranch<T>, NodeComponent>;
26
- source(): TreeNode<TreeBranch<T>, NodeComponent>;
23
+ oldParent(): TreeNode<T>;
24
+ source(): TreeNode<T>;
27
25
  }
@@ -1,9 +1,8 @@
1
- import type { NodeComponent } from "../../components/node-component.interface";
2
- import type { TreeNode } from "../../structure";
3
- import type { TreeEvent } from "../../structure/tree-event.interface";
1
+ import type { TreeNode } from "../../core";
2
+ import type { TreeEvent } from "../../events";
4
3
  /** Emitted when a TreeBranch begins being dragged */
5
- export declare class DragStartEvent implements TreeEvent {
4
+ export declare class DragStartEvent<T> implements TreeEvent<T> {
6
5
  private readonly _source;
7
- constructor(source: TreeNode<unknown, NodeComponent>);
8
- source(): TreeNode<unknown, NodeComponent>;
6
+ constructor(source: TreeNode<T>);
7
+ source(): TreeNode<T>;
9
8
  }
@@ -1,13 +1,12 @@
1
- import type { NodeComponent } from "../../components/node-component.interface";
2
- import type { TreeBranch } from "../../core";
3
- import type { TreeNode, TreeEvent } from "../../structure";
1
+ import type { TreeNode } from "../../core";
2
+ import type { TreeEvent } from "../../events";
4
3
  /** Emitted when a TreeBranch is dropped into a valid Dropzone */
5
- export declare class DropEvent<T> implements TreeEvent {
4
+ export declare class DropEvent<T> implements TreeEvent<T> {
6
5
  private readonly _source;
7
6
  private readonly _parent;
8
7
  private readonly _index;
9
- constructor(source: TreeNode<TreeBranch<T>, NodeComponent>, parent: TreeNode<TreeBranch<T>, NodeComponent>, index: number);
10
- source(): TreeNode<TreeBranch<T>, NodeComponent>;
8
+ constructor(source: TreeNode<T>, parent: TreeNode<T>, index: number);
9
+ source(): TreeNode<T>;
11
10
  index(): number;
12
- parent(): TreeNode<TreeBranch<T>, NodeComponent>;
11
+ parent(): TreeNode<T>;
13
12
  }
@@ -1,8 +1,8 @@
1
- import type { NodeComponent } from "../../components/node-component.interface";
2
- import type { TreeNode, TreeEvent } from "../../structure";
1
+ import type { TreeNode } from "../../core";
2
+ import type { TreeEvent } from "../../events";
3
3
  /** Emitted when a node is destroyed */
4
- export declare class DestructionEvent implements TreeEvent {
4
+ export declare class DestructionEvent<T> implements TreeEvent<T> {
5
5
  private readonly _source;
6
- constructor(source: TreeNode<unknown, NodeComponent>);
7
- source(): TreeNode<unknown, NodeComponent>;
6
+ constructor(source: TreeNode<T>);
7
+ source(): TreeNode<T>;
8
8
  }
@@ -1,3 +1,4 @@
1
- export * from "./relational";
2
1
  export * from "./drag";
3
2
  export * from "./general";
3
+ export * from "./relational";
4
+ export * from "./tree-event.interface";
@@ -1,14 +1,15 @@
1
1
  import type { RelationalTreeEvent } from "./relational-tree-event.interface";
2
- import type { TreeRelationship } from "../../structure/tree-relationship.interface";
2
+ import type { TreeRelationship } from "./tree-relationship.interface";
3
+ import type { TreeBranch, TreeNode } from "../../core";
3
4
  /** Emits when a branch is grafted to another tree node */
4
- export declare class GraftEvent<T extends TreeRelationship<any, any>> implements RelationalTreeEvent<T["parent"], T["child"]> {
5
+ export declare class GraftEvent<UserlandComponent> implements RelationalTreeEvent<UserlandComponent> {
5
6
  private readonly _source;
6
7
  private readonly _parent;
7
8
  private readonly _child;
8
9
  private readonly _index;
9
- constructor(source: T["child"], relationship: T);
10
- child(): T["child"];
10
+ constructor(source: TreeBranch<UserlandComponent>, relationship: TreeRelationship<UserlandComponent>);
11
+ child(): TreeBranch<UserlandComponent>;
11
12
  index(): number;
12
- parent(): T["parent"];
13
- source(): T["child"];
13
+ parent(): TreeNode<UserlandComponent>;
14
+ source(): TreeBranch<UserlandComponent>;
14
15
  }
@@ -1,3 +1,4 @@
1
1
  export * from "./graft-event";
2
2
  export * from "./prune-event";
3
3
  export * from "./relational-tree-event.interface";
4
+ export * from "./tree-relationship.interface";
@@ -1,14 +1,15 @@
1
1
  import type { RelationalTreeEvent } from "./relational-tree-event.interface";
2
- import type { TreeRelationship } from "../../structure/tree-relationship.interface";
2
+ import type { TreeRelationship } from "./tree-relationship.interface";
3
+ import type { TreeNode, TreeBranch } from "../../core";
3
4
  /** Emitted when a branch is pruned from its parent branch */
4
- export declare class PruneEvent<T extends TreeRelationship<any, any>> implements RelationalTreeEvent<T["parent"], T["child"]> {
5
+ export declare class PruneEvent<UserlandComponent> implements RelationalTreeEvent<UserlandComponent> {
5
6
  private readonly _source;
6
7
  private readonly _parent;
7
8
  private readonly _child;
8
9
  private readonly _index;
9
- constructor(source: T["child"], relationship: T);
10
- child(): T["child"];
10
+ constructor(source: TreeBranch<UserlandComponent>, relationship: TreeRelationship<UserlandComponent>);
11
+ child(): TreeBranch<UserlandComponent>;
11
12
  index(): number;
12
- parent(): T["parent"];
13
- source(): T["child"];
13
+ parent(): TreeNode<UserlandComponent>;
14
+ source(): TreeBranch<UserlandComponent>;
14
15
  }
@@ -1,10 +1,11 @@
1
- import type { TreeEvent } from "../../structure/tree-event.interface";
1
+ import type { TreeBranch, TreeNode } from "../../core";
2
+ import type { TreeEvent } from "../tree-event.interface";
2
3
  /** A TreeEvent which involves a parent/child relationship */
3
- export interface RelationalTreeEvent<Parent, Child> extends TreeEvent {
4
+ export interface RelationalTreeEvent<UserlandComponent> extends TreeEvent<UserlandComponent> {
4
5
  /** @returns The parent branch of the relationship */
5
- parent: () => Parent;
6
+ parent: () => TreeNode<UserlandComponent>;
6
7
  /** @returns The child branch of the relationship */
7
- child: () => Child;
8
+ child: () => TreeBranch<UserlandComponent>;
8
9
  /** @returns The index location of the child */
9
10
  index: () => number;
10
11
  }
@@ -0,0 +1,6 @@
1
+ import type { TreeBranch, TreeNode } from "../../core";
2
+ export interface TreeRelationship<UserlandComponent> {
3
+ parent: TreeNode<UserlandComponent>;
4
+ child: TreeBranch<UserlandComponent>;
5
+ index: number;
6
+ }
@@ -0,0 +1,5 @@
1
+ import type { TreeNode } from "../core";
2
+ /** An event emitted by a node in the tree */
3
+ export interface TreeEvent<UserlandComponent> {
4
+ source: () => TreeNode<UserlandComponent>;
5
+ }
@@ -1,4 +1,4 @@
1
- import { TreeBranch } from "../../core";
1
+ import type { TreeBranch } from "../../core";
2
2
  declare class TreeCollapser {
3
3
  private readonly tempStorage;
4
4
  constructor();
@@ -1,2 +1,3 @@
1
1
  export * from "./collapse.module";
2
2
  export * from "./collapse.service";
3
+ export * from "./collapse";
@@ -1,11 +1,9 @@
1
1
  import { Subject } from "rxjs";
2
- import { NodeComponent } from "../../components/node-component.interface";
3
- import { TreeBranch } from "../../core";
4
- import { TreeNode } from "../../structure";
2
+ import { type TreeBranch, type TreeNode } from "../../core";
5
3
  declare class DragAndDrop {
6
4
  readonly dragAborted$: Subject<DragEvent>;
7
5
  dragStart<T>(treeBranch: TreeBranch<T>, event: DragEvent): void;
8
- drop<T>(parent: TreeNode<TreeBranch<T>, NodeComponent>, index: number): void;
6
+ drop<T>(parent: TreeNode<T>, index: number): void;
9
7
  private getDragImageOffsets;
10
8
  private setDragEffects;
11
9
  private watchForDragend;
@@ -1,12 +1,11 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import * as i1 from "./draggable.directive";
3
- import * as i2 from "./dragover-no-change-detect";
4
3
  /**
5
4
  * An Angular module containing all of the entities which provide Drag-And-Drop
6
5
  * functionality.
7
6
  */
8
7
  export declare class TreeDragAndDropModule {
9
8
  static ɵfac: i0.ɵɵFactoryDeclaration<TreeDragAndDropModule, never>;
10
- static ɵmod: i0.ɵɵNgModuleDeclaration<TreeDragAndDropModule, never, [typeof i1.DraggableDirective, typeof i2.DragoverNoChangeDetectDirective], [typeof i1.DraggableDirective, typeof i2.DragoverNoChangeDetectDirective]>;
9
+ static ɵmod: i0.ɵɵNgModuleDeclaration<TreeDragAndDropModule, never, [typeof i1.DraggableDirective], [typeof i1.DraggableDirective]>;
11
10
  static ɵinj: i0.ɵɵInjectorDeclaration<TreeDragAndDropModule>;
12
11
  }
@@ -1,6 +1,6 @@
1
1
  import type { Observable } from "rxjs";
2
- import type { TreeBranch, TreeRoot } from "../../core";
3
- import { DragStates } from "./drag-state";
2
+ import type { TreeNode, TreeRoot } from "../../core";
3
+ import { type DragStates } from "./drag-state";
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class TreeDragAndDropService {
6
6
  /** Hides all Dropzones */
@@ -10,7 +10,7 @@ export declare class TreeDragAndDropService {
10
10
  * If no dropzones are being displayed, then null is returned.
11
11
  */
12
12
  getCurrentlyDisplayedDropzoneFamily(): {
13
- treeBranch: TreeRoot<any> | TreeBranch<any>;
13
+ treeBranch: TreeNode<any>;
14
14
  direction: "upper" | "lower";
15
15
  } | null;
16
16
  /**
@@ -1,4 +1,4 @@
1
- import { Observable } from "rxjs";
1
+ import { type Observable } from "rxjs";
2
2
  import { TreeBranch } from "../../core";
3
3
  export declare enum DragStates {
4
4
  Idle = 0,