angular-gridster2
Advanced tools
Comparing version 3.11.2 to 3.11.3
@@ -5,13 +5,15 @@ import { OnInit, ElementRef, OnDestroy, Renderer2, ChangeDetectorRef } from '@angular/core'; | ||
import { GridsterGridComponent } from './gridsterGrid.component'; | ||
import { GridsterItem } from './gridsterItem.interface'; | ||
import { GridsterEmptyCell } from './gridsterEmptyCell.service'; | ||
import { GridsterCompact } from './gridsterCompact.service'; | ||
import { GridsterConfigS } from './gridsterConfigS.interface'; | ||
import { GridsterItemS } from './gridsterItemS.interface'; | ||
export declare class GridsterComponent implements OnInit, OnDestroy { | ||
renderer: Renderer2; | ||
private cdRef; | ||
cdRef: ChangeDetectorRef; | ||
options: GridsterConfig; | ||
calculateLayoutDebounce: Function; | ||
movingItem: GridsterItem; | ||
initialItem: GridsterItem; | ||
movingItem: GridsterItemS; | ||
previewStyle: Function; | ||
el: any; | ||
$options: GridsterConfig; | ||
$options: GridsterConfigS; | ||
mobile: boolean; | ||
@@ -25,12 +27,8 @@ curWidth: number; | ||
curRowHeight: number; | ||
windowResize: Function; | ||
emptyCellClick: Function; | ||
emptyCellDrop: Function; | ||
emptyCellDrag: Function; | ||
emptyCellMMove: Function; | ||
emptyCellUp: Function; | ||
emptyCellMove: Function; | ||
windowResize: Function | null; | ||
gridLines: GridsterGridComponent; | ||
dragInProgress: boolean; | ||
static checkCollisionTwoItems(item: GridsterItem, item2: GridsterItem): boolean; | ||
emptyCell: GridsterEmptyCell; | ||
compact: GridsterCompact; | ||
static checkCollisionTwoItems(item: GridsterItemS, item2: GridsterItemS): boolean; | ||
constructor(el: ElementRef, renderer: Renderer2, cdRef: ChangeDetectorRef); | ||
@@ -42,9 +40,2 @@ ngOnInit(): void; | ||
ngOnDestroy(): void; | ||
emptyCellClickCb(e: any): void; | ||
emptyCellDragDrop(e: any): void; | ||
emptyCellDragOver(e: any): void; | ||
emptyCellMouseDown(e: any): void; | ||
emptyCellMouseMove(e: any): void; | ||
emptyCellMouseUp(e: any): void; | ||
getValidItemFromEvent(e: any, oldItem?: GridsterItem): GridsterItem | undefined; | ||
onResize(): void; | ||
@@ -57,7 +48,7 @@ checkIfToResize(): boolean; | ||
removeItem(itemComponent: GridsterItemComponent): void; | ||
checkCollision(itemComponent: GridsterItem): GridsterItemComponent | boolean; | ||
checkGridCollision(itemComponent: GridsterItem): boolean; | ||
findItemWithItem(itemComponent: GridsterItem): GridsterItemComponent; | ||
checkCollision(itemComponent: GridsterItemS): GridsterItemComponent | boolean; | ||
checkGridCollision(itemComponent: GridsterItemS): boolean; | ||
findItemWithItem(itemComponent: GridsterItemS): GridsterItemComponent | boolean; | ||
autoPositionItem(itemComponent: GridsterItemComponent): void; | ||
getNextPossiblePosition(newItem: GridsterItem): boolean; | ||
getNextPossiblePosition(newItem: GridsterItemS): boolean; | ||
pixelsToPosition(x: number, y: number, roundingMethod: Function): [number, number]; | ||
@@ -68,7 +59,2 @@ pixelsToPositionX(x: number, roundingMethod: Function): number; | ||
positionYToPixels(y: number): number; | ||
checkCompact(): void; | ||
checkCompactUp(): boolean; | ||
moveUpTillCollision(itemComponent: GridsterItemComponent): boolean; | ||
checkCompactLeft(): boolean; | ||
moveLeftTillCollision(itemComponent: GridsterItemComponent): boolean; | ||
} |
@@ -6,2 +6,4 @@ "use strict"; | ||
var gridsterUtils_service_1 = require("./gridsterUtils.service"); | ||
var gridsterEmptyCell_service_1 = require("./gridsterEmptyCell.service"); | ||
var gridsterCompact_service_1 = require("./gridsterCompact.service"); | ||
var GridsterComponent = (function () { | ||
@@ -30,2 +32,4 @@ function GridsterComponent(el, renderer, cdRef) { | ||
this.$options.emptyCellDragCallback = undefined; | ||
this.emptyCell = new gridsterEmptyCell_service_1.GridsterEmptyCell(this); | ||
this.compact = new gridsterCompact_service_1.GridsterCompact(this); | ||
} | ||
@@ -78,26 +82,3 @@ GridsterComponent.checkCollisionTwoItems = function (item, item2) { | ||
} | ||
if (this.$options.enableEmptyCellClick && !this.emptyCellClick && this.$options.emptyCellClickCallback) { | ||
this.emptyCellClick = this.renderer.listen(this.el, 'click', this.emptyCellClickCb.bind(this)); | ||
} | ||
else if (!this.$options.enableEmptyCellClick && this.emptyCellClick) { | ||
this.emptyCellClick(); | ||
this.emptyCellClick = null; | ||
} | ||
if (this.$options.enableEmptyCellDrop && !this.emptyCellDrop && this.$options.emptyCellDropCallback) { | ||
this.emptyCellDrop = this.renderer.listen(this.el, 'drop', this.emptyCellDragDrop.bind(this)); | ||
this.emptyCellMove = this.renderer.listen(this.el, 'dragover', this.emptyCellDragOver.bind(this)); | ||
} | ||
else if (!this.$options.enableEmptyCellDrop && this.emptyCellDrop) { | ||
this.emptyCellDrop(); | ||
this.emptyCellMove(); | ||
this.emptyCellMove = null; | ||
this.emptyCellDrop = null; | ||
} | ||
if (this.$options.enableEmptyCellDrag && !this.emptyCellDrag && this.$options.emptyCellDragCallback) { | ||
this.emptyCellDrag = this.renderer.listen(this.el, 'mousedown', this.emptyCellMouseDown.bind(this)); | ||
} | ||
else if (!this.$options.enableEmptyCellDrag && this.emptyCellDrag) { | ||
this.emptyCellDrag(); | ||
this.emptyCellDrag = null; | ||
} | ||
this.emptyCell.updateOptions(); | ||
}; | ||
@@ -118,106 +99,2 @@ GridsterComponent.prototype.optionsChanged = function () { | ||
}; | ||
GridsterComponent.prototype.emptyCellClickCb = function (e) { | ||
if (gridsterUtils_service_1.GridsterUtils.checkContentClassForEvent(this, e)) { | ||
return; | ||
} | ||
var item = this.getValidItemFromEvent(e); | ||
if (!item || this.movingItem) { | ||
return; | ||
} | ||
this.$options.emptyCellClickCallback(event, item); | ||
this.cdRef.markForCheck(); | ||
}; | ||
GridsterComponent.prototype.emptyCellDragDrop = function (e) { | ||
var item = this.getValidItemFromEvent(e); | ||
if (!item) { | ||
return; | ||
} | ||
this.$options.emptyCellDropCallback(event, item); | ||
this.cdRef.markForCheck(); | ||
}; | ||
GridsterComponent.prototype.emptyCellDragOver = function (e) { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
if (this.getValidItemFromEvent(e)) { | ||
e.dataTransfer.dropEffect = 'move'; | ||
} | ||
else { | ||
e.dataTransfer.dropEffect = 'none'; | ||
} | ||
}; | ||
GridsterComponent.prototype.emptyCellMouseDown = function (e) { | ||
if (gridsterUtils_service_1.GridsterUtils.checkContentClassForEvent(this, e)) { | ||
return; | ||
} | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
var item = this.getValidItemFromEvent(e); | ||
if (!item) { | ||
return; | ||
} | ||
this.initialItem = item; | ||
this.movingItem = item; | ||
this.previewStyle(); | ||
this.emptyCellMMove = this.renderer.listen('window', 'mousemove', this.emptyCellMouseMove.bind(this)); | ||
this.emptyCellUp = this.renderer.listen('window', 'mouseup', this.emptyCellMouseUp.bind(this)); | ||
}; | ||
GridsterComponent.prototype.emptyCellMouseMove = function (e) { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
var item = this.getValidItemFromEvent(e, this.initialItem); | ||
if (!item) { | ||
return; | ||
} | ||
this.movingItem = item; | ||
this.previewStyle(); | ||
}; | ||
GridsterComponent.prototype.emptyCellMouseUp = function (e) { | ||
this.emptyCellMMove(); | ||
this.emptyCellUp(); | ||
var item = this.getValidItemFromEvent(e, this.initialItem); | ||
if (!item) { | ||
return; | ||
} | ||
this.movingItem = item; | ||
this.$options.emptyCellDragCallback(e, this.movingItem); | ||
setTimeout(function () { | ||
this.movingItem = null; | ||
this.previewStyle(); | ||
}.bind(this)); | ||
this.cdRef.markForCheck(); | ||
}; | ||
GridsterComponent.prototype.getValidItemFromEvent = function (e, oldItem) { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
gridsterUtils_service_1.GridsterUtils.checkTouchEvent(e); | ||
var rect = this.el.getBoundingClientRect(); | ||
var x = e.clientX + this.el.scrollLeft - rect.left; | ||
var y = e.clientY + this.el.scrollTop - rect.top; | ||
var item = { | ||
x: this.pixelsToPositionX(x, Math.floor), | ||
y: this.pixelsToPositionY(y, Math.floor), | ||
cols: this.$options.defaultItemCols, | ||
rows: this.$options.defaultItemRows | ||
}; | ||
if (oldItem) { | ||
item.cols = Math.min(Math.abs(oldItem.x - item.x) + 1, this.$options.emptyCellDragMaxCols); | ||
item.rows = Math.min(Math.abs(oldItem.y - item.y) + 1, this.$options.emptyCellDragMaxRows); | ||
if (oldItem.x < item.x) { | ||
item.x = oldItem.x; | ||
} | ||
else if (oldItem.x - item.x > this.$options.emptyCellDragMaxCols - 1) { | ||
item.x = this.movingItem.x; | ||
} | ||
if (oldItem.y < item.y) { | ||
item.y = oldItem.y; | ||
} | ||
else if (oldItem.y - item.y > this.$options.emptyCellDragMaxRows - 1) { | ||
item.y = this.movingItem.y; | ||
} | ||
} | ||
if (this.checkCollision(item)) { | ||
return; | ||
} | ||
return item; | ||
}; | ||
GridsterComponent.prototype.onResize = function () { | ||
@@ -269,3 +146,3 @@ this.setGridSize(); | ||
// check to compact | ||
this.checkCompact(); | ||
this.compact.checkCompact(); | ||
this.setGridDimensions(); | ||
@@ -280,6 +157,6 @@ if (this.$options.outerMargin) { | ||
} | ||
var addClass; | ||
var removeClass1; | ||
var removeClass2; | ||
var removeClass3; | ||
var addClass = ''; | ||
var removeClass1 = ''; | ||
var removeClass2 = ''; | ||
var removeClass3 = ''; | ||
if (this.$options.gridType === 'fit') { | ||
@@ -366,4 +243,2 @@ addClass = 'fit'; | ||
JSON.stringify(itemComponent.item, ['cols', 'rows', 'x', 'y'])); | ||
itemComponent.$item.x = undefined; | ||
itemComponent.$item.y = undefined; | ||
this.autoPositionItem(itemComponent); | ||
@@ -415,2 +290,3 @@ } | ||
} | ||
return false; | ||
}; | ||
@@ -461,2 +337,3 @@ GridsterComponent.prototype.autoPositionItem = function (itemComponent) { | ||
} | ||
return false; | ||
}; | ||
@@ -478,76 +355,2 @@ GridsterComponent.prototype.pixelsToPosition = function (x, y, roundingMethod) { | ||
}; | ||
GridsterComponent.prototype.checkCompact = function () { | ||
if (this.$options.compactType !== 'none') { | ||
if (this.$options.compactType === 'compactUp') { | ||
this.checkCompactUp(); | ||
} | ||
else if (this.$options.compactType === 'compactLeft') { | ||
this.checkCompactLeft(); | ||
} | ||
else if (this.$options.compactType === 'compactUp&Left') { | ||
this.checkCompactUp(); | ||
this.checkCompactLeft(); | ||
} | ||
else if (this.$options.compactType === 'compactLeft&Up') { | ||
this.checkCompactLeft(); | ||
this.checkCompactUp(); | ||
} | ||
} | ||
}; | ||
GridsterComponent.prototype.checkCompactUp = function () { | ||
var widgetMovedUp = false, widget, moved; | ||
var l = this.grid.length; | ||
for (var i = 0; i < l; i++) { | ||
widget = this.grid[i]; | ||
moved = this.moveUpTillCollision(widget); | ||
if (moved) { | ||
widgetMovedUp = true; | ||
widget.item.y = widget.$item.y; | ||
widget.itemChanged(); | ||
} | ||
} | ||
if (widgetMovedUp) { | ||
this.checkCompactUp(); | ||
return widgetMovedUp; | ||
} | ||
}; | ||
GridsterComponent.prototype.moveUpTillCollision = function (itemComponent) { | ||
itemComponent.$item.y -= 1; | ||
if (this.checkCollision(itemComponent.$item)) { | ||
itemComponent.$item.y += 1; | ||
return false; | ||
} | ||
else { | ||
this.moveUpTillCollision(itemComponent); | ||
return true; | ||
} | ||
}; | ||
GridsterComponent.prototype.checkCompactLeft = function () { | ||
var widgetMovedUp = false, widget, moved; | ||
var l = this.grid.length; | ||
for (var i = 0; i < l; i++) { | ||
widget = this.grid[i]; | ||
moved = this.moveLeftTillCollision(widget); | ||
if (moved) { | ||
widgetMovedUp = true; | ||
widget.item.x = widget.$item.x; | ||
widget.itemChanged(); | ||
} | ||
} | ||
if (widgetMovedUp) { | ||
this.checkCompactLeft(); | ||
return widgetMovedUp; | ||
} | ||
}; | ||
GridsterComponent.prototype.moveLeftTillCollision = function (itemComponent) { | ||
itemComponent.$item.x -= 1; | ||
if (this.checkCollision(itemComponent.$item)) { | ||
itemComponent.$item.x += 1; | ||
return false; | ||
} | ||
else { | ||
this.moveUpTillCollision(itemComponent); | ||
return true; | ||
} | ||
}; | ||
GridsterComponent.decorators = [ | ||
@@ -554,0 +357,0 @@ { type: core_1.Component, args: [{ |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"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) /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"}],"resize":[{"__symbolic":"method"}],"setOptions":[{"__symbolic":"method"}],"optionsChanged":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"emptyCellClickCb":[{"__symbolic":"method"}],"emptyCellDragDrop":[{"__symbolic":"method"}],"emptyCellDragOver":[{"__symbolic":"method"}],"emptyCellMouseDown":[{"__symbolic":"method"}],"emptyCellMouseMove":[{"__symbolic":"method"}],"emptyCellMouseUp":[{"__symbolic":"method"}],"getValidItemFromEvent":[{"__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"}],"autoPositionItem":[{"__symbolic":"method"}],"getNextPossiblePosition":[{"__symbolic":"method"}],"pixelsToPosition":[{"__symbolic":"method"}],"pixelsToPositionX":[{"__symbolic":"method"}],"pixelsToPositionY":[{"__symbolic":"method"}],"positionXToPixels":[{"__symbolic":"method"}],"positionYToPixels":[{"__symbolic":"method"}],"checkCompact":[{"__symbolic":"method"}],"checkCompactUp":[{"__symbolic":"method"}],"moveUpTillCollision":[{"__symbolic":"method"}],"checkCompactLeft":[{"__symbolic":"method"}],"moveLeftTillCollision":[{"__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":1,"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) /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"}],"resize":[{"__symbolic":"method"}],"setOptions":[{"__symbolic":"method"}],"optionsChanged":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"emptyCellClickCb":[{"__symbolic":"method"}],"emptyCellDragDrop":[{"__symbolic":"method"}],"emptyCellDragOver":[{"__symbolic":"method"}],"emptyCellMouseDown":[{"__symbolic":"method"}],"emptyCellMouseMove":[{"__symbolic":"method"}],"emptyCellMouseUp":[{"__symbolic":"method"}],"getValidItemFromEvent":[{"__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"}],"autoPositionItem":[{"__symbolic":"method"}],"getNextPossiblePosition":[{"__symbolic":"method"}],"pixelsToPosition":[{"__symbolic":"method"}],"pixelsToPositionX":[{"__symbolic":"method"}],"pixelsToPositionY":[{"__symbolic":"method"}],"positionXToPixels":[{"__symbolic":"method"}],"positionYToPixels":[{"__symbolic":"method"}],"checkCompact":[{"__symbolic":"method"}],"checkCompactUp":[{"__symbolic":"method"}],"moveUpTillCollision":[{"__symbolic":"method"}],"checkCompactLeft":[{"__symbolic":"method"}],"moveLeftTillCollision":[{"__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":3,"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) /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"}],"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"}],"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":1,"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) /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"}],"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"}],"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"}}}}}}}}] |
@@ -54,11 +54,8 @@ export declare type GridType = 'fit' | 'scrollVertical' | 'scrollHorizontal' | 'fixed' | 'verticalFixed' | 'horizontalFixed'; | ||
} | ||
export interface Draggable { | ||
enabled?: boolean; | ||
export interface Draggable extends DragBase { | ||
ignoreContentClass?: string; | ||
ignoreContent?: boolean; | ||
dragHandleClass?: string; | ||
stop?: Function; | ||
start?: Function; | ||
} | ||
export interface Resizable extends Draggable { | ||
export interface Resizable extends DragBase { | ||
handles?: { | ||
@@ -75,1 +72,6 @@ s: boolean; | ||
} | ||
export interface DragBase { | ||
enabled?: boolean; | ||
stop?: Function; | ||
start?: Function; | ||
} |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"GridsterConfig":{"__symbolic":"interface"},"Draggable":{"__symbolic":"interface"},"Resizable":{"__symbolic":"interface"}}},{"__symbolic":"module","version":1,"metadata":{"GridsterConfig":{"__symbolic":"interface"},"Draggable":{"__symbolic":"interface"},"Resizable":{"__symbolic":"interface"}}}] | ||
[{"__symbolic":"module","version":3,"metadata":{"GridsterConfig":{"__symbolic":"interface"},"Draggable":{"__symbolic":"interface"},"Resizable":{"__symbolic":"interface"},"DragBase":{"__symbolic":"interface"}}},{"__symbolic":"module","version":1,"metadata":{"GridsterConfig":{"__symbolic":"interface"},"Draggable":{"__symbolic":"interface"},"Resizable":{"__symbolic":"interface"},"DragBase":{"__symbolic":"interface"}}}] |
@@ -62,3 +62,3 @@ "use strict"; | ||
this.gridster.gridLines.updateGrid(); | ||
this.path.push({ x: this.gridsterItem.item.x, y: this.gridsterItem.item.y }); | ||
this.path.push({ x: this.gridsterItem.item.x || 0, y: this.gridsterItem.item.y || 0 }); | ||
}; | ||
@@ -108,9 +108,7 @@ GridsterDraggable.prototype.dragMove = function (e) { | ||
GridsterDraggable.prototype.cancelDrag = function () { | ||
this.gridsterItem.$item.x = this.gridsterItem.item.x; | ||
this.gridsterItem.$item.y = this.gridsterItem.item.y; | ||
this.gridsterItem.$item.x = this.gridsterItem.item.x || 0; | ||
this.gridsterItem.$item.y = this.gridsterItem.item.y || 0; | ||
this.gridsterItem.setSize(true); | ||
this.push.restoreItems(); | ||
this.push = undefined; | ||
this.swap.restoreSwapItem(); | ||
this.swap = undefined; | ||
}; | ||
@@ -121,5 +119,3 @@ GridsterDraggable.prototype.makeDrag = function () { | ||
this.push.setPushedItems(); | ||
this.push = undefined; | ||
this.swap.setSwapItem(); | ||
this.swap = undefined; | ||
}; | ||
@@ -126,0 +122,0 @@ GridsterDraggable.prototype.calculateItemPosition = function () { |
@@ -6,2 +6,3 @@ import { OnInit, ElementRef, OnDestroy, EventEmitter, Renderer2 } from '@angular/core'; | ||
import { GridsterResizable } from './gridsterResizable.service'; | ||
import { GridsterItemS } from './gridsterItemS.interface'; | ||
export declare class GridsterItemComponent implements OnInit, OnDestroy { | ||
@@ -12,3 +13,3 @@ renderer: Renderer2; | ||
itemResize: EventEmitter<GridsterItem>; | ||
$item: GridsterItem; | ||
$item: GridsterItemS; | ||
el: any; | ||
@@ -15,0 +16,0 @@ gridster: GridsterComponent; |
@@ -15,2 +15,17 @@ "use strict"; | ||
this.$item = { | ||
cols: -1, | ||
rows: -1, | ||
x: -1, | ||
y: -1, | ||
}; | ||
this.gridster = gridster; | ||
this.drag = new gridsterDraggable_service_1.GridsterDraggable(this, gridster); | ||
this.resize = new gridsterResizable_service_1.GridsterResizable(this, gridster); | ||
} | ||
GridsterItemComponent.prototype.ngOnInit = function () { | ||
this.updateOptions(); | ||
this.gridster.addItem(this); | ||
}; | ||
GridsterItemComponent.prototype.updateOptions = function () { | ||
this.$item = gridsterUtils_service_1.GridsterUtils.merge(this.$item, this.item, { | ||
cols: undefined, | ||
@@ -27,14 +42,4 @@ rows: undefined, | ||
minItemCols: undefined | ||
}; | ||
this.gridster = gridster; | ||
this.drag = new gridsterDraggable_service_1.GridsterDraggable(this, gridster); | ||
this.resize = new gridsterResizable_service_1.GridsterResizable(this, gridster); | ||
} | ||
GridsterItemComponent.prototype.ngOnInit = function () { | ||
this.updateOptions(); | ||
this.gridster.addItem(this); | ||
}); | ||
}; | ||
GridsterItemComponent.prototype.updateOptions = function () { | ||
this.$item = gridsterUtils_service_1.GridsterUtils.merge(this.$item, this.item, this.$item); | ||
}; | ||
GridsterItemComponent.prototype.ngOnDestroy = function () { | ||
@@ -104,6 +109,6 @@ this.gridster.removeItem(this); | ||
if (this.gridster.checkCollision(this.$item)) { | ||
this.$item.x = oldValue.x; | ||
this.$item.y = oldValue.y; | ||
this.$item.cols = oldValue.cols; | ||
this.$item.rows = oldValue.rows; | ||
this.$item.x = oldValue.x || 0; | ||
this.$item.y = oldValue.y || 0; | ||
this.$item.cols = oldValue.cols || 1; | ||
this.$item.rows = oldValue.rows || 1; | ||
} | ||
@@ -110,0 +115,0 @@ else { |
@@ -34,8 +34,8 @@ "use strict"; | ||
pushedItem = this.pushedItems[i]; | ||
pushedItem.$item.x = pushedItem.item.x; | ||
pushedItem.$item.y = pushedItem.item.y; | ||
pushedItem.$item.x = pushedItem.item.x || 0; | ||
pushedItem.$item.y = pushedItem.item.y || 0; | ||
pushedItem.setSize(true); | ||
} | ||
this.pushedItems = undefined; | ||
this.pushedItemsPath = undefined; | ||
this.pushedItems = []; | ||
this.pushedItemsPath = []; | ||
}; | ||
@@ -50,4 +50,4 @@ GridsterPush.prototype.setPushedItems = function () { | ||
} | ||
this.pushedItems = undefined; | ||
this.pushedItemsPath = undefined; | ||
this.pushedItems = []; | ||
this.pushedItemsPath = []; | ||
}; | ||
@@ -72,5 +72,6 @@ GridsterPush.prototype.push = function (gridsterItem, direction) { | ||
} | ||
else if (gridsterItemCollision === undefined) { | ||
else if (gridsterItemCollision === false) { | ||
return true; | ||
} | ||
return false; | ||
}; | ||
@@ -90,2 +91,3 @@ GridsterPush.prototype.trySouth = function (gridsterItemCollide, gridsterItem, direction) { | ||
} | ||
return false; | ||
}; | ||
@@ -105,2 +107,3 @@ GridsterPush.prototype.tryNorth = function (gridsterItemCollide, gridsterItem, direction) { | ||
} | ||
return false; | ||
}; | ||
@@ -120,2 +123,3 @@ GridsterPush.prototype.tryEast = function (gridsterItemCollide, gridsterItem, direction) { | ||
} | ||
return false; | ||
}; | ||
@@ -135,2 +139,3 @@ GridsterPush.prototype.tryWest = function (gridsterItemCollide, gridsterItem, direction) { | ||
} | ||
return false; | ||
}; | ||
@@ -140,3 +145,4 @@ GridsterPush.prototype.addToPushed = function (gridsterItem) { | ||
this.pushedItems.push(gridsterItem); | ||
this.pushedItemsPath.push([{ x: gridsterItem.item.x, y: gridsterItem.item.y }, { x: gridsterItem.$item.x, y: gridsterItem.$item.y }]); | ||
this.pushedItemsPath.push([{ x: gridsterItem.item.x || 0, y: gridsterItem.item.y || 0 }, | ||
{ x: gridsterItem.$item.x, y: gridsterItem.$item.y }]); | ||
} | ||
@@ -189,2 +195,3 @@ else { | ||
} | ||
return false; | ||
}; | ||
@@ -191,0 +198,0 @@ GridsterPush.decorators = [ |
@@ -34,10 +34,10 @@ "use strict"; | ||
pushedItem = this.pushedItems[i]; | ||
pushedItem.$item.x = pushedItem.item.x; | ||
pushedItem.$item.y = pushedItem.item.y; | ||
pushedItem.$item.cols = pushedItem.item.cols; | ||
pushedItem.$item.row = pushedItem.item.row; | ||
pushedItem.$item.x = pushedItem.item.x || 0; | ||
pushedItem.$item.y = pushedItem.item.y || 0; | ||
pushedItem.$item.cols = pushedItem.item.cols || 1; | ||
pushedItem.$item.row = pushedItem.item.row || 1; | ||
pushedItem.setSize(true); | ||
} | ||
this.pushedItems = undefined; | ||
this.pushedItemsPath = undefined; | ||
this.pushedItems = []; | ||
this.pushedItemsPath = []; | ||
}; | ||
@@ -52,4 +52,4 @@ GridsterPushResize.prototype.setPushedItems = function () { | ||
} | ||
this.pushedItems = undefined; | ||
this.pushedItemsPath = undefined; | ||
this.pushedItems = []; | ||
this.pushedItemsPath = []; | ||
}; | ||
@@ -64,5 +64,6 @@ GridsterPushResize.prototype.push = function (gridsterItem, direction) { | ||
} | ||
else if (gridsterItemCollision === undefined) { | ||
else if (gridsterItemCollision === false) { | ||
return true; | ||
} | ||
return false; | ||
}; | ||
@@ -85,2 +86,3 @@ GridsterPushResize.prototype.trySouth = function (gridsterItemCollide, gridsterItem, direction) { | ||
} | ||
return false; | ||
}; | ||
@@ -100,2 +102,3 @@ GridsterPushResize.prototype.tryNorth = function (gridsterItemCollide, gridsterItem, direction) { | ||
} | ||
return false; | ||
}; | ||
@@ -118,2 +121,3 @@ GridsterPushResize.prototype.tryEast = function (gridsterItemCollide, gridsterItem, direction) { | ||
} | ||
return false; | ||
}; | ||
@@ -133,2 +137,3 @@ GridsterPushResize.prototype.tryWest = function (gridsterItemCollide, gridsterItem, direction) { | ||
} | ||
return false; | ||
}; | ||
@@ -210,2 +215,3 @@ GridsterPushResize.prototype.addToPushed = function (gridsterItem) { | ||
} | ||
return false; | ||
}; | ||
@@ -212,0 +218,0 @@ GridsterPushResize.decorators = [ |
@@ -144,11 +144,9 @@ "use strict"; | ||
GridsterResizable.prototype.cancelResize = function () { | ||
this.gridsterItem.$item.cols = this.gridsterItem.item.cols; | ||
this.gridsterItem.$item.rows = this.gridsterItem.item.rows; | ||
this.gridsterItem.$item.x = this.gridsterItem.item.x; | ||
this.gridsterItem.$item.y = this.gridsterItem.item.y; | ||
this.gridsterItem.$item.cols = this.gridsterItem.item.cols || 1; | ||
this.gridsterItem.$item.rows = this.gridsterItem.item.rows || 1; | ||
this.gridsterItem.$item.x = this.gridsterItem.item.x || 0; | ||
this.gridsterItem.$item.y = this.gridsterItem.item.y || 0; | ||
this.gridsterItem.setSize(true); | ||
this.push.restoreItems(); | ||
this.push = undefined; | ||
this.pushResize.restoreItems(); | ||
this.pushResize = undefined; | ||
}; | ||
@@ -159,5 +157,3 @@ GridsterResizable.prototype.makeResize = function () { | ||
this.push.setPushedItems(); | ||
this.push = undefined; | ||
this.pushResize.setPushedItems(); | ||
this.pushResize = undefined; | ||
}; | ||
@@ -164,0 +160,0 @@ GridsterResizable.prototype.handleN = function (e) { |
@@ -27,3 +27,3 @@ "use strict"; | ||
cancelN(); | ||
if ((resizeEvent && !resizeEventType.s) || intervalS) { | ||
if ((resizeEvent && resizeEventType && !resizeEventType.s) || intervalS) { | ||
return; | ||
@@ -35,3 +35,3 @@ } | ||
cancelS(); | ||
if ((resizeEvent && !resizeEventType.n) || intervalN) { | ||
if ((resizeEvent && resizeEventType && !resizeEventType.n) || intervalN) { | ||
return; | ||
@@ -48,3 +48,3 @@ } | ||
cancelW(); | ||
if ((resizeEvent && !resizeEventType.e) || intervalE) { | ||
if ((resizeEvent && resizeEventType && !resizeEventType.e) || intervalE) { | ||
return; | ||
@@ -56,3 +56,3 @@ } | ||
cancelE(); | ||
if ((resizeEvent && !resizeEventType.w) || intervalW) { | ||
if ((resizeEvent && resizeEventType && !resizeEventType.w) || intervalW) { | ||
return; | ||
@@ -92,6 +92,3 @@ } | ||
cancelVertical(); | ||
scrollSensitivity = undefined; | ||
scrollSpeed = undefined; | ||
gridsterElement = undefined; | ||
resizeEventType = undefined; | ||
} | ||
@@ -110,3 +107,3 @@ exports.cancelScroll = cancelScroll; | ||
clearInterval(intervalE); | ||
intervalE = undefined; | ||
intervalE = 0; | ||
} | ||
@@ -117,3 +114,3 @@ } | ||
clearInterval(intervalW); | ||
intervalW = undefined; | ||
intervalW = 0; | ||
} | ||
@@ -124,3 +121,3 @@ } | ||
clearInterval(intervalS); | ||
intervalS = undefined; | ||
intervalS = 0; | ||
} | ||
@@ -131,5 +128,5 @@ } | ||
clearInterval(intervalN); | ||
intervalN = undefined; | ||
intervalN = 0; | ||
} | ||
} | ||
//# sourceMappingURL=gridsterScroll.service.js.map |
@@ -21,4 +21,4 @@ "use strict"; | ||
var y = this.swapedItem.$item.y; | ||
this.swapedItem.$item.x = this.swapedItem.item.x; | ||
this.swapedItem.$item.y = this.swapedItem.item.y; | ||
this.swapedItem.$item.x = this.swapedItem.item.x || 0; | ||
this.swapedItem.$item.y = this.swapedItem.item.y || 0; | ||
if (this.gridster.checkCollision(this.swapedItem.$item)) { | ||
@@ -30,4 +30,4 @@ this.swapedItem.$item.x = x; | ||
this.swapedItem.setSize(true); | ||
this.gridsterItem.$item.x = this.gridsterItem.item.x; | ||
this.gridsterItem.$item.y = this.gridsterItem.item.y; | ||
this.gridsterItem.$item.x = this.gridsterItem.item.x || 0; | ||
this.gridsterItem.$item.y = this.gridsterItem.item.y || 0; | ||
this.swapedItem = undefined; | ||
@@ -39,4 +39,4 @@ } | ||
if (this.swapedItem) { | ||
this.swapedItem.$item.x = this.swapedItem.item.x; | ||
this.swapedItem.$item.y = this.swapedItem.item.y; | ||
this.swapedItem.$item.x = this.swapedItem.item.x || 0; | ||
this.swapedItem.$item.y = this.swapedItem.item.y || 0; | ||
this.swapedItem.setSize(true); | ||
@@ -56,11 +56,11 @@ this.swapedItem = undefined; | ||
var gridsterItemCollide = gridsterItemCollision; | ||
gridsterItemCollide.$item.x = pushedBy.item.x; | ||
gridsterItemCollide.$item.y = pushedBy.item.y; | ||
pushedBy.$item.x = gridsterItemCollide.item.x; | ||
pushedBy.$item.y = gridsterItemCollide.item.y; | ||
gridsterItemCollide.$item.x = pushedBy.item.x || 0; | ||
gridsterItemCollide.$item.y = pushedBy.item.y || 0; | ||
pushedBy.$item.x = gridsterItemCollide.item.x || 0; | ||
pushedBy.$item.y = gridsterItemCollide.item.y || 0; | ||
if (this.gridster.checkCollision(gridsterItemCollide.$item) || this.gridster.checkCollision(pushedBy.$item)) { | ||
pushedBy.$item.x = gridsterItemCollide.$item.x; | ||
pushedBy.$item.y = gridsterItemCollide.$item.y; | ||
gridsterItemCollide.$item.x = gridsterItemCollide.item.x; | ||
gridsterItemCollide.$item.y = gridsterItemCollide.item.y; | ||
gridsterItemCollide.$item.x = gridsterItemCollide.item.x || 0; | ||
gridsterItemCollide.$item.y = gridsterItemCollide.item.y || 0; | ||
} | ||
@@ -67,0 +67,0 @@ else { |
@@ -0,1 +1,2 @@ | ||
import { GridsterComponent } from './gridster.component'; | ||
export declare class GridsterUtils { | ||
@@ -5,4 +6,4 @@ static merge(obj1: any, obj2: any, properties: any): any; | ||
static checkTouchEvent(e: any): void; | ||
static checkContentClassForEvent(gridster: any, e: any): boolean; | ||
static checkContentClassForEvent(gridster: GridsterComponent, e: any): boolean; | ||
static checkContentClass(target: any, current: any, contentClass: any): boolean; | ||
} |
@@ -49,2 +49,3 @@ "use strict"; | ||
} | ||
return false; | ||
}; | ||
@@ -51,0 +52,0 @@ GridsterUtils.checkContentClass = function (target, current, contentClass) { |
{ | ||
"name": "angular-gridster2", | ||
"version": "3.11.2", | ||
"version": "3.11.3", | ||
"license": "MIT", | ||
@@ -49,17 +49,17 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@angular/animations": "4.3.3", | ||
"@angular/animations": "5.0.0-beta.3", | ||
"@angular/cdk": "2.0.0-beta.8", | ||
"@angular/cli": "1.3.0", | ||
"@angular/common": "4.3.3", | ||
"@angular/compiler": "4.3.3", | ||
"@angular/compiler-cli": "4.3.3", | ||
"@angular/core": "4.3.3", | ||
"@angular/forms": "4.3.3", | ||
"@angular/http": "4.3.3", | ||
"@angular/language-service": "4.3.3", | ||
"@angular/common": "5.0.0-beta.3", | ||
"@angular/compiler": "5.0.0-beta.3", | ||
"@angular/compiler-cli": "5.0.0-beta.3", | ||
"@angular/core": "5.0.0-beta.3", | ||
"@angular/forms": "5.0.0-beta.3", | ||
"@angular/http": "5.0.0-beta.3", | ||
"@angular/language-service": "5.0.0-beta.3", | ||
"@angular/material": "2.0.0-beta.8", | ||
"@angular/platform-browser": "4.3.3", | ||
"@angular/platform-browser-dynamic": "4.3.3", | ||
"@angular/platform-server": "4.3.3", | ||
"@angular/router": "4.3.3", | ||
"@angular/platform-browser": "5.0.0-beta.3", | ||
"@angular/platform-browser-dynamic": "5.0.0-beta.3", | ||
"@angular/platform-server": "5.0.0-beta.3", | ||
"@angular/router": "5.0.0-beta.3", | ||
"@types/jasmine": "2.5.53", | ||
@@ -83,3 +83,3 @@ "@types/node": "8.0.20", | ||
"systemjs": "0.20.17", | ||
"rxjs": "5.4.2", | ||
"rxjs": "5.4.3", | ||
"ts-helpers": "1.1.2", | ||
@@ -86,0 +86,0 @@ "ts-node": "3.3.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
271795
87
2691