@limble/limble-tree 1.0.0-alpha.1 → 1.0.0-beta.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.
- package/README.md +450 -17
- package/esm2020/lib/components/branch/branch.component.mjs +7 -15
- package/esm2020/lib/components/dropzone/dropzone.component.mjs +2 -2
- package/esm2020/lib/components/root/root.component.mjs +3 -4
- package/esm2020/lib/core/branch-options.interface.mjs +1 -1
- package/esm2020/lib/core/configuration/configuration.mjs +1 -1
- package/esm2020/lib/core/configuration/tree-options.interface.mjs +1 -1
- package/esm2020/lib/core/index.mjs +1 -2
- package/esm2020/lib/core/relationship.interface.mjs +1 -1
- package/esm2020/lib/core/tree-branch/branch-controller.mjs +99 -0
- package/esm2020/lib/core/tree-branch/tree-branch.mjs +260 -106
- package/esm2020/lib/core/tree-node-base.mjs +10 -9
- package/esm2020/lib/core/tree-root/root-controller.mjs +42 -0
- package/esm2020/lib/core/tree-root/tree-root.mjs +138 -27
- package/esm2020/lib/core/tree-service/tree.service.mjs +7 -1
- package/esm2020/lib/events/drag/drag-end-event.mjs +9 -7
- package/esm2020/lib/events/drag/drag-start-event.mjs +2 -4
- package/esm2020/lib/events/drag/drop-event.mjs +2 -4
- package/esm2020/lib/events/general/destruction-event.mjs +10 -0
- package/esm2020/lib/events/general/index.mjs +2 -0
- package/esm2020/lib/events/index.mjs +2 -1
- package/esm2020/lib/events/relational/graft-event.mjs +2 -4
- package/esm2020/lib/events/relational/prune-event.mjs +2 -4
- package/esm2020/lib/events/relational/relational-tree-event.interface.mjs +1 -1
- package/esm2020/lib/extras/collapse/collapse.mjs +2 -2
- package/esm2020/lib/extras/collapse/collapse.module.mjs +2 -1
- package/esm2020/lib/extras/collapse/collapse.service.mjs +26 -1
- package/esm2020/lib/extras/drag-and-drop/drag-and-drop.mjs +6 -10
- package/esm2020/lib/extras/drag-and-drop/drag-and-drop.module.mjs +5 -1
- package/esm2020/lib/extras/drag-and-drop/drag-and-drop.service.mjs +21 -5
- package/esm2020/lib/extras/drag-and-drop/draggable.directive.mjs +7 -7
- package/esm2020/lib/extras/drag-and-drop/dragover-no-change-detect.mjs +10 -11
- package/esm2020/lib/extras/drag-and-drop/dropzone-renderer.mjs +9 -7
- package/esm2020/lib/legacy/legacy-component-obj.interface.mjs +1 -1
- package/esm2020/lib/legacy/legacy-tree-data.interface.mjs +1 -1
- package/esm2020/lib/legacy/legacy-tree-options.interface.mjs +1 -1
- package/esm2020/lib/legacy/legacy-tree.mjs +30 -30
- package/esm2020/lib/legacy/limble-tree-root/limble-tree-root.component.mjs +1 -1
- package/esm2020/lib/limble-tree.module.mjs +6 -2
- package/esm2020/lib/structure/branchable.interface.mjs +1 -1
- package/esm2020/lib/structure/component-container.interface.mjs +2 -0
- package/esm2020/lib/structure/index.mjs +2 -5
- package/esm2020/lib/structure/tree-branch-node.interface.mjs +1 -1
- package/esm2020/lib/structure/tree-event.interface.mjs +1 -1
- package/esm2020/lib/structure/tree-node.interface.mjs +1 -1
- package/esm2020/lib/structure/tree-relationship.interface.mjs +1 -1
- package/fesm2015/limble-limble-tree.mjs +821 -376
- package/fesm2015/limble-limble-tree.mjs.map +1 -1
- package/fesm2020/limble-limble-tree.mjs +819 -372
- package/fesm2020/limble-limble-tree.mjs.map +1 -1
- package/lib/core/branch-options.interface.d.ts +1 -1
- package/lib/core/configuration/configuration.d.ts +2 -2
- package/lib/core/configuration/tree-options.interface.d.ts +48 -29
- package/lib/core/index.d.ts +0 -1
- package/lib/core/relationship.interface.d.ts +2 -3
- package/lib/core/tree-branch/branch-controller.d.ts +25 -0
- package/lib/core/tree-branch/tree-branch.d.ts +199 -24
- package/lib/core/tree-node-base.d.ts +4 -5
- package/lib/core/tree-root/root-controller.d.ts +19 -0
- package/lib/core/tree-root/tree-root.d.ts +109 -14
- package/lib/core/tree-service/tree.service.d.ts +8 -2
- package/lib/events/drag/drag-end-event.d.ts +15 -13
- package/lib/events/drag/drag-start-event.d.ts +6 -5
- package/lib/events/drag/drop-event.d.ts +7 -10
- package/lib/events/general/destruction-event.d.ts +8 -0
- package/lib/events/general/index.d.ts +1 -0
- package/lib/events/index.d.ts +1 -0
- package/lib/events/relational/graft-event.d.ts +5 -6
- package/lib/events/relational/prune-event.d.ts +5 -6
- package/lib/events/relational/relational-tree-event.interface.d.ts +5 -1
- package/lib/extras/collapse/collapse.module.d.ts +1 -0
- package/lib/extras/collapse/collapse.service.d.ts +25 -0
- package/lib/extras/drag-and-drop/drag-and-drop.d.ts +2 -3
- package/lib/extras/drag-and-drop/drag-and-drop.module.d.ts +4 -0
- package/lib/extras/drag-and-drop/drag-and-drop.service.d.ts +22 -3
- package/lib/extras/drag-and-drop/draggable.directive.d.ts +4 -5
- package/lib/extras/drag-and-drop/dragover-no-change-detect.d.ts +7 -3
- package/lib/legacy/legacy-component-obj.interface.d.ts +1 -1
- package/lib/legacy/legacy-tree-data.interface.d.ts +1 -1
- package/lib/legacy/legacy-tree-options.interface.d.ts +2 -2
- package/lib/legacy/legacy-tree.d.ts +4 -4
- package/lib/legacy/limble-tree-root/limble-tree-root.component.d.ts +4 -4
- package/lib/limble-tree.module.d.ts +4 -0
- package/lib/structure/branchable.interface.d.ts +0 -1
- package/lib/structure/component-container.interface.d.ts +8 -0
- package/lib/structure/index.d.ts +1 -4
- package/lib/structure/tree-branch-node.interface.d.ts +3 -3
- package/lib/structure/tree-event.interface.d.ts +3 -3
- package/lib/structure/tree-node.interface.d.ts +11 -6
- package/lib/structure/tree-relationship.interface.d.ts +2 -2
- package/package.json +1 -1
- package/esm2020/lib/structure/container-tree-node.interface.mjs +0 -2
- package/esm2020/lib/structure/content-container.interface.mjs +0 -2
- package/esm2020/lib/structure/event-conduit.interface.mjs +0 -2
- package/esm2020/lib/structure/tree-root.node.interface.mjs +0 -2
- package/lib/structure/container-tree-node.interface.d.ts +0 -3
- package/lib/structure/content-container.interface.d.ts +0 -3
- package/lib/structure/event-conduit.interface.d.ts +0 -6
- package/lib/structure/tree-root.node.interface.d.ts +0 -2
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { NodeComponent } from "../../components/node-component.interface";
|
|
2
|
+
import type { TreeNode } from "../../structure";
|
|
3
|
+
import type { TreeEvent } from "../../structure/tree-event.interface";
|
|
4
|
+
/** Emitted when a TreeBranch begins being dragged */
|
|
3
5
|
export declare class DragStartEvent implements TreeEvent {
|
|
4
6
|
private readonly _source;
|
|
5
|
-
constructor(source:
|
|
6
|
-
|
|
7
|
-
source(): EventConduit;
|
|
7
|
+
constructor(source: TreeNode<unknown, NodeComponent>);
|
|
8
|
+
source(): TreeNode<unknown, NodeComponent>;
|
|
8
9
|
}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { EventConduit } from "../../structure/event-conduit.interface";
|
|
6
|
-
import { TreeEvent } from "../../structure/tree-event.interface";
|
|
1
|
+
import type { NodeComponent } from "../../components/node-component.interface";
|
|
2
|
+
import type { TreeBranch } from "../../core";
|
|
3
|
+
import type { TreeNode, TreeEvent } from "../../structure";
|
|
4
|
+
/** Emitted when a TreeBranch is dropped into a valid Dropzone */
|
|
7
5
|
export declare class DropEvent<T> implements TreeEvent {
|
|
8
6
|
private readonly _source;
|
|
9
7
|
private readonly _parent;
|
|
10
8
|
private readonly _index;
|
|
11
|
-
constructor(source:
|
|
12
|
-
|
|
13
|
-
source(): EventConduit;
|
|
9
|
+
constructor(source: TreeNode<TreeBranch<T>, NodeComponent>, parent: TreeNode<TreeBranch<T>, NodeComponent>, index: number);
|
|
10
|
+
source(): TreeNode<TreeBranch<T>, NodeComponent>;
|
|
14
11
|
index(): number;
|
|
15
|
-
parent():
|
|
12
|
+
parent(): TreeNode<TreeBranch<T>, NodeComponent>;
|
|
16
13
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NodeComponent } from "../../components/node-component.interface";
|
|
2
|
+
import type { TreeNode, TreeEvent } from "../../structure";
|
|
3
|
+
/** Emitted when a node is destroyed */
|
|
4
|
+
export declare class DestructionEvent implements TreeEvent {
|
|
5
|
+
private readonly _source;
|
|
6
|
+
constructor(source: TreeNode<unknown, NodeComponent>);
|
|
7
|
+
source(): TreeNode<unknown, NodeComponent>;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./destruction-event";
|
package/lib/events/index.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import type { RelationalTreeEvent } from "./relational-tree-event.interface";
|
|
2
|
+
import type { TreeRelationship } from "../../structure/tree-relationship.interface";
|
|
3
|
+
/** Emits when a branch is grafted to another tree node */
|
|
4
4
|
export declare class GraftEvent<T extends TreeRelationship<any, any>> implements RelationalTreeEvent<T["parent"], T["child"]> {
|
|
5
5
|
private readonly _source;
|
|
6
6
|
private readonly _parent;
|
|
7
7
|
private readonly _child;
|
|
8
8
|
private readonly _index;
|
|
9
|
-
constructor(source:
|
|
9
|
+
constructor(source: T["child"], relationship: T);
|
|
10
10
|
child(): T["child"];
|
|
11
|
-
type(): "graft";
|
|
12
11
|
index(): number;
|
|
13
12
|
parent(): T["parent"];
|
|
14
|
-
source():
|
|
13
|
+
source(): T["child"];
|
|
15
14
|
}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import type { RelationalTreeEvent } from "./relational-tree-event.interface";
|
|
2
|
+
import type { TreeRelationship } from "../../structure/tree-relationship.interface";
|
|
3
|
+
/** Emitted when a branch is pruned from its parent branch */
|
|
4
4
|
export declare class PruneEvent<T extends TreeRelationship<any, any>> implements RelationalTreeEvent<T["parent"], T["child"]> {
|
|
5
5
|
private readonly _source;
|
|
6
6
|
private readonly _parent;
|
|
7
7
|
private readonly _child;
|
|
8
8
|
private readonly _index;
|
|
9
|
-
constructor(source:
|
|
9
|
+
constructor(source: T["child"], relationship: T);
|
|
10
10
|
child(): T["child"];
|
|
11
|
-
type(): "prune";
|
|
12
11
|
index(): number;
|
|
13
12
|
parent(): T["parent"];
|
|
14
|
-
source():
|
|
13
|
+
source(): T["child"];
|
|
15
14
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { TreeEvent } from "../../structure/tree-event.interface";
|
|
1
|
+
import type { TreeEvent } from "../../structure/tree-event.interface";
|
|
2
|
+
/** A TreeEvent which involves a parent/child relationship */
|
|
2
3
|
export interface RelationalTreeEvent<Parent, Child> extends TreeEvent {
|
|
4
|
+
/** @returns The parent branch of the relationship */
|
|
3
5
|
parent: () => Parent;
|
|
6
|
+
/** @returns The child branch of the relationship */
|
|
4
7
|
child: () => Child;
|
|
8
|
+
/** @returns The index location of the child */
|
|
5
9
|
index: () => number;
|
|
6
10
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
+
/** A module containing the entities which provide collapse functionality */
|
|
2
3
|
export declare class TreeCollapseModule {
|
|
3
4
|
static ɵfac: i0.ɵɵFactoryDeclaration<TreeCollapseModule, never>;
|
|
4
5
|
static ɵmod: i0.ɵɵNgModuleDeclaration<TreeCollapseModule, never, never, never>;
|
|
@@ -1,8 +1,33 @@
|
|
|
1
1
|
import { TreeBranch } from "../../core";
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
+
/** A service that collapses and expands tree branches */
|
|
3
4
|
export declare class TreeCollapseService {
|
|
5
|
+
/**
|
|
6
|
+
* Causes a TreeBranch to collapse, temporarily pruning all of its children
|
|
7
|
+
* from the tree.
|
|
8
|
+
*
|
|
9
|
+
* @param treeBranch - The branch to collapse.
|
|
10
|
+
*/
|
|
4
11
|
collapse<T>(treeBranch: TreeBranch<T>): void;
|
|
12
|
+
/**
|
|
13
|
+
* Causes a TreeBranch to expand, restoring all of its children which were
|
|
14
|
+
* previously pruned by a call to `collapse()`.
|
|
15
|
+
*
|
|
16
|
+
* @param treeBranch - The branch to expand.
|
|
17
|
+
*/
|
|
5
18
|
expand<T>(treeBranch: TreeBranch<T>): void;
|
|
19
|
+
/**
|
|
20
|
+
* Determines whether a TreeBranch currently has any children which are
|
|
21
|
+
* pruned from the tree due to a call to the `collapse()` method.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* Child branches which are pruned manually from the tree, rather than
|
|
25
|
+
* through the `collapse()` method, will not be considered.
|
|
26
|
+
*
|
|
27
|
+
* @param treeBranch - The branch to check.
|
|
28
|
+
*
|
|
29
|
+
* @returns `true` if the branch is currently collapsed; `false` if it is not.
|
|
30
|
+
*/
|
|
6
31
|
isCollapsed<T>(treeBranch: TreeBranch<T>): boolean;
|
|
7
32
|
static ɵfac: i0.ɵɵFactoryDeclaration<TreeCollapseService, never>;
|
|
8
33
|
static ɵprov: i0.ɵɵInjectableDeclaration<TreeCollapseService>;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { ComponentRef } from "@angular/core";
|
|
2
1
|
import { Subject } from "rxjs";
|
|
3
2
|
import { NodeComponent } from "../../components/node-component.interface";
|
|
4
3
|
import { TreeBranch } from "../../core";
|
|
5
|
-
import {
|
|
4
|
+
import { TreeNode } from "../../structure";
|
|
6
5
|
declare class DragAndDrop {
|
|
7
6
|
readonly dragAborted$: Subject<DragEvent>;
|
|
8
7
|
dragStart<T>(treeBranch: TreeBranch<T>, event: DragEvent): void;
|
|
9
|
-
drop<T>(parent:
|
|
8
|
+
drop<T>(parent: TreeNode<TreeBranch<T>, NodeComponent>, index: number): void;
|
|
10
9
|
private getDragImageOffsets;
|
|
11
10
|
private setDragEffects;
|
|
12
11
|
private watchForDragend;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import * as i1 from "./draggable.directive";
|
|
3
3
|
import * as i2 from "./dragover-no-change-detect";
|
|
4
|
+
/**
|
|
5
|
+
* An Angular module containing all of the entities which provide Drag-And-Drop
|
|
6
|
+
* functionality.
|
|
7
|
+
*/
|
|
4
8
|
export declare class TreeDragAndDropModule {
|
|
5
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<TreeDragAndDropModule, never>;
|
|
6
10
|
static ɵmod: i0.ɵɵNgModuleDeclaration<TreeDragAndDropModule, never, [typeof i1.DraggableDirective, typeof i2.DragoverNoChangeDetectDirective], [typeof i1.DraggableDirective, typeof i2.DragoverNoChangeDetectDirective]>;
|
|
@@ -1,15 +1,34 @@
|
|
|
1
|
-
import { Observable } from "rxjs";
|
|
2
|
-
import { TreeBranch, TreeRoot } from "../../core";
|
|
1
|
+
import type { Observable } from "rxjs";
|
|
2
|
+
import type { TreeBranch, TreeRoot } from "../../core";
|
|
3
3
|
import { DragStates } from "./drag-state";
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class TreeDragAndDropService {
|
|
6
|
+
/** Hides all Dropzones */
|
|
6
7
|
clearDropzones(): void;
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* @returns An object that indicates which dropzones are currently being displayed.
|
|
10
|
+
* If no dropzones are being displayed, then null is returned.
|
|
11
|
+
*/
|
|
8
12
|
getCurrentlyDisplayedDropzoneFamily(): {
|
|
9
13
|
treeBranch: TreeRoot<any> | TreeBranch<any>;
|
|
10
14
|
direction: "upper" | "lower";
|
|
11
15
|
} | null;
|
|
16
|
+
/**
|
|
17
|
+
* Causes the dropzone of the TreeRoot to be displayed.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* This is a useful function when you want to show the dropzone of a TreeRoot
|
|
21
|
+
* that has no child branches.
|
|
22
|
+
*
|
|
23
|
+
* @param root - The TreeRoot whose dropzone you want to show.
|
|
24
|
+
*/
|
|
12
25
|
showRootDropzone<T>(root: TreeRoot<T>): void;
|
|
26
|
+
/**
|
|
27
|
+
* @returns An observable that emits a number whenever the drag state changes.
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* See the `DragStates` enum for a list of possible states.
|
|
31
|
+
*/
|
|
13
32
|
state(): Observable<DragStates>;
|
|
14
33
|
static ɵfac: i0.ɵɵFactoryDeclaration<TreeDragAndDropService, never>;
|
|
15
34
|
static ɵprov: i0.ɵɵInjectableDeclaration<TreeDragAndDropService>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { ElementRef, Renderer2 } from "@angular/core";
|
|
2
|
-
import { TreeBranch } from "../../core";
|
|
3
|
-
import { TreeDragAndDropService } from "./drag-and-drop.service";
|
|
2
|
+
import type { TreeBranch } from "../../core";
|
|
4
3
|
import * as i0 from "@angular/core";
|
|
4
|
+
/** Makes an TreeBranch draggable when the host element is dragged */
|
|
5
5
|
export declare class DraggableDirective {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
constructor(dragAndDropService: TreeDragAndDropService, renderer: Renderer2, hostElement: ElementRef<HTMLElement>);
|
|
6
|
+
limbleTreeDraggable?: TreeBranch<any> | undefined;
|
|
7
|
+
constructor(renderer: Renderer2, hostElement: ElementRef<HTMLElement>);
|
|
9
8
|
onDragstart(event: DragEvent): void;
|
|
10
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<DraggableDirective, never>;
|
|
11
10
|
static ɵdir: i0.ɵɵDirectiveDeclaration<DraggableDirective, "[limbleTreeDraggable]", never, { "limbleTreeDraggable": "limbleTreeDraggable"; }, {}, never, never, true>;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import { ElementRef, EventEmitter, NgZone, OnDestroy, OnInit } from "@angular/core";
|
|
1
|
+
import { ElementRef, EventEmitter, NgZone, type OnDestroy, type OnInit } from "@angular/core";
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Works just like Angular's built-in `(dragover)` event binding, but is much
|
|
5
|
+
* more performant. It throttles the event to a configurable rate (default once
|
|
6
|
+
* every 25ms) and runs outside of Angular's change detection.
|
|
7
|
+
*/
|
|
3
8
|
export declare class DragoverNoChangeDetectDirective implements OnInit, OnDestroy {
|
|
4
9
|
private readonly ngZone;
|
|
5
10
|
private readonly el;
|
|
6
|
-
dragoverEventThrottle: number;
|
|
7
11
|
readonly dragoverNoChangeDetect: EventEmitter<DragEvent>;
|
|
8
12
|
private eventSubscription;
|
|
9
13
|
constructor(ngZone: NgZone, el: ElementRef<Element>);
|
|
10
14
|
ngOnInit(): void;
|
|
11
15
|
ngOnDestroy(): void;
|
|
12
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<DragoverNoChangeDetectDirective, never>;
|
|
13
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<DragoverNoChangeDetectDirective, "[dragoverNoChangeDetect]", never, {
|
|
17
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DragoverNoChangeDetectDirective, "[dragoverNoChangeDetect]", never, {}, { "dragoverNoChangeDetect": "dragoverNoChangeDetect"; }, never, never, true>;
|
|
14
18
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TreeBranch, TreeRoot } from "../core";
|
|
2
|
-
import { ComponentObj } from "./legacy-component-obj.interface";
|
|
1
|
+
import type { TreeBranch, TreeRoot } from "../core";
|
|
2
|
+
import type { ComponentObj } from "./legacy-component-obj.interface";
|
|
3
3
|
/**
|
|
4
4
|
* A group of settings for changing the functionality of the tree
|
|
5
5
|
* @deprecated
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ViewContainerRef } from "@angular/core";
|
|
2
|
-
import { TreeRoot, TreeOptions } from "../core";
|
|
3
|
-
import { LimbleTreeOptions as LegacyLimbleTreeOptions } from "./legacy-tree-options.interface";
|
|
4
|
-
import { LimbleTreeData } from "./legacy-tree-data.interface";
|
|
1
|
+
import type { ViewContainerRef } from "@angular/core";
|
|
2
|
+
import { TreeRoot, type TreeOptions } from "../core";
|
|
3
|
+
import type { LimbleTreeOptions as LegacyLimbleTreeOptions } from "./legacy-tree-options.interface";
|
|
4
|
+
import type { LimbleTreeData } from "./legacy-tree-data.interface";
|
|
5
5
|
/**
|
|
6
6
|
* A shim to help with the transition from v0 to v1.
|
|
7
7
|
* @deprecated
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AfterViewInit, EventEmitter, OnChanges, OnDestroy, ViewContainerRef } from "@angular/core";
|
|
2
|
-
import { LimbleTreeData } from "../legacy-tree-data.interface";
|
|
3
|
-
import { LimbleTreeOptions } from "../legacy-tree-options.interface";
|
|
4
|
-
import { TreeRoot } from "../../core";
|
|
1
|
+
import { type AfterViewInit, EventEmitter, type OnChanges, type OnDestroy, ViewContainerRef } from "@angular/core";
|
|
2
|
+
import type { LimbleTreeData } from "../legacy-tree-data.interface";
|
|
3
|
+
import type { LimbleTreeOptions } from "../legacy-tree-options.interface";
|
|
4
|
+
import type { TreeRoot } from "../../core";
|
|
5
5
|
import { DragEndEvent } from "../../events";
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
/** @deprecated */
|
|
@@ -2,6 +2,10 @@ import * as i0 from "@angular/core";
|
|
|
2
2
|
import * as i1 from "./legacy/limble-tree-legacy.module";
|
|
3
3
|
import * as i2 from "./extras/collapse/collapse.module";
|
|
4
4
|
import * as i3 from "./extras/drag-and-drop/drag-and-drop.module";
|
|
5
|
+
/**
|
|
6
|
+
* Import this Angular module into your application to gain access to the
|
|
7
|
+
* components, directives, and services provided by Limble Tree.
|
|
8
|
+
*/
|
|
5
9
|
export declare class LimbleTreeModule {
|
|
6
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<LimbleTreeModule, never>;
|
|
7
11
|
static ɵmod: i0.ɵɵNgModuleDeclaration<LimbleTreeModule, never, [typeof i1.LimbleTreeLegacyModule, typeof i2.TreeCollapseModule, typeof i3.TreeDragAndDropModule], [typeof i1.LimbleTreeLegacyModule, typeof i2.TreeCollapseModule, typeof i3.TreeDragAndDropModule]>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ViewContainerRef, ViewRef } from "@angular/core";
|
|
2
|
+
export interface ComponentContainer<Component> {
|
|
3
|
+
detectChanges: () => void;
|
|
4
|
+
getBranchesContainer: () => ViewContainerRef | undefined;
|
|
5
|
+
getComponentInstance: () => Component;
|
|
6
|
+
getHostView: () => ViewRef;
|
|
7
|
+
getNativeElement: () => HTMLElement;
|
|
8
|
+
}
|
package/lib/structure/index.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
export * from "./branchable.interface";
|
|
2
|
-
export * from "./container
|
|
3
|
-
export * from "./content-container.interface";
|
|
4
|
-
export * from "./event-conduit.interface";
|
|
2
|
+
export * from "./component-container.interface";
|
|
5
3
|
export * from "./graftable.interface";
|
|
6
4
|
export * from "./tree-branch-node.interface";
|
|
7
5
|
export * from "./tree-event.interface";
|
|
8
6
|
export * from "./tree-node.interface";
|
|
9
7
|
export * from "./tree-plot";
|
|
10
8
|
export * from "./tree-relationship.interface";
|
|
11
|
-
export * from "./tree-root.node.interface";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Graftable } from "./graftable.interface";
|
|
2
|
-
import {
|
|
3
|
-
export declare type TreeBranchNode<Contents, Children, ParentContents> =
|
|
1
|
+
import type { Graftable } from "./graftable.interface";
|
|
2
|
+
import type { TreeNode } from "./tree-node.interface";
|
|
3
|
+
export declare type TreeBranchNode<Contents, Children, ParentContents> = TreeNode<Children, Contents> & Graftable<TreeNode<Children, ParentContents>> & {
|
|
4
4
|
position: () => Array<number>;
|
|
5
5
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { TreeNode } from "./tree-node.interface";
|
|
2
|
+
/** An event emitted by a node in the tree */
|
|
2
3
|
export interface TreeEvent {
|
|
3
|
-
|
|
4
|
-
source: () => EventConduit;
|
|
4
|
+
source: () => TreeNode<unknown, unknown>;
|
|
5
5
|
}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { Branchable } from "./branchable.interface";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import type { Branchable } from "./branchable.interface";
|
|
2
|
+
import type { TreePlot } from "./tree-plot";
|
|
3
|
+
import type { TreeRoot } from "../core";
|
|
4
|
+
import type { ComponentContainer } from "./component-container.interface";
|
|
5
|
+
import type { Observable } from "rxjs";
|
|
6
|
+
import type { TreeEvent } from "./tree-event.interface";
|
|
7
|
+
export interface TreeNode<Children, Component> extends Branchable<Children>, ComponentContainer<Component> {
|
|
8
|
+
dispatch: (event: TreeEvent) => void;
|
|
9
|
+
events: () => Observable<TreeEvent>;
|
|
10
|
+
isDestroyed: () => boolean;
|
|
6
11
|
plot: () => TreePlot;
|
|
7
|
-
traverse: (callback: (node: Branchable<Children>) => void) => void;
|
|
8
12
|
root: () => TreeRoot<any> | undefined;
|
|
13
|
+
traverse: (callback: (node: Branchable<Children>) => void) => void;
|
|
9
14
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Branchable } from "./branchable.interface";
|
|
2
|
-
import { Graftable } from "./graftable.interface";
|
|
1
|
+
import type { Branchable } from "./branchable.interface";
|
|
2
|
+
import type { Graftable } from "./graftable.interface";
|
|
3
3
|
export interface TreeRelationship<Parent extends Branchable<Child>, Child extends Graftable<Parent>> {
|
|
4
4
|
parent: Parent;
|
|
5
5
|
child: Child;
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udGFpbmVyLXRyZWUtbm9kZS5pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9saW1ibGUtdHJlZS9zcmMvbGliL3N0cnVjdHVyZS9jb250YWluZXItdHJlZS1ub2RlLmludGVyZmFjZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQ29udGVudENvbnRhaW5lciB9IGZyb20gXCIuL2NvbnRlbnQtY29udGFpbmVyLmludGVyZmFjZVwiO1xuaW1wb3J0IHsgVHJlZU5vZGUgfSBmcm9tIFwiLi90cmVlLW5vZGUuaW50ZXJmYWNlXCI7XG5cbmV4cG9ydCB0eXBlIENvbnRhaW5lclRyZWVOb2RlPENvbnRlbnRzLCBDaGlsZHJlbj4gPSBUcmVlTm9kZTxDaGlsZHJlbj4gJlxuICAgQ29udGVudENvbnRhaW5lcjxDb250ZW50cz47XG4iXX0=
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udGVudC1jb250YWluZXIuaW50ZXJmYWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbGltYmxlLXRyZWUvc3JjL2xpYi9zdHJ1Y3R1cmUvY29udGVudC1jb250YWluZXIuaW50ZXJmYWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIENvbnRlbnRDb250YWluZXI8Q29udGVudHM+IHtcbiAgIGdldENvbnRlbnRzOiAoKSA9PiBDb250ZW50cztcbn1cbiJdfQ==
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXZlbnQtY29uZHVpdC5pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9saW1ibGUtdHJlZS9zcmMvbGliL3N0cnVjdHVyZS9ldmVudC1jb25kdWl0LmludGVyZmFjZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgT2JzZXJ2YWJsZSB9IGZyb20gXCJyeGpzXCI7XG5pbXBvcnQgeyBUcmVlRXZlbnQgfSBmcm9tIFwiLi90cmVlLWV2ZW50LmludGVyZmFjZVwiO1xuXG5leHBvcnQgaW50ZXJmYWNlIEV2ZW50Q29uZHVpdCB7XG4gICBkaXNwYXRjaDogKGV2ZW50OiBUcmVlRXZlbnQpID0+IHZvaWQ7XG4gICBldmVudHM6ICgpID0+IE9ic2VydmFibGU8VHJlZUV2ZW50Pjtcbn1cbiJdfQ==
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJlZS1yb290Lm5vZGUuaW50ZXJmYWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbGltYmxlLXRyZWUvc3JjL2xpYi9zdHJ1Y3R1cmUvdHJlZS1yb290Lm5vZGUuaW50ZXJmYWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBDb250YWluZXJUcmVlTm9kZSB9IGZyb20gXCIuL2NvbnRhaW5lci10cmVlLW5vZGUuaW50ZXJmYWNlXCI7XG5cbmV4cG9ydCB0eXBlIFRyZWVSb290Tm9kZTxDb250ZW50cywgQ2hpbGRyZW4+ID0gQ29udGFpbmVyVHJlZU5vZGU8XG4gICBDb250ZW50cyxcbiAgIENoaWxkcmVuXG4+O1xuIl19
|