@elliemae/ds-resizeable-container 1.60.0 → 2.0.0-alpha.12
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/cjs/Resizable.js +106 -146
- package/cjs/defaultProps.js +1 -2
- package/cjs/index.js +1 -14
- package/cjs/props.js +1 -2
- package/esm/Resizable.js +100 -138
- package/esm/defaultProps.js +1 -2
- package/esm/index.js +0 -13
- package/esm/props.js +1 -2
- package/package.json +44 -12
- package/types/Resizable.d.ts +62 -0
- package/types/defaultProps.d.ts +4 -0
- package/types/index.d.ts +2 -0
- package/types/props.d.ts +38 -0
- package/types/tests/DSResizableContainer.events.test.d.ts +1 -0
- package/Resizable/package.json +0 -10
- package/cjs/Resizable.js.map +0 -1
- package/cjs/defaultProps.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/props.js.map +0 -1
- package/defaultProps/package.json +0 -10
- package/esm/Resizable.js.map +0 -1
- package/esm/defaultProps.js.map +0 -1
- package/esm/index.js.map +0 -1
- package/esm/props.js.map +0 -1
- package/props/package.json +0 -10
package/cjs/Resizable.js
CHANGED
|
@@ -2,11 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _jsx2 = require('@babel/runtime/helpers/jsx');
|
|
5
6
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
-
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
7
|
-
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
8
|
-
var _extends = require('@babel/runtime/helpers/extends');
|
|
9
7
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
10
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
11
|
+
require('core-js/modules/esnext.async-iterator.every.js');
|
|
12
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
13
|
+
require('core-js/modules/esnext.iterator.every.js');
|
|
14
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
15
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
16
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
17
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
18
|
var React = require('react');
|
|
11
19
|
var reactDesc = require('react-desc');
|
|
12
20
|
var styled = require('styled-components');
|
|
@@ -14,30 +22,29 @@ var dsSystem = require('@elliemae/ds-system');
|
|
|
14
22
|
var dsGrid = require('@elliemae/ds-grid');
|
|
15
23
|
var props = require('./props.js');
|
|
16
24
|
var defaultProps = require('./defaultProps.js');
|
|
25
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
17
26
|
|
|
18
27
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
28
|
|
|
29
|
+
var _jsx2__default = /*#__PURE__*/_interopDefaultLegacy(_jsx2);
|
|
20
30
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
21
|
-
var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
|
|
22
|
-
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
23
|
-
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
24
31
|
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
25
32
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
26
33
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
27
34
|
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
const _excluded = ["innerRef"],
|
|
36
|
+
_excluded2 = ["children", "cols", "rows", "vertical", "horizontal"];
|
|
30
37
|
|
|
31
38
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
32
39
|
|
|
33
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default[
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
41
|
+
const safeDifference = 15;
|
|
42
|
+
const minDifference = 8;
|
|
43
|
+
const EVENT_TYPE = {
|
|
37
44
|
MOUSE: 'mouse',
|
|
38
45
|
KEY: 'arrows'
|
|
39
46
|
};
|
|
40
|
-
|
|
47
|
+
const DIRECTION = {
|
|
41
48
|
L: 'left',
|
|
42
49
|
R: 'right',
|
|
43
50
|
U: 'up',
|
|
@@ -45,7 +52,7 @@ var DIRECTION = {
|
|
|
45
52
|
};
|
|
46
53
|
|
|
47
54
|
function calcPosition(arrow, position) {
|
|
48
|
-
|
|
55
|
+
let offset;
|
|
49
56
|
|
|
50
57
|
switch (arrow) {
|
|
51
58
|
case DIRECTION.U:
|
|
@@ -72,7 +79,7 @@ function calcPosition(arrow, position) {
|
|
|
72
79
|
}
|
|
73
80
|
|
|
74
81
|
function cursorResolver(nextPx, px, isVertical) {
|
|
75
|
-
|
|
82
|
+
const orientation = {
|
|
76
83
|
vertical: 'row-resize',
|
|
77
84
|
horizontal: 'col-resize',
|
|
78
85
|
left: 'w-resize',
|
|
@@ -90,28 +97,32 @@ function cursorResolver(nextPx, px, isVertical) {
|
|
|
90
97
|
}
|
|
91
98
|
|
|
92
99
|
function ResizableItemComponent(_ref) {
|
|
93
|
-
|
|
94
|
-
|
|
100
|
+
let {
|
|
101
|
+
innerRef
|
|
102
|
+
} = _ref,
|
|
103
|
+
p = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
95
104
|
|
|
96
|
-
return /*#__PURE__*/
|
|
105
|
+
return /*#__PURE__*/jsxRuntime.jsx(dsGrid.Grid, _objectSpread({
|
|
97
106
|
ref: innerRef
|
|
98
107
|
}, p));
|
|
99
108
|
}
|
|
100
109
|
|
|
101
|
-
|
|
110
|
+
const ResizableGrid = /*#__PURE__*/styled__default["default"](dsGrid.Grid).withConfig({
|
|
102
111
|
componentId: "sc-forwbw-0"
|
|
103
112
|
})([""]);
|
|
104
|
-
|
|
113
|
+
const ResizableItem = /*#__PURE__*/styled__default["default"](ResizableItemComponent).withConfig({
|
|
105
114
|
componentId: "sc-forwbw-1"
|
|
106
115
|
})(["position:relative;"]);
|
|
107
|
-
|
|
116
|
+
const ResizableBar = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
108
117
|
componentId: "sc-forwbw-2"
|
|
109
|
-
})(["position:absolute;cursor:", ";", ""],
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
118
|
+
})(["position:absolute;cursor:", ";", ""], _ref2 => {
|
|
119
|
+
let {
|
|
120
|
+
container,
|
|
121
|
+
nextContainer,
|
|
122
|
+
v
|
|
123
|
+
} = _ref2;
|
|
113
124
|
return cursorResolver(nextContainer, container, v);
|
|
114
|
-
},
|
|
125
|
+
}, props => {
|
|
115
126
|
if (props.v) {
|
|
116
127
|
return "\n bottom: calc(".concat(dsSystem.mapGap(props.gutter), " * -0.5);\n left: 0;\n width: 100%;\n height: 10px;\n margin-bottom: -5px;\n display: flex;\n flex-direction: column;\n justify-content:space-around;\n align-items: center;\n &:after{\n width: 100%;\n height: 1px;\n display: block;\n background: ").concat(props.theme.colors.neutral['300'], ";\n content: '';\n }\n &:hover{\n &:after{\n background: ").concat(props.theme.colors.brand['600'], ";\n } \n }\n ");
|
|
117
128
|
}
|
|
@@ -119,69 +130,42 @@ var ResizableBar = /*#__PURE__*/styled__default['default'].div.withConfig({
|
|
|
119
130
|
return "\n top: 0;\n right: calc(".concat(dsSystem.mapGap(props.gutter), " * -0.5);\n height: 100%;\n width: 10px;\n margin-right: -5px;\n display: flex;\n flex-direction: row;\n justify-content:space-around;\n align-items: center;\n &:after{\n height: 100%;\n width: 1px;\n display: block;\n background: ").concat(props.theme.colors.neutral['300'], ";\n content: '';\n }\n &:hover{\n &:after{\n background: ").concat(props.theme.colors.brand['600'], ";\n } \n }\n ");
|
|
120
131
|
});
|
|
121
132
|
|
|
122
|
-
|
|
123
|
-
return list.map(function (l) {
|
|
124
|
-
return l.clientWidth;
|
|
125
|
-
});
|
|
126
|
-
};
|
|
133
|
+
const getWidths = list => list.map(l => l.clientWidth);
|
|
127
134
|
|
|
128
|
-
|
|
129
|
-
return list.map(function (l) {
|
|
130
|
-
return l.clientHeight;
|
|
131
|
-
});
|
|
132
|
-
};
|
|
135
|
+
const getHeights = list => list.map(l => l.clientHeight);
|
|
133
136
|
|
|
134
137
|
function ResizableContainer(_ref3) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
blocks = _useState4[0],
|
|
152
|
-
setBlocks = _useState4[1];
|
|
153
|
-
|
|
154
|
-
var _useState5 = React.useState(false),
|
|
155
|
-
_useState6 = _slicedToArray__default['default'](_useState5, 2),
|
|
156
|
-
isDragging = _useState6[0],
|
|
157
|
-
setDragging = _useState6[1];
|
|
158
|
-
|
|
159
|
-
var _useState7 = React.useState(0),
|
|
160
|
-
_useState8 = _slicedToArray__default['default'](_useState7, 2),
|
|
161
|
-
start = _useState8[0],
|
|
162
|
-
setStartPoint = _useState8[1];
|
|
163
|
-
|
|
164
|
-
var _useState9 = React.useState(),
|
|
165
|
-
_useState10 = _slicedToArray__default['default'](_useState9, 2),
|
|
166
|
-
resetPoint = _useState10[0],
|
|
167
|
-
setResetPoint = _useState10[1];
|
|
168
|
-
|
|
169
|
-
React.useEffect(function () {
|
|
138
|
+
let {
|
|
139
|
+
children,
|
|
140
|
+
cols,
|
|
141
|
+
rows,
|
|
142
|
+
vertical,
|
|
143
|
+
horizontal
|
|
144
|
+
} = _ref3,
|
|
145
|
+
rest = _objectWithoutProperties__default["default"](_ref3, _excluded2);
|
|
146
|
+
|
|
147
|
+
const refs = React.useRef([]);
|
|
148
|
+
const [containers, setContainers] = React.useState(cols);
|
|
149
|
+
const [blocks, setBlocks] = React.useState(rows);
|
|
150
|
+
const [isDragging, setDragging] = React.useState(false);
|
|
151
|
+
const [start, setStartPoint] = React.useState(0);
|
|
152
|
+
const [resetPoint, setResetPoint] = React.useState();
|
|
153
|
+
React.useEffect(() => {
|
|
170
154
|
if (horizontal) setContainers(getWidths(refs.current));
|
|
171
155
|
if (vertical) setBlocks(getHeights(refs.current));
|
|
172
156
|
}, [refs.current, horizontal, vertical]);
|
|
173
157
|
|
|
174
|
-
|
|
158
|
+
const addRef = node => {
|
|
175
159
|
refs.current.push(node);
|
|
176
160
|
};
|
|
177
161
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
162
|
+
const resizePanels = function () {
|
|
163
|
+
let diff = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
164
|
+
let v = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
165
|
+
const index = parseInt(start.index, 10);
|
|
182
166
|
|
|
183
167
|
if (!v) {
|
|
184
|
-
|
|
168
|
+
const newContainers = [...containers];
|
|
185
169
|
|
|
186
170
|
if (newContainers[index + 1] && newContainers[index + 1] > minDifference) {
|
|
187
171
|
newContainers[index + 1] = newContainers[index + 1] - diff;
|
|
@@ -191,11 +175,9 @@ function ResizableContainer(_ref3) {
|
|
|
191
175
|
newContainers[index] = diff + newContainers[index];
|
|
192
176
|
}
|
|
193
177
|
|
|
194
|
-
if (newContainers.every(
|
|
195
|
-
return c > safeDifference;
|
|
196
|
-
})) setContainers(newContainers);
|
|
178
|
+
if (newContainers.every(c => c > safeDifference)) setContainers(newContainers);
|
|
197
179
|
} else {
|
|
198
|
-
|
|
180
|
+
const newBlocks = [...blocks];
|
|
199
181
|
|
|
200
182
|
if (newBlocks[index + 1] && newBlocks[index + 1] > minDifference) {
|
|
201
183
|
newBlocks[index + 1] = newBlocks[index + 1] - diff;
|
|
@@ -205,31 +187,29 @@ function ResizableContainer(_ref3) {
|
|
|
205
187
|
newBlocks[index] = diff + newBlocks[index];
|
|
206
188
|
}
|
|
207
189
|
|
|
208
|
-
if (newBlocks.every(
|
|
209
|
-
return c > safeDifference;
|
|
210
|
-
})) setBlocks(newBlocks);
|
|
190
|
+
if (newBlocks.every(c => c > safeDifference)) setBlocks(newBlocks);
|
|
211
191
|
}
|
|
212
192
|
};
|
|
213
193
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
194
|
+
const startResize = function (event, index) {
|
|
195
|
+
let v = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
196
|
+
let type = arguments.length > 3 ? arguments[3] : undefined;
|
|
217
197
|
setDragging(type);
|
|
218
198
|
setStartPoint({
|
|
219
199
|
x: event.clientX,
|
|
220
200
|
y: event.clientY,
|
|
221
|
-
index
|
|
222
|
-
v
|
|
201
|
+
index,
|
|
202
|
+
v
|
|
223
203
|
});
|
|
224
204
|
setResetPoint({
|
|
225
|
-
containers
|
|
226
|
-
blocks
|
|
205
|
+
containers,
|
|
206
|
+
blocks
|
|
227
207
|
});
|
|
228
208
|
};
|
|
229
209
|
|
|
230
|
-
|
|
210
|
+
const moveResize = (event, type) => {
|
|
231
211
|
if (isDragging && isDragging === type && !start.v) {
|
|
232
|
-
|
|
212
|
+
const diff = event.clientX - start.x;
|
|
233
213
|
if (diff === 0) return;
|
|
234
214
|
setStartPoint({
|
|
235
215
|
x: event.clientX,
|
|
@@ -237,27 +217,26 @@ function ResizableContainer(_ref3) {
|
|
|
237
217
|
});
|
|
238
218
|
resizePanels(diff);
|
|
239
219
|
} else if (isDragging && isDragging === type && start.v) {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
if (_diff === 0) return;
|
|
220
|
+
const diff = event.clientY - start.y;
|
|
221
|
+
if (diff === 0) return;
|
|
243
222
|
setStartPoint(_objectSpread(_objectSpread({}, start), {}, {
|
|
244
223
|
y: event.clientY,
|
|
245
224
|
index: start.index
|
|
246
225
|
}));
|
|
247
|
-
resizePanels(
|
|
226
|
+
resizePanels(diff, true);
|
|
248
227
|
}
|
|
249
228
|
};
|
|
250
229
|
|
|
251
|
-
|
|
230
|
+
const endResize = type => {
|
|
252
231
|
if (isDragging === type) {
|
|
253
232
|
setDragging(false);
|
|
254
233
|
setStartPoint();
|
|
255
234
|
}
|
|
256
235
|
};
|
|
257
236
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
237
|
+
const handleKeyDown = function (e, index) {
|
|
238
|
+
let v = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
239
|
+
const keyCodes = {
|
|
261
240
|
37: DIRECTION.L,
|
|
262
241
|
Left: DIRECTION.L,
|
|
263
242
|
ArrowLeft: DIRECTION.L,
|
|
@@ -274,10 +253,10 @@ function ResizableContainer(_ref3) {
|
|
|
274
253
|
|
|
275
254
|
if (keyCodes[e.key || e.keyCode]) {
|
|
276
255
|
e.preventDefault();
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
256
|
+
const {
|
|
257
|
+
top: y,
|
|
258
|
+
left: x
|
|
259
|
+
} = e.target.getBoundingClientRect();
|
|
281
260
|
|
|
282
261
|
if (!start) {
|
|
283
262
|
startResize({
|
|
@@ -285,17 +264,17 @@ function ResizableContainer(_ref3) {
|
|
|
285
264
|
clientY: y
|
|
286
265
|
}, index, v, EVENT_TYPE.KEY);
|
|
287
266
|
} else {
|
|
288
|
-
|
|
289
|
-
|
|
267
|
+
const clientX = keyCodes[e.keyCode] === DIRECTION.L || keyCodes[e.keyCode] === DIRECTION.R ? calcPosition(keyCodes[e.keyCode], x) : x;
|
|
268
|
+
const clientY = keyCodes[e.keyCode] === DIRECTION.U || keyCodes[e.keyCode] === DIRECTION.D ? calcPosition(keyCodes[e.keyCode], y) : y;
|
|
290
269
|
moveResize({
|
|
291
|
-
clientX
|
|
292
|
-
clientY
|
|
270
|
+
clientX,
|
|
271
|
+
clientY
|
|
293
272
|
}, EVENT_TYPE.KEY);
|
|
294
273
|
}
|
|
295
274
|
}
|
|
296
275
|
};
|
|
297
276
|
|
|
298
|
-
|
|
277
|
+
const onLeave = type => {
|
|
299
278
|
if (isDragging === type) {
|
|
300
279
|
setDragging(false);
|
|
301
280
|
if (resetPoint && resetPoint.blocks) setBlocks(resetPoint.blocks);
|
|
@@ -303,61 +282,42 @@ function ResizableContainer(_ref3) {
|
|
|
303
282
|
}
|
|
304
283
|
};
|
|
305
284
|
|
|
306
|
-
|
|
307
|
-
return /*#__PURE__*/
|
|
285
|
+
const count = React__default["default"].Children.count(children);
|
|
286
|
+
return /*#__PURE__*/jsxRuntime.jsx(ResizableGrid, _objectSpread(_objectSpread({}, rest), {}, {
|
|
308
287
|
cols: containers,
|
|
309
|
-
onKeyUp:
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
onMouseMove: function onMouseMove(e) {
|
|
316
|
-
return moveResize(e, EVENT_TYPE.MOUSE);
|
|
317
|
-
},
|
|
318
|
-
onMouseUp: function onMouseUp() {
|
|
319
|
-
return endResize(EVENT_TYPE.MOUSE);
|
|
320
|
-
},
|
|
321
|
-
rows: blocks
|
|
322
|
-
}), React__default['default'].Children.map(children, function (child, index) {
|
|
323
|
-
return /*#__PURE__*/React__default['default'].createElement(ResizableItem, {
|
|
288
|
+
onKeyUp: () => endResize(EVENT_TYPE.KEY),
|
|
289
|
+
onMouseLeave: () => onLeave(EVENT_TYPE.MOUSE),
|
|
290
|
+
onMouseMove: e => moveResize(e, EVENT_TYPE.MOUSE),
|
|
291
|
+
onMouseUp: () => endResize(EVENT_TYPE.MOUSE),
|
|
292
|
+
rows: blocks,
|
|
293
|
+
children: React__default["default"].Children.map(children, (child, index) => /*#__PURE__*/_jsx2__default["default"](ResizableItem, {
|
|
324
294
|
"data-index": index,
|
|
325
295
|
innerRef: addRef
|
|
326
|
-
}, child, count - 1 !== index && horizontal && /*#__PURE__*/
|
|
296
|
+
}, void 0, child, count - 1 !== index && horizontal && /*#__PURE__*/_jsx2__default["default"](ResizableBar, {
|
|
327
297
|
container: containers[index],
|
|
328
298
|
"data-index": index,
|
|
329
299
|
gutter: rest.gutter,
|
|
330
300
|
nextContainer: containers[index + 1],
|
|
331
|
-
onKeyDown:
|
|
332
|
-
|
|
333
|
-
},
|
|
334
|
-
onMouseDown: function onMouseDown(e) {
|
|
335
|
-
return startResize(e, index, false, EVENT_TYPE.MOUSE);
|
|
336
|
-
},
|
|
301
|
+
onKeyDown: e => handleKeyDown(e, index, false),
|
|
302
|
+
onMouseDown: e => startResize(e, index, false, EVENT_TYPE.MOUSE),
|
|
337
303
|
tabIndex: 0
|
|
338
|
-
}), count - 1 !== index && vertical && /*#__PURE__*/
|
|
304
|
+
}), count - 1 !== index && vertical && /*#__PURE__*/_jsx2__default["default"](ResizableBar, {
|
|
339
305
|
container: blocks[index],
|
|
340
306
|
"data-index": index,
|
|
341
307
|
gutter: rest.gutter,
|
|
342
308
|
nextContainer: blocks[index + 1],
|
|
343
|
-
onKeyDown:
|
|
344
|
-
|
|
345
|
-
},
|
|
346
|
-
onMouseDown: function onMouseDown(e) {
|
|
347
|
-
return startResize(e, index, true, EVENT_TYPE.MOUSE);
|
|
348
|
-
},
|
|
309
|
+
onKeyDown: e => handleKeyDown(e, index, true),
|
|
310
|
+
onMouseDown: e => startResize(e, index, true, EVENT_TYPE.MOUSE),
|
|
349
311
|
tabIndex: 0,
|
|
350
312
|
v: true
|
|
351
|
-
}))
|
|
313
|
+
})))
|
|
352
314
|
}));
|
|
353
315
|
}
|
|
354
316
|
|
|
355
|
-
ResizableContainer.propTypes = props.props;
|
|
356
317
|
ResizableContainer.defaultProps = defaultProps.defaultProps;
|
|
357
|
-
|
|
318
|
+
const DSResizableContainerWithSchema = reactDesc.describe(ResizableContainer);
|
|
358
319
|
DSResizableContainerWithSchema.propTypes = props.props;
|
|
359
320
|
|
|
360
321
|
exports.DSResizableContainerWithSchema = DSResizableContainerWithSchema;
|
|
361
322
|
exports.ResizableContainer = ResizableContainer;
|
|
362
|
-
exports[
|
|
363
|
-
//# sourceMappingURL=Resizable.js.map
|
|
323
|
+
exports["default"] = ResizableContainer;
|
package/cjs/defaultProps.js
CHANGED
package/cjs/index.js
CHANGED
|
@@ -3,22 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var Resizable = require('./Resizable.js');
|
|
6
|
-
require('@babel/runtime/helpers/defineProperty');
|
|
7
|
-
require('@babel/runtime/helpers/toConsumableArray');
|
|
8
|
-
require('@babel/runtime/helpers/slicedToArray');
|
|
9
|
-
require('@babel/runtime/helpers/extends');
|
|
10
|
-
require('@babel/runtime/helpers/objectWithoutProperties');
|
|
11
|
-
require('react');
|
|
12
|
-
require('react-desc');
|
|
13
|
-
require('styled-components');
|
|
14
|
-
require('@elliemae/ds-system');
|
|
15
|
-
require('@elliemae/ds-grid');
|
|
16
|
-
require('./props.js');
|
|
17
|
-
require('./defaultProps.js');
|
|
18
6
|
|
|
19
7
|
|
|
20
8
|
|
|
21
9
|
exports.DSResizableContainerWithSchema = Resizable.DSResizableContainerWithSchema;
|
|
22
10
|
exports.ResizableContainer = Resizable.ResizableContainer;
|
|
23
|
-
exports
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
|
11
|
+
exports["default"] = Resizable.ResizableContainer;
|
package/cjs/props.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var reactDesc = require('react-desc');
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const props = {
|
|
8
8
|
/** grid item content */
|
|
9
9
|
children: reactDesc.PropTypes.node.description('Grid item content'),
|
|
10
10
|
|
|
@@ -22,4 +22,3 @@ var props = {
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
exports.props = props;
|
|
25
|
-
//# sourceMappingURL=props.js.map
|