react-grid-layout 1.2.5 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc.js +3 -2
- package/.eslintignore +3 -0
- package/.flowconfig +1 -3
- package/.prettierignore +1 -0
- package/CHANGELOG.md +383 -246
- package/README.md +122 -60
- package/build/GridItem.js +8 -8
- package/build/ReactGridLayout.js +304 -324
- package/build/ReactGridLayoutPropTypes.js +7 -1
- package/build/ResponsiveReactGridLayout.js +14 -8
- package/build/calculateUtils.js +8 -8
- package/build/components/WidthProvider.js +9 -7
- package/build/fastRGLPropsEqual.js +1 -1
- package/build/responsiveUtils.js +1 -1
- package/build/utils.js +44 -52
- package/dist/react-grid-layout.min.js +1 -2
- package/dist/react-grid-layout.min.js.map +1 -1
- package/index.js +4 -2
- package/lib/GridItem.jsx +10 -5
- package/lib/ReactGridLayout.jsx +101 -62
- package/lib/ReactGridLayoutPropTypes.js +33 -12
- package/lib/ResponsiveReactGridLayout.jsx +7 -1
- package/lib/components/WidthProvider.jsx +2 -2
- package/lib/utils.js +42 -42
- package/package.json +46 -33
- package/dist/react-grid-layout.min.js.LICENSE.txt +0 -5
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@ or autogenerated.
|
|
|
14
14
|
RGL is React-only and does not require jQuery.
|
|
15
15
|
|
|
16
16
|

