@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/esm/Resizable.js
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
3
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
4
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
5
|
+
import _jsx2 from '@babel/runtime/helpers/esm/jsx';
|
|
1
6
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
-
import _toConsumableArray from '@babel/runtime/helpers/esm/toConsumableArray';
|
|
3
|
-
import _slicedToArray from '@babel/runtime/helpers/esm/slicedToArray';
|
|
4
|
-
import _extends from '@babel/runtime/helpers/esm/extends';
|
|
5
7
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
8
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
9
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
10
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
11
|
+
import 'core-js/modules/esnext.async-iterator.every.js';
|
|
12
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
13
|
+
import 'core-js/modules/esnext.iterator.every.js';
|
|
6
14
|
import React, { useRef, useState, useEffect } from 'react';
|
|
7
15
|
import { describe } from 'react-desc';
|
|
8
16
|
import styled from 'styled-components';
|
|
@@ -10,20 +18,21 @@ import { mapGap } from '@elliemae/ds-system';
|
|
|
10
18
|
import { Grid } from '@elliemae/ds-grid';
|
|
11
19
|
import { props } from './props.js';
|
|
12
20
|
import { defaultProps } from './defaultProps.js';
|
|
21
|
+
import { jsx } from 'react/jsx-runtime';
|
|
13
22
|
|
|
14
|
-
|
|
15
|
-
|
|
23
|
+
const _excluded = ["innerRef"],
|
|
24
|
+
_excluded2 = ["children", "cols", "rows", "vertical", "horizontal"];
|
|
16
25
|
|
|
17
26
|
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; }
|
|
18
27
|
|
|
19
28
|
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(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; }
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
29
|
+
const safeDifference = 15;
|
|
30
|
+
const minDifference = 8;
|
|
31
|
+
const EVENT_TYPE = {
|
|
23
32
|
MOUSE: 'mouse',
|
|
24
33
|
KEY: 'arrows'
|
|
25
34
|
};
|
|
26
|
-
|
|
35
|
+
const DIRECTION = {
|
|
27
36
|
L: 'left',
|
|
28
37
|
R: 'right',
|
|
29
38
|
U: 'up',
|
|
@@ -31,7 +40,7 @@ var DIRECTION = {
|
|
|
31
40
|
};
|
|
32
41
|
|
|
33
42
|
function calcPosition(arrow, position) {
|
|
34
|
-
|
|
43
|
+
let offset;
|
|
35
44
|
|
|
36
45
|
switch (arrow) {
|
|
37
46
|
case DIRECTION.U:
|
|
@@ -58,7 +67,7 @@ function calcPosition(arrow, position) {
|
|
|
58
67
|
}
|
|
59
68
|
|
|
60
69
|
function cursorResolver(nextPx, px, isVertical) {
|
|
61
|
-
|
|
70
|
+
const orientation = {
|
|
62
71
|
vertical: 'row-resize',
|
|
63
72
|
horizontal: 'col-resize',
|
|
64
73
|
left: 'w-resize',
|
|
@@ -76,28 +85,32 @@ function cursorResolver(nextPx, px, isVertical) {
|
|
|
76
85
|
}
|
|
77
86
|
|
|
78
87
|
function ResizableItemComponent(_ref) {
|
|
79
|
-
|
|
88
|
+
let {
|
|
89
|
+
innerRef
|
|
90
|
+
} = _ref,
|
|
80
91
|
p = _objectWithoutProperties(_ref, _excluded);
|
|
81
92
|
|
|
82
|
-
return /*#__PURE__*/
|
|
93
|
+
return /*#__PURE__*/jsx(Grid, _objectSpread({
|
|
83
94
|
ref: innerRef
|
|
84
95
|
}, p));
|
|
85
96
|
}
|
|
86
97
|
|
|
87
|
-
|
|
98
|
+
const ResizableGrid = /*#__PURE__*/styled(Grid).withConfig({
|
|
88
99
|
componentId: "sc-forwbw-0"
|
|
89
100
|
})([""]);
|
|
90
|
-
|
|
101
|
+
const ResizableItem = /*#__PURE__*/styled(ResizableItemComponent).withConfig({
|
|
91
102
|
componentId: "sc-forwbw-1"
|
|
92
103
|
})(["position:relative;"]);
|
|
93
|
-
|
|
104
|
+
const ResizableBar = /*#__PURE__*/styled.div.withConfig({
|
|
94
105
|
componentId: "sc-forwbw-2"
|
|
95
|
-
})(["position:absolute;cursor:", ";", ""],
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
106
|
+
})(["position:absolute;cursor:", ";", ""], _ref2 => {
|
|
107
|
+
let {
|
|
108
|
+
container,
|
|
109
|
+
nextContainer,
|
|
110
|
+
v
|
|
111
|
+
} = _ref2;
|
|
99
112
|
return cursorResolver(nextContainer, container, v);
|
|
100
|
-
},
|
|
113
|
+
}, props => {
|
|
101
114
|
if (props.v) {
|
|
102
115
|
return "\n bottom: calc(".concat(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 ");
|
|
103
116
|
}
|
|
@@ -105,69 +118,42 @@ var ResizableBar = /*#__PURE__*/styled.div.withConfig({
|
|
|
105
118
|
return "\n top: 0;\n right: calc(".concat(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 ");
|
|
106
119
|
});
|
|
107
120
|
|
|
108
|
-
|
|
109
|
-
return list.map(function (l) {
|
|
110
|
-
return l.clientWidth;
|
|
111
|
-
});
|
|
112
|
-
};
|
|
121
|
+
const getWidths = list => list.map(l => l.clientWidth);
|
|
113
122
|
|
|
114
|
-
|
|
115
|
-
return list.map(function (l) {
|
|
116
|
-
return l.clientHeight;
|
|
117
|
-
});
|
|
118
|
-
};
|
|
123
|
+
const getHeights = list => list.map(l => l.clientHeight);
|
|
119
124
|
|
|
120
125
|
function ResizableContainer(_ref3) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
+
let {
|
|
127
|
+
children,
|
|
128
|
+
cols,
|
|
129
|
+
rows,
|
|
130
|
+
vertical,
|
|
131
|
+
horizontal
|
|
132
|
+
} = _ref3,
|
|
126
133
|
rest = _objectWithoutProperties(_ref3, _excluded2);
|
|
127
134
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
var _useState3 = useState(rows),
|
|
136
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
137
|
-
blocks = _useState4[0],
|
|
138
|
-
setBlocks = _useState4[1];
|
|
139
|
-
|
|
140
|
-
var _useState5 = useState(false),
|
|
141
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
142
|
-
isDragging = _useState6[0],
|
|
143
|
-
setDragging = _useState6[1];
|
|
144
|
-
|
|
145
|
-
var _useState7 = useState(0),
|
|
146
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
147
|
-
start = _useState8[0],
|
|
148
|
-
setStartPoint = _useState8[1];
|
|
149
|
-
|
|
150
|
-
var _useState9 = useState(),
|
|
151
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
152
|
-
resetPoint = _useState10[0],
|
|
153
|
-
setResetPoint = _useState10[1];
|
|
154
|
-
|
|
155
|
-
useEffect(function () {
|
|
135
|
+
const refs = useRef([]);
|
|
136
|
+
const [containers, setContainers] = useState(cols);
|
|
137
|
+
const [blocks, setBlocks] = useState(rows);
|
|
138
|
+
const [isDragging, setDragging] = useState(false);
|
|
139
|
+
const [start, setStartPoint] = useState(0);
|
|
140
|
+
const [resetPoint, setResetPoint] = useState();
|
|
141
|
+
useEffect(() => {
|
|
156
142
|
if (horizontal) setContainers(getWidths(refs.current));
|
|
157
143
|
if (vertical) setBlocks(getHeights(refs.current));
|
|
158
144
|
}, [refs.current, horizontal, vertical]);
|
|
159
145
|
|
|
160
|
-
|
|
146
|
+
const addRef = node => {
|
|
161
147
|
refs.current.push(node);
|
|
162
148
|
};
|
|
163
149
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
150
|
+
const resizePanels = function () {
|
|
151
|
+
let diff = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
152
|
+
let v = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
153
|
+
const index = parseInt(start.index, 10);
|
|
168
154
|
|
|
169
155
|
if (!v) {
|
|
170
|
-
|
|
156
|
+
const newContainers = [...containers];
|
|
171
157
|
|
|
172
158
|
if (newContainers[index + 1] && newContainers[index + 1] > minDifference) {
|
|
173
159
|
newContainers[index + 1] = newContainers[index + 1] - diff;
|
|
@@ -177,11 +163,9 @@ function ResizableContainer(_ref3) {
|
|
|
177
163
|
newContainers[index] = diff + newContainers[index];
|
|
178
164
|
}
|
|
179
165
|
|
|
180
|
-
if (newContainers.every(
|
|
181
|
-
return c > safeDifference;
|
|
182
|
-
})) setContainers(newContainers);
|
|
166
|
+
if (newContainers.every(c => c > safeDifference)) setContainers(newContainers);
|
|
183
167
|
} else {
|
|
184
|
-
|
|
168
|
+
const newBlocks = [...blocks];
|
|
185
169
|
|
|
186
170
|
if (newBlocks[index + 1] && newBlocks[index + 1] > minDifference) {
|
|
187
171
|
newBlocks[index + 1] = newBlocks[index + 1] - diff;
|
|
@@ -191,31 +175,29 @@ function ResizableContainer(_ref3) {
|
|
|
191
175
|
newBlocks[index] = diff + newBlocks[index];
|
|
192
176
|
}
|
|
193
177
|
|
|
194
|
-
if (newBlocks.every(
|
|
195
|
-
return c > safeDifference;
|
|
196
|
-
})) setBlocks(newBlocks);
|
|
178
|
+
if (newBlocks.every(c => c > safeDifference)) setBlocks(newBlocks);
|
|
197
179
|
}
|
|
198
180
|
};
|
|
199
181
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
182
|
+
const startResize = function (event, index) {
|
|
183
|
+
let v = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
184
|
+
let type = arguments.length > 3 ? arguments[3] : undefined;
|
|
203
185
|
setDragging(type);
|
|
204
186
|
setStartPoint({
|
|
205
187
|
x: event.clientX,
|
|
206
188
|
y: event.clientY,
|
|
207
|
-
index
|
|
208
|
-
v
|
|
189
|
+
index,
|
|
190
|
+
v
|
|
209
191
|
});
|
|
210
192
|
setResetPoint({
|
|
211
|
-
containers
|
|
212
|
-
blocks
|
|
193
|
+
containers,
|
|
194
|
+
blocks
|
|
213
195
|
});
|
|
214
196
|
};
|
|
215
197
|
|
|
216
|
-
|
|
198
|
+
const moveResize = (event, type) => {
|
|
217
199
|
if (isDragging && isDragging === type && !start.v) {
|
|
218
|
-
|
|
200
|
+
const diff = event.clientX - start.x;
|
|
219
201
|
if (diff === 0) return;
|
|
220
202
|
setStartPoint({
|
|
221
203
|
x: event.clientX,
|
|
@@ -223,27 +205,26 @@ function ResizableContainer(_ref3) {
|
|
|
223
205
|
});
|
|
224
206
|
resizePanels(diff);
|
|
225
207
|
} else if (isDragging && isDragging === type && start.v) {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
if (_diff === 0) return;
|
|
208
|
+
const diff = event.clientY - start.y;
|
|
209
|
+
if (diff === 0) return;
|
|
229
210
|
setStartPoint(_objectSpread(_objectSpread({}, start), {}, {
|
|
230
211
|
y: event.clientY,
|
|
231
212
|
index: start.index
|
|
232
213
|
}));
|
|
233
|
-
resizePanels(
|
|
214
|
+
resizePanels(diff, true);
|
|
234
215
|
}
|
|
235
216
|
};
|
|
236
217
|
|
|
237
|
-
|
|
218
|
+
const endResize = type => {
|
|
238
219
|
if (isDragging === type) {
|
|
239
220
|
setDragging(false);
|
|
240
221
|
setStartPoint();
|
|
241
222
|
}
|
|
242
223
|
};
|
|
243
224
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
225
|
+
const handleKeyDown = function (e, index) {
|
|
226
|
+
let v = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
227
|
+
const keyCodes = {
|
|
247
228
|
37: DIRECTION.L,
|
|
248
229
|
Left: DIRECTION.L,
|
|
249
230
|
ArrowLeft: DIRECTION.L,
|
|
@@ -260,10 +241,10 @@ function ResizableContainer(_ref3) {
|
|
|
260
241
|
|
|
261
242
|
if (keyCodes[e.key || e.keyCode]) {
|
|
262
243
|
e.preventDefault();
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
244
|
+
const {
|
|
245
|
+
top: y,
|
|
246
|
+
left: x
|
|
247
|
+
} = e.target.getBoundingClientRect();
|
|
267
248
|
|
|
268
249
|
if (!start) {
|
|
269
250
|
startResize({
|
|
@@ -271,17 +252,17 @@ function ResizableContainer(_ref3) {
|
|
|
271
252
|
clientY: y
|
|
272
253
|
}, index, v, EVENT_TYPE.KEY);
|
|
273
254
|
} else {
|
|
274
|
-
|
|
275
|
-
|
|
255
|
+
const clientX = keyCodes[e.keyCode] === DIRECTION.L || keyCodes[e.keyCode] === DIRECTION.R ? calcPosition(keyCodes[e.keyCode], x) : x;
|
|
256
|
+
const clientY = keyCodes[e.keyCode] === DIRECTION.U || keyCodes[e.keyCode] === DIRECTION.D ? calcPosition(keyCodes[e.keyCode], y) : y;
|
|
276
257
|
moveResize({
|
|
277
|
-
clientX
|
|
278
|
-
clientY
|
|
258
|
+
clientX,
|
|
259
|
+
clientY
|
|
279
260
|
}, EVENT_TYPE.KEY);
|
|
280
261
|
}
|
|
281
262
|
}
|
|
282
263
|
};
|
|
283
264
|
|
|
284
|
-
|
|
265
|
+
const onLeave = type => {
|
|
285
266
|
if (isDragging === type) {
|
|
286
267
|
setDragging(false);
|
|
287
268
|
if (resetPoint && resetPoint.blocks) setBlocks(resetPoint.blocks);
|
|
@@ -289,59 +270,40 @@ function ResizableContainer(_ref3) {
|
|
|
289
270
|
}
|
|
290
271
|
};
|
|
291
272
|
|
|
292
|
-
|
|
293
|
-
return /*#__PURE__*/
|
|
273
|
+
const count = React.Children.count(children);
|
|
274
|
+
return /*#__PURE__*/jsx(ResizableGrid, _objectSpread(_objectSpread({}, rest), {}, {
|
|
294
275
|
cols: containers,
|
|
295
|
-
onKeyUp:
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
onMouseMove: function onMouseMove(e) {
|
|
302
|
-
return moveResize(e, EVENT_TYPE.MOUSE);
|
|
303
|
-
},
|
|
304
|
-
onMouseUp: function onMouseUp() {
|
|
305
|
-
return endResize(EVENT_TYPE.MOUSE);
|
|
306
|
-
},
|
|
307
|
-
rows: blocks
|
|
308
|
-
}), React.Children.map(children, function (child, index) {
|
|
309
|
-
return /*#__PURE__*/React.createElement(ResizableItem, {
|
|
276
|
+
onKeyUp: () => endResize(EVENT_TYPE.KEY),
|
|
277
|
+
onMouseLeave: () => onLeave(EVENT_TYPE.MOUSE),
|
|
278
|
+
onMouseMove: e => moveResize(e, EVENT_TYPE.MOUSE),
|
|
279
|
+
onMouseUp: () => endResize(EVENT_TYPE.MOUSE),
|
|
280
|
+
rows: blocks,
|
|
281
|
+
children: React.Children.map(children, (child, index) => /*#__PURE__*/_jsx2(ResizableItem, {
|
|
310
282
|
"data-index": index,
|
|
311
283
|
innerRef: addRef
|
|
312
|
-
}, child, count - 1 !== index && horizontal && /*#__PURE__*/
|
|
284
|
+
}, void 0, child, count - 1 !== index && horizontal && /*#__PURE__*/_jsx2(ResizableBar, {
|
|
313
285
|
container: containers[index],
|
|
314
286
|
"data-index": index,
|
|
315
287
|
gutter: rest.gutter,
|
|
316
288
|
nextContainer: containers[index + 1],
|
|
317
|
-
onKeyDown:
|
|
318
|
-
|
|
319
|
-
},
|
|
320
|
-
onMouseDown: function onMouseDown(e) {
|
|
321
|
-
return startResize(e, index, false, EVENT_TYPE.MOUSE);
|
|
322
|
-
},
|
|
289
|
+
onKeyDown: e => handleKeyDown(e, index, false),
|
|
290
|
+
onMouseDown: e => startResize(e, index, false, EVENT_TYPE.MOUSE),
|
|
323
291
|
tabIndex: 0
|
|
324
|
-
}), count - 1 !== index && vertical && /*#__PURE__*/
|
|
292
|
+
}), count - 1 !== index && vertical && /*#__PURE__*/_jsx2(ResizableBar, {
|
|
325
293
|
container: blocks[index],
|
|
326
294
|
"data-index": index,
|
|
327
295
|
gutter: rest.gutter,
|
|
328
296
|
nextContainer: blocks[index + 1],
|
|
329
|
-
onKeyDown:
|
|
330
|
-
|
|
331
|
-
},
|
|
332
|
-
onMouseDown: function onMouseDown(e) {
|
|
333
|
-
return startResize(e, index, true, EVENT_TYPE.MOUSE);
|
|
334
|
-
},
|
|
297
|
+
onKeyDown: e => handleKeyDown(e, index, true),
|
|
298
|
+
onMouseDown: e => startResize(e, index, true, EVENT_TYPE.MOUSE),
|
|
335
299
|
tabIndex: 0,
|
|
336
300
|
v: true
|
|
337
|
-
}))
|
|
301
|
+
})))
|
|
338
302
|
}));
|
|
339
303
|
}
|
|
340
304
|
|
|
341
|
-
ResizableContainer.propTypes = props;
|
|
342
305
|
ResizableContainer.defaultProps = defaultProps;
|
|
343
|
-
|
|
306
|
+
const DSResizableContainerWithSchema = describe(ResizableContainer);
|
|
344
307
|
DSResizableContainerWithSchema.propTypes = props;
|
|
345
308
|
|
|
346
309
|
export { DSResizableContainerWithSchema, ResizableContainer, ResizableContainer as default };
|
|
347
|
-
//# sourceMappingURL=Resizable.js.map
|
package/esm/defaultProps.js
CHANGED
package/esm/index.js
CHANGED
|
@@ -1,14 +1 @@
|
|
|
1
1
|
export { DSResizableContainerWithSchema, ResizableContainer, ResizableContainer as default } from './Resizable.js';
|
|
2
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
3
|
-
import '@babel/runtime/helpers/esm/toConsumableArray';
|
|
4
|
-
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
5
|
-
import '@babel/runtime/helpers/esm/extends';
|
|
6
|
-
import '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
7
|
-
import 'react';
|
|
8
|
-
import 'react-desc';
|
|
9
|
-
import 'styled-components';
|
|
10
|
-
import '@elliemae/ds-system';
|
|
11
|
-
import '@elliemae/ds-grid';
|
|
12
|
-
import './props.js';
|
|
13
|
-
import './defaultProps.js';
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
package/esm/props.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropTypes } from 'react-desc';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const props = {
|
|
4
4
|
/** grid item content */
|
|
5
5
|
children: PropTypes.node.description('Grid item content'),
|
|
6
6
|
|
|
@@ -18,4 +18,3 @@ var props = {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export { props };
|
|
21
|
-
//# sourceMappingURL=props.js.map
|
package/package.json
CHANGED
|
@@ -1,14 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-resizeable-container",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.12",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"description": "
|
|
6
|
-
"module": "esm/index.js",
|
|
7
|
-
"main": "cjs/index.js",
|
|
5
|
+
"description": "ICE MT - Dimsum - Resizeable Container",
|
|
6
|
+
"module": "./esm/index.js",
|
|
7
|
+
"main": "./cjs/index.js",
|
|
8
|
+
"types": "./types/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./esm/index.js",
|
|
12
|
+
"require": "./cjs/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./Resizable": {
|
|
15
|
+
"import": "./esm/Resizable.js",
|
|
16
|
+
"require": "./cjs/Resizable.js"
|
|
17
|
+
},
|
|
18
|
+
"./props": {
|
|
19
|
+
"import": "./esm/props.js",
|
|
20
|
+
"require": "./cjs/props.js"
|
|
21
|
+
},
|
|
22
|
+
"./defaultProps": {
|
|
23
|
+
"import": "./esm/defaultProps.js",
|
|
24
|
+
"require": "./cjs/defaultProps.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
8
27
|
"sideEffects": [
|
|
9
28
|
"*.css",
|
|
10
29
|
"*.scss"
|
|
11
30
|
],
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"npm": ">=7",
|
|
37
|
+
"node": ">=14"
|
|
38
|
+
},
|
|
39
|
+
"author": "ICE MT",
|
|
12
40
|
"scripts": {
|
|
13
41
|
"dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w",
|
|
14
42
|
"prebuild": "exit 0",
|
|
@@ -16,20 +44,24 @@
|
|
|
16
44
|
"build": "node ../../scripts/build/build.js"
|
|
17
45
|
},
|
|
18
46
|
"dependencies": {
|
|
19
|
-
"@elliemae/ds-grid": "
|
|
20
|
-
"@elliemae/ds-system": "
|
|
21
|
-
"react-desc": "
|
|
47
|
+
"@elliemae/ds-grid": "2.0.0-alpha.12",
|
|
48
|
+
"@elliemae/ds-system": "2.0.0-alpha.12",
|
|
49
|
+
"react-desc": "~4.1.3"
|
|
22
50
|
},
|
|
23
51
|
"devDependencies": {
|
|
24
|
-
"
|
|
52
|
+
"@testing-library/jest-dom": "~5.15.0",
|
|
53
|
+
"@testing-library/react": "~12.1.2",
|
|
54
|
+
"@testing-library/user-event": "~13.5.0",
|
|
55
|
+
"styled-components": "~5.3.3"
|
|
25
56
|
},
|
|
26
57
|
"peerDependencies": {
|
|
27
|
-
"react": "^17.0.
|
|
28
|
-
"react-dom": "^17.0.
|
|
29
|
-
"styled-components": "^5.3.
|
|
58
|
+
"react": "^17.0.2",
|
|
59
|
+
"react-dom": "^17.0.2",
|
|
60
|
+
"styled-components": "^5.3.3"
|
|
30
61
|
},
|
|
31
62
|
"publishConfig": {
|
|
32
63
|
"access": "public",
|
|
33
|
-
"directory": "dist"
|
|
64
|
+
"directory": "dist",
|
|
65
|
+
"generateSubmodules": true
|
|
34
66
|
}
|
|
35
67
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
+
/// <reference types="react" />
|
|
3
|
+
declare function ResizableContainer({ children, cols, rows, vertical, horizontal, ...rest }: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
children: any;
|
|
6
|
+
cols: any;
|
|
7
|
+
rows: any;
|
|
8
|
+
vertical: any;
|
|
9
|
+
horizontal: any;
|
|
10
|
+
}): JSX.Element;
|
|
11
|
+
declare namespace ResizableContainer {
|
|
12
|
+
var propTypes: {
|
|
13
|
+
children: {
|
|
14
|
+
defaultValue<T = unknown>(arg: T): {
|
|
15
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
16
|
+
};
|
|
17
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
18
|
+
};
|
|
19
|
+
vertical: {
|
|
20
|
+
defaultValue<T = unknown>(arg: T): {
|
|
21
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
22
|
+
};
|
|
23
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
24
|
+
};
|
|
25
|
+
horizontal: {
|
|
26
|
+
defaultValue<T = unknown>(arg: T): {
|
|
27
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
28
|
+
};
|
|
29
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
30
|
+
};
|
|
31
|
+
rows: {
|
|
32
|
+
defaultValue<T = unknown>(arg: T): {
|
|
33
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
34
|
+
};
|
|
35
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
36
|
+
};
|
|
37
|
+
cols: {
|
|
38
|
+
defaultValue<T = unknown>(arg: T): {
|
|
39
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
40
|
+
};
|
|
41
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
var defaultProps: {
|
|
45
|
+
vertical: boolean;
|
|
46
|
+
horizontal: boolean;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
declare const DSResizableContainerWithSchema: {
|
|
50
|
+
(props?: {
|
|
51
|
+
[x: string]: any;
|
|
52
|
+
children: any;
|
|
53
|
+
cols: any;
|
|
54
|
+
rows: any;
|
|
55
|
+
vertical: any;
|
|
56
|
+
horizontal: any;
|
|
57
|
+
} | undefined): JSX.Element;
|
|
58
|
+
propTypes: unknown;
|
|
59
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
60
|
+
};
|
|
61
|
+
export { ResizableContainer, DSResizableContainerWithSchema };
|
|
62
|
+
export default ResizableContainer;
|
package/types/index.d.ts
ADDED
package/types/props.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
+
export declare const props: {
|
|
3
|
+
/** grid item content */
|
|
4
|
+
children: {
|
|
5
|
+
defaultValue<T = unknown>(arg: T): {
|
|
6
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
7
|
+
};
|
|
8
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
9
|
+
};
|
|
10
|
+
/** vertical resizing */
|
|
11
|
+
vertical: {
|
|
12
|
+
defaultValue<T = unknown>(arg: T): {
|
|
13
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
14
|
+
};
|
|
15
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
16
|
+
};
|
|
17
|
+
/** horizontal resizing */
|
|
18
|
+
horizontal: {
|
|
19
|
+
defaultValue<T = unknown>(arg: T): {
|
|
20
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
21
|
+
};
|
|
22
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
23
|
+
};
|
|
24
|
+
/** Row layout cells */
|
|
25
|
+
rows: {
|
|
26
|
+
defaultValue<T = unknown>(arg: T): {
|
|
27
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
28
|
+
};
|
|
29
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
30
|
+
};
|
|
31
|
+
/** Column layout cells */
|
|
32
|
+
cols: {
|
|
33
|
+
defaultValue<T = unknown>(arg: T): {
|
|
34
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
35
|
+
};
|
|
36
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|