@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.
- package/esm2020/lib/components/branch/branch.component.mjs +4 -4
- package/esm2020/lib/components/branch/index.mjs +2 -0
- package/esm2020/lib/components/dragover-no-change-detect.mjs +39 -0
- package/esm2020/lib/components/dropzone/dropzone.component.mjs +2 -2
- package/esm2020/lib/components/dropzone/index.mjs +2 -0
- package/esm2020/lib/components/host-component.interface.mjs +1 -1
- package/esm2020/lib/components/index.mjs +7 -0
- package/esm2020/lib/components/node-component.interface.mjs +1 -1
- package/esm2020/lib/components/root/index.mjs +2 -0
- package/esm2020/lib/components/root/root.component.mjs +3 -3
- package/esm2020/lib/core/branch-options.interface.mjs +1 -1
- package/esm2020/lib/core/branchable.interface.mjs +2 -0
- package/esm2020/lib/core/component-container.interface.mjs +2 -0
- package/esm2020/lib/core/configuration/configuration.mjs +1 -1
- package/esm2020/lib/core/configuration/index.mjs +3 -0
- package/esm2020/lib/core/configuration/tree-options.interface.mjs +1 -1
- package/esm2020/lib/core/index.mjs +11 -5
- package/esm2020/lib/core/tree-branch/branch-controller.mjs +4 -4
- package/esm2020/lib/core/tree-branch/graftable.interface.mjs +2 -0
- package/esm2020/lib/core/tree-branch/index.mjs +4 -0
- package/esm2020/lib/core/tree-branch/tree-branch.mjs +8 -8
- package/esm2020/lib/core/tree-node-base.mjs +3 -4
- package/esm2020/lib/core/tree-node.interface.mjs +2 -0
- package/esm2020/lib/core/tree-plot.interface.mjs +2 -0
- package/esm2020/lib/core/tree-root/index.mjs +3 -0
- package/esm2020/lib/core/tree-root/root-controller.mjs +4 -4
- package/esm2020/lib/core/tree-root/tree-root.mjs +5 -5
- package/esm2020/lib/core/tree-service/index.mjs +2 -0
- package/esm2020/lib/core/tree-service/tree.service.mjs +3 -3
- package/esm2020/lib/events/drag/drag-end-event.mjs +1 -1
- package/esm2020/lib/events/drag/drag-start-event.mjs +1 -1
- package/esm2020/lib/events/drag/drop-event.mjs +1 -1
- package/esm2020/lib/events/general/destruction-event.mjs +1 -1
- package/esm2020/lib/events/index.mjs +3 -2
- package/esm2020/lib/events/relational/graft-event.mjs +1 -1
- package/esm2020/lib/events/relational/index.mjs +2 -1
- package/esm2020/lib/events/relational/prune-event.mjs +1 -1
- package/esm2020/lib/events/relational/relational-tree-event.interface.mjs +1 -1
- package/esm2020/lib/events/relational/tree-relationship.interface.mjs +2 -0
- package/esm2020/lib/events/tree-event.interface.mjs +2 -0
- package/esm2020/lib/extras/collapse/collapse.mjs +1 -1
- package/esm2020/lib/extras/collapse/index.mjs +2 -1
- package/esm2020/lib/extras/drag-and-drop/drag-and-drop.mjs +4 -6
- package/esm2020/lib/extras/drag-and-drop/drag-and-drop.module.mjs +4 -5
- package/esm2020/lib/extras/drag-and-drop/drag-and-drop.service.mjs +1 -1
- package/esm2020/lib/extras/drag-and-drop/drag-state.mjs +2 -2
- package/esm2020/lib/extras/drag-and-drop/dropzone-renderer.mjs +6 -8
- package/esm2020/lib/extras/drag-and-drop/index.mjs +4 -2
- package/esm2020/lib/legacy/legacy-tree.mjs +3 -4
- package/esm2020/lib/legacy/limble-tree-legacy.module.mjs +2 -2
- package/esm2020/lib/legacy/limble-tree-root/limble-tree-root.component.mjs +2 -2
- package/esm2020/public-api.mjs +9 -9
- package/esm2020/shared/index.mjs +3 -0
- package/fesm2015/limble-limble-tree.mjs +241 -241
- package/fesm2015/limble-limble-tree.mjs.map +1 -1
- package/fesm2020/limble-limble-tree.mjs +239 -239
- package/fesm2020/limble-limble-tree.mjs.map +1 -1
- package/lib/components/branch/branch.component.d.ts +4 -4
- package/lib/components/branch/index.d.ts +1 -0
- package/lib/components/dropzone/index.d.ts +1 -0
- package/lib/components/host-component.interface.d.ts +1 -1
- package/lib/components/index.d.ts +6 -0
- package/lib/components/node-component.interface.d.ts +1 -1
- package/lib/components/root/index.d.ts +1 -0
- package/lib/components/root/root.component.d.ts +3 -3
- package/lib/core/branch-options.interface.d.ts +1 -1
- package/lib/core/branchable.interface.d.ts +8 -0
- package/lib/core/configuration/configuration.d.ts +1 -1
- package/lib/core/configuration/index.d.ts +2 -0
- package/lib/core/configuration/tree-options.interface.d.ts +2 -2
- package/lib/core/index.d.ts +10 -4
- package/lib/core/tree-branch/branch-controller.d.ts +4 -4
- package/lib/core/tree-branch/graftable.interface.d.ts +7 -0
- package/lib/core/tree-branch/index.d.ts +3 -0
- package/lib/core/tree-branch/tree-branch.d.ts +13 -11
- package/lib/core/tree-node-base.d.ts +9 -10
- package/lib/core/tree-node.interface.d.ts +16 -0
- package/lib/core/tree-root/index.d.ts +2 -0
- package/lib/core/tree-root/root-controller.d.ts +4 -4
- package/lib/core/tree-root/tree-root.d.ts +10 -9
- package/lib/core/tree-service/index.d.ts +1 -0
- package/lib/core/tree-service/tree.service.d.ts +2 -2
- package/lib/events/drag/drag-end-event.d.ts +9 -11
- package/lib/events/drag/drag-start-event.d.ts +5 -6
- package/lib/events/drag/drop-event.d.ts +6 -7
- package/lib/events/general/destruction-event.d.ts +5 -5
- package/lib/events/index.d.ts +2 -1
- package/lib/events/relational/graft-event.d.ts +7 -6
- package/lib/events/relational/index.d.ts +1 -0
- package/lib/events/relational/prune-event.d.ts +7 -6
- package/lib/events/relational/relational-tree-event.interface.d.ts +5 -4
- package/lib/events/relational/tree-relationship.interface.d.ts +6 -0
- package/lib/events/tree-event.interface.d.ts +5 -0
- package/lib/extras/collapse/collapse.d.ts +1 -1
- package/lib/extras/collapse/index.d.ts +1 -0
- package/lib/extras/drag-and-drop/drag-and-drop.d.ts +2 -4
- package/lib/extras/drag-and-drop/drag-and-drop.module.d.ts +1 -2
- package/lib/extras/drag-and-drop/drag-and-drop.service.d.ts +3 -3
- package/lib/extras/drag-and-drop/drag-state.d.ts +1 -1
- package/lib/extras/drag-and-drop/dropzone-renderer.d.ts +8 -9
- package/lib/extras/drag-and-drop/index.d.ts +3 -1
- package/package.json +1 -1
- package/public-api.d.ts +8 -8
- package/shared/index.d.ts +2 -0
- package/esm2020/lib/core/relationship.interface.mjs +0 -2
- package/esm2020/lib/extras/drag-and-drop/dragover-no-change-detect.mjs +0 -39
- package/esm2020/lib/structure/branchable.interface.mjs +0 -2
- package/esm2020/lib/structure/component-container.interface.mjs +0 -2
- package/esm2020/lib/structure/graftable.interface.mjs +0 -2
- package/esm2020/lib/structure/index.mjs +0 -9
- package/esm2020/lib/structure/tree-branch-node.interface.mjs +0 -2
- package/esm2020/lib/structure/tree-event.interface.mjs +0 -2
- package/esm2020/lib/structure/tree-node.interface.mjs +0 -2
- package/esm2020/lib/structure/tree-plot.mjs +0 -2
- package/esm2020/lib/structure/tree-relationship.interface.mjs +0 -2
- package/lib/core/relationship.interface.d.ts +0 -5
- package/lib/structure/branchable.interface.d.ts +0 -4
- package/lib/structure/graftable.interface.d.ts +0 -6
- package/lib/structure/index.d.ts +0 -8
- package/lib/structure/tree-branch-node.interface.d.ts +0 -5
- package/lib/structure/tree-event.interface.d.ts +0 -5
- package/lib/structure/tree-node.interface.d.ts +0 -15
- package/lib/structure/tree-relationship.interface.d.ts +0 -7
- /package/lib/{extras/drag-and-drop → components}/dragover-no-change-detect.d.ts +0 -0
- /package/lib/{structure → core}/component-container.interface.d.ts +0 -0
- /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 {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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 @@
|
|
|
1
|
+
export * from "./root.component";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AfterViewInit, EventEmitter, ViewContainerRef } from "@angular/core";
|
|
2
|
-
import { DropzoneComponent } from "../dropzone
|
|
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;
|
|
@@ -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,5 +1,5 @@
|
|
|
1
|
-
import type { TreeBranch } from "../tree-branch
|
|
2
|
-
import type { TreeRoot } from "../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?: {
|
package/lib/core/index.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./tree-
|
|
3
|
-
export * from "./tree-
|
|
4
|
-
export * from "./
|
|
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
|
|
3
|
-
import { ComponentContainer } from "
|
|
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
|
+
}
|
|
@@ -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
|
|
4
|
-
import
|
|
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 {
|
|
7
|
-
import
|
|
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
|
|
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<
|
|
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<
|
|
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<
|
|
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:
|
|
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 {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
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:
|
|
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
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ViewContainerRef, ViewRef } from "@angular/core";
|
|
2
|
-
import { RootComponent } from "../../components
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
|
|
3
|
-
import type {
|
|
4
|
-
import {
|
|
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 {
|
|
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<
|
|
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<
|
|
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
|
|
3
|
-
import { TreeRoot } from "../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 {
|
|
2
|
-
import type {
|
|
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<
|
|
13
|
-
oldParent: TreeNode<
|
|
10
|
+
constructor(source: TreeNode<T>, endpoints: {
|
|
11
|
+
oldParent: TreeNode<T>;
|
|
14
12
|
oldIndex: number;
|
|
15
|
-
newParent: TreeNode<
|
|
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<
|
|
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<
|
|
26
|
-
source(): TreeNode<
|
|
23
|
+
oldParent(): TreeNode<T>;
|
|
24
|
+
source(): TreeNode<T>;
|
|
27
25
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
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<
|
|
8
|
-
source(): TreeNode<
|
|
6
|
+
constructor(source: TreeNode<T>);
|
|
7
|
+
source(): TreeNode<T>;
|
|
9
8
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
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<
|
|
10
|
-
source(): TreeNode<
|
|
8
|
+
constructor(source: TreeNode<T>, parent: TreeNode<T>, index: number);
|
|
9
|
+
source(): TreeNode<T>;
|
|
11
10
|
index(): number;
|
|
12
|
-
parent(): TreeNode<
|
|
11
|
+
parent(): TreeNode<T>;
|
|
13
12
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
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<
|
|
7
|
-
source(): TreeNode<
|
|
6
|
+
constructor(source: TreeNode<T>);
|
|
7
|
+
source(): TreeNode<T>;
|
|
8
8
|
}
|
package/lib/events/index.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { RelationalTreeEvent } from "./relational-tree-event.interface";
|
|
2
|
-
import type { TreeRelationship } from "
|
|
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<
|
|
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:
|
|
10
|
-
child():
|
|
10
|
+
constructor(source: TreeBranch<UserlandComponent>, relationship: TreeRelationship<UserlandComponent>);
|
|
11
|
+
child(): TreeBranch<UserlandComponent>;
|
|
11
12
|
index(): number;
|
|
12
|
-
parent():
|
|
13
|
-
source():
|
|
13
|
+
parent(): TreeNode<UserlandComponent>;
|
|
14
|
+
source(): TreeBranch<UserlandComponent>;
|
|
14
15
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { RelationalTreeEvent } from "./relational-tree-event.interface";
|
|
2
|
-
import type { TreeRelationship } from "
|
|
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<
|
|
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:
|
|
10
|
-
child():
|
|
10
|
+
constructor(source: TreeBranch<UserlandComponent>, relationship: TreeRelationship<UserlandComponent>);
|
|
11
|
+
child(): TreeBranch<UserlandComponent>;
|
|
11
12
|
index(): number;
|
|
12
|
-
parent():
|
|
13
|
-
source():
|
|
13
|
+
parent(): TreeNode<UserlandComponent>;
|
|
14
|
+
source(): TreeBranch<UserlandComponent>;
|
|
14
15
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
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<
|
|
4
|
+
export interface RelationalTreeEvent<UserlandComponent> extends TreeEvent<UserlandComponent> {
|
|
4
5
|
/** @returns The parent branch of the relationship */
|
|
5
|
-
parent: () =>
|
|
6
|
+
parent: () => TreeNode<UserlandComponent>;
|
|
6
7
|
/** @returns The child branch of the relationship */
|
|
7
|
-
child: () =>
|
|
8
|
+
child: () => TreeBranch<UserlandComponent>;
|
|
8
9
|
/** @returns The index location of the child */
|
|
9
10
|
index: () => number;
|
|
10
11
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { Subject } from "rxjs";
|
|
2
|
-
import {
|
|
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<
|
|
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
|
|
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 {
|
|
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:
|
|
13
|
+
treeBranch: TreeNode<any>;
|
|
14
14
|
direction: "upper" | "lower";
|
|
15
15
|
} | null;
|
|
16
16
|
/**
|