From ef3191132c6a844fe2998927dceea6894c6b4d63 Mon Sep 17 00:00:00 2001 From: Zicrael <13ccdd@gmail.com> Date: Mon, 26 Mar 2018 18:02:50 +0300 Subject: [PATCH] fix issues #1-2 add v 1.2.2 --- README.MD | 33 +++++- dist/README.MD | 33 +++++- dist/index.js | 125 ++++++++++++++++++---- dist/ngx-tree-dnd-children.component.d.ts | 6 +- dist/ngx-tree-dnd.component.d.ts | 1 + dist/ngx-tree-dnd.metadata.json | 2 +- dist/ngx-tree-dnd.service.d.ts | 4 + dist/ngx-tree-dnd.umd.js | 125 ++++++++++++++++++---- dist/package.json | 2 +- dist/styles-tree-dnd.css | 19 ++-- dist/tree-view.model.d.ts | 27 +++-- src/ngx-tree-dnd-children.component.ts | 68 +++++++++--- src/ngx-tree-dnd.component.ts | 10 +- src/ngx-tree-dnd.service.ts | 28 ++--- src/package.json | 2 +- src/styles-tree-dnd.css | 19 ++-- src/tree-view.model.ts | 28 +++-- tslint.json | 4 +- 18 files changed, 411 insertions(+), 125 deletions(-) diff --git a/README.MD b/README.MD index c9a1d99..10eb759 100644 --- a/README.MD +++ b/README.MD @@ -90,14 +90,19 @@ The interface accepts only the following structure: ```typescript export interface TreeModel { - name: string; - id: number; - options?: {}; - childrens: TreeModel[]; + name: string; // name of item + id: number; // id of item + options?: TreeItemOptions; // options of item + childrens: TreeModel[]; // childrens list +} +export interface TreeItemOptions { + href?: string; // href for tag if enable setTreeItemAsLinks on config + isHidden?: boolean; // hide childrens + currentlyDragging?: boolean; // enable only where element is drugging. } ``` -#### Example +#### example in you template file: @@ -146,6 +151,23 @@ in you component file: } ``` +### ondragend() +Trigger end of drag event +#### example + +in you template file: + +```xml + +``` +in you component file: + +```typescript + onDragEnd(event) { + console.log(event); + } +``` + ### onallowdrop() Trigger start of dragging element @@ -260,6 +282,7 @@ in you component file: showDeleteButton: true, // enable / disable delete item button. setErrorValidationText: "I can be change", // set error validate text. setMinValidationCountChars: 3 // Set count of name min chars on tree. + setTreeItemAsLinks: true // set name of items as and set link from item.options.href . } ``` diff --git a/dist/README.MD b/dist/README.MD index c9a1d99..10eb759 100644 --- a/dist/README.MD +++ b/dist/README.MD @@ -90,14 +90,19 @@ The interface accepts only the following structure: ```typescript export interface TreeModel { - name: string; - id: number; - options?: {}; - childrens: TreeModel[]; + name: string; // name of item + id: number; // id of item + options?: TreeItemOptions; // options of item + childrens: TreeModel[]; // childrens list +} +export interface TreeItemOptions { + href?: string; // href for tag if enable setTreeItemAsLinks on config + isHidden?: boolean; // hide childrens + currentlyDragging?: boolean; // enable only where element is drugging. } ``` -#### Example +#### example in you template file: @@ -146,6 +151,23 @@ in you component file: } ``` +### ondragend() +Trigger end of drag event +#### example + +in you template file: + +```xml + +``` +in you component file: + +```typescript + onDragEnd(event) { + console.log(event); + } +``` + ### onallowdrop() Trigger start of dragging element @@ -260,6 +282,7 @@ in you component file: showDeleteButton: true, // enable / disable delete item button. setErrorValidationText: "I can be change", // set error validate text. setMinValidationCountChars: 3 // Set count of name min chars on tree. + setTreeItemAsLinks: true // set name of items as and set link from item.options.href . } ``` diff --git a/dist/index.js b/dist/index.js index 002a593..d9a96c5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -16,10 +16,12 @@ var NgxTreeService = (function () { this.onDragStart = new Subject$1(); this.onDrop = new Subject$1(); this.onAllowDrop = new Subject$1(); + this.onDragEnd = new Subject$1(); this.onAddItem = new Subject$1(); this.onRenameItem = new Subject$1(); this.onRemoveItem = new Subject$1(); this._config = new BehaviorSubject$1(null); + this.globalPositionCounter = 0; } /** * @param {?} item @@ -153,6 +155,16 @@ var NgxTreeService = (function () { this.onRenameItem.next(eventEmit); this.clearAction(); }; + /** + * @return {?} + */ + NgxTreeService.prototype.startDragging = /** + * @return {?} + */ + function () { + this.elementFinder(this.treeStorage, this.isDragging.id); + this.selectedElement.options.currentlyDragging = true; + }; /** * @param {?} el * @param {?} to @@ -165,30 +177,32 @@ var NgxTreeService = (function () { */ function (el, to) { if (el !== to) { - if (el.childrens.length > 0) { - this.elementFinder(el.childrens, to.id); - if (this.selectedElement.id !== to.id) { - this.deleteItem(el.id); - this.elementFinder(this.treeStorage, to.id); - this.selectedElement.childrens.push(el); - this.clearAction(); - } - else { - return false; - } - } - else { - this.deleteItem(el.id); - this.elementFinder(this.treeStorage, to.id); - this.selectedElement.childrens.push(el); - this.clearAction(); - } + el.options.currentlyDragging = false; + this.deleteItem(el.id); + this.elementFinder(this.treeStorage, to.id); + this.selectedElement.childrens.push(el); + this.clearAction(); } else { this.clearAction(); + el.options.currentlyDragging = false; return false; } }; + /** + * @param {?} el + * @return {?} + */ + NgxTreeService.prototype.dragEndAction = /** + * @param {?} el + * @return {?} + */ + function (el) { + if (el) { + el.options.currentlyDragging = false; + } + return false; + }; /** * @param {?} el * @return {?} @@ -198,6 +212,7 @@ var NgxTreeService = (function () { * @return {?} */ function (el) { + el.options.currentlyDragging = false; this.deleteItem(el.id); this.treeStorage.push(el); this.clearAction(); @@ -230,9 +245,9 @@ var NgxTreeChildrenComponent = (function () { this.treeService = treeService; this.fb = fb; this.type = 'children'; - this.isHidden = false; this.treeService._config.subscribe(function (config) { _this._config = config; + _this.isDragable = _this._config.enableDragging; _this.createForm(); }); } @@ -242,12 +257,52 @@ var NgxTreeChildrenComponent = (function () { * @return {?} */ function (item) { + this.itemOptions = { + href: '#', + isHidden: false, + currentlyDragging: false + }; + if (item.options) { + this.setOptions(item.options); + item.options = this.itemOptions; + } + else { + item.options = this.itemOptions; + } this._item = item; + this.isHidden = this._item.options.isHidden; this.checkFloatItem(); }, enumerable: true, configurable: true }); + /** + * @param {?} options + * @return {?} + */ + NgxTreeChildrenComponent.prototype.setOptions = /** + * @param {?} options + * @return {?} + */ + function (options) { + for (var _i = 0, _a = Object.keys(options); _i < _a.length; _i++) { + var key = _a[_i]; + this.setValue(key, options); + } + }; + /** + * @param {?} item + * @param {?} options + * @return {?} + */ + NgxTreeChildrenComponent.prototype.setValue = /** + * @param {?} item + * @param {?} options + * @return {?} + */ + function (item, options) { + this.itemOptions[item] = options[item]; + }; /** * @return {?} */ @@ -294,6 +349,7 @@ var NgxTreeChildrenComponent = (function () { target: item }; event.stopPropagation(); + this.treeService.startDragging(); this.treeService.onDragStart.next(eventObj); // const allowed = document.getElementsByClassName('tree-title'); // const arr = Array.prototype.slice.call( allowed ); @@ -302,6 +358,25 @@ var NgxTreeChildrenComponent = (function () { // i.style.border = '1px dashed grey'; // } }; + /** + * @param {?} event + * @param {?} item + * @return {?} + */ + NgxTreeChildrenComponent.prototype.onDragEnd = /** + * @param {?} event + * @param {?} item + * @return {?} + */ + function (event, item) { + var /** @type {?} */ dragItem = this.treeService.isDragging; + this.treeService.dragEndAction(dragItem); + var /** @type {?} */ eventObj = { + event: event, + target: item + }; + this.treeService.onDragEnd.next(eventObj); + }; /** * @param {?} event * @param {?} item @@ -362,7 +437,6 @@ var NgxTreeChildrenComponent = (function () { this.showError = false; this.treeService.renameItem(this.renameForm.value.name, item.id); this.isEdit = false; - console.log(); } else { this.showError = true; @@ -398,7 +472,7 @@ var NgxTreeChildrenComponent = (function () { NgxTreeChildrenComponent.decorators = [ { type: Component, args: [{ selector: 'ngx-tree-children', - template: "\n
\n
\n
\n
\n {{_item.name}}\n
\n \n \n \n
\n
\n \n
\n
\n \n
\n
\n \n \n
\n {{_config.setErrorValidationText}}\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n \n \n \n
\n
\n
\n\n " + template: "\n
\n
\n
\n \n \n
\n
\n \n
\n
\n \n \n
\n {{_config.setErrorValidationText}}\n
\n
\n
\n
\n
\n \n
\n
\n
0\">\n
\n \n
\n \n \n \n
\n
\n
\n
\n
\n\n " },] }, ]; /** @nocollapse */ @@ -430,11 +504,13 @@ var NgxTreeComponent = (function () { enableDragging: true, setRootTitle: 'Root', setErrorValidationText: 'Enter valid name', - setMinValidationCountChars: 1 + setMinValidationCountChars: 1, + setTreeItemAsLinks: false }; this.ondragstart = new EventEmitter(); this.ondrop = new EventEmitter(); this.onallowdrop = new EventEmitter(); + this.ondragend = new EventEmitter(); this.onadditem = new EventEmitter(); this.onrenameitem = new EventEmitter(); this.onremoveitem = new EventEmitter(); @@ -508,6 +584,9 @@ var NgxTreeComponent = (function () { this.treeService.onAllowDrop.subscribe(function (event) { _this.onallowdrop.emit(event); }); + this.treeService.onDragEnd.subscribe(function (event) { + _this.ondragend.emit(event); + }); this.treeService.onAddItem.subscribe(function (event) { _this.onadditem.emit(event); }); @@ -530,7 +609,6 @@ var NgxTreeComponent = (function () { var _this = this; this.treeService.getLocalData(userTree).subscribe(function (tree) { _this.treeView = tree; - console.log(_this.treeView); }, function (error) { console.log(error); }); @@ -613,6 +691,7 @@ var NgxTreeComponent = (function () { "ondragstart": [{ type: Output },], "ondrop": [{ type: Output },], "onallowdrop": [{ type: Output },], + "ondragend": [{ type: Output },], "onadditem": [{ type: Output },], "onrenameitem": [{ type: Output },], "onremoveitem": [{ type: Output },], diff --git a/dist/ngx-tree-dnd-children.component.d.ts b/dist/ngx-tree-dnd-children.component.d.ts index 2713076..10a8dd1 100644 --- a/dist/ngx-tree-dnd-children.component.d.ts +++ b/dist/ngx-tree-dnd-children.component.d.ts @@ -1,6 +1,6 @@ import { OnInit } from '@angular/core'; import { NgxTreeService } from './ngx-tree-dnd.service'; -import { TreeModel, TreeConfig } from './tree-view.model'; +import { TreeModel, TreeConfig, TreeItemOptions } from './tree-view.model'; import { FormGroup, FormBuilder } from '@angular/forms'; export declare class NgxTreeChildrenComponent implements OnInit { private treeService; @@ -13,11 +13,15 @@ export declare class NgxTreeChildrenComponent implements OnInit { isDragable: boolean; renameForm: FormGroup; _config: TreeConfig; + itemOptions: TreeItemOptions; item: TreeModel; constructor(treeService: NgxTreeService, fb: FormBuilder); + setOptions(options: any): void; + setValue(item: any, options: any): void; checkFloatItem(): void; createForm(): void; onDragStart(event: any, item: any): void; + onDragEnd(event: any, item: any): void; onDrop(event: any, item: any): void; allowDrop(event: any): void; submitAdd(name: any, type: any): void; diff --git a/dist/ngx-tree-dnd.component.d.ts b/dist/ngx-tree-dnd.component.d.ts index 5b4e09a..348773b 100644 --- a/dist/ngx-tree-dnd.component.d.ts +++ b/dist/ngx-tree-dnd.component.d.ts @@ -13,6 +13,7 @@ export declare class NgxTreeComponent implements OnInit { ondragstart: EventEmitter; ondrop: EventEmitter; onallowdrop: EventEmitter; + ondragend: EventEmitter; onadditem: EventEmitter; onrenameitem: EventEmitter; onremoveitem: EventEmitter; diff --git a/dist/ngx-tree-dnd.metadata.json b/dist/ngx-tree-dnd.metadata.json index 024010d..e11f238 100644 --- a/dist/ngx-tree-dnd.metadata.json +++ b/dist/ngx-tree-dnd.metadata.json @@ -1 +1 @@ -{"__symbolic":"module","version":4,"metadata":{"NgxTreeModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":15,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":17,"character":4},{"__symbolic":"reference","module":"@angular/forms","name":"ReactiveFormsModule","line":18,"character":4}],"declarations":[{"__symbolic":"reference","name":"NgxTreeComponent"},{"__symbolic":"reference","name":"ɵa"},{"__symbolic":"reference","name":"NgxTreeDirective"},{"__symbolic":"reference","name":"NgxTreePipe"}],"exports":[{"__symbolic":"reference","name":"NgxTreeComponent"},{"__symbolic":"reference","name":"ɵa"},{"__symbolic":"reference","name":"NgxTreeDirective"},{"__symbolic":"reference","name":"NgxTreePipe"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"NgxTreeModule"},"providers":[{"__symbolic":"reference","name":"NgxTreeService"},{"__symbolic":"reference","module":"@angular/forms","name":"FormBuilder","line":37,"character":34}]}}}},"NgxTreeComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":12,"character":1},"arguments":[{"selector":"ngx-tree-component","template":"\n
\n
\n {{_config.setRootTitle}}\n
\n
\n
\n \n
\n
\n\n
\n "}]}],"members":{"child":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":46,"character":3},"arguments":[{"__symbolic":"reference","name":"ɵa"}]}]}],"ondragstart":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":47,"character":3}}]}],"ondrop":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":48,"character":3}}]}],"onallowdrop":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":49,"character":3}}]}],"onadditem":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":50,"character":3}}]}],"onrenameitem":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":51,"character":3}}]}],"onremoveitem":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":52,"character":3}}]}],"config":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":53,"character":3}}]}],"treeData":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":57,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"NgxTreeService"},{"__symbolic":"reference","module":"@angular/forms","name":"FormBuilder","line":61,"character":62}]}],"setConfig":[{"__symbolic":"method"}],"setValue":[{"__symbolic":"method"}],"enableSubscribers":[{"__symbolic":"method"}],"getTreeData":[{"__symbolic":"method"}],"addRootItem":[{"__symbolic":"method"}],"onDrop":[{"__symbolic":"method"}],"onDragStart":[{"__symbolic":"method"}],"onDropChild":[{"__symbolic":"method"}],"ngOnInit":[{"__symbolic":"method"}]}},"NgxTreeDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":7,"character":1},"arguments":[{"selector":"[ngxTreeDirective]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":12,"character":26}]}]}},"NgxTreePipe":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Pipe","line":10,"character":1},"arguments":[{"name":"NgxTreePipe"}]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":13,"character":1}}],"members":{"transform":[{"__symbolic":"method"}]}},"NgxTreeService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":11,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"getLocalData":[{"__symbolic":"method"}],"elementFinder":[{"__symbolic":"method"}],"addNewItem":[{"__symbolic":"method"}],"deleteItem":[{"__symbolic":"method"}],"renameItem":[{"__symbolic":"method"}],"dropAction":[{"__symbolic":"method"}],"dropOnRoot":[{"__symbolic":"method"}],"clearAction":[{"__symbolic":"method"}]}},"ɵa":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":9,"character":1},"arguments":[{"selector":"ngx-tree-children","template":"\n
\n
\n
\n
\n {{_item.name}}\n
\n \n \n \n
\n
\n \n
\n
\n \n
\n
\n \n \n
\n {{_config.setErrorValidationText}}\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n \n \n \n
\n
\n
\n\n "}]}],"members":{"item":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":67,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"NgxTreeService"},{"__symbolic":"reference","module":"@angular/forms","name":"FormBuilder","line":72,"character":63}]}],"checkFloatItem":[{"__symbolic":"method"}],"createForm":[{"__symbolic":"method"}],"onDragStart":[{"__symbolic":"method"}],"onDrop":[{"__symbolic":"method"}],"allowDrop":[{"__symbolic":"method"}],"submitAdd":[{"__symbolic":"method"}],"submitRename":[{"__symbolic":"method"}],"onSubmitDelete":[{"__symbolic":"method"}],"ngOnInit":[{"__symbolic":"method"}]}}},"origins":{"NgxTreeModule":"./index","NgxTreeComponent":"./ngx-tree-dnd.component","NgxTreeDirective":"./ngx-tree-dnd.directive","NgxTreePipe":"./ngx-tree-dnd.pipe","NgxTreeService":"./ngx-tree-dnd.service","ɵa":"./ngx-tree-dnd-children.component"},"importAs":"ngx-tree-dnd"} \ No newline at end of file +{"__symbolic":"module","version":4,"metadata":{"NgxTreeModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":15,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":17,"character":4},{"__symbolic":"reference","module":"@angular/forms","name":"ReactiveFormsModule","line":18,"character":4}],"declarations":[{"__symbolic":"reference","name":"NgxTreeComponent"},{"__symbolic":"reference","name":"ɵa"},{"__symbolic":"reference","name":"NgxTreeDirective"},{"__symbolic":"reference","name":"NgxTreePipe"}],"exports":[{"__symbolic":"reference","name":"NgxTreeComponent"},{"__symbolic":"reference","name":"ɵa"},{"__symbolic":"reference","name":"NgxTreeDirective"},{"__symbolic":"reference","name":"NgxTreePipe"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"NgxTreeModule"},"providers":[{"__symbolic":"reference","name":"NgxTreeService"},{"__symbolic":"reference","module":"@angular/forms","name":"FormBuilder","line":37,"character":34}]}}}},"NgxTreeComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":12,"character":1},"arguments":[{"selector":"ngx-tree-component","template":"\n
\n
\n {{_config.setRootTitle}}\n
\n
\n
\n \n
\n
\n\n
\n "}]}],"members":{"child":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":47,"character":3},"arguments":[{"__symbolic":"reference","name":"ɵa"}]}]}],"ondragstart":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":48,"character":3}}]}],"ondrop":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":49,"character":3}}]}],"onallowdrop":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":50,"character":3}}]}],"ondragend":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":51,"character":3}}]}],"onadditem":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":52,"character":3}}]}],"onrenameitem":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":53,"character":3}}]}],"onremoveitem":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":54,"character":3}}]}],"config":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":55,"character":3}}]}],"treeData":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":59,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"NgxTreeService"},{"__symbolic":"reference","module":"@angular/forms","name":"FormBuilder","line":63,"character":62}]}],"setConfig":[{"__symbolic":"method"}],"setValue":[{"__symbolic":"method"}],"enableSubscribers":[{"__symbolic":"method"}],"getTreeData":[{"__symbolic":"method"}],"addRootItem":[{"__symbolic":"method"}],"onDrop":[{"__symbolic":"method"}],"onDragStart":[{"__symbolic":"method"}],"onDropChild":[{"__symbolic":"method"}],"ngOnInit":[{"__symbolic":"method"}]}},"NgxTreeDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":7,"character":1},"arguments":[{"selector":"[ngxTreeDirective]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":12,"character":26}]}]}},"NgxTreePipe":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Pipe","line":10,"character":1},"arguments":[{"name":"NgxTreePipe"}]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":13,"character":1}}],"members":{"transform":[{"__symbolic":"method"}]}},"NgxTreeService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":11,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"getLocalData":[{"__symbolic":"method"}],"elementFinder":[{"__symbolic":"method"}],"addNewItem":[{"__symbolic":"method"}],"deleteItem":[{"__symbolic":"method"}],"renameItem":[{"__symbolic":"method"}],"startDragging":[{"__symbolic":"method"}],"dropAction":[{"__symbolic":"method"}],"dragEndAction":[{"__symbolic":"method"}],"dropOnRoot":[{"__symbolic":"method"}],"clearAction":[{"__symbolic":"method"}]}},"ɵa":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":9,"character":1},"arguments":[{"selector":"ngx-tree-children","template":"\n
\n
\n
\n
\n
\n {{_item.name}}\n
\n \n \n \n
\n \n \n \n
\n
\n \n
\n
\n \n
\n
\n \n \n
\n {{_config.setErrorValidationText}}\n
\n
\n
\n
\n
\n \n
\n
\n
0\">\n
\n \n
\n \n \n \n
\n
\n
\n
\n
\n\n "}]}],"members":{"item":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":73,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"NgxTreeService"},{"__symbolic":"reference","module":"@angular/forms","name":"FormBuilder","line":90,"character":63}]}],"setOptions":[{"__symbolic":"method"}],"setValue":[{"__symbolic":"method"}],"checkFloatItem":[{"__symbolic":"method"}],"createForm":[{"__symbolic":"method"}],"onDragStart":[{"__symbolic":"method"}],"onDragEnd":[{"__symbolic":"method"}],"onDrop":[{"__symbolic":"method"}],"allowDrop":[{"__symbolic":"method"}],"submitAdd":[{"__symbolic":"method"}],"submitRename":[{"__symbolic":"method"}],"onSubmitDelete":[{"__symbolic":"method"}],"ngOnInit":[{"__symbolic":"method"}]}}},"origins":{"NgxTreeModule":"./index","NgxTreeComponent":"./ngx-tree-dnd.component","NgxTreeDirective":"./ngx-tree-dnd.directive","NgxTreePipe":"./ngx-tree-dnd.pipe","NgxTreeService":"./ngx-tree-dnd.service","ɵa":"./ngx-tree-dnd-children.component"},"importAs":"ngx-tree-dnd"} \ No newline at end of file diff --git a/dist/ngx-tree-dnd.service.d.ts b/dist/ngx-tree-dnd.service.d.ts index 0c009ad..ac9687d 100644 --- a/dist/ngx-tree-dnd.service.d.ts +++ b/dist/ngx-tree-dnd.service.d.ts @@ -8,9 +8,11 @@ export declare class NgxTreeService { listOfSelectedElement: TreeModel[]; selectedElement: TreeModel; isDragging: TreeModel; + globalPositionCounter: number; onDragStart: Subject; onDrop: Subject; onAllowDrop: Subject; + onDragEnd: Subject; onAddItem: Subject; onRenameItem: Subject; onRemoveItem: Subject; @@ -21,7 +23,9 @@ export declare class NgxTreeService { addNewItem(id: any, name: any, type: any, parent?: any): void; deleteItem(id: any): void; renameItem(name: any, id: any): void; + startDragging(): void; dropAction(el: any, to: any): boolean; + dragEndAction(el: any): boolean; dropOnRoot(el: any): void; clearAction(): void; } diff --git a/dist/ngx-tree-dnd.umd.js b/dist/ngx-tree-dnd.umd.js index c650c8d..79254c2 100644 --- a/dist/ngx-tree-dnd.umd.js +++ b/dist/ngx-tree-dnd.umd.js @@ -14,10 +14,12 @@ var NgxTreeService = (function () { this.onDragStart = new Subject.Subject(); this.onDrop = new Subject.Subject(); this.onAllowDrop = new Subject.Subject(); + this.onDragEnd = new Subject.Subject(); this.onAddItem = new Subject.Subject(); this.onRenameItem = new Subject.Subject(); this.onRemoveItem = new Subject.Subject(); this._config = new BehaviorSubject.BehaviorSubject(null); + this.globalPositionCounter = 0; } /** * @param {?} item @@ -151,6 +153,16 @@ var NgxTreeService = (function () { this.onRenameItem.next(eventEmit); this.clearAction(); }; + /** + * @return {?} + */ + NgxTreeService.prototype.startDragging = /** + * @return {?} + */ + function () { + this.elementFinder(this.treeStorage, this.isDragging.id); + this.selectedElement.options.currentlyDragging = true; + }; /** * @param {?} el * @param {?} to @@ -163,30 +175,32 @@ var NgxTreeService = (function () { */ function (el, to) { if (el !== to) { - if (el.childrens.length > 0) { - this.elementFinder(el.childrens, to.id); - if (this.selectedElement.id !== to.id) { - this.deleteItem(el.id); - this.elementFinder(this.treeStorage, to.id); - this.selectedElement.childrens.push(el); - this.clearAction(); - } - else { - return false; - } - } - else { - this.deleteItem(el.id); - this.elementFinder(this.treeStorage, to.id); - this.selectedElement.childrens.push(el); - this.clearAction(); - } + el.options.currentlyDragging = false; + this.deleteItem(el.id); + this.elementFinder(this.treeStorage, to.id); + this.selectedElement.childrens.push(el); + this.clearAction(); } else { this.clearAction(); + el.options.currentlyDragging = false; return false; } }; + /** + * @param {?} el + * @return {?} + */ + NgxTreeService.prototype.dragEndAction = /** + * @param {?} el + * @return {?} + */ + function (el) { + if (el) { + el.options.currentlyDragging = false; + } + return false; + }; /** * @param {?} el * @return {?} @@ -196,6 +210,7 @@ var NgxTreeService = (function () { * @return {?} */ function (el) { + el.options.currentlyDragging = false; this.deleteItem(el.id); this.treeStorage.push(el); this.clearAction(); @@ -228,9 +243,9 @@ var NgxTreeChildrenComponent = (function () { this.treeService = treeService; this.fb = fb; this.type = 'children'; - this.isHidden = false; this.treeService._config.subscribe(function (config) { _this._config = config; + _this.isDragable = _this._config.enableDragging; _this.createForm(); }); } @@ -240,12 +255,52 @@ var NgxTreeChildrenComponent = (function () { * @return {?} */ function (item) { + this.itemOptions = { + href: '#', + isHidden: false, + currentlyDragging: false + }; + if (item.options) { + this.setOptions(item.options); + item.options = this.itemOptions; + } + else { + item.options = this.itemOptions; + } this._item = item; + this.isHidden = this._item.options.isHidden; this.checkFloatItem(); }, enumerable: true, configurable: true }); + /** + * @param {?} options + * @return {?} + */ + NgxTreeChildrenComponent.prototype.setOptions = /** + * @param {?} options + * @return {?} + */ + function (options) { + for (var _i = 0, _a = Object.keys(options); _i < _a.length; _i++) { + var key = _a[_i]; + this.setValue(key, options); + } + }; + /** + * @param {?} item + * @param {?} options + * @return {?} + */ + NgxTreeChildrenComponent.prototype.setValue = /** + * @param {?} item + * @param {?} options + * @return {?} + */ + function (item, options) { + this.itemOptions[item] = options[item]; + }; /** * @return {?} */ @@ -292,6 +347,7 @@ var NgxTreeChildrenComponent = (function () { target: item }; event.stopPropagation(); + this.treeService.startDragging(); this.treeService.onDragStart.next(eventObj); // const allowed = document.getElementsByClassName('tree-title'); // const arr = Array.prototype.slice.call( allowed ); @@ -300,6 +356,25 @@ var NgxTreeChildrenComponent = (function () { // i.style.border = '1px dashed grey'; // } }; + /** + * @param {?} event + * @param {?} item + * @return {?} + */ + NgxTreeChildrenComponent.prototype.onDragEnd = /** + * @param {?} event + * @param {?} item + * @return {?} + */ + function (event, item) { + var /** @type {?} */ dragItem = this.treeService.isDragging; + this.treeService.dragEndAction(dragItem); + var /** @type {?} */ eventObj = { + event: event, + target: item + }; + this.treeService.onDragEnd.next(eventObj); + }; /** * @param {?} event * @param {?} item @@ -360,7 +435,6 @@ var NgxTreeChildrenComponent = (function () { this.showError = false; this.treeService.renameItem(this.renameForm.value.name, item.id); this.isEdit = false; - console.log(); } else { this.showError = true; @@ -396,7 +470,7 @@ var NgxTreeChildrenComponent = (function () { NgxTreeChildrenComponent.decorators = [ { type: core.Component, args: [{ selector: 'ngx-tree-children', - template: "\n
\n
\n
\n
\n {{_item.name}}\n
\n \n \n \n
\n
\n \n
\n
\n \n
\n
\n \n \n
\n {{_config.setErrorValidationText}}\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n \n \n \n
\n
\n
\n\n " + template: "\n
\n
\n
\n
\n
\n {{_item.name}}\n
\n \n \n \n
\n \n \n \n
\n
\n \n
\n
\n \n
\n
\n \n \n
\n {{_config.setErrorValidationText}}\n
\n
\n
\n
\n
\n \n
\n
\n
0\">\n
\n \n
\n \n \n \n
\n
\n
\n
\n
\n\n " },] }, ]; /** @nocollapse */ @@ -428,11 +502,13 @@ var NgxTreeComponent = (function () { enableDragging: true, setRootTitle: 'Root', setErrorValidationText: 'Enter valid name', - setMinValidationCountChars: 1 + setMinValidationCountChars: 1, + setTreeItemAsLinks: false }; this.ondragstart = new core.EventEmitter(); this.ondrop = new core.EventEmitter(); this.onallowdrop = new core.EventEmitter(); + this.ondragend = new core.EventEmitter(); this.onadditem = new core.EventEmitter(); this.onrenameitem = new core.EventEmitter(); this.onremoveitem = new core.EventEmitter(); @@ -506,6 +582,9 @@ var NgxTreeComponent = (function () { this.treeService.onAllowDrop.subscribe(function (event) { _this.onallowdrop.emit(event); }); + this.treeService.onDragEnd.subscribe(function (event) { + _this.ondragend.emit(event); + }); this.treeService.onAddItem.subscribe(function (event) { _this.onadditem.emit(event); }); @@ -528,7 +607,6 @@ var NgxTreeComponent = (function () { var _this = this; this.treeService.getLocalData(userTree).subscribe(function (tree) { _this.treeView = tree; - console.log(_this.treeView); }, function (error) { console.log(error); }); @@ -611,6 +689,7 @@ var NgxTreeComponent = (function () { "ondragstart": [{ type: core.Output },], "ondrop": [{ type: core.Output },], "onallowdrop": [{ type: core.Output },], + "ondragend": [{ type: core.Output },], "onadditem": [{ type: core.Output },], "onrenameitem": [{ type: core.Output },], "onremoveitem": [{ type: core.Output },], diff --git a/dist/package.json b/dist/package.json index efe9d50..29cd8dd 100644 --- a/dist/package.json +++ b/dist/package.json @@ -1,6 +1,6 @@ { "name": "ngx-tree-dnd", - "version": "1.1.0", + "version": "1.2.2", "repository": { "type": "git", "url": "https://github.com/Zicrael/ngx-tree-dnd" diff --git a/dist/styles-tree-dnd.css b/dist/styles-tree-dnd.css index 0f40bd3..c88e242 100644 --- a/dist/styles-tree-dnd.css +++ b/dist/styles-tree-dnd.css @@ -3,12 +3,15 @@ This project is licensed under the terms of the MIT license. https://github.com/Zicrael/ngx-tree-dnd */ - .tree-title { + +.tree-child { + user-select: none; +} +.tree-title { position: relative; padding-left: 11px; align-items: center; margin-bottom: 5px; - user-select: none; } .d-flex { display: flex; @@ -31,7 +34,6 @@ align-items: center; content: ''; } - .btn-add-small, .btn-remove-small, .btn-edit-small, .btn-accept-edit-small, .btn-hide-small, .btn-show-small { display: flex; position: relative; @@ -47,7 +49,6 @@ cursor: pointer; padding: 0; } - .btn-hide-small, .btn-show-small { background-color: #DCDCDC; outline-color: #DCDCDC; @@ -147,6 +148,12 @@ .pos-relative { position: relative; } -.inOpacity { - opacity: 0; +.blockThis { + display: flex; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(255,255,255,0.5); } \ No newline at end of file diff --git a/dist/tree-view.model.d.ts b/dist/tree-view.model.d.ts index ca9e5ec..3e0e879 100644 --- a/dist/tree-view.model.d.ts +++ b/dist/tree-view.model.d.ts @@ -1,17 +1,24 @@ export interface TreeModel { name: string; id: number; + options?: TreeItemOptions; childrens: TreeModel[]; } +export interface TreeItemOptions { + href?: string; + isHidden?: boolean; + currentlyDragging?: boolean; +} export interface TreeConfig { - showAddRootBtn: boolean; - showItemActionBtns: boolean; - showAddItemButton: boolean; - showRenameButton: boolean; - showDeleteButton: boolean; - enableShowHideBtns: boolean; - enableDragging: boolean; - setRootTitle: string; - setErrorValidationText: string; - setMinValidationCountChars: number; + showAddRootBtn?: boolean; + showItemActionBtns?: boolean; + showAddItemButton?: boolean; + showRenameButton?: boolean; + showDeleteButton?: boolean; + enableShowHideBtns?: boolean; + enableDragging?: boolean; + setRootTitle?: string; + setErrorValidationText?: string; + setMinValidationCountChars?: number; + setTreeItemAsLinks?: boolean; } diff --git a/src/ngx-tree-dnd-children.component.ts b/src/ngx-tree-dnd-children.component.ts index 349ec9a..931e2a4 100644 --- a/src/ngx-tree-dnd-children.component.ts +++ b/src/ngx-tree-dnd-children.component.ts @@ -5,24 +5,27 @@ */ import { Component, OnInit, Input, ViewChild, Output } from '@angular/core'; import { NgxTreeService } from './ngx-tree-dnd.service'; -import { TreeModel, TreeConfig } from './tree-view.model'; +import { TreeModel, TreeConfig, TreeItemOptions } from './tree-view.model'; import { FormControl, FormGroup, FormBuilder, Validators } from '@angular/forms'; @Component({ selector: 'ngx-tree-children', template: ` -
+
-
-
- {{_item.name}} +
+
+
+ {{_item.name}} +
+ + +
- - - + + +
@@ -39,11 +42,11 @@ import { FormControl, FormGroup, FormBuilder, Validators } from '@angular/forms'
-
+
-
+
@@ -51,6 +54,8 @@ import { FormControl, FormGroup, FormBuilder, Validators } from '@angular/forms'
+
+
@@ -65,22 +70,42 @@ export class NgxTreeChildrenComponent implements OnInit { isDragable: boolean; renameForm: FormGroup; _config: TreeConfig; + itemOptions: TreeItemOptions; @Input() set item(item: TreeModel) { + this.itemOptions = { + href: '#', + isHidden: false, + currentlyDragging: false + }; + if (item.options) { + this.setOptions(item.options); + item.options = this.itemOptions; + } else { + item.options = this.itemOptions; + } this._item = item; + this.isHidden = this._item.options.isHidden; this.checkFloatItem(); } constructor(private treeService: NgxTreeService, private fb: FormBuilder) { this.type = 'children'; - this.isHidden = false; this.treeService._config.subscribe( (config) => { this._config = config; + this.isDragable = this._config.enableDragging; this.createForm(); } ); } - + setOptions(options) { + for (const key of Object.keys(options)) { + this.setValue(key, options); + } + } + setValue(item, options) { + this.itemOptions[item] = options[item]; + } checkFloatItem() { if (this._item.name === null) { this.isEdit = true; @@ -105,6 +130,7 @@ export class NgxTreeChildrenComponent implements OnInit { target: item }; event.stopPropagation(); + this.treeService.startDragging(); this.treeService.onDragStart.next(eventObj); // const allowed = document.getElementsByClassName('tree-title'); // const arr = Array.prototype.slice.call( allowed ); @@ -113,6 +139,15 @@ export class NgxTreeChildrenComponent implements OnInit { // i.style.border = '1px dashed grey'; // } } + onDragEnd(event, item) { + const dragItem = this.treeService.isDragging; + this.treeService.dragEndAction(dragItem); + const eventObj = { + event, + target: item + }; + this.treeService.onDragEnd.next(eventObj); + } onDrop(event, item) { const dragItem = this.treeService.isDragging; this.treeService.dropAction(dragItem, item); @@ -137,7 +172,6 @@ export class NgxTreeChildrenComponent implements OnInit { this.showError = false; this.treeService.renameItem(this.renameForm.value.name, item.id); this.isEdit = false; - console.log(); } else { this.showError = true; } diff --git a/src/ngx-tree-dnd.component.ts b/src/ngx-tree-dnd.component.ts index cbd53b5..97c8a08 100644 --- a/src/ngx-tree-dnd.component.ts +++ b/src/ngx-tree-dnd.component.ts @@ -42,12 +42,14 @@ export class NgxTreeComponent implements OnInit { enableDragging: true, setRootTitle: 'Root', setErrorValidationText: 'Enter valid name', - setMinValidationCountChars: 1 + setMinValidationCountChars: 1, + setTreeItemAsLinks: false }; @ViewChild(NgxTreeChildrenComponent) child: NgxTreeChildrenComponent; @Output() ondragstart: EventEmitter = new EventEmitter(); @Output() ondrop: EventEmitter = new EventEmitter(); @Output() onallowdrop: EventEmitter = new EventEmitter(); + @Output() ondragend: EventEmitter = new EventEmitter(); @Output() onadditem: EventEmitter = new EventEmitter(); @Output() onrenameitem: EventEmitter = new EventEmitter(); @Output() onremoveitem: EventEmitter = new EventEmitter(); @@ -88,6 +90,11 @@ export class NgxTreeComponent implements OnInit { this.onallowdrop.emit(event); } ); + this.treeService.onDragEnd.subscribe( + (event) => { + this.ondragend.emit(event); + } + ); this.treeService.onAddItem.subscribe( (event) => { this.onadditem.emit(event); @@ -109,7 +116,6 @@ export class NgxTreeComponent implements OnInit { this.treeService.getLocalData(userTree).subscribe( (tree: TreeModel) => { this.treeView = tree; - console.log(this.treeView); }, (error) => { console.log(error); } diff --git a/src/ngx-tree-dnd.service.ts b/src/ngx-tree-dnd.service.ts index 4880209..7afe399 100644 --- a/src/ngx-tree-dnd.service.ts +++ b/src/ngx-tree-dnd.service.ts @@ -15,14 +15,17 @@ export class NgxTreeService { listOfSelectedElement: TreeModel[]; selectedElement: TreeModel; isDragging: TreeModel; + globalPositionCounter: number; onDragStart = new Subject(); onDrop = new Subject(); onAllowDrop = new Subject(); + onDragEnd = new Subject(); onAddItem = new Subject(); onRenameItem = new Subject(); onRemoveItem = new Subject(); _config = new BehaviorSubject(null); constructor() { + this.globalPositionCounter = 0; } getLocalData(item) { const data = new Observable(observer => { @@ -101,30 +104,31 @@ export class NgxTreeService { this.onRenameItem.next(eventEmit); this.clearAction(); } + startDragging () { + this.elementFinder(this.treeStorage, this.isDragging.id); + this.selectedElement.options.currentlyDragging = true; + } dropAction(el, to) { if (el !== to) { - if (el.childrens.length > 0) { - this.elementFinder(el.childrens, to.id); - if (this.selectedElement.id !== to.id) { - this.deleteItem(el.id); - this.elementFinder(this.treeStorage, to.id); - this.selectedElement.childrens.push(el); - this.clearAction(); - } else { - return false; - } - } else { + el.options.currentlyDragging = false; this.deleteItem(el.id); this.elementFinder(this.treeStorage, to.id); this.selectedElement.childrens.push(el); this.clearAction(); - } } else { this.clearAction(); + el.options.currentlyDragging = false; return false; } } + dragEndAction(el) { + if ( el ) { + el.options.currentlyDragging = false; + } + return false; + } dropOnRoot(el) { + el.options.currentlyDragging = false; this.deleteItem(el.id); this.treeStorage.push(el); this.clearAction(); diff --git a/src/package.json b/src/package.json index efe9d50..29cd8dd 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "ngx-tree-dnd", - "version": "1.1.0", + "version": "1.2.2", "repository": { "type": "git", "url": "https://github.com/Zicrael/ngx-tree-dnd" diff --git a/src/styles-tree-dnd.css b/src/styles-tree-dnd.css index 0f40bd3..c88e242 100644 --- a/src/styles-tree-dnd.css +++ b/src/styles-tree-dnd.css @@ -3,12 +3,15 @@ This project is licensed under the terms of the MIT license. https://github.com/Zicrael/ngx-tree-dnd */ - .tree-title { + +.tree-child { + user-select: none; +} +.tree-title { position: relative; padding-left: 11px; align-items: center; margin-bottom: 5px; - user-select: none; } .d-flex { display: flex; @@ -31,7 +34,6 @@ align-items: center; content: ''; } - .btn-add-small, .btn-remove-small, .btn-edit-small, .btn-accept-edit-small, .btn-hide-small, .btn-show-small { display: flex; position: relative; @@ -47,7 +49,6 @@ cursor: pointer; padding: 0; } - .btn-hide-small, .btn-show-small { background-color: #DCDCDC; outline-color: #DCDCDC; @@ -147,6 +148,12 @@ .pos-relative { position: relative; } -.inOpacity { - opacity: 0; +.blockThis { + display: flex; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(255,255,255,0.5); } \ No newline at end of file diff --git a/src/tree-view.model.ts b/src/tree-view.model.ts index f7574f7..bbeb41a 100644 --- a/src/tree-view.model.ts +++ b/src/tree-view.model.ts @@ -6,17 +6,25 @@ export interface TreeModel { name: string; id: number; + options?: TreeItemOptions; childrens: TreeModel[]; } + +export interface TreeItemOptions { + href?: string; + isHidden?: boolean; + currentlyDragging?: boolean; +} export interface TreeConfig { - showAddRootBtn: boolean; - showItemActionBtns: boolean; - showAddItemButton: boolean; - showRenameButton: boolean; - showDeleteButton: boolean; - enableShowHideBtns: boolean; - enableDragging: boolean; - setRootTitle: string; - setErrorValidationText: string; - setMinValidationCountChars: number; + showAddRootBtn?: boolean; + showItemActionBtns?: boolean; + showAddItemButton?: boolean; + showRenameButton?: boolean; + showDeleteButton?: boolean; + enableShowHideBtns?: boolean; + enableDragging?: boolean; + setRootTitle?: string; + setErrorValidationText?: string; + setMinValidationCountChars?: number; + setTreeItemAsLinks?: boolean; } diff --git a/tslint.json b/tslint.json index c091340..d030853 100644 --- a/tslint.json +++ b/tslint.json @@ -17,8 +17,8 @@ ], "label-position": true, "max-line-length": [ - true, - 140 + false, + 200 ], "member-access": false, "member-ordering": [