-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
113 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
export enum FoldingType { | ||
Expanded, | ||
Collapsed, | ||
Leaf | ||
} | ||
|
||
export type FoldingTypeCssClass = 'node-expanded' | 'node-collapsed' | 'node-leaf'; | ||
|
||
export interface TreeEvent { | ||
node: TreeModel | ||
} | ||
|
||
export interface TreeModel { | ||
value: string; | ||
children?: Array<TreeModel>; | ||
status?: TreeStatus, | ||
foldingType?: FoldingType, | ||
indexInParent?: number | ||
} | ||
|
||
export enum TreeStatus { | ||
New, | ||
Modified, | ||
EditInProgress | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import {TreeModel} from '../branchy.types'; | ||
import {ElementRef} from '@angular/core'; | ||
|
||
export class CapturedNode { | ||
constructor(private anElement: ElementRef, | ||
private aTree: TreeModel) { | ||
} | ||
|
||
public canBeDroppedAt(element: ElementRef): boolean { | ||
return !this.sameAs(element) && !this.contains(element); | ||
} | ||
|
||
public contains(other: ElementRef): boolean { | ||
return this.element.nativeElement.contains(other.nativeElement) | ||
} | ||
|
||
public sameAs(other: ElementRef): boolean { | ||
return this.element === other; | ||
} | ||
|
||
get element(): ElementRef { | ||
return this.anElement; | ||
} | ||
|
||
get tree(): TreeModel { | ||
return this.aTree; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {ElementRef} from '@angular/core'; | ||
import {CapturedNode} from './captured-node'; | ||
|
||
export enum NodeDraggableEventAction { | ||
Remove | ||
} | ||
|
||
export interface NodeDraggableEvent { | ||
captured: CapturedNode; | ||
target: ElementRef; | ||
action?: NodeDraggableEventAction; | ||
} |
4 changes: 3 additions & 1 deletion
4
src/node-draggable.directive.ts → src/draggable/node-draggable.directive.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/node-draggable.service.ts → src/draggable/node-draggable.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export type NodeEditableEventType = 'blur' | 'keyup'; | ||
|
||
export interface NodeEditableEvent { | ||
value: string, | ||
type: NodeEditableEventType | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
export enum MouseButtons { | ||
Left = 1, | ||
} | ||
|
||
export enum NodeMenuItemAction { | ||
NewFolder, | ||
NewTag, | ||
Rename, | ||
Remove | ||
} | ||
|
||
export enum NodeMenuAction { | ||
Close | ||
} | ||
|
||
export interface NodeMenuEvent { | ||
sender: HTMLElement; | ||
action: NodeMenuAction; | ||
} | ||
|
||
export interface NodeMenuItemSelectedEvent { | ||
nodeMenuItemAction: NodeMenuItemAction | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.