Socket
Socket
Sign inDemoInstall

react-grid-layout

Package Overview
Dependencies
144
Maintainers
1
Versions
104
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.1 to 1.3.2

coverage/clover.xml

5

.babelrc.js
// @flow
const es6Compat = process.env.BABEL_ES_COMPAT === "6" || process.env.NODE_ENV === "test";
const es6Compat =
process.env.BABEL_ES_COMPAT === "6" || process.env.NODE_ENV === "test";

@@ -11,3 +12,3 @@ module.exports = {

targets: es6Compat ? "maintained node versions" : "> 0.25%, not dead"
},
}
],

@@ -14,0 +15,0 @@ "@babel/react",

11

build/utils.js

@@ -782,4 +782,3 @@ "use strict";

if (!isProduction && child.props._grid) {
console.warn("`_grid` properties on children have been deprecated as of React 15.2. " + // eslint-disable-line
"Please use `data-grid` or add your properties directly to the `layout`.");
console.warn("`_grid` properties on children have been deprecated as of React 15.2. " + "Please use `data-grid` or add your properties directly to the `layout`.");
}

@@ -846,10 +845,2 @@

}
if (item.i && typeof item.i !== "string") {
throw new Error("ReactGridLayout: " + contextName + "[" + i + "].i must be a string!");
}
if (item.static !== undefined && typeof item.static !== "boolean") {
throw new Error("ReactGridLayout: " + contextName + "[" + i + "].static must be a boolean!");
}
}

@@ -856,0 +847,0 @@ } // Legacy support for verticalCompact: false

