react-table-edit 0.8.2 → 0.8.4
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/dist/index.d.mts +14 -8
- package/dist/index.d.ts +14 -8
- package/dist/index.js +3124 -68
- package/dist/index.mjs +3148 -57
- package/package.json +5 -2
package/dist/index.js
CHANGED
|
@@ -5,6 +5,12 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __esm = (fn, res) => function __init() {
|
|
9
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
10
|
+
};
|
|
11
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
12
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
13
|
+
};
|
|
8
14
|
var __export = (target, all) => {
|
|
9
15
|
for (var name in all)
|
|
10
16
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -15,17 +21,3010 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
21
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
22
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
23
|
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
27
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
28
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
29
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
30
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
31
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
32
|
+
mod
|
|
33
|
+
));
|
|
34
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
|
+
|
|
36
|
+
// node_modules/react-is/cjs/react-is.production.min.js
|
|
37
|
+
var require_react_is_production_min = __commonJS({
|
|
38
|
+
"node_modules/react-is/cjs/react-is.production.min.js"(exports2) {
|
|
39
|
+
"use strict";
|
|
40
|
+
var b = "function" === typeof Symbol && Symbol.for;
|
|
41
|
+
var c = b ? Symbol.for("react.element") : 60103;
|
|
42
|
+
var d = b ? Symbol.for("react.portal") : 60106;
|
|
43
|
+
var e = b ? Symbol.for("react.fragment") : 60107;
|
|
44
|
+
var f = b ? Symbol.for("react.strict_mode") : 60108;
|
|
45
|
+
var g = b ? Symbol.for("react.profiler") : 60114;
|
|
46
|
+
var h = b ? Symbol.for("react.provider") : 60109;
|
|
47
|
+
var k = b ? Symbol.for("react.context") : 60110;
|
|
48
|
+
var l = b ? Symbol.for("react.async_mode") : 60111;
|
|
49
|
+
var m = b ? Symbol.for("react.concurrent_mode") : 60111;
|
|
50
|
+
var n = b ? Symbol.for("react.forward_ref") : 60112;
|
|
51
|
+
var p = b ? Symbol.for("react.suspense") : 60113;
|
|
52
|
+
var q = b ? Symbol.for("react.suspense_list") : 60120;
|
|
53
|
+
var r2 = b ? Symbol.for("react.memo") : 60115;
|
|
54
|
+
var t = b ? Symbol.for("react.lazy") : 60116;
|
|
55
|
+
var v = b ? Symbol.for("react.block") : 60121;
|
|
56
|
+
var w = b ? Symbol.for("react.fundamental") : 60117;
|
|
57
|
+
var x = b ? Symbol.for("react.responder") : 60118;
|
|
58
|
+
var y = b ? Symbol.for("react.scope") : 60119;
|
|
59
|
+
function z(a) {
|
|
60
|
+
if ("object" === typeof a && null !== a) {
|
|
61
|
+
var u = a.$$typeof;
|
|
62
|
+
switch (u) {
|
|
63
|
+
case c:
|
|
64
|
+
switch (a = a.type, a) {
|
|
65
|
+
case l:
|
|
66
|
+
case m:
|
|
67
|
+
case e:
|
|
68
|
+
case g:
|
|
69
|
+
case f:
|
|
70
|
+
case p:
|
|
71
|
+
return a;
|
|
72
|
+
default:
|
|
73
|
+
switch (a = a && a.$$typeof, a) {
|
|
74
|
+
case k:
|
|
75
|
+
case n:
|
|
76
|
+
case t:
|
|
77
|
+
case r2:
|
|
78
|
+
case h:
|
|
79
|
+
return a;
|
|
80
|
+
default:
|
|
81
|
+
return u;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
case d:
|
|
85
|
+
return u;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function A(a) {
|
|
90
|
+
return z(a) === m;
|
|
91
|
+
}
|
|
92
|
+
exports2.AsyncMode = l;
|
|
93
|
+
exports2.ConcurrentMode = m;
|
|
94
|
+
exports2.ContextConsumer = k;
|
|
95
|
+
exports2.ContextProvider = h;
|
|
96
|
+
exports2.Element = c;
|
|
97
|
+
exports2.ForwardRef = n;
|
|
98
|
+
exports2.Fragment = e;
|
|
99
|
+
exports2.Lazy = t;
|
|
100
|
+
exports2.Memo = r2;
|
|
101
|
+
exports2.Portal = d;
|
|
102
|
+
exports2.Profiler = g;
|
|
103
|
+
exports2.StrictMode = f;
|
|
104
|
+
exports2.Suspense = p;
|
|
105
|
+
exports2.isAsyncMode = function(a) {
|
|
106
|
+
return A(a) || z(a) === l;
|
|
107
|
+
};
|
|
108
|
+
exports2.isConcurrentMode = A;
|
|
109
|
+
exports2.isContextConsumer = function(a) {
|
|
110
|
+
return z(a) === k;
|
|
111
|
+
};
|
|
112
|
+
exports2.isContextProvider = function(a) {
|
|
113
|
+
return z(a) === h;
|
|
114
|
+
};
|
|
115
|
+
exports2.isElement = function(a) {
|
|
116
|
+
return "object" === typeof a && null !== a && a.$$typeof === c;
|
|
117
|
+
};
|
|
118
|
+
exports2.isForwardRef = function(a) {
|
|
119
|
+
return z(a) === n;
|
|
120
|
+
};
|
|
121
|
+
exports2.isFragment = function(a) {
|
|
122
|
+
return z(a) === e;
|
|
123
|
+
};
|
|
124
|
+
exports2.isLazy = function(a) {
|
|
125
|
+
return z(a) === t;
|
|
126
|
+
};
|
|
127
|
+
exports2.isMemo = function(a) {
|
|
128
|
+
return z(a) === r2;
|
|
129
|
+
};
|
|
130
|
+
exports2.isPortal = function(a) {
|
|
131
|
+
return z(a) === d;
|
|
132
|
+
};
|
|
133
|
+
exports2.isProfiler = function(a) {
|
|
134
|
+
return z(a) === g;
|
|
135
|
+
};
|
|
136
|
+
exports2.isStrictMode = function(a) {
|
|
137
|
+
return z(a) === f;
|
|
138
|
+
};
|
|
139
|
+
exports2.isSuspense = function(a) {
|
|
140
|
+
return z(a) === p;
|
|
141
|
+
};
|
|
142
|
+
exports2.isValidElementType = function(a) {
|
|
143
|
+
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 === r2 || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
|
|
144
|
+
};
|
|
145
|
+
exports2.typeOf = z;
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
// node_modules/react-is/cjs/react-is.development.js
|
|
150
|
+
var require_react_is_development = __commonJS({
|
|
151
|
+
"node_modules/react-is/cjs/react-is.development.js"(exports2) {
|
|
152
|
+
"use strict";
|
|
153
|
+
if (process.env.NODE_ENV !== "production") {
|
|
154
|
+
(function() {
|
|
155
|
+
"use strict";
|
|
156
|
+
var hasSymbol = typeof Symbol === "function" && Symbol.for;
|
|
157
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103;
|
|
158
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106;
|
|
159
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107;
|
|
160
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108;
|
|
161
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114;
|
|
162
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109;
|
|
163
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110;
|
|
164
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111;
|
|
165
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111;
|
|
166
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112;
|
|
167
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113;
|
|
168
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120;
|
|
169
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115;
|
|
170
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116;
|
|
171
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121;
|
|
172
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117;
|
|
173
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118;
|
|
174
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119;
|
|
175
|
+
function isValidElementType(type) {
|
|
176
|
+
return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
177
|
+
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);
|
|
178
|
+
}
|
|
179
|
+
function typeOf(object) {
|
|
180
|
+
if (typeof object === "object" && object !== null) {
|
|
181
|
+
var $$typeof = object.$$typeof;
|
|
182
|
+
switch ($$typeof) {
|
|
183
|
+
case REACT_ELEMENT_TYPE:
|
|
184
|
+
var type = object.type;
|
|
185
|
+
switch (type) {
|
|
186
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
187
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
188
|
+
case REACT_FRAGMENT_TYPE:
|
|
189
|
+
case REACT_PROFILER_TYPE:
|
|
190
|
+
case REACT_STRICT_MODE_TYPE:
|
|
191
|
+
case REACT_SUSPENSE_TYPE:
|
|
192
|
+
return type;
|
|
193
|
+
default:
|
|
194
|
+
var $$typeofType = type && type.$$typeof;
|
|
195
|
+
switch ($$typeofType) {
|
|
196
|
+
case REACT_CONTEXT_TYPE:
|
|
197
|
+
case REACT_FORWARD_REF_TYPE:
|
|
198
|
+
case REACT_LAZY_TYPE:
|
|
199
|
+
case REACT_MEMO_TYPE:
|
|
200
|
+
case REACT_PROVIDER_TYPE:
|
|
201
|
+
return $$typeofType;
|
|
202
|
+
default:
|
|
203
|
+
return $$typeof;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
case REACT_PORTAL_TYPE:
|
|
207
|
+
return $$typeof;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return void 0;
|
|
211
|
+
}
|
|
212
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
213
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
214
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
215
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
216
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
217
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
218
|
+
var Fragment21 = REACT_FRAGMENT_TYPE;
|
|
219
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
220
|
+
var Memo = REACT_MEMO_TYPE;
|
|
221
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
222
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
223
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
224
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
225
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
226
|
+
function isAsyncMode(object) {
|
|
227
|
+
{
|
|
228
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
229
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
230
|
+
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.");
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
234
|
+
}
|
|
235
|
+
function isConcurrentMode(object) {
|
|
236
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
237
|
+
}
|
|
238
|
+
function isContextConsumer(object) {
|
|
239
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
240
|
+
}
|
|
241
|
+
function isContextProvider(object) {
|
|
242
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
243
|
+
}
|
|
244
|
+
function isElement(object) {
|
|
245
|
+
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
246
|
+
}
|
|
247
|
+
function isForwardRef(object) {
|
|
248
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
249
|
+
}
|
|
250
|
+
function isFragment(object) {
|
|
251
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
252
|
+
}
|
|
253
|
+
function isLazy(object) {
|
|
254
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
255
|
+
}
|
|
256
|
+
function isMemo(object) {
|
|
257
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
258
|
+
}
|
|
259
|
+
function isPortal(object) {
|
|
260
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
261
|
+
}
|
|
262
|
+
function isProfiler(object) {
|
|
263
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
264
|
+
}
|
|
265
|
+
function isStrictMode(object) {
|
|
266
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
267
|
+
}
|
|
268
|
+
function isSuspense(object) {
|
|
269
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
270
|
+
}
|
|
271
|
+
exports2.AsyncMode = AsyncMode;
|
|
272
|
+
exports2.ConcurrentMode = ConcurrentMode;
|
|
273
|
+
exports2.ContextConsumer = ContextConsumer;
|
|
274
|
+
exports2.ContextProvider = ContextProvider;
|
|
275
|
+
exports2.Element = Element;
|
|
276
|
+
exports2.ForwardRef = ForwardRef;
|
|
277
|
+
exports2.Fragment = Fragment21;
|
|
278
|
+
exports2.Lazy = Lazy;
|
|
279
|
+
exports2.Memo = Memo;
|
|
280
|
+
exports2.Portal = Portal;
|
|
281
|
+
exports2.Profiler = Profiler;
|
|
282
|
+
exports2.StrictMode = StrictMode;
|
|
283
|
+
exports2.Suspense = Suspense;
|
|
284
|
+
exports2.isAsyncMode = isAsyncMode;
|
|
285
|
+
exports2.isConcurrentMode = isConcurrentMode;
|
|
286
|
+
exports2.isContextConsumer = isContextConsumer;
|
|
287
|
+
exports2.isContextProvider = isContextProvider;
|
|
288
|
+
exports2.isElement = isElement;
|
|
289
|
+
exports2.isForwardRef = isForwardRef;
|
|
290
|
+
exports2.isFragment = isFragment;
|
|
291
|
+
exports2.isLazy = isLazy;
|
|
292
|
+
exports2.isMemo = isMemo;
|
|
293
|
+
exports2.isPortal = isPortal;
|
|
294
|
+
exports2.isProfiler = isProfiler;
|
|
295
|
+
exports2.isStrictMode = isStrictMode;
|
|
296
|
+
exports2.isSuspense = isSuspense;
|
|
297
|
+
exports2.isValidElementType = isValidElementType;
|
|
298
|
+
exports2.typeOf = typeOf;
|
|
299
|
+
})();
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
// node_modules/react-is/index.js
|
|
305
|
+
var require_react_is = __commonJS({
|
|
306
|
+
"node_modules/react-is/index.js"(exports2, module2) {
|
|
307
|
+
"use strict";
|
|
308
|
+
if (process.env.NODE_ENV === "production") {
|
|
309
|
+
module2.exports = require_react_is_production_min();
|
|
310
|
+
} else {
|
|
311
|
+
module2.exports = require_react_is_development();
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
// node_modules/object-assign/index.js
|
|
317
|
+
var require_object_assign = __commonJS({
|
|
318
|
+
"node_modules/object-assign/index.js"(exports2, module2) {
|
|
319
|
+
"use strict";
|
|
320
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
321
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
322
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
323
|
+
function toObject(val) {
|
|
324
|
+
if (val === null || val === void 0) {
|
|
325
|
+
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
326
|
+
}
|
|
327
|
+
return Object(val);
|
|
328
|
+
}
|
|
329
|
+
function shouldUseNative() {
|
|
330
|
+
try {
|
|
331
|
+
if (!Object.assign) {
|
|
332
|
+
return false;
|
|
333
|
+
}
|
|
334
|
+
var test1 = new String("abc");
|
|
335
|
+
test1[5] = "de";
|
|
336
|
+
if (Object.getOwnPropertyNames(test1)[0] === "5") {
|
|
337
|
+
return false;
|
|
338
|
+
}
|
|
339
|
+
var test2 = {};
|
|
340
|
+
for (var i = 0; i < 10; i++) {
|
|
341
|
+
test2["_" + String.fromCharCode(i)] = i;
|
|
342
|
+
}
|
|
343
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
|
|
344
|
+
return test2[n];
|
|
345
|
+
});
|
|
346
|
+
if (order2.join("") !== "0123456789") {
|
|
347
|
+
return false;
|
|
348
|
+
}
|
|
349
|
+
var test3 = {};
|
|
350
|
+
"abcdefghijklmnopqrst".split("").forEach(function(letter) {
|
|
351
|
+
test3[letter] = letter;
|
|
352
|
+
});
|
|
353
|
+
if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
|
|
354
|
+
return false;
|
|
355
|
+
}
|
|
356
|
+
return true;
|
|
357
|
+
} catch (err) {
|
|
358
|
+
return false;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
module2.exports = shouldUseNative() ? Object.assign : function(target, source) {
|
|
362
|
+
var from;
|
|
363
|
+
var to = toObject(target);
|
|
364
|
+
var symbols;
|
|
365
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
366
|
+
from = Object(arguments[s]);
|
|
367
|
+
for (var key in from) {
|
|
368
|
+
if (hasOwnProperty.call(from, key)) {
|
|
369
|
+
to[key] = from[key];
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
if (getOwnPropertySymbols) {
|
|
373
|
+
symbols = getOwnPropertySymbols(from);
|
|
374
|
+
for (var i = 0; i < symbols.length; i++) {
|
|
375
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
|
376
|
+
to[symbols[i]] = from[symbols[i]];
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
return to;
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
// node_modules/prop-types/lib/ReactPropTypesSecret.js
|
|
387
|
+
var require_ReactPropTypesSecret = __commonJS({
|
|
388
|
+
"node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports2, module2) {
|
|
389
|
+
"use strict";
|
|
390
|
+
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
391
|
+
module2.exports = ReactPropTypesSecret;
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
|
|
395
|
+
// node_modules/prop-types/lib/has.js
|
|
396
|
+
var require_has = __commonJS({
|
|
397
|
+
"node_modules/prop-types/lib/has.js"(exports2, module2) {
|
|
398
|
+
"use strict";
|
|
399
|
+
module2.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
// node_modules/prop-types/checkPropTypes.js
|
|
404
|
+
var require_checkPropTypes = __commonJS({
|
|
405
|
+
"node_modules/prop-types/checkPropTypes.js"(exports2, module2) {
|
|
406
|
+
"use strict";
|
|
407
|
+
var printWarning = function() {
|
|
408
|
+
};
|
|
409
|
+
if (process.env.NODE_ENV !== "production") {
|
|
410
|
+
ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
411
|
+
loggedTypeFailures = {};
|
|
412
|
+
has = require_has();
|
|
413
|
+
printWarning = function(text) {
|
|
414
|
+
var message = "Warning: " + text;
|
|
415
|
+
if (typeof console !== "undefined") {
|
|
416
|
+
console.error(message);
|
|
417
|
+
}
|
|
418
|
+
try {
|
|
419
|
+
throw new Error(message);
|
|
420
|
+
} catch (x) {
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
var ReactPropTypesSecret;
|
|
425
|
+
var loggedTypeFailures;
|
|
426
|
+
var has;
|
|
427
|
+
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
428
|
+
if (process.env.NODE_ENV !== "production") {
|
|
429
|
+
for (var typeSpecName in typeSpecs) {
|
|
430
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
431
|
+
var error;
|
|
432
|
+
try {
|
|
433
|
+
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
434
|
+
var err = Error(
|
|
435
|
+
(componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
|
436
|
+
);
|
|
437
|
+
err.name = "Invariant Violation";
|
|
438
|
+
throw err;
|
|
439
|
+
}
|
|
440
|
+
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
441
|
+
} catch (ex) {
|
|
442
|
+
error = ex;
|
|
443
|
+
}
|
|
444
|
+
if (error && !(error instanceof Error)) {
|
|
445
|
+
printWarning(
|
|
446
|
+
(componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
|
447
|
+
);
|
|
448
|
+
}
|
|
449
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
450
|
+
loggedTypeFailures[error.message] = true;
|
|
451
|
+
var stack = getStack ? getStack() : "";
|
|
452
|
+
printWarning(
|
|
453
|
+
"Failed " + location + " type: " + error.message + (stack != null ? stack : "")
|
|
454
|
+
);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
checkPropTypes.resetWarningCache = function() {
|
|
461
|
+
if (process.env.NODE_ENV !== "production") {
|
|
462
|
+
loggedTypeFailures = {};
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
module2.exports = checkPropTypes;
|
|
466
|
+
}
|
|
467
|
+
});
|
|
468
|
+
|
|
469
|
+
// node_modules/prop-types/factoryWithTypeCheckers.js
|
|
470
|
+
var require_factoryWithTypeCheckers = __commonJS({
|
|
471
|
+
"node_modules/prop-types/factoryWithTypeCheckers.js"(exports2, module2) {
|
|
472
|
+
"use strict";
|
|
473
|
+
var ReactIs = require_react_is();
|
|
474
|
+
var assign = require_object_assign();
|
|
475
|
+
var ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
476
|
+
var has = require_has();
|
|
477
|
+
var checkPropTypes = require_checkPropTypes();
|
|
478
|
+
var printWarning = function() {
|
|
479
|
+
};
|
|
480
|
+
if (process.env.NODE_ENV !== "production") {
|
|
481
|
+
printWarning = function(text) {
|
|
482
|
+
var message = "Warning: " + text;
|
|
483
|
+
if (typeof console !== "undefined") {
|
|
484
|
+
console.error(message);
|
|
485
|
+
}
|
|
486
|
+
try {
|
|
487
|
+
throw new Error(message);
|
|
488
|
+
} catch (x) {
|
|
489
|
+
}
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
function emptyFunctionThatReturnsNull() {
|
|
493
|
+
return null;
|
|
494
|
+
}
|
|
495
|
+
module2.exports = function(isValidElement, throwOnDirectAccess) {
|
|
496
|
+
var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
|
|
497
|
+
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
498
|
+
function getIteratorFn(maybeIterable) {
|
|
499
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
500
|
+
if (typeof iteratorFn === "function") {
|
|
501
|
+
return iteratorFn;
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
var ANONYMOUS = "<<anonymous>>";
|
|
505
|
+
var ReactPropTypes = {
|
|
506
|
+
array: createPrimitiveTypeChecker("array"),
|
|
507
|
+
bigint: createPrimitiveTypeChecker("bigint"),
|
|
508
|
+
bool: createPrimitiveTypeChecker("boolean"),
|
|
509
|
+
func: createPrimitiveTypeChecker("function"),
|
|
510
|
+
number: createPrimitiveTypeChecker("number"),
|
|
511
|
+
object: createPrimitiveTypeChecker("object"),
|
|
512
|
+
string: createPrimitiveTypeChecker("string"),
|
|
513
|
+
symbol: createPrimitiveTypeChecker("symbol"),
|
|
514
|
+
any: createAnyTypeChecker(),
|
|
515
|
+
arrayOf: createArrayOfTypeChecker,
|
|
516
|
+
element: createElementTypeChecker(),
|
|
517
|
+
elementType: createElementTypeTypeChecker(),
|
|
518
|
+
instanceOf: createInstanceTypeChecker,
|
|
519
|
+
node: createNodeChecker(),
|
|
520
|
+
objectOf: createObjectOfTypeChecker,
|
|
521
|
+
oneOf: createEnumTypeChecker,
|
|
522
|
+
oneOfType: createUnionTypeChecker,
|
|
523
|
+
shape: createShapeTypeChecker,
|
|
524
|
+
exact: createStrictShapeTypeChecker
|
|
525
|
+
};
|
|
526
|
+
function is(x, y) {
|
|
527
|
+
if (x === y) {
|
|
528
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
529
|
+
} else {
|
|
530
|
+
return x !== x && y !== y;
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
function PropTypeError(message, data) {
|
|
534
|
+
this.message = message;
|
|
535
|
+
this.data = data && typeof data === "object" ? data : {};
|
|
536
|
+
this.stack = "";
|
|
537
|
+
}
|
|
538
|
+
PropTypeError.prototype = Error.prototype;
|
|
539
|
+
function createChainableTypeChecker(validate) {
|
|
540
|
+
if (process.env.NODE_ENV !== "production") {
|
|
541
|
+
var manualPropTypeCallCache = {};
|
|
542
|
+
var manualPropTypeWarningCount = 0;
|
|
543
|
+
}
|
|
544
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
545
|
+
componentName = componentName || ANONYMOUS;
|
|
546
|
+
propFullName = propFullName || propName;
|
|
547
|
+
if (secret !== ReactPropTypesSecret) {
|
|
548
|
+
if (throwOnDirectAccess) {
|
|
549
|
+
var err = new Error(
|
|
550
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
551
|
+
);
|
|
552
|
+
err.name = "Invariant Violation";
|
|
553
|
+
throw err;
|
|
554
|
+
} else if (process.env.NODE_ENV !== "production" && typeof console !== "undefined") {
|
|
555
|
+
var cacheKey = componentName + ":" + propName;
|
|
556
|
+
if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
557
|
+
manualPropTypeWarningCount < 3) {
|
|
558
|
+
printWarning(
|
|
559
|
+
"You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
560
|
+
);
|
|
561
|
+
manualPropTypeCallCache[cacheKey] = true;
|
|
562
|
+
manualPropTypeWarningCount++;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
if (props[propName] == null) {
|
|
567
|
+
if (isRequired) {
|
|
568
|
+
if (props[propName] === null) {
|
|
569
|
+
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
|
|
570
|
+
}
|
|
571
|
+
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
|
|
572
|
+
}
|
|
573
|
+
return null;
|
|
574
|
+
} else {
|
|
575
|
+
return validate(props, propName, componentName, location, propFullName);
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
var chainedCheckType = checkType.bind(null, false);
|
|
579
|
+
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
580
|
+
return chainedCheckType;
|
|
581
|
+
}
|
|
582
|
+
function createPrimitiveTypeChecker(expectedType) {
|
|
583
|
+
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
584
|
+
var propValue = props[propName];
|
|
585
|
+
var propType = getPropType(propValue);
|
|
586
|
+
if (propType !== expectedType) {
|
|
587
|
+
var preciseType = getPreciseType(propValue);
|
|
588
|
+
return new PropTypeError(
|
|
589
|
+
"Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."),
|
|
590
|
+
{ expectedType }
|
|
591
|
+
);
|
|
592
|
+
}
|
|
593
|
+
return null;
|
|
594
|
+
}
|
|
595
|
+
return createChainableTypeChecker(validate);
|
|
596
|
+
}
|
|
597
|
+
function createAnyTypeChecker() {
|
|
598
|
+
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
599
|
+
}
|
|
600
|
+
function createArrayOfTypeChecker(typeChecker) {
|
|
601
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
602
|
+
if (typeof typeChecker !== "function") {
|
|
603
|
+
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
|
|
604
|
+
}
|
|
605
|
+
var propValue = props[propName];
|
|
606
|
+
if (!Array.isArray(propValue)) {
|
|
607
|
+
var propType = getPropType(propValue);
|
|
608
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
|
|
609
|
+
}
|
|
610
|
+
for (var i = 0; i < propValue.length; i++) {
|
|
611
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret);
|
|
612
|
+
if (error instanceof Error) {
|
|
613
|
+
return error;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
return null;
|
|
617
|
+
}
|
|
618
|
+
return createChainableTypeChecker(validate);
|
|
619
|
+
}
|
|
620
|
+
function createElementTypeChecker() {
|
|
621
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
622
|
+
var propValue = props[propName];
|
|
623
|
+
if (!isValidElement(propValue)) {
|
|
624
|
+
var propType = getPropType(propValue);
|
|
625
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
|
|
626
|
+
}
|
|
627
|
+
return null;
|
|
628
|
+
}
|
|
629
|
+
return createChainableTypeChecker(validate);
|
|
630
|
+
}
|
|
631
|
+
function createElementTypeTypeChecker() {
|
|
632
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
633
|
+
var propValue = props[propName];
|
|
634
|
+
if (!ReactIs.isValidElementType(propValue)) {
|
|
635
|
+
var propType = getPropType(propValue);
|
|
636
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
|
|
637
|
+
}
|
|
638
|
+
return null;
|
|
639
|
+
}
|
|
640
|
+
return createChainableTypeChecker(validate);
|
|
641
|
+
}
|
|
642
|
+
function createInstanceTypeChecker(expectedClass) {
|
|
643
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
644
|
+
if (!(props[propName] instanceof expectedClass)) {
|
|
645
|
+
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
646
|
+
var actualClassName = getClassName(props[propName]);
|
|
647
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
|
|
648
|
+
}
|
|
649
|
+
return null;
|
|
650
|
+
}
|
|
651
|
+
return createChainableTypeChecker(validate);
|
|
652
|
+
}
|
|
653
|
+
function createEnumTypeChecker(expectedValues) {
|
|
654
|
+
if (!Array.isArray(expectedValues)) {
|
|
655
|
+
if (process.env.NODE_ENV !== "production") {
|
|
656
|
+
if (arguments.length > 1) {
|
|
657
|
+
printWarning(
|
|
658
|
+
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
|
659
|
+
);
|
|
660
|
+
} else {
|
|
661
|
+
printWarning("Invalid argument supplied to oneOf, expected an array.");
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
return emptyFunctionThatReturnsNull;
|
|
665
|
+
}
|
|
666
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
667
|
+
var propValue = props[propName];
|
|
668
|
+
for (var i = 0; i < expectedValues.length; i++) {
|
|
669
|
+
if (is(propValue, expectedValues[i])) {
|
|
670
|
+
return null;
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
674
|
+
var type = getPreciseType(value);
|
|
675
|
+
if (type === "symbol") {
|
|
676
|
+
return String(value);
|
|
677
|
+
}
|
|
678
|
+
return value;
|
|
679
|
+
});
|
|
680
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
|
|
681
|
+
}
|
|
682
|
+
return createChainableTypeChecker(validate);
|
|
683
|
+
}
|
|
684
|
+
function createObjectOfTypeChecker(typeChecker) {
|
|
685
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
686
|
+
if (typeof typeChecker !== "function") {
|
|
687
|
+
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
|
|
688
|
+
}
|
|
689
|
+
var propValue = props[propName];
|
|
690
|
+
var propType = getPropType(propValue);
|
|
691
|
+
if (propType !== "object") {
|
|
692
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
|
|
693
|
+
}
|
|
694
|
+
for (var key in propValue) {
|
|
695
|
+
if (has(propValue, key)) {
|
|
696
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
697
|
+
if (error instanceof Error) {
|
|
698
|
+
return error;
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
return null;
|
|
703
|
+
}
|
|
704
|
+
return createChainableTypeChecker(validate);
|
|
705
|
+
}
|
|
706
|
+
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
707
|
+
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
708
|
+
process.env.NODE_ENV !== "production" ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0;
|
|
709
|
+
return emptyFunctionThatReturnsNull;
|
|
710
|
+
}
|
|
711
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
712
|
+
var checker = arrayOfTypeCheckers[i];
|
|
713
|
+
if (typeof checker !== "function") {
|
|
714
|
+
printWarning(
|
|
715
|
+
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "."
|
|
716
|
+
);
|
|
717
|
+
return emptyFunctionThatReturnsNull;
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
721
|
+
var expectedTypes = [];
|
|
722
|
+
for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) {
|
|
723
|
+
var checker2 = arrayOfTypeCheckers[i2];
|
|
724
|
+
var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
725
|
+
if (checkerResult == null) {
|
|
726
|
+
return null;
|
|
727
|
+
}
|
|
728
|
+
if (checkerResult.data && has(checkerResult.data, "expectedType")) {
|
|
729
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
|
|
733
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
|
|
734
|
+
}
|
|
735
|
+
return createChainableTypeChecker(validate);
|
|
736
|
+
}
|
|
737
|
+
function createNodeChecker() {
|
|
738
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
739
|
+
if (!isNode(props[propName])) {
|
|
740
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
|
|
741
|
+
}
|
|
742
|
+
return null;
|
|
743
|
+
}
|
|
744
|
+
return createChainableTypeChecker(validate);
|
|
745
|
+
}
|
|
746
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
747
|
+
return new PropTypeError(
|
|
748
|
+
(componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."
|
|
749
|
+
);
|
|
750
|
+
}
|
|
751
|
+
function createShapeTypeChecker(shapeTypes) {
|
|
752
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
753
|
+
var propValue = props[propName];
|
|
754
|
+
var propType = getPropType(propValue);
|
|
755
|
+
if (propType !== "object") {
|
|
756
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
757
|
+
}
|
|
758
|
+
for (var key in shapeTypes) {
|
|
759
|
+
var checker = shapeTypes[key];
|
|
760
|
+
if (typeof checker !== "function") {
|
|
761
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
762
|
+
}
|
|
763
|
+
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
764
|
+
if (error) {
|
|
765
|
+
return error;
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
return null;
|
|
769
|
+
}
|
|
770
|
+
return createChainableTypeChecker(validate);
|
|
771
|
+
}
|
|
772
|
+
function createStrictShapeTypeChecker(shapeTypes) {
|
|
773
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
774
|
+
var propValue = props[propName];
|
|
775
|
+
var propType = getPropType(propValue);
|
|
776
|
+
if (propType !== "object") {
|
|
777
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
778
|
+
}
|
|
779
|
+
var allKeys = assign({}, props[propName], shapeTypes);
|
|
780
|
+
for (var key in allKeys) {
|
|
781
|
+
var checker = shapeTypes[key];
|
|
782
|
+
if (has(shapeTypes, key) && typeof checker !== "function") {
|
|
783
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
784
|
+
}
|
|
785
|
+
if (!checker) {
|
|
786
|
+
return new PropTypeError(
|
|
787
|
+
"Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ")
|
|
788
|
+
);
|
|
789
|
+
}
|
|
790
|
+
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
791
|
+
if (error) {
|
|
792
|
+
return error;
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
return null;
|
|
796
|
+
}
|
|
797
|
+
return createChainableTypeChecker(validate);
|
|
798
|
+
}
|
|
799
|
+
function isNode(propValue) {
|
|
800
|
+
switch (typeof propValue) {
|
|
801
|
+
case "number":
|
|
802
|
+
case "string":
|
|
803
|
+
case "undefined":
|
|
804
|
+
return true;
|
|
805
|
+
case "boolean":
|
|
806
|
+
return !propValue;
|
|
807
|
+
case "object":
|
|
808
|
+
if (Array.isArray(propValue)) {
|
|
809
|
+
return propValue.every(isNode);
|
|
810
|
+
}
|
|
811
|
+
if (propValue === null || isValidElement(propValue)) {
|
|
812
|
+
return true;
|
|
813
|
+
}
|
|
814
|
+
var iteratorFn = getIteratorFn(propValue);
|
|
815
|
+
if (iteratorFn) {
|
|
816
|
+
var iterator = iteratorFn.call(propValue);
|
|
817
|
+
var step;
|
|
818
|
+
if (iteratorFn !== propValue.entries) {
|
|
819
|
+
while (!(step = iterator.next()).done) {
|
|
820
|
+
if (!isNode(step.value)) {
|
|
821
|
+
return false;
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
} else {
|
|
825
|
+
while (!(step = iterator.next()).done) {
|
|
826
|
+
var entry = step.value;
|
|
827
|
+
if (entry) {
|
|
828
|
+
if (!isNode(entry[1])) {
|
|
829
|
+
return false;
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
} else {
|
|
835
|
+
return false;
|
|
836
|
+
}
|
|
837
|
+
return true;
|
|
838
|
+
default:
|
|
839
|
+
return false;
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
function isSymbol(propType, propValue) {
|
|
843
|
+
if (propType === "symbol") {
|
|
844
|
+
return true;
|
|
845
|
+
}
|
|
846
|
+
if (!propValue) {
|
|
847
|
+
return false;
|
|
848
|
+
}
|
|
849
|
+
if (propValue["@@toStringTag"] === "Symbol") {
|
|
850
|
+
return true;
|
|
851
|
+
}
|
|
852
|
+
if (typeof Symbol === "function" && propValue instanceof Symbol) {
|
|
853
|
+
return true;
|
|
854
|
+
}
|
|
855
|
+
return false;
|
|
856
|
+
}
|
|
857
|
+
function getPropType(propValue) {
|
|
858
|
+
var propType = typeof propValue;
|
|
859
|
+
if (Array.isArray(propValue)) {
|
|
860
|
+
return "array";
|
|
861
|
+
}
|
|
862
|
+
if (propValue instanceof RegExp) {
|
|
863
|
+
return "object";
|
|
864
|
+
}
|
|
865
|
+
if (isSymbol(propType, propValue)) {
|
|
866
|
+
return "symbol";
|
|
867
|
+
}
|
|
868
|
+
return propType;
|
|
869
|
+
}
|
|
870
|
+
function getPreciseType(propValue) {
|
|
871
|
+
if (typeof propValue === "undefined" || propValue === null) {
|
|
872
|
+
return "" + propValue;
|
|
873
|
+
}
|
|
874
|
+
var propType = getPropType(propValue);
|
|
875
|
+
if (propType === "object") {
|
|
876
|
+
if (propValue instanceof Date) {
|
|
877
|
+
return "date";
|
|
878
|
+
} else if (propValue instanceof RegExp) {
|
|
879
|
+
return "regexp";
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
return propType;
|
|
883
|
+
}
|
|
884
|
+
function getPostfixForTypeWarning(value) {
|
|
885
|
+
var type = getPreciseType(value);
|
|
886
|
+
switch (type) {
|
|
887
|
+
case "array":
|
|
888
|
+
case "object":
|
|
889
|
+
return "an " + type;
|
|
890
|
+
case "boolean":
|
|
891
|
+
case "date":
|
|
892
|
+
case "regexp":
|
|
893
|
+
return "a " + type;
|
|
894
|
+
default:
|
|
895
|
+
return type;
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
function getClassName(propValue) {
|
|
899
|
+
if (!propValue.constructor || !propValue.constructor.name) {
|
|
900
|
+
return ANONYMOUS;
|
|
901
|
+
}
|
|
902
|
+
return propValue.constructor.name;
|
|
903
|
+
}
|
|
904
|
+
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
905
|
+
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
906
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
907
|
+
return ReactPropTypes;
|
|
908
|
+
};
|
|
909
|
+
}
|
|
910
|
+
});
|
|
911
|
+
|
|
912
|
+
// node_modules/prop-types/factoryWithThrowingShims.js
|
|
913
|
+
var require_factoryWithThrowingShims = __commonJS({
|
|
914
|
+
"node_modules/prop-types/factoryWithThrowingShims.js"(exports2, module2) {
|
|
915
|
+
"use strict";
|
|
916
|
+
var ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
917
|
+
function emptyFunction() {
|
|
918
|
+
}
|
|
919
|
+
function emptyFunctionWithReset() {
|
|
920
|
+
}
|
|
921
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
922
|
+
module2.exports = function() {
|
|
923
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
924
|
+
if (secret === ReactPropTypesSecret) {
|
|
925
|
+
return;
|
|
926
|
+
}
|
|
927
|
+
var err = new Error(
|
|
928
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
|
|
929
|
+
);
|
|
930
|
+
err.name = "Invariant Violation";
|
|
931
|
+
throw err;
|
|
932
|
+
}
|
|
933
|
+
;
|
|
934
|
+
shim.isRequired = shim;
|
|
935
|
+
function getShim() {
|
|
936
|
+
return shim;
|
|
937
|
+
}
|
|
938
|
+
;
|
|
939
|
+
var ReactPropTypes = {
|
|
940
|
+
array: shim,
|
|
941
|
+
bigint: shim,
|
|
942
|
+
bool: shim,
|
|
943
|
+
func: shim,
|
|
944
|
+
number: shim,
|
|
945
|
+
object: shim,
|
|
946
|
+
string: shim,
|
|
947
|
+
symbol: shim,
|
|
948
|
+
any: shim,
|
|
949
|
+
arrayOf: getShim,
|
|
950
|
+
element: shim,
|
|
951
|
+
elementType: shim,
|
|
952
|
+
instanceOf: getShim,
|
|
953
|
+
node: shim,
|
|
954
|
+
objectOf: getShim,
|
|
955
|
+
oneOf: getShim,
|
|
956
|
+
oneOfType: getShim,
|
|
957
|
+
shape: getShim,
|
|
958
|
+
exact: getShim,
|
|
959
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
960
|
+
resetWarningCache: emptyFunction
|
|
961
|
+
};
|
|
962
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
963
|
+
return ReactPropTypes;
|
|
964
|
+
};
|
|
965
|
+
}
|
|
966
|
+
});
|
|
967
|
+
|
|
968
|
+
// node_modules/prop-types/index.js
|
|
969
|
+
var require_prop_types = __commonJS({
|
|
970
|
+
"node_modules/prop-types/index.js"(exports2, module2) {
|
|
971
|
+
"use strict";
|
|
972
|
+
if (process.env.NODE_ENV !== "production") {
|
|
973
|
+
ReactIs = require_react_is();
|
|
974
|
+
throwOnDirectAccess = true;
|
|
975
|
+
module2.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
976
|
+
} else {
|
|
977
|
+
module2.exports = require_factoryWithThrowingShims()();
|
|
978
|
+
}
|
|
979
|
+
var ReactIs;
|
|
980
|
+
var throwOnDirectAccess;
|
|
981
|
+
}
|
|
982
|
+
});
|
|
983
|
+
|
|
984
|
+
// node_modules/clsx/dist/clsx.m.js
|
|
985
|
+
var clsx_m_exports = {};
|
|
986
|
+
__export(clsx_m_exports, {
|
|
987
|
+
clsx: () => clsx,
|
|
988
|
+
default: () => clsx_m_default
|
|
989
|
+
});
|
|
990
|
+
function r(e) {
|
|
991
|
+
var t, f, n = "";
|
|
992
|
+
if ("string" == typeof e || "number" == typeof e)
|
|
993
|
+
n += e;
|
|
994
|
+
else if ("object" == typeof e)
|
|
995
|
+
if (Array.isArray(e))
|
|
996
|
+
for (t = 0; t < e.length; t++)
|
|
997
|
+
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
998
|
+
else
|
|
999
|
+
for (t in e)
|
|
1000
|
+
e[t] && (n && (n += " "), n += t);
|
|
1001
|
+
return n;
|
|
1002
|
+
}
|
|
1003
|
+
function clsx() {
|
|
1004
|
+
for (var e, t, f = 0, n = ""; f < arguments.length; )
|
|
1005
|
+
(e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
1006
|
+
return n;
|
|
1007
|
+
}
|
|
1008
|
+
var clsx_m_default;
|
|
1009
|
+
var init_clsx_m = __esm({
|
|
1010
|
+
"node_modules/clsx/dist/clsx.m.js"() {
|
|
1011
|
+
"use strict";
|
|
1012
|
+
clsx_m_default = clsx;
|
|
1013
|
+
}
|
|
1014
|
+
});
|
|
1015
|
+
|
|
1016
|
+
// node_modules/react-draggable/build/cjs/utils/shims.js
|
|
1017
|
+
var require_shims = __commonJS({
|
|
1018
|
+
"node_modules/react-draggable/build/cjs/utils/shims.js"(exports2) {
|
|
1019
|
+
"use strict";
|
|
1020
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
1021
|
+
value: true
|
|
1022
|
+
});
|
|
1023
|
+
exports2.dontSetMe = dontSetMe;
|
|
1024
|
+
exports2.findInArray = findInArray;
|
|
1025
|
+
exports2.int = int;
|
|
1026
|
+
exports2.isFunction = isFunction;
|
|
1027
|
+
exports2.isNum = isNum;
|
|
1028
|
+
function findInArray(array, callback) {
|
|
1029
|
+
for (let i = 0, length = array.length; i < length; i++) {
|
|
1030
|
+
if (callback.apply(callback, [array[i], i, array]))
|
|
1031
|
+
return array[i];
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
function isFunction(func) {
|
|
1035
|
+
return typeof func === "function" || Object.prototype.toString.call(func) === "[object Function]";
|
|
1036
|
+
}
|
|
1037
|
+
function isNum(num) {
|
|
1038
|
+
return typeof num === "number" && !isNaN(num);
|
|
1039
|
+
}
|
|
1040
|
+
function int(a) {
|
|
1041
|
+
return parseInt(a, 10);
|
|
1042
|
+
}
|
|
1043
|
+
function dontSetMe(props, propName, componentName) {
|
|
1044
|
+
if (props[propName]) {
|
|
1045
|
+
return new Error("Invalid prop ".concat(propName, " passed to ").concat(componentName, " - do not set this, set it on the child."));
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
});
|
|
1050
|
+
|
|
1051
|
+
// node_modules/react-draggable/build/cjs/utils/getPrefix.js
|
|
1052
|
+
var require_getPrefix = __commonJS({
|
|
1053
|
+
"node_modules/react-draggable/build/cjs/utils/getPrefix.js"(exports2) {
|
|
1054
|
+
"use strict";
|
|
1055
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
1056
|
+
value: true
|
|
1057
|
+
});
|
|
1058
|
+
exports2.browserPrefixToKey = browserPrefixToKey;
|
|
1059
|
+
exports2.browserPrefixToStyle = browserPrefixToStyle;
|
|
1060
|
+
exports2.default = void 0;
|
|
1061
|
+
exports2.getPrefix = getPrefix;
|
|
1062
|
+
var prefixes = ["Moz", "Webkit", "O", "ms"];
|
|
1063
|
+
function getPrefix() {
|
|
1064
|
+
var _window$document;
|
|
1065
|
+
let prop = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "transform";
|
|
1066
|
+
if (typeof window === "undefined")
|
|
1067
|
+
return "";
|
|
1068
|
+
const style = (_window$document = window.document) === null || _window$document === void 0 || (_window$document = _window$document.documentElement) === null || _window$document === void 0 ? void 0 : _window$document.style;
|
|
1069
|
+
if (!style)
|
|
1070
|
+
return "";
|
|
1071
|
+
if (prop in style)
|
|
1072
|
+
return "";
|
|
1073
|
+
for (let i = 0; i < prefixes.length; i++) {
|
|
1074
|
+
if (browserPrefixToKey(prop, prefixes[i]) in style)
|
|
1075
|
+
return prefixes[i];
|
|
1076
|
+
}
|
|
1077
|
+
return "";
|
|
1078
|
+
}
|
|
1079
|
+
function browserPrefixToKey(prop, prefix) {
|
|
1080
|
+
return prefix ? "".concat(prefix).concat(kebabToTitleCase(prop)) : prop;
|
|
1081
|
+
}
|
|
1082
|
+
function browserPrefixToStyle(prop, prefix) {
|
|
1083
|
+
return prefix ? "-".concat(prefix.toLowerCase(), "-").concat(prop) : prop;
|
|
1084
|
+
}
|
|
1085
|
+
function kebabToTitleCase(str) {
|
|
1086
|
+
let out = "";
|
|
1087
|
+
let shouldCapitalize = true;
|
|
1088
|
+
for (let i = 0; i < str.length; i++) {
|
|
1089
|
+
if (shouldCapitalize) {
|
|
1090
|
+
out += str[i].toUpperCase();
|
|
1091
|
+
shouldCapitalize = false;
|
|
1092
|
+
} else if (str[i] === "-") {
|
|
1093
|
+
shouldCapitalize = true;
|
|
1094
|
+
} else {
|
|
1095
|
+
out += str[i];
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
return out;
|
|
1099
|
+
}
|
|
1100
|
+
var _default = exports2.default = getPrefix();
|
|
1101
|
+
}
|
|
1102
|
+
});
|
|
1103
|
+
|
|
1104
|
+
// node_modules/react-draggable/build/cjs/utils/domFns.js
|
|
1105
|
+
var require_domFns = __commonJS({
|
|
1106
|
+
"node_modules/react-draggable/build/cjs/utils/domFns.js"(exports2) {
|
|
1107
|
+
"use strict";
|
|
1108
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
1109
|
+
value: true
|
|
1110
|
+
});
|
|
1111
|
+
exports2.addClassName = addClassName;
|
|
1112
|
+
exports2.addEvent = addEvent;
|
|
1113
|
+
exports2.addUserSelectStyles = addUserSelectStyles;
|
|
1114
|
+
exports2.createCSSTransform = createCSSTransform;
|
|
1115
|
+
exports2.createSVGTransform = createSVGTransform;
|
|
1116
|
+
exports2.getTouch = getTouch;
|
|
1117
|
+
exports2.getTouchIdentifier = getTouchIdentifier;
|
|
1118
|
+
exports2.getTranslation = getTranslation;
|
|
1119
|
+
exports2.innerHeight = innerHeight;
|
|
1120
|
+
exports2.innerWidth = innerWidth;
|
|
1121
|
+
exports2.matchesSelector = matchesSelector;
|
|
1122
|
+
exports2.matchesSelectorAndParentsTo = matchesSelectorAndParentsTo;
|
|
1123
|
+
exports2.offsetXYFromParent = offsetXYFromParent;
|
|
1124
|
+
exports2.outerHeight = outerHeight;
|
|
1125
|
+
exports2.outerWidth = outerWidth;
|
|
1126
|
+
exports2.removeClassName = removeClassName;
|
|
1127
|
+
exports2.removeEvent = removeEvent;
|
|
1128
|
+
exports2.removeUserSelectStyles = removeUserSelectStyles;
|
|
1129
|
+
var _shims = require_shims();
|
|
1130
|
+
var _getPrefix = _interopRequireWildcard(require_getPrefix());
|
|
1131
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
1132
|
+
if (typeof WeakMap !== "function")
|
|
1133
|
+
return null;
|
|
1134
|
+
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
|
|
1135
|
+
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
|
|
1136
|
+
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
1137
|
+
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
1138
|
+
})(nodeInterop);
|
|
1139
|
+
}
|
|
1140
|
+
function _interopRequireWildcard(obj, nodeInterop) {
|
|
1141
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
1142
|
+
return obj;
|
|
1143
|
+
}
|
|
1144
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
1145
|
+
return { default: obj };
|
|
1146
|
+
}
|
|
1147
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
1148
|
+
if (cache && cache.has(obj)) {
|
|
1149
|
+
return cache.get(obj);
|
|
1150
|
+
}
|
|
1151
|
+
var newObj = {};
|
|
1152
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
1153
|
+
for (var key in obj) {
|
|
1154
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
1155
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
1156
|
+
if (desc && (desc.get || desc.set)) {
|
|
1157
|
+
Object.defineProperty(newObj, key, desc);
|
|
1158
|
+
} else {
|
|
1159
|
+
newObj[key] = obj[key];
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
newObj.default = obj;
|
|
1164
|
+
if (cache) {
|
|
1165
|
+
cache.set(obj, newObj);
|
|
1166
|
+
}
|
|
1167
|
+
return newObj;
|
|
1168
|
+
}
|
|
1169
|
+
var matchesSelectorFunc = "";
|
|
1170
|
+
function matchesSelector(el, selector) {
|
|
1171
|
+
if (!matchesSelectorFunc) {
|
|
1172
|
+
matchesSelectorFunc = (0, _shims.findInArray)(["matches", "webkitMatchesSelector", "mozMatchesSelector", "msMatchesSelector", "oMatchesSelector"], function(method) {
|
|
1173
|
+
return (0, _shims.isFunction)(el[method]);
|
|
1174
|
+
});
|
|
1175
|
+
}
|
|
1176
|
+
if (!(0, _shims.isFunction)(el[matchesSelectorFunc]))
|
|
1177
|
+
return false;
|
|
1178
|
+
return el[matchesSelectorFunc](selector);
|
|
1179
|
+
}
|
|
1180
|
+
function matchesSelectorAndParentsTo(el, selector, baseNode) {
|
|
1181
|
+
let node = el;
|
|
1182
|
+
do {
|
|
1183
|
+
if (matchesSelector(node, selector))
|
|
1184
|
+
return true;
|
|
1185
|
+
if (node === baseNode)
|
|
1186
|
+
return false;
|
|
1187
|
+
node = node.parentNode;
|
|
1188
|
+
} while (node);
|
|
1189
|
+
return false;
|
|
1190
|
+
}
|
|
1191
|
+
function addEvent(el, event, handler, inputOptions) {
|
|
1192
|
+
if (!el)
|
|
1193
|
+
return;
|
|
1194
|
+
const options = {
|
|
1195
|
+
capture: true,
|
|
1196
|
+
...inputOptions
|
|
1197
|
+
};
|
|
1198
|
+
if (el.addEventListener) {
|
|
1199
|
+
el.addEventListener(event, handler, options);
|
|
1200
|
+
} else if (el.attachEvent) {
|
|
1201
|
+
el.attachEvent("on" + event, handler);
|
|
1202
|
+
} else {
|
|
1203
|
+
el["on" + event] = handler;
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
function removeEvent(el, event, handler, inputOptions) {
|
|
1207
|
+
if (!el)
|
|
1208
|
+
return;
|
|
1209
|
+
const options = {
|
|
1210
|
+
capture: true,
|
|
1211
|
+
...inputOptions
|
|
1212
|
+
};
|
|
1213
|
+
if (el.removeEventListener) {
|
|
1214
|
+
el.removeEventListener(event, handler, options);
|
|
1215
|
+
} else if (el.detachEvent) {
|
|
1216
|
+
el.detachEvent("on" + event, handler);
|
|
1217
|
+
} else {
|
|
1218
|
+
el["on" + event] = null;
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
function outerHeight(node) {
|
|
1222
|
+
let height = node.clientHeight;
|
|
1223
|
+
const computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
|
|
1224
|
+
height += (0, _shims.int)(computedStyle.borderTopWidth);
|
|
1225
|
+
height += (0, _shims.int)(computedStyle.borderBottomWidth);
|
|
1226
|
+
return height;
|
|
1227
|
+
}
|
|
1228
|
+
function outerWidth(node) {
|
|
1229
|
+
let width = node.clientWidth;
|
|
1230
|
+
const computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
|
|
1231
|
+
width += (0, _shims.int)(computedStyle.borderLeftWidth);
|
|
1232
|
+
width += (0, _shims.int)(computedStyle.borderRightWidth);
|
|
1233
|
+
return width;
|
|
1234
|
+
}
|
|
1235
|
+
function innerHeight(node) {
|
|
1236
|
+
let height = node.clientHeight;
|
|
1237
|
+
const computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
|
|
1238
|
+
height -= (0, _shims.int)(computedStyle.paddingTop);
|
|
1239
|
+
height -= (0, _shims.int)(computedStyle.paddingBottom);
|
|
1240
|
+
return height;
|
|
1241
|
+
}
|
|
1242
|
+
function innerWidth(node) {
|
|
1243
|
+
let width = node.clientWidth;
|
|
1244
|
+
const computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
|
|
1245
|
+
width -= (0, _shims.int)(computedStyle.paddingLeft);
|
|
1246
|
+
width -= (0, _shims.int)(computedStyle.paddingRight);
|
|
1247
|
+
return width;
|
|
1248
|
+
}
|
|
1249
|
+
function offsetXYFromParent(evt, offsetParent, scale) {
|
|
1250
|
+
const isBody = offsetParent === offsetParent.ownerDocument.body;
|
|
1251
|
+
const offsetParentRect = isBody ? {
|
|
1252
|
+
left: 0,
|
|
1253
|
+
top: 0
|
|
1254
|
+
} : offsetParent.getBoundingClientRect();
|
|
1255
|
+
const x = (evt.clientX + offsetParent.scrollLeft - offsetParentRect.left) / scale;
|
|
1256
|
+
const y = (evt.clientY + offsetParent.scrollTop - offsetParentRect.top) / scale;
|
|
1257
|
+
return {
|
|
1258
|
+
x,
|
|
1259
|
+
y
|
|
1260
|
+
};
|
|
1261
|
+
}
|
|
1262
|
+
function createCSSTransform(controlPos, positionOffset) {
|
|
1263
|
+
const translation = getTranslation(controlPos, positionOffset, "px");
|
|
1264
|
+
return {
|
|
1265
|
+
[(0, _getPrefix.browserPrefixToKey)("transform", _getPrefix.default)]: translation
|
|
1266
|
+
};
|
|
1267
|
+
}
|
|
1268
|
+
function createSVGTransform(controlPos, positionOffset) {
|
|
1269
|
+
const translation = getTranslation(controlPos, positionOffset, "");
|
|
1270
|
+
return translation;
|
|
1271
|
+
}
|
|
1272
|
+
function getTranslation(_ref, positionOffset, unitSuffix) {
|
|
1273
|
+
let {
|
|
1274
|
+
x,
|
|
1275
|
+
y
|
|
1276
|
+
} = _ref;
|
|
1277
|
+
let translation = "translate(".concat(x).concat(unitSuffix, ",").concat(y).concat(unitSuffix, ")");
|
|
1278
|
+
if (positionOffset) {
|
|
1279
|
+
const defaultX = "".concat(typeof positionOffset.x === "string" ? positionOffset.x : positionOffset.x + unitSuffix);
|
|
1280
|
+
const defaultY = "".concat(typeof positionOffset.y === "string" ? positionOffset.y : positionOffset.y + unitSuffix);
|
|
1281
|
+
translation = "translate(".concat(defaultX, ", ").concat(defaultY, ")") + translation;
|
|
1282
|
+
}
|
|
1283
|
+
return translation;
|
|
1284
|
+
}
|
|
1285
|
+
function getTouch(e, identifier) {
|
|
1286
|
+
return e.targetTouches && (0, _shims.findInArray)(e.targetTouches, (t) => identifier === t.identifier) || e.changedTouches && (0, _shims.findInArray)(e.changedTouches, (t) => identifier === t.identifier);
|
|
1287
|
+
}
|
|
1288
|
+
function getTouchIdentifier(e) {
|
|
1289
|
+
if (e.targetTouches && e.targetTouches[0])
|
|
1290
|
+
return e.targetTouches[0].identifier;
|
|
1291
|
+
if (e.changedTouches && e.changedTouches[0])
|
|
1292
|
+
return e.changedTouches[0].identifier;
|
|
1293
|
+
}
|
|
1294
|
+
function addUserSelectStyles(doc) {
|
|
1295
|
+
if (!doc)
|
|
1296
|
+
return;
|
|
1297
|
+
let styleEl = doc.getElementById("react-draggable-style-el");
|
|
1298
|
+
if (!styleEl) {
|
|
1299
|
+
styleEl = doc.createElement("style");
|
|
1300
|
+
styleEl.type = "text/css";
|
|
1301
|
+
styleEl.id = "react-draggable-style-el";
|
|
1302
|
+
styleEl.innerHTML = ".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n";
|
|
1303
|
+
styleEl.innerHTML += ".react-draggable-transparent-selection *::selection {all: inherit;}\n";
|
|
1304
|
+
doc.getElementsByTagName("head")[0].appendChild(styleEl);
|
|
1305
|
+
}
|
|
1306
|
+
if (doc.body)
|
|
1307
|
+
addClassName(doc.body, "react-draggable-transparent-selection");
|
|
1308
|
+
}
|
|
1309
|
+
function removeUserSelectStyles(doc) {
|
|
1310
|
+
if (!doc)
|
|
1311
|
+
return;
|
|
1312
|
+
try {
|
|
1313
|
+
if (doc.body)
|
|
1314
|
+
removeClassName(doc.body, "react-draggable-transparent-selection");
|
|
1315
|
+
if (doc.selection) {
|
|
1316
|
+
doc.selection.empty();
|
|
1317
|
+
} else {
|
|
1318
|
+
const selection = (doc.defaultView || window).getSelection();
|
|
1319
|
+
if (selection && selection.type !== "Caret") {
|
|
1320
|
+
selection.removeAllRanges();
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
} catch (e) {
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
function addClassName(el, className) {
|
|
1327
|
+
if (el.classList) {
|
|
1328
|
+
el.classList.add(className);
|
|
1329
|
+
} else {
|
|
1330
|
+
if (!el.className.match(new RegExp("(?:^|\\s)".concat(className, "(?!\\S)")))) {
|
|
1331
|
+
el.className += " ".concat(className);
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
function removeClassName(el, className) {
|
|
1336
|
+
if (el.classList) {
|
|
1337
|
+
el.classList.remove(className);
|
|
1338
|
+
} else {
|
|
1339
|
+
el.className = el.className.replace(new RegExp("(?:^|\\s)".concat(className, "(?!\\S)"), "g"), "");
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
});
|
|
1344
|
+
|
|
1345
|
+
// node_modules/react-draggable/build/cjs/utils/positionFns.js
|
|
1346
|
+
var require_positionFns = __commonJS({
|
|
1347
|
+
"node_modules/react-draggable/build/cjs/utils/positionFns.js"(exports2) {
|
|
1348
|
+
"use strict";
|
|
1349
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
1350
|
+
value: true
|
|
1351
|
+
});
|
|
1352
|
+
exports2.canDragX = canDragX;
|
|
1353
|
+
exports2.canDragY = canDragY;
|
|
1354
|
+
exports2.createCoreData = createCoreData;
|
|
1355
|
+
exports2.createDraggableData = createDraggableData;
|
|
1356
|
+
exports2.getBoundPosition = getBoundPosition;
|
|
1357
|
+
exports2.getControlPosition = getControlPosition;
|
|
1358
|
+
exports2.snapToGrid = snapToGrid;
|
|
1359
|
+
var _shims = require_shims();
|
|
1360
|
+
var _domFns = require_domFns();
|
|
1361
|
+
function getBoundPosition(draggable, x, y) {
|
|
1362
|
+
if (!draggable.props.bounds)
|
|
1363
|
+
return [x, y];
|
|
1364
|
+
let {
|
|
1365
|
+
bounds
|
|
1366
|
+
} = draggable.props;
|
|
1367
|
+
bounds = typeof bounds === "string" ? bounds : cloneBounds(bounds);
|
|
1368
|
+
const node = findDOMNode(draggable);
|
|
1369
|
+
if (typeof bounds === "string") {
|
|
1370
|
+
const {
|
|
1371
|
+
ownerDocument
|
|
1372
|
+
} = node;
|
|
1373
|
+
const ownerWindow = ownerDocument.defaultView;
|
|
1374
|
+
let boundNode;
|
|
1375
|
+
if (bounds === "parent") {
|
|
1376
|
+
boundNode = node.parentNode;
|
|
1377
|
+
} else {
|
|
1378
|
+
boundNode = ownerDocument.querySelector(bounds);
|
|
1379
|
+
}
|
|
1380
|
+
if (!(boundNode instanceof ownerWindow.HTMLElement)) {
|
|
1381
|
+
throw new Error('Bounds selector "' + bounds + '" could not find an element.');
|
|
1382
|
+
}
|
|
1383
|
+
const boundNodeEl = boundNode;
|
|
1384
|
+
const nodeStyle = ownerWindow.getComputedStyle(node);
|
|
1385
|
+
const boundNodeStyle = ownerWindow.getComputedStyle(boundNodeEl);
|
|
1386
|
+
bounds = {
|
|
1387
|
+
left: -node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingLeft) + (0, _shims.int)(nodeStyle.marginLeft),
|
|
1388
|
+
top: -node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingTop) + (0, _shims.int)(nodeStyle.marginTop),
|
|
1389
|
+
right: (0, _domFns.innerWidth)(boundNodeEl) - (0, _domFns.outerWidth)(node) - node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingRight) - (0, _shims.int)(nodeStyle.marginRight),
|
|
1390
|
+
bottom: (0, _domFns.innerHeight)(boundNodeEl) - (0, _domFns.outerHeight)(node) - node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingBottom) - (0, _shims.int)(nodeStyle.marginBottom)
|
|
1391
|
+
};
|
|
1392
|
+
}
|
|
1393
|
+
if ((0, _shims.isNum)(bounds.right))
|
|
1394
|
+
x = Math.min(x, bounds.right);
|
|
1395
|
+
if ((0, _shims.isNum)(bounds.bottom))
|
|
1396
|
+
y = Math.min(y, bounds.bottom);
|
|
1397
|
+
if ((0, _shims.isNum)(bounds.left))
|
|
1398
|
+
x = Math.max(x, bounds.left);
|
|
1399
|
+
if ((0, _shims.isNum)(bounds.top))
|
|
1400
|
+
y = Math.max(y, bounds.top);
|
|
1401
|
+
return [x, y];
|
|
1402
|
+
}
|
|
1403
|
+
function snapToGrid(grid, pendingX, pendingY) {
|
|
1404
|
+
const x = Math.round(pendingX / grid[0]) * grid[0];
|
|
1405
|
+
const y = Math.round(pendingY / grid[1]) * grid[1];
|
|
1406
|
+
return [x, y];
|
|
1407
|
+
}
|
|
1408
|
+
function canDragX(draggable) {
|
|
1409
|
+
return draggable.props.axis === "both" || draggable.props.axis === "x";
|
|
1410
|
+
}
|
|
1411
|
+
function canDragY(draggable) {
|
|
1412
|
+
return draggable.props.axis === "both" || draggable.props.axis === "y";
|
|
1413
|
+
}
|
|
1414
|
+
function getControlPosition(e, touchIdentifier, draggableCore) {
|
|
1415
|
+
const touchObj = typeof touchIdentifier === "number" ? (0, _domFns.getTouch)(e, touchIdentifier) : null;
|
|
1416
|
+
if (typeof touchIdentifier === "number" && !touchObj)
|
|
1417
|
+
return null;
|
|
1418
|
+
const node = findDOMNode(draggableCore);
|
|
1419
|
+
const offsetParent = draggableCore.props.offsetParent || node.offsetParent || node.ownerDocument.body;
|
|
1420
|
+
return (0, _domFns.offsetXYFromParent)(touchObj || e, offsetParent, draggableCore.props.scale);
|
|
1421
|
+
}
|
|
1422
|
+
function createCoreData(draggable, x, y) {
|
|
1423
|
+
const isStart = !(0, _shims.isNum)(draggable.lastX);
|
|
1424
|
+
const node = findDOMNode(draggable);
|
|
1425
|
+
if (isStart) {
|
|
1426
|
+
return {
|
|
1427
|
+
node,
|
|
1428
|
+
deltaX: 0,
|
|
1429
|
+
deltaY: 0,
|
|
1430
|
+
lastX: x,
|
|
1431
|
+
lastY: y,
|
|
1432
|
+
x,
|
|
1433
|
+
y
|
|
1434
|
+
};
|
|
1435
|
+
} else {
|
|
1436
|
+
return {
|
|
1437
|
+
node,
|
|
1438
|
+
deltaX: x - draggable.lastX,
|
|
1439
|
+
deltaY: y - draggable.lastY,
|
|
1440
|
+
lastX: draggable.lastX,
|
|
1441
|
+
lastY: draggable.lastY,
|
|
1442
|
+
x,
|
|
1443
|
+
y
|
|
1444
|
+
};
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
function createDraggableData(draggable, coreData) {
|
|
1448
|
+
const scale = draggable.props.scale;
|
|
1449
|
+
return {
|
|
1450
|
+
node: coreData.node,
|
|
1451
|
+
x: draggable.state.x + coreData.deltaX / scale,
|
|
1452
|
+
y: draggable.state.y + coreData.deltaY / scale,
|
|
1453
|
+
deltaX: coreData.deltaX / scale,
|
|
1454
|
+
deltaY: coreData.deltaY / scale,
|
|
1455
|
+
lastX: draggable.state.x,
|
|
1456
|
+
lastY: draggable.state.y
|
|
1457
|
+
};
|
|
1458
|
+
}
|
|
1459
|
+
function cloneBounds(bounds) {
|
|
1460
|
+
return {
|
|
1461
|
+
left: bounds.left,
|
|
1462
|
+
top: bounds.top,
|
|
1463
|
+
right: bounds.right,
|
|
1464
|
+
bottom: bounds.bottom
|
|
1465
|
+
};
|
|
1466
|
+
}
|
|
1467
|
+
function findDOMNode(draggable) {
|
|
1468
|
+
const node = draggable.findDOMNode();
|
|
1469
|
+
if (!node) {
|
|
1470
|
+
throw new Error("<DraggableCore>: Unmounted during event!");
|
|
1471
|
+
}
|
|
1472
|
+
return node;
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
});
|
|
1476
|
+
|
|
1477
|
+
// node_modules/react-draggable/build/cjs/utils/log.js
|
|
1478
|
+
var require_log = __commonJS({
|
|
1479
|
+
"node_modules/react-draggable/build/cjs/utils/log.js"(exports2) {
|
|
1480
|
+
"use strict";
|
|
1481
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
1482
|
+
value: true
|
|
1483
|
+
});
|
|
1484
|
+
exports2.default = log;
|
|
1485
|
+
function log() {
|
|
1486
|
+
if (void 0)
|
|
1487
|
+
console.log(...arguments);
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
});
|
|
1491
|
+
|
|
1492
|
+
// node_modules/react-draggable/build/cjs/DraggableCore.js
|
|
1493
|
+
var require_DraggableCore = __commonJS({
|
|
1494
|
+
"node_modules/react-draggable/build/cjs/DraggableCore.js"(exports2) {
|
|
1495
|
+
"use strict";
|
|
1496
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
1497
|
+
value: true
|
|
1498
|
+
});
|
|
1499
|
+
exports2.default = void 0;
|
|
1500
|
+
var React = _interopRequireWildcard(require("react"));
|
|
1501
|
+
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
1502
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
1503
|
+
var _domFns = require_domFns();
|
|
1504
|
+
var _positionFns = require_positionFns();
|
|
1505
|
+
var _shims = require_shims();
|
|
1506
|
+
var _log = _interopRequireDefault(require_log());
|
|
1507
|
+
function _interopRequireDefault(obj) {
|
|
1508
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
1509
|
+
}
|
|
1510
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
1511
|
+
if (typeof WeakMap !== "function")
|
|
1512
|
+
return null;
|
|
1513
|
+
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
|
|
1514
|
+
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
|
|
1515
|
+
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
1516
|
+
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
1517
|
+
})(nodeInterop);
|
|
1518
|
+
}
|
|
1519
|
+
function _interopRequireWildcard(obj, nodeInterop) {
|
|
1520
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
1521
|
+
return obj;
|
|
1522
|
+
}
|
|
1523
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
1524
|
+
return { default: obj };
|
|
1525
|
+
}
|
|
1526
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
1527
|
+
if (cache && cache.has(obj)) {
|
|
1528
|
+
return cache.get(obj);
|
|
1529
|
+
}
|
|
1530
|
+
var newObj = {};
|
|
1531
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
1532
|
+
for (var key in obj) {
|
|
1533
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
1534
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
1535
|
+
if (desc && (desc.get || desc.set)) {
|
|
1536
|
+
Object.defineProperty(newObj, key, desc);
|
|
1537
|
+
} else {
|
|
1538
|
+
newObj[key] = obj[key];
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
newObj.default = obj;
|
|
1543
|
+
if (cache) {
|
|
1544
|
+
cache.set(obj, newObj);
|
|
1545
|
+
}
|
|
1546
|
+
return newObj;
|
|
1547
|
+
}
|
|
1548
|
+
function _defineProperty(obj, key, value) {
|
|
1549
|
+
key = _toPropertyKey(key);
|
|
1550
|
+
if (key in obj) {
|
|
1551
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
1552
|
+
} else {
|
|
1553
|
+
obj[key] = value;
|
|
1554
|
+
}
|
|
1555
|
+
return obj;
|
|
1556
|
+
}
|
|
1557
|
+
function _toPropertyKey(arg) {
|
|
1558
|
+
var key = _toPrimitive(arg, "string");
|
|
1559
|
+
return typeof key === "symbol" ? key : String(key);
|
|
1560
|
+
}
|
|
1561
|
+
function _toPrimitive(input, hint) {
|
|
1562
|
+
if (typeof input !== "object" || input === null)
|
|
1563
|
+
return input;
|
|
1564
|
+
var prim = input[Symbol.toPrimitive];
|
|
1565
|
+
if (prim !== void 0) {
|
|
1566
|
+
var res = prim.call(input, hint || "default");
|
|
1567
|
+
if (typeof res !== "object")
|
|
1568
|
+
return res;
|
|
1569
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1570
|
+
}
|
|
1571
|
+
return (hint === "string" ? String : Number)(input);
|
|
1572
|
+
}
|
|
1573
|
+
var eventsFor = {
|
|
1574
|
+
touch: {
|
|
1575
|
+
start: "touchstart",
|
|
1576
|
+
move: "touchmove",
|
|
1577
|
+
stop: "touchend"
|
|
1578
|
+
},
|
|
1579
|
+
mouse: {
|
|
1580
|
+
start: "mousedown",
|
|
1581
|
+
move: "mousemove",
|
|
1582
|
+
stop: "mouseup"
|
|
1583
|
+
}
|
|
1584
|
+
};
|
|
1585
|
+
var dragEventFor = eventsFor.mouse;
|
|
1586
|
+
var DraggableCore = class extends React.Component {
|
|
1587
|
+
constructor() {
|
|
1588
|
+
super(...arguments);
|
|
1589
|
+
_defineProperty(this, "dragging", false);
|
|
1590
|
+
_defineProperty(this, "lastX", NaN);
|
|
1591
|
+
_defineProperty(this, "lastY", NaN);
|
|
1592
|
+
_defineProperty(this, "touchIdentifier", null);
|
|
1593
|
+
_defineProperty(this, "mounted", false);
|
|
1594
|
+
_defineProperty(this, "handleDragStart", (e) => {
|
|
1595
|
+
this.props.onMouseDown(e);
|
|
1596
|
+
if (!this.props.allowAnyClick && typeof e.button === "number" && e.button !== 0)
|
|
1597
|
+
return false;
|
|
1598
|
+
const thisNode = this.findDOMNode();
|
|
1599
|
+
if (!thisNode || !thisNode.ownerDocument || !thisNode.ownerDocument.body) {
|
|
1600
|
+
throw new Error("<DraggableCore> not mounted on DragStart!");
|
|
1601
|
+
}
|
|
1602
|
+
const {
|
|
1603
|
+
ownerDocument
|
|
1604
|
+
} = thisNode;
|
|
1605
|
+
if (this.props.disabled || !(e.target instanceof ownerDocument.defaultView.Node) || this.props.handle && !(0, _domFns.matchesSelectorAndParentsTo)(e.target, this.props.handle, thisNode) || this.props.cancel && (0, _domFns.matchesSelectorAndParentsTo)(e.target, this.props.cancel, thisNode)) {
|
|
1606
|
+
return;
|
|
1607
|
+
}
|
|
1608
|
+
if (e.type === "touchstart")
|
|
1609
|
+
e.preventDefault();
|
|
1610
|
+
const touchIdentifier = (0, _domFns.getTouchIdentifier)(e);
|
|
1611
|
+
this.touchIdentifier = touchIdentifier;
|
|
1612
|
+
const position = (0, _positionFns.getControlPosition)(e, touchIdentifier, this);
|
|
1613
|
+
if (position == null)
|
|
1614
|
+
return;
|
|
1615
|
+
const {
|
|
1616
|
+
x,
|
|
1617
|
+
y
|
|
1618
|
+
} = position;
|
|
1619
|
+
const coreEvent = (0, _positionFns.createCoreData)(this, x, y);
|
|
1620
|
+
(0, _log.default)("DraggableCore: handleDragStart: %j", coreEvent);
|
|
1621
|
+
(0, _log.default)("calling", this.props.onStart);
|
|
1622
|
+
const shouldUpdate = this.props.onStart(e, coreEvent);
|
|
1623
|
+
if (shouldUpdate === false || this.mounted === false)
|
|
1624
|
+
return;
|
|
1625
|
+
if (this.props.enableUserSelectHack)
|
|
1626
|
+
(0, _domFns.addUserSelectStyles)(ownerDocument);
|
|
1627
|
+
this.dragging = true;
|
|
1628
|
+
this.lastX = x;
|
|
1629
|
+
this.lastY = y;
|
|
1630
|
+
(0, _domFns.addEvent)(ownerDocument, dragEventFor.move, this.handleDrag);
|
|
1631
|
+
(0, _domFns.addEvent)(ownerDocument, dragEventFor.stop, this.handleDragStop);
|
|
1632
|
+
});
|
|
1633
|
+
_defineProperty(this, "handleDrag", (e) => {
|
|
1634
|
+
const position = (0, _positionFns.getControlPosition)(e, this.touchIdentifier, this);
|
|
1635
|
+
if (position == null)
|
|
1636
|
+
return;
|
|
1637
|
+
let {
|
|
1638
|
+
x,
|
|
1639
|
+
y
|
|
1640
|
+
} = position;
|
|
1641
|
+
if (Array.isArray(this.props.grid)) {
|
|
1642
|
+
let deltaX = x - this.lastX, deltaY = y - this.lastY;
|
|
1643
|
+
[deltaX, deltaY] = (0, _positionFns.snapToGrid)(this.props.grid, deltaX, deltaY);
|
|
1644
|
+
if (!deltaX && !deltaY)
|
|
1645
|
+
return;
|
|
1646
|
+
x = this.lastX + deltaX, y = this.lastY + deltaY;
|
|
1647
|
+
}
|
|
1648
|
+
const coreEvent = (0, _positionFns.createCoreData)(this, x, y);
|
|
1649
|
+
(0, _log.default)("DraggableCore: handleDrag: %j", coreEvent);
|
|
1650
|
+
const shouldUpdate = this.props.onDrag(e, coreEvent);
|
|
1651
|
+
if (shouldUpdate === false || this.mounted === false) {
|
|
1652
|
+
try {
|
|
1653
|
+
this.handleDragStop(new MouseEvent("mouseup"));
|
|
1654
|
+
} catch (err) {
|
|
1655
|
+
const event = document.createEvent("MouseEvents");
|
|
1656
|
+
event.initMouseEvent("mouseup", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
|
1657
|
+
this.handleDragStop(event);
|
|
1658
|
+
}
|
|
1659
|
+
return;
|
|
1660
|
+
}
|
|
1661
|
+
this.lastX = x;
|
|
1662
|
+
this.lastY = y;
|
|
1663
|
+
});
|
|
1664
|
+
_defineProperty(this, "handleDragStop", (e) => {
|
|
1665
|
+
if (!this.dragging)
|
|
1666
|
+
return;
|
|
1667
|
+
const position = (0, _positionFns.getControlPosition)(e, this.touchIdentifier, this);
|
|
1668
|
+
if (position == null)
|
|
1669
|
+
return;
|
|
1670
|
+
let {
|
|
1671
|
+
x,
|
|
1672
|
+
y
|
|
1673
|
+
} = position;
|
|
1674
|
+
if (Array.isArray(this.props.grid)) {
|
|
1675
|
+
let deltaX = x - this.lastX || 0;
|
|
1676
|
+
let deltaY = y - this.lastY || 0;
|
|
1677
|
+
[deltaX, deltaY] = (0, _positionFns.snapToGrid)(this.props.grid, deltaX, deltaY);
|
|
1678
|
+
x = this.lastX + deltaX, y = this.lastY + deltaY;
|
|
1679
|
+
}
|
|
1680
|
+
const coreEvent = (0, _positionFns.createCoreData)(this, x, y);
|
|
1681
|
+
const shouldContinue = this.props.onStop(e, coreEvent);
|
|
1682
|
+
if (shouldContinue === false || this.mounted === false)
|
|
1683
|
+
return false;
|
|
1684
|
+
const thisNode = this.findDOMNode();
|
|
1685
|
+
if (thisNode) {
|
|
1686
|
+
if (this.props.enableUserSelectHack)
|
|
1687
|
+
(0, _domFns.removeUserSelectStyles)(thisNode.ownerDocument);
|
|
1688
|
+
}
|
|
1689
|
+
(0, _log.default)("DraggableCore: handleDragStop: %j", coreEvent);
|
|
1690
|
+
this.dragging = false;
|
|
1691
|
+
this.lastX = NaN;
|
|
1692
|
+
this.lastY = NaN;
|
|
1693
|
+
if (thisNode) {
|
|
1694
|
+
(0, _log.default)("DraggableCore: Removing handlers");
|
|
1695
|
+
(0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.move, this.handleDrag);
|
|
1696
|
+
(0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.stop, this.handleDragStop);
|
|
1697
|
+
}
|
|
1698
|
+
});
|
|
1699
|
+
_defineProperty(this, "onMouseDown", (e) => {
|
|
1700
|
+
dragEventFor = eventsFor.mouse;
|
|
1701
|
+
return this.handleDragStart(e);
|
|
1702
|
+
});
|
|
1703
|
+
_defineProperty(this, "onMouseUp", (e) => {
|
|
1704
|
+
dragEventFor = eventsFor.mouse;
|
|
1705
|
+
return this.handleDragStop(e);
|
|
1706
|
+
});
|
|
1707
|
+
_defineProperty(this, "onTouchStart", (e) => {
|
|
1708
|
+
dragEventFor = eventsFor.touch;
|
|
1709
|
+
return this.handleDragStart(e);
|
|
1710
|
+
});
|
|
1711
|
+
_defineProperty(this, "onTouchEnd", (e) => {
|
|
1712
|
+
dragEventFor = eventsFor.touch;
|
|
1713
|
+
return this.handleDragStop(e);
|
|
1714
|
+
});
|
|
1715
|
+
}
|
|
1716
|
+
componentDidMount() {
|
|
1717
|
+
this.mounted = true;
|
|
1718
|
+
const thisNode = this.findDOMNode();
|
|
1719
|
+
if (thisNode) {
|
|
1720
|
+
(0, _domFns.addEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, {
|
|
1721
|
+
passive: false
|
|
1722
|
+
});
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
componentWillUnmount() {
|
|
1726
|
+
this.mounted = false;
|
|
1727
|
+
const thisNode = this.findDOMNode();
|
|
1728
|
+
if (thisNode) {
|
|
1729
|
+
const {
|
|
1730
|
+
ownerDocument
|
|
1731
|
+
} = thisNode;
|
|
1732
|
+
(0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.move, this.handleDrag);
|
|
1733
|
+
(0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.move, this.handleDrag);
|
|
1734
|
+
(0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.stop, this.handleDragStop);
|
|
1735
|
+
(0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.stop, this.handleDragStop);
|
|
1736
|
+
(0, _domFns.removeEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, {
|
|
1737
|
+
passive: false
|
|
1738
|
+
});
|
|
1739
|
+
if (this.props.enableUserSelectHack)
|
|
1740
|
+
(0, _domFns.removeUserSelectStyles)(ownerDocument);
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
// React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
|
|
1744
|
+
// the underlying DOM node ourselves. See the README for more information.
|
|
1745
|
+
findDOMNode() {
|
|
1746
|
+
var _this$props, _this$props2;
|
|
1747
|
+
return (_this$props = this.props) !== null && _this$props !== void 0 && _this$props.nodeRef ? (_this$props2 = this.props) === null || _this$props2 === void 0 || (_this$props2 = _this$props2.nodeRef) === null || _this$props2 === void 0 ? void 0 : _this$props2.current : _reactDom.default.findDOMNode(this);
|
|
1748
|
+
}
|
|
1749
|
+
render() {
|
|
1750
|
+
return /* @__PURE__ */ React.cloneElement(React.Children.only(this.props.children), {
|
|
1751
|
+
// Note: mouseMove handler is attached to document so it will still function
|
|
1752
|
+
// when the user drags quickly and leaves the bounds of the element.
|
|
1753
|
+
onMouseDown: this.onMouseDown,
|
|
1754
|
+
onMouseUp: this.onMouseUp,
|
|
1755
|
+
// onTouchStart is added on `componentDidMount` so they can be added with
|
|
1756
|
+
// {passive: false}, which allows it to cancel. See
|
|
1757
|
+
// https://developers.google.com/web/updates/2017/01/scrolling-intervention
|
|
1758
|
+
onTouchEnd: this.onTouchEnd
|
|
1759
|
+
});
|
|
1760
|
+
}
|
|
1761
|
+
};
|
|
1762
|
+
exports2.default = DraggableCore;
|
|
1763
|
+
_defineProperty(DraggableCore, "displayName", "DraggableCore");
|
|
1764
|
+
_defineProperty(DraggableCore, "propTypes", {
|
|
1765
|
+
/**
|
|
1766
|
+
* `allowAnyClick` allows dragging using any mouse button.
|
|
1767
|
+
* By default, we only accept the left button.
|
|
1768
|
+
*
|
|
1769
|
+
* Defaults to `false`.
|
|
1770
|
+
*/
|
|
1771
|
+
allowAnyClick: _propTypes.default.bool,
|
|
1772
|
+
children: _propTypes.default.node.isRequired,
|
|
1773
|
+
/**
|
|
1774
|
+
* `disabled`, if true, stops the <Draggable> from dragging. All handlers,
|
|
1775
|
+
* with the exception of `onMouseDown`, will not fire.
|
|
1776
|
+
*/
|
|
1777
|
+
disabled: _propTypes.default.bool,
|
|
1778
|
+
/**
|
|
1779
|
+
* By default, we add 'user-select:none' attributes to the document body
|
|
1780
|
+
* to prevent ugly text selection during drag. If this is causing problems
|
|
1781
|
+
* for your app, set this to `false`.
|
|
1782
|
+
*/
|
|
1783
|
+
enableUserSelectHack: _propTypes.default.bool,
|
|
1784
|
+
/**
|
|
1785
|
+
* `offsetParent`, if set, uses the passed DOM node to compute drag offsets
|
|
1786
|
+
* instead of using the parent node.
|
|
1787
|
+
*/
|
|
1788
|
+
offsetParent: function(props, propName) {
|
|
1789
|
+
if (props[propName] && props[propName].nodeType !== 1) {
|
|
1790
|
+
throw new Error("Draggable's offsetParent must be a DOM Node.");
|
|
1791
|
+
}
|
|
1792
|
+
},
|
|
1793
|
+
/**
|
|
1794
|
+
* `grid` specifies the x and y that dragging should snap to.
|
|
1795
|
+
*/
|
|
1796
|
+
grid: _propTypes.default.arrayOf(_propTypes.default.number),
|
|
1797
|
+
/**
|
|
1798
|
+
* `handle` specifies a selector to be used as the handle that initiates drag.
|
|
1799
|
+
*
|
|
1800
|
+
* Example:
|
|
1801
|
+
*
|
|
1802
|
+
* ```jsx
|
|
1803
|
+
* let App = React.createClass({
|
|
1804
|
+
* render: function () {
|
|
1805
|
+
* return (
|
|
1806
|
+
* <Draggable handle=".handle">
|
|
1807
|
+
* <div>
|
|
1808
|
+
* <div className="handle">Click me to drag</div>
|
|
1809
|
+
* <div>This is some other content</div>
|
|
1810
|
+
* </div>
|
|
1811
|
+
* </Draggable>
|
|
1812
|
+
* );
|
|
1813
|
+
* }
|
|
1814
|
+
* });
|
|
1815
|
+
* ```
|
|
1816
|
+
*/
|
|
1817
|
+
handle: _propTypes.default.string,
|
|
1818
|
+
/**
|
|
1819
|
+
* `cancel` specifies a selector to be used to prevent drag initialization.
|
|
1820
|
+
*
|
|
1821
|
+
* Example:
|
|
1822
|
+
*
|
|
1823
|
+
* ```jsx
|
|
1824
|
+
* let App = React.createClass({
|
|
1825
|
+
* render: function () {
|
|
1826
|
+
* return(
|
|
1827
|
+
* <Draggable cancel=".cancel">
|
|
1828
|
+
* <div>
|
|
1829
|
+
* <div className="cancel">You can't drag from here</div>
|
|
1830
|
+
* <div>Dragging here works fine</div>
|
|
1831
|
+
* </div>
|
|
1832
|
+
* </Draggable>
|
|
1833
|
+
* );
|
|
1834
|
+
* }
|
|
1835
|
+
* });
|
|
1836
|
+
* ```
|
|
1837
|
+
*/
|
|
1838
|
+
cancel: _propTypes.default.string,
|
|
1839
|
+
/* If running in React Strict mode, ReactDOM.findDOMNode() is deprecated.
|
|
1840
|
+
* Unfortunately, in order for <Draggable> to work properly, we need raw access
|
|
1841
|
+
* to the underlying DOM node. If you want to avoid the warning, pass a `nodeRef`
|
|
1842
|
+
* as in this example:
|
|
1843
|
+
*
|
|
1844
|
+
* function MyComponent() {
|
|
1845
|
+
* const nodeRef = React.useRef(null);
|
|
1846
|
+
* return (
|
|
1847
|
+
* <Draggable nodeRef={nodeRef}>
|
|
1848
|
+
* <div ref={nodeRef}>Example Target</div>
|
|
1849
|
+
* </Draggable>
|
|
1850
|
+
* );
|
|
1851
|
+
* }
|
|
1852
|
+
*
|
|
1853
|
+
* This can be used for arbitrarily nested components, so long as the ref ends up
|
|
1854
|
+
* pointing to the actual child DOM node and not a custom component.
|
|
1855
|
+
*/
|
|
1856
|
+
nodeRef: _propTypes.default.object,
|
|
1857
|
+
/**
|
|
1858
|
+
* Called when dragging starts.
|
|
1859
|
+
* If this function returns the boolean false, dragging will be canceled.
|
|
1860
|
+
*/
|
|
1861
|
+
onStart: _propTypes.default.func,
|
|
1862
|
+
/**
|
|
1863
|
+
* Called while dragging.
|
|
1864
|
+
* If this function returns the boolean false, dragging will be canceled.
|
|
1865
|
+
*/
|
|
1866
|
+
onDrag: _propTypes.default.func,
|
|
1867
|
+
/**
|
|
1868
|
+
* Called when dragging stops.
|
|
1869
|
+
* If this function returns the boolean false, the drag will remain active.
|
|
1870
|
+
*/
|
|
1871
|
+
onStop: _propTypes.default.func,
|
|
1872
|
+
/**
|
|
1873
|
+
* A workaround option which can be passed if onMouseDown needs to be accessed,
|
|
1874
|
+
* since it'll always be blocked (as there is internal use of onMouseDown)
|
|
1875
|
+
*/
|
|
1876
|
+
onMouseDown: _propTypes.default.func,
|
|
1877
|
+
/**
|
|
1878
|
+
* `scale`, if set, applies scaling while dragging an element
|
|
1879
|
+
*/
|
|
1880
|
+
scale: _propTypes.default.number,
|
|
1881
|
+
/**
|
|
1882
|
+
* These properties should be defined on the child, not here.
|
|
1883
|
+
*/
|
|
1884
|
+
className: _shims.dontSetMe,
|
|
1885
|
+
style: _shims.dontSetMe,
|
|
1886
|
+
transform: _shims.dontSetMe
|
|
1887
|
+
});
|
|
1888
|
+
_defineProperty(DraggableCore, "defaultProps", {
|
|
1889
|
+
allowAnyClick: false,
|
|
1890
|
+
// by default only accept left click
|
|
1891
|
+
disabled: false,
|
|
1892
|
+
enableUserSelectHack: true,
|
|
1893
|
+
onStart: function() {
|
|
1894
|
+
},
|
|
1895
|
+
onDrag: function() {
|
|
1896
|
+
},
|
|
1897
|
+
onStop: function() {
|
|
1898
|
+
},
|
|
1899
|
+
onMouseDown: function() {
|
|
1900
|
+
},
|
|
1901
|
+
scale: 1
|
|
1902
|
+
});
|
|
1903
|
+
}
|
|
1904
|
+
});
|
|
1905
|
+
|
|
1906
|
+
// node_modules/react-draggable/build/cjs/Draggable.js
|
|
1907
|
+
var require_Draggable = __commonJS({
|
|
1908
|
+
"node_modules/react-draggable/build/cjs/Draggable.js"(exports2) {
|
|
1909
|
+
"use strict";
|
|
1910
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
1911
|
+
value: true
|
|
1912
|
+
});
|
|
1913
|
+
Object.defineProperty(exports2, "DraggableCore", {
|
|
1914
|
+
enumerable: true,
|
|
1915
|
+
get: function() {
|
|
1916
|
+
return _DraggableCore.default;
|
|
1917
|
+
}
|
|
1918
|
+
});
|
|
1919
|
+
exports2.default = void 0;
|
|
1920
|
+
var React = _interopRequireWildcard(require("react"));
|
|
1921
|
+
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
1922
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
1923
|
+
var _clsx = _interopRequireDefault((init_clsx_m(), __toCommonJS(clsx_m_exports)));
|
|
1924
|
+
var _domFns = require_domFns();
|
|
1925
|
+
var _positionFns = require_positionFns();
|
|
1926
|
+
var _shims = require_shims();
|
|
1927
|
+
var _DraggableCore = _interopRequireDefault(require_DraggableCore());
|
|
1928
|
+
var _log = _interopRequireDefault(require_log());
|
|
1929
|
+
function _interopRequireDefault(obj) {
|
|
1930
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
1931
|
+
}
|
|
1932
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
1933
|
+
if (typeof WeakMap !== "function")
|
|
1934
|
+
return null;
|
|
1935
|
+
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
|
|
1936
|
+
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
|
|
1937
|
+
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
1938
|
+
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
1939
|
+
})(nodeInterop);
|
|
1940
|
+
}
|
|
1941
|
+
function _interopRequireWildcard(obj, nodeInterop) {
|
|
1942
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
1943
|
+
return obj;
|
|
1944
|
+
}
|
|
1945
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
1946
|
+
return { default: obj };
|
|
1947
|
+
}
|
|
1948
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
1949
|
+
if (cache && cache.has(obj)) {
|
|
1950
|
+
return cache.get(obj);
|
|
1951
|
+
}
|
|
1952
|
+
var newObj = {};
|
|
1953
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
1954
|
+
for (var key in obj) {
|
|
1955
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
1956
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
1957
|
+
if (desc && (desc.get || desc.set)) {
|
|
1958
|
+
Object.defineProperty(newObj, key, desc);
|
|
1959
|
+
} else {
|
|
1960
|
+
newObj[key] = obj[key];
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
newObj.default = obj;
|
|
1965
|
+
if (cache) {
|
|
1966
|
+
cache.set(obj, newObj);
|
|
1967
|
+
}
|
|
1968
|
+
return newObj;
|
|
1969
|
+
}
|
|
1970
|
+
function _extends() {
|
|
1971
|
+
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
1972
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1973
|
+
var source = arguments[i];
|
|
1974
|
+
for (var key in source) {
|
|
1975
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1976
|
+
target[key] = source[key];
|
|
1977
|
+
}
|
|
1978
|
+
}
|
|
1979
|
+
}
|
|
1980
|
+
return target;
|
|
1981
|
+
};
|
|
1982
|
+
return _extends.apply(this, arguments);
|
|
1983
|
+
}
|
|
1984
|
+
function _defineProperty(obj, key, value) {
|
|
1985
|
+
key = _toPropertyKey(key);
|
|
1986
|
+
if (key in obj) {
|
|
1987
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
1988
|
+
} else {
|
|
1989
|
+
obj[key] = value;
|
|
1990
|
+
}
|
|
1991
|
+
return obj;
|
|
1992
|
+
}
|
|
1993
|
+
function _toPropertyKey(arg) {
|
|
1994
|
+
var key = _toPrimitive(arg, "string");
|
|
1995
|
+
return typeof key === "symbol" ? key : String(key);
|
|
1996
|
+
}
|
|
1997
|
+
function _toPrimitive(input, hint) {
|
|
1998
|
+
if (typeof input !== "object" || input === null)
|
|
1999
|
+
return input;
|
|
2000
|
+
var prim = input[Symbol.toPrimitive];
|
|
2001
|
+
if (prim !== void 0) {
|
|
2002
|
+
var res = prim.call(input, hint || "default");
|
|
2003
|
+
if (typeof res !== "object")
|
|
2004
|
+
return res;
|
|
2005
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2006
|
+
}
|
|
2007
|
+
return (hint === "string" ? String : Number)(input);
|
|
2008
|
+
}
|
|
2009
|
+
var Draggable = class extends React.Component {
|
|
2010
|
+
// React 16.3+
|
|
2011
|
+
// Arity (props, state)
|
|
2012
|
+
static getDerivedStateFromProps(_ref, _ref2) {
|
|
2013
|
+
let {
|
|
2014
|
+
position
|
|
2015
|
+
} = _ref;
|
|
2016
|
+
let {
|
|
2017
|
+
prevPropsPosition
|
|
2018
|
+
} = _ref2;
|
|
2019
|
+
if (position && (!prevPropsPosition || position.x !== prevPropsPosition.x || position.y !== prevPropsPosition.y)) {
|
|
2020
|
+
(0, _log.default)("Draggable: getDerivedStateFromProps %j", {
|
|
2021
|
+
position,
|
|
2022
|
+
prevPropsPosition
|
|
2023
|
+
});
|
|
2024
|
+
return {
|
|
2025
|
+
x: position.x,
|
|
2026
|
+
y: position.y,
|
|
2027
|
+
prevPropsPosition: {
|
|
2028
|
+
...position
|
|
2029
|
+
}
|
|
2030
|
+
};
|
|
2031
|
+
}
|
|
2032
|
+
return null;
|
|
2033
|
+
}
|
|
2034
|
+
constructor(props) {
|
|
2035
|
+
super(props);
|
|
2036
|
+
_defineProperty(this, "onDragStart", (e, coreData) => {
|
|
2037
|
+
(0, _log.default)("Draggable: onDragStart: %j", coreData);
|
|
2038
|
+
const shouldStart = this.props.onStart(e, (0, _positionFns.createDraggableData)(this, coreData));
|
|
2039
|
+
if (shouldStart === false)
|
|
2040
|
+
return false;
|
|
2041
|
+
this.setState({
|
|
2042
|
+
dragging: true,
|
|
2043
|
+
dragged: true
|
|
2044
|
+
});
|
|
2045
|
+
});
|
|
2046
|
+
_defineProperty(this, "onDrag", (e, coreData) => {
|
|
2047
|
+
if (!this.state.dragging)
|
|
2048
|
+
return false;
|
|
2049
|
+
(0, _log.default)("Draggable: onDrag: %j", coreData);
|
|
2050
|
+
const uiData = (0, _positionFns.createDraggableData)(this, coreData);
|
|
2051
|
+
const newState = {
|
|
2052
|
+
x: uiData.x,
|
|
2053
|
+
y: uiData.y,
|
|
2054
|
+
slackX: 0,
|
|
2055
|
+
slackY: 0
|
|
2056
|
+
};
|
|
2057
|
+
if (this.props.bounds) {
|
|
2058
|
+
const {
|
|
2059
|
+
x,
|
|
2060
|
+
y
|
|
2061
|
+
} = newState;
|
|
2062
|
+
newState.x += this.state.slackX;
|
|
2063
|
+
newState.y += this.state.slackY;
|
|
2064
|
+
const [newStateX, newStateY] = (0, _positionFns.getBoundPosition)(this, newState.x, newState.y);
|
|
2065
|
+
newState.x = newStateX;
|
|
2066
|
+
newState.y = newStateY;
|
|
2067
|
+
newState.slackX = this.state.slackX + (x - newState.x);
|
|
2068
|
+
newState.slackY = this.state.slackY + (y - newState.y);
|
|
2069
|
+
uiData.x = newState.x;
|
|
2070
|
+
uiData.y = newState.y;
|
|
2071
|
+
uiData.deltaX = newState.x - this.state.x;
|
|
2072
|
+
uiData.deltaY = newState.y - this.state.y;
|
|
2073
|
+
}
|
|
2074
|
+
const shouldUpdate = this.props.onDrag(e, uiData);
|
|
2075
|
+
if (shouldUpdate === false)
|
|
2076
|
+
return false;
|
|
2077
|
+
this.setState(newState);
|
|
2078
|
+
});
|
|
2079
|
+
_defineProperty(this, "onDragStop", (e, coreData) => {
|
|
2080
|
+
if (!this.state.dragging)
|
|
2081
|
+
return false;
|
|
2082
|
+
const shouldContinue = this.props.onStop(e, (0, _positionFns.createDraggableData)(this, coreData));
|
|
2083
|
+
if (shouldContinue === false)
|
|
2084
|
+
return false;
|
|
2085
|
+
(0, _log.default)("Draggable: onDragStop: %j", coreData);
|
|
2086
|
+
const newState = {
|
|
2087
|
+
dragging: false,
|
|
2088
|
+
slackX: 0,
|
|
2089
|
+
slackY: 0
|
|
2090
|
+
};
|
|
2091
|
+
const controlled = Boolean(this.props.position);
|
|
2092
|
+
if (controlled) {
|
|
2093
|
+
const {
|
|
2094
|
+
x,
|
|
2095
|
+
y
|
|
2096
|
+
} = this.props.position;
|
|
2097
|
+
newState.x = x;
|
|
2098
|
+
newState.y = y;
|
|
2099
|
+
}
|
|
2100
|
+
this.setState(newState);
|
|
2101
|
+
});
|
|
2102
|
+
this.state = {
|
|
2103
|
+
// Whether or not we are currently dragging.
|
|
2104
|
+
dragging: false,
|
|
2105
|
+
// Whether or not we have been dragged before.
|
|
2106
|
+
dragged: false,
|
|
2107
|
+
// Current transform x and y.
|
|
2108
|
+
x: props.position ? props.position.x : props.defaultPosition.x,
|
|
2109
|
+
y: props.position ? props.position.y : props.defaultPosition.y,
|
|
2110
|
+
prevPropsPosition: {
|
|
2111
|
+
...props.position
|
|
2112
|
+
},
|
|
2113
|
+
// Used for compensating for out-of-bounds drags
|
|
2114
|
+
slackX: 0,
|
|
2115
|
+
slackY: 0,
|
|
2116
|
+
// Can only determine if SVG after mounting
|
|
2117
|
+
isElementSVG: false
|
|
2118
|
+
};
|
|
2119
|
+
if (props.position && !(props.onDrag || props.onStop)) {
|
|
2120
|
+
console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.");
|
|
2121
|
+
}
|
|
2122
|
+
}
|
|
2123
|
+
componentDidMount() {
|
|
2124
|
+
if (typeof window.SVGElement !== "undefined" && this.findDOMNode() instanceof window.SVGElement) {
|
|
2125
|
+
this.setState({
|
|
2126
|
+
isElementSVG: true
|
|
2127
|
+
});
|
|
2128
|
+
}
|
|
2129
|
+
}
|
|
2130
|
+
componentWillUnmount() {
|
|
2131
|
+
this.setState({
|
|
2132
|
+
dragging: false
|
|
2133
|
+
});
|
|
2134
|
+
}
|
|
2135
|
+
// React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
|
|
2136
|
+
// the underlying DOM node ourselves. See the README for more information.
|
|
2137
|
+
findDOMNode() {
|
|
2138
|
+
var _this$props$nodeRef$c, _this$props;
|
|
2139
|
+
return (_this$props$nodeRef$c = (_this$props = this.props) === null || _this$props === void 0 || (_this$props = _this$props.nodeRef) === null || _this$props === void 0 ? void 0 : _this$props.current) !== null && _this$props$nodeRef$c !== void 0 ? _this$props$nodeRef$c : _reactDom.default.findDOMNode(this);
|
|
2140
|
+
}
|
|
2141
|
+
render() {
|
|
2142
|
+
const {
|
|
2143
|
+
axis,
|
|
2144
|
+
bounds,
|
|
2145
|
+
children,
|
|
2146
|
+
defaultPosition,
|
|
2147
|
+
defaultClassName,
|
|
2148
|
+
defaultClassNameDragging,
|
|
2149
|
+
defaultClassNameDragged,
|
|
2150
|
+
position,
|
|
2151
|
+
positionOffset,
|
|
2152
|
+
scale,
|
|
2153
|
+
...draggableCoreProps
|
|
2154
|
+
} = this.props;
|
|
2155
|
+
let style = {};
|
|
2156
|
+
let svgTransform = null;
|
|
2157
|
+
const controlled = Boolean(position);
|
|
2158
|
+
const draggable = !controlled || this.state.dragging;
|
|
2159
|
+
const validPosition = position || defaultPosition;
|
|
2160
|
+
const transformOpts = {
|
|
2161
|
+
// Set left if horizontal drag is enabled
|
|
2162
|
+
x: (0, _positionFns.canDragX)(this) && draggable ? this.state.x : validPosition.x,
|
|
2163
|
+
// Set top if vertical drag is enabled
|
|
2164
|
+
y: (0, _positionFns.canDragY)(this) && draggable ? this.state.y : validPosition.y
|
|
2165
|
+
};
|
|
2166
|
+
if (this.state.isElementSVG) {
|
|
2167
|
+
svgTransform = (0, _domFns.createSVGTransform)(transformOpts, positionOffset);
|
|
2168
|
+
} else {
|
|
2169
|
+
style = (0, _domFns.createCSSTransform)(transformOpts, positionOffset);
|
|
2170
|
+
}
|
|
2171
|
+
const className = (0, _clsx.default)(children.props.className || "", defaultClassName, {
|
|
2172
|
+
[defaultClassNameDragging]: this.state.dragging,
|
|
2173
|
+
[defaultClassNameDragged]: this.state.dragged
|
|
2174
|
+
});
|
|
2175
|
+
return /* @__PURE__ */ React.createElement(_DraggableCore.default, _extends({}, draggableCoreProps, {
|
|
2176
|
+
onStart: this.onDragStart,
|
|
2177
|
+
onDrag: this.onDrag,
|
|
2178
|
+
onStop: this.onDragStop
|
|
2179
|
+
}), /* @__PURE__ */ React.cloneElement(React.Children.only(children), {
|
|
2180
|
+
className,
|
|
2181
|
+
style: {
|
|
2182
|
+
...children.props.style,
|
|
2183
|
+
...style
|
|
2184
|
+
},
|
|
2185
|
+
transform: svgTransform
|
|
2186
|
+
}));
|
|
2187
|
+
}
|
|
2188
|
+
};
|
|
2189
|
+
exports2.default = Draggable;
|
|
2190
|
+
_defineProperty(Draggable, "displayName", "Draggable");
|
|
2191
|
+
_defineProperty(Draggable, "propTypes", {
|
|
2192
|
+
// Accepts all props <DraggableCore> accepts.
|
|
2193
|
+
..._DraggableCore.default.propTypes,
|
|
2194
|
+
/**
|
|
2195
|
+
* `axis` determines which axis the draggable can move.
|
|
2196
|
+
*
|
|
2197
|
+
* Note that all callbacks will still return data as normal. This only
|
|
2198
|
+
* controls flushing to the DOM.
|
|
2199
|
+
*
|
|
2200
|
+
* 'both' allows movement horizontally and vertically.
|
|
2201
|
+
* 'x' limits movement to horizontal axis.
|
|
2202
|
+
* 'y' limits movement to vertical axis.
|
|
2203
|
+
* 'none' limits all movement.
|
|
2204
|
+
*
|
|
2205
|
+
* Defaults to 'both'.
|
|
2206
|
+
*/
|
|
2207
|
+
axis: _propTypes.default.oneOf(["both", "x", "y", "none"]),
|
|
2208
|
+
/**
|
|
2209
|
+
* `bounds` determines the range of movement available to the element.
|
|
2210
|
+
* Available values are:
|
|
2211
|
+
*
|
|
2212
|
+
* 'parent' restricts movement within the Draggable's parent node.
|
|
2213
|
+
*
|
|
2214
|
+
* Alternatively, pass an object with the following properties, all of which are optional:
|
|
2215
|
+
*
|
|
2216
|
+
* {left: LEFT_BOUND, right: RIGHT_BOUND, bottom: BOTTOM_BOUND, top: TOP_BOUND}
|
|
2217
|
+
*
|
|
2218
|
+
* All values are in px.
|
|
2219
|
+
*
|
|
2220
|
+
* Example:
|
|
2221
|
+
*
|
|
2222
|
+
* ```jsx
|
|
2223
|
+
* let App = React.createClass({
|
|
2224
|
+
* render: function () {
|
|
2225
|
+
* return (
|
|
2226
|
+
* <Draggable bounds={{right: 300, bottom: 300}}>
|
|
2227
|
+
* <div>Content</div>
|
|
2228
|
+
* </Draggable>
|
|
2229
|
+
* );
|
|
2230
|
+
* }
|
|
2231
|
+
* });
|
|
2232
|
+
* ```
|
|
2233
|
+
*/
|
|
2234
|
+
bounds: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
2235
|
+
left: _propTypes.default.number,
|
|
2236
|
+
right: _propTypes.default.number,
|
|
2237
|
+
top: _propTypes.default.number,
|
|
2238
|
+
bottom: _propTypes.default.number
|
|
2239
|
+
}), _propTypes.default.string, _propTypes.default.oneOf([false])]),
|
|
2240
|
+
defaultClassName: _propTypes.default.string,
|
|
2241
|
+
defaultClassNameDragging: _propTypes.default.string,
|
|
2242
|
+
defaultClassNameDragged: _propTypes.default.string,
|
|
2243
|
+
/**
|
|
2244
|
+
* `defaultPosition` specifies the x and y that the dragged item should start at
|
|
2245
|
+
*
|
|
2246
|
+
* Example:
|
|
2247
|
+
*
|
|
2248
|
+
* ```jsx
|
|
2249
|
+
* let App = React.createClass({
|
|
2250
|
+
* render: function () {
|
|
2251
|
+
* return (
|
|
2252
|
+
* <Draggable defaultPosition={{x: 25, y: 25}}>
|
|
2253
|
+
* <div>I start with transformX: 25px and transformY: 25px;</div>
|
|
2254
|
+
* </Draggable>
|
|
2255
|
+
* );
|
|
2256
|
+
* }
|
|
2257
|
+
* });
|
|
2258
|
+
* ```
|
|
2259
|
+
*/
|
|
2260
|
+
defaultPosition: _propTypes.default.shape({
|
|
2261
|
+
x: _propTypes.default.number,
|
|
2262
|
+
y: _propTypes.default.number
|
|
2263
|
+
}),
|
|
2264
|
+
positionOffset: _propTypes.default.shape({
|
|
2265
|
+
x: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
2266
|
+
y: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
|
|
2267
|
+
}),
|
|
2268
|
+
/**
|
|
2269
|
+
* `position`, if present, defines the current position of the element.
|
|
2270
|
+
*
|
|
2271
|
+
* This is similar to how form elements in React work - if no `position` is supplied, the component
|
|
2272
|
+
* is uncontrolled.
|
|
2273
|
+
*
|
|
2274
|
+
* Example:
|
|
2275
|
+
*
|
|
2276
|
+
* ```jsx
|
|
2277
|
+
* let App = React.createClass({
|
|
2278
|
+
* render: function () {
|
|
2279
|
+
* return (
|
|
2280
|
+
* <Draggable position={{x: 25, y: 25}}>
|
|
2281
|
+
* <div>I start with transformX: 25px and transformY: 25px;</div>
|
|
2282
|
+
* </Draggable>
|
|
2283
|
+
* );
|
|
2284
|
+
* }
|
|
2285
|
+
* });
|
|
2286
|
+
* ```
|
|
2287
|
+
*/
|
|
2288
|
+
position: _propTypes.default.shape({
|
|
2289
|
+
x: _propTypes.default.number,
|
|
2290
|
+
y: _propTypes.default.number
|
|
2291
|
+
}),
|
|
2292
|
+
/**
|
|
2293
|
+
* These properties should be defined on the child, not here.
|
|
2294
|
+
*/
|
|
2295
|
+
className: _shims.dontSetMe,
|
|
2296
|
+
style: _shims.dontSetMe,
|
|
2297
|
+
transform: _shims.dontSetMe
|
|
2298
|
+
});
|
|
2299
|
+
_defineProperty(Draggable, "defaultProps", {
|
|
2300
|
+
..._DraggableCore.default.defaultProps,
|
|
2301
|
+
axis: "both",
|
|
2302
|
+
bounds: false,
|
|
2303
|
+
defaultClassName: "react-draggable",
|
|
2304
|
+
defaultClassNameDragging: "react-draggable-dragging",
|
|
2305
|
+
defaultClassNameDragged: "react-draggable-dragged",
|
|
2306
|
+
defaultPosition: {
|
|
2307
|
+
x: 0,
|
|
2308
|
+
y: 0
|
|
2309
|
+
},
|
|
2310
|
+
scale: 1
|
|
2311
|
+
});
|
|
2312
|
+
}
|
|
2313
|
+
});
|
|
2314
|
+
|
|
2315
|
+
// node_modules/react-draggable/build/cjs/cjs.js
|
|
2316
|
+
var require_cjs = __commonJS({
|
|
2317
|
+
"node_modules/react-draggable/build/cjs/cjs.js"(exports2, module2) {
|
|
2318
|
+
"use strict";
|
|
2319
|
+
var {
|
|
2320
|
+
default: Draggable,
|
|
2321
|
+
DraggableCore
|
|
2322
|
+
} = require_Draggable();
|
|
2323
|
+
module2.exports = Draggable;
|
|
2324
|
+
module2.exports.default = Draggable;
|
|
2325
|
+
module2.exports.DraggableCore = DraggableCore;
|
|
2326
|
+
}
|
|
2327
|
+
});
|
|
2328
|
+
|
|
2329
|
+
// node_modules/react-resizable/build/utils.js
|
|
2330
|
+
var require_utils = __commonJS({
|
|
2331
|
+
"node_modules/react-resizable/build/utils.js"(exports2) {
|
|
2332
|
+
"use strict";
|
|
2333
|
+
exports2.__esModule = true;
|
|
2334
|
+
exports2.cloneElement = cloneElement;
|
|
2335
|
+
var _react = _interopRequireDefault(require("react"));
|
|
2336
|
+
function _interopRequireDefault(obj) {
|
|
2337
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
2338
|
+
}
|
|
2339
|
+
function ownKeys(object, enumerableOnly) {
|
|
2340
|
+
var keys = Object.keys(object);
|
|
2341
|
+
if (Object.getOwnPropertySymbols) {
|
|
2342
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
2343
|
+
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
2344
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
2345
|
+
})), keys.push.apply(keys, symbols);
|
|
2346
|
+
}
|
|
2347
|
+
return keys;
|
|
2348
|
+
}
|
|
2349
|
+
function _objectSpread(target) {
|
|
2350
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2351
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
2352
|
+
i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
|
|
2353
|
+
_defineProperty(target, key, source[key]);
|
|
2354
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
2355
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
2356
|
+
});
|
|
2357
|
+
}
|
|
2358
|
+
return target;
|
|
2359
|
+
}
|
|
2360
|
+
function _defineProperty(obj, key, value) {
|
|
2361
|
+
key = _toPropertyKey(key);
|
|
2362
|
+
if (key in obj) {
|
|
2363
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
2364
|
+
} else {
|
|
2365
|
+
obj[key] = value;
|
|
2366
|
+
}
|
|
2367
|
+
return obj;
|
|
2368
|
+
}
|
|
2369
|
+
function _toPropertyKey(arg) {
|
|
2370
|
+
var key = _toPrimitive(arg, "string");
|
|
2371
|
+
return typeof key === "symbol" ? key : String(key);
|
|
2372
|
+
}
|
|
2373
|
+
function _toPrimitive(input, hint) {
|
|
2374
|
+
if (typeof input !== "object" || input === null)
|
|
2375
|
+
return input;
|
|
2376
|
+
var prim = input[Symbol.toPrimitive];
|
|
2377
|
+
if (prim !== void 0) {
|
|
2378
|
+
var res = prim.call(input, hint || "default");
|
|
2379
|
+
if (typeof res !== "object")
|
|
2380
|
+
return res;
|
|
2381
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2382
|
+
}
|
|
2383
|
+
return (hint === "string" ? String : Number)(input);
|
|
2384
|
+
}
|
|
2385
|
+
function cloneElement(element, props) {
|
|
2386
|
+
if (props.style && element.props.style) {
|
|
2387
|
+
props.style = _objectSpread(_objectSpread({}, element.props.style), props.style);
|
|
2388
|
+
}
|
|
2389
|
+
if (props.className && element.props.className) {
|
|
2390
|
+
props.className = element.props.className + " " + props.className;
|
|
2391
|
+
}
|
|
2392
|
+
return /* @__PURE__ */ _react.default.cloneElement(element, props);
|
|
2393
|
+
}
|
|
2394
|
+
}
|
|
2395
|
+
});
|
|
2396
|
+
|
|
2397
|
+
// node_modules/react-resizable/build/propTypes.js
|
|
2398
|
+
var require_propTypes = __commonJS({
|
|
2399
|
+
"node_modules/react-resizable/build/propTypes.js"(exports2) {
|
|
2400
|
+
"use strict";
|
|
2401
|
+
exports2.__esModule = true;
|
|
2402
|
+
exports2.resizableProps = void 0;
|
|
2403
|
+
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
2404
|
+
var _reactDraggable = require_cjs();
|
|
2405
|
+
function _interopRequireDefault(obj) {
|
|
2406
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
2407
|
+
}
|
|
2408
|
+
var resizableProps = {
|
|
2409
|
+
/*
|
|
2410
|
+
* Restricts resizing to a particular axis (default: 'both')
|
|
2411
|
+
* 'both' - allows resizing by width or height
|
|
2412
|
+
* 'x' - only allows the width to be changed
|
|
2413
|
+
* 'y' - only allows the height to be changed
|
|
2414
|
+
* 'none' - disables resizing altogether
|
|
2415
|
+
* */
|
|
2416
|
+
axis: _propTypes.default.oneOf(["both", "x", "y", "none"]),
|
|
2417
|
+
className: _propTypes.default.string,
|
|
2418
|
+
/*
|
|
2419
|
+
* Require that one and only one child be present.
|
|
2420
|
+
* */
|
|
2421
|
+
children: _propTypes.default.element.isRequired,
|
|
2422
|
+
/*
|
|
2423
|
+
* These will be passed wholesale to react-draggable's DraggableCore
|
|
2424
|
+
* */
|
|
2425
|
+
draggableOpts: _propTypes.default.shape({
|
|
2426
|
+
allowAnyClick: _propTypes.default.bool,
|
|
2427
|
+
cancel: _propTypes.default.string,
|
|
2428
|
+
children: _propTypes.default.node,
|
|
2429
|
+
disabled: _propTypes.default.bool,
|
|
2430
|
+
enableUserSelectHack: _propTypes.default.bool,
|
|
2431
|
+
offsetParent: _propTypes.default.node,
|
|
2432
|
+
grid: _propTypes.default.arrayOf(_propTypes.default.number),
|
|
2433
|
+
handle: _propTypes.default.string,
|
|
2434
|
+
nodeRef: _propTypes.default.object,
|
|
2435
|
+
onStart: _propTypes.default.func,
|
|
2436
|
+
onDrag: _propTypes.default.func,
|
|
2437
|
+
onStop: _propTypes.default.func,
|
|
2438
|
+
onMouseDown: _propTypes.default.func,
|
|
2439
|
+
scale: _propTypes.default.number
|
|
2440
|
+
}),
|
|
2441
|
+
/*
|
|
2442
|
+
* Initial height
|
|
2443
|
+
* */
|
|
2444
|
+
height: function height() {
|
|
2445
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2446
|
+
args[_key] = arguments[_key];
|
|
2447
|
+
}
|
|
2448
|
+
var props = args[0];
|
|
2449
|
+
if (props.axis === "both" || props.axis === "y") {
|
|
2450
|
+
var _PropTypes$number;
|
|
2451
|
+
return (_PropTypes$number = _propTypes.default.number).isRequired.apply(_PropTypes$number, args);
|
|
2452
|
+
}
|
|
2453
|
+
return _propTypes.default.number.apply(_propTypes.default, args);
|
|
2454
|
+
},
|
|
2455
|
+
/*
|
|
2456
|
+
* Customize cursor resize handle
|
|
2457
|
+
* */
|
|
2458
|
+
handle: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
|
2459
|
+
/*
|
|
2460
|
+
* If you change this, be sure to update your css
|
|
2461
|
+
* */
|
|
2462
|
+
handleSize: _propTypes.default.arrayOf(_propTypes.default.number),
|
|
2463
|
+
lockAspectRatio: _propTypes.default.bool,
|
|
2464
|
+
/*
|
|
2465
|
+
* Max X & Y measure
|
|
2466
|
+
* */
|
|
2467
|
+
maxConstraints: _propTypes.default.arrayOf(_propTypes.default.number),
|
|
2468
|
+
/*
|
|
2469
|
+
* Min X & Y measure
|
|
2470
|
+
* */
|
|
2471
|
+
minConstraints: _propTypes.default.arrayOf(_propTypes.default.number),
|
|
2472
|
+
/*
|
|
2473
|
+
* Called on stop resize event
|
|
2474
|
+
* */
|
|
2475
|
+
onResizeStop: _propTypes.default.func,
|
|
2476
|
+
/*
|
|
2477
|
+
* Called on start resize event
|
|
2478
|
+
* */
|
|
2479
|
+
onResizeStart: _propTypes.default.func,
|
|
2480
|
+
/*
|
|
2481
|
+
* Called on resize event
|
|
2482
|
+
* */
|
|
2483
|
+
onResize: _propTypes.default.func,
|
|
2484
|
+
/*
|
|
2485
|
+
* Defines which resize handles should be rendered (default: 'se')
|
|
2486
|
+
* 's' - South handle (bottom-center)
|
|
2487
|
+
* 'w' - West handle (left-center)
|
|
2488
|
+
* 'e' - East handle (right-center)
|
|
2489
|
+
* 'n' - North handle (top-center)
|
|
2490
|
+
* 'sw' - Southwest handle (bottom-left)
|
|
2491
|
+
* 'nw' - Northwest handle (top-left)
|
|
2492
|
+
* 'se' - Southeast handle (bottom-right)
|
|
2493
|
+
* 'ne' - Northeast handle (top-center)
|
|
2494
|
+
* */
|
|
2495
|
+
resizeHandles: _propTypes.default.arrayOf(_propTypes.default.oneOf(["s", "w", "e", "n", "sw", "nw", "se", "ne"])),
|
|
2496
|
+
/*
|
|
2497
|
+
* If `transform: scale(n)` is set on the parent, this should be set to `n`.
|
|
2498
|
+
* */
|
|
2499
|
+
transformScale: _propTypes.default.number,
|
|
2500
|
+
/*
|
|
2501
|
+
* Initial width
|
|
2502
|
+
*/
|
|
2503
|
+
width: function width() {
|
|
2504
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
2505
|
+
args[_key2] = arguments[_key2];
|
|
2506
|
+
}
|
|
2507
|
+
var props = args[0];
|
|
2508
|
+
if (props.axis === "both" || props.axis === "x") {
|
|
2509
|
+
var _PropTypes$number2;
|
|
2510
|
+
return (_PropTypes$number2 = _propTypes.default.number).isRequired.apply(_PropTypes$number2, args);
|
|
2511
|
+
}
|
|
2512
|
+
return _propTypes.default.number.apply(_propTypes.default, args);
|
|
2513
|
+
}
|
|
2514
|
+
};
|
|
2515
|
+
exports2.resizableProps = resizableProps;
|
|
2516
|
+
}
|
|
2517
|
+
});
|
|
2518
|
+
|
|
2519
|
+
// node_modules/react-resizable/build/Resizable.js
|
|
2520
|
+
var require_Resizable = __commonJS({
|
|
2521
|
+
"node_modules/react-resizable/build/Resizable.js"(exports2) {
|
|
2522
|
+
"use strict";
|
|
2523
|
+
exports2.__esModule = true;
|
|
2524
|
+
exports2.default = void 0;
|
|
2525
|
+
var React = _interopRequireWildcard(require("react"));
|
|
2526
|
+
var _reactDraggable = require_cjs();
|
|
2527
|
+
var _utils = require_utils();
|
|
2528
|
+
var _propTypes = require_propTypes();
|
|
2529
|
+
var _excluded = ["children", "className", "draggableOpts", "width", "height", "handle", "handleSize", "lockAspectRatio", "axis", "minConstraints", "maxConstraints", "onResize", "onResizeStop", "onResizeStart", "resizeHandles", "transformScale"];
|
|
2530
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
2531
|
+
if (typeof WeakMap !== "function")
|
|
2532
|
+
return null;
|
|
2533
|
+
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
|
|
2534
|
+
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
|
|
2535
|
+
return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
|
|
2536
|
+
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
2537
|
+
})(nodeInterop);
|
|
2538
|
+
}
|
|
2539
|
+
function _interopRequireWildcard(obj, nodeInterop) {
|
|
2540
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
2541
|
+
return obj;
|
|
2542
|
+
}
|
|
2543
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
2544
|
+
return { default: obj };
|
|
2545
|
+
}
|
|
2546
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
2547
|
+
if (cache && cache.has(obj)) {
|
|
2548
|
+
return cache.get(obj);
|
|
2549
|
+
}
|
|
2550
|
+
var newObj = {};
|
|
2551
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
2552
|
+
for (var key in obj) {
|
|
2553
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
2554
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
2555
|
+
if (desc && (desc.get || desc.set)) {
|
|
2556
|
+
Object.defineProperty(newObj, key, desc);
|
|
2557
|
+
} else {
|
|
2558
|
+
newObj[key] = obj[key];
|
|
2559
|
+
}
|
|
2560
|
+
}
|
|
2561
|
+
}
|
|
2562
|
+
newObj.default = obj;
|
|
2563
|
+
if (cache) {
|
|
2564
|
+
cache.set(obj, newObj);
|
|
2565
|
+
}
|
|
2566
|
+
return newObj;
|
|
2567
|
+
}
|
|
2568
|
+
function _extends() {
|
|
2569
|
+
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
2570
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2571
|
+
var source = arguments[i];
|
|
2572
|
+
for (var key in source) {
|
|
2573
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2574
|
+
target[key] = source[key];
|
|
2575
|
+
}
|
|
2576
|
+
}
|
|
2577
|
+
}
|
|
2578
|
+
return target;
|
|
2579
|
+
};
|
|
2580
|
+
return _extends.apply(this, arguments);
|
|
2581
|
+
}
|
|
2582
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
2583
|
+
if (source == null)
|
|
2584
|
+
return {};
|
|
2585
|
+
var target = {};
|
|
2586
|
+
var sourceKeys = Object.keys(source);
|
|
2587
|
+
var key, i;
|
|
2588
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
2589
|
+
key = sourceKeys[i];
|
|
2590
|
+
if (excluded.indexOf(key) >= 0)
|
|
2591
|
+
continue;
|
|
2592
|
+
target[key] = source[key];
|
|
2593
|
+
}
|
|
2594
|
+
return target;
|
|
2595
|
+
}
|
|
2596
|
+
function ownKeys(object, enumerableOnly) {
|
|
2597
|
+
var keys = Object.keys(object);
|
|
2598
|
+
if (Object.getOwnPropertySymbols) {
|
|
2599
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
2600
|
+
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
2601
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
2602
|
+
})), keys.push.apply(keys, symbols);
|
|
2603
|
+
}
|
|
2604
|
+
return keys;
|
|
2605
|
+
}
|
|
2606
|
+
function _objectSpread(target) {
|
|
2607
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2608
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
2609
|
+
i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
|
|
2610
|
+
_defineProperty(target, key, source[key]);
|
|
2611
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
2612
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
2613
|
+
});
|
|
2614
|
+
}
|
|
2615
|
+
return target;
|
|
2616
|
+
}
|
|
2617
|
+
function _defineProperty(obj, key, value) {
|
|
2618
|
+
key = _toPropertyKey(key);
|
|
2619
|
+
if (key in obj) {
|
|
2620
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
2621
|
+
} else {
|
|
2622
|
+
obj[key] = value;
|
|
2623
|
+
}
|
|
2624
|
+
return obj;
|
|
2625
|
+
}
|
|
2626
|
+
function _toPropertyKey(arg) {
|
|
2627
|
+
var key = _toPrimitive(arg, "string");
|
|
2628
|
+
return typeof key === "symbol" ? key : String(key);
|
|
2629
|
+
}
|
|
2630
|
+
function _toPrimitive(input, hint) {
|
|
2631
|
+
if (typeof input !== "object" || input === null)
|
|
2632
|
+
return input;
|
|
2633
|
+
var prim = input[Symbol.toPrimitive];
|
|
2634
|
+
if (prim !== void 0) {
|
|
2635
|
+
var res = prim.call(input, hint || "default");
|
|
2636
|
+
if (typeof res !== "object")
|
|
2637
|
+
return res;
|
|
2638
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2639
|
+
}
|
|
2640
|
+
return (hint === "string" ? String : Number)(input);
|
|
2641
|
+
}
|
|
2642
|
+
function _inheritsLoose(subClass, superClass) {
|
|
2643
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
2644
|
+
subClass.prototype.constructor = subClass;
|
|
2645
|
+
_setPrototypeOf(subClass, superClass);
|
|
2646
|
+
}
|
|
2647
|
+
function _setPrototypeOf(o, p) {
|
|
2648
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
|
|
2649
|
+
o2.__proto__ = p2;
|
|
2650
|
+
return o2;
|
|
2651
|
+
};
|
|
2652
|
+
return _setPrototypeOf(o, p);
|
|
2653
|
+
}
|
|
2654
|
+
var Resizable2 = /* @__PURE__ */ function(_React$Component) {
|
|
2655
|
+
_inheritsLoose(Resizable3, _React$Component);
|
|
2656
|
+
function Resizable3() {
|
|
2657
|
+
var _this;
|
|
2658
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2659
|
+
args[_key] = arguments[_key];
|
|
2660
|
+
}
|
|
2661
|
+
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
2662
|
+
_this.handleRefs = {};
|
|
2663
|
+
_this.lastHandleRect = null;
|
|
2664
|
+
_this.slack = null;
|
|
2665
|
+
return _this;
|
|
2666
|
+
}
|
|
2667
|
+
var _proto = Resizable3.prototype;
|
|
2668
|
+
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
2669
|
+
this.resetData();
|
|
2670
|
+
};
|
|
2671
|
+
_proto.resetData = function resetData() {
|
|
2672
|
+
this.lastHandleRect = this.slack = null;
|
|
2673
|
+
};
|
|
2674
|
+
_proto.runConstraints = function runConstraints(width, height) {
|
|
2675
|
+
var _this$props = this.props, minConstraints = _this$props.minConstraints, maxConstraints = _this$props.maxConstraints, lockAspectRatio = _this$props.lockAspectRatio;
|
|
2676
|
+
if (!minConstraints && !maxConstraints && !lockAspectRatio)
|
|
2677
|
+
return [width, height];
|
|
2678
|
+
if (lockAspectRatio) {
|
|
2679
|
+
var ratio = this.props.width / this.props.height;
|
|
2680
|
+
var deltaW = width - this.props.width;
|
|
2681
|
+
var deltaH = height - this.props.height;
|
|
2682
|
+
if (Math.abs(deltaW) > Math.abs(deltaH * ratio)) {
|
|
2683
|
+
height = width / ratio;
|
|
2684
|
+
} else {
|
|
2685
|
+
width = height * ratio;
|
|
2686
|
+
}
|
|
2687
|
+
}
|
|
2688
|
+
var oldW = width, oldH = height;
|
|
2689
|
+
var _ref = this.slack || [0, 0], slackW = _ref[0], slackH = _ref[1];
|
|
2690
|
+
width += slackW;
|
|
2691
|
+
height += slackH;
|
|
2692
|
+
if (minConstraints) {
|
|
2693
|
+
width = Math.max(minConstraints[0], width);
|
|
2694
|
+
height = Math.max(minConstraints[1], height);
|
|
2695
|
+
}
|
|
2696
|
+
if (maxConstraints) {
|
|
2697
|
+
width = Math.min(maxConstraints[0], width);
|
|
2698
|
+
height = Math.min(maxConstraints[1], height);
|
|
2699
|
+
}
|
|
2700
|
+
this.slack = [slackW + (oldW - width), slackH + (oldH - height)];
|
|
2701
|
+
return [width, height];
|
|
2702
|
+
};
|
|
2703
|
+
_proto.resizeHandler = function resizeHandler(handlerName, axis) {
|
|
2704
|
+
var _this2 = this;
|
|
2705
|
+
return function(e, _ref2) {
|
|
2706
|
+
var node = _ref2.node, deltaX = _ref2.deltaX, deltaY = _ref2.deltaY;
|
|
2707
|
+
if (handlerName === "onResizeStart")
|
|
2708
|
+
_this2.resetData();
|
|
2709
|
+
var canDragX = (_this2.props.axis === "both" || _this2.props.axis === "x") && axis !== "n" && axis !== "s";
|
|
2710
|
+
var canDragY = (_this2.props.axis === "both" || _this2.props.axis === "y") && axis !== "e" && axis !== "w";
|
|
2711
|
+
if (!canDragX && !canDragY)
|
|
2712
|
+
return;
|
|
2713
|
+
var axisV = axis[0];
|
|
2714
|
+
var axisH = axis[axis.length - 1];
|
|
2715
|
+
var handleRect = node.getBoundingClientRect();
|
|
2716
|
+
if (_this2.lastHandleRect != null) {
|
|
2717
|
+
if (axisH === "w") {
|
|
2718
|
+
var deltaLeftSinceLast = handleRect.left - _this2.lastHandleRect.left;
|
|
2719
|
+
deltaX += deltaLeftSinceLast;
|
|
2720
|
+
}
|
|
2721
|
+
if (axisV === "n") {
|
|
2722
|
+
var deltaTopSinceLast = handleRect.top - _this2.lastHandleRect.top;
|
|
2723
|
+
deltaY += deltaTopSinceLast;
|
|
2724
|
+
}
|
|
2725
|
+
}
|
|
2726
|
+
_this2.lastHandleRect = handleRect;
|
|
2727
|
+
if (axisH === "w")
|
|
2728
|
+
deltaX = -deltaX;
|
|
2729
|
+
if (axisV === "n")
|
|
2730
|
+
deltaY = -deltaY;
|
|
2731
|
+
var width = _this2.props.width + (canDragX ? deltaX / _this2.props.transformScale : 0);
|
|
2732
|
+
var height = _this2.props.height + (canDragY ? deltaY / _this2.props.transformScale : 0);
|
|
2733
|
+
var _this2$runConstraints = _this2.runConstraints(width, height);
|
|
2734
|
+
width = _this2$runConstraints[0];
|
|
2735
|
+
height = _this2$runConstraints[1];
|
|
2736
|
+
var dimensionsChanged = width !== _this2.props.width || height !== _this2.props.height;
|
|
2737
|
+
var cb = typeof _this2.props[handlerName] === "function" ? _this2.props[handlerName] : null;
|
|
2738
|
+
var shouldSkipCb = handlerName === "onResize" && !dimensionsChanged;
|
|
2739
|
+
if (cb && !shouldSkipCb) {
|
|
2740
|
+
e.persist == null ? void 0 : e.persist();
|
|
2741
|
+
cb(e, {
|
|
2742
|
+
node,
|
|
2743
|
+
size: {
|
|
2744
|
+
width,
|
|
2745
|
+
height
|
|
2746
|
+
},
|
|
2747
|
+
handle: axis
|
|
2748
|
+
});
|
|
2749
|
+
}
|
|
2750
|
+
if (handlerName === "onResizeStop")
|
|
2751
|
+
_this2.resetData();
|
|
2752
|
+
};
|
|
2753
|
+
};
|
|
2754
|
+
_proto.renderResizeHandle = function renderResizeHandle(handleAxis, ref) {
|
|
2755
|
+
var handle = this.props.handle;
|
|
2756
|
+
if (!handle) {
|
|
2757
|
+
return /* @__PURE__ */ React.createElement("span", {
|
|
2758
|
+
className: "react-resizable-handle react-resizable-handle-" + handleAxis,
|
|
2759
|
+
ref
|
|
2760
|
+
});
|
|
2761
|
+
}
|
|
2762
|
+
if (typeof handle === "function") {
|
|
2763
|
+
return handle(handleAxis, ref);
|
|
2764
|
+
}
|
|
2765
|
+
var isDOMElement = typeof handle.type === "string";
|
|
2766
|
+
var props = _objectSpread({
|
|
2767
|
+
ref
|
|
2768
|
+
}, isDOMElement ? {} : {
|
|
2769
|
+
handleAxis
|
|
2770
|
+
});
|
|
2771
|
+
return /* @__PURE__ */ React.cloneElement(handle, props);
|
|
2772
|
+
};
|
|
2773
|
+
_proto.render = function render() {
|
|
2774
|
+
var _this3 = this;
|
|
2775
|
+
var _this$props2 = this.props, children = _this$props2.children, className = _this$props2.className, draggableOpts = _this$props2.draggableOpts, width = _this$props2.width, height = _this$props2.height, handle = _this$props2.handle, handleSize = _this$props2.handleSize, lockAspectRatio = _this$props2.lockAspectRatio, axis = _this$props2.axis, minConstraints = _this$props2.minConstraints, maxConstraints = _this$props2.maxConstraints, onResize = _this$props2.onResize, onResizeStop = _this$props2.onResizeStop, onResizeStart = _this$props2.onResizeStart, resizeHandles = _this$props2.resizeHandles, transformScale = _this$props2.transformScale, p = _objectWithoutPropertiesLoose(_this$props2, _excluded);
|
|
2776
|
+
return (0, _utils.cloneElement)(children, _objectSpread(_objectSpread({}, p), {}, {
|
|
2777
|
+
className: (className ? className + " " : "") + "react-resizable",
|
|
2778
|
+
children: [].concat(children.props.children, resizeHandles.map(function(handleAxis) {
|
|
2779
|
+
var _this3$handleRefs$han;
|
|
2780
|
+
var ref = (_this3$handleRefs$han = _this3.handleRefs[handleAxis]) != null ? _this3$handleRefs$han : _this3.handleRefs[handleAxis] = /* @__PURE__ */ React.createRef();
|
|
2781
|
+
return /* @__PURE__ */ React.createElement(_reactDraggable.DraggableCore, _extends({}, draggableOpts, {
|
|
2782
|
+
nodeRef: ref,
|
|
2783
|
+
key: "resizableHandle-" + handleAxis,
|
|
2784
|
+
onStop: _this3.resizeHandler("onResizeStop", handleAxis),
|
|
2785
|
+
onStart: _this3.resizeHandler("onResizeStart", handleAxis),
|
|
2786
|
+
onDrag: _this3.resizeHandler("onResize", handleAxis)
|
|
2787
|
+
}), _this3.renderResizeHandle(handleAxis, ref));
|
|
2788
|
+
}))
|
|
2789
|
+
}));
|
|
2790
|
+
};
|
|
2791
|
+
return Resizable3;
|
|
2792
|
+
}(React.Component);
|
|
2793
|
+
exports2.default = Resizable2;
|
|
2794
|
+
Resizable2.propTypes = _propTypes.resizableProps;
|
|
2795
|
+
Resizable2.defaultProps = {
|
|
2796
|
+
axis: "both",
|
|
2797
|
+
handleSize: [20, 20],
|
|
2798
|
+
lockAspectRatio: false,
|
|
2799
|
+
minConstraints: [20, 20],
|
|
2800
|
+
maxConstraints: [Infinity, Infinity],
|
|
2801
|
+
resizeHandles: ["se"],
|
|
2802
|
+
transformScale: 1
|
|
2803
|
+
};
|
|
2804
|
+
}
|
|
2805
|
+
});
|
|
2806
|
+
|
|
2807
|
+
// node_modules/react-resizable/build/ResizableBox.js
|
|
2808
|
+
var require_ResizableBox = __commonJS({
|
|
2809
|
+
"node_modules/react-resizable/build/ResizableBox.js"(exports2) {
|
|
2810
|
+
"use strict";
|
|
2811
|
+
exports2.__esModule = true;
|
|
2812
|
+
exports2.default = void 0;
|
|
2813
|
+
var React = _interopRequireWildcard(require("react"));
|
|
2814
|
+
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
2815
|
+
var _Resizable = _interopRequireDefault(require_Resizable());
|
|
2816
|
+
var _propTypes2 = require_propTypes();
|
|
2817
|
+
var _excluded = ["handle", "handleSize", "onResize", "onResizeStart", "onResizeStop", "draggableOpts", "minConstraints", "maxConstraints", "lockAspectRatio", "axis", "width", "height", "resizeHandles", "style", "transformScale"];
|
|
2818
|
+
function _interopRequireDefault(obj) {
|
|
2819
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
2820
|
+
}
|
|
2821
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
2822
|
+
if (typeof WeakMap !== "function")
|
|
2823
|
+
return null;
|
|
2824
|
+
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
|
|
2825
|
+
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
|
|
2826
|
+
return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
|
|
2827
|
+
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
2828
|
+
})(nodeInterop);
|
|
2829
|
+
}
|
|
2830
|
+
function _interopRequireWildcard(obj, nodeInterop) {
|
|
2831
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
2832
|
+
return obj;
|
|
2833
|
+
}
|
|
2834
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
2835
|
+
return { default: obj };
|
|
2836
|
+
}
|
|
2837
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
2838
|
+
if (cache && cache.has(obj)) {
|
|
2839
|
+
return cache.get(obj);
|
|
2840
|
+
}
|
|
2841
|
+
var newObj = {};
|
|
2842
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
2843
|
+
for (var key in obj) {
|
|
2844
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
2845
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
2846
|
+
if (desc && (desc.get || desc.set)) {
|
|
2847
|
+
Object.defineProperty(newObj, key, desc);
|
|
2848
|
+
} else {
|
|
2849
|
+
newObj[key] = obj[key];
|
|
2850
|
+
}
|
|
2851
|
+
}
|
|
2852
|
+
}
|
|
2853
|
+
newObj.default = obj;
|
|
2854
|
+
if (cache) {
|
|
2855
|
+
cache.set(obj, newObj);
|
|
2856
|
+
}
|
|
2857
|
+
return newObj;
|
|
2858
|
+
}
|
|
2859
|
+
function _extends() {
|
|
2860
|
+
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
2861
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2862
|
+
var source = arguments[i];
|
|
2863
|
+
for (var key in source) {
|
|
2864
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2865
|
+
target[key] = source[key];
|
|
2866
|
+
}
|
|
2867
|
+
}
|
|
2868
|
+
}
|
|
2869
|
+
return target;
|
|
2870
|
+
};
|
|
2871
|
+
return _extends.apply(this, arguments);
|
|
2872
|
+
}
|
|
2873
|
+
function ownKeys(object, enumerableOnly) {
|
|
2874
|
+
var keys = Object.keys(object);
|
|
2875
|
+
if (Object.getOwnPropertySymbols) {
|
|
2876
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
2877
|
+
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
2878
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
2879
|
+
})), keys.push.apply(keys, symbols);
|
|
2880
|
+
}
|
|
2881
|
+
return keys;
|
|
2882
|
+
}
|
|
2883
|
+
function _objectSpread(target) {
|
|
2884
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2885
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
2886
|
+
i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
|
|
2887
|
+
_defineProperty(target, key, source[key]);
|
|
2888
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
2889
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
2890
|
+
});
|
|
2891
|
+
}
|
|
2892
|
+
return target;
|
|
2893
|
+
}
|
|
2894
|
+
function _defineProperty(obj, key, value) {
|
|
2895
|
+
key = _toPropertyKey(key);
|
|
2896
|
+
if (key in obj) {
|
|
2897
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
2898
|
+
} else {
|
|
2899
|
+
obj[key] = value;
|
|
2900
|
+
}
|
|
2901
|
+
return obj;
|
|
2902
|
+
}
|
|
2903
|
+
function _toPropertyKey(arg) {
|
|
2904
|
+
var key = _toPrimitive(arg, "string");
|
|
2905
|
+
return typeof key === "symbol" ? key : String(key);
|
|
2906
|
+
}
|
|
2907
|
+
function _toPrimitive(input, hint) {
|
|
2908
|
+
if (typeof input !== "object" || input === null)
|
|
2909
|
+
return input;
|
|
2910
|
+
var prim = input[Symbol.toPrimitive];
|
|
2911
|
+
if (prim !== void 0) {
|
|
2912
|
+
var res = prim.call(input, hint || "default");
|
|
2913
|
+
if (typeof res !== "object")
|
|
2914
|
+
return res;
|
|
2915
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2916
|
+
}
|
|
2917
|
+
return (hint === "string" ? String : Number)(input);
|
|
2918
|
+
}
|
|
2919
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
2920
|
+
if (source == null)
|
|
2921
|
+
return {};
|
|
2922
|
+
var target = {};
|
|
2923
|
+
var sourceKeys = Object.keys(source);
|
|
2924
|
+
var key, i;
|
|
2925
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
2926
|
+
key = sourceKeys[i];
|
|
2927
|
+
if (excluded.indexOf(key) >= 0)
|
|
2928
|
+
continue;
|
|
2929
|
+
target[key] = source[key];
|
|
2930
|
+
}
|
|
2931
|
+
return target;
|
|
2932
|
+
}
|
|
2933
|
+
function _inheritsLoose(subClass, superClass) {
|
|
2934
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
2935
|
+
subClass.prototype.constructor = subClass;
|
|
2936
|
+
_setPrototypeOf(subClass, superClass);
|
|
2937
|
+
}
|
|
2938
|
+
function _setPrototypeOf(o, p) {
|
|
2939
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
|
|
2940
|
+
o2.__proto__ = p2;
|
|
2941
|
+
return o2;
|
|
2942
|
+
};
|
|
2943
|
+
return _setPrototypeOf(o, p);
|
|
2944
|
+
}
|
|
2945
|
+
var ResizableBox = /* @__PURE__ */ function(_React$Component) {
|
|
2946
|
+
_inheritsLoose(ResizableBox2, _React$Component);
|
|
2947
|
+
function ResizableBox2() {
|
|
2948
|
+
var _this;
|
|
2949
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2950
|
+
args[_key] = arguments[_key];
|
|
2951
|
+
}
|
|
2952
|
+
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
2953
|
+
_this.state = {
|
|
2954
|
+
width: _this.props.width,
|
|
2955
|
+
height: _this.props.height,
|
|
2956
|
+
propsWidth: _this.props.width,
|
|
2957
|
+
propsHeight: _this.props.height
|
|
2958
|
+
};
|
|
2959
|
+
_this.onResize = function(e, data) {
|
|
2960
|
+
var size = data.size;
|
|
2961
|
+
if (_this.props.onResize) {
|
|
2962
|
+
e.persist == null ? void 0 : e.persist();
|
|
2963
|
+
_this.setState(size, function() {
|
|
2964
|
+
return _this.props.onResize && _this.props.onResize(e, data);
|
|
2965
|
+
});
|
|
2966
|
+
} else {
|
|
2967
|
+
_this.setState(size);
|
|
2968
|
+
}
|
|
2969
|
+
};
|
|
2970
|
+
return _this;
|
|
2971
|
+
}
|
|
2972
|
+
ResizableBox2.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
|
|
2973
|
+
if (state.propsWidth !== props.width || state.propsHeight !== props.height) {
|
|
2974
|
+
return {
|
|
2975
|
+
width: props.width,
|
|
2976
|
+
height: props.height,
|
|
2977
|
+
propsWidth: props.width,
|
|
2978
|
+
propsHeight: props.height
|
|
2979
|
+
};
|
|
2980
|
+
}
|
|
2981
|
+
return null;
|
|
2982
|
+
};
|
|
2983
|
+
var _proto = ResizableBox2.prototype;
|
|
2984
|
+
_proto.render = function render() {
|
|
2985
|
+
var _this$props = this.props, handle = _this$props.handle, handleSize = _this$props.handleSize, onResize = _this$props.onResize, onResizeStart = _this$props.onResizeStart, onResizeStop = _this$props.onResizeStop, draggableOpts = _this$props.draggableOpts, minConstraints = _this$props.minConstraints, maxConstraints = _this$props.maxConstraints, lockAspectRatio = _this$props.lockAspectRatio, axis = _this$props.axis, width = _this$props.width, height = _this$props.height, resizeHandles = _this$props.resizeHandles, style = _this$props.style, transformScale = _this$props.transformScale, props = _objectWithoutPropertiesLoose(_this$props, _excluded);
|
|
2986
|
+
return /* @__PURE__ */ React.createElement(_Resizable.default, {
|
|
2987
|
+
axis,
|
|
2988
|
+
draggableOpts,
|
|
2989
|
+
handle,
|
|
2990
|
+
handleSize,
|
|
2991
|
+
height: this.state.height,
|
|
2992
|
+
lockAspectRatio,
|
|
2993
|
+
maxConstraints,
|
|
2994
|
+
minConstraints,
|
|
2995
|
+
onResizeStart,
|
|
2996
|
+
onResize: this.onResize,
|
|
2997
|
+
onResizeStop,
|
|
2998
|
+
resizeHandles,
|
|
2999
|
+
transformScale,
|
|
3000
|
+
width: this.state.width
|
|
3001
|
+
}, /* @__PURE__ */ React.createElement("div", _extends({}, props, {
|
|
3002
|
+
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
3003
|
+
width: this.state.width + "px",
|
|
3004
|
+
height: this.state.height + "px"
|
|
3005
|
+
})
|
|
3006
|
+
})));
|
|
3007
|
+
};
|
|
3008
|
+
return ResizableBox2;
|
|
3009
|
+
}(React.Component);
|
|
3010
|
+
exports2.default = ResizableBox;
|
|
3011
|
+
ResizableBox.propTypes = _objectSpread(_objectSpread({}, _propTypes2.resizableProps), {}, {
|
|
3012
|
+
children: _propTypes.default.element
|
|
3013
|
+
});
|
|
3014
|
+
}
|
|
3015
|
+
});
|
|
3016
|
+
|
|
3017
|
+
// node_modules/react-resizable/index.js
|
|
3018
|
+
var require_react_resizable = __commonJS({
|
|
3019
|
+
"node_modules/react-resizable/index.js"(exports2, module2) {
|
|
3020
|
+
"use strict";
|
|
3021
|
+
module2.exports = function() {
|
|
3022
|
+
throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable");
|
|
3023
|
+
};
|
|
3024
|
+
module2.exports.Resizable = require_Resizable().default;
|
|
3025
|
+
module2.exports.ResizableBox = require_ResizableBox().default;
|
|
3026
|
+
}
|
|
3027
|
+
});
|
|
29
3028
|
|
|
30
3029
|
// index.ts
|
|
31
3030
|
var Table_edit_exports = {};
|
|
@@ -270,15 +3269,15 @@ var generateUUID = () => {
|
|
|
270
3269
|
let d = (/* @__PURE__ */ new Date()).getTime();
|
|
271
3270
|
let d2 = typeof performance !== "undefined" && performance.now && performance.now() * 1e3 || 0;
|
|
272
3271
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
|
|
273
|
-
let
|
|
3272
|
+
let r2 = Math.random() * 16;
|
|
274
3273
|
if (d > 0) {
|
|
275
|
-
|
|
3274
|
+
r2 = (d + r2) % 16 | 0;
|
|
276
3275
|
d = Math.floor(d / 16);
|
|
277
3276
|
} else {
|
|
278
|
-
|
|
3277
|
+
r2 = (d2 + r2) % 16 | 0;
|
|
279
3278
|
d2 = Math.floor(d2 / 16);
|
|
280
3279
|
}
|
|
281
|
-
return (c === "x" ?
|
|
3280
|
+
return (c === "x" ? r2 : 3).toString(16);
|
|
282
3281
|
});
|
|
283
3282
|
};
|
|
284
3283
|
var objSymbolDecimal = { 0: ",", 1: "." };
|
|
@@ -2151,6 +5150,7 @@ var import_react13 = require("react");
|
|
|
2151
5150
|
var import_classnames12 = __toESM(require("classnames"));
|
|
2152
5151
|
var import_reactstrap9 = require("reactstrap");
|
|
2153
5152
|
var import_react_i18next10 = require("react-i18next");
|
|
5153
|
+
var import_react_resizable = __toESM(require_react_resizable());
|
|
2154
5154
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2155
5155
|
var HeaderTableCol = (props) => {
|
|
2156
5156
|
const {
|
|
@@ -2163,51 +5163,70 @@ var HeaderTableCol = (props) => {
|
|
|
2163
5163
|
objWidthFix,
|
|
2164
5164
|
totalCount,
|
|
2165
5165
|
selectedRows,
|
|
5166
|
+
column,
|
|
5167
|
+
setColumn,
|
|
2166
5168
|
isMulti
|
|
2167
5169
|
} = props;
|
|
2168
5170
|
const { t } = (0, import_react_i18next10.useTranslation)();
|
|
5171
|
+
const handleResize = (e, { size }) => {
|
|
5172
|
+
if (size.width > 50) {
|
|
5173
|
+
const newColumns = [...column];
|
|
5174
|
+
newColumns[indexCol].width = size.width;
|
|
5175
|
+
setColumn(newColumns);
|
|
5176
|
+
}
|
|
5177
|
+
};
|
|
2169
5178
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react13.Fragment, { children: col.visible !== false && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2170
|
-
|
|
5179
|
+
import_react_resizable.Resizable,
|
|
2171
5180
|
{
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
width: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : col.width,
|
|
2180
|
-
minWidth: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : col.minWidth,
|
|
2181
|
-
maxWidth: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : col.width
|
|
2182
|
-
},
|
|
2183
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
2184
|
-
"div",
|
|
5181
|
+
className: "r-resize",
|
|
5182
|
+
width: typeof col.width === "number" ? col.width : Number((col.width ?? "").replaceAll(new RegExp(`[^0-9]`, "g"), "")),
|
|
5183
|
+
height: 0,
|
|
5184
|
+
onResize: handleResize,
|
|
5185
|
+
draggableOpts: { enableUserSelectHack: false },
|
|
5186
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
5187
|
+
"th",
|
|
2185
5188
|
{
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
5189
|
+
rowSpan: col.rowspan !== 1 ? col.rowspan : void 0,
|
|
5190
|
+
colSpan: col.columns?.length ?? 1,
|
|
5191
|
+
className: (0, import_classnames12.default)(`r-headercell fix-${col.fixedType}`, { "cell-fixed": col.fixedType }),
|
|
5192
|
+
style: {
|
|
5193
|
+
top: `${indexParent * 42}px`,
|
|
5194
|
+
left: col.fixedType === "left" ? objWidthFix[col.index ?? 0] : void 0,
|
|
5195
|
+
right: col.fixedType === "right" ? objWidthFix[col.index ?? 0] : void 0,
|
|
5196
|
+
width: col.width ? typeof col.width === "number" ? col.width : col.width?.includes("px") || col.width?.includes("%") ? col.width : `${col.width}px` : "auto",
|
|
5197
|
+
minWidth: col.width ? typeof col.width === "number" ? col.width : col.width?.includes("px") || col.width?.includes("%") ? col.width : `${col.width}px` : "auto",
|
|
5198
|
+
maxWidth: col.width ? typeof col.width === "number" ? col.width : col.width?.includes("px") || col.width?.includes("%") ? col.width : `${col.width}px` : "auto"
|
|
5199
|
+
},
|
|
5200
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
5201
|
+
"div",
|
|
5202
|
+
{
|
|
5203
|
+
style: { justifyContent: col.textAlign ?? "left" },
|
|
5204
|
+
className: (0, import_classnames12.default)("r-headercell-div"),
|
|
5205
|
+
children: [
|
|
5206
|
+
col.field === "checkbox" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
5207
|
+
import_reactstrap9.Input,
|
|
5208
|
+
{
|
|
5209
|
+
checked: totalCount > 0 && selectedRows?.length >= totalCount,
|
|
5210
|
+
type: "checkbox",
|
|
5211
|
+
className: (0, import_classnames12.default)("cursor-pointer", { "d-none": !isMulti }),
|
|
5212
|
+
style: { textAlign: col.textAlign ?? "left", marginTop: 6 },
|
|
5213
|
+
onChange: (e) => {
|
|
5214
|
+
if (selectEnable) {
|
|
5215
|
+
if (e.target.checked) {
|
|
5216
|
+
setSelectedRows(dataSource.map((item) => {
|
|
5217
|
+
return item;
|
|
5218
|
+
}));
|
|
5219
|
+
} else {
|
|
5220
|
+
setSelectedRows([]);
|
|
5221
|
+
}
|
|
5222
|
+
}
|
|
2204
5223
|
}
|
|
2205
5224
|
}
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
5225
|
+
),
|
|
5226
|
+
col.field !== "checkbox" && t(col.headerText ?? "")
|
|
5227
|
+
]
|
|
5228
|
+
}
|
|
5229
|
+
)
|
|
2211
5230
|
}
|
|
2212
5231
|
)
|
|
2213
5232
|
}
|
|
@@ -2337,17 +5356,18 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
|
|
|
2337
5356
|
let rightWidthFix = 0;
|
|
2338
5357
|
contentColumns.forEach((item, index) => {
|
|
2339
5358
|
if (levelCol === 1) {
|
|
5359
|
+
headerColumns[0][index].width = item.width;
|
|
2340
5360
|
headerColumns[0][index].visible = item.visible;
|
|
2341
5361
|
headerColumns[0][index].fixedType = item.fixedType;
|
|
2342
5362
|
}
|
|
2343
5363
|
if (item.fixedType === "left" && item.visible !== false) {
|
|
2344
5364
|
objWidthFix[index] = letfWidthFix;
|
|
2345
|
-
letfWidthFix += Number(item.
|
|
5365
|
+
letfWidthFix += Number(item.width ?? 40);
|
|
2346
5366
|
}
|
|
2347
5367
|
const lasColumn = contentColumns[contentColumns.length - 1 - index];
|
|
2348
5368
|
if (lasColumn.fixedType === "right" && lasColumn.visible !== false) {
|
|
2349
5369
|
objWidthFix[contentColumns.length - 1 - index] = rightWidthFix;
|
|
2350
|
-
rightWidthFix += Number(lasColumn.
|
|
5370
|
+
rightWidthFix += Number(lasColumn.width ?? 40);
|
|
2351
5371
|
}
|
|
2352
5372
|
if (item.editEnable && item.visible !== false && !item.disabledCondition) {
|
|
2353
5373
|
if (indexFirst === -1) {
|
|
@@ -3468,9 +6488,6 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
|
|
|
3468
6488
|
"div",
|
|
3469
6489
|
{
|
|
3470
6490
|
className: (0, import_classnames14.default)("r-rowcell-div"),
|
|
3471
|
-
style: {
|
|
3472
|
-
width: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : col.width
|
|
3473
|
-
},
|
|
3474
6491
|
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
3475
6492
|
"div",
|
|
3476
6493
|
{
|
|
@@ -3517,9 +6534,6 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
|
|
|
3517
6534
|
style: {
|
|
3518
6535
|
left: col.fixedType === "left" ? objWidthFix[indexCol] : void 0,
|
|
3519
6536
|
right: col.fixedType === "right" ? objWidthFix[indexCol] : void 0,
|
|
3520
|
-
width: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : col.width,
|
|
3521
|
-
minWidth: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : col.minWidth,
|
|
3522
|
-
maxWidth: col.maxWidth,
|
|
3523
6537
|
textAlign: col.textAlign ? col.textAlign : "left"
|
|
3524
6538
|
},
|
|
3525
6539
|
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "r-footer-div", children: col.haveSum === true && col.editType === "numeric" ? formartNumberic(dataSource.reduce(function(accumulator, currentValue) {
|
|
@@ -3638,6 +6652,8 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
|
|
|
3638
6652
|
selectEnable: selectEnable ?? false,
|
|
3639
6653
|
selectedRows,
|
|
3640
6654
|
setSelectedRows,
|
|
6655
|
+
column: contentColumns,
|
|
6656
|
+
setColumn: setContentColumns,
|
|
3641
6657
|
totalCount
|
|
3642
6658
|
},
|
|
3643
6659
|
`header-${indexParent}-${index}`
|
|
@@ -4679,13 +7695,24 @@ var OptionFont = [
|
|
|
4679
7695
|
// test-app/src/component/input-style/index.tsx
|
|
4680
7696
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
4681
7697
|
var InputStyleComponent = (props) => {
|
|
4682
|
-
const {
|
|
7698
|
+
const {
|
|
7699
|
+
value,
|
|
7700
|
+
onChange,
|
|
7701
|
+
disabled,
|
|
7702
|
+
disabledColor,
|
|
7703
|
+
disabledBackgroundColor,
|
|
7704
|
+
disabledFontFamily,
|
|
7705
|
+
disabledFontSize,
|
|
7706
|
+
disabledBold,
|
|
7707
|
+
disabledItalic,
|
|
7708
|
+
disabledUnderline
|
|
7709
|
+
} = props;
|
|
4683
7710
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react18.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "d-flex align-items-center", children: [
|
|
4684
7711
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
4685
7712
|
SelectTable,
|
|
4686
7713
|
{
|
|
4687
7714
|
options: OptionFont,
|
|
4688
|
-
isDisabled: disabled,
|
|
7715
|
+
isDisabled: disabled || disabledFontFamily,
|
|
4689
7716
|
noHeader: true,
|
|
4690
7717
|
value: value.fontFamily ? OptionFont.find((x) => x.label === value.fontFamily) : null,
|
|
4691
7718
|
onChange: (val) => {
|
|
@@ -4715,7 +7742,7 @@ var InputStyleComponent = (props) => {
|
|
|
4715
7742
|
}
|
|
4716
7743
|
}
|
|
4717
7744
|
),
|
|
4718
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "ms-25", style: { width: 60 }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7745
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: (0, import_classnames16.default)("ms-25", { "d-none": disabledFontSize }), style: { width: 60 }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
4719
7746
|
SelectTable,
|
|
4720
7747
|
{
|
|
4721
7748
|
options: Array.from({ length: 100 }, (_, i) => ({ value: i + 1, label: i + 1 })),
|
|
@@ -4730,7 +7757,7 @@ var InputStyleComponent = (props) => {
|
|
|
4730
7757
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
4731
7758
|
"div",
|
|
4732
7759
|
{
|
|
4733
|
-
className: (0, import_classnames16.default)("btn-input-style", { "active-custom": value.bold }),
|
|
7760
|
+
className: (0, import_classnames16.default)("btn-input-style", { "active-custom": value.bold }, { "d-none": disabledBold }),
|
|
4734
7761
|
onClick: () => {
|
|
4735
7762
|
if (!disabled) {
|
|
4736
7763
|
onChange({ ...value, bold: !value.bold });
|
|
@@ -4742,7 +7769,7 @@ var InputStyleComponent = (props) => {
|
|
|
4742
7769
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
4743
7770
|
"div",
|
|
4744
7771
|
{
|
|
4745
|
-
className: (0, import_classnames16.default)("btn-input-style", { "active-custom": value.italic }),
|
|
7772
|
+
className: (0, import_classnames16.default)("btn-input-style", { "active-custom": value.italic }, { "d-none": disabledItalic }),
|
|
4746
7773
|
onClick: () => {
|
|
4747
7774
|
if (!disabled) {
|
|
4748
7775
|
onChange({ ...value, italic: !value.italic });
|
|
@@ -4754,7 +7781,7 @@ var InputStyleComponent = (props) => {
|
|
|
4754
7781
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
4755
7782
|
"div",
|
|
4756
7783
|
{
|
|
4757
|
-
className: (0, import_classnames16.default)("btn-input-style", { "active-custom": value.underline }),
|
|
7784
|
+
className: (0, import_classnames16.default)("btn-input-style", { "active-custom": value.underline }, { "d-none": disabledUnderline }),
|
|
4758
7785
|
onClick: () => {
|
|
4759
7786
|
if (!disabled) {
|
|
4760
7787
|
onChange({ ...value, underline: !value.underline });
|
|
@@ -4763,7 +7790,7 @@ var InputStyleComponent = (props) => {
|
|
|
4763
7790
|
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_becoxy_icons8.Underline, { fontSize: 18 })
|
|
4764
7791
|
}
|
|
4765
7792
|
),
|
|
4766
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_reactstrap13.Button, { tag: "label", color: "none", className: "btn-input-style", children: [
|
|
7793
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_reactstrap13.Button, { tag: "label", color: "none", className: (0, import_classnames16.default)("btn-input-style", { "d-none": disabledColor }), children: [
|
|
4767
7794
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_becoxy_icons8.Type, { stroke: value.color ?? "#000000", fontSize: 18 }),
|
|
4768
7795
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
4769
7796
|
"input",
|
|
@@ -4779,7 +7806,7 @@ var InputStyleComponent = (props) => {
|
|
|
4779
7806
|
}
|
|
4780
7807
|
)
|
|
4781
7808
|
] }),
|
|
4782
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_reactstrap13.Button, { tag: "label", color: "none", className: "btn-input-style", children: [
|
|
7809
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_reactstrap13.Button, { tag: "label", color: "none", className: (0, import_classnames16.default)("btn-input-style", { "d-none": disabledBackgroundColor }), children: [
|
|
4783
7810
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_becoxy_icons8.Droplet, { fill: value.backgroundColor ?? "#ffffff", fontSize: 18 }),
|
|
4784
7811
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
4785
7812
|
import_reactstrap13.Input,
|
|
@@ -4821,3 +7848,32 @@ var Table_edit_default = table_default;
|
|
|
4821
7848
|
roundNumber,
|
|
4822
7849
|
useOnClickOutside
|
|
4823
7850
|
});
|
|
7851
|
+
/*! Bundled license information:
|
|
7852
|
+
|
|
7853
|
+
react-is/cjs/react-is.production.min.js:
|
|
7854
|
+
(** @license React v16.13.1
|
|
7855
|
+
* react-is.production.min.js
|
|
7856
|
+
*
|
|
7857
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7858
|
+
*
|
|
7859
|
+
* This source code is licensed under the MIT license found in the
|
|
7860
|
+
* LICENSE file in the root directory of this source tree.
|
|
7861
|
+
*)
|
|
7862
|
+
|
|
7863
|
+
react-is/cjs/react-is.development.js:
|
|
7864
|
+
(** @license React v16.13.1
|
|
7865
|
+
* react-is.development.js
|
|
7866
|
+
*
|
|
7867
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7868
|
+
*
|
|
7869
|
+
* This source code is licensed under the MIT license found in the
|
|
7870
|
+
* LICENSE file in the root directory of this source tree.
|
|
7871
|
+
*)
|
|
7872
|
+
|
|
7873
|
+
object-assign/index.js:
|
|
7874
|
+
(*
|
|
7875
|
+
object-assign
|
|
7876
|
+
(c) Sindre Sorhus
|
|
7877
|
+
@license MIT
|
|
7878
|
+
*)
|
|
7879
|
+
*/
|