@hi-ui/layout 4.0.0
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/README.md +11 -0
- package/lib/cjs/Content.js +48 -0
- package/lib/cjs/Layout.js +48 -0
- package/lib/cjs/SearchTrigger.js +55 -0
- package/lib/cjs/Sider.js +100 -0
- package/lib/cjs/_virtual/Draggable.js +16 -0
- package/lib/cjs/_virtual/DraggableCore.js +16 -0
- package/lib/cjs/_virtual/Resizable.js +16 -0
- package/lib/cjs/_virtual/ResizableBox.js +16 -0
- package/lib/cjs/_virtual/cjs.js +18 -0
- package/lib/cjs/_virtual/domFns.js +16 -0
- package/lib/cjs/_virtual/getPrefix.js +16 -0
- package/lib/cjs/_virtual/index.js +18 -0
- package/lib/cjs/_virtual/index2.js +18 -0
- package/lib/cjs/_virtual/index3.js +18 -0
- package/lib/cjs/_virtual/index4.js +18 -0
- package/lib/cjs/_virtual/log.js +16 -0
- package/lib/cjs/_virtual/positionFns.js +16 -0
- package/lib/cjs/_virtual/propTypes.js +16 -0
- package/lib/cjs/_virtual/react-is.development.js +16 -0
- package/lib/cjs/_virtual/react-is.production.min.js +16 -0
- package/lib/cjs/_virtual/shims.js +16 -0
- package/lib/cjs/_virtual/utils.js +16 -0
- package/lib/cjs/index.js +24 -0
- package/lib/cjs/node_modules/classnames/index.js +62 -0
- package/lib/cjs/node_modules/object-assign/index.js +94 -0
- package/lib/cjs/node_modules/prop-types/checkPropTypes.js +101 -0
- package/lib/cjs/node_modules/prop-types/factoryWithThrowingShims.js +68 -0
- package/lib/cjs/node_modules/prop-types/factoryWithTypeCheckers.js +553 -0
- package/lib/cjs/node_modules/prop-types/index.js +36 -0
- package/lib/cjs/node_modules/prop-types/lib/ReactPropTypesSecret.js +25 -0
- package/lib/cjs/node_modules/react-draggable/build/cjs/Draggable.js +655 -0
- package/lib/cjs/node_modules/react-draggable/build/cjs/DraggableCore.js +670 -0
- package/lib/cjs/node_modules/react-draggable/build/cjs/cjs.js +23 -0
- package/lib/cjs/node_modules/react-draggable/build/cjs/utils/domFns.js +366 -0
- package/lib/cjs/node_modules/react-draggable/build/cjs/utils/getPrefix.js +69 -0
- package/lib/cjs/node_modules/react-draggable/build/cjs/utils/log.js +19 -0
- package/lib/cjs/node_modules/react-draggable/build/cjs/utils/positionFns.js +176 -0
- package/lib/cjs/node_modules/react-draggable/build/cjs/utils/shims.js +57 -0
- package/lib/cjs/node_modules/react-is/cjs/react-is.development.js +182 -0
- package/lib/cjs/node_modules/react-is/cjs/react-is.production.min.js +132 -0
- package/lib/cjs/node_modules/react-is/index.js +21 -0
- package/lib/cjs/node_modules/react-resizable/build/Resizable.js +366 -0
- package/lib/cjs/node_modules/react-resizable/build/ResizableBox.js +244 -0
- package/lib/cjs/node_modules/react-resizable/build/propTypes.js +115 -0
- package/lib/cjs/node_modules/react-resizable/build/utils.js +86 -0
- package/lib/cjs/node_modules/react-resizable/index.js +25 -0
- package/lib/cjs/packages/icons/lib/esm/components/common/search-outlined.js +65 -0
- package/lib/cjs/packages/icons/lib/esm/styles/index.scss.js +35 -0
- package/lib/cjs/styles/index.scss.js +18 -0
- package/lib/esm/Content.js +36 -0
- package/lib/esm/Layout.js +36 -0
- package/lib/esm/SearchTrigger.js +43 -0
- package/lib/esm/Sider.js +88 -0
- package/lib/esm/_virtual/Draggable.js +11 -0
- package/lib/esm/_virtual/DraggableCore.js +11 -0
- package/lib/esm/_virtual/Resizable.js +11 -0
- package/lib/esm/_virtual/ResizableBox.js +11 -0
- package/lib/esm/_virtual/cjs.js +13 -0
- package/lib/esm/_virtual/domFns.js +11 -0
- package/lib/esm/_virtual/getPrefix.js +11 -0
- package/lib/esm/_virtual/index.js +13 -0
- package/lib/esm/_virtual/index2.js +13 -0
- package/lib/esm/_virtual/index3.js +13 -0
- package/lib/esm/_virtual/index4.js +13 -0
- package/lib/esm/_virtual/log.js +11 -0
- package/lib/esm/_virtual/positionFns.js +11 -0
- package/lib/esm/_virtual/propTypes.js +11 -0
- package/lib/esm/_virtual/react-is.development.js +11 -0
- package/lib/esm/_virtual/react-is.production.min.js +11 -0
- package/lib/esm/_virtual/shims.js +11 -0
- package/lib/esm/_virtual/utils.js +11 -0
- package/lib/esm/index.js +14 -0
- package/lib/esm/node_modules/classnames/index.js +60 -0
- package/lib/esm/node_modules/object-assign/index.js +88 -0
- package/lib/esm/node_modules/prop-types/checkPropTypes.js +96 -0
- package/lib/esm/node_modules/prop-types/factoryWithThrowingShims.js +63 -0
- package/lib/esm/node_modules/prop-types/factoryWithTypeCheckers.js +548 -0
- package/lib/esm/node_modules/prop-types/index.js +34 -0
- package/lib/esm/node_modules/prop-types/lib/ReactPropTypesSecret.js +19 -0
- package/lib/esm/node_modules/react-draggable/build/cjs/Draggable.js +645 -0
- package/lib/esm/node_modules/react-draggable/build/cjs/DraggableCore.js +660 -0
- package/lib/esm/node_modules/react-draggable/build/cjs/cjs.js +21 -0
- package/lib/esm/node_modules/react-draggable/build/cjs/utils/domFns.js +361 -0
- package/lib/esm/node_modules/react-draggable/build/cjs/utils/getPrefix.js +67 -0
- package/lib/esm/node_modules/react-draggable/build/cjs/utils/log.js +17 -0
- package/lib/esm/node_modules/react-draggable/build/cjs/utils/positionFns.js +171 -0
- package/lib/esm/node_modules/react-draggable/build/cjs/utils/shims.js +52 -0
- package/lib/esm/node_modules/react-is/cjs/react-is.development.js +177 -0
- package/lib/esm/node_modules/react-is/cjs/react-is.production.min.js +127 -0
- package/lib/esm/node_modules/react-is/index.js +19 -0
- package/lib/esm/node_modules/react-resizable/build/Resizable.js +358 -0
- package/lib/esm/node_modules/react-resizable/build/ResizableBox.js +236 -0
- package/lib/esm/node_modules/react-resizable/build/propTypes.js +110 -0
- package/lib/esm/node_modules/react-resizable/build/utils.js +74 -0
- package/lib/esm/node_modules/react-resizable/index.js +20 -0
- package/lib/esm/packages/icons/lib/esm/components/common/search-outlined.js +53 -0
- package/lib/esm/packages/icons/lib/esm/styles/index.scss.js +23 -0
- package/lib/esm/styles/index.scss.js +13 -0
- package/lib/types/Content.d.ts +8 -0
- package/lib/types/Layout.d.ts +8 -0
- package/lib/types/SearchTrigger.d.ts +10 -0
- package/lib/types/Sider.d.ts +10 -0
- package/lib/types/index.d.ts +6 -0
- package/package.json +61 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
2
|
+
/** @LICENSE
|
|
3
|
+
* @hi-ui/layout
|
|
4
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/layout#readme
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/
|
|
11
|
+
import { __exports as reactIs_development } from '../../../_virtual/react-is.development.js';
|
|
12
|
+
|
|
13
|
+
/** @license React v16.13.1
|
|
14
|
+
* react-is.development.js
|
|
15
|
+
*
|
|
16
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
17
|
+
*
|
|
18
|
+
* This source code is licensed under the MIT license found in the
|
|
19
|
+
* LICENSE file in the root directory of this source tree.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
if (process.env.NODE_ENV !== "production") {
|
|
23
|
+
(function () {
|
|
24
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
25
|
+
// nor polyfill, then a plain number is used for performance.
|
|
26
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol["for"];
|
|
27
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol["for"]('react.element') : 0xeac7;
|
|
28
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol["for"]('react.portal') : 0xeaca;
|
|
29
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol["for"]('react.fragment') : 0xeacb;
|
|
30
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol["for"]('react.strict_mode') : 0xeacc;
|
|
31
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol["for"]('react.profiler') : 0xead2;
|
|
32
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol["for"]('react.provider') : 0xeacd;
|
|
33
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol["for"]('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
34
|
+
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
35
|
+
|
|
36
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol["for"]('react.async_mode') : 0xeacf;
|
|
37
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol["for"]('react.concurrent_mode') : 0xeacf;
|
|
38
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol["for"]('react.forward_ref') : 0xead0;
|
|
39
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol["for"]('react.suspense') : 0xead1;
|
|
40
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol["for"]('react.suspense_list') : 0xead8;
|
|
41
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol["for"]('react.memo') : 0xead3;
|
|
42
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol["for"]('react.lazy') : 0xead4;
|
|
43
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol["for"]('react.block') : 0xead9;
|
|
44
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol["for"]('react.fundamental') : 0xead5;
|
|
45
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol["for"]('react.responder') : 0xead6;
|
|
46
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol["for"]('react.scope') : 0xead7;
|
|
47
|
+
function isValidElementType(type) {
|
|
48
|
+
return typeof type === 'string' || typeof type === 'function' ||
|
|
49
|
+
// Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
50
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || _typeof(type) === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
51
|
+
}
|
|
52
|
+
function typeOf(object) {
|
|
53
|
+
if (_typeof(object) === 'object' && object !== null) {
|
|
54
|
+
var $$typeof = object.$$typeof;
|
|
55
|
+
switch ($$typeof) {
|
|
56
|
+
case REACT_ELEMENT_TYPE:
|
|
57
|
+
var type = object.type;
|
|
58
|
+
switch (type) {
|
|
59
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
60
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
61
|
+
case REACT_FRAGMENT_TYPE:
|
|
62
|
+
case REACT_PROFILER_TYPE:
|
|
63
|
+
case REACT_STRICT_MODE_TYPE:
|
|
64
|
+
case REACT_SUSPENSE_TYPE:
|
|
65
|
+
return type;
|
|
66
|
+
default:
|
|
67
|
+
var $$typeofType = type && type.$$typeof;
|
|
68
|
+
switch ($$typeofType) {
|
|
69
|
+
case REACT_CONTEXT_TYPE:
|
|
70
|
+
case REACT_FORWARD_REF_TYPE:
|
|
71
|
+
case REACT_LAZY_TYPE:
|
|
72
|
+
case REACT_MEMO_TYPE:
|
|
73
|
+
case REACT_PROVIDER_TYPE:
|
|
74
|
+
return $$typeofType;
|
|
75
|
+
default:
|
|
76
|
+
return $$typeof;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
case REACT_PORTAL_TYPE:
|
|
80
|
+
return $$typeof;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return undefined;
|
|
84
|
+
} // AsyncMode is deprecated along with isAsyncMode
|
|
85
|
+
|
|
86
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
87
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
88
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
89
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
90
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
91
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
92
|
+
var Fragment = REACT_FRAGMENT_TYPE;
|
|
93
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
94
|
+
var Memo = REACT_MEMO_TYPE;
|
|
95
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
96
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
97
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
98
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
99
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
100
|
+
|
|
101
|
+
function isAsyncMode(object) {
|
|
102
|
+
{
|
|
103
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
104
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
105
|
+
|
|
106
|
+
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
110
|
+
}
|
|
111
|
+
function isConcurrentMode(object) {
|
|
112
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
113
|
+
}
|
|
114
|
+
function isContextConsumer(object) {
|
|
115
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
116
|
+
}
|
|
117
|
+
function isContextProvider(object) {
|
|
118
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
119
|
+
}
|
|
120
|
+
function isElement(object) {
|
|
121
|
+
return _typeof(object) === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
122
|
+
}
|
|
123
|
+
function isForwardRef(object) {
|
|
124
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
125
|
+
}
|
|
126
|
+
function isFragment(object) {
|
|
127
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
128
|
+
}
|
|
129
|
+
function isLazy(object) {
|
|
130
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
131
|
+
}
|
|
132
|
+
function isMemo(object) {
|
|
133
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
134
|
+
}
|
|
135
|
+
function isPortal(object) {
|
|
136
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
137
|
+
}
|
|
138
|
+
function isProfiler(object) {
|
|
139
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
140
|
+
}
|
|
141
|
+
function isStrictMode(object) {
|
|
142
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
143
|
+
}
|
|
144
|
+
function isSuspense(object) {
|
|
145
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
146
|
+
}
|
|
147
|
+
reactIs_development.AsyncMode = AsyncMode;
|
|
148
|
+
reactIs_development.ConcurrentMode = ConcurrentMode;
|
|
149
|
+
reactIs_development.ContextConsumer = ContextConsumer;
|
|
150
|
+
reactIs_development.ContextProvider = ContextProvider;
|
|
151
|
+
reactIs_development.Element = Element;
|
|
152
|
+
reactIs_development.ForwardRef = ForwardRef;
|
|
153
|
+
reactIs_development.Fragment = Fragment;
|
|
154
|
+
reactIs_development.Lazy = Lazy;
|
|
155
|
+
reactIs_development.Memo = Memo;
|
|
156
|
+
reactIs_development.Portal = Portal;
|
|
157
|
+
reactIs_development.Profiler = Profiler;
|
|
158
|
+
reactIs_development.StrictMode = StrictMode;
|
|
159
|
+
reactIs_development.Suspense = Suspense;
|
|
160
|
+
reactIs_development.isAsyncMode = isAsyncMode;
|
|
161
|
+
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
162
|
+
reactIs_development.isContextConsumer = isContextConsumer;
|
|
163
|
+
reactIs_development.isContextProvider = isContextProvider;
|
|
164
|
+
reactIs_development.isElement = isElement;
|
|
165
|
+
reactIs_development.isForwardRef = isForwardRef;
|
|
166
|
+
reactIs_development.isFragment = isFragment;
|
|
167
|
+
reactIs_development.isLazy = isLazy;
|
|
168
|
+
reactIs_development.isMemo = isMemo;
|
|
169
|
+
reactIs_development.isPortal = isPortal;
|
|
170
|
+
reactIs_development.isProfiler = isProfiler;
|
|
171
|
+
reactIs_development.isStrictMode = isStrictMode;
|
|
172
|
+
reactIs_development.isSuspense = isSuspense;
|
|
173
|
+
reactIs_development.isValidElementType = isValidElementType;
|
|
174
|
+
reactIs_development.typeOf = typeOf;
|
|
175
|
+
})();
|
|
176
|
+
}
|
|
177
|
+
export { reactIs_development as default };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
2
|
+
/** @LICENSE
|
|
3
|
+
* @hi-ui/layout
|
|
4
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/layout#readme
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/
|
|
11
|
+
import { __exports as reactIs_production_min } from '../../../_virtual/react-is.production.min.js';
|
|
12
|
+
|
|
13
|
+
/** @license React v16.13.1
|
|
14
|
+
* react-is.production.min.js
|
|
15
|
+
*
|
|
16
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
17
|
+
*
|
|
18
|
+
* This source code is licensed under the MIT license found in the
|
|
19
|
+
* LICENSE file in the root directory of this source tree.
|
|
20
|
+
*/
|
|
21
|
+
var b = "function" === typeof Symbol && Symbol["for"],
|
|
22
|
+
c = b ? Symbol["for"]("react.element") : 60103,
|
|
23
|
+
d = b ? Symbol["for"]("react.portal") : 60106,
|
|
24
|
+
e = b ? Symbol["for"]("react.fragment") : 60107,
|
|
25
|
+
f = b ? Symbol["for"]("react.strict_mode") : 60108,
|
|
26
|
+
g = b ? Symbol["for"]("react.profiler") : 60114,
|
|
27
|
+
h = b ? Symbol["for"]("react.provider") : 60109,
|
|
28
|
+
k = b ? Symbol["for"]("react.context") : 60110,
|
|
29
|
+
l = b ? Symbol["for"]("react.async_mode") : 60111,
|
|
30
|
+
m = b ? Symbol["for"]("react.concurrent_mode") : 60111,
|
|
31
|
+
n = b ? Symbol["for"]("react.forward_ref") : 60112,
|
|
32
|
+
p = b ? Symbol["for"]("react.suspense") : 60113,
|
|
33
|
+
q = b ? Symbol["for"]("react.suspense_list") : 60120,
|
|
34
|
+
r = b ? Symbol["for"]("react.memo") : 60115,
|
|
35
|
+
t = b ? Symbol["for"]("react.lazy") : 60116,
|
|
36
|
+
v = b ? Symbol["for"]("react.block") : 60121,
|
|
37
|
+
w = b ? Symbol["for"]("react.fundamental") : 60117,
|
|
38
|
+
x = b ? Symbol["for"]("react.responder") : 60118,
|
|
39
|
+
y = b ? Symbol["for"]("react.scope") : 60119;
|
|
40
|
+
function z(a) {
|
|
41
|
+
if ("object" === _typeof(a) && null !== a) {
|
|
42
|
+
var u = a.$$typeof;
|
|
43
|
+
switch (u) {
|
|
44
|
+
case c:
|
|
45
|
+
switch (a = a.type, a) {
|
|
46
|
+
case l:
|
|
47
|
+
case m:
|
|
48
|
+
case e:
|
|
49
|
+
case g:
|
|
50
|
+
case f:
|
|
51
|
+
case p:
|
|
52
|
+
return a;
|
|
53
|
+
default:
|
|
54
|
+
switch (a = a && a.$$typeof, a) {
|
|
55
|
+
case k:
|
|
56
|
+
case n:
|
|
57
|
+
case t:
|
|
58
|
+
case r:
|
|
59
|
+
case h:
|
|
60
|
+
return a;
|
|
61
|
+
default:
|
|
62
|
+
return u;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
case d:
|
|
66
|
+
return u;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function A(a) {
|
|
71
|
+
return z(a) === m;
|
|
72
|
+
}
|
|
73
|
+
reactIs_production_min.AsyncMode = l;
|
|
74
|
+
reactIs_production_min.ConcurrentMode = m;
|
|
75
|
+
reactIs_production_min.ContextConsumer = k;
|
|
76
|
+
reactIs_production_min.ContextProvider = h;
|
|
77
|
+
reactIs_production_min.Element = c;
|
|
78
|
+
reactIs_production_min.ForwardRef = n;
|
|
79
|
+
reactIs_production_min.Fragment = e;
|
|
80
|
+
reactIs_production_min.Lazy = t;
|
|
81
|
+
reactIs_production_min.Memo = r;
|
|
82
|
+
reactIs_production_min.Portal = d;
|
|
83
|
+
reactIs_production_min.Profiler = g;
|
|
84
|
+
reactIs_production_min.StrictMode = f;
|
|
85
|
+
reactIs_production_min.Suspense = p;
|
|
86
|
+
reactIs_production_min.isAsyncMode = function (a) {
|
|
87
|
+
return A(a) || z(a) === l;
|
|
88
|
+
};
|
|
89
|
+
reactIs_production_min.isConcurrentMode = A;
|
|
90
|
+
reactIs_production_min.isContextConsumer = function (a) {
|
|
91
|
+
return z(a) === k;
|
|
92
|
+
};
|
|
93
|
+
reactIs_production_min.isContextProvider = function (a) {
|
|
94
|
+
return z(a) === h;
|
|
95
|
+
};
|
|
96
|
+
reactIs_production_min.isElement = function (a) {
|
|
97
|
+
return "object" === _typeof(a) && null !== a && a.$$typeof === c;
|
|
98
|
+
};
|
|
99
|
+
reactIs_production_min.isForwardRef = function (a) {
|
|
100
|
+
return z(a) === n;
|
|
101
|
+
};
|
|
102
|
+
reactIs_production_min.isFragment = function (a) {
|
|
103
|
+
return z(a) === e;
|
|
104
|
+
};
|
|
105
|
+
reactIs_production_min.isLazy = function (a) {
|
|
106
|
+
return z(a) === t;
|
|
107
|
+
};
|
|
108
|
+
reactIs_production_min.isMemo = function (a) {
|
|
109
|
+
return z(a) === r;
|
|
110
|
+
};
|
|
111
|
+
reactIs_production_min.isPortal = function (a) {
|
|
112
|
+
return z(a) === d;
|
|
113
|
+
};
|
|
114
|
+
reactIs_production_min.isProfiler = function (a) {
|
|
115
|
+
return z(a) === g;
|
|
116
|
+
};
|
|
117
|
+
reactIs_production_min.isStrictMode = function (a) {
|
|
118
|
+
return z(a) === f;
|
|
119
|
+
};
|
|
120
|
+
reactIs_production_min.isSuspense = function (a) {
|
|
121
|
+
return z(a) === p;
|
|
122
|
+
};
|
|
123
|
+
reactIs_production_min.isValidElementType = function (a) {
|
|
124
|
+
return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === _typeof(a) && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
|
|
125
|
+
};
|
|
126
|
+
reactIs_production_min.typeOf = z;
|
|
127
|
+
export { reactIs_production_min as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** @LICENSE
|
|
2
|
+
* @hi-ui/layout
|
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/layout#readme
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/
|
|
10
|
+
import { r as reactIs } from '../../_virtual/index3.js';
|
|
11
|
+
import './cjs/react-is.production.min.js';
|
|
12
|
+
import './cjs/react-is.development.js';
|
|
13
|
+
import { __exports as reactIs_production_min } from '../../_virtual/react-is.production.min.js';
|
|
14
|
+
import { __exports as reactIs_development } from '../../_virtual/react-is.development.js';
|
|
15
|
+
if (process.env.NODE_ENV === 'production') {
|
|
16
|
+
reactIs.exports = reactIs_production_min;
|
|
17
|
+
} else {
|
|
18
|
+
reactIs.exports = reactIs_development;
|
|
19
|
+
}
|
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
2
|
+
/** @LICENSE
|
|
3
|
+
* @hi-ui/layout
|
|
4
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/layout#readme
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/
|
|
11
|
+
import { __exports as Resizable$1 } from '../../../_virtual/Resizable.js';
|
|
12
|
+
import React$1 from 'react';
|
|
13
|
+
import '../../react-draggable/build/cjs/cjs.js';
|
|
14
|
+
import './utils.js';
|
|
15
|
+
import './propTypes.js';
|
|
16
|
+
import { __exports as propTypes } from '../../../_virtual/propTypes.js';
|
|
17
|
+
import { c as cjs } from '../../../_virtual/cjs.js';
|
|
18
|
+
import { __exports as utils } from '../../../_virtual/utils.js';
|
|
19
|
+
Resizable$1.__esModule = true;
|
|
20
|
+
Resizable$1["default"] = void 0;
|
|
21
|
+
var React = _interopRequireWildcard(React$1);
|
|
22
|
+
var _reactDraggable = cjs.exports;
|
|
23
|
+
var _utils = utils;
|
|
24
|
+
var _propTypes = propTypes;
|
|
25
|
+
var _excluded = ["children", "className", "draggableOpts", "width", "height", "handle", "handleSize", "lockAspectRatio", "axis", "minConstraints", "maxConstraints", "onResize", "onResizeStop", "onResizeStart", "resizeHandles", "transformScale"];
|
|
26
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
27
|
+
if (typeof WeakMap !== "function") return null;
|
|
28
|
+
var cacheBabelInterop = new WeakMap();
|
|
29
|
+
var cacheNodeInterop = new WeakMap();
|
|
30
|
+
return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {
|
|
31
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
32
|
+
})(nodeInterop);
|
|
33
|
+
}
|
|
34
|
+
function _interopRequireWildcard(obj, nodeInterop) {
|
|
35
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
36
|
+
return obj;
|
|
37
|
+
}
|
|
38
|
+
if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
|
|
39
|
+
return {
|
|
40
|
+
"default": obj
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
44
|
+
if (cache && cache.has(obj)) {
|
|
45
|
+
return cache.get(obj);
|
|
46
|
+
}
|
|
47
|
+
var newObj = {};
|
|
48
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
49
|
+
for (var key in obj) {
|
|
50
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
51
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
52
|
+
if (desc && (desc.get || desc.set)) {
|
|
53
|
+
Object.defineProperty(newObj, key, desc);
|
|
54
|
+
} else {
|
|
55
|
+
newObj[key] = obj[key];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
newObj["default"] = obj;
|
|
60
|
+
if (cache) {
|
|
61
|
+
cache.set(obj, newObj);
|
|
62
|
+
}
|
|
63
|
+
return newObj;
|
|
64
|
+
}
|
|
65
|
+
function _extends() {
|
|
66
|
+
_extends = Object.assign || function (target) {
|
|
67
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
68
|
+
var source = arguments[i];
|
|
69
|
+
for (var key in source) {
|
|
70
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
71
|
+
target[key] = source[key];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return target;
|
|
76
|
+
};
|
|
77
|
+
return _extends.apply(this, arguments);
|
|
78
|
+
}
|
|
79
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
80
|
+
if (source == null) return {};
|
|
81
|
+
var target = {};
|
|
82
|
+
var sourceKeys = Object.keys(source);
|
|
83
|
+
var key, i;
|
|
84
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
85
|
+
key = sourceKeys[i];
|
|
86
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
87
|
+
target[key] = source[key];
|
|
88
|
+
}
|
|
89
|
+
return target;
|
|
90
|
+
}
|
|
91
|
+
function ownKeys(object, enumerableOnly) {
|
|
92
|
+
var keys = Object.keys(object);
|
|
93
|
+
if (Object.getOwnPropertySymbols) {
|
|
94
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
95
|
+
if (enumerableOnly) {
|
|
96
|
+
symbols = symbols.filter(function (sym) {
|
|
97
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
keys.push.apply(keys, symbols);
|
|
101
|
+
}
|
|
102
|
+
return keys;
|
|
103
|
+
}
|
|
104
|
+
function _objectSpread(target) {
|
|
105
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
106
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
107
|
+
if (i % 2) {
|
|
108
|
+
ownKeys(Object(source), true).forEach(function (key) {
|
|
109
|
+
_defineProperty(target, key, source[key]);
|
|
110
|
+
});
|
|
111
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
112
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
113
|
+
} else {
|
|
114
|
+
ownKeys(Object(source)).forEach(function (key) {
|
|
115
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return target;
|
|
120
|
+
}
|
|
121
|
+
function _defineProperty(obj, key, value) {
|
|
122
|
+
if (key in obj) {
|
|
123
|
+
Object.defineProperty(obj, key, {
|
|
124
|
+
value: value,
|
|
125
|
+
enumerable: true,
|
|
126
|
+
configurable: true,
|
|
127
|
+
writable: true
|
|
128
|
+
});
|
|
129
|
+
} else {
|
|
130
|
+
obj[key] = value;
|
|
131
|
+
}
|
|
132
|
+
return obj;
|
|
133
|
+
}
|
|
134
|
+
function _inheritsLoose(subClass, superClass) {
|
|
135
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
136
|
+
subClass.prototype.constructor = subClass;
|
|
137
|
+
_setPrototypeOf(subClass, superClass);
|
|
138
|
+
}
|
|
139
|
+
function _setPrototypeOf(o, p) {
|
|
140
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
141
|
+
o.__proto__ = p;
|
|
142
|
+
return o;
|
|
143
|
+
};
|
|
144
|
+
return _setPrototypeOf(o, p);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// The base <Resizable> component.
|
|
148
|
+
// This component does not have state and relies on the parent to set its props based on callback data.
|
|
149
|
+
var Resizable = /*#__PURE__*/function (_React$Component) {
|
|
150
|
+
_inheritsLoose(Resizable, _React$Component);
|
|
151
|
+
function Resizable() {
|
|
152
|
+
var _this;
|
|
153
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
154
|
+
args[_key] = arguments[_key];
|
|
155
|
+
}
|
|
156
|
+
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
157
|
+
_this.handleRefs = {};
|
|
158
|
+
_this.lastHandleRect = null;
|
|
159
|
+
_this.slack = null;
|
|
160
|
+
return _this;
|
|
161
|
+
}
|
|
162
|
+
var _proto = Resizable.prototype;
|
|
163
|
+
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
164
|
+
this.resetData();
|
|
165
|
+
};
|
|
166
|
+
_proto.resetData = function resetData() {
|
|
167
|
+
this.lastHandleRect = this.slack = null;
|
|
168
|
+
} // Clamp width and height within provided constraints
|
|
169
|
+
;
|
|
170
|
+
|
|
171
|
+
_proto.runConstraints = function runConstraints(width, height) {
|
|
172
|
+
var _this$props = this.props,
|
|
173
|
+
minConstraints = _this$props.minConstraints,
|
|
174
|
+
maxConstraints = _this$props.maxConstraints,
|
|
175
|
+
lockAspectRatio = _this$props.lockAspectRatio; // short circuit
|
|
176
|
+
|
|
177
|
+
if (!minConstraints && !maxConstraints && !lockAspectRatio) return [width, height]; // If constraining to min and max, we need to also fit width and height to aspect ratio.
|
|
178
|
+
|
|
179
|
+
if (lockAspectRatio) {
|
|
180
|
+
var ratio = this.props.width / this.props.height;
|
|
181
|
+
var deltaW = width - this.props.width;
|
|
182
|
+
var deltaH = height - this.props.height; // Find which coordinate was greater and should push the other toward it.
|
|
183
|
+
// E.g.:
|
|
184
|
+
// ratio = 1, deltaW = 10, deltaH = 5, deltaH should become 10.
|
|
185
|
+
// ratio = 2, deltaW = 10, deltaH = 6, deltaW should become 12.
|
|
186
|
+
|
|
187
|
+
if (Math.abs(deltaW) > Math.abs(deltaH * ratio)) {
|
|
188
|
+
height = width / ratio;
|
|
189
|
+
} else {
|
|
190
|
+
width = height * ratio;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
var oldW = width,
|
|
194
|
+
oldH = height; // Add slack to the values used to calculate bound position. This will ensure that if
|
|
195
|
+
// we start removing slack, the element won't react to it right away until it's been
|
|
196
|
+
// completely removed.
|
|
197
|
+
|
|
198
|
+
var _ref = this.slack || [0, 0],
|
|
199
|
+
slackW = _ref[0],
|
|
200
|
+
slackH = _ref[1];
|
|
201
|
+
width += slackW;
|
|
202
|
+
height += slackH;
|
|
203
|
+
if (minConstraints) {
|
|
204
|
+
width = Math.max(minConstraints[0], width);
|
|
205
|
+
height = Math.max(minConstraints[1], height);
|
|
206
|
+
}
|
|
207
|
+
if (maxConstraints) {
|
|
208
|
+
width = Math.min(maxConstraints[0], width);
|
|
209
|
+
height = Math.min(maxConstraints[1], height);
|
|
210
|
+
} // If the width or height changed, we must have introduced some slack. Record it for the next iteration.
|
|
211
|
+
|
|
212
|
+
this.slack = [slackW + (oldW - width), slackH + (oldH - height)];
|
|
213
|
+
return [width, height];
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Wrapper around drag events to provide more useful data.
|
|
217
|
+
*
|
|
218
|
+
* @param {String} handlerName Handler name to wrap.
|
|
219
|
+
* @return {Function} Handler function.
|
|
220
|
+
*/;
|
|
221
|
+
|
|
222
|
+
_proto.resizeHandler = function resizeHandler(handlerName, axis) {
|
|
223
|
+
var _this2 = this;
|
|
224
|
+
return function (e, _ref2) {
|
|
225
|
+
var node = _ref2.node,
|
|
226
|
+
deltaX = _ref2.deltaX,
|
|
227
|
+
deltaY = _ref2.deltaY;
|
|
228
|
+
// Reset data in case it was left over somehow (should not be possible)
|
|
229
|
+
if (handlerName === 'onResizeStart') _this2.resetData(); // Axis restrictions
|
|
230
|
+
|
|
231
|
+
var canDragX = (_this2.props.axis === 'both' || _this2.props.axis === 'x') && axis !== 'n' && axis !== 's';
|
|
232
|
+
var canDragY = (_this2.props.axis === 'both' || _this2.props.axis === 'y') && axis !== 'e' && axis !== 'w'; // No dragging possible.
|
|
233
|
+
|
|
234
|
+
if (!canDragX && !canDragY) return; // Decompose axis for later use
|
|
235
|
+
|
|
236
|
+
var axisV = axis[0];
|
|
237
|
+
var axisH = axis[axis.length - 1]; // intentionally not axis[1], so that this catches axis === 'w' for example
|
|
238
|
+
// Track the element being dragged to account for changes in position.
|
|
239
|
+
// If a handle's position is changed between callbacks, we need to factor this in to the next callback.
|
|
240
|
+
// Failure to do so will cause the element to "skip" when resized upwards or leftwards.
|
|
241
|
+
|
|
242
|
+
var handleRect = node.getBoundingClientRect();
|
|
243
|
+
if (_this2.lastHandleRect != null) {
|
|
244
|
+
// If the handle has repositioned on either axis since last render,
|
|
245
|
+
// we need to increase our callback values by this much.
|
|
246
|
+
// Only checking 'n', 'w' since resizing by 's', 'w' won't affect the overall position on page,
|
|
247
|
+
if (axisH === 'w') {
|
|
248
|
+
var deltaLeftSinceLast = handleRect.left - _this2.lastHandleRect.left;
|
|
249
|
+
deltaX += deltaLeftSinceLast;
|
|
250
|
+
}
|
|
251
|
+
if (axisV === 'n') {
|
|
252
|
+
var deltaTopSinceLast = handleRect.top - _this2.lastHandleRect.top;
|
|
253
|
+
deltaY += deltaTopSinceLast;
|
|
254
|
+
}
|
|
255
|
+
} // Storage of last rect so we know how much it has really moved.
|
|
256
|
+
|
|
257
|
+
_this2.lastHandleRect = handleRect; // Reverse delta if using top or left drag handles.
|
|
258
|
+
|
|
259
|
+
if (axisH === 'w') deltaX = -deltaX;
|
|
260
|
+
if (axisV === 'n') deltaY = -deltaY; // Update w/h by the deltas. Also factor in transformScale.
|
|
261
|
+
|
|
262
|
+
var width = _this2.props.width + (canDragX ? deltaX / _this2.props.transformScale : 0);
|
|
263
|
+
var height = _this2.props.height + (canDragY ? deltaY / _this2.props.transformScale : 0); // Run user-provided constraints.
|
|
264
|
+
|
|
265
|
+
var _this2$runConstraints = _this2.runConstraints(width, height);
|
|
266
|
+
width = _this2$runConstraints[0];
|
|
267
|
+
height = _this2$runConstraints[1];
|
|
268
|
+
var dimensionsChanged = width !== _this2.props.width || height !== _this2.props.height; // Call user-supplied callback if present.
|
|
269
|
+
|
|
270
|
+
var cb = typeof _this2.props[handlerName] === 'function' ? _this2.props[handlerName] : null; // Don't call 'onResize' if dimensions haven't changed.
|
|
271
|
+
|
|
272
|
+
var shouldSkipCb = handlerName === 'onResize' && !dimensionsChanged;
|
|
273
|
+
if (cb && !shouldSkipCb) {
|
|
274
|
+
e.persist == null ? void 0 : e.persist();
|
|
275
|
+
cb(e, {
|
|
276
|
+
node: node,
|
|
277
|
+
size: {
|
|
278
|
+
width: width,
|
|
279
|
+
height: height
|
|
280
|
+
},
|
|
281
|
+
handle: axis
|
|
282
|
+
});
|
|
283
|
+
} // Reset internal data
|
|
284
|
+
|
|
285
|
+
if (handlerName === 'onResizeStop') _this2.resetData();
|
|
286
|
+
};
|
|
287
|
+
} // Render a resize handle given an axis & DOM ref. Ref *must* be attached for
|
|
288
|
+
// the underlying draggable library to work properly.
|
|
289
|
+
;
|
|
290
|
+
|
|
291
|
+
_proto.renderResizeHandle = function renderResizeHandle(handleAxis, ref) {
|
|
292
|
+
var handle = this.props.handle; // No handle provided, make the default
|
|
293
|
+
|
|
294
|
+
if (!handle) {
|
|
295
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
296
|
+
className: "react-resizable-handle react-resizable-handle-" + handleAxis,
|
|
297
|
+
ref: ref
|
|
298
|
+
});
|
|
299
|
+
} // Handle is a function, such as:
|
|
300
|
+
// `handle={(handleAxis) => <span className={...} />}`
|
|
301
|
+
|
|
302
|
+
if (typeof handle === 'function') {
|
|
303
|
+
return handle(handleAxis, ref);
|
|
304
|
+
} // Handle is a React component (composite or DOM).
|
|
305
|
+
|
|
306
|
+
var isDOMElement = typeof handle.type === 'string';
|
|
307
|
+
var props = _objectSpread({
|
|
308
|
+
ref: ref
|
|
309
|
+
}, isDOMElement ? {} : {
|
|
310
|
+
handleAxis: handleAxis
|
|
311
|
+
});
|
|
312
|
+
return /*#__PURE__*/React.cloneElement(handle, props);
|
|
313
|
+
};
|
|
314
|
+
_proto.render = function render() {
|
|
315
|
+
var _this3 = this;
|
|
316
|
+
|
|
317
|
+
// Pass along only props not meant for the `<Resizable>`.`
|
|
318
|
+
// eslint-disable-next-line no-unused-vars
|
|
319
|
+
var _this$props2 = this.props,
|
|
320
|
+
children = _this$props2.children,
|
|
321
|
+
className = _this$props2.className,
|
|
322
|
+
draggableOpts = _this$props2.draggableOpts,
|
|
323
|
+
resizeHandles = _this$props2.resizeHandles,
|
|
324
|
+
p = _objectWithoutPropertiesLoose(_this$props2, _excluded); // What we're doing here is getting the child of this element, and cloning it with this element's props.
|
|
325
|
+
// We are then defining its children as:
|
|
326
|
+
// 1. Its original children (resizable's child's children), and
|
|
327
|
+
// 2. One or more draggable handles.
|
|
328
|
+
|
|
329
|
+
return (0, _utils.cloneElement)(children, _objectSpread(_objectSpread({}, p), {}, {
|
|
330
|
+
className: (className ? className + " " : '') + "react-resizable",
|
|
331
|
+
children: [].concat(children.props.children, resizeHandles.map(function (handleAxis) {
|
|
332
|
+
var _this3$handleRefs$han;
|
|
333
|
+
|
|
334
|
+
// Create a ref to the handle so that `<DraggableCore>` doesn't have to use ReactDOM.findDOMNode().
|
|
335
|
+
var ref = (_this3$handleRefs$han = _this3.handleRefs[handleAxis]) != null ? _this3$handleRefs$han : _this3.handleRefs[handleAxis] = /*#__PURE__*/React.createRef();
|
|
336
|
+
return /*#__PURE__*/React.createElement(_reactDraggable.DraggableCore, _extends({}, draggableOpts, {
|
|
337
|
+
nodeRef: ref,
|
|
338
|
+
key: "resizableHandle-" + handleAxis,
|
|
339
|
+
onStop: _this3.resizeHandler('onResizeStop', handleAxis),
|
|
340
|
+
onStart: _this3.resizeHandler('onResizeStart', handleAxis),
|
|
341
|
+
onDrag: _this3.resizeHandler('onResize', handleAxis)
|
|
342
|
+
}), _this3.renderResizeHandle(handleAxis, ref));
|
|
343
|
+
}))
|
|
344
|
+
}));
|
|
345
|
+
};
|
|
346
|
+
return Resizable;
|
|
347
|
+
}(React.Component);
|
|
348
|
+
Resizable$1["default"] = Resizable;
|
|
349
|
+
Resizable.propTypes = _propTypes.resizableProps;
|
|
350
|
+
Resizable.defaultProps = {
|
|
351
|
+
axis: 'both',
|
|
352
|
+
handleSize: [20, 20],
|
|
353
|
+
lockAspectRatio: false,
|
|
354
|
+
minConstraints: [20, 20],
|
|
355
|
+
maxConstraints: [Infinity, Infinity],
|
|
356
|
+
resizeHandles: ['se'],
|
|
357
|
+
transformScale: 1
|
|
358
|
+
};
|