# Changelog
1.3.0 (Aug 27, 2021)
---
## 1.3.1 (Nov 29, 2021)
### Bugfixes
- Fix `allowOverlap` not firing `onLayoutChange()`. [#1620](https://github.com/react-grid-layout/react-grid-layout/pull/1620)
- This was due to a short-circuiting of internal logic that did not properly clone the `layout` prop.
### Internal Changes
- Replace `classnames` with `clsx` for smaller package size. (#1543)
## 1.3.0 (Aug 27, 2021)
### New Features
- `allowOverlap` prop, when `true`, allows overlapping grid items. [#1470](https://github.com/react-grid-layout/react-grid-layout/pull/1470)
- Add `onDropDragOver` callback. [#1395](https://github.com/react-grid-layout/react-grid-layout/pull/1395)
- Use this callback to dynamically adjust the `droppingItem` based on what is being dragged over. Return `w` and `h` to adjust the item. It is then [spread into the dropping placeholder](https://github.com/react-grid-layout/react-grid-layout/pull/1395/files#diff-83ab569936bfd4bf0460a4f23653ecbe8bc88509062c95e75c9402218b2b8733R609).
- This callback has the type:
- `onDragOver: (e: DragOverEvent) => { w: number, h: number } | false;`
- Return `false` to short-circuit the dragover.
- `allowOverlap` prop, when `true`, allows overlapping grid items. [#1470](https://github.com/react-grid-layout/react-grid-layout/pull/1470)
- Add `onDropDragOver` callback. [#1395](https://github.com/react-grid-layout/react-grid-layout/pull/1395)
- Use this callback to dynamically adjust the `droppingItem` based on what is being dragged over. Return `w` and `h` to adjust the item. It is then [spread into the dropping placeholder](https://github.com/react-grid-layout/react-grid-layout/pull/1395/files#diff-83ab569936bfd4bf0460a4f23653ecbe8bc88509062c95e75c9402218b2b8733R609).
- This callback has the type:
- `onDragOver: (e: DragOverEvent) => { w: number, h: number } | false;`
- Return `false` to short-circuit the dragover.
### Bugfixes
- Remove sorting when `compactType` is `null`. [#1474](https://github.com/react-grid-layout/react-grid-layout/pull/1474)
- Droppable fixes for Chrome behavior. [#1442](https://github.com/react-grid-layout/react-grid-layout/issues/1442) [#1448](https://github.com/react-grid-layout/react-grid-layout/issues/1442)
- Allow `null` children as a convenience so that inline expressions don't break the library. [#1296](https://github.com/react-grid-layout/react-grid-layout/pull/1296)
- Various dependency upgrades.
- Remove sorting when `compactType` is `null`. [#1474](https://github.com/react-grid-layout/react-grid-layout/pull/1474)
- Droppable fixes for Chrome behavior. [#1442](https://github.com/react-grid-layout/react-grid-layout/issues/1442) [#1448](https://github.com/react-grid-layout/react-grid-layout/issues/1442)
- Allow `null` children as a convenience so that inline expressions don't break the library. [#1296](https://github.com/react-grid-layout/react-grid-layout/pull/1296)
- Various dependency upgrades.
### Documentation
- Add docs on using custom components as grid children.
- Note required class on resizable handles for proper styling.
- Add docs on using custom components as grid children.
- Note required class on resizable handles for proper styling.
1.2.5 (May 10, 2021)
---
## 1.2.5 (May 10, 2021)
### Bugfixes
- Ensure no negative positions are possible when compacting
- Thanks @DonnyLi [#829](https://github.com/react-grid-layout/react-grid-layout/pull/829)
- Fixes [#535](https://github.com/react-grid-layout/react-grid-layout/issues/535)
- Fix resizing on mobile. This was caused by the `ref` refactor to remove ReactDOM in 1.2.3.
- Fixes #[1458](https://github.com/react-grid-layout/react-grid-layout/issues/1458)
- Note: this upgrades `react-resizable` to `3.0.1`, which like our other deps, is only compatible with `React@>=16.3`.
- Ensure no negative positions are possible when compacting
- Thanks @DonnyLi [#829](https://github.com/react-grid-layout/react-grid-layout/pull/829)
- Fixes [#535](https://github.com/react-grid-layout/react-grid-layout/issues/535)
- Fix resizing on mobile. This was caused by the `ref` refactor to remove ReactDOM in 1.2.3.
- Fixes #[1458](https://github.com/react-grid-layout/react-grid-layout/issues/1458)
- Note: this upgrades `react-resizable` to `3.0.1`, which like our other deps, is only compatible with `React@>=16.3`.
### Documentation
- Document new arity of `resizeHandle` (`(axis: ResizeHandleAxis, ref: ReactRef<HTMLElement>) => React$Element`)
- Remove references to the deprecated `verticalCompact` prop
1.2.4 (Mar 18, 2021)
---
- Document new arity of `resizeHandle` (`(axis: ResizeHandleAxis, ref: ReactRef<HTMLElement>) => React$Element`)
- Remove references to the deprecated `verticalCompact` prop
*This version fixes a serious render bug in `<WidthProvider>`. 1.2.3 should not be used.*
## 1.2.4 (Mar 18, 2021)
_This version fixes a serious render bug in `<WidthProvider>`. 1.2.3 should not be used._
### Bugfixes
- Fix failure to mount when layout is WidthProvider-wrapped and `measureBeforeMount` is `true`.
- Ref: [#1428](https://github.com/react-grid-layout/react-grid-layout/issues/1428)
- `<WidthProvider>` no longer updates grid with if it has been set to 0. This prevents unnecessary updates
if the grid is set to `display: none;`. Thanks @405go [#1427](https://github.com/react-grid-layout/react-grid-layout/pull/1427)
1.2.3 (Mar 16, 2021)
---
- Fix failure to mount when layout is WidthProvider-wrapped and `measureBeforeMount` is `true`.
- Ref: [#1428](https://github.com/react-grid-layout/react-grid-layout/issues/1428)
- `<WidthProvider>` no longer updates grid with if it has been set to 0. This prevents unnecessary updates
if the grid is set to `display: none;`. Thanks @405go [#1427](https://github.com/react-grid-layout/react-grid-layout/pull/1427)
## 1.2.3 (Mar 16, 2021)
### New Features
- React-Grid-Layout is now fully compatible with `<React.StrictMode>`.
- Usage of `ReactDOM` has been removed by using `React.createRef()` inside RGL, and the new [`nodeRef` prop](https://github.com/react-grid-layout/react-draggable/blob/master/CHANGELOG.md#440-may-12-2020) in `react-draggable`.
1.2.2 (Mar 1, 2021)
---
- React-Grid-Layout is now fully compatible with `<React.StrictMode>`.
- Usage of `ReactDOM` has been removed by using `React.createRef()` inside RGL, and the new [`nodeRef` prop](https://github.com/react-grid-layout/react-draggable/blob/master/CHANGELOG.md#440-may-12-2020) in `react-draggable`.
## 1.2.2 (Mar 1, 2021)
### Bugfixes
- `onResize` as changed in 1.2.1 did not correctly save the layout. This is now fixed.
- As you might guess, we need more test coverage! PRs are very welcome, I'll buy you beers on Cashapp or Patreon or whatever you like.
1.2.1 (Mar 1, 2021)
---
- `onResize` as changed in 1.2.1 did not correctly save the layout. This is now fixed.
- As you might guess, we need more test coverage! PRs are very welcome, I'll buy you beers on Cashapp or Patreon or whatever you like.
## 1.2.1 (Mar 1, 2021)
## Organization Changes

@@ -76,104 +88,114 @@

### Bugfixes
- Use `classList` in Firefox onDragOver hack. [#1310](https://github.com/STRML/react-grid-layout/pull/1310)
- Fix `scale` property. As `scale` support was added to dependencies, this caused double-compensation for scale, causing the dragged element not to follow the cursor. [#1393](https://github.com/STRML/react-grid-layout/pull/1393)
- Fix horizontal compact mode issue where it inadventently would compact the bottom of the grid. This is not useful nor intended. Thanks @s4m3. [#1390](https://github.com/STRML/react-grid-layout/pull/1390)
- Fix `onLayoutChange` sometimes not triggering on resize. We weren't cloning the layout item before modifying it. Thanks @xcqwan. [#1289](https://github.com/react-grid-layout/react-grid-layout/pull/1289)
- Use `classList` in Firefox onDragOver hack. [#1310](https://github.com/STRML/react-grid-layout/pull/1310)
- Fix `scale` property. As `scale` support was added to dependencies, this caused double-compensation for scale, causing the dragged element not to follow the cursor. [#1393](https://github.com/STRML/react-grid-layout/pull/1393)
- Fix horizontal compact mode issue where it inadventently would compact the bottom of the grid. This is not useful nor intended. Thanks @s4m3. [#1390](https://github.com/STRML/react-grid-layout/pull/1390)
- Fix `onLayoutChange` sometimes not triggering on resize. We weren't cloning the layout item before modifying it. Thanks @xcqwan. [#1289](https://github.com/react-grid-layout/react-grid-layout/pull/1289)
### Internal Refactors
- Updated to the latest versions of all dependencies (enzyme, webpack, jest, flow).
- Held back React@17 as enzyme is [not yet ready](https://github.com/enzymejs/enzyme/issues/2429).
1.2.0 (Nov 17, 2020)
---
- Updated to the latest versions of all dependencies (enzyme, webpack, jest, flow).
- Held back React@17 as enzyme is [not yet ready](https://github.com/enzymejs/enzyme/issues/2429).
## 1.2.0 (Nov 17, 2020)
### New Features
- You can now customize your resizable handle component as supported by [`react-resizable`](https://github.com/STRML/react-resizable/blob/09fd865c0e1cc570caa8d67e44a2e56172d3d816/examples/ExampleLayout.js#L72). For example:
```js
<ReactGridLayout resizeHandle={<span className="custom-handle custom-handle-se" />} {...props} />
````
Thanks @typeetfunc [#1303](https://github.com/STRML/react-grid-layout/pull/1303)
- You can now customize your resizable handle component as supported by [`react-resizable`](https://github.com/STRML/react-resizable/blob/09fd865c0e1cc570caa8d67e44a2e56172d3d816/examples/ExampleLayout.js#L72). For example:
```js
<ReactGridLayout
resizeHandle={<span className="custom-handle custom-handle-se" />}
{...props}
/>
```
Thanks @typeetfunc [#1303](https://github.com/STRML/react-grid-layout/pull/1303)
### Bugfixes
- Fix `onDrop` handler not firing on Firefox if you drop over the placeholder.
- Thanks @Charles-Lamoureux [#1333](https://github.com/STRML/react-grid-layout/pull/1333)
- Various example style fixes [#1283](https://github.com/STRML/react-grid-layout/pull/1283) [#1299](https://github.com/STRML/react-grid-layout/pull/1299)
1.1.1 (Sep 10, 2020)
---
- Fix `onDrop` handler not firing on Firefox if you drop over the placeholder.
- Thanks @Charles-Lamoureux [#1333](https://github.com/STRML/react-grid-layout/pull/1333)
- Various example style fixes [#1283](https://github.com/STRML/react-grid-layout/pull/1283) [#1299](https://github.com/STRML/react-grid-layout/pull/1299)
## 1.1.1 (Sep 10, 2020)
Republish to add `dist/` folder for unpkg use.
1.1.0 (Sep 3, 2020)
---
## 1.1.0 (Sep 3, 2020)
### New Features
- You can now place resizable handles on all corners. Use the `resizeHandles` prop, which is default `['se']` (for 'southeast').
- Allowable values are:
* 's' - South handle (bottom-center)
* 'w' - West handle (left-center)
* 'e' - East handle (right-center)
* 'n' - North handle (top-center)
* 'sw' - Southwest handle (bottom-left)
* 'nw' - Northwest handle (top-left)
* 'se' - Southeast handle (bottom-right)
* 'ne' - Northeast handle (top-right)
- These values may be combined, e.g. `['s', 'se', 'e']`, to place three handles on the bottom side, bottom-right corner, and right side.
- You can now place resizable handles on all corners. Use the `resizeHandles` prop, which is default `['se']` (for 'southeast').
- Allowable values are:
- 's' - South handle (bottom-center)
- 'w' - West handle (left-center)
- 'e' - East handle (right-center)
- 'n' - North handle (top-center)
- 'sw' - Southwest handle (bottom-left)
- 'nw' - Northwest handle (top-left)
- 'se' - Southeast handle (bottom-right)
- 'ne' - Northeast handle (top-right)
- These values may be combined, e.g. `['s', 'se', 'e']`, to place three handles on the bottom side, bottom-right corner, and right side.
### Bugfixes
- Revert `containerPadding` change in #1138. This change was meant to be types-only, but it caused a behavioral change where the default value of `containerPadding` became `[0, 0]`, not `margin`, which is default `[10, 10]`.
- Add a few more files to `npmignore` to improve package size.
1.0.0 (July 20, 2020)
---
- Revert `containerPadding` change in #1138. This change was meant to be types-only, but it caused a behavioral change where the default value of `containerPadding` became `[0, 0]`, not `margin`, which is default `[10, 10]`.
- Add a few more files to `npmignore` to improve package size.
## 1.0.0 (July 20, 2020)
React-Grid-Layout has been in `0.x` status for far too long. With the addition of some new features in this version and a breaking change, I thought it was time to move to a stable semver.
### Breaking Changes
- `onDrop` callback now has a form more consistent with other callbacks.
- Previous type: `(elemParams: { x: number, y: number, w: number, h: number, e: Event }) => void`
- New type: `(layout: Layout, item: ?LayoutItem, e: Event) => void`
- Thanks @ceberhar [#1169](https://github.com/STRML/react-grid-layout/pull/1169)
- Dropping Node 8 compatibility and testing due to devDep incompatibilities
- `onDrop` callback now has a form more consistent with other callbacks.
- Previous type: `(elemParams: { x: number, y: number, w: number, h: number, e: Event }) => void`
- New type: `(layout: Layout, item: ?LayoutItem, e: Event) => void`
- Thanks @ceberhar [#1169](https://github.com/STRML/react-grid-layout/pull/1169)
- Dropping Node 8 compatibility and testing due to devDep incompatibilities
### New Features
- Add `innerRef: React.Ref<'div'>` prop to expose a ref for the grid layout's outer div. Thanks @paul-sachs [#1176](https://github.com/STRML/react-grid-layout/pull/1176)
- Add `isBounded` property to prevent dragging items outside of the grid. Thanks @artembykov [#1248](https://github.com/STRML/react-grid-layout/pull/1248)
- Add `innerRef: React.Ref<'div'>` prop to expose a ref for the grid layout's outer div. Thanks @paul-sachs [#1176](https://github.com/STRML/react-grid-layout/pull/1176)
- Add `isBounded` property to prevent dragging items outside of the grid. Thanks @artembykov [#1248](https://github.com/STRML/react-grid-layout/pull/1248)
### Bugfixes
- Fix grid items stuck using percentages on first render. Thanks @rhbg [#1246](https://github.com/STRML/react-grid-layout/pull/1246)
0.18.3 (Mar 16, 2020)
----
- Fix grid items stuck using percentages on first render. Thanks @rhbg [#1246](https://github.com/STRML/react-grid-layout/pull/1246)
## 0.18.3 (Mar 16, 2020)
### Bugfixes
- Fix `shouldComponentUpdate` interfering with droppability ([#1152](https://github.com/STRML/react-grid-layout/issues/1152))
- Fix `shouldComponentUpdate` interfering with droppability ([#1152](https://github.com/STRML/react-grid-layout/issues/1152))
### Internal Changes
- New Enzyme test suite added to prevent regression. If you have time, we could really use more test cases that reflect your use cases!
0.18.2 (Feb 26, 2020)
----
- New Enzyme test suite added to prevent regression. If you have time, we could really use more test cases that reflect your use cases!
## 0.18.2 (Feb 26, 2020)
### Bugfixes
- `shouldComponentUpdate`:
- A too-aggressive implementation of `shouldComponentUpdate` was shipped in 0.18.0-0.18.1 ([#1123](https://github.com/STRML/react-grid-layout/pull/1123)), which did not compare the `children` object. While this works well in many simple implementations of RGL, it breaks in more complex applications.
- Reference equality of `props.children` and `nextProps.children` is now added to `<ReactGridLayout>` and `<GridItem>`. If you wish to take advantage of the performance improvements from the `shouldComponentUpdate` work, memoize your children.
- A section has been added to the [README](/README.md#Performance) explaining how this works.
- Fixed [#1150](https://github.com/STRML/react-grid-layout/issues/1150), [#1151](https://github.com/STRML/react-grid-layout/issues/1151).
0.18.1 (Feb 25, 2020)
----
- `shouldComponentUpdate`:
- A too-aggressive implementation of `shouldComponentUpdate` was shipped in 0.18.0-0.18.1 ([#1123](https://github.com/STRML/react-grid-layout/pull/1123)), which did not compare the `children` object. While this works well in many simple implementations of RGL, it breaks in more complex applications.
- Reference equality of `props.children` and `nextProps.children` is now added to `<ReactGridLayout>` and `<GridItem>`. If you wish to take advantage of the performance improvements from the `shouldComponentUpdate` work, memoize your children.
- A section has been added to the [README](/README.md#Performance) explaining how this works.
- Fixed [#1150](https://github.com/STRML/react-grid-layout/issues/1150), [#1151](https://github.com/STRML/react-grid-layout/issues/1151).
## 0.18.1 (Feb 25, 2020)
This release contains typedef changes only.
### Bugfixes
- Flow types:
- Make Props to `<ReactGridLayout>` and `<ResponsiveReactGridLayout>` exact.
- Fix loss of props refinement when passing through `WidthProvider`.
- Fix Flow errors as surfaced in [#1138](https://github.com/STRML/react-grid-layout/pull/1138).
- Modify examples to use types so that the above type error can't resurface
0.18.0 (Feb 25, 2020)
----
- Flow types:
- Make Props to `<ReactGridLayout>` and `<ResponsiveReactGridLayout>` exact.
- Fix loss of props refinement when passing through `WidthProvider`.
- Fix Flow errors as surfaced in [#1138](https://github.com/STRML/react-grid-layout/pull/1138).
- Modify examples to use types so that the above type error can't resurface
## 0.18.0 (Feb 25, 2020)
Thanks to all of our maintainers for this big release. 0.18.0 contains a large number of bugfixes that users have been asking for. Please read the full list so you know what to expect. Some of the biggest improvements include fixing changes of `isResizable`/`isDraggable` without a remount ([#892](https://github.com/STRML/react-grid-layout/pull/892)), fixes to prop changes on `ResponsiveReactGridLayout` ([#1090](https://github.com/STRML/react-grid-layout/pull/1090)), `shouldComponentUpdate` improvements for speed ([#1123](https://github.com/STRML/react-grid-layout/pull/1123)), improvements to droppability ([#1127](https://github.com/STRML/react-grid-layout/pull/1127)), and much more.

@@ -210,5 +232,5 @@

0.17.1 (Oct 29, 2019)
0.17.1 (Oct 29, 2019)
----
---

@@ -220,5 +242,6 @@ ### Bugfixes

0.17.0 (Oct 24, 2019)
----
0.17.0 (Oct 24, 2019)
---
It's been 18 months since the last release, and this is a pretty large one! For references on the items below, see https://github.com/STRML/react-grid-layout/milestone/1?closed=1.

@@ -235,3 +258,2 @@

### Bugfixes

@@ -257,5 +279,6 @@

0.16.6 (Mar 8, 2018)
----
0.16.6 (Mar 8, 2018)
---
- Fixed collision issue where items below could rearrange on a move.

@@ -272,10 +295,12 @@ - The root cause was "teleportation", or practically the same bug that leads to Pac-Man going through

0.16.5 (Feb 26, 2018)
----
0.16.5 (Feb 26, 2018)
---
- Minor fix to `isUserAction` on certain types of compaction cascades (#714, #720, #729)
0.16.4 (Feb 15, 2018)
----
0.16.4 (Feb 15, 2018)
---
- Skip null items in processGridItem (#578)

@@ -285,5 +310,6 @@ - Resize is broken for grids with preventCollision: true, fixes #655 (#656)

0.16.3 (Jan 31, 2018)
----
0.16.3 (Jan 31, 2018)
---
- Fix overriding of `onStart` behaviour (#707, thanks @ersel)

@@ -293,5 +319,6 @@ - Fixed Flow type of WidthProvider

0.16.2 (Dec 17, 2017)
----
0.16.2 (Dec 17, 2017)
---
- Fix `onLayoutChange` not firing properly due to regression introduced in 0.16.1

@@ -302,5 +329,6 @@ - Ref: https://github.com/STRML/react-grid-layout/issues/683

0.16.1 (Dec 10, 2017)
----
0.16.1 (Dec 10, 2017)
---
- Flow def upgrades (thanks @TrySound)

@@ -311,23 +339,28 @@ - DevDep upgrades

0.16.0 (Oct 6, 2017)
----
0.16.0 (Oct 6, 2017)
---
- Added horizontal compaction option, `compactType` (thanks @Rhjulskov)
- Added `preventCollision` option for static grids (thanks @EmrysMyrddin)
0.15.2 (Sep 5, 2017)
----
0.15.2 (Sep 5, 2017)
---
- Fix missed `import *`
- Dependency updates
0.15.1 (Sep 5, 2017)
----
0.15.1 (Sep 5, 2017)
---
- Fix React PropTypes & createClass warnings
- See https://github.com/facebook/react/issues/10583
0.15.0 (Aug 21, 2017)
----
0.15.0 (Aug 21, 2017)
---
- Package upgrades, including Webpack 3

@@ -337,21 +370,26 @@ - Flow typedef upgrades for the 0.53 rework

0.14.7 (Jul 14, 2017)
----
0.14.7 (Jul 14, 2017)
---
- Fixed a dragging bug when the grid container is scrollable. Thanks @chultquist.
- Ref: https://github.com/STRML/react-grid-layout/pull/555
0.14.6 (Apr 19, 2017)
----
0.14.6 (Apr 19, 2017)
---
- Fixed a bad publish (connectivity issue).
0.14.5 (Apr 19, 2017)
----
0.14.5 (Apr 19, 2017)
---
- Moved to `prop-types` package to avoid React.PropTypes deprecation in 15.5. Thanks @inverts!
0.14.4 (Mar 9, 2017)
----
0.14.4 (Mar 9, 2017)
---
#### Fixes:

@@ -365,5 +403,6 @@

0.14.3 (Feb 22, 2017)
----
0.14.3 (Feb 22, 2017)
---
#### Fixes:

@@ -373,5 +412,6 @@

0.14.2 (Feb 22, 2017)
----
0.14.2 (Feb 22, 2017)
---
#### Fixes:

@@ -386,5 +426,6 @@

0.14.1 (Feb 20, 2017)
----
0.14.1 (Feb 20, 2017)
---
#### Fixes:

@@ -395,5 +436,6 @@

0.14.0 (Feb 13, 2017)
-----
0.14.0 (Feb 13, 2017)
---
#### Features:

@@ -406,21 +448,26 @@

0.13.9 (Oct 13, 2016)
-----
0.13.9 (Oct 13, 2016)
---
#### Fixes:
- Fixed sorting of layout items, which could be different in IE if two items have the same x & y coordinate.
- See [#369](https://github.com/STRML/react-grid-layout/issues/369).
0.13.8 (Oct 13, 2016)
-----
0.13.8 (Oct 13, 2016)
---
#### Fixes:
- Fixed breakage introduced in `0.13.7` when items are added without a layout or `data-grid` property.
- See [#368](https://github.com/STRML/react-grid-layout/issues/368).
0.13.7 (Oct 3, 2016)
-----
0.13.7 (Oct 3, 2016)
---
#### Fixes:

@@ -433,5 +480,6 @@

0.13.6 (Sep 26, 2016)
-----
0.13.6 (Sep 26, 2016)
---
#### Fixes:

@@ -441,5 +489,6 @@

0.13.5 (Sep 9, 2016)
-----
0.13.5 (Sep 9, 2016)
---
#### Fixes:

@@ -449,5 +498,6 @@

0.13.4 (Sep 9, 2016)
-----
0.13.4 (Sep 9, 2016)
---
#### Fixes:

@@ -457,14 +507,17 @@

- Fixed an issue where layout items using `data-grid` could rearrange on mount depending on how they were ordered.
- See [#342](https://github.com/STRML/react-grid-layout/pull/342) for reference.
0.13.3 (Aug 31, 2016)
-----
0.13.3 (Aug 31, 2016)
---
#### Fixes:
- Fixed `lodash.isequal` import, which was ruined by case-insensitive HFS+ *shakes fist*
- Fixed `lodash.isequal` import, which was ruined by case-insensitive HFS+ _shakes fist_
0.13.2 (Aug 31, 2016)
-----
0.13.2 (Aug 31, 2016)
---
#### Fixes:

@@ -478,7 +531,9 @@

- `babel-plugin-transform-flow-comments` had limited support for defining types like transpiled classes.
- This has been updated to instead copy source to `.js.flow` files, which preserves all type information.
0.13.1 (Aug 16, 2016)
-----
0.13.1 (Aug 16, 2016)
---
#### Fixes:

@@ -488,5 +543,6 @@

0.13.0 (Aug 3, 2016)
-----
0.13.0 (Aug 3, 2016)
---
#### Changed:

@@ -502,43 +558,52 @@

0.12.7 (Jun 29, 2016)
-----
0.12.7 (Jun 29, 2016)
---
- Prevent extraenous rerenders in `<ResponsiveReactGridLayout>` by using deep equality on layouts.
0.12.6 (Jun 5, 2016)
-----
0.12.6 (Jun 5, 2016)
---
- Fix blindingly obvious bug where mounted isn't set to true. Smack forehead.
0.12.5 (Jun 3, 2016)
-----
0.12.5 (Jun 3, 2016)
---
- Fixes for server rendering checksum failures.
0.12.4 (May 22, 2016)
-----
0.12.4 (May 22, 2016)
---
- Update to React-Draggable v2. Fixes: #241, #239, #24
- v2 contains a number of bugfixes & enhancements for touchscreens, multitouch, and scrolling containers.
0.12.3 (May 3, 2016)
-----
0.12.3 (May 3, 2016)
---
- Bugfix: Rendering with new `breakpoints`/`cols` does not refresh the layout.
Fixes #208 - thanks @damienleroux
0.12.2 (May 1, 2016)
------
0.12.2 (May 1, 2016)
---
- Bugfix: Fix warning about undefined `useCSSTransforms` when server-rendering.
0.12.1 (Apr 19, 2016)
------
0.12.1 (Apr 19, 2016)
---
- Bugfix: Don't set `layout` twice on width change. See #217 - thanks @damienleroux
- Enhancement: Add Flow type comments
0.12.0 (Apr 14, 2016)
------
0.12.0 (Apr 14, 2016)
---
- `<ReactGridLayout>` will no longer animate so severely on mount. See #212.

@@ -553,22 +618,26 @@ - If you are using `<WidthProvider>`, you may notice that the container's width still shunts on mount.

0.11.3 (Apr 8, 2016)
------
0.11.3 (Apr 8, 2016)
---
- Officially support React v15.
0.11.2 (Apr 6, 2016)
------
0.11.2 (Apr 6, 2016)
---
- Bugfix: Draggable cancel selectors, see #203 - thanks @RiiD
- README fixes, thanks @bravo-kernel & @ro-savage
0.11.1
------
0.11.1
---
- Bugfix: `<ResponsiveReactGridLayout>` was using stale data when synchronizing children with the layout
on a breakpoint change.
0.11.0
------
0.11.0
---
This release contains potentially breaking changes so I have updated the minor version (as per semver).

@@ -578,3 +647,3 @@

- Layout items now have a fixed set of properties. Other properties will *not* be merged into the `<GridItem>`, such
- Layout items now have a fixed set of properties. Other properties will _not_ be merged into the `<GridItem>`, such
as `className`. To set a `className` on a child, set it on the child directly and it will be merged.

@@ -591,58 +660,68 @@ This allows us to make better assumptions about the layout and use a faster cloning mechanism.

- Removed redundant `isPlaceholder` property from `<GridItem>`.
- README updates to clarify layout/_grid usage.
- README updates to clarify layout/\_grid usage.
0.10.11
-------
0.10.11
---
- Bugfix: `layouts` param on `<ResponsiveReactGridLayout>`'s `onLayoutChange` could have stale data
for the current breakpoint.
0.10.10
-------
0.10.10
---
- Performance: Prevent V8 deopt in a few methods and add fast layout item cloning.
0.10.9
------
0.10.9
---
- Bugfix: Typo in children comparison in CWRP. See #169.
- Bugfix: Missing babel-preset-es2015 in dev.
0.10.8
------
0.10.8
---
- Rebuild using [ES2015 Loose Mode](https://babeljs.algolia.com/docs/advanced/loose/).
0.10.7
------
0.10.7
---
- Bugfix: `className` and `style` props on grid children were being incorrectly dropped, a holdover
from when `cloneWithProps()` used to do this merging for us. They are now merged.
0.10.6
------
0.10.6
---
- Bugfix: If both `props.layout` and `props.children.length` change in the same tick,
props.layout would be clobbered. See #162
0.10.5
------
0.10.5
---
- Bugfix/Enhancement: Margins were causing subtle error in some of the positioning calculations. This has
been fixed.
0.10.4
------
0.10.4
---
- Bugfix: Container height was calculated as less than expected due to improper addition of margin.
0.10.3
------
0.10.3
---
- Bugfix: Round item positions even if they're currently resizing or dragging (#158, regression of #141)
- Bugfix: Fix a positioning bug when margins are 0 (#160)
0.10.2
------
0.10.2
---
- Bugfix: <RGL> would synchronize children with layout if the layout in props didn't match the state;

@@ -658,10 +737,12 @@ this was meant to be a hook for the developer to supply a new layout. The incorrect check could cause the

0.10.1
------
0.10.1
---
- Hotfix for default export incompatibility caused by Babel 6.
0.10.0
------
0.10.0
---
This long-awaited release provides React 0.14 compatibility and a rewrite of the underlying

@@ -679,18 +760,21 @@ `<Draggable>` functionality.

- *Finally* compatible with React 0.14! Big thanks to @menelike for his help.
- _Finally_ compatible with React 0.14! Big thanks to @menelike for his help.
- Upgraded to Babel 6.
- Full typechecking via Flow.
- Lots of misc bugfixes.
- See beta releases below for more details.
0.10.0-beta1
------------
0.10.0-beta1
---
- Fixed a React import bug on ListensToWidth.jsx (#130; thanks @mrblueblue)
0.10.0-beta0
------------
0.10.0-beta0
*This release is unstable!*
---
_This release is unstable!_
- React 0.14 compatibility.

@@ -703,33 +787,38 @@ - This release includes a rewrite of much of the project in ES6/7 style with Flow typing.

Known bugs:
- The placeholder box does not properly follow the mouse and stays pinned to the active drag.
0.9.2
-----
- The placeholder box does not properly follow the mouse and stays pinned to the active drag.
## 0.9.2
- Update `react-draggable` to `v0.8.0` to fix IE11 issues (#29).
0.9.1
-----
0.9.1
---
- Update `react-draggable` to `v0.7.3` to fix a bounds bug (#56).
0.9.0
-----
0.9.0
---
- Move off `react-draggable` fork to mainline `v0.7.2`. Incremented minor (major in the case of
npm's `^`, since we are pre-v1) version in case of unforeseen conflicts.
0.8.3
-----
0.8.3
---
- Add `verticalCompact` toggle.
0.8.2
-----
0.8.2
---
- Fix a crash when initializing with no children.
0.8.1
-----
0.8.1
---
- Fixed React 0.13 warning about `isMounted()`.

@@ -740,5 +829,6 @@ - Update to babel 5.

0.8.0
-----
0.8.0
---
- Changed signature on resize/drag callbacks to allow dynamic max/min W/H per item.

@@ -748,10 +838,12 @@ - Fixed bug in `useCSSTransforms`.

0.7.1
-----
0.7.1
---
- Added callbacks for resize and drag start/active/stop.
0.7.0
-----
0.7.0
---
**Breaking changes:**

@@ -762,4 +854,4 @@

> This version contains a CSS update. This fixes a visual bug where you may see items quickly reset position
and animate back to their original position on load, when you are using CSS transforms. To fix this bug,
copy the rules from css/styles.css into your stylesheet.
> and animate back to their original position on load, when you are using CSS transforms. To fix this bug,
> copy the rules from css/styles.css into your stylesheet.

@@ -772,5 +864,5 @@ Other changes:

0.6.2
0.6.2
-----
---

@@ -783,26 +875,32 @@ - Fix #21 (error when passing only a single child).

0.6.1
-----
0.6.1
- Fixed #8 (current layout was not properly being stored when provided via _grid props).
---
0.6.0
-----
- Fixed #8 (current layout was not properly being stored when provided via \_grid props).
0.6.0
---
- Optionally use CSS transforms for placement, fallback on position top/left.
- Allow parent to set responsive breakpoint directly.
0.5.2
-----
0.5.2
---
- Fix Responsive import for node users
0.5.1
-----
0.5.1
---
- Add support for min/max dimension attributes.
- Example tweak
0.5.0
-----
0.5.0
---
- Refactoring and demo tweaks. Update README with new params.

@@ -813,5 +911,6 @@ - Add showcase example, tweak template

0.4.0
-----
0.4.0
---
- Force lodash into commons chunk

@@ -825,5 +924,4 @@ - More tweaks to grid collisions. This should fix bad swaps once and for all.

< 0.4.0
-------
## < 0.4.0
- Early development versions, too many changes to list.
module.exports = require("./build/ReactGridLayout").default;
module.exports.utils = require("./build/utils");
module.exports.Responsive = require("./build/ResponsiveReactGridLayout").default;
module.exports.Responsive =
require("./build/ResponsiveReactGridLayout").default;
module.exports.Responsive.utils = require("./build/responsiveUtils");
module.exports.WidthProvider = require("./build/components/WidthProvider").default;
module.exports.WidthProvider =
require("./build/components/WidthProvider").default;

@@ -384,4 +384,9 @@ // @flow

// This is the max possible width - doesn't go to infinity because of the width of the window
const maxWidth = calcGridItemPosition(positionParams, 0, 0, cols - x, 0)
.width;
const maxWidth = calcGridItemPosition(
positionParams,
0,
0,
cols - x,
0
).width;

@@ -400,3 +405,3 @@ // Calculate min/max constraints using our min & maxes

draggableOpts={{
disabled: !isResizable,
disabled: !isResizable
}}

@@ -403,0 +408,0 @@ className={isResizable ? undefined : "react-resizable-hide"}

@@ -708,3 +708,3 @@ // @flow

console.warn(
"`_grid` properties on children have been deprecated as of React 15.2. " + // eslint-disable-line
"`_grid` properties on children have been deprecated as of React 15.2. " +
"Please use `data-grid` or add your properties directly to the `layout`."

@@ -774,16 +774,2 @@ );

}
if (item.i && typeof item.i !== "string") {
throw new Error(
"ReactGridLayout: " + contextName + "[" + i + "].i must be a string!"
);
}
if (item.static !== undefined && typeof item.static !== "boolean") {
throw new Error(
"ReactGridLayout: " +
contextName +
"[" +
i +
"].static must be a boolean!"
);
}
}

@@ -790,0 +776,0 @@ }

{
"name": "react-grid-layout",
"version": "1.3.1",
"version": "1.3.2",
"description": "A draggable and resizable grid layout with responsive breakpoints, for React.",

@@ -15,3 +15,5 @@ "main": "index.js",

"validate": "npm ls",
"flow": "flow"
"flow": "flow",
"fmt": "prettier --write ./**.{json,js,yml,md}",
"fmt:check": "prettier --check ./**.{json,js,yml,md}"
},

@@ -39,2 +41,3 @@ "repository": {

"dependencies": {
"@babel/eslint-parser": "^7.16.3",
"clsx": "^1.1.1",

@@ -56,3 +59,2 @@ "lodash.isequal": "^4.0.0",

"@webpack-cli/serve": "^1.5.2",
"babel-eslint": "^10.1.0",
"babel-jest": "^27.0.6",

@@ -70,2 +72,3 @@ "babel-loader": "^8.2.2",

"eslint-plugin-react": "^7.24.0",
"eslint-plugin-unicorn": "^39.0.0",
"exports-loader": "^3.0.0",

@@ -108,9 +111,18 @@ "flow-bin": "^0.158.0",

"testEnvironment": "jsdom",
"testURL": "http://localhost"
"testURL": "http://localhost",
"coverageThreshold": {
"global": {
"statements": 77.43,
"branches": 72.02,
"functions": 77.12,
"lines": 78.93
}
}
},
"lint-staged": {
"*.{js,jsx,css}": [
"prettier --write"
"eslint --ext .js,.jsx --fix",
"yarn fmt"
]
}
}
}

@@ -17,2 +17,3 @@ # React-Grid-Layout

![BitMEX UI](http://i.imgur.com/oo1NT6c.gif)
> GIF from production usage on [BitMEX.com](https://www.bitmex.com)

@@ -81,28 +82,28 @@

*Know of others? Create a PR to let me know!*
_Know of others? Create a PR to let me know!_
## Features
* 100% React - no jQuery
* Compatible with server-rendered apps
* Draggable widgets
* Resizable widgets
* Static widgets
* Configurable packing: horizontal, vertical, or off
* Bounds checking for dragging and resizing
* Widgets may be added or removed without rebuilding grid
* Layout can be serialized and restored
* Responsive breakpoints
* Separate layouts per responsive breakpoint
* Grid Items placed using CSS Transforms
* Performance with CSS Transforms: [on](http://i.imgur.com/FTogpLp.jpg) / [off](http://i.imgur.com/gOveMm8.jpg), note paint (green) as % of time
* Compatibility with `<React.StrictMode>`
- 100% React - no jQuery
- Compatible with server-rendered apps
- Draggable widgets
- Resizable widgets
- Static widgets
- Configurable packing: horizontal, vertical, or off
- Bounds checking for dragging and resizing
- Widgets may be added or removed without rebuilding grid
- Layout can be serialized and restored
- Responsive breakpoints
- Separate layouts per responsive breakpoint
- Grid Items placed using CSS Transforms
- Performance with CSS Transforms: [on](http://i.imgur.com/FTogpLp.jpg) / [off](http://i.imgur.com/gOveMm8.jpg), note paint (green) as % of time
- Compatibility with `<React.StrictMode>`
|Version | Compatibility |
|----------------|------------------|
| >= 0.17.0 | React 16 & 17 |
| >= 0.11.3 | React 0.14 & 15 |
| >= 0.10.0 | React 0.14 |
| 0.8. - 0.9.2 | React 0.13 |
| < 0.8 | React 0.12 |
| Version | Compatibility |
| ------------ | --------------- |
| >= 0.17.0 | React 16 & 17 |
| >= 0.11.3 | React 0.14 & 15 |
| >= 0.10.0 | React 0.14 |
| 0.8. - 0.9.2 | React 0.13 |
| < 0.8 | React 0.12 |

@@ -134,3 +135,3 @@ ## Installation

```js
import GridLayout from 'react-grid-layout';
import GridLayout from "react-grid-layout";

@@ -141,8 +142,14 @@ class MyFirstGrid extends React.Component {

const layout = [
{i: 'a', x: 0, y: 0, w: 1, h: 2, static: true},
{i: 'b', x: 1, y: 0, w: 3, h: 2, minW: 2, maxW: 4},
{i: 'c', x: 4, y: 0, w: 1, h: 2}
{ i: "a", x: 0, y: 0, w: 1, h: 2, static: true },
{ i: "b", x: 1, y: 0, w: 3, h: 2, minW: 2, maxW: 4 },
{ i: "c", x: 4, y: 0, w: 1, h: 2 }
];
return (
<GridLayout className="layout" layout={layout} cols={12} rowHeight={30} width={1200}>
<GridLayout
className="layout"
layout={layout}
cols={12}
rowHeight={30}
width={1200}
>
<div key="a">a</div>

@@ -152,3 +159,3 @@ <div key="b">b</div>

</GridLayout>
)
);
}

@@ -161,3 +168,3 @@ }

```js
import GridLayout from 'react-grid-layout';
import GridLayout from "react-grid-layout";

@@ -168,7 +175,13 @@ class MyFirstGrid extends React.Component {

<GridLayout className="layout" cols={12} rowHeight={30} width={1200}>
<div key="a" data-grid={{x: 0, y: 0, w: 1, h: 2, static: true}}>a</div>
<div key="b" data-grid={{x: 1, y: 0, w: 3, h: 2, minW: 2, maxW: 4}}>b</div>
<div key="c" data-grid={{x: 4, y: 0, w: 1, h: 2}}>c</div>
<div key="a" data-grid={{ x: 0, y: 0, w: 1, h: 2, static: true }}>
a
</div>
<div key="b" data-grid={{ x: 1, y: 0, w: 3, h: 2, minW: 2, maxW: 4 }}>
b
</div>
<div key="c" data-grid={{ x: 4, y: 0, w: 1, h: 2 }}>
c
</div>
</GridLayout>
)
);
}

@@ -188,3 +201,3 @@ }

```js
import { Responsive as ResponsiveGridLayout } from 'react-grid-layout';
import { Responsive as ResponsiveGridLayout } from "react-grid-layout";

@@ -196,5 +209,8 @@ class MyResponsiveGrid extends React.Component {

return (
<ResponsiveGridLayout className="layout" layouts={layouts}
breakpoints={{lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0}}
cols={{lg: 12, md: 10, sm: 6, xs: 4, xxs: 2}}>
<ResponsiveGridLayout
className="layout"
layouts={layouts}
breakpoints={{ lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0 }}
cols={{ lg: 12, md: 10, sm: 6, xs: 4, xxs: 2 }}
>
<div key="1">1</div>

@@ -204,3 +220,3 @@ <div key="2">2</div>

</ResponsiveGridLayout>
)
);
}

@@ -228,3 +244,3 @@ }

```js
import { Responsive, WidthProvider } from 'react-grid-layout';
import { Responsive, WidthProvider } from "react-grid-layout";

@@ -238,5 +254,8 @@ const ResponsiveGridLayout = WidthProvider(Responsive);

return (
<ResponsiveGridLayout className="layout" layouts={layouts}
breakpoints={{lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0}}
cols={{lg: 12, md: 10, sm: 6, xs: 4, xxs: 2}}>
<ResponsiveGridLayout
className="layout"
layouts={layouts}
breakpoints={{ lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0 }}
cols={{ lg: 12, md: 10, sm: 6, xs: 4, xxs: 2 }}
>
<div key="1">1</div>

@@ -246,3 +265,3 @@ <div key="2">2</div>

</ResponsiveGridLayout>
)
);
}

@@ -412,3 +431,5 @@ }

// You can use this instead of a regular ref and the deprecated `ReactDOM.findDOMNode()`` function.
innerRef: ?React.Ref<"div">,
// Note that this type is React.Ref<HTMLDivElement> in TypeScript, Flow has a bug here
// https://github.com/facebook/flow/issues/8671#issuecomment-862634865
innerRef: {current: null | HTMLDivElement},
```

@@ -511,3 +532,2 @@

```js

@@ -535,3 +555,3 @@ // lib/ReactGridLayout.jsx

return new Array(props.count).fill(undefined).map((val, idx) => {
return <div key={idx} data-grid={{x: idx, y: 1, w: 1, h: 1}} />;
return <div key={idx} data-grid={{ x: idx, y: 1, w: 1, h: 1 }} />;
});

@@ -559,3 +579,3 @@ }, [props.count]);

{/* Some other content */}
</div>
</div>
);

@@ -562,0 +582,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 too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc