@elliemae/ds-resizeable-container 2.3.0-alpha.8 → 2.3.0-next.2
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 +323 -0
- package/cjs/defaultProps.js +10 -0
- package/cjs/index.js +11 -0
- package/cjs/props.js +24 -0
- package/esm/Resizable.js +309 -0
- package/esm/defaultProps.js +6 -0
- package/esm/index.js +1 -0
- package/esm/props.js +20 -0
- package/package.json +25 -27
- package/types/Resizable.d.ts +55 -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/dist/cjs/Resizable.js +0 -314
- package/dist/cjs/Resizable.js.map +0 -7
- package/dist/cjs/defaultProps.js +0 -38
- package/dist/cjs/defaultProps.js.map +0 -7
- package/dist/cjs/index.js +0 -36
- package/dist/cjs/index.js.map +0 -7
- package/dist/cjs/props.js +0 -42
- package/dist/cjs/props.js.map +0 -7
- package/dist/esm/Resizable.js +0 -285
- package/dist/esm/Resizable.js.map +0 -7
- package/dist/esm/defaultProps.js +0 -9
- package/dist/esm/defaultProps.js.map +0 -7
- package/dist/esm/index.js +0 -7
- package/dist/esm/index.js.map +0 -7
- package/dist/esm/props.js +0 -13
- package/dist/esm/props.js.map +0 -7
package/esm/props.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PropTypes } from 'react-desc';
|
|
2
|
+
|
|
3
|
+
const props = {
|
|
4
|
+
/** grid item content */
|
|
5
|
+
children: PropTypes.node.description('Grid item content'),
|
|
6
|
+
|
|
7
|
+
/** vertical resizing */
|
|
8
|
+
vertical: PropTypes.bool.description('vertical resizing'),
|
|
9
|
+
|
|
10
|
+
/** horizontal resizing */
|
|
11
|
+
horizontal: PropTypes.bool.description('horizontal resizing'),
|
|
12
|
+
|
|
13
|
+
/** Row layout cells */
|
|
14
|
+
rows: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])).description('Row layout cells'),
|
|
15
|
+
|
|
16
|
+
/** Column layout cells */
|
|
17
|
+
cols: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])).description('Column layout cells')
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { props };
|
package/package.json
CHANGED
|
@@ -1,30 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-resizeable-container",
|
|
3
|
-
"version": "2.3.0-
|
|
3
|
+
"version": "2.3.0-next.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Resizeable Container",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"module": "./dist/esm/index.js",
|
|
10
|
-
"main": "./dist/cjs/index.js",
|
|
11
|
-
"types": "./dist/types/index.d.ts",
|
|
6
|
+
"module": "./esm/index.js",
|
|
7
|
+
"main": "./cjs/index.js",
|
|
8
|
+
"types": "./types/index.d.ts",
|
|
12
9
|
"exports": {
|
|
13
10
|
".": {
|
|
14
|
-
"import": "./
|
|
15
|
-
"require": "./
|
|
11
|
+
"import": "./esm/index.js",
|
|
12
|
+
"require": "./cjs/index.js"
|
|
16
13
|
},
|
|
17
14
|
"./Resizable": {
|
|
18
|
-
"import": "./
|
|
19
|
-
"require": "./
|
|
15
|
+
"import": "./esm/Resizable.js",
|
|
16
|
+
"require": "./cjs/Resizable.js"
|
|
20
17
|
},
|
|
21
18
|
"./props": {
|
|
22
|
-
"import": "./
|
|
23
|
-
"require": "./
|
|
19
|
+
"import": "./esm/props.js",
|
|
20
|
+
"require": "./cjs/props.js"
|
|
24
21
|
},
|
|
25
22
|
"./defaultProps": {
|
|
26
|
-
"import": "./
|
|
27
|
-
"require": "./
|
|
23
|
+
"import": "./esm/defaultProps.js",
|
|
24
|
+
"require": "./cjs/defaultProps.js"
|
|
28
25
|
}
|
|
29
26
|
},
|
|
30
27
|
"sideEffects": [
|
|
@@ -36,17 +33,23 @@
|
|
|
36
33
|
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
37
34
|
},
|
|
38
35
|
"engines": {
|
|
39
|
-
"
|
|
40
|
-
"node": ">=
|
|
36
|
+
"npm": ">=7",
|
|
37
|
+
"node": ">=14"
|
|
41
38
|
},
|
|
42
39
|
"author": "ICE MT",
|
|
40
|
+
"scripts": {
|
|
41
|
+
"dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w",
|
|
42
|
+
"prebuild": "exit 0",
|
|
43
|
+
"predev": "exit 0",
|
|
44
|
+
"build": "node ../../scripts/build/build.js"
|
|
45
|
+
},
|
|
43
46
|
"dependencies": {
|
|
44
|
-
"@elliemae/ds-grid": "2.3.0-
|
|
45
|
-
"@elliemae/ds-system": "2.3.0-
|
|
47
|
+
"@elliemae/ds-grid": "2.3.0-next.2",
|
|
48
|
+
"@elliemae/ds-system": "2.3.0-next.1",
|
|
46
49
|
"react-desc": "~4.1.3"
|
|
47
50
|
},
|
|
48
51
|
"devDependencies": {
|
|
49
|
-
"@testing-library/jest-dom": "~5.15.
|
|
52
|
+
"@testing-library/jest-dom": "~5.15.0",
|
|
50
53
|
"@testing-library/react": "~12.1.2",
|
|
51
54
|
"@testing-library/user-event": "~13.5.0",
|
|
52
55
|
"styled-components": "~5.3.3"
|
|
@@ -58,12 +61,7 @@
|
|
|
58
61
|
},
|
|
59
62
|
"publishConfig": {
|
|
60
63
|
"access": "public",
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
"scripts": {
|
|
64
|
-
"dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w",
|
|
65
|
-
"prebuild": "exit 0",
|
|
66
|
-
"predev": "exit 0",
|
|
67
|
-
"build": "node ../../scripts/build/build.js"
|
|
64
|
+
"directory": "dist",
|
|
65
|
+
"generateSubmodules": true
|
|
68
66
|
}
|
|
69
67
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
15
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
16
|
+
};
|
|
17
|
+
isRequired: import("react-desc").PropTypesDescValue;
|
|
18
|
+
};
|
|
19
|
+
vertical: {
|
|
20
|
+
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
21
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
22
|
+
};
|
|
23
|
+
isRequired: import("react-desc").PropTypesDescValue;
|
|
24
|
+
};
|
|
25
|
+
horizontal: {
|
|
26
|
+
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
27
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
28
|
+
};
|
|
29
|
+
isRequired: import("react-desc").PropTypesDescValue;
|
|
30
|
+
};
|
|
31
|
+
rows: {
|
|
32
|
+
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
33
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
34
|
+
};
|
|
35
|
+
isRequired: import("react-desc").PropTypesDescValue;
|
|
36
|
+
};
|
|
37
|
+
cols: {
|
|
38
|
+
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
39
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
40
|
+
};
|
|
41
|
+
isRequired: import("react-desc").PropTypesDescValue;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
var defaultProps: {
|
|
45
|
+
vertical: boolean;
|
|
46
|
+
horizontal: boolean;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
declare const DSResizableContainerWithSchema: {
|
|
50
|
+
(props?: unknown): JSX.Element;
|
|
51
|
+
propTypes: unknown;
|
|
52
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
53
|
+
};
|
|
54
|
+
export { ResizableContainer, DSResizableContainerWithSchema };
|
|
55
|
+
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(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
6
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
7
|
+
};
|
|
8
|
+
isRequired: import("react-desc").PropTypesDescValue;
|
|
9
|
+
};
|
|
10
|
+
/** vertical resizing */
|
|
11
|
+
vertical: {
|
|
12
|
+
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
13
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
14
|
+
};
|
|
15
|
+
isRequired: import("react-desc").PropTypesDescValue;
|
|
16
|
+
};
|
|
17
|
+
/** horizontal resizing */
|
|
18
|
+
horizontal: {
|
|
19
|
+
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
20
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
21
|
+
};
|
|
22
|
+
isRequired: import("react-desc").PropTypesDescValue;
|
|
23
|
+
};
|
|
24
|
+
/** Row layout cells */
|
|
25
|
+
rows: {
|
|
26
|
+
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
27
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
28
|
+
};
|
|
29
|
+
isRequired: import("react-desc").PropTypesDescValue;
|
|
30
|
+
};
|
|
31
|
+
/** Column layout cells */
|
|
32
|
+
cols: {
|
|
33
|
+
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
34
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
35
|
+
};
|
|
36
|
+
isRequired: import("react-desc").PropTypesDescValue;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/cjs/Resizable.js
DELETED
|
@@ -1,314 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var Resizable_exports = {};
|
|
29
|
-
__export(Resizable_exports, {
|
|
30
|
-
DSResizableContainerWithSchema: () => DSResizableContainerWithSchema,
|
|
31
|
-
ResizableContainer: () => ResizableContainer,
|
|
32
|
-
default: () => Resizable_default
|
|
33
|
-
});
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
var import_react = __toESM(require("react"));
|
|
36
|
-
var import_react_desc = require("react-desc");
|
|
37
|
-
var import_styled_components = __toESM(require("styled-components"));
|
|
38
|
-
var import_ds_system = require("@elliemae/ds-system");
|
|
39
|
-
var import_ds_grid = require("@elliemae/ds-grid");
|
|
40
|
-
var import_props = require("./props");
|
|
41
|
-
var import_defaultProps = require("./defaultProps");
|
|
42
|
-
const safeDifference = 15;
|
|
43
|
-
const minDifference = 8;
|
|
44
|
-
const EVENT_TYPE = { MOUSE: "mouse", KEY: "arrows" };
|
|
45
|
-
const DIRECTION = {
|
|
46
|
-
L: "left",
|
|
47
|
-
R: "right",
|
|
48
|
-
U: "up",
|
|
49
|
-
D: "down"
|
|
50
|
-
};
|
|
51
|
-
function calcPosition(arrow, position) {
|
|
52
|
-
let offset;
|
|
53
|
-
switch (arrow) {
|
|
54
|
-
case DIRECTION.U:
|
|
55
|
-
offset = position - 3;
|
|
56
|
-
break;
|
|
57
|
-
case DIRECTION.D:
|
|
58
|
-
offset = position + 3;
|
|
59
|
-
break;
|
|
60
|
-
case DIRECTION.L:
|
|
61
|
-
offset = position - 3;
|
|
62
|
-
break;
|
|
63
|
-
case DIRECTION.R:
|
|
64
|
-
offset = position + 3;
|
|
65
|
-
break;
|
|
66
|
-
default:
|
|
67
|
-
offset = position;
|
|
68
|
-
}
|
|
69
|
-
return offset;
|
|
70
|
-
}
|
|
71
|
-
function cursorResolver(nextPx, px, isVertical) {
|
|
72
|
-
const orientation = {
|
|
73
|
-
vertical: "row-resize",
|
|
74
|
-
horizontal: "col-resize",
|
|
75
|
-
left: "w-resize",
|
|
76
|
-
right: "e-resize",
|
|
77
|
-
up: "n-resize",
|
|
78
|
-
down: "s-resize"
|
|
79
|
-
};
|
|
80
|
-
if (isVertical && nextPx && nextPx <= safeDifference + 1)
|
|
81
|
-
return orientation.up;
|
|
82
|
-
if (isVertical && px > safeDifference + 1)
|
|
83
|
-
return orientation.vertical;
|
|
84
|
-
if (isVertical && px <= safeDifference + 1)
|
|
85
|
-
return orientation.down;
|
|
86
|
-
if (!isVertical && nextPx && nextPx <= safeDifference + 1)
|
|
87
|
-
return orientation.left;
|
|
88
|
-
if (!isVertical && px <= safeDifference + 1)
|
|
89
|
-
return orientation.right;
|
|
90
|
-
if (!isVertical && px > safeDifference + 1)
|
|
91
|
-
return orientation.horizontal;
|
|
92
|
-
return isVertical ? orientation.vertical : orientation.horizontal;
|
|
93
|
-
}
|
|
94
|
-
function ResizableItemComponent({ innerRef, ...p }) {
|
|
95
|
-
return /* @__PURE__ */ import_react.default.createElement(import_ds_grid.Grid, {
|
|
96
|
-
ref: innerRef,
|
|
97
|
-
...p
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
const ResizableGrid = (0, import_styled_components.default)(import_ds_grid.Grid)``;
|
|
101
|
-
const ResizableItem = (0, import_styled_components.default)(ResizableItemComponent)`
|
|
102
|
-
position: relative;
|
|
103
|
-
`;
|
|
104
|
-
const ResizableBar = import_styled_components.default.div`
|
|
105
|
-
position: absolute;
|
|
106
|
-
cursor: ${({ container, nextContainer, v }) => cursorResolver(nextContainer, container, v)};
|
|
107
|
-
|
|
108
|
-
${(props) => {
|
|
109
|
-
if (props.v) {
|
|
110
|
-
return `
|
|
111
|
-
bottom: calc(${(0, import_ds_system.mapGap)(props.gutter)} * -0.5);
|
|
112
|
-
left: 0;
|
|
113
|
-
width: 100%;
|
|
114
|
-
height: 10px;
|
|
115
|
-
margin-bottom: -5px;
|
|
116
|
-
display: flex;
|
|
117
|
-
flex-direction: column;
|
|
118
|
-
justify-content:space-around;
|
|
119
|
-
align-items: center;
|
|
120
|
-
&:after{
|
|
121
|
-
width: 100%;
|
|
122
|
-
height: 1px;
|
|
123
|
-
display: block;
|
|
124
|
-
background: ${props.theme.colors.neutral["300"]};
|
|
125
|
-
content: '';
|
|
126
|
-
}
|
|
127
|
-
&:hover{
|
|
128
|
-
&:after{
|
|
129
|
-
background: ${props.theme.colors.brand["600"]};
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
`;
|
|
133
|
-
}
|
|
134
|
-
return `
|
|
135
|
-
top: 0;
|
|
136
|
-
right: calc(${(0, import_ds_system.mapGap)(props.gutter)} * -0.5);
|
|
137
|
-
height: 100%;
|
|
138
|
-
width: 10px;
|
|
139
|
-
margin-right: -5px;
|
|
140
|
-
display: flex;
|
|
141
|
-
flex-direction: row;
|
|
142
|
-
justify-content:space-around;
|
|
143
|
-
align-items: center;
|
|
144
|
-
&:after{
|
|
145
|
-
height: 100%;
|
|
146
|
-
width: 1px;
|
|
147
|
-
display: block;
|
|
148
|
-
background: ${props.theme.colors.neutral["300"]};
|
|
149
|
-
content: '';
|
|
150
|
-
}
|
|
151
|
-
&:hover{
|
|
152
|
-
&:after{
|
|
153
|
-
background: ${props.theme.colors.brand["600"]};
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
`;
|
|
157
|
-
}}
|
|
158
|
-
`;
|
|
159
|
-
const getWidths = (list) => list.map((l) => l.clientWidth);
|
|
160
|
-
const getHeights = (list) => list.map((l) => l.clientHeight);
|
|
161
|
-
function ResizableContainer({
|
|
162
|
-
children,
|
|
163
|
-
cols,
|
|
164
|
-
rows,
|
|
165
|
-
vertical,
|
|
166
|
-
horizontal,
|
|
167
|
-
...rest
|
|
168
|
-
}) {
|
|
169
|
-
const refs = (0, import_react.useRef)([]);
|
|
170
|
-
const [containers, setContainers] = (0, import_react.useState)(cols);
|
|
171
|
-
const [blocks, setBlocks] = (0, import_react.useState)(rows);
|
|
172
|
-
const [isDragging, setDragging] = (0, import_react.useState)(false);
|
|
173
|
-
const [start, setStartPoint] = (0, import_react.useState)(0);
|
|
174
|
-
const [resetPoint, setResetPoint] = (0, import_react.useState)();
|
|
175
|
-
(0, import_react.useEffect)(() => {
|
|
176
|
-
if (horizontal)
|
|
177
|
-
setContainers(getWidths(refs.current));
|
|
178
|
-
if (vertical)
|
|
179
|
-
setBlocks(getHeights(refs.current));
|
|
180
|
-
}, [refs.current, horizontal, vertical]);
|
|
181
|
-
const addRef = (node) => {
|
|
182
|
-
refs.current.push(node);
|
|
183
|
-
};
|
|
184
|
-
const resizePanels = (diff = 1, v = false) => {
|
|
185
|
-
const index = parseInt(start.index, 10);
|
|
186
|
-
if (!v) {
|
|
187
|
-
const newContainers = [...containers];
|
|
188
|
-
if (newContainers[index + 1] && newContainers[index + 1] > minDifference) {
|
|
189
|
-
newContainers[index + 1] = newContainers[index + 1] - diff;
|
|
190
|
-
newContainers[index] = diff + newContainers[index];
|
|
191
|
-
} else if (newContainers[index - 1] && newContainers[index - 1] > minDifference) {
|
|
192
|
-
newContainers[index - 1] = newContainers[index - 1] - diff;
|
|
193
|
-
newContainers[index] = diff + newContainers[index];
|
|
194
|
-
}
|
|
195
|
-
if (newContainers.every((c) => c > safeDifference))
|
|
196
|
-
setContainers(newContainers);
|
|
197
|
-
} else {
|
|
198
|
-
const newBlocks = [...blocks];
|
|
199
|
-
if (newBlocks[index + 1] && newBlocks[index + 1] > minDifference) {
|
|
200
|
-
newBlocks[index + 1] = newBlocks[index + 1] - diff;
|
|
201
|
-
newBlocks[index] = diff + newBlocks[index];
|
|
202
|
-
} else if (newBlocks[index - 1] && newBlocks[index - 1] > minDifference) {
|
|
203
|
-
newBlocks[index - 1] = newBlocks[index - 1] - diff;
|
|
204
|
-
newBlocks[index] = diff + newBlocks[index];
|
|
205
|
-
}
|
|
206
|
-
if (newBlocks.every((c) => c > safeDifference))
|
|
207
|
-
setBlocks(newBlocks);
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
const startResize = (event, index, v = false, type) => {
|
|
211
|
-
setDragging(type);
|
|
212
|
-
setStartPoint({
|
|
213
|
-
x: event.clientX,
|
|
214
|
-
y: event.clientY,
|
|
215
|
-
index,
|
|
216
|
-
v
|
|
217
|
-
});
|
|
218
|
-
setResetPoint({ containers, blocks });
|
|
219
|
-
};
|
|
220
|
-
const moveResize = (event, type) => {
|
|
221
|
-
if (isDragging && isDragging === type && !start.v) {
|
|
222
|
-
const diff = event.clientX - start.x;
|
|
223
|
-
if (diff === 0)
|
|
224
|
-
return;
|
|
225
|
-
setStartPoint({ x: event.clientX, index: start.index });
|
|
226
|
-
resizePanels(diff);
|
|
227
|
-
} else if (isDragging && isDragging === type && start.v) {
|
|
228
|
-
const diff = event.clientY - start.y;
|
|
229
|
-
if (diff === 0)
|
|
230
|
-
return;
|
|
231
|
-
setStartPoint({ ...start, y: event.clientY, index: start.index });
|
|
232
|
-
resizePanels(diff, true);
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
const endResize = (type) => {
|
|
236
|
-
if (isDragging === type) {
|
|
237
|
-
setDragging(false);
|
|
238
|
-
setStartPoint();
|
|
239
|
-
}
|
|
240
|
-
};
|
|
241
|
-
const handleKeyDown = (e, index, v = false) => {
|
|
242
|
-
const keyCodes = {
|
|
243
|
-
37: DIRECTION.L,
|
|
244
|
-
Left: DIRECTION.L,
|
|
245
|
-
ArrowLeft: DIRECTION.L,
|
|
246
|
-
38: DIRECTION.U,
|
|
247
|
-
Up: DIRECTION.U,
|
|
248
|
-
ArrowUp: DIRECTION.U,
|
|
249
|
-
39: DIRECTION.R,
|
|
250
|
-
Right: DIRECTION.R,
|
|
251
|
-
ArrowRight: DIRECTION.R,
|
|
252
|
-
40: DIRECTION.D,
|
|
253
|
-
Down: DIRECTION.D,
|
|
254
|
-
ArrowDown: DIRECTION.D
|
|
255
|
-
};
|
|
256
|
-
if (keyCodes[e.key || e.keyCode]) {
|
|
257
|
-
e.preventDefault();
|
|
258
|
-
const { top: y, left: x } = e.target.getBoundingClientRect();
|
|
259
|
-
if (!start) {
|
|
260
|
-
startResize({ clientX: x, clientY: y }, index, v, EVENT_TYPE.KEY);
|
|
261
|
-
} else {
|
|
262
|
-
const clientX = keyCodes[e.keyCode] === DIRECTION.L || keyCodes[e.keyCode] === DIRECTION.R ? calcPosition(keyCodes[e.keyCode], x) : x;
|
|
263
|
-
const clientY = keyCodes[e.keyCode] === DIRECTION.U || keyCodes[e.keyCode] === DIRECTION.D ? calcPosition(keyCodes[e.keyCode], y) : y;
|
|
264
|
-
moveResize({ clientX, clientY }, EVENT_TYPE.KEY);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
};
|
|
268
|
-
const onLeave = (type) => {
|
|
269
|
-
if (isDragging === type) {
|
|
270
|
-
setDragging(false);
|
|
271
|
-
if (resetPoint && resetPoint.blocks)
|
|
272
|
-
setBlocks(resetPoint.blocks);
|
|
273
|
-
if (resetPoint && resetPoint.containers)
|
|
274
|
-
setContainers(resetPoint.containers);
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
|
-
const count = import_react.default.Children.count(children);
|
|
278
|
-
return /* @__PURE__ */ import_react.default.createElement(ResizableGrid, {
|
|
279
|
-
...rest,
|
|
280
|
-
cols: containers,
|
|
281
|
-
onKeyUp: () => endResize(EVENT_TYPE.KEY),
|
|
282
|
-
onMouseLeave: () => onLeave(EVENT_TYPE.MOUSE),
|
|
283
|
-
onMouseMove: (e) => moveResize(e, EVENT_TYPE.MOUSE),
|
|
284
|
-
onMouseUp: () => endResize(EVENT_TYPE.MOUSE),
|
|
285
|
-
rows: blocks
|
|
286
|
-
}, import_react.default.Children.map(children, (child, index) => /* @__PURE__ */ import_react.default.createElement(ResizableItem, {
|
|
287
|
-
"data-index": index,
|
|
288
|
-
innerRef: addRef
|
|
289
|
-
}, child, count - 1 !== index && horizontal && /* @__PURE__ */ import_react.default.createElement(ResizableBar, {
|
|
290
|
-
container: containers[index],
|
|
291
|
-
"data-index": index,
|
|
292
|
-
gutter: rest.gutter,
|
|
293
|
-
nextContainer: containers[index + 1],
|
|
294
|
-
onKeyDown: (e) => handleKeyDown(e, index, false),
|
|
295
|
-
onMouseDown: (e) => startResize(e, index, false, EVENT_TYPE.MOUSE),
|
|
296
|
-
tabIndex: 0
|
|
297
|
-
}), count - 1 !== index && vertical && /* @__PURE__ */ import_react.default.createElement(ResizableBar, {
|
|
298
|
-
container: blocks[index],
|
|
299
|
-
"data-index": index,
|
|
300
|
-
gutter: rest.gutter,
|
|
301
|
-
nextContainer: blocks[index + 1],
|
|
302
|
-
onKeyDown: (e) => handleKeyDown(e, index, true),
|
|
303
|
-
onMouseDown: (e) => startResize(e, index, true, EVENT_TYPE.MOUSE),
|
|
304
|
-
tabIndex: 0,
|
|
305
|
-
v: true
|
|
306
|
-
}))));
|
|
307
|
-
}
|
|
308
|
-
ResizableContainer.propTypes = import_props.props;
|
|
309
|
-
ResizableContainer.defaultProps = import_defaultProps.defaultProps;
|
|
310
|
-
const DSResizableContainerWithSchema = (0, import_react_desc.describe)(ResizableContainer);
|
|
311
|
-
DSResizableContainerWithSchema.propTypes = import_props.props;
|
|
312
|
-
var Resizable_default = ResizableContainer;
|
|
313
|
-
module.exports = __toCommonJS(Resizable_exports);
|
|
314
|
-
//# sourceMappingURL=Resizable.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/Resizable.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-lines */\n/* eslint-disable max-statements */\nimport React, { useRef, useState, useEffect } from 'react';\nimport { describe } from 'react-desc';\nimport styled from 'styled-components';\nimport { mapGap } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { props as rprops } from './props';\nimport { defaultProps } from './defaultProps';\n\nconst safeDifference = 15;\nconst minDifference = 8;\nconst EVENT_TYPE = { MOUSE: 'mouse', KEY: 'arrows' };\nconst DIRECTION = {\n L: 'left',\n R: 'right',\n U: 'up',\n D: 'down',\n};\n\nfunction calcPosition(arrow, position) {\n let offset;\n switch (arrow) {\n case DIRECTION.U:\n offset = position - 3;\n break;\n case DIRECTION.D:\n offset = position + 3;\n break;\n case DIRECTION.L:\n offset = position - 3;\n break;\n case DIRECTION.R:\n offset = position + 3;\n break;\n default:\n offset = position;\n }\n return offset;\n}\n\nfunction cursorResolver(nextPx, px, isVertical) {\n const orientation = {\n vertical: 'row-resize',\n horizontal: 'col-resize',\n left: 'w-resize',\n right: 'e-resize',\n up: 'n-resize',\n down: 's-resize',\n };\n\n if (isVertical && nextPx && nextPx <= safeDifference + 1)\n return orientation.up;\n if (isVertical && px > safeDifference + 1) return orientation.vertical;\n if (isVertical && px <= safeDifference + 1) return orientation.down;\n\n if (!isVertical && nextPx && nextPx <= safeDifference + 1)\n return orientation.left;\n if (!isVertical && px <= safeDifference + 1) return orientation.right;\n if (!isVertical && px > safeDifference + 1) return orientation.horizontal;\n\n return isVertical ? orientation.vertical : orientation.horizontal;\n}\n\nfunction ResizableItemComponent({ innerRef, ...p }) {\n return <Grid ref={innerRef} {...p} />;\n}\n\nconst ResizableGrid = styled(Grid)``;\nconst ResizableItem = styled(ResizableItemComponent)`\n position: relative;\n`;\nconst ResizableBar = styled.div`\n position: absolute;\n cursor: ${({ container, nextContainer, v }) =>\n cursorResolver(nextContainer, container, v)};\n\n ${(props) => {\n if (props.v) {\n return `\n bottom: calc(${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: ${props.theme.colors.neutral['300']};\n content: '';\n }\n &:hover{\n &:after{\n background: ${props.theme.colors.brand['600']};\n } \n }\n `;\n }\n return `\n top: 0;\n right: calc(${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: ${props.theme.colors.neutral['300']};\n content: '';\n }\n &:hover{\n &:after{\n background: ${props.theme.colors.brand['600']};\n } \n }\n `;\n }}\n`;\nconst getWidths = (list) => list.map((l) => l.clientWidth);\nconst getHeights = (list) => list.map((l) => l.clientHeight);\n\nfunction ResizableContainer({\n children,\n cols,\n rows,\n vertical,\n horizontal,\n ...rest\n}) {\n const refs = useRef([]);\n const [containers, setContainers] = useState(cols);\n const [blocks, setBlocks] = useState(rows);\n const [isDragging, setDragging] = useState(false);\n const [start, setStartPoint] = useState(0);\n const [resetPoint, setResetPoint] = useState();\n\n useEffect(() => {\n if (horizontal) setContainers(getWidths(refs.current));\n if (vertical) setBlocks(getHeights(refs.current));\n }, [refs.current, horizontal, vertical]);\n const addRef = (node) => {\n refs.current.push(node);\n };\n const resizePanels = (diff = 1, v = false) => {\n const index = parseInt(start.index, 10);\n if (!v) {\n const newContainers = [...containers];\n if (\n newContainers[index + 1] &&\n newContainers[index + 1] > minDifference\n ) {\n newContainers[index + 1] = newContainers[index + 1] - diff;\n newContainers[index] = diff + newContainers[index];\n } else if (\n newContainers[index - 1] &&\n newContainers[index - 1] > minDifference\n ) {\n newContainers[index - 1] = newContainers[index - 1] - diff;\n newContainers[index] = diff + newContainers[index];\n }\n if (newContainers.every((c) => c > safeDifference))\n setContainers(newContainers);\n } else {\n const newBlocks = [...blocks];\n if (newBlocks[index + 1] && newBlocks[index + 1] > minDifference) {\n newBlocks[index + 1] = newBlocks[index + 1] - diff;\n newBlocks[index] = diff + newBlocks[index];\n } else if (newBlocks[index - 1] && newBlocks[index - 1] > minDifference) {\n newBlocks[index - 1] = newBlocks[index - 1] - diff;\n newBlocks[index] = diff + newBlocks[index];\n }\n if (newBlocks.every((c) => c > safeDifference)) setBlocks(newBlocks);\n }\n };\n const startResize = (event, index, v = false, type) => {\n setDragging(type);\n setStartPoint({\n x: event.clientX,\n y: event.clientY,\n index,\n v,\n });\n setResetPoint({ containers, blocks });\n };\n const moveResize = (event, type) => {\n if (isDragging && isDragging === type && !start.v) {\n const diff = event.clientX - start.x;\n if (diff === 0) return;\n setStartPoint({ x: event.clientX, index: start.index });\n resizePanels(diff);\n } else if (isDragging && isDragging === type && start.v) {\n const diff = event.clientY - start.y;\n if (diff === 0) return;\n setStartPoint({ ...start, y: event.clientY, index: start.index });\n resizePanels(diff, true);\n }\n };\n const endResize = (type) => {\n if (isDragging === type) {\n setDragging(false);\n setStartPoint();\n }\n };\n const handleKeyDown = (e, index, v = false) => {\n const keyCodes = {\n 37: DIRECTION.L,\n Left: DIRECTION.L,\n ArrowLeft: DIRECTION.L,\n 38: DIRECTION.U,\n Up: DIRECTION.U,\n ArrowUp: DIRECTION.U,\n 39: DIRECTION.R,\n Right: DIRECTION.R,\n ArrowRight: DIRECTION.R,\n 40: DIRECTION.D,\n Down: DIRECTION.D,\n ArrowDown: DIRECTION.D,\n };\n\n if (keyCodes[e.key || e.keyCode]) {\n e.preventDefault();\n const { top: y, left: x } = e.target.getBoundingClientRect();\n if (!start) {\n startResize({ clientX: x, clientY: y }, index, v, EVENT_TYPE.KEY);\n } else {\n const clientX =\n keyCodes[e.keyCode] === DIRECTION.L ||\n keyCodes[e.keyCode] === DIRECTION.R\n ? calcPosition(keyCodes[e.keyCode], x)\n : x;\n const clientY =\n keyCodes[e.keyCode] === DIRECTION.U ||\n keyCodes[e.keyCode] === DIRECTION.D\n ? calcPosition(keyCodes[e.keyCode], y)\n : y;\n\n moveResize({ clientX, clientY }, EVENT_TYPE.KEY);\n }\n }\n };\n\n const onLeave = (type) => {\n if (isDragging === type) {\n setDragging(false);\n\n if (resetPoint && resetPoint.blocks) setBlocks(resetPoint.blocks);\n if (resetPoint && resetPoint.containers)\n setContainers(resetPoint.containers);\n }\n };\n const count = React.Children.count(children);\n\n return (\n <ResizableGrid\n {...rest}\n cols={containers}\n onKeyUp={() => endResize(EVENT_TYPE.KEY)}\n onMouseLeave={() => onLeave(EVENT_TYPE.MOUSE)}\n onMouseMove={(e) => moveResize(e, EVENT_TYPE.MOUSE)}\n onMouseUp={() => endResize(EVENT_TYPE.MOUSE)}\n rows={blocks}\n >\n {React.Children.map(children, (child, index) => (\n <ResizableItem data-index={index} innerRef={addRef}>\n {child}\n {count - 1 !== index && horizontal && (\n <ResizableBar\n container={containers[index]}\n data-index={index}\n gutter={rest.gutter}\n nextContainer={containers[index + 1]}\n onKeyDown={(e) => handleKeyDown(e, index, false)}\n onMouseDown={(e) =>\n startResize(e, index, false, EVENT_TYPE.MOUSE)\n }\n tabIndex={0}\n />\n )}\n {count - 1 !== index && vertical && (\n <ResizableBar\n container={blocks[index]}\n data-index={index}\n gutter={rest.gutter}\n nextContainer={blocks[index + 1]}\n onKeyDown={(e) => handleKeyDown(e, index, true)}\n onMouseDown={(e) => startResize(e, index, true, EVENT_TYPE.MOUSE)}\n tabIndex={0}\n v\n />\n )}\n </ResizableItem>\n ))}\n </ResizableGrid>\n );\n}\n\nResizableContainer.propTypes = rprops;\nResizableContainer.defaultProps = defaultProps;\n\nconst DSResizableContainerWithSchema = describe(ResizableContainer);\nDSResizableContainerWithSchema.propTypes = rprops;\n\nexport { ResizableContainer, DSResizableContainerWithSchema };\nexport default ResizableContainer;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,mBAAmD;AACnD,wBAAyB;AACzB,+BAAmB;AACnB,uBAAuB;AACvB,qBAAqB;AACrB,mBAAgC;AAChC,0BAA6B;AAE7B,MAAM,iBAAiB;AACvB,MAAM,gBAAg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,SAAS,MAAM;AAEnC,SACE,mDAAC,eAAD;AAAA,OACM;AAAA,IACJ,MAAM;AAAA,IACN,SAAS,MAAM,UAAU,WAAW;AAAA,IACpC,cAAc,MAAM,QAAQ,WAAW;AAAA,IACvC,aAAa,CAAC,MAAM,WAAW,GAAG,WAAW;AAAA,IAC7C,WAAW,MAAM,UAAU,WAAW;AAAA,IACtC,MAAM;AAAA,KAEL,qBAAM,SAAS,IAAI,UAAU,CAAC,OAAO,UACpC,mDAAC,eAAD;AAAA,IAAe,cAAY;AAAA,IAAO,UAAU;AAAA,KACzC,OACA,QAAQ,MAAM,SAAS,cACtB,mDAAC,cAAD;AAAA,IACE,WAAW,WAAW;AAAA,IACtB,cAAY;AAAA,IACZ,QAAQ,KAAK;AAAA,IACb,eAAe,WAAW,QAAQ;AAAA,IAClC,WAAW,CAAC,MAAM,cAAc,GAAG,OAAO;AAAA,IAC1C,aAAa,CAAC,MACZ,YAAY,GAAG,OAAO,OAAO,WAAW;AAAA,IAE1C,UAAU;AAAA,MAGb,QAAQ,MAAM,SAAS,YACtB,mDAAC,cAAD;AAAA,IACE,WAAW,OAAO;AAAA,IAClB,cAAY;AAAA,IACZ,QAAQ,KAAK;AAAA,IACb,eAAe,OAAO,QAAQ;AAAA,IAC9B,WAAW,CAAC,MAAM,cAAc,GAAG,OAAO;AAAA,IAC1C,aAAa,CAAC,MAAM,YAAY,GAAG,OAAO,MAAM,WAAW;AAAA,IAC3D,UAAU;AAAA,IACV,GAAC;AAAA;AAAA;AASf,mBAAmB,YAAY;AAC/B,mBAAmB,eAAe;AAElC,MAAM,iCAAiC,gCAAS;AAChD,+BAA+B,YAAY;AAG3C,IAAO,oBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/cjs/defaultProps.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var defaultProps_exports = {};
|
|
29
|
-
__export(defaultProps_exports, {
|
|
30
|
-
defaultProps: () => defaultProps
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
const defaultProps = {
|
|
34
|
-
vertical: false,
|
|
35
|
-
horizontal: false
|
|
36
|
-
};
|
|
37
|
-
module.exports = __toCommonJS(defaultProps_exports);
|
|
38
|
-
//# sourceMappingURL=defaultProps.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/defaultProps.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export const defaultProps = {\n vertical: false,\n horizontal: false,\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,eAAe;AAAA,EAC1B,UAAU;AAAA,EACV,YAAY;AAAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/cjs/index.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var src_exports = {};
|
|
29
|
-
__export(src_exports, {
|
|
30
|
-
default: () => import_Resizable.default
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
__reExport(src_exports, require("./Resizable"));
|
|
34
|
-
var import_Resizable = __toESM(require("./Resizable"));
|
|
35
|
-
module.exports = __toCommonJS(src_exports);
|
|
36
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export * from './Resizable';\nexport { default } from './Resizable';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc;AACd,uBAAwB;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|