angular-gridster2
Advanced tools
Comparing version 4.1.0 to 4.2.0
@@ -1,2 +0,2 @@ | ||
import { ChangeDetectorRef, ElementRef, OnChanges, OnInit, OnDestroy, Renderer2, SimpleChanges } from '@angular/core'; | ||
import { ChangeDetectorRef, ElementRef, OnChanges, OnDestroy, OnInit, Renderer2, SimpleChanges } from '@angular/core'; | ||
import { GridsterConfig } from './gridsterConfig.interface'; | ||
@@ -9,3 +9,4 @@ import { GridsterItemComponent } from './gridsterItem.component'; | ||
import { GridsterItemS } from './gridsterItemS.interface'; | ||
export declare class GridsterComponent implements OnInit, OnChanges, OnDestroy { | ||
import { GridsterComponentInterface } from './gridster.interface'; | ||
export declare class GridsterComponent implements OnInit, OnChanges, OnDestroy, GridsterComponentInterface { | ||
renderer: Renderer2; | ||
@@ -32,4 +33,4 @@ cdRef: ChangeDetectorRef; | ||
compact: GridsterCompact; | ||
constructor(el: ElementRef, renderer: Renderer2, cdRef: ChangeDetectorRef); | ||
static checkCollisionTwoItems(item: GridsterItemS, item2: GridsterItemS): boolean; | ||
constructor(el: ElementRef, renderer: Renderer2, cdRef: ChangeDetectorRef); | ||
ngOnInit(): void; | ||
@@ -36,0 +37,0 @@ ngOnChanges(changes: SimpleChanges): void; |
@@ -43,13 +43,2 @@ "use strict"; | ||
GridsterComponent.prototype.ngOnInit = function () { | ||
this.setOptions(); | ||
this.options.api = { | ||
optionsChanged: this.optionsChanged.bind(this), | ||
resize: this.onResize.bind(this), | ||
getNextPossiblePosition: this.getNextPossiblePosition.bind(this) | ||
}; | ||
this.columns = this.$options.minCols; | ||
this.rows = this.$options.minRows; | ||
this.setGridSize(); | ||
this.calculateLayoutDebounce = gridsterUtils_service_1.GridsterUtils.debounce(this.calculateLayout.bind(this), 5); | ||
this.calculateLayoutDebounce(); | ||
if (this.options.initCallback) { | ||
@@ -61,3 +50,13 @@ this.options.initCallback(this); | ||
if (changes.options) { | ||
this.ngOnInit(); | ||
this.setOptions(); | ||
this.options.api = { | ||
optionsChanged: this.optionsChanged.bind(this), | ||
resize: this.onResize.bind(this), | ||
getNextPossiblePosition: this.getNextPossiblePosition.bind(this) | ||
}; | ||
this.columns = this.$options.minCols; | ||
this.rows = this.$options.minRows; | ||
this.setGridSize(); | ||
this.calculateLayoutDebounce = gridsterUtils_service_1.GridsterUtils.debounce(this.calculateLayout.bind(this), 5); | ||
this.calculateLayoutDebounce(); | ||
} | ||
@@ -104,2 +103,15 @@ }; | ||
} | ||
if (this.options.destroyCallback) { | ||
this.options.destroyCallback(this); | ||
} | ||
if (this.options.api) { | ||
this.options.api.resize = undefined; | ||
this.options.api.optionsChanged = undefined; | ||
this.options.api.getNextPossiblePosition = undefined; | ||
this.options.api = undefined; | ||
} | ||
this.emptyCell.destroy(); | ||
delete this.emptyCell; | ||
this.compact.destroy(); | ||
delete this.compact; | ||
}; | ||
@@ -161,3 +173,5 @@ GridsterComponent.prototype.onResize = function () { | ||
// check to compact | ||
this.compact.checkCompact(); | ||
if (this.compact) { | ||
this.compact.checkCompact(); | ||
} | ||
this.setGridDimensions(); | ||
@@ -222,3 +236,5 @@ if (this.$options.outerMargin) { | ||
this.renderer.removeClass(this.el, removeClass3); | ||
this.gridLines.updateGrid(); | ||
if (this.gridLines) { | ||
this.gridLines.updateGrid(); | ||
} | ||
var widgetsIndex = this.grid.length - 1, widget; | ||
@@ -248,4 +264,6 @@ for (; widgetsIndex >= 0; widgetsIndex--) { | ||
else if (this.checkCollision(itemComponent.$item)) { | ||
console.warn('Can\'t be placed in the bounds of the dashboard, trying to auto position!/n' + | ||
JSON.stringify(itemComponent.item, ['cols', 'rows', 'x', 'y'])); | ||
if (!this.$options.disableWarnings) { | ||
console.warn('Can\'t be placed in the bounds of the dashboard, trying to auto position!/n' + | ||
JSON.stringify(itemComponent.item, ['cols', 'rows', 'x', 'y'])); | ||
} | ||
this.autoPositionItem(itemComponent); | ||
@@ -318,4 +336,6 @@ } | ||
itemComponent.notPlaced = true; | ||
console.warn('Can\'t be placed in the bounds of the dashboard!/n' + | ||
JSON.stringify(itemComponent.item, ['cols', 'rows', 'x', 'y'])); | ||
if (!this.$options.disableWarnings) { | ||
console.warn('Can\'t be placed in the bounds of the dashboard!/n' + | ||
JSON.stringify(itemComponent.item, ['cols', 'rows', 'x', 'y'])); | ||
} | ||
} | ||
@@ -322,0 +342,0 @@ }; |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"gridster","template":"<gridster-grid class=\"gridster-grid\"></gridster-grid> <ng-content></ng-content> <gridster-preview class=\"gridster-preview\"></gridster-preview>","styles":[":host { position: relative; display: flex; overflow: auto; flex: 1 auto; background: grey; width: 100%; height: 100%; } :host(.fit) { overflow-x: hidden; overflow-y: hidden; } :host(.scrollVertical) { overflow-x: hidden; overflow-y: auto; } :host(.scrollHorizontal) { overflow-x: auto; overflow-y: hidden; } :host(.fixed) { overflow: auto; } :host(.mobile) { overflow-x: hidden; overflow-y: auto; display: block; } :host(.mobile) ::ng-deep gridster-item { position: relative; }"]}]}],"members":{"options":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"resize":[{"__symbolic":"method"}],"setOptions":[{"__symbolic":"method"}],"optionsChanged":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"onResize":[{"__symbolic":"method"}],"checkIfToResize":[{"__symbolic":"method"}],"setGridSize":[{"__symbolic":"method"}],"setGridDimensions":[{"__symbolic":"method"}],"calculateLayout":[{"__symbolic":"method"}],"addItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"checkCollision":[{"__symbolic":"method"}],"checkGridCollision":[{"__symbolic":"method"}],"findItemWithItem":[{"__symbolic":"method"}],"findItemsWithItem":[{"__symbolic":"method"}],"autoPositionItem":[{"__symbolic":"method"}],"getNextPossiblePosition":[{"__symbolic":"method"}],"pixelsToPosition":[{"__symbolic":"method"}],"pixelsToPositionX":[{"__symbolic":"method"}],"pixelsToPositionY":[{"__symbolic":"method"}],"positionXToPixels":[{"__symbolic":"method"}],"positionYToPixels":[{"__symbolic":"method"}]},"statics":{"checkCollisionTwoItems":{"__symbolic":"function","parameters":["item","item2"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"<","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"item"},"member":"x"},"right":{"__symbolic":"binop","operator":"+","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"item2"},"member":"x"},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"item2"},"member":"cols"}}},"right":{"__symbolic":"binop","operator":">","left":{"__symbolic":"binop","operator":"+","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"item"},"member":"x"},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"item"},"member":"cols"}},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"item2"},"member":"x"}}},"right":{"__symbolic":"binop","operator":"<","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"item"},"member":"y"},"right":{"__symbolic":"binop","operator":"+","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"item2"},"member":"y"},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"item2"},"member":"rows"}}}},"right":{"__symbolic":"binop","operator":">","left":{"__symbolic":"binop","operator":"+","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"item"},"member":"y"},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"item"},"member":"rows"}},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"item2"},"member":"y"}}}}}}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":13,"character":1},"arguments":[{"selector":"gridster","template":"<gridster-grid class=\"gridster-grid\"></gridster-grid> <ng-content></ng-content> <gridster-preview class=\"gridster-preview\"></gridster-preview>","styles":[":host { position: relative; display: flex; overflow: auto; flex: 1 auto; background: grey; width: 100%; height: 100%; } :host(.fit) { overflow-x: hidden; overflow-y: hidden; } :host(.scrollVertical) { overflow-x: hidden; overflow-y: auto; } :host(.scrollHorizontal) { overflow-x: auto; overflow-y: hidden; } :host(.fixed) { overflow: auto; } :host(.mobile) { overflow-x: hidden; overflow-y: auto; display: block; } :host(.mobile) ::ng-deep gridster-item { position: relative; }"]}]}],"members":{"options":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":19,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":39,"character":18},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":39,"character":47},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":39,"character":72}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"resize":[{"__symbolic":"method"}],"setOptions":[{"__symbolic":"method"}],"optionsChanged":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"onResize":[{"__symbolic":"method"}],"checkIfToResize":[{"__symbolic":"method"}],"setGridSize":[{"__symbolic":"method"}],"setGridDimensions":[{"__symbolic":"method"}],"calculateLayout":[{"__symbolic":"method"}],"addItem":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"checkCollision":[{"__symbolic":"method"}],"checkGridCollision":[{"__symbolic":"method"}],"findItemWithItem":[{"__symbolic":"method"}],"findItemsWithItem":[{"__symbolic":"method"}],"autoPositionItem":[{"__symbolic":"method"}],"getNextPossiblePosition":[{"__symbolic":"method"}],"pixelsToPosition":[{"__symbolic":"method"}],"pixelsToPositionX":[{"__symbolic":"method"}],"pixelsToPositionY":[{"__symbolic":"method"}],"positionXToPixels":[{"__symbolic":"method"}],"positionYToPixels":[{"__symbolic":"method"}]},"statics":{"checkCollisionTwoItems":{"__symbolic":"function","parameters":["item","item2"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"<","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"item"},"member":"x"},"right":{"__symbolic":"binop","operator":"+","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"item2"},"member":"x"},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"item2"},"member":"cols"}}},"right":{"__symbolic":"binop","operator":">","left":{"__symbolic":"binop","operator":"+","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"item"},"member":"x"},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"item"},"member":"cols"}},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"item2"},"member":"x"}}},"right":{"__symbolic":"binop","operator":"<","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"item"},"member":"y"},"right":{"__symbolic":"binop","operator":"+","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"item2"},"member":"y"},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"item2"},"member":"rows"}}}},"right":{"__symbolic":"binop","operator":">","left":{"__symbolic":"binop","operator":"+","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"item"},"member":"y"},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"item"},"member":"rows"}},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"item2"},"member":"y"}}}}}}}}] |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./gridster.component","name":"GridsterComponent"},{"__symbolic":"reference","module":"./gridsterItem.component","name":"GridsterItemComponent"},{"__symbolic":"reference","module":"./gridsterGrid.component","name":"GridsterGridComponent"},{"__symbolic":"reference","module":"./gridsterPreview.component","name":"GridsterPreviewComponent"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"}],"exports":[{"__symbolic":"reference","module":"./gridster.component","name":"GridsterComponent"},{"__symbolic":"reference","module":"./gridsterItem.component","name":"GridsterItemComponent"}],"providers":[],"bootstrap":[]}]}]}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":8,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./gridster.component","name":"GridsterComponent","line":10,"character":4},{"__symbolic":"reference","module":"./gridsterItem.component","name":"GridsterItemComponent","line":11,"character":4},{"__symbolic":"reference","module":"./gridsterGrid.component","name":"GridsterGridComponent","line":12,"character":4},{"__symbolic":"reference","module":"./gridsterPreview.component","name":"GridsterPreviewComponent","line":13,"character":4}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":16,"character":4}],"exports":[{"__symbolic":"reference","module":"./gridster.component","name":"GridsterComponent","line":18,"character":12},{"__symbolic":"reference","module":"./gridsterItem.component","name":"GridsterItemComponent","line":18,"character":31}],"providers":[],"bootstrap":[]}]}]}}}] |
@@ -1,6 +0,7 @@ | ||
import { GridsterComponent } from './gridster.component'; | ||
import { GridsterItemComponent } from './gridsterItem.component'; | ||
import { GridsterComponentInterface } from './gridster.interface'; | ||
export declare class GridsterCompact { | ||
private gridster; | ||
constructor(gridster: GridsterComponent); | ||
constructor(gridster: GridsterComponentInterface); | ||
destroy(): void; | ||
checkCompact(): void; | ||
@@ -7,0 +8,0 @@ checkCompactUp(): boolean; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var core_1 = require("@angular/core"); | ||
var gridster_component_1 = require("./gridster.component"); | ||
var GridsterCompact = (function () { | ||
@@ -9,2 +8,5 @@ function GridsterCompact(gridster) { | ||
} | ||
GridsterCompact.prototype.destroy = function () { | ||
delete this.gridster; | ||
}; | ||
GridsterCompact.prototype.checkCompact = function () { | ||
@@ -95,3 +97,3 @@ if (this.gridster.$options.compactType !== 'none') { | ||
GridsterCompact.ctorParameters = function () { return [ | ||
{ type: gridster_component_1.GridsterComponent, }, | ||
null, | ||
]; }; | ||
@@ -98,0 +100,0 @@ return GridsterCompact; |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterCompact":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./gridster.component","name":"GridsterComponent"}]}],"checkCompact":[{"__symbolic":"method"}],"checkCompactUp":[{"__symbolic":"method"}],"moveUpTillCollision":[{"__symbolic":"method"}],"checkCompactLeft":[{"__symbolic":"method"}],"moveLeftTillCollision":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterCompact":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":5,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./gridster.interface","name":"GridsterComponentInterface","line":8,"character":32}]}],"destroy":[{"__symbolic":"method"}],"checkCompact":[{"__symbolic":"method"}],"checkCompactUp":[{"__symbolic":"method"}],"moveUpTillCollision":[{"__symbolic":"method"}],"checkCompactLeft":[{"__symbolic":"method"}],"moveLeftTillCollision":[{"__symbolic":"method"}]}}}}] |
@@ -57,2 +57,4 @@ "use strict"; | ||
// callback to call after grid has initialized. Arguments: gridsterComponent | ||
destroyCallback: undefined, | ||
// callback to call after grid has destroyed. Arguments: gridsterComponent | ||
itemChangeCallback: undefined, | ||
@@ -142,3 +144,5 @@ // callback to call for each item when is changes x, y, rows, cols. | ||
// display background grid of rows and columns | ||
disableWindowResize: false // disable the window on resize listener. This will stop grid to recalculate on window resize. | ||
disableWindowResize: false, | ||
// disable the window on resize listener. This will stop grid to recalculate on window resize. | ||
disableWarnings: false // disable console log warnings about misplacements grid items | ||
}; |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterConfigService":{"gridType":"fit","fixedColWidth":250,"fixedRowHeight":250,"keepFixedHeightInMobile":false,"keepFixedWidthInMobile":false,"compactType":"none","mobileBreakpoint":640,"minCols":1,"maxCols":100,"minRows":1,"maxRows":100,"defaultItemCols":1,"defaultItemRows":1,"maxItemCols":50,"maxItemRows":50,"minItemCols":1,"minItemRows":1,"minItemArea":1,"maxItemArea":2500,"margin":10,"outerMargin":true,"scrollSensitivity":10,"scrollSpeed":20,"initCallback":{"__symbolic":"reference","name":"undefined"},"itemChangeCallback":{"__symbolic":"reference","name":"undefined"},"itemResizeCallback":{"__symbolic":"reference","name":"undefined"},"itemInitCallback":{"__symbolic":"reference","name":"undefined"},"itemRemovedCallback":{"__symbolic":"reference","name":"undefined"},"enableEmptyCellClick":false,"enableEmptyCellContextMenu":false,"enableEmptyCellDrop":false,"enableEmptyCellDrag":false,"emptyCellClickCallback":{"__symbolic":"reference","name":"undefined"},"emptyCellContextMenuCallback":{"__symbolic":"reference","name":"undefined"},"emptyCellDropCallback":{"__symbolic":"reference","name":"undefined"},"emptyCellDragCallback":{"__symbolic":"reference","name":"undefined"},"emptyCellDragMaxCols":50,"emptyCellDragMaxRows":50,"draggable":{"delayStart":0,"enabled":false,"ignoreContentClass":"gridster-item-content","ignoreContent":false,"dragHandleClass":"drag-handler","stop":{"__symbolic":"reference","name":"undefined"},"start":{"__symbolic":"reference","name":"undefined"}},"resizable":{"delayStart":0,"enabled":false,"handles":{"s":true,"e":true,"n":true,"w":true,"se":true,"ne":true,"sw":true,"nw":true},"stop":{"__symbolic":"reference","name":"undefined"},"start":{"__symbolic":"reference","name":"undefined"}},"swap":true,"pushItems":false,"disablePushOnDrag":false,"disablePushOnResize":false,"pushDirections":{"north":true,"east":true,"south":true,"west":true},"pushResizeItems":false,"displayGrid":"onDrag&Resize","disableWindowResize":false}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterConfigService":{"gridType":"fit","fixedColWidth":250,"fixedRowHeight":250,"keepFixedHeightInMobile":false,"keepFixedWidthInMobile":false,"compactType":"none","mobileBreakpoint":640,"minCols":1,"maxCols":100,"minRows":1,"maxRows":100,"defaultItemCols":1,"defaultItemRows":1,"maxItemCols":50,"maxItemRows":50,"minItemCols":1,"minItemRows":1,"minItemArea":1,"maxItemArea":2500,"margin":10,"outerMargin":true,"scrollSensitivity":10,"scrollSpeed":20,"initCallback":{"__symbolic":"reference","name":"undefined"},"destroyCallback":{"__symbolic":"reference","name":"undefined"},"itemChangeCallback":{"__symbolic":"reference","name":"undefined"},"itemResizeCallback":{"__symbolic":"reference","name":"undefined"},"itemInitCallback":{"__symbolic":"reference","name":"undefined"},"itemRemovedCallback":{"__symbolic":"reference","name":"undefined"},"enableEmptyCellClick":false,"enableEmptyCellContextMenu":false,"enableEmptyCellDrop":false,"enableEmptyCellDrag":false,"emptyCellClickCallback":{"__symbolic":"reference","name":"undefined"},"emptyCellContextMenuCallback":{"__symbolic":"reference","name":"undefined"},"emptyCellDropCallback":{"__symbolic":"reference","name":"undefined"},"emptyCellDragCallback":{"__symbolic":"reference","name":"undefined"},"emptyCellDragMaxCols":50,"emptyCellDragMaxRows":50,"draggable":{"delayStart":0,"enabled":false,"ignoreContentClass":"gridster-item-content","ignoreContent":false,"dragHandleClass":"drag-handler","stop":{"__symbolic":"reference","name":"undefined"},"start":{"__symbolic":"reference","name":"undefined"}},"resizable":{"delayStart":0,"enabled":false,"handles":{"s":true,"e":true,"n":true,"w":true,"se":true,"ne":true,"sw":true,"nw":true},"stop":{"__symbolic":"reference","name":"undefined"},"start":{"__symbolic":"reference","name":"undefined"}},"swap":true,"pushItems":false,"disablePushOnDrag":false,"disablePushOnResize":false,"pushDirections":{"north":true,"east":true,"south":true,"west":true},"pushResizeItems":false,"displayGrid":"onDrag&Resize","disableWindowResize":false,"disableWarnings":false}}}] |
@@ -29,2 +29,3 @@ export declare type GridType = 'fit' | 'scrollVertical' | 'scrollHorizontal' | 'fixed' | 'verticalFixed' | 'horizontalFixed'; | ||
initCallback?: Function; | ||
destroyCallback?: Function; | ||
itemChangeCallback?: Function; | ||
@@ -44,2 +45,3 @@ itemResizeCallback?: Function; | ||
disableWindowResize?: boolean; | ||
disableWarnings?: boolean; | ||
enableEmptyCellClick?: boolean; | ||
@@ -46,0 +48,0 @@ enableEmptyCellContextMenu?: boolean; |
@@ -36,2 +36,3 @@ import { compactType, displayGrid, GridType } from './gridsterConfig.interface'; | ||
disableWindowResize: boolean; | ||
disableWarnings: boolean; | ||
enableEmptyCellClick: boolean; | ||
@@ -38,0 +39,0 @@ enableEmptyCellContextMenu: boolean; |
import { GridsterSwap } from './gridsterSwap.service'; | ||
import { GridsterItemComponent } from './gridsterItem.component'; | ||
import { GridsterComponent } from './gridster.component'; | ||
import { GridsterPush } from './gridsterPush.service'; | ||
import { GridsterItemComponentInterface } from './gridsterItemComponent.interface'; | ||
import { GridsterComponentInterface } from './gridster.interface'; | ||
export declare class GridsterDraggable { | ||
gridsterItem: GridsterItemComponent; | ||
gridster: GridsterComponent; | ||
gridsterItem: GridsterItemComponentInterface; | ||
gridster: GridsterComponentInterface; | ||
lastMouse: { | ||
@@ -43,3 +43,4 @@ clientX: number; | ||
}>; | ||
constructor(gridsterItem: GridsterItemComponent, gridster: GridsterComponent); | ||
constructor(gridsterItem: GridsterItemComponentInterface, gridster: GridsterComponentInterface); | ||
destroy(): void; | ||
dragStart(e: any): void; | ||
@@ -46,0 +47,0 @@ dragMove(e: any): void; |
@@ -6,4 +6,2 @@ "use strict"; | ||
var gridsterScroll_service_1 = require("./gridsterScroll.service"); | ||
var gridsterItem_component_1 = require("./gridsterItem.component"); | ||
var gridster_component_1 = require("./gridster.component"); | ||
var gridsterPush_service_1 = require("./gridsterPush.service"); | ||
@@ -21,2 +19,10 @@ var gridsterUtils_service_1 = require("./gridsterUtils.service"); | ||
} | ||
GridsterDraggable.prototype.destroy = function () { | ||
delete this.gridsterItem; | ||
delete this.gridster; | ||
if (this.mousedown) { | ||
this.mousedown(); | ||
this.touchstart(); | ||
} | ||
}; | ||
GridsterDraggable.prototype.dragStart = function (e) { | ||
@@ -112,2 +118,6 @@ switch (e.which) { | ||
this.swap.restoreSwapItem(); | ||
this.push.destroy(); | ||
delete this.push; | ||
this.swap.destroy(); | ||
delete this.swap; | ||
}; | ||
@@ -119,2 +129,6 @@ GridsterDraggable.prototype.makeDrag = function () { | ||
this.swap.setSwapItem(); | ||
this.push.destroy(); | ||
delete this.push; | ||
this.swap.destroy(); | ||
delete this.swap; | ||
}; | ||
@@ -224,4 +238,4 @@ GridsterDraggable.prototype.calculateItemPosition = function () { | ||
GridsterDraggable.ctorParameters = function () { return [ | ||
{ type: gridsterItem_component_1.GridsterItemComponent, }, | ||
{ type: gridster_component_1.GridsterComponent, }, | ||
null, | ||
null, | ||
]; }; | ||
@@ -228,0 +242,0 @@ return GridsterDraggable; |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterDraggable":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./gridsterItem.component","name":"GridsterItemComponent"},{"__symbolic":"reference","module":"./gridster.component","name":"GridsterComponent"}]}],"dragStart":[{"__symbolic":"method"}],"dragMove":[{"__symbolic":"method"}],"calculateItemPositionFromMousePosition":[{"__symbolic":"method"}],"dragStop":[{"__symbolic":"method"}],"cancelDrag":[{"__symbolic":"method"}],"makeDrag":[{"__symbolic":"method"}],"calculateItemPosition":[{"__symbolic":"method"}],"toggle":[{"__symbolic":"method"}],"dragStartDelay":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterDraggable":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":9,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./gridsterItemComponent.interface","name":"GridsterItemComponentInterface","line":46,"character":28},{"__symbolic":"reference","module":"./gridster.interface","name":"GridsterComponentInterface","line":46,"character":70}]}],"destroy":[{"__symbolic":"method"}],"dragStart":[{"__symbolic":"method"}],"dragMove":[{"__symbolic":"method"}],"calculateItemPositionFromMousePosition":[{"__symbolic":"method"}],"dragStop":[{"__symbolic":"method"}],"cancelDrag":[{"__symbolic":"method"}],"makeDrag":[{"__symbolic":"method"}],"calculateItemPosition":[{"__symbolic":"method"}],"toggle":[{"__symbolic":"method"}],"dragStartDelay":[{"__symbolic":"method"}]}}}}] |
@@ -1,3 +0,3 @@ | ||
import { GridsterComponent } from './gridster.component'; | ||
import { GridsterItemS } from './gridsterItemS.interface'; | ||
import { GridsterComponentInterface } from './gridster.interface'; | ||
export declare class GridsterEmptyCell { | ||
@@ -17,3 +17,4 @@ private gridster; | ||
emptyCellMove: Function | null; | ||
constructor(gridster: GridsterComponent); | ||
constructor(gridster: GridsterComponentInterface); | ||
destroy(): void; | ||
updateOptions(): void; | ||
@@ -20,0 +21,0 @@ emptyCellClickCb(e: any): void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var core_1 = require("@angular/core"); | ||
var gridster_component_1 = require("./gridster.component"); | ||
var gridsterUtils_service_1 = require("./gridsterUtils.service"); | ||
@@ -10,2 +9,5 @@ var GridsterEmptyCell = (function () { | ||
} | ||
GridsterEmptyCell.prototype.destroy = function () { | ||
delete this.gridster; | ||
}; | ||
GridsterEmptyCell.prototype.updateOptions = function () { | ||
@@ -177,3 +179,3 @@ if (this.gridster.$options.enableEmptyCellClick && !this.emptyCellClick && this.gridster.$options.emptyCellClickCallback) { | ||
GridsterEmptyCell.ctorParameters = function () { return [ | ||
{ type: gridster_component_1.GridsterComponent, }, | ||
null, | ||
]; }; | ||
@@ -180,0 +182,0 @@ return GridsterEmptyCell; |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterEmptyCell":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./gridster.component","name":"GridsterComponent"}]}],"updateOptions":[{"__symbolic":"method"}],"emptyCellClickCb":[{"__symbolic":"method"}],"emptyCellContextMenuCb":[{"__symbolic":"method"}],"emptyCellDragDrop":[{"__symbolic":"method"}],"emptyCellDragOver":[{"__symbolic":"method"}],"emptyCellMouseDown":[{"__symbolic":"method"}],"emptyCellMouseMove":[{"__symbolic":"method"}],"emptyCellMouseUp":[{"__symbolic":"method"}],"getValidItemFromEvent":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterEmptyCell":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":6,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./gridster.interface","name":"GridsterComponentInterface","line":21,"character":32}]}],"destroy":[{"__symbolic":"method"}],"updateOptions":[{"__symbolic":"method"}],"emptyCellClickCb":[{"__symbolic":"method"}],"emptyCellContextMenuCb":[{"__symbolic":"method"}],"emptyCellDragDrop":[{"__symbolic":"method"}],"emptyCellDragOver":[{"__symbolic":"method"}],"emptyCellMouseDown":[{"__symbolic":"method"}],"emptyCellMouseMove":[{"__symbolic":"method"}],"emptyCellMouseUp":[{"__symbolic":"method"}],"getValidItemFromEvent":[{"__symbolic":"method"}]}}}}] |
@@ -1,4 +0,4 @@ | ||
import { ChangeDetectorRef, ElementRef, Renderer2 } from '@angular/core'; | ||
import { ChangeDetectorRef, ElementRef, OnDestroy, Renderer2 } from '@angular/core'; | ||
import { GridsterComponent } from './gridster.component'; | ||
export declare class GridsterGridComponent { | ||
export declare class GridsterGridComponent implements OnDestroy { | ||
renderer: Renderer2; | ||
@@ -16,3 +16,4 @@ private cdRef; | ||
constructor(el: ElementRef, gridster: GridsterComponent, renderer: Renderer2, cdRef: ChangeDetectorRef); | ||
ngOnDestroy(): void; | ||
updateGrid(): void; | ||
} |
@@ -19,2 +19,7 @@ "use strict"; | ||
} | ||
GridsterGridComponent.prototype.ngOnDestroy = function () { | ||
delete this.el; | ||
delete this.gridster.gridLines; | ||
delete this.gridster; | ||
}; | ||
GridsterGridComponent.prototype.updateGrid = function () { | ||
@@ -21,0 +26,0 @@ if (this.gridster.$options.displayGrid === 'always' && !this.gridster.mobile) { |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterGridComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"gridster-grid","template":"<div class=\"columns\" [style.height.px]=\"columnsHeight\"> <div class=\"column\" *ngFor=\"let column of columns; let isFirst = first;\" [style.min-width.px]=\"width\" [style.margin-left.px]=\"isFirst && !gridster.$options.outerMargin ? 0 : margin\"></div> </div> <div class=\"rows\" [style.width.px]=\"rowsWidth\"> <div class=\"row\" *ngFor=\"let row of rows; let isFirst = first;\" [style.height.px]=\"height\" [style.margin-top.px]=\"isFirst && !gridster.$options.outerMargin ? 0 : margin\"></div> </div>","styles":[":host { display: none; position: absolute; } .rows, .columns { position: absolute; } .columns { display: flex; flex-direction: row; } .column, .row { transition: .3s; box-sizing: border-box; } .column { height: 100%; border-left: 1px solid white; border-right: 1px solid white; } .row { width: 100%; border-top: 1px solid white; border-bottom: 1px solid white; }"],"changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy"},"member":"OnPush"}}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Host"}}],null,null],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"./gridster.component","name":"GridsterComponent"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef"}]}],"updateGrid":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterGridComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":4,"character":1},"arguments":[{"selector":"gridster-grid","template":"<div class=\"columns\" [style.height.px]=\"columnsHeight\"> <div class=\"column\" *ngFor=\"let column of columns; let isFirst = first;\" [style.min-width.px]=\"width\" [style.margin-left.px]=\"isFirst && !gridster.$options.outerMargin ? 0 : margin\"></div> </div> <div class=\"rows\" [style.width.px]=\"rowsWidth\"> <div class=\"row\" *ngFor=\"let row of rows; let isFirst = first;\" [style.height.px]=\"height\" [style.margin-top.px]=\"isFirst && !gridster.$options.outerMargin ? 0 : margin\"></div> </div>","styles":[":host { display: none; position: absolute; } .rows, .columns { position: absolute; } .columns { display: flex; flex-direction: row; } .column, .row { transition: .3s; box-sizing: border-box; } .column { height: 100%; border-left: 1px solid white; border-right: 1px solid white; } .row { width: 100%; border-top: 1px solid white; border-bottom: 1px solid white; }"],"changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":8,"character":19},"member":"OnPush"}}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Host","line":22,"character":31}}],null,null],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":22,"character":18},{"__symbolic":"reference","module":"./gridster.component","name":"GridsterComponent","line":22,"character":48},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":22,"character":84},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":23,"character":29}]}],"ngOnDestroy":[{"__symbolic":"method"}],"updateGrid":[{"__symbolic":"method"}]}}}}] |
@@ -1,2 +0,2 @@ | ||
import { ElementRef, EventEmitter, OnInit, OnDestroy, Renderer2 } from '@angular/core'; | ||
import { ElementRef, EventEmitter, OnDestroy, OnInit, Renderer2 } from '@angular/core'; | ||
import { GridsterItem } from './gridsterItem.interface'; | ||
@@ -7,3 +7,4 @@ import { GridsterComponent } from './gridster.component'; | ||
import { GridsterItemS } from './gridsterItemS.interface'; | ||
export declare class GridsterItemComponent implements OnInit, OnDestroy { | ||
import { GridsterItemComponentInterface } from './gridsterItemComponent.interface'; | ||
export declare class GridsterItemComponent implements OnInit, OnDestroy, GridsterItemComponentInterface { | ||
renderer: Renderer2; | ||
@@ -10,0 +11,0 @@ item: GridsterItem; |
@@ -48,2 +48,8 @@ "use strict"; | ||
this.gridster.removeItem(this); | ||
delete this.$item.initCallback; | ||
delete this.gridster; | ||
this.drag.destroy(); | ||
delete this.drag; | ||
this.resize.destroy(); | ||
delete this.resize; | ||
}; | ||
@@ -137,3 +143,3 @@ GridsterItemComponent.prototype.setSize = function (noCheck) { | ||
template: "<ng-content></ng-content> <div (mousedown)=\"resize.dragStartDelay($event)\" (touchstart)=\"resize.dragStartDelay($event)\" [hidden]=\"!gridster.$options.resizable.handles.s || !resize.resizeEnabled\" class=\"gridster-item-resizable-handler handle-s\"></div> <div (mousedown)=\"resize.dragStartDelay($event)\" (touchstart)=\"resize.dragStartDelay($event)\" [hidden]=\"!gridster.$options.resizable.handles.e || !resize.resizeEnabled\" class=\"gridster-item-resizable-handler handle-e\"></div> <div (mousedown)=\"resize.dragStartDelay($event)\" (touchstart)=\"resize.dragStartDelay($event)\" [hidden]=\"!gridster.$options.resizable.handles.n || !resize.resizeEnabled\" class=\"gridster-item-resizable-handler handle-n\"></div> <div (mousedown)=\"resize.dragStartDelay($event)\" (touchstart)=\"resize.dragStartDelay($event)\" [hidden]=\"!gridster.$options.resizable.handles.w || !resize.resizeEnabled\" class=\"gridster-item-resizable-handler handle-w\"></div> <div (mousedown)=\"resize.dragStartDelay($event)\" (touchstart)=\"resize.dragStartDelay($event)\" [hidden]=\"!gridster.$options.resizable.handles.se || !resize.resizeEnabled\" class=\"gridster-item-resizable-handler handle-se\"></div> <div (mousedown)=\"resize.dragStartDelay($event)\" (touchstart)=\"resize.dragStartDelay($event)\" [hidden]=\"!gridster.$options.resizable.handles.ne || !resize.resizeEnabled\" class=\"gridster-item-resizable-handler handle-ne\"></div> <div (mousedown)=\"resize.dragStartDelay($event)\" (touchstart)=\"resize.dragStartDelay($event)\" [hidden]=\"!gridster.$options.resizable.handles.sw || !resize.resizeEnabled\" class=\"gridster-item-resizable-handler handle-sw\"></div> <div (mousedown)=\"resize.dragStartDelay($event)\" (touchstart)=\"resize.dragStartDelay($event)\" [hidden]=\"!gridster.$options.resizable.handles.nw || !resize.resizeEnabled\" class=\"gridster-item-resizable-handler handle-nw\"></div>", | ||
styles: [":host { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; box-sizing: border-box; z-index: 1; position: absolute; overflow: hidden; transition: .3s; display: none; background: white; } :host(.gridster-item-moving) { cursor: move; } :host(.gridster-item-resizing), :host(.gridster-item-moving) { transition: 0s; z-index: 2; box-shadow: 0 0 5px 5px rgba(0, 0, 0, .2), 0 6px 10px 0 rgba(0, 0, 0, .14), 0 1px 18px 0 rgba(0, 0, 0, .12); } .gridster-item-resizable-handler { position: absolute; z-index: 2; } .gridster-item-resizable-handler.handle-n { cursor: n-resize; height: 10px; right: 0; top: 0; left: 0; } .gridster-item-resizable-handler.handle-e { cursor: e-resize; width: 10px; bottom: 0; right: 0; top: 0; } .gridster-item-resizable-handler.handle-s { cursor: s-resize; height: 10px; right: 0; bottom: 0; left: 0; } .gridster-item-resizable-handler.handle-w { cursor: w-resize; width: 10px; left: 0; top: 0; bottom: 0; } .gridster-item-resizable-handler.handle-ne { cursor: ne-resize; width: 10px; height: 10px; right: 0; top: 0; } .gridster-item-resizable-handler.handle-nw { cursor: nw-resize; width: 10px; height: 10px; left: 0; top: 0; } .gridster-item-resizable-handler.handle-se { cursor: se-resize; width: 0; height: 0; right: 0; bottom: 0; border-style: solid; border-width: 0 0 10px 10px; border-color: transparent; } .gridster-item-resizable-handler.handle-sw { cursor: sw-resize; width: 10px; height: 10px; left: 0; bottom: 0; } :host ::ng-deep .gridster-item-content { -webkit-user-select: auto; -moz-user-select: auto; -ms-user-select: auto; user-select: auto; } :host(:hover) .gridster-item-resizable-handler.handle-se { border-color: transparent transparent #ccc }"] | ||
styles: [":host { box-sizing: border-box; z-index: 1; position: absolute; overflow: hidden; transition: .3s; display: none; background: white; } :host(.gridster-item-moving) { cursor: move; } :host(.gridster-item-resizing), :host(.gridster-item-moving) { transition: 0s; z-index: 2; box-shadow: 0 0 5px 5px rgba(0, 0, 0, .2), 0 6px 10px 0 rgba(0, 0, 0, .14), 0 1px 18px 0 rgba(0, 0, 0, .12); } .gridster-item-resizable-handler { position: absolute; z-index: 2; } .gridster-item-resizable-handler.handle-n { cursor: n-resize; height: 10px; right: 0; top: 0; left: 0; } .gridster-item-resizable-handler.handle-e { cursor: e-resize; width: 10px; bottom: 0; right: 0; top: 0; } .gridster-item-resizable-handler.handle-s { cursor: s-resize; height: 10px; right: 0; bottom: 0; left: 0; } .gridster-item-resizable-handler.handle-w { cursor: w-resize; width: 10px; left: 0; top: 0; bottom: 0; } .gridster-item-resizable-handler.handle-ne { cursor: ne-resize; width: 10px; height: 10px; right: 0; top: 0; } .gridster-item-resizable-handler.handle-nw { cursor: nw-resize; width: 10px; height: 10px; left: 0; top: 0; } .gridster-item-resizable-handler.handle-se { cursor: se-resize; width: 0; height: 0; right: 0; bottom: 0; border-style: solid; border-width: 0 0 10px 10px; border-color: transparent; } .gridster-item-resizable-handler.handle-sw { cursor: sw-resize; width: 10px; height: 10px; left: 0; bottom: 0; } :host(:hover) .gridster-item-resizable-handler.handle-se { border-color: transparent transparent #ccc }"] | ||
},] }, | ||
@@ -140,0 +146,0 @@ ]; |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterItemComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"gridster-item","template":"<ng-content></ng-content> <div (mousedown)=\"resize.dragStartDelay($event)\" (touchstart)=\"resize.dragStartDelay($event)\" [hidden]=\"!gridster.$options.resizable.handles.s || !resize.resizeEnabled\" class=\"gridster-item-resizable-handler handle-s\"></div> <div (mousedown)=\"resize.dragStartDelay($event)\" (touchstart)=\"resize.dragStartDelay($event)\" [hidden]=\"!gridster.$options.resizable.handles.e || !resize.resizeEnabled\" class=\"gridster-item-resizable-handler handle-e\"></div> <div (mousedown)=\"resize.dragStartDelay($event)\" (touchstart)=\"resize.dragStartDelay($event)\" [hidden]=\"!gridster.$options.resizable.handles.n || !resize.resizeEnabled\" class=\"gridster-item-resizable-handler handle-n\"></div> <div (mousedown)=\"resize.dragStartDelay($event)\" (touchstart)=\"resize.dragStartDelay($event)\" [hidden]=\"!gridster.$options.resizable.handles.w || !resize.resizeEnabled\" class=\"gridster-item-resizable-handler handle-w\"></div> <div (mousedown)=\"resize.dragStartDelay($event)\" (touchstart)=\"resize.dragStartDelay($event)\" [hidden]=\"!gridster.$options.resizable.handles.se || !resize.resizeEnabled\" class=\"gridster-item-resizable-handler handle-se\"></div> <div (mousedown)=\"resize.dragStartDelay($event)\" (touchstart)=\"resize.dragStartDelay($event)\" [hidden]=\"!gridster.$options.resizable.handles.ne || !resize.resizeEnabled\" class=\"gridster-item-resizable-handler handle-ne\"></div> <div (mousedown)=\"resize.dragStartDelay($event)\" (touchstart)=\"resize.dragStartDelay($event)\" [hidden]=\"!gridster.$options.resizable.handles.sw || !resize.resizeEnabled\" class=\"gridster-item-resizable-handler handle-sw\"></div> <div (mousedown)=\"resize.dragStartDelay($event)\" (touchstart)=\"resize.dragStartDelay($event)\" [hidden]=\"!gridster.$options.resizable.handles.nw || !resize.resizeEnabled\" class=\"gridster-item-resizable-handler handle-nw\"></div>","styles":[":host { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; box-sizing: border-box; z-index: 1; position: absolute; overflow: hidden; transition: .3s; display: none; background: white; } :host(.gridster-item-moving) { cursor: move; } :host(.gridster-item-resizing), :host(.gridster-item-moving) { transition: 0s; z-index: 2; box-shadow: 0 0 5px 5px rgba(0, 0, 0, .2), 0 6px 10px 0 rgba(0, 0, 0, .14), 0 1px 18px 0 rgba(0, 0, 0, .12); } .gridster-item-resizable-handler { position: absolute; z-index: 2; } .gridster-item-resizable-handler.handle-n { cursor: n-resize; height: 10px; right: 0; top: 0; left: 0; } .gridster-item-resizable-handler.handle-e { cursor: e-resize; width: 10px; bottom: 0; right: 0; top: 0; } .gridster-item-resizable-handler.handle-s { cursor: s-resize; height: 10px; right: 0; bottom: 0; left: 0; } .gridster-item-resizable-handler.handle-w { cursor: w-resize; width: 10px; left: 0; top: 0; bottom: 0; } .gridster-item-resizable-handler.handle-ne { cursor: ne-resize; width: 10px; height: 10px; right: 0; top: 0; } .gridster-item-resizable-handler.handle-nw { cursor: nw-resize; width: 10px; height: 10px; left: 0; top: 0; } .gridster-item-resizable-handler.handle-se { cursor: se-resize; width: 0; height: 0; right: 0; bottom: 0; border-style: solid; border-width: 0 0 10px 10px; border-color: transparent; } .gridster-item-resizable-handler.handle-sw { cursor: sw-resize; width: 10px; height: 10px; left: 0; bottom: 0; } :host ::ng-deep .gridster-item-content { -webkit-user-select: auto; -moz-user-select: auto; -ms-user-select: auto; user-select: auto; } :host(:hover) .gridster-item-resizable-handler.handle-se { border-color: transparent transparent #ccc }"]}]}],"members":{"item":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"itemChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"itemResize":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Host"}}],null],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"./gridster.component","name":"GridsterComponent"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2"}]}],"ngOnInit":[{"__symbolic":"method"}],"updateOptions":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"setSize":[{"__symbolic":"method"}],"itemChanged":[{"__symbolic":"method"}],"checkItemChanges":[{"__symbolic":"method"}],"canBeDragged":[{"__symbolic":"method"}],"canBeResized":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterItemComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":10,"character":1},"arguments":[{"selector":"gridster-item","template":"<ng-content></ng-content> <div (mousedown)=\"resize.dragStartDelay($event)\" (touchstart)=\"resize.dragStartDelay($event)\" [hidden]=\"!gridster.$options.resizable.handles.s || !resize.resizeEnabled\" class=\"gridster-item-resizable-handler handle-s\"></div> <div (mousedown)=\"resize.dragStartDelay($event)\" (touchstart)=\"resize.dragStartDelay($event)\" [hidden]=\"!gridster.$options.resizable.handles.e || !resize.resizeEnabled\" class=\"gridster-item-resizable-handler handle-e\"></div> <div (mousedown)=\"resize.dragStartDelay($event)\" (touchstart)=\"resize.dragStartDelay($event)\" [hidden]=\"!gridster.$options.resizable.handles.n || !resize.resizeEnabled\" class=\"gridster-item-resizable-handler handle-n\"></div> <div (mousedown)=\"resize.dragStartDelay($event)\" (touchstart)=\"resize.dragStartDelay($event)\" [hidden]=\"!gridster.$options.resizable.handles.w || !resize.resizeEnabled\" class=\"gridster-item-resizable-handler handle-w\"></div> <div (mousedown)=\"resize.dragStartDelay($event)\" (touchstart)=\"resize.dragStartDelay($event)\" [hidden]=\"!gridster.$options.resizable.handles.se || !resize.resizeEnabled\" class=\"gridster-item-resizable-handler handle-se\"></div> <div (mousedown)=\"resize.dragStartDelay($event)\" (touchstart)=\"resize.dragStartDelay($event)\" [hidden]=\"!gridster.$options.resizable.handles.ne || !resize.resizeEnabled\" class=\"gridster-item-resizable-handler handle-ne\"></div> <div (mousedown)=\"resize.dragStartDelay($event)\" (touchstart)=\"resize.dragStartDelay($event)\" [hidden]=\"!gridster.$options.resizable.handles.sw || !resize.resizeEnabled\" class=\"gridster-item-resizable-handler handle-sw\"></div> <div (mousedown)=\"resize.dragStartDelay($event)\" (touchstart)=\"resize.dragStartDelay($event)\" [hidden]=\"!gridster.$options.resizable.handles.nw || !resize.resizeEnabled\" class=\"gridster-item-resizable-handler handle-nw\"></div>","styles":[":host { box-sizing: border-box; z-index: 1; position: absolute; overflow: hidden; transition: .3s; display: none; background: white; } :host(.gridster-item-moving) { cursor: move; } :host(.gridster-item-resizing), :host(.gridster-item-moving) { transition: 0s; z-index: 2; box-shadow: 0 0 5px 5px rgba(0, 0, 0, .2), 0 6px 10px 0 rgba(0, 0, 0, .14), 0 1px 18px 0 rgba(0, 0, 0, .12); } .gridster-item-resizable-handler { position: absolute; z-index: 2; } .gridster-item-resizable-handler.handle-n { cursor: n-resize; height: 10px; right: 0; top: 0; left: 0; } .gridster-item-resizable-handler.handle-e { cursor: e-resize; width: 10px; bottom: 0; right: 0; top: 0; } .gridster-item-resizable-handler.handle-s { cursor: s-resize; height: 10px; right: 0; bottom: 0; left: 0; } .gridster-item-resizable-handler.handle-w { cursor: w-resize; width: 10px; left: 0; top: 0; bottom: 0; } .gridster-item-resizable-handler.handle-ne { cursor: ne-resize; width: 10px; height: 10px; right: 0; top: 0; } .gridster-item-resizable-handler.handle-nw { cursor: nw-resize; width: 10px; height: 10px; left: 0; top: 0; } .gridster-item-resizable-handler.handle-se { cursor: se-resize; width: 0; height: 0; right: 0; bottom: 0; border-style: solid; border-width: 0 0 10px 10px; border-color: transparent; } .gridster-item-resizable-handler.handle-sw { cursor: sw-resize; width: 10px; height: 10px; left: 0; bottom: 0; } :host(:hover) .gridster-item-resizable-handler.handle-se { border-color: transparent transparent #ccc }"]}]}],"members":{"item":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":16,"character":3}}]}],"itemChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":17,"character":3}}]}],"itemResize":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":18,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Host","line":35,"character":31}}],null],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":35,"character":18},{"__symbolic":"reference","module":"./gridster.component","name":"GridsterComponent","line":35,"character":48},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":35,"character":84}]}],"ngOnInit":[{"__symbolic":"method"}],"updateOptions":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"setSize":[{"__symbolic":"method"}],"itemChanged":[{"__symbolic":"method"}],"checkItemChanges":[{"__symbolic":"method"}],"canBeDragged":[{"__symbolic":"method"}],"canBeResized":[{"__symbolic":"method"}]}}}}] |
@@ -1,4 +0,4 @@ | ||
import { ElementRef, Renderer2 } from '@angular/core'; | ||
import { ElementRef, OnDestroy, Renderer2 } from '@angular/core'; | ||
import { GridsterComponent } from './gridster.component'; | ||
export declare class GridsterPreviewComponent { | ||
export declare class GridsterPreviewComponent implements OnDestroy { | ||
renderer: Renderer2; | ||
@@ -8,3 +8,4 @@ el: any; | ||
constructor(el: ElementRef, gridster: GridsterComponent, renderer: Renderer2); | ||
ngOnDestroy(): void; | ||
previewStyle(): void; | ||
} |
@@ -12,2 +12,7 @@ "use strict"; | ||
} | ||
GridsterPreviewComponent.prototype.ngOnDestroy = function () { | ||
delete this.el; | ||
delete this.gridster.previewStyle; | ||
delete this.gridster; | ||
}; | ||
GridsterPreviewComponent.prototype.previewStyle = function () { | ||
@@ -14,0 +19,0 @@ if (!this.gridster.movingItem) { |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterPreviewComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"gridster-preview","template":"","styles":[":host { background: rgba(0, 0, 0, 0.15); position: absolute; }"]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Host"}}],null],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"./gridster.component","name":"GridsterComponent"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2"}]}],"previewStyle":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterPreviewComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":4,"character":1},"arguments":[{"selector":"gridster-preview","template":"","styles":[":host { background: rgba(0, 0, 0, 0.15); position: absolute; }"]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Host","line":13,"character":31}}],null],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":13,"character":18},{"__symbolic":"reference","module":"./gridster.component","name":"GridsterComponent","line":13,"character":48},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":13,"character":84}]}],"ngOnDestroy":[{"__symbolic":"method"}],"previewStyle":[{"__symbolic":"method"}]}}}}] |
@@ -1,2 +0,2 @@ | ||
import { GridsterItemComponent } from './gridsterItem.component'; | ||
import { GridsterItemComponentInterface } from './gridsterItemComponent.interface'; | ||
export declare class GridsterPush { | ||
@@ -9,10 +9,12 @@ fromSouth: string; | ||
private pushedItemsTemp; | ||
private pushedItemsTempInit; | ||
private count; | ||
private pushedItemsTempPath; | ||
private pushedItemsPath; | ||
private gridsterItem; | ||
private gridster; | ||
private pushedItemsOrder; | ||
private tryPattern; | ||
constructor(gridsterItem: GridsterItemComponent); | ||
constructor(gridsterItem: GridsterItemComponentInterface); | ||
destroy(): void; | ||
pushItems(direction: string, disable?: boolean): void; | ||
restoreTempItems(): void; | ||
restoreItems(): void; | ||
@@ -28,6 +30,6 @@ setPushedItems(): void; | ||
private removeFromTempPushed(gridsterItem); | ||
private checkInTempPushed(gridsterItem); | ||
private addToPushed(gridsterItem); | ||
private removeFromPushed(i); | ||
private removeFromPushedItem(gridsterItem); | ||
private checkPushedItem(pushedItem, i); | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var core_1 = require("@angular/core"); | ||
var gridsterItem_component_1 = require("./gridsterItem.component"); | ||
var GridsterPush = (function () { | ||
@@ -9,3 +8,3 @@ function GridsterPush(gridsterItem) { | ||
this.pushedItemsTemp = []; | ||
this.pushedItemsTempInit = []; | ||
this.pushedItemsTempPath = []; | ||
this.pushedItemsPath = []; | ||
@@ -25,14 +24,23 @@ this.gridsterItem = gridsterItem; | ||
} | ||
GridsterPush.prototype.destroy = function () { | ||
delete this.gridster; | ||
delete this.gridsterItem; | ||
}; | ||
GridsterPush.prototype.pushItems = function (direction, disable) { | ||
if (this.gridster.$options.pushItems && !disable) { | ||
this.count = 0; | ||
this.pushedItemsOrder = []; | ||
if (!this.push(this.gridsterItem, direction)) { | ||
var i = this.pushedItemsTemp.length - 1; | ||
for (; i > -1; i--) { | ||
this.removeFromTempPushed(this.pushedItemsTemp[i]); | ||
} | ||
this.restoreTempItems(); | ||
} | ||
this.pushedItemsOrder = []; | ||
this.pushedItemsTemp = []; | ||
this.pushedItemsTempPath = []; | ||
} | ||
}; | ||
GridsterPush.prototype.restoreTempItems = function () { | ||
var i = this.pushedItemsTemp.length - 1; | ||
for (; i > -1; i--) { | ||
this.removeFromTempPushed(this.pushedItemsTemp[i]); | ||
} | ||
}; | ||
GridsterPush.prototype.restoreItems = function () { | ||
@@ -75,8 +83,2 @@ var i = 0; | ||
GridsterPush.prototype.push = function (gridsterItem, direction) { | ||
if (this.count > 3000) { | ||
return false; | ||
} | ||
else { | ||
this.count++; | ||
} | ||
if (this.gridster.checkGridCollision(gridsterItem.$item)) { | ||
@@ -86,22 +88,35 @@ return false; | ||
var a = this.gridster.findItemsWithItem(gridsterItem.$item); | ||
var i = a.length - 1, itemColision; | ||
var i = a.length - 1, itemCollision; | ||
var makePush = true; | ||
var b = []; | ||
for (; i > -1; i--) { | ||
itemColision = a[i]; | ||
if (itemColision === this.gridsterItem) { | ||
itemCollision = a[i]; | ||
if (itemCollision === this.gridsterItem) { | ||
makePush = false; | ||
break; | ||
} | ||
if (!itemColision.canBeDragged()) { | ||
if (!itemCollision.canBeDragged()) { | ||
makePush = false; | ||
break; | ||
} | ||
if (this.tryPattern[direction][0].call(this, itemColision, gridsterItem)) { | ||
if (this.pushedItemsTemp.indexOf(itemCollision) > -1) { | ||
makePush = false; | ||
break; | ||
} | ||
else if (this.tryPattern[direction][1].call(this, itemColision, gridsterItem)) { | ||
if (this.tryPattern[direction][0].call(this, itemCollision, gridsterItem)) { | ||
this.pushedItemsOrder.push(itemCollision); | ||
b.push(itemCollision); | ||
} | ||
else if (this.tryPattern[direction][2].call(this, itemColision, gridsterItem)) { | ||
else if (this.tryPattern[direction][1].call(this, itemCollision, gridsterItem)) { | ||
this.pushedItemsOrder.push(itemCollision); | ||
b.push(itemCollision); | ||
} | ||
else if (this.tryPattern[direction][3].call(this, itemColision, gridsterItem)) { | ||
else if (this.tryPattern[direction][2].call(this, itemCollision, gridsterItem)) { | ||
this.pushedItemsOrder.push(itemCollision); | ||
b.push(itemCollision); | ||
} | ||
else if (this.tryPattern[direction][3].call(this, itemCollision, gridsterItem)) { | ||
this.pushedItemsOrder.push(itemCollision); | ||
b.push(itemCollision); | ||
} | ||
else { | ||
@@ -112,2 +127,14 @@ makePush = false; | ||
} | ||
if (!makePush) { | ||
i = this.pushedItemsOrder.lastIndexOf(b[0]); | ||
if (i > -1) { | ||
var j = this.pushedItemsOrder.length - 1; | ||
for (; j >= i; j--) { | ||
itemCollision = this.pushedItemsOrder[j]; | ||
this.pushedItemsOrder.pop(); | ||
this.removeFromTempPushed(itemCollision); | ||
this.removeFromPushedItem(itemCollision); | ||
} | ||
} | ||
} | ||
return makePush; | ||
@@ -120,3 +147,2 @@ }; | ||
this.addToTempPushed(gridsterItemCollide); | ||
var backUpY = gridsterItemCollide.$item.y; | ||
gridsterItemCollide.$item.y = gridsterItem.$item.y + gridsterItem.$item.rows; | ||
@@ -129,3 +155,3 @@ if (this.push(gridsterItemCollide, this.fromNorth)) { | ||
else { | ||
gridsterItemCollide.$item.y = backUpY; | ||
this.removeFromTempPushed(gridsterItemCollide); | ||
} | ||
@@ -139,3 +165,2 @@ return false; | ||
this.addToTempPushed(gridsterItemCollide); | ||
var backUpY = gridsterItemCollide.$item.y; | ||
gridsterItemCollide.$item.y = gridsterItem.$item.y - gridsterItemCollide.$item.rows; | ||
@@ -148,3 +173,3 @@ if (this.push(gridsterItemCollide, this.fromSouth)) { | ||
else { | ||
gridsterItemCollide.$item.y = backUpY; | ||
this.removeFromTempPushed(gridsterItemCollide); | ||
} | ||
@@ -158,3 +183,2 @@ return false; | ||
this.addToTempPushed(gridsterItemCollide); | ||
var backUpX = gridsterItemCollide.$item.x; | ||
gridsterItemCollide.$item.x = gridsterItem.$item.x + gridsterItem.$item.cols; | ||
@@ -167,3 +191,3 @@ if (this.push(gridsterItemCollide, this.fromWest)) { | ||
else { | ||
gridsterItemCollide.$item.x = backUpX; | ||
this.removeFromTempPushed(gridsterItemCollide); | ||
} | ||
@@ -177,3 +201,2 @@ return false; | ||
this.addToTempPushed(gridsterItemCollide); | ||
var backUpX = gridsterItemCollide.$item.x; | ||
gridsterItemCollide.$item.x = gridsterItem.$item.x - gridsterItemCollide.$item.cols; | ||
@@ -186,3 +209,3 @@ if (this.push(gridsterItemCollide, this.fromEast)) { | ||
else { | ||
gridsterItemCollide.$item.x = backUpX; | ||
this.removeFromTempPushed(gridsterItemCollide); | ||
} | ||
@@ -192,20 +215,23 @@ return false; | ||
GridsterPush.prototype.addToTempPushed = function (gridsterItem) { | ||
if (this.checkInTempPushed(gridsterItem)) { | ||
return; | ||
var i = this.pushedItemsTemp.indexOf(gridsterItem); | ||
if (i === -1) { | ||
i = this.pushedItemsTemp.push(gridsterItem) - 1; | ||
this.pushedItemsTempPath[i] = []; | ||
} | ||
var l = this.pushedItemsTemp.push(gridsterItem); | ||
this.pushedItemsTempInit[l - 1] = { x: gridsterItem.$item.x, y: gridsterItem.$item.y }; | ||
this.pushedItemsTempPath[i].push({ x: gridsterItem.$item.x, y: gridsterItem.$item.y }); | ||
}; | ||
GridsterPush.prototype.removeFromTempPushed = function (gridsterItem) { | ||
var i = this.pushedItemsTemp.indexOf(gridsterItem); | ||
this.pushedItemsTemp.splice(i, 1); | ||
var initPosition = this.pushedItemsTempInit[i]; | ||
gridsterItem.$item.x = initPosition.x; | ||
gridsterItem.$item.y = initPosition.y; | ||
var tempPosition = this.pushedItemsTempPath[i].pop(); | ||
if (!tempPosition) { | ||
return; | ||
} | ||
gridsterItem.$item.x = tempPosition.x; | ||
gridsterItem.$item.y = tempPosition.y; | ||
gridsterItem.setSize(true); | ||
this.pushedItemsTempInit.splice(i, 1); | ||
if (!this.pushedItemsTempPath[i].length) { | ||
this.pushedItemsTemp.splice(i, 1); | ||
this.pushedItemsTempPath.splice(i, 1); | ||
} | ||
}; | ||
GridsterPush.prototype.checkInTempPushed = function (gridsterItem) { | ||
return this.pushedItemsTemp.indexOf(gridsterItem) > -1; | ||
}; | ||
GridsterPush.prototype.addToPushed = function (gridsterItem) { | ||
@@ -228,2 +254,12 @@ if (this.pushedItems.indexOf(gridsterItem) < 0) { | ||
}; | ||
GridsterPush.prototype.removeFromPushedItem = function (gridsterItem) { | ||
var i = this.pushedItems.indexOf(gridsterItem); | ||
if (i > -1) { | ||
this.pushedItemsPath[i].pop(); | ||
if (!this.pushedItemsPath.length) { | ||
this.pushedItems.splice(i, 1); | ||
this.pushedItemsPath.splice(i, 1); | ||
} | ||
} | ||
}; | ||
GridsterPush.prototype.checkPushedItem = function (pushedItem, i) { | ||
@@ -260,3 +296,3 @@ var path = this.pushedItemsPath[i]; | ||
GridsterPush.ctorParameters = function () { return [ | ||
{ type: gridsterItem_component_1.GridsterItemComponent, }, | ||
null, | ||
]; }; | ||
@@ -263,0 +299,0 @@ return GridsterPush; |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterPush":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./gridsterItem.component","name":"GridsterItemComponent"}]}],"pushItems":[{"__symbolic":"method"}],"restoreItems":[{"__symbolic":"method"}],"setPushedItems":[{"__symbolic":"method"}],"checkPushBack":[{"__symbolic":"method"}],"push":[{"__symbolic":"method"}],"trySouth":[{"__symbolic":"method"}],"tryNorth":[{"__symbolic":"method"}],"tryEast":[{"__symbolic":"method"}],"tryWest":[{"__symbolic":"method"}],"addToTempPushed":[{"__symbolic":"method"}],"removeFromTempPushed":[{"__symbolic":"method"}],"checkInTempPushed":[{"__symbolic":"method"}],"addToPushed":[{"__symbolic":"method"}],"removeFromPushed":[{"__symbolic":"method"}],"checkPushedItem":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterPush":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":5,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./gridsterItemComponent.interface","name":"GridsterItemComponentInterface","line":26,"character":28}]}],"destroy":[{"__symbolic":"method"}],"pushItems":[{"__symbolic":"method"}],"restoreTempItems":[{"__symbolic":"method"}],"restoreItems":[{"__symbolic":"method"}],"setPushedItems":[{"__symbolic":"method"}],"checkPushBack":[{"__symbolic":"method"}],"push":[{"__symbolic":"method"}],"trySouth":[{"__symbolic":"method"}],"tryNorth":[{"__symbolic":"method"}],"tryEast":[{"__symbolic":"method"}],"tryWest":[{"__symbolic":"method"}],"addToTempPushed":[{"__symbolic":"method"}],"removeFromTempPushed":[{"__symbolic":"method"}],"addToPushed":[{"__symbolic":"method"}],"removeFromPushed":[{"__symbolic":"method"}],"removeFromPushedItem":[{"__symbolic":"method"}],"checkPushedItem":[{"__symbolic":"method"}]}}}}] |
@@ -1,2 +0,2 @@ | ||
import { GridsterItemComponent } from './gridsterItem.component'; | ||
import { GridsterItemComponentInterface } from './gridsterItemComponent.interface'; | ||
export declare class GridsterPushResize { | ||
@@ -12,3 +12,4 @@ fromSouth: string; | ||
private tryPattern; | ||
constructor(gridsterItem: GridsterItemComponent); | ||
constructor(gridsterItem: GridsterItemComponentInterface); | ||
destroy(): void; | ||
pushItems(direction: string): void; | ||
@@ -15,0 +16,0 @@ restoreItems(): void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var core_1 = require("@angular/core"); | ||
var gridsterItem_component_1 = require("./gridsterItem.component"); | ||
var gridster_component_1 = require("./gridster.component"); | ||
@@ -23,2 +22,6 @@ var GridsterPushResize = (function () { | ||
} | ||
GridsterPushResize.prototype.destroy = function () { | ||
delete this.gridster; | ||
delete this.gridsterItem; | ||
}; | ||
GridsterPushResize.prototype.pushItems = function (direction) { | ||
@@ -216,3 +219,3 @@ if (this.gridster.$options.pushResizeItems) { | ||
GridsterPushResize.ctorParameters = function () { return [ | ||
{ type: gridsterItem_component_1.GridsterItemComponent, }, | ||
null, | ||
]; }; | ||
@@ -219,0 +222,0 @@ return GridsterPushResize; |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterPushResize":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./gridsterItem.component","name":"GridsterItemComponent"}]}],"pushItems":[{"__symbolic":"method"}],"restoreItems":[{"__symbolic":"method"}],"setPushedItems":[{"__symbolic":"method"}],"checkPushBack":[{"__symbolic":"method"}],"push":[{"__symbolic":"method"}],"trySouth":[{"__symbolic":"method"}],"tryNorth":[{"__symbolic":"method"}],"tryEast":[{"__symbolic":"method"}],"tryWest":[{"__symbolic":"method"}],"addToPushed":[{"__symbolic":"method"}],"removeFromPushed":[{"__symbolic":"method"}],"checkPushedItem":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterPushResize":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":7,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./gridsterItemComponent.interface","name":"GridsterItemComponentInterface","line":25,"character":28}]}],"destroy":[{"__symbolic":"method"}],"pushItems":[{"__symbolic":"method"}],"restoreItems":[{"__symbolic":"method"}],"setPushedItems":[{"__symbolic":"method"}],"checkPushBack":[{"__symbolic":"method"}],"push":[{"__symbolic":"method"}],"trySouth":[{"__symbolic":"method"}],"tryNorth":[{"__symbolic":"method"}],"tryEast":[{"__symbolic":"method"}],"tryWest":[{"__symbolic":"method"}],"addToPushed":[{"__symbolic":"method"}],"removeFromPushed":[{"__symbolic":"method"}],"checkPushedItem":[{"__symbolic":"method"}]}}}}] |
@@ -1,9 +0,9 @@ | ||
import { GridsterItemComponent } from './gridsterItem.component'; | ||
import { GridsterResizeEventType } from './gridsterResizeEventType.interface'; | ||
import { GridsterPush } from './gridsterPush.service'; | ||
import { GridsterComponent } from './gridster.component'; | ||
import { GridsterPushResize } from './gridsterPushResize.service'; | ||
import { GridsterItemComponentInterface } from './gridsterItemComponent.interface'; | ||
import { GridsterComponentInterface } from './gridster.interface'; | ||
export declare class GridsterResizable { | ||
gridsterItem: GridsterItemComponent; | ||
gridster: GridsterComponent; | ||
gridsterItem: GridsterItemComponentInterface; | ||
gridster: GridsterComponentInterface; | ||
lastMouse: { | ||
@@ -44,3 +44,4 @@ clientX: number; | ||
newPosition: number; | ||
constructor(gridsterItem: GridsterItemComponent, gridster: GridsterComponent); | ||
constructor(gridsterItem: GridsterItemComponentInterface, gridster: GridsterComponentInterface); | ||
destroy(): void; | ||
dragStart(e: any): void; | ||
@@ -47,0 +48,0 @@ dragMove(e: any): void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var core_1 = require("@angular/core"); | ||
var gridsterItem_component_1 = require("./gridsterItem.component"); | ||
var gridsterScroll_service_1 = require("./gridsterScroll.service"); | ||
var gridsterPush_service_1 = require("./gridsterPush.service"); | ||
var gridster_component_1 = require("./gridster.component"); | ||
var gridsterUtils_service_1 = require("./gridsterUtils.service"); | ||
@@ -21,2 +19,6 @@ var gridsterPushResize_service_1 = require("./gridsterPushResize.service"); | ||
} | ||
GridsterResizable.prototype.destroy = function () { | ||
delete this.gridsterItem; | ||
delete this.gridster; | ||
}; | ||
GridsterResizable.prototype.dragStart = function (e) { | ||
@@ -153,2 +155,6 @@ switch (e.which) { | ||
this.pushResize.restoreItems(); | ||
this.push.destroy(); | ||
delete this.push; | ||
this.pushResize.destroy(); | ||
delete this.pushResize; | ||
}; | ||
@@ -160,2 +166,6 @@ GridsterResizable.prototype.makeResize = function () { | ||
this.pushResize.setPushedItems(); | ||
this.push.destroy(); | ||
delete this.push; | ||
this.pushResize.destroy(); | ||
delete this.pushResize; | ||
}; | ||
@@ -333,4 +343,4 @@ GridsterResizable.prototype.handleN = function (e) { | ||
GridsterResizable.ctorParameters = function () { return [ | ||
{ type: gridsterItem_component_1.GridsterItemComponent, }, | ||
{ type: gridster_component_1.GridsterComponent, }, | ||
null, | ||
null, | ||
]; }; | ||
@@ -337,0 +347,0 @@ return GridsterResizable; |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterResizable":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./gridsterItem.component","name":"GridsterItemComponent"},{"__symbolic":"reference","module":"./gridster.component","name":"GridsterComponent"}]}],"dragStart":[{"__symbolic":"method"}],"dragMove":[{"__symbolic":"method"}],"dragStop":[{"__symbolic":"method"}],"cancelResize":[{"__symbolic":"method"}],"makeResize":[{"__symbolic":"method"}],"handleN":[{"__symbolic":"method"}],"handleW":[{"__symbolic":"method"}],"handleS":[{"__symbolic":"method"}],"handleE":[{"__symbolic":"method"}],"handleNW":[{"__symbolic":"method"}],"handleNE":[{"__symbolic":"method"}],"handleSW":[{"__symbolic":"method"}],"handleSE":[{"__symbolic":"method"}],"toggle":[{"__symbolic":"method"}],"dragStartDelay":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterResizable":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":10,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./gridsterItemComponent.interface","name":"GridsterItemComponentInterface","line":50,"character":28},{"__symbolic":"reference","module":"./gridster.interface","name":"GridsterComponentInterface","line":50,"character":70}]}],"destroy":[{"__symbolic":"method"}],"dragStart":[{"__symbolic":"method"}],"dragMove":[{"__symbolic":"method"}],"dragStop":[{"__symbolic":"method"}],"cancelResize":[{"__symbolic":"method"}],"makeResize":[{"__symbolic":"method"}],"handleN":[{"__symbolic":"method"}],"handleW":[{"__symbolic":"method"}],"handleS":[{"__symbolic":"method"}],"handleE":[{"__symbolic":"method"}],"handleNW":[{"__symbolic":"method"}],"handleNE":[{"__symbolic":"method"}],"handleSW":[{"__symbolic":"method"}],"handleSE":[{"__symbolic":"method"}],"toggle":[{"__symbolic":"method"}],"dragStartDelay":[{"__symbolic":"method"}]}}}}] |
@@ -1,4 +0,4 @@ | ||
import { GridsterItemComponent } from './gridsterItem.component'; | ||
import { GridsterResizeEventType } from './gridsterResizeEventType.interface'; | ||
export declare function scroll(gridsterItem: GridsterItemComponent, e: MouseEvent, lastMouse: any, calculateItemPosition: Function, resize?: boolean, resizeEventScrollType?: GridsterResizeEventType): void; | ||
import { GridsterItemComponentInterface } from './gridsterItemComponent.interface'; | ||
export declare function scroll(gridsterItem: GridsterItemComponentInterface, e: MouseEvent, lastMouse: any, calculateItemPosition: Function, resize?: boolean, resizeEventScrollType?: GridsterResizeEventType): void; | ||
export declare function cancelScroll(): void; |
@@ -1,2 +0,2 @@ | ||
import { GridsterItemComponent } from './gridsterItem.component'; | ||
import { GridsterItemComponentInterface } from './gridsterItemComponent.interface'; | ||
export declare class GridsterSwap { | ||
@@ -6,3 +6,4 @@ private swapedItem; | ||
private gridster; | ||
constructor(gridsterItem: GridsterItemComponent); | ||
constructor(gridsterItem: GridsterItemComponentInterface); | ||
destroy(): void; | ||
swapItems(): void; | ||
@@ -12,3 +13,3 @@ checkSwapBack(): void; | ||
setSwapItem(): void; | ||
checkSwap(pushedBy: GridsterItemComponent): void; | ||
checkSwap(pushedBy: GridsterItemComponentInterface): void; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var core_1 = require("@angular/core"); | ||
var gridsterItem_component_1 = require("./gridsterItem.component"); | ||
var GridsterSwap = (function () { | ||
@@ -10,2 +9,7 @@ function GridsterSwap(gridsterItem) { | ||
} | ||
GridsterSwap.prototype.destroy = function () { | ||
delete this.gridster; | ||
delete this.gridsterItem; | ||
delete this.swapedItem; | ||
}; | ||
GridsterSwap.prototype.swapItems = function () { | ||
@@ -78,3 +82,3 @@ if (this.gridster.$options.swap) { | ||
GridsterSwap.ctorParameters = function () { return [ | ||
{ type: gridsterItem_component_1.GridsterItemComponent, }, | ||
null, | ||
]; }; | ||
@@ -81,0 +85,0 @@ return GridsterSwap; |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterSwap":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./gridsterItem.component","name":"GridsterItemComponent"}]}],"swapItems":[{"__symbolic":"method"}],"checkSwapBack":[{"__symbolic":"method"}],"restoreSwapItem":[{"__symbolic":"method"}],"setSwapItem":[{"__symbolic":"method"}],"checkSwap":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterSwap":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":5,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./gridsterItemComponent.interface","name":"GridsterItemComponentInterface","line":11,"character":28}]}],"destroy":[{"__symbolic":"method"}],"swapItems":[{"__symbolic":"method"}],"checkSwapBack":[{"__symbolic":"method"}],"restoreSwapItem":[{"__symbolic":"method"}],"setSwapItem":[{"__symbolic":"method"}],"checkSwap":[{"__symbolic":"method"}]}}}}] |
@@ -1,2 +0,2 @@ | ||
import { GridsterComponent } from './gridster.component'; | ||
import { GridsterComponentInterface } from './gridster.interface'; | ||
export declare class GridsterUtils { | ||
@@ -6,4 +6,4 @@ static merge(obj1: any, obj2: any, properties: any): any; | ||
static checkTouchEvent(e: any): void; | ||
static checkContentClassForEvent(gridster: GridsterComponent, e: any): boolean; | ||
static checkContentClassForEvent(gridster: GridsterComponentInterface, e: any): boolean; | ||
static checkContentClass(target: any, current: any, contentClass: string): boolean; | ||
} |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterUtils":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}]}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"GridsterUtils":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":4,"character":1}}]}}}] |
{ | ||
"name": "angular-gridster2", | ||
"version": "4.1.0", | ||
"version": "4.2.0", | ||
"license": "MIT", | ||
@@ -49,21 +49,21 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@angular/animations": "5.0.5", | ||
"@angular/cdk": "5.0.0-rc.2", | ||
"@angular/cli": "1.5.5", | ||
"@angular/common": "5.0.5", | ||
"@angular/compiler": "5.0.5", | ||
"@angular/compiler-cli": "5.0.5", | ||
"@angular/core": "5.0.5", | ||
"@angular/forms": "5.0.5", | ||
"@angular/http": "5.0.5", | ||
"@angular/language-service": "5.0.5", | ||
"@angular/material": "5.0.0-rc.2", | ||
"@angular/platform-browser": "5.0.5", | ||
"@angular/platform-browser-dynamic": "5.0.5", | ||
"@angular/platform-server": "5.0.5", | ||
"@angular/router": "5.0.5", | ||
"@angular/animations": "5.1.0", | ||
"@angular/cdk": "5.0.0", | ||
"@angular/cli": "1.6.0", | ||
"@angular/common": "5.1.0", | ||
"@angular/compiler": "5.1.0", | ||
"@angular/compiler-cli": "5.1.0", | ||
"@angular/core": "5.1.0", | ||
"@angular/forms": "5.1.0", | ||
"@angular/http": "5.1.0", | ||
"@angular/language-service": "5.1.0", | ||
"@angular/material": "5.0.0", | ||
"@angular/platform-browser": "5.1.0", | ||
"@angular/platform-browser-dynamic": "5.1.0", | ||
"@angular/platform-server": "5.1.0", | ||
"@angular/router": "5.1.0", | ||
"@types/jasmine": "2.8.2", | ||
"@types/node": "8.0.53", | ||
"@types/node": "8.0.57", | ||
"codelyzer": "4.0.1", | ||
"core-js": "2.5.1", | ||
"core-js": "2.5.2", | ||
"gulp": "3.9.1", | ||
@@ -81,8 +81,8 @@ "gulp-clean": "0.3.2", | ||
"karma-jasmine-html-reporter": "0.2.2", | ||
"protractor": "5.2.0", | ||
"rxjs": "5.5.3", | ||
"protractor": "5.2.1", | ||
"rxjs": "5.5.5", | ||
"systemjs": "0.20.19", | ||
"ts-helpers": "1.1.2", | ||
"ts-node": "3.3.0", | ||
"tslib": "1.8.0", | ||
"tslib": "1.8.1", | ||
"tslint": "5.8.0", | ||
@@ -89,0 +89,0 @@ "typescript": "2.4.2", |
@@ -117,2 +117,3 @@ angular-gridster2 | ||
initCallback: undefined, // callback to call after grid has initialized. Arguments: gridsterComponent | ||
destroyCallback: undefined, // callback to call after grid has destroyed. Arguments: gridsterComponent | ||
itemChangeCallback: undefined, // callback to call for each item when is changes x, y, rows, cols. | ||
@@ -171,3 +172,4 @@ // Arguments: gridsterItem, gridsterItemComponent | ||
displayGrid: 'onDrag&Resize', // display background grid of rows and columns | ||
disableWindowResize: false // disable the window on resize listener. This will stop grid to recalculate on window resize. | ||
disableWindowResize: false, // disable the window on resize listener. This will stop grid to recalculate on window resize. | ||
disableWarnings: false // disable console log warnings about misplacements grid items | ||
}; | ||
@@ -174,0 +176,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
179688
72
3190
276