🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

react-grid-layout-horizontal-compact

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-grid-layout-horizontal-compact - npm Package Compare versions

Comparing version

to
0.14.6

34

build/utils.js

@@ -150,29 +150,19 @@ 'use strict';

function compactItem(compareWith, l, compactType, cols) {
var compactV = compactType === 'vertical';
var compactH = compactType === 'horizontal';
if (compactV) {
l.y = Math.min(bottom(compareWith), l.y);
// First pass: compact Vertically
l.y = Math.min(bottom(compareWith), l.y);
l.x = 0;
// Move the element up as far as it can go without colliding.
while (l.y > 0 && !getFirstCollision(compareWith, l)) {
l.y--;
}
} else if (compactH) {
// Move the element left as far as it can go without colliding.
while (l.x > 0 && !getFirstCollision(compareWith, l)) {
l.x--;
}
// Move the element up as far as it can go without colliding.
while (l.y > 0 && !getFirstCollision(compareWith, l)) {
l.y--;
}
// Move it down, and keep moving it down if it's colliding.
// Move it right, and keep moving it right if it's colliding.
// if we run out of space horizontally, move to a new column
var collides = void 0;
while (collides = getFirstCollision(compareWith, l)) {
if (compactH) {
l.x = collides.x + collides.w;
} else {
l.y = collides.y + collides.h;
}
l.x = collides.x + collides.w;
// Since we can't grow without bounds horizontally, if we've overflown, let's move it down and try again.
if (compactH && l.x + l.w > cols) {
l.x = cols - l.w;
if (l.x + l.w > cols) {
l.x = 0;
l.y++;

@@ -179,0 +169,0 @@ }

{
"name": "react-grid-layout-horizontal-compact",
"version": "0.14.5",
"version": "0.14.6",
"description": "A draggable and resizable grid layout with responsive breakpoints, for React.",

@@ -5,0 +5,0 @@ "main": "index.js",

# React-Grid-Layout
[![travis build](https://travis-ci.org/STRML/react-grid-layout.svg?branch=master)](https://travis-ci.org/STRML/react-grid-layout)
[![npm package](https://img.shields.io/npm/v/react-grid-layout.svg?style=flat-square)](https://www.npmjs.org/package/react-grid-layout)
[![npm downloads](https://img.shields.io/npm/dt/react-grid-layout.svg?maxAge=2592000)]()
### ATTN:
This is a temporary fork, waiting for the official lib to either merge [PR #534](https://github.com/STRML/react-grid-layout/pull/534) or to implement STH like [Issue #157](https://github.com/STRML/react-grid-layout/issues/157).
It will be deprecated as soon as these are fixed. DO NOT USE, DO NOT DEPEND ON THIS. I warned you.
========
React-Grid-Layout is a grid layout system much like [Packery](http://packery.metafizzy.co/) or

@@ -8,0 +10,0 @@ [Gridster](http://gridster.net), for React.

Sorry, the diff of this file is not supported yet