|
|
17
|
+
|
|
17
18
|
> GIF from production usage on [BitMEX.com](https://www.bitmex.com)
|
|
18
19
|
|
|
19
20
|
[**[Demo](https://react-grid-layout.github.io/react-grid-layout/) | [Changelog](/CHANGELOG.md) | [CodeSandbox Editable demo](https://codesandbox.io/s/5wy3rz5z1x?module=%2Fsrc%2FShowcaseLayout.js)**]
|
|
@@ -55,6 +56,7 @@ RGL is React-only and does not require jQuery.
|
|
|
55
56
|
1. [Bounded Layout](https://react-grid-layout.github.io/react-grid-layout/examples/16-bounded.html)
|
|
56
57
|
1. [Resizable Handles](https://react-grid-layout.github.io/react-grid-layout/examples/17-resizable-handles.html)
|
|
57
58
|
1. [Scaled Containers](https://react-grid-layout.github.io/react-grid-layout/examples/18-scale.html)
|
|
59
|
+
1. [Allow Overlap](https://react-grid-layout.github.io/react-grid-layout/examples/19-allow-overlap.html)
|
|
58
60
|
|
|
59
61
|
#### Projects Using React-Grid-Layout
|
|
60
62
|
|
|
@@ -74,33 +76,34 @@ RGL is React-only and does not require jQuery.
|
|
|
74
76
|
- [Hakkiri](https://www.hakkiri.io)
|
|
75
77
|
- [Ubidots](https://help.ubidots.com/en/articles/2400308-create-dashboards-and-widgets)
|
|
76
78
|
- [Statsout](https://statsout.com/)
|
|
79
|
+
- [Datto RMM](https://www.datto.com/uk/products/rmm/)
|
|
77
80
|
|
|
78
|
-
|
|
81
|
+
_Know of others? Create a PR to let me know!_
|
|
79
82
|
|
|
80
83
|
## Features
|
|
81
84
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|Version
|
|
98
|
-
|
|
99
|
-
| >= 0.17.0
|
|
100
|
-
| >= 0.11.3
|
|
101
|
-
| >= 0.10.0
|
|
102
|
-
| 0.8. - 0.9.2
|
|
103
|
-
| < 0.8
|
|
85
|
+
- 100% React - no jQuery
|
|
86
|
+
- Compatible with server-rendered apps
|
|
87
|
+
- Draggable widgets
|
|
88
|
+
- Resizable widgets
|
|
89
|
+
- Static widgets
|
|
90
|
+
- Configurable packing: horizontal, vertical, or off
|
|
91
|
+
- Bounds checking for dragging and resizing
|
|
92
|
+
- Widgets may be added or removed without rebuilding grid
|
|
93
|
+
- Layout can be serialized and restored
|
|
94
|
+
- Responsive breakpoints
|
|
95
|
+
- Separate layouts per responsive breakpoint
|
|
96
|
+
- Grid Items placed using CSS Transforms
|
|
97
|
+
- Performance with CSS Transforms: [on](http://i.imgur.com/FTogpLp.jpg) / [off](http://i.imgur.com/gOveMm8.jpg), note paint (green) as % of time
|
|
98
|
+
- Compatibility with `<React.StrictMode>`
|
|
99
|
+
|
|
100
|
+
| Version | Compatibility |
|
|
101
|
+
| ------------ | --------------- |
|
|
102
|
+
| >= 0.17.0 | React 16 & 17 |
|
|
103
|
+
| >= 0.11.3 | React 0.14 & 15 |
|
|
104
|
+
| >= 0.10.0 | React 0.14 |
|
|
105
|
+
| 0.8. - 0.9.2 | React 0.13 |
|
|
106
|
+
| < 0.8 | React 0.12 |
|
|
104
107
|
|
|
105
108
|
## Installation
|
|
106
109
|
|
|
@@ -127,23 +130,29 @@ produce a grid with three items where:
|
|
|
127
130
|
- users will be able to freely drag and resize item `c`
|
|
128
131
|
|
|
129
132
|
```js
|
|
130
|
-
import GridLayout from
|
|
133
|
+
import GridLayout from "react-grid-layout";
|
|
131
134
|
|
|
132
135
|
class MyFirstGrid extends React.Component {
|
|
133
136
|
render() {
|
|
134
137
|
// layout is an array of objects, see the demo for more complete usage
|
|
135
138
|
const layout = [
|
|
136
|
-
{i:
|
|
137
|
-
{i:
|
|
138
|
-
{i:
|
|
139
|
+
{ i: "a", x: 0, y: 0, w: 1, h: 2, static: true },
|
|
140
|
+
{ i: "b", x: 1, y: 0, w: 3, h: 2, minW: 2, maxW: 4 },
|
|
141
|
+
{ i: "c", x: 4, y: 0, w: 1, h: 2 }
|
|
139
142
|
];
|
|
140
143
|
return (
|
|
141
|
-
<GridLayout
|
|
144
|
+
<GridLayout
|
|
145
|
+
className="layout"
|
|
146
|
+
layout={layout}
|
|
147
|
+
cols={12}
|
|
148
|
+
rowHeight={30}
|
|
149
|
+
width={1200}
|
|
150
|
+
>
|
|
142
151
|
<div key="a">a</div>
|
|
143
152
|
<div key="b">b</div>
|
|
144
153
|
<div key="c">c</div>
|
|
145
154
|
</GridLayout>
|
|
146
|
-
)
|
|
155
|
+
);
|
|
147
156
|
}
|
|
148
157
|
}
|
|
149
158
|
```
|
|
@@ -151,17 +160,23 @@ class MyFirstGrid extends React.Component {
|
|
|
151
160
|
You may also choose to set layout properties directly on the children:
|
|
152
161
|
|
|
153
162
|
```js
|
|
154
|
-
import GridLayout from
|
|
163
|
+
import GridLayout from "react-grid-layout";
|
|
155
164
|
|
|
156
165
|
class MyFirstGrid extends React.Component {
|
|
157
166
|
render() {
|
|
158
167
|
return (
|
|
159
168
|
<GridLayout className="layout" cols={12} rowHeight={30} width={1200}>
|
|
160
|
-
<div key="a" data-grid={{x: 0, y: 0, w: 1, h: 2, static: true}}>
|
|
161
|
-
|
|
162
|
-
|
|
169
|
+
<div key="a" data-grid={{ x: 0, y: 0, w: 1, h: 2, static: true }}>
|
|
170
|
+
a
|
|
171
|
+
</div>
|
|
172
|
+
<div key="b" data-grid={{ x: 1, y: 0, w: 3, h: 2, minW: 2, maxW: 4 }}>
|
|
173
|
+
b
|
|
174
|
+
</div>
|
|
175
|
+
<div key="c" data-grid={{ x: 4, y: 0, w: 1, h: 2 }}>
|
|
176
|
+
c
|
|
177
|
+
</div>
|
|
163
178
|
</GridLayout>
|
|
164
|
-
)
|
|
179
|
+
);
|
|
165
180
|
}
|
|
166
181
|
}
|
|
167
182
|
```
|
|
@@ -176,21 +191,24 @@ excludes `React`, so it must be otherwise available in your application, either
|
|
|
176
191
|
To make RGL responsive, use the `<ResponsiveReactGridLayout>` element:
|
|
177
192
|
|
|
178
193
|
```js
|
|
179
|
-
import { Responsive as ResponsiveGridLayout } from
|
|
194
|
+
import { Responsive as ResponsiveGridLayout } from "react-grid-layout";
|
|
180
195
|
|
|
181
196
|
class MyResponsiveGrid extends React.Component {
|
|
182
197
|
render() {
|
|
183
198
|
// {lg: layout1, md: layout2, ...}
|
|
184
199
|
const layouts = getLayoutsFromSomewhere();
|
|
185
200
|
return (
|
|
186
|
-
<ResponsiveGridLayout
|
|
187
|
-
|
|
188
|
-
|
|
201
|
+
<ResponsiveGridLayout
|
|
202
|
+
className="layout"
|
|
203
|
+
layouts={layouts}
|
|
204
|
+
breakpoints={{ lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0 }}
|
|
205
|
+
cols={{ lg: 12, md: 10, sm: 6, xs: 4, xxs: 2 }}
|
|
206
|
+
>
|
|
189
207
|
<div key="1">1</div>
|
|
190
208
|
<div key="2">2</div>
|
|
191
209
|
<div key="3">3</div>
|
|
192
210
|
</ResponsiveGridLayout>
|
|
193
|
-
)
|
|
211
|
+
);
|
|
194
212
|
}
|
|
195
213
|
}
|
|
196
214
|
```
|
|
@@ -213,7 +231,7 @@ positions on drag events. In simple cases a HOC `WidthProvider` can be used to a
|
|
|
213
231
|
width upon initialization and window resize events.
|
|
214
232
|
|
|
215
233
|
```js
|
|
216
|
-
import { Responsive, WidthProvider } from
|
|
234
|
+
import { Responsive, WidthProvider } from "react-grid-layout";
|
|
217
235
|
|
|
218
236
|
const ResponsiveGridLayout = WidthProvider(Responsive);
|
|
219
237
|
|
|
@@ -222,14 +240,17 @@ class MyResponsiveGrid extends React.Component {
|
|
|
222
240
|
// {lg: layout1, md: layout2, ...}
|
|
223
241
|
var layouts = getLayoutsFromSomewhere();
|
|
224
242
|
return (
|
|
225
|
-
<ResponsiveGridLayout
|
|
226
|
-
|
|
227
|
-
|
|
243
|
+
<ResponsiveGridLayout
|
|
244
|
+
className="layout"
|
|
245
|
+
layouts={layouts}
|
|
246
|
+
breakpoints={{ lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0 }}
|
|
247
|
+
cols={{ lg: 12, md: 10, sm: 6, xs: 4, xxs: 2 }}
|
|
248
|
+
>
|
|
228
249
|
<div key="1">1</div>
|
|
229
250
|
<div key="2">2</div>
|
|
230
251
|
<div key="3">3</div>
|
|
231
252
|
</ResponsiveGridLayout>
|
|
232
|
-
)
|
|
253
|
+
);
|
|
233
254
|
}
|
|
234
255
|
}
|
|
235
256
|
```
|
|
@@ -266,6 +287,7 @@ cols: ?number = 12,
|
|
|
266
287
|
// A CSS selector for tags that will not be draggable.
|
|
267
288
|
// For example: draggableCancel:'.MyNonDraggableAreaClassName'
|
|
268
289
|
// If you forget the leading . it will not work.
|
|
290
|
+
// .react-resizable-handle" is always prepended to this value.
|
|
269
291
|
draggableCancel: ?string = '',
|
|
270
292
|
|
|
271
293
|
// A CSS selector for tags that will act as the draggable handle.
|
|
@@ -315,9 +337,14 @@ useCSSTransforms: ?boolean = true,
|
|
|
315
337
|
// we should set scale coefficient to avoid render artefacts while dragging.
|
|
316
338
|
transformScale: ?number = 1,
|
|
317
339
|
|
|
340
|
+
// If true, grid can be placed one over the other.
|
|
341
|
+
// If set, implies `preventCollision`.
|
|
342
|
+
allowOverlap: ?boolean = false,
|
|
343
|
+
|
|
318
344
|
// If true, grid items won't change position when being
|
|
319
|
-
// dragged over.
|
|
320
|
-
|
|
345
|
+
// dragged over. If `allowOverlap` is still false,
|
|
346
|
+
// this simply won't allow one to drop on an existing object.
|
|
347
|
+
preventCollision: ?boolean = false,
|
|
321
348
|
|
|
322
349
|
// If true, droppable elements (with `draggable={true}` attribute)
|
|
323
350
|
// can be dropped on the grid. It triggers "onDrop" callback
|
|
@@ -329,7 +356,7 @@ preventCollision: ?boolean = false;
|
|
|
329
356
|
// along with `draggable={true}` otherwise this feature will work incorrect.
|
|
330
357
|
// onDragStart attribute is required for Firefox for a dragging initialization
|
|
331
358
|
// @see https://bugzilla.mozilla.org/show_bug.cgi?id=568313
|
|
332
|
-
isDroppable: ?boolean = false
|
|
359
|
+
isDroppable: ?boolean = false,
|
|
333
360
|
// Defines which resize handles should be rendered
|
|
334
361
|
// Allows for any combination of:
|
|
335
362
|
// 's' - South handle (bottom-center)
|
|
@@ -340,10 +367,12 @@ isDroppable: ?boolean = false
|
|
|
340
367
|
// 'nw' - Northwest handle (top-left)
|
|
341
368
|
// 'se' - Southeast handle (bottom-right)
|
|
342
369
|
// 'ne' - Northeast handle (top-right)
|
|
343
|
-
resizeHandles: ?Array<'s' | 'w' | 'e' | 'n' | 'sw' | 'nw' | 'se' | 'ne'> = ['se']
|
|
370
|
+
resizeHandles: ?Array<'s' | 'w' | 'e' | 'n' | 'sw' | 'nw' | 'se' | 'ne'> = ['se'],
|
|
344
371
|
// Custom component for resize handles
|
|
345
|
-
// See `handle` as used in https://github.com/react-grid-layout/react-resizable#
|
|
346
|
-
|
|
372
|
+
// See `handle` as used in https://github.com/react-grid-layout/react-resizable#resize-handle
|
|
373
|
+
// Your component should have the class `.react-resizable-handle`, or you should add your custom
|
|
374
|
+
// class to the `draggableCancel` prop.
|
|
375
|
+
resizeHandle?: ReactElement<any> | ((resizeHandleAxis: ResizeHandleAxis, ref: ReactRef<HTMLElement>) => ReactElement<any>),
|
|
347
376
|
|
|
348
377
|
//
|
|
349
378
|
// Callbacks
|
|
@@ -358,7 +387,7 @@ onLayoutChange: (layout: Layout) => void,
|
|
|
358
387
|
// 'start' and 'stop' callbacks pass `undefined` for 'placeholder'.
|
|
359
388
|
//
|
|
360
389
|
type ItemCallback = (layout: Layout, oldItem: LayoutItem, newItem: LayoutItem,
|
|
361
|
-
placeholder: LayoutItem, e: MouseEvent, element: HTMLElement) => void
|
|
390
|
+
placeholder: LayoutItem, e: MouseEvent, element: HTMLElement) => void,
|
|
362
391
|
|
|
363
392
|
// Calls when drag starts.
|
|
364
393
|
onDragStart: ItemCallback,
|
|
@@ -372,12 +401,23 @@ onResizeStart: ItemCallback,
|
|
|
372
401
|
onResize: ItemCallback,
|
|
373
402
|
// Calls when resize is complete.
|
|
374
403
|
onResizeStop: ItemCallback,
|
|
404
|
+
|
|
405
|
+
//
|
|
406
|
+
// Dropover functionality
|
|
407
|
+
//
|
|
408
|
+
|
|
375
409
|
// Calls when an element has been dropped into the grid from outside.
|
|
376
|
-
onDrop: (layout: Layout, item: ?LayoutItem, e: Event) => void
|
|
410
|
+
onDrop: (layout: Layout, item: ?LayoutItem, e: Event) => void,
|
|
411
|
+
// Calls when an element is being dragged over the grid from outside as above.
|
|
412
|
+
// This callback should return an object to dynamically change the droppingItem size
|
|
413
|
+
// Return false to short-circuit the dragover
|
|
414
|
+
onDropDragOver: (e: DragOverEvent) => ?({|w?: number, h?: number|} | false),
|
|
377
415
|
|
|
378
416
|
// Ref for getting a reference for the grid's wrapping div.
|
|
379
417
|
// You can use this instead of a regular ref and the deprecated `ReactDOM.findDOMNode()`` function.
|
|
380
|
-
|
|
418
|
+
// Note that this type is React.Ref<HTMLDivElement> in TypeScript, Flow has a bug here
|
|
419
|
+
// https://github.com/facebook/flow/issues/8671#issuecomment-862634865
|
|
420
|
+
innerRef: {current: null | HTMLDivElement},
|
|
381
421
|
```
|
|
382
422
|
|
|
383
423
|
### Responsive Grid Layout Props
|
|
@@ -395,16 +435,16 @@ cols: ?Object = {lg: 12, md: 10, sm: 6, xs: 4, xxs: 2},
|
|
|
395
435
|
|
|
396
436
|
|
|
397
437
|
// margin (in pixels). Can be specified either as horizontal and vertical margin, e.g. `[10, 10]` or as a breakpoint -> margin map, e.g. `{lg: [10, 10], md: [10, 10], ...}.
|
|
398
|
-
margin: [number, number] | {[breakpoint: $Keys<breakpoints>]: [number, number]}
|
|
438
|
+
margin: [number, number] | {[breakpoint: $Keys<breakpoints>]: [number, number]},
|
|
399
439
|
|
|
400
440
|
|
|
401
441
|
// containerPadding (in pixels). Can be specified either as horizontal and vertical padding, e.g. `[10, 10]` or as a breakpoint -> containerPadding map, e.g. `{lg: [10, 10], md: [10, 10], ...}.
|
|
402
|
-
containerPadding: [number, number] | {[breakpoint: $Keys<breakpoints>]: [number, number]}
|
|
442
|
+
containerPadding: [number, number] | {[breakpoint: $Keys<breakpoints>]: [number, number]},
|
|
403
443
|
|
|
404
444
|
|
|
405
445
|
// layouts is an object mapping breakpoints to layouts.
|
|
406
446
|
// e.g. {lg: Layout, md: Layout, ...}
|
|
407
|
-
layouts: {[key: $Keys<breakpoints>]: Layout}
|
|
447
|
+
layouts: {[key: $Keys<breakpoints>]: Layout},
|
|
408
448
|
|
|
409
449
|
//
|
|
410
450
|
// Callbacks
|
|
@@ -475,7 +515,6 @@ will be draggable, even if the item is marked `static: true`.
|
|
|
475
515
|
|
|
476
516
|
`<ReactGridLayout>` has [an optimized `shouldComponentUpdate` implementation](lib/ReactGridLayout.jsx), but it relies on the user memoizing the `children` array:
|
|
477
517
|
|
|
478
|
-
|
|
479
518
|
```js
|
|
480
519
|
// lib/ReactGridLayout.jsx
|
|
481
520
|
// ...
|
|
@@ -498,7 +537,7 @@ If you memoize your children, you can take advantage of this, and reap faster re
|
|
|
498
537
|
function MyGrid(props) {
|
|
499
538
|
const children = React.useMemo(() => {
|
|
500
539
|
return new Array(props.count).fill(undefined).map((val, idx) => {
|
|
501
|
-
return <div key={idx} data-grid={{x: idx, y: 1, w: 1, h: 1}} />;
|
|
540
|
+
return <div key={idx} data-grid={{ x: idx, y: 1, w: 1, h: 1 }} />;
|
|
502
541
|
});
|
|
503
542
|
}, [props.count]);
|
|
504
543
|
return <ReactGridLayout cols={12}>{children}</ReactGridLayout>;
|
|
@@ -507,11 +546,34 @@ function MyGrid(props) {
|
|
|
507
546
|
|
|
508
547
|
Because the `children` prop doesn't change between rerenders, updates to `<MyGrid>` won't result in new renders, improving performance.
|
|
509
548
|
|
|
549
|
+
### Custom Child Components and Draggable Handles
|
|
550
|
+
|
|
551
|
+
If you use React Components as grid children, they need to do a few things:
|
|
552
|
+
|
|
553
|
+
1. Forward refs to an underlying DOM node, and
|
|
554
|
+
2. Forward `style` and `className` to that same DOM node.
|
|
555
|
+
|
|
556
|
+
For example:
|
|
557
|
+
|
|
558
|
+
```js
|
|
559
|
+
const CustomGridItemComponent = React.forwardRef(({style, className, ...props}, ref) => {
|
|
560
|
+
return (
|
|
561
|
+
<div style={{ /* styles */, ...style}} className={className} ref={ref}>
|
|
562
|
+
{/* Some other content */}
|
|
563
|
+
</div>
|
|
564
|
+
);
|
|
565
|
+
}
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
The same is true of custom elements as draggable handles using the `draggableHandle` prop. This is so that
|
|
569
|
+
the underlying `react-draggable` library can get a reference to the DOM node underneath, manipulate
|
|
570
|
+
positioning via `style`, and set classes.
|
|
571
|
+
|
|
510
572
|
## Contribute
|
|
511
573
|
|
|
512
574
|
If you have a feature request, please add it as an issue or make a pull request.
|
|
513
575
|
|
|
514
|
-
If you have a bug to report, please reproduce the bug in [CodeSandbox](https://codesandbox.io/s/
|
|
576
|
+
If you have a bug to report, please reproduce the bug in [CodeSandbox](https://codesandbox.io/s/staging-bush-3lvt7?file=/src/ShowcaseLayout.js) to help
|
|
515
577
|
us easily isolate it.
|
|
516
578
|
|
|
517
579
|
## TODO List
|
|
@@ -527,5 +589,5 @@ us easily isolate it.
|
|
|
527
589
|
- [x] Static elements
|
|
528
590
|
- [x] Persistent id per item for predictable localstorage restores, even when # items changes
|
|
529
591
|
- [x] Min/max w/h per item
|
|
530
|
-
- [
|
|
592
|
+
- [x] Resizable handles on other corners
|
|
531
593
|
- [ ] Configurable w/h per breakpoint
|
package/build/GridItem.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -21,27 +21,27 @@ var _calculateUtils = require("./calculateUtils");
|
|
|
21
21
|
|
|
22
22
|
var _ReactGridLayoutPropTypes = require("./ReactGridLayoutPropTypes");
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
25
25
|
|
|
26
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
27
|
|
|
28
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
28
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
29
29
|
|
|
30
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
30
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
31
31
|
|
|
32
32
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
33
33
|
|
|
34
34
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
35
35
|
|
|
36
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
36
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
37
37
|
|
|
38
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass
|
|
38
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
39
39
|
|
|
40
40
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
41
41
|
|
|
42
42
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
43
43
|
|
|
44
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
44
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
45
45
|
|
|
46
46
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
47
47
|
|
|
@@ -512,7 +512,7 @@ var GridItem = /*#__PURE__*/function (_React$Component) {
|
|
|
512
512
|
|
|
513
513
|
var newChild = /*#__PURE__*/_react.default.cloneElement(child, {
|
|
514
514
|
ref: this.elementRef,
|
|
515
|
-
className: (0,
|
|
515
|
+
className: (0, _clsx.default)("react-grid-item", child.props.className, this.props.className, {
|
|
516
516
|
static: this.props.static,
|
|
517
517
|
resizing: Boolean(this.state.resizing),
|
|
518
518
|
"react-draggable": isDraggable,
|