@object-ui/plugin-dashboard 0.1.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +20 -0
- package/CHANGELOG.md +14 -0
- package/dist/index.css +1 -0
- package/dist/index.js +4563 -264
- package/dist/index.umd.cjs +5 -2
- package/dist/src/DashboardGridLayout.d.ts +11 -0
- package/dist/src/DashboardGridLayout.d.ts.map +1 -0
- package/dist/src/DashboardRenderer.d.ts +1 -1
- package/dist/src/DashboardRenderer.d.ts.map +1 -1
- package/dist/src/MetricCard.d.ts +16 -0
- package/dist/src/MetricCard.d.ts.map +1 -0
- package/dist/src/MetricWidget.d.ts +1 -1
- package/dist/src/MetricWidget.d.ts.map +1 -1
- package/dist/src/index.d.ts +13 -1
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +10 -8
- package/src/DashboardGridLayout.tsx +211 -0
- package/src/DashboardRenderer.tsx +111 -23
- package/src/MetricCard.tsx +75 -0
- package/src/MetricWidget.tsx +13 -3
- package/src/__tests__/DashboardGridLayout.test.tsx +199 -0
- package/src/__tests__/MetricCard.test.tsx +59 -0
- package/src/index.tsx +64 -3
- package/vite.config.ts +19 -0
- package/vitest.config.ts +9 -0
- package/vitest.setup.tsx +18 -0
package/dist/index.js
CHANGED
|
@@ -1,362 +1,4661 @@
|
|
|
1
|
-
import { ComponentRegistry as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { ComponentRegistry as Bt } from "@object-ui/core";
|
|
2
|
+
import * as it from "react";
|
|
3
|
+
import Re, { forwardRef as Xn, useState as Te, useRef as se, useCallback as pe, useEffect as Be, useMemo as we } from "react";
|
|
4
|
+
import { SchemaRenderer as $t } from "@object-ui/react";
|
|
5
|
+
import { Card as Ft, CardHeader as Xt, CardTitle as Ut, CardContent as Gt, cn as qe, Button as zt } from "@object-ui/components";
|
|
6
|
+
import * as fn from "lucide-react";
|
|
7
|
+
import { Save as Un, X as Gn, Edit as Vn, GripVertical as Or, ArrowUpIcon as dn, ArrowDownIcon as pn, MinusIcon as hn } from "lucide-react";
|
|
8
|
+
import mn from "react-dom";
|
|
9
|
+
import mr from "clsx";
|
|
10
|
+
var Mt = { exports: {} }, ht = {};
|
|
11
|
+
var _r;
|
|
12
|
+
function Jn() {
|
|
13
|
+
if (_r) return ht;
|
|
14
|
+
_r = 1;
|
|
15
|
+
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
16
|
+
function r(n, o, i) {
|
|
17
|
+
var l = null;
|
|
18
|
+
if (i !== void 0 && (l = "" + i), o.key !== void 0 && (l = "" + o.key), "key" in o) {
|
|
19
|
+
i = {};
|
|
20
|
+
for (var c in o)
|
|
21
|
+
c !== "key" && (i[c] = o[c]);
|
|
22
|
+
} else i = o;
|
|
23
|
+
return o = i.ref, {
|
|
24
|
+
$$typeof: e,
|
|
25
|
+
type: n,
|
|
26
|
+
key: l,
|
|
27
|
+
ref: o !== void 0 ? o : null,
|
|
28
|
+
props: i
|
|
25
29
|
};
|
|
26
30
|
}
|
|
27
|
-
return
|
|
28
|
-
}
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
function
|
|
32
|
-
return
|
|
33
|
-
function
|
|
34
|
-
if (
|
|
35
|
-
if (typeof
|
|
36
|
-
return
|
|
37
|
-
if (typeof
|
|
38
|
-
switch (
|
|
39
|
-
case
|
|
31
|
+
return ht.Fragment = t, ht.jsx = r, ht.jsxs = r, ht;
|
|
32
|
+
}
|
|
33
|
+
var mt = {};
|
|
34
|
+
var Dr;
|
|
35
|
+
function Kn() {
|
|
36
|
+
return Dr || (Dr = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
37
|
+
function e(f) {
|
|
38
|
+
if (f == null) return null;
|
|
39
|
+
if (typeof f == "function")
|
|
40
|
+
return f.$$typeof === W ? null : f.displayName || f.name || null;
|
|
41
|
+
if (typeof f == "string") return f;
|
|
42
|
+
switch (f) {
|
|
43
|
+
case a:
|
|
40
44
|
return "Fragment";
|
|
41
|
-
case
|
|
45
|
+
case h:
|
|
42
46
|
return "Profiler";
|
|
43
|
-
case
|
|
47
|
+
case s:
|
|
44
48
|
return "StrictMode";
|
|
45
|
-
case
|
|
49
|
+
case R:
|
|
46
50
|
return "Suspense";
|
|
47
|
-
case
|
|
51
|
+
case m:
|
|
48
52
|
return "SuspenseList";
|
|
49
|
-
case
|
|
53
|
+
case $:
|
|
50
54
|
return "Activity";
|
|
51
55
|
}
|
|
52
|
-
if (typeof
|
|
53
|
-
switch (typeof
|
|
56
|
+
if (typeof f == "object")
|
|
57
|
+
switch (typeof f.tag == "number" && console.error(
|
|
54
58
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
55
|
-
),
|
|
56
|
-
case
|
|
59
|
+
), f.$$typeof) {
|
|
60
|
+
case u:
|
|
57
61
|
return "Portal";
|
|
58
|
-
case
|
|
59
|
-
return
|
|
60
|
-
case
|
|
61
|
-
return (
|
|
62
|
-
case
|
|
63
|
-
var
|
|
64
|
-
return
|
|
65
|
-
case
|
|
66
|
-
return
|
|
67
|
-
case
|
|
68
|
-
|
|
62
|
+
case S:
|
|
63
|
+
return f.displayName || "Context";
|
|
64
|
+
case y:
|
|
65
|
+
return (f._context.displayName || "Context") + ".Consumer";
|
|
66
|
+
case b:
|
|
67
|
+
var D = f.render;
|
|
68
|
+
return f = f.displayName, f || (f = D.displayName || D.name || "", f = f !== "" ? "ForwardRef(" + f + ")" : "ForwardRef"), f;
|
|
69
|
+
case x:
|
|
70
|
+
return D = f.displayName || null, D !== null ? D : e(f.type) || "Memo";
|
|
71
|
+
case C:
|
|
72
|
+
D = f._payload, f = f._init;
|
|
69
73
|
try {
|
|
70
|
-
return
|
|
74
|
+
return e(f(D));
|
|
71
75
|
} catch {
|
|
72
76
|
}
|
|
73
77
|
}
|
|
74
78
|
return null;
|
|
75
79
|
}
|
|
76
|
-
function
|
|
77
|
-
return "" +
|
|
80
|
+
function t(f) {
|
|
81
|
+
return "" + f;
|
|
78
82
|
}
|
|
79
|
-
function
|
|
83
|
+
function r(f) {
|
|
80
84
|
try {
|
|
81
|
-
|
|
82
|
-
var
|
|
85
|
+
t(f);
|
|
86
|
+
var D = !1;
|
|
83
87
|
} catch {
|
|
84
|
-
|
|
88
|
+
D = !0;
|
|
85
89
|
}
|
|
86
|
-
if (
|
|
87
|
-
|
|
88
|
-
var
|
|
89
|
-
return
|
|
90
|
-
|
|
90
|
+
if (D) {
|
|
91
|
+
D = console;
|
|
92
|
+
var z = D.error, j = typeof Symbol == "function" && Symbol.toStringTag && f[Symbol.toStringTag] || f.constructor.name || "Object";
|
|
93
|
+
return z.call(
|
|
94
|
+
D,
|
|
91
95
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
92
|
-
|
|
93
|
-
),
|
|
96
|
+
j
|
|
97
|
+
), t(f);
|
|
94
98
|
}
|
|
95
99
|
}
|
|
96
|
-
function f
|
|
97
|
-
if (
|
|
98
|
-
if (typeof
|
|
100
|
+
function n(f) {
|
|
101
|
+
if (f === a) return "<>";
|
|
102
|
+
if (typeof f == "object" && f !== null && f.$$typeof === C)
|
|
99
103
|
return "<...>";
|
|
100
104
|
try {
|
|
101
|
-
var
|
|
102
|
-
return
|
|
105
|
+
var D = e(f);
|
|
106
|
+
return D ? "<" + D + ">" : "<...>";
|
|
103
107
|
} catch {
|
|
104
108
|
return "<...>";
|
|
105
109
|
}
|
|
106
110
|
}
|
|
107
|
-
function
|
|
108
|
-
var
|
|
109
|
-
return
|
|
111
|
+
function o() {
|
|
112
|
+
var f = G.A;
|
|
113
|
+
return f === null ? null : f.getOwner();
|
|
110
114
|
}
|
|
111
|
-
function
|
|
115
|
+
function i() {
|
|
112
116
|
return Error("react-stack-top-frame");
|
|
113
117
|
}
|
|
114
|
-
function
|
|
115
|
-
if (
|
|
116
|
-
var
|
|
117
|
-
if (
|
|
118
|
+
function l(f) {
|
|
119
|
+
if (k.call(f, "key")) {
|
|
120
|
+
var D = Object.getOwnPropertyDescriptor(f, "key").get;
|
|
121
|
+
if (D && D.isReactWarning) return !1;
|
|
118
122
|
}
|
|
119
|
-
return
|
|
123
|
+
return f.key !== void 0;
|
|
120
124
|
}
|
|
121
|
-
function
|
|
122
|
-
function
|
|
123
|
-
|
|
125
|
+
function c(f, D) {
|
|
126
|
+
function z() {
|
|
127
|
+
X || (X = !0, console.error(
|
|
124
128
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
125
|
-
|
|
129
|
+
D
|
|
126
130
|
));
|
|
127
131
|
}
|
|
128
|
-
|
|
129
|
-
get:
|
|
132
|
+
z.isReactWarning = !0, Object.defineProperty(f, "key", {
|
|
133
|
+
get: z,
|
|
130
134
|
configurable: !0
|
|
131
135
|
});
|
|
132
136
|
}
|
|
133
|
-
function
|
|
134
|
-
var
|
|
135
|
-
return
|
|
137
|
+
function d() {
|
|
138
|
+
var f = e(this.type);
|
|
139
|
+
return V[f] || (V[f] = !0, console.error(
|
|
136
140
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
137
|
-
)),
|
|
141
|
+
)), f = this.props.ref, f !== void 0 ? f : null;
|
|
138
142
|
}
|
|
139
|
-
function
|
|
140
|
-
var
|
|
141
|
-
return
|
|
143
|
+
function v(f, D, z, j, F, A) {
|
|
144
|
+
var T = z.ref;
|
|
145
|
+
return f = {
|
|
142
146
|
$$typeof: O,
|
|
143
|
-
type:
|
|
144
|
-
key:
|
|
145
|
-
props:
|
|
146
|
-
_owner:
|
|
147
|
-
}, (
|
|
147
|
+
type: f,
|
|
148
|
+
key: D,
|
|
149
|
+
props: z,
|
|
150
|
+
_owner: j
|
|
151
|
+
}, (T !== void 0 ? T : null) !== null ? Object.defineProperty(f, "ref", {
|
|
148
152
|
enumerable: !1,
|
|
149
|
-
get:
|
|
150
|
-
}) : Object.defineProperty(
|
|
153
|
+
get: d
|
|
154
|
+
}) : Object.defineProperty(f, "ref", { enumerable: !1, value: null }), f._store = {}, Object.defineProperty(f._store, "validated", {
|
|
151
155
|
configurable: !1,
|
|
152
156
|
enumerable: !1,
|
|
153
157
|
writable: !0,
|
|
154
158
|
value: 0
|
|
155
|
-
}), Object.defineProperty(
|
|
159
|
+
}), Object.defineProperty(f, "_debugInfo", {
|
|
156
160
|
configurable: !1,
|
|
157
161
|
enumerable: !1,
|
|
158
162
|
writable: !0,
|
|
159
163
|
value: null
|
|
160
|
-
}), Object.defineProperty(
|
|
164
|
+
}), Object.defineProperty(f, "_debugStack", {
|
|
161
165
|
configurable: !1,
|
|
162
166
|
enumerable: !1,
|
|
163
167
|
writable: !0,
|
|
164
|
-
value:
|
|
165
|
-
}), Object.defineProperty(
|
|
168
|
+
value: F
|
|
169
|
+
}), Object.defineProperty(f, "_debugTask", {
|
|
166
170
|
configurable: !1,
|
|
167
171
|
enumerable: !1,
|
|
168
172
|
writable: !0,
|
|
169
|
-
value:
|
|
170
|
-
}), Object.freeze && (Object.freeze(
|
|
171
|
-
}
|
|
172
|
-
function
|
|
173
|
-
var
|
|
174
|
-
if (
|
|
175
|
-
if (
|
|
176
|
-
if (
|
|
177
|
-
for (
|
|
178
|
-
|
|
179
|
-
Object.freeze && Object.freeze(
|
|
173
|
+
value: A
|
|
174
|
+
}), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
|
|
175
|
+
}
|
|
176
|
+
function g(f, D, z, j, F, A) {
|
|
177
|
+
var T = D.children;
|
|
178
|
+
if (T !== void 0)
|
|
179
|
+
if (j)
|
|
180
|
+
if (H(T)) {
|
|
181
|
+
for (j = 0; j < T.length; j++)
|
|
182
|
+
p(T[j]);
|
|
183
|
+
Object.freeze && Object.freeze(T);
|
|
180
184
|
} else
|
|
181
185
|
console.error(
|
|
182
186
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
183
187
|
);
|
|
184
|
-
else
|
|
185
|
-
if (
|
|
186
|
-
|
|
187
|
-
var
|
|
188
|
-
return
|
|
188
|
+
else p(T);
|
|
189
|
+
if (k.call(D, "key")) {
|
|
190
|
+
T = e(f);
|
|
191
|
+
var I = Object.keys(D).filter(function(q) {
|
|
192
|
+
return q !== "key";
|
|
189
193
|
});
|
|
190
|
-
|
|
194
|
+
j = 0 < I.length ? "{key: someKey, " + I.join(": ..., ") + ": ...}" : "{key: someKey}", E[T + j] || (I = 0 < I.length ? "{" + I.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
191
195
|
`A props object containing a "key" prop is being spread into JSX:
|
|
192
196
|
let props = %s;
|
|
193
197
|
<%s {...props} />
|
|
194
198
|
React keys must be passed directly to JSX without using spread:
|
|
195
199
|
let props = %s;
|
|
196
200
|
<%s key={someKey} {...props} />`,
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
),
|
|
202
|
-
}
|
|
203
|
-
if (
|
|
204
|
-
|
|
205
|
-
for (var
|
|
206
|
-
|
|
207
|
-
} else
|
|
208
|
-
return
|
|
209
|
-
|
|
210
|
-
typeof
|
|
211
|
-
),
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
201
|
+
j,
|
|
202
|
+
T,
|
|
203
|
+
I,
|
|
204
|
+
T
|
|
205
|
+
), E[T + j] = !0);
|
|
206
|
+
}
|
|
207
|
+
if (T = null, z !== void 0 && (r(z), T = "" + z), l(D) && (r(D.key), T = "" + D.key), "key" in D) {
|
|
208
|
+
z = {};
|
|
209
|
+
for (var N in D)
|
|
210
|
+
N !== "key" && (z[N] = D[N]);
|
|
211
|
+
} else z = D;
|
|
212
|
+
return T && c(
|
|
213
|
+
z,
|
|
214
|
+
typeof f == "function" ? f.displayName || f.name || "Unknown" : f
|
|
215
|
+
), v(
|
|
216
|
+
f,
|
|
217
|
+
T,
|
|
218
|
+
z,
|
|
219
|
+
o(),
|
|
220
|
+
F,
|
|
221
|
+
A
|
|
218
222
|
);
|
|
219
223
|
}
|
|
220
|
-
function
|
|
221
|
-
|
|
224
|
+
function p(f) {
|
|
225
|
+
w(f) ? f._store && (f._store.validated = 1) : typeof f == "object" && f !== null && f.$$typeof === C && (f._payload.status === "fulfilled" ? w(f._payload.value) && f._payload.value._store && (f._payload.value._store.validated = 1) : f._store && (f._store.validated = 1));
|
|
222
226
|
}
|
|
223
|
-
function
|
|
224
|
-
return typeof
|
|
227
|
+
function w(f) {
|
|
228
|
+
return typeof f == "object" && f !== null && f.$$typeof === O;
|
|
225
229
|
}
|
|
226
|
-
var
|
|
230
|
+
var P = Re, O = /* @__PURE__ */ Symbol.for("react.transitional.element"), u = /* @__PURE__ */ Symbol.for("react.portal"), a = /* @__PURE__ */ Symbol.for("react.fragment"), s = /* @__PURE__ */ Symbol.for("react.strict_mode"), h = /* @__PURE__ */ Symbol.for("react.profiler"), y = /* @__PURE__ */ Symbol.for("react.consumer"), S = /* @__PURE__ */ Symbol.for("react.context"), b = /* @__PURE__ */ Symbol.for("react.forward_ref"), R = /* @__PURE__ */ Symbol.for("react.suspense"), m = /* @__PURE__ */ Symbol.for("react.suspense_list"), x = /* @__PURE__ */ Symbol.for("react.memo"), C = /* @__PURE__ */ Symbol.for("react.lazy"), $ = /* @__PURE__ */ Symbol.for("react.activity"), W = /* @__PURE__ */ Symbol.for("react.client.reference"), G = P.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, k = Object.prototype.hasOwnProperty, H = Array.isArray, J = console.createTask ? console.createTask : function() {
|
|
227
231
|
return null;
|
|
228
232
|
};
|
|
229
|
-
|
|
230
|
-
react_stack_bottom_frame: function(
|
|
231
|
-
return
|
|
233
|
+
P = {
|
|
234
|
+
react_stack_bottom_frame: function(f) {
|
|
235
|
+
return f();
|
|
232
236
|
}
|
|
233
237
|
};
|
|
234
|
-
var
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
)(),
|
|
238
|
-
|
|
239
|
-
var
|
|
240
|
-
return
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
238
|
+
var X, V = {}, ie = P.react_stack_bottom_frame.bind(
|
|
239
|
+
P,
|
|
240
|
+
i
|
|
241
|
+
)(), ge = J(n(i)), E = {};
|
|
242
|
+
mt.Fragment = a, mt.jsx = function(f, D, z) {
|
|
243
|
+
var j = 1e4 > G.recentlyCreatedOwnerStacks++;
|
|
244
|
+
return g(
|
|
245
|
+
f,
|
|
246
|
+
D,
|
|
247
|
+
z,
|
|
244
248
|
!1,
|
|
245
|
-
|
|
246
|
-
|
|
249
|
+
j ? Error("react-stack-top-frame") : ie,
|
|
250
|
+
j ? J(n(f)) : ge
|
|
247
251
|
);
|
|
248
|
-
},
|
|
249
|
-
var
|
|
250
|
-
return
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
252
|
+
}, mt.jsxs = function(f, D, z) {
|
|
253
|
+
var j = 1e4 > G.recentlyCreatedOwnerStacks++;
|
|
254
|
+
return g(
|
|
255
|
+
f,
|
|
256
|
+
D,
|
|
257
|
+
z,
|
|
254
258
|
!0,
|
|
255
|
-
|
|
256
|
-
|
|
259
|
+
j ? Error("react-stack-top-frame") : ie,
|
|
260
|
+
j ? J(n(f)) : ge
|
|
257
261
|
);
|
|
258
262
|
};
|
|
259
|
-
})()),
|
|
263
|
+
})()), mt;
|
|
260
264
|
}
|
|
261
|
-
var
|
|
262
|
-
function
|
|
263
|
-
return
|
|
265
|
+
var Tr;
|
|
266
|
+
function Zn() {
|
|
267
|
+
return Tr || (Tr = 1, process.env.NODE_ENV === "production" ? Mt.exports = Jn() : Mt.exports = Kn()), Mt.exports;
|
|
264
268
|
}
|
|
265
|
-
var
|
|
266
|
-
const
|
|
267
|
-
(
|
|
268
|
-
|
|
269
|
-
|
|
269
|
+
var M = Zn();
|
|
270
|
+
const Qn = [
|
|
271
|
+
"hsl(var(--chart-1))",
|
|
272
|
+
"hsl(var(--chart-2))",
|
|
273
|
+
"hsl(var(--chart-3))",
|
|
274
|
+
"hsl(var(--chart-4))",
|
|
275
|
+
"hsl(var(--chart-5))"
|
|
276
|
+
], gn = Xn(
|
|
277
|
+
({ schema: e, className: t, dataSource: r, ...n }, o) => {
|
|
278
|
+
const i = e.columns || 4, l = e.gap || 4;
|
|
279
|
+
return /* @__PURE__ */ M.jsx(
|
|
270
280
|
"div",
|
|
271
281
|
{
|
|
272
|
-
ref:
|
|
273
|
-
className:
|
|
282
|
+
ref: o,
|
|
283
|
+
className: qe("grid auto-rows-min", t),
|
|
274
284
|
style: {
|
|
275
|
-
gridTemplateColumns: `repeat(${
|
|
285
|
+
gridTemplateColumns: `repeat(${i}, minmax(0, 1fr))`,
|
|
276
286
|
gap: `${l * 0.25}rem`
|
|
277
287
|
},
|
|
278
|
-
...
|
|
279
|
-
children:
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
288
|
+
...n,
|
|
289
|
+
children: e.widgets?.map((c) => {
|
|
290
|
+
const v = (() => {
|
|
291
|
+
if (c.component) return c.component;
|
|
292
|
+
const p = c.type;
|
|
293
|
+
if (p === "bar" || p === "line" || p === "area" || p === "pie" || p === "donut") {
|
|
294
|
+
const w = Array.isArray(c.data) ? c.data : c.data?.items || [], P = c.options || {}, O = P.xField || "name", u = P.yField || "value";
|
|
295
|
+
return {
|
|
296
|
+
type: "chart",
|
|
297
|
+
chartType: p,
|
|
298
|
+
data: w,
|
|
299
|
+
xAxisKey: O,
|
|
300
|
+
series: [{ dataKey: u }],
|
|
301
|
+
colors: Qn,
|
|
302
|
+
className: "h-[300px]"
|
|
303
|
+
// Enforce height
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
return p === "table" ? {
|
|
307
|
+
type: "data-table",
|
|
308
|
+
...c.options,
|
|
309
|
+
data: c.data?.items || [],
|
|
310
|
+
searchable: !1,
|
|
311
|
+
// Simple table for dashboard
|
|
312
|
+
pagination: !1,
|
|
313
|
+
className: "border-0"
|
|
314
|
+
} : {
|
|
315
|
+
...c,
|
|
316
|
+
...c.options || {}
|
|
317
|
+
};
|
|
318
|
+
})();
|
|
319
|
+
return c.type === "metric" ? /* @__PURE__ */ M.jsx(
|
|
320
|
+
"div",
|
|
321
|
+
{
|
|
322
|
+
className: "h-full w-full",
|
|
323
|
+
style: c.layout ? {
|
|
324
|
+
gridColumn: `span ${c.layout.w}`,
|
|
325
|
+
gridRow: `span ${c.layout.h}`
|
|
326
|
+
} : void 0,
|
|
327
|
+
children: /* @__PURE__ */ M.jsx($t, { schema: v, className: "h-full w-full" })
|
|
328
|
+
},
|
|
329
|
+
c.id || c.title
|
|
330
|
+
) : /* @__PURE__ */ M.jsxs(
|
|
331
|
+
Ft,
|
|
332
|
+
{
|
|
333
|
+
className: qe(
|
|
334
|
+
"overflow-hidden border-border/50 shadow-sm transition-all hover:shadow-md",
|
|
335
|
+
"bg-card/50 backdrop-blur-sm"
|
|
336
|
+
),
|
|
337
|
+
style: c.layout ? {
|
|
338
|
+
gridColumn: `span ${c.layout.w}`,
|
|
339
|
+
gridRow: `span ${c.layout.h}`
|
|
340
|
+
} : void 0,
|
|
341
|
+
children: [
|
|
342
|
+
c.title && /* @__PURE__ */ M.jsx(Xt, { className: "pb-2 border-b border-border/40 bg-muted/20", children: /* @__PURE__ */ M.jsx(Ut, { className: "text-base font-medium tracking-tight truncate", title: c.title, children: c.title }) }),
|
|
343
|
+
/* @__PURE__ */ M.jsx(Gt, { className: "p-0", children: /* @__PURE__ */ M.jsx("div", { className: qe("h-full w-full", (c.title, "p-4")), children: /* @__PURE__ */ M.jsx($t, { schema: v }) }) })
|
|
344
|
+
]
|
|
345
|
+
},
|
|
346
|
+
c.id || c.title
|
|
347
|
+
);
|
|
348
|
+
})
|
|
294
349
|
}
|
|
295
350
|
);
|
|
296
351
|
}
|
|
297
|
-
)
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
o.value,
|
|
323
|
-
"%"
|
|
324
|
-
] }),
|
|
325
|
-
l || o?.label
|
|
326
|
-
] })
|
|
327
|
-
] })
|
|
328
|
-
] });
|
|
329
|
-
L.register(
|
|
330
|
-
"dashboard",
|
|
331
|
-
be,
|
|
332
|
-
{
|
|
333
|
-
label: "Dashboard",
|
|
334
|
-
category: "Complex",
|
|
335
|
-
icon: "layout-dashboard",
|
|
336
|
-
inputs: [
|
|
337
|
-
{ name: "columns", type: "number", label: "Columns", defaultValue: 3 },
|
|
338
|
-
{ name: "gap", type: "number", label: "Gap", defaultValue: 4 },
|
|
339
|
-
{ name: "className", type: "string", label: "CSS Class" }
|
|
340
|
-
],
|
|
341
|
-
defaultProps: {
|
|
342
|
-
columns: 3,
|
|
343
|
-
widgets: []
|
|
352
|
+
);
|
|
353
|
+
function ut(e) {
|
|
354
|
+
const { margin: t, containerPadding: r, containerWidth: n, cols: o } = e;
|
|
355
|
+
return (n - t[0] * (o - 1) - r[0] * 2) / o;
|
|
356
|
+
}
|
|
357
|
+
function ct(e, t, r) {
|
|
358
|
+
return Number.isFinite(e) ? Math.round(
|
|
359
|
+
t * e + Math.max(0, e - 1) * r
|
|
360
|
+
) : e;
|
|
361
|
+
}
|
|
362
|
+
function gt(e, t, r, n, o, i, l) {
|
|
363
|
+
const { margin: c, containerPadding: d, rowHeight: v } = e, g = ut(e);
|
|
364
|
+
let p, w, P, O;
|
|
365
|
+
if (l ? (p = Math.round(l.width), w = Math.round(l.height)) : (p = ct(n, g, c[0]), w = ct(o, v, c[1])), i ? (P = Math.round(i.top), O = Math.round(i.left)) : l ? (P = Math.round(l.top), O = Math.round(l.left)) : (P = Math.round((v + c[1]) * r + d[1]), O = Math.round((g + c[0]) * t + d[0])), !i && !l) {
|
|
366
|
+
if (Number.isFinite(n)) {
|
|
367
|
+
const a = Math.round(
|
|
368
|
+
(g + c[0]) * (t + n) + d[0]
|
|
369
|
+
) - O - p;
|
|
370
|
+
a !== c[0] && (p += a - c[0]);
|
|
371
|
+
}
|
|
372
|
+
if (Number.isFinite(o)) {
|
|
373
|
+
const a = Math.round(
|
|
374
|
+
(v + c[1]) * (r + o) + d[1]
|
|
375
|
+
) - P - w;
|
|
376
|
+
a !== c[1] && (w += a - c[1]);
|
|
344
377
|
}
|
|
345
378
|
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
379
|
+
return { top: P, left: O, width: p, height: w };
|
|
380
|
+
}
|
|
381
|
+
function eo(e, t, r, n, o) {
|
|
382
|
+
const { margin: i, containerPadding: l, cols: c, rowHeight: d, maxRows: v } = e, g = ut(e);
|
|
383
|
+
let p = Math.round((r - l[0]) / (g + i[0])), w = Math.round((t - l[1]) / (d + i[1]));
|
|
384
|
+
return p = Ht(p, 0, c - n), w = Ht(w, 0, v - o), { x: p, y: w };
|
|
385
|
+
}
|
|
386
|
+
function Nt(e, t, r) {
|
|
387
|
+
const { margin: n, containerPadding: o, rowHeight: i } = e, l = ut(e), c = Math.round((r - o[0]) / (l + n[0])), d = Math.round((t - o[1]) / (i + n[1]));
|
|
388
|
+
return { x: c, y: d };
|
|
389
|
+
}
|
|
390
|
+
function to(e, t, r) {
|
|
391
|
+
const { margin: n, rowHeight: o } = e, i = ut(e), l = Math.max(
|
|
392
|
+
1,
|
|
393
|
+
Math.round((t + n[0]) / (i + n[0]))
|
|
394
|
+
), c = Math.max(
|
|
395
|
+
1,
|
|
396
|
+
Math.round((r + n[1]) / (o + n[1]))
|
|
397
|
+
);
|
|
398
|
+
return { w: l, h: c };
|
|
399
|
+
}
|
|
400
|
+
function Ht(e, t, r) {
|
|
401
|
+
return Math.max(Math.min(e, r), t);
|
|
402
|
+
}
|
|
403
|
+
function gr(e, t) {
|
|
404
|
+
return !(e.i === t.i || e.x + e.w <= t.x || e.x >= t.x + t.w || e.y + e.h <= t.y || e.y >= t.y + t.h);
|
|
405
|
+
}
|
|
406
|
+
function tt(e, t) {
|
|
407
|
+
for (let r = 0; r < e.length; r++) {
|
|
408
|
+
const n = e[r];
|
|
409
|
+
if (n !== void 0 && gr(n, t))
|
|
410
|
+
return n;
|
|
357
411
|
}
|
|
358
|
-
|
|
412
|
+
}
|
|
413
|
+
function yn(e, t) {
|
|
414
|
+
return e.filter((r) => gr(r, t));
|
|
415
|
+
}
|
|
416
|
+
function ro(e, t) {
|
|
417
|
+
return t === "horizontal" ? vn(e) : t === "vertical" || t === "wrap" ? hr(e) : [...e];
|
|
418
|
+
}
|
|
419
|
+
function hr(e) {
|
|
420
|
+
return [...e].sort((t, r) => t.y !== r.y ? t.y - r.y : t.x - r.x);
|
|
421
|
+
}
|
|
422
|
+
function vn(e) {
|
|
423
|
+
return [...e].sort((t, r) => t.x !== r.x ? t.x - r.x : t.y - r.y);
|
|
424
|
+
}
|
|
425
|
+
function Vt(e) {
|
|
426
|
+
let t = 0;
|
|
427
|
+
for (let r = 0; r < e.length; r++) {
|
|
428
|
+
const n = e[r];
|
|
429
|
+
if (n !== void 0) {
|
|
430
|
+
const o = n.y + n.h;
|
|
431
|
+
o > t && (t = o);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
return t;
|
|
435
|
+
}
|
|
436
|
+
function Qe(e, t) {
|
|
437
|
+
for (let r = 0; r < e.length; r++) {
|
|
438
|
+
const n = e[r];
|
|
439
|
+
if (n !== void 0 && n.i === t)
|
|
440
|
+
return n;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
function Jt(e) {
|
|
444
|
+
return e.filter((t) => t.static === !0);
|
|
445
|
+
}
|
|
446
|
+
function rt(e) {
|
|
447
|
+
return {
|
|
448
|
+
i: e.i,
|
|
449
|
+
x: e.x,
|
|
450
|
+
y: e.y,
|
|
451
|
+
w: e.w,
|
|
452
|
+
h: e.h,
|
|
453
|
+
minW: e.minW,
|
|
454
|
+
maxW: e.maxW,
|
|
455
|
+
minH: e.minH,
|
|
456
|
+
maxH: e.maxH,
|
|
457
|
+
moved: !!e.moved,
|
|
458
|
+
static: !!e.static,
|
|
459
|
+
isDraggable: e.isDraggable,
|
|
460
|
+
isResizable: e.isResizable,
|
|
461
|
+
resizeHandles: e.resizeHandles,
|
|
462
|
+
constraints: e.constraints,
|
|
463
|
+
isBounded: e.isBounded
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
function Ze(e) {
|
|
467
|
+
const t = new Array(e.length);
|
|
468
|
+
for (let r = 0; r < e.length; r++) {
|
|
469
|
+
const n = e[r];
|
|
470
|
+
n !== void 0 && (t[r] = rt(n));
|
|
471
|
+
}
|
|
472
|
+
return t;
|
|
473
|
+
}
|
|
474
|
+
function no(e, t) {
|
|
475
|
+
const r = new Array(e.length);
|
|
476
|
+
for (let n = 0; n < e.length; n++) {
|
|
477
|
+
const o = e[n];
|
|
478
|
+
o !== void 0 && (t.i === o.i ? r[n] = t : r[n] = o);
|
|
479
|
+
}
|
|
480
|
+
return r;
|
|
481
|
+
}
|
|
482
|
+
function oo(e, t, r) {
|
|
483
|
+
let n = Qe(e, t);
|
|
484
|
+
return n ? (n = r(rt(n)), [no(e, n), n]) : [[...e], null];
|
|
485
|
+
}
|
|
486
|
+
function yr(e, t) {
|
|
487
|
+
const r = Jt(e);
|
|
488
|
+
for (let n = 0; n < e.length; n++) {
|
|
489
|
+
const o = e[n];
|
|
490
|
+
if (o !== void 0)
|
|
491
|
+
if (o.x + o.w > t.cols && (o.x = t.cols - o.w), o.x < 0 && (o.x = 0, o.w = t.cols), !o.static)
|
|
492
|
+
r.push(o);
|
|
493
|
+
else
|
|
494
|
+
for (; tt(r, o); )
|
|
495
|
+
o.y++;
|
|
496
|
+
}
|
|
497
|
+
return e;
|
|
498
|
+
}
|
|
499
|
+
function et(e, t, r, n, o, i, l, c, d) {
|
|
500
|
+
if (t.static && t.isDraggable !== !0)
|
|
501
|
+
return [...e];
|
|
502
|
+
if (t.y === n && t.x === r)
|
|
503
|
+
return [...e];
|
|
504
|
+
const v = t.x, g = t.y;
|
|
505
|
+
typeof r == "number" && (t.x = r), typeof n == "number" && (t.y = n), t.moved = !0;
|
|
506
|
+
let p = ro(e, l);
|
|
507
|
+
(l === "vertical" && typeof n == "number" ? g >= n : l === "horizontal" && typeof r == "number" && v >= r) && (p = p.reverse());
|
|
508
|
+
const P = yn(p, t), O = P.length > 0;
|
|
509
|
+
if (O && d)
|
|
510
|
+
return Ze(e);
|
|
511
|
+
if (O && i)
|
|
512
|
+
return t.x = v, t.y = g, t.moved = !1, e;
|
|
513
|
+
let u = [...e];
|
|
514
|
+
for (let a = 0; a < P.length; a++) {
|
|
515
|
+
const s = P[a];
|
|
516
|
+
s !== void 0 && (s.moved || (s.static ? u = jr(
|
|
517
|
+
u,
|
|
518
|
+
s,
|
|
519
|
+
t,
|
|
520
|
+
o,
|
|
521
|
+
l
|
|
522
|
+
) : u = jr(
|
|
523
|
+
u,
|
|
524
|
+
t,
|
|
525
|
+
s,
|
|
526
|
+
o,
|
|
527
|
+
l
|
|
528
|
+
)));
|
|
529
|
+
}
|
|
530
|
+
return u;
|
|
531
|
+
}
|
|
532
|
+
function jr(e, t, r, n, o, i) {
|
|
533
|
+
const l = o === "horizontal", c = o === "vertical", d = t.static;
|
|
534
|
+
if (n) {
|
|
535
|
+
n = !1;
|
|
536
|
+
const p = {
|
|
537
|
+
x: l ? Math.max(t.x - r.w, 0) : r.x,
|
|
538
|
+
y: c ? Math.max(t.y - r.h, 0) : r.y,
|
|
539
|
+
w: r.w,
|
|
540
|
+
h: r.h,
|
|
541
|
+
i: "-1"
|
|
542
|
+
}, w = tt(e, p), P = w !== void 0 && w.y + w.h > t.y, O = w !== void 0 && t.x + t.w > w.x;
|
|
543
|
+
if (!w)
|
|
544
|
+
return et(
|
|
545
|
+
e,
|
|
546
|
+
r,
|
|
547
|
+
l ? p.x : void 0,
|
|
548
|
+
c ? p.y : void 0,
|
|
549
|
+
n,
|
|
550
|
+
d,
|
|
551
|
+
o
|
|
552
|
+
);
|
|
553
|
+
if (P && c)
|
|
554
|
+
return et(
|
|
555
|
+
e,
|
|
556
|
+
r,
|
|
557
|
+
void 0,
|
|
558
|
+
r.y + 1,
|
|
559
|
+
n,
|
|
560
|
+
d,
|
|
561
|
+
o
|
|
562
|
+
);
|
|
563
|
+
if (P && o === null)
|
|
564
|
+
return t.y = r.y, r.y = r.y + r.h, [...e];
|
|
565
|
+
if (O && l)
|
|
566
|
+
return et(
|
|
567
|
+
e,
|
|
568
|
+
t,
|
|
569
|
+
r.x,
|
|
570
|
+
void 0,
|
|
571
|
+
n,
|
|
572
|
+
d,
|
|
573
|
+
o
|
|
574
|
+
);
|
|
575
|
+
}
|
|
576
|
+
const v = l ? r.x + 1 : void 0, g = c ? r.y + 1 : void 0;
|
|
577
|
+
return v === void 0 && g === void 0 ? [...e] : et(
|
|
578
|
+
e,
|
|
579
|
+
r,
|
|
580
|
+
v,
|
|
581
|
+
g,
|
|
582
|
+
n,
|
|
583
|
+
d,
|
|
584
|
+
o
|
|
585
|
+
);
|
|
586
|
+
}
|
|
587
|
+
function lt(e, t, r) {
|
|
588
|
+
return Math.max(t, Math.min(r, e));
|
|
589
|
+
}
|
|
590
|
+
var ao = {
|
|
591
|
+
name: "gridBounds",
|
|
592
|
+
constrainPosition(e, t, r, { cols: n, maxRows: o }) {
|
|
593
|
+
return {
|
|
594
|
+
x: lt(t, 0, Math.max(0, n - e.w)),
|
|
595
|
+
y: lt(r, 0, Math.max(0, o - e.h))
|
|
596
|
+
};
|
|
597
|
+
},
|
|
598
|
+
constrainSize(e, t, r, n, { cols: o, maxRows: i }) {
|
|
599
|
+
const l = n === "w" || n === "nw" || n === "sw" ? e.x + e.w : o - e.x, c = n === "n" || n === "nw" || n === "ne" ? e.y + e.h : i - e.y;
|
|
600
|
+
return {
|
|
601
|
+
w: lt(t, 1, Math.max(1, l)),
|
|
602
|
+
h: lt(r, 1, Math.max(1, c))
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
}, so = {
|
|
606
|
+
name: "minMaxSize",
|
|
607
|
+
constrainSize(e, t, r) {
|
|
608
|
+
return {
|
|
609
|
+
w: lt(t, e.minW ?? 1, e.maxW ?? 1 / 0),
|
|
610
|
+
h: lt(r, e.minH ?? 1, e.maxH ?? 1 / 0)
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
}, bn = [ao, so];
|
|
614
|
+
function kt(e, t, r, n, o) {
|
|
615
|
+
let i = { x: r, y: n };
|
|
616
|
+
for (const l of e)
|
|
617
|
+
l.constrainPosition && (i = l.constrainPosition(t, i.x, i.y, o));
|
|
618
|
+
if (t.constraints)
|
|
619
|
+
for (const l of t.constraints)
|
|
620
|
+
l.constrainPosition && (i = l.constrainPosition(
|
|
621
|
+
t,
|
|
622
|
+
i.x,
|
|
623
|
+
i.y,
|
|
624
|
+
o
|
|
625
|
+
));
|
|
626
|
+
return i;
|
|
627
|
+
}
|
|
628
|
+
function io(e, t, r, n, o, i) {
|
|
629
|
+
let l = { w: r, h: n };
|
|
630
|
+
for (const c of e)
|
|
631
|
+
c.constrainSize && (l = c.constrainSize(
|
|
632
|
+
t,
|
|
633
|
+
l.w,
|
|
634
|
+
l.h,
|
|
635
|
+
o,
|
|
636
|
+
i
|
|
637
|
+
));
|
|
638
|
+
if (t.constraints)
|
|
639
|
+
for (const c of t.constraints)
|
|
640
|
+
c.constrainSize && (l = c.constrainSize(
|
|
641
|
+
t,
|
|
642
|
+
l.w,
|
|
643
|
+
l.h,
|
|
644
|
+
o,
|
|
645
|
+
i
|
|
646
|
+
));
|
|
647
|
+
return l;
|
|
648
|
+
}
|
|
649
|
+
function xn({
|
|
650
|
+
top: e,
|
|
651
|
+
left: t,
|
|
652
|
+
width: r,
|
|
653
|
+
height: n
|
|
654
|
+
}) {
|
|
655
|
+
const o = `translate(${t}px,${e}px)`;
|
|
656
|
+
return {
|
|
657
|
+
transform: o,
|
|
658
|
+
WebkitTransform: o,
|
|
659
|
+
MozTransform: o,
|
|
660
|
+
msTransform: o,
|
|
661
|
+
OTransform: o,
|
|
662
|
+
width: `${r}px`,
|
|
663
|
+
height: `${n}px`,
|
|
664
|
+
position: "absolute"
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
function lo({
|
|
668
|
+
top: e,
|
|
669
|
+
left: t,
|
|
670
|
+
width: r,
|
|
671
|
+
height: n
|
|
672
|
+
}) {
|
|
673
|
+
return {
|
|
674
|
+
top: `${e}px`,
|
|
675
|
+
left: `${t}px`,
|
|
676
|
+
width: `${r}px`,
|
|
677
|
+
height: `${n}px`,
|
|
678
|
+
position: "absolute"
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
function zr(e) {
|
|
682
|
+
return e * 100 + "%";
|
|
683
|
+
}
|
|
684
|
+
function co(e, t, r, n) {
|
|
685
|
+
return e + r > n ? t : r;
|
|
686
|
+
}
|
|
687
|
+
function wn(e, t, r) {
|
|
688
|
+
return e < 0 ? t : r;
|
|
689
|
+
}
|
|
690
|
+
function uo(e) {
|
|
691
|
+
return Math.max(0, e);
|
|
692
|
+
}
|
|
693
|
+
function Yt(e) {
|
|
694
|
+
return Math.max(0, e);
|
|
695
|
+
}
|
|
696
|
+
var vr = (e, t, r) => {
|
|
697
|
+
const { left: n, height: o, width: i } = t, l = e.top - (o - e.height);
|
|
698
|
+
return {
|
|
699
|
+
left: n,
|
|
700
|
+
width: i,
|
|
701
|
+
height: wn(l, e.height, o),
|
|
702
|
+
top: Yt(l)
|
|
703
|
+
};
|
|
704
|
+
}, br = (e, t, r) => {
|
|
705
|
+
const { top: n, left: o, height: i, width: l } = t;
|
|
706
|
+
return {
|
|
707
|
+
top: n,
|
|
708
|
+
height: i,
|
|
709
|
+
width: co(
|
|
710
|
+
e.left,
|
|
711
|
+
e.width,
|
|
712
|
+
l,
|
|
713
|
+
r
|
|
714
|
+
),
|
|
715
|
+
left: uo(o)
|
|
716
|
+
};
|
|
717
|
+
}, xr = (e, t, r) => {
|
|
718
|
+
const { top: n, height: o, width: i } = t, l = e.left + e.width - i;
|
|
719
|
+
return l < 0 ? {
|
|
720
|
+
height: o,
|
|
721
|
+
width: e.left + e.width,
|
|
722
|
+
top: Yt(n),
|
|
723
|
+
left: 0
|
|
724
|
+
} : {
|
|
725
|
+
height: o,
|
|
726
|
+
width: i,
|
|
727
|
+
top: Yt(n),
|
|
728
|
+
left: l
|
|
729
|
+
};
|
|
730
|
+
}, wr = (e, t, r) => {
|
|
731
|
+
const { top: n, left: o, height: i, width: l } = t;
|
|
732
|
+
return {
|
|
733
|
+
width: l,
|
|
734
|
+
left: o,
|
|
735
|
+
height: wn(n, e.height, i),
|
|
736
|
+
top: Yt(n)
|
|
737
|
+
};
|
|
738
|
+
}, fo = (e, t, r) => vr(
|
|
739
|
+
e,
|
|
740
|
+
br(e, t, r)
|
|
741
|
+
), po = (e, t, r) => vr(
|
|
742
|
+
e,
|
|
743
|
+
xr(e, t)
|
|
744
|
+
), ho = (e, t, r) => wr(
|
|
745
|
+
e,
|
|
746
|
+
br(e, t, r)
|
|
747
|
+
), mo = (e, t, r) => wr(
|
|
748
|
+
e,
|
|
749
|
+
xr(e, t)
|
|
750
|
+
), go = {
|
|
751
|
+
n: vr,
|
|
752
|
+
ne: fo,
|
|
753
|
+
e: br,
|
|
754
|
+
se: ho,
|
|
755
|
+
s: wr,
|
|
756
|
+
sw: mo,
|
|
757
|
+
w: xr,
|
|
758
|
+
nw: po
|
|
759
|
+
};
|
|
760
|
+
function yo(e, t, r, n) {
|
|
761
|
+
const o = go[e];
|
|
762
|
+
return o ? o(t, { ...t, ...r }, n) : r;
|
|
763
|
+
}
|
|
764
|
+
var vo = {
|
|
765
|
+
type: "transform",
|
|
766
|
+
scale: 1,
|
|
767
|
+
calcStyle(e) {
|
|
768
|
+
return xn(e);
|
|
769
|
+
}
|
|
770
|
+
}, bo = vo, xo = {
|
|
771
|
+
cols: 12,
|
|
772
|
+
rowHeight: 150,
|
|
773
|
+
margin: [10, 10],
|
|
774
|
+
containerPadding: null,
|
|
775
|
+
maxRows: 1 / 0
|
|
776
|
+
}, wo = {
|
|
777
|
+
enabled: !0,
|
|
778
|
+
bounded: !1,
|
|
779
|
+
threshold: 3
|
|
780
|
+
}, So = {
|
|
781
|
+
enabled: !0,
|
|
782
|
+
handles: ["se"]
|
|
783
|
+
}, Ro = {
|
|
784
|
+
enabled: !1,
|
|
785
|
+
defaultItem: { w: 1, h: 1 }
|
|
786
|
+
};
|
|
787
|
+
function Sr(e, t, r, n, o) {
|
|
788
|
+
const i = n === "x" ? "w" : "h";
|
|
789
|
+
t[n] += 1;
|
|
790
|
+
const l = e.findIndex((d) => d.i === t.i), c = o ?? Jt(e).length > 0;
|
|
791
|
+
for (let d = l + 1; d < e.length; d++) {
|
|
792
|
+
const v = e[d];
|
|
793
|
+
if (v !== void 0 && !v.static) {
|
|
794
|
+
if (!c && v.y > t.y + t.h) break;
|
|
795
|
+
gr(t, v) && Sr(
|
|
796
|
+
e,
|
|
797
|
+
v,
|
|
798
|
+
r + t[i],
|
|
799
|
+
n,
|
|
800
|
+
c
|
|
801
|
+
);
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
t[n] = r;
|
|
805
|
+
}
|
|
806
|
+
function Eo(e, t, r, n) {
|
|
807
|
+
for (t.x = Math.max(t.x, 0), t.y = Math.max(t.y, 0), t.y = Math.min(n, t.y); t.y > 0 && !tt(e, t); )
|
|
808
|
+
t.y--;
|
|
809
|
+
let o;
|
|
810
|
+
for (; (o = tt(e, t)) !== void 0; )
|
|
811
|
+
Sr(r, t, o.y + o.h, "y");
|
|
812
|
+
return t.y = Math.max(t.y, 0), t;
|
|
813
|
+
}
|
|
814
|
+
function Po(e, t, r, n) {
|
|
815
|
+
for (t.x = Math.max(t.x, 0), t.y = Math.max(t.y, 0); t.x > 0 && !tt(e, t); )
|
|
816
|
+
t.x--;
|
|
817
|
+
let o;
|
|
818
|
+
for (; (o = tt(e, t)) !== void 0; )
|
|
819
|
+
if (Sr(n, t, o.x + o.w, "x"), t.x + t.w > r)
|
|
820
|
+
for (t.x = r - t.w, t.y++; t.x > 0 && !tt(e, t); )
|
|
821
|
+
t.x--;
|
|
822
|
+
return t.x = Math.max(t.x, 0), t;
|
|
823
|
+
}
|
|
824
|
+
var Sn = {
|
|
825
|
+
type: "vertical",
|
|
826
|
+
allowOverlap: !1,
|
|
827
|
+
compact(e, t) {
|
|
828
|
+
const r = Jt(e);
|
|
829
|
+
let n = Vt(r);
|
|
830
|
+
const o = hr(e), i = new Array(e.length);
|
|
831
|
+
for (let l = 0; l < o.length; l++) {
|
|
832
|
+
const c = o[l];
|
|
833
|
+
if (c === void 0) continue;
|
|
834
|
+
let d = rt(c);
|
|
835
|
+
d.static || (d = Eo(r, d, o, n), n = Math.max(n, d.y + d.h), r.push(d));
|
|
836
|
+
const v = e.indexOf(c);
|
|
837
|
+
i[v] = d, d.moved = !1;
|
|
838
|
+
}
|
|
839
|
+
return i;
|
|
840
|
+
}
|
|
841
|
+
}, Rn = {
|
|
842
|
+
type: "horizontal",
|
|
843
|
+
allowOverlap: !1,
|
|
844
|
+
compact(e, t) {
|
|
845
|
+
const r = Jt(e), n = vn(e), o = new Array(e.length);
|
|
846
|
+
for (let i = 0; i < n.length; i++) {
|
|
847
|
+
const l = n[i];
|
|
848
|
+
if (l === void 0) continue;
|
|
849
|
+
let c = rt(l);
|
|
850
|
+
c.static || (c = Po(r, c, t, n), r.push(c));
|
|
851
|
+
const d = e.indexOf(l);
|
|
852
|
+
o[d] = c, c.moved = !1;
|
|
853
|
+
}
|
|
854
|
+
return o;
|
|
855
|
+
}
|
|
856
|
+
}, En = {
|
|
857
|
+
type: null,
|
|
858
|
+
allowOverlap: !1,
|
|
859
|
+
compact(e, t) {
|
|
860
|
+
return Ze(e);
|
|
861
|
+
}
|
|
862
|
+
}, Co = {
|
|
863
|
+
...Sn,
|
|
864
|
+
allowOverlap: !0,
|
|
865
|
+
compact(e, t) {
|
|
866
|
+
return Ze(e);
|
|
867
|
+
}
|
|
868
|
+
}, Oo = {
|
|
869
|
+
...Rn,
|
|
870
|
+
allowOverlap: !0,
|
|
871
|
+
compact(e, t) {
|
|
872
|
+
return Ze(e);
|
|
873
|
+
}
|
|
874
|
+
}, _o = {
|
|
875
|
+
...En,
|
|
876
|
+
allowOverlap: !0
|
|
877
|
+
};
|
|
878
|
+
function Rr(e, t = !1, r = !1) {
|
|
879
|
+
let n;
|
|
880
|
+
return t ? e === "vertical" ? n = Co : e === "horizontal" ? n = Oo : n = _o : e === "vertical" ? n = Sn : e === "horizontal" ? n = Rn : n = En, r ? { ...n, preventCollision: r } : n;
|
|
881
|
+
}
|
|
882
|
+
function Pn(e) {
|
|
883
|
+
return Object.keys(e).sort((r, n) => e[r] - e[n]);
|
|
884
|
+
}
|
|
885
|
+
function Mr(e, t) {
|
|
886
|
+
const r = Pn(e);
|
|
887
|
+
let n = r[0];
|
|
888
|
+
if (n === void 0)
|
|
889
|
+
throw new Error("No breakpoints defined");
|
|
890
|
+
for (let o = 1; o < r.length; o++) {
|
|
891
|
+
const i = r[o];
|
|
892
|
+
if (i === void 0) continue;
|
|
893
|
+
const l = e[i];
|
|
894
|
+
t > l && (n = i);
|
|
895
|
+
}
|
|
896
|
+
return n;
|
|
897
|
+
}
|
|
898
|
+
function Nr(e, t) {
|
|
899
|
+
const r = t[e];
|
|
900
|
+
if (r === void 0)
|
|
901
|
+
throw new Error(
|
|
902
|
+
`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`
|
|
903
|
+
);
|
|
904
|
+
return r;
|
|
905
|
+
}
|
|
906
|
+
function ar(e, t, r, n, o, i) {
|
|
907
|
+
const l = e[r];
|
|
908
|
+
if (l)
|
|
909
|
+
return Ze(l);
|
|
910
|
+
let c = e[n];
|
|
911
|
+
const d = Pn(t), v = d.slice(
|
|
912
|
+
d.indexOf(r)
|
|
913
|
+
);
|
|
914
|
+
for (let P = 0; P < v.length; P++) {
|
|
915
|
+
const O = v[P];
|
|
916
|
+
if (O === void 0) continue;
|
|
917
|
+
const u = e[O];
|
|
918
|
+
if (u) {
|
|
919
|
+
c = u;
|
|
920
|
+
break;
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
const g = Ze(c || []), p = yr(g, { cols: o });
|
|
924
|
+
return (typeof i == "object" && i !== null ? i : Rr(i)).compact(p, o);
|
|
925
|
+
}
|
|
926
|
+
function At(e, t) {
|
|
927
|
+
if (Array.isArray(e))
|
|
928
|
+
return e;
|
|
929
|
+
const r = e, n = r[t];
|
|
930
|
+
if (n !== void 0)
|
|
931
|
+
return n;
|
|
932
|
+
const o = Object.keys(r);
|
|
933
|
+
for (const i of o) {
|
|
934
|
+
const l = r[i];
|
|
935
|
+
if (l !== void 0)
|
|
936
|
+
return l;
|
|
937
|
+
}
|
|
938
|
+
return [10, 10];
|
|
939
|
+
}
|
|
940
|
+
function Cn(e) {
|
|
941
|
+
return function(r, n, o, i, l, c, d) {
|
|
942
|
+
return e(r, n, d);
|
|
943
|
+
};
|
|
944
|
+
}
|
|
945
|
+
function Kt(e) {
|
|
946
|
+
return function(r, n, o, i) {
|
|
947
|
+
if (!r || !n || typeof r != "object" || typeof n != "object")
|
|
948
|
+
return e(r, n, o, i);
|
|
949
|
+
var l = i.get(r), c = i.get(n);
|
|
950
|
+
if (l && c)
|
|
951
|
+
return l === n && c === r;
|
|
952
|
+
i.set(r, n), i.set(n, r);
|
|
953
|
+
var d = e(r, n, o, i);
|
|
954
|
+
return i.delete(r), i.delete(n), d;
|
|
955
|
+
};
|
|
956
|
+
}
|
|
957
|
+
function On(e, t) {
|
|
958
|
+
var r = {};
|
|
959
|
+
for (var n in e)
|
|
960
|
+
r[n] = e[n];
|
|
961
|
+
for (var n in t)
|
|
962
|
+
r[n] = t[n];
|
|
963
|
+
return r;
|
|
964
|
+
}
|
|
965
|
+
function kr(e) {
|
|
966
|
+
return e.constructor === Object || e.constructor == null;
|
|
967
|
+
}
|
|
968
|
+
function Ar(e) {
|
|
969
|
+
return typeof e.then == "function";
|
|
970
|
+
}
|
|
971
|
+
function Zt(e, t) {
|
|
972
|
+
return e === t || e !== e && t !== t;
|
|
973
|
+
}
|
|
974
|
+
var Do = "[object Arguments]", To = "[object Boolean]", jo = "[object Date]", zo = "[object RegExp]", Mo = "[object Map]", No = "[object Number]", ko = "[object Object]", Ao = "[object Set]", Lo = "[object String]", Lr = Object.prototype.toString;
|
|
975
|
+
function Qt(e) {
|
|
976
|
+
var t = e.areArraysEqual, r = e.areDatesEqual, n = e.areMapsEqual, o = e.areObjectsEqual, i = e.areRegExpsEqual, l = e.areSetsEqual, c = e.createIsNestedEqual, d = c(v);
|
|
977
|
+
function v(g, p, w) {
|
|
978
|
+
if (g === p)
|
|
979
|
+
return !0;
|
|
980
|
+
if (!g || !p || typeof g != "object" || typeof p != "object")
|
|
981
|
+
return g !== g && p !== p;
|
|
982
|
+
if (kr(g) && kr(p))
|
|
983
|
+
return o(g, p, d, w);
|
|
984
|
+
var P = Array.isArray(g), O = Array.isArray(p);
|
|
985
|
+
if (P || O)
|
|
986
|
+
return P === O && t(g, p, d, w);
|
|
987
|
+
var u = Lr.call(g);
|
|
988
|
+
return u !== Lr.call(p) ? !1 : u === jo ? r(g, p, d, w) : u === zo ? i(g, p, d, w) : u === Mo ? n(g, p, d, w) : u === Ao ? l(g, p, d, w) : u === ko || u === Do ? Ar(g) || Ar(p) ? !1 : o(g, p, d, w) : u === To || u === No || u === Lo ? Zt(g.valueOf(), p.valueOf()) : !1;
|
|
989
|
+
}
|
|
990
|
+
return v;
|
|
991
|
+
}
|
|
992
|
+
function _n(e, t, r, n) {
|
|
993
|
+
var o = e.length;
|
|
994
|
+
if (t.length !== o)
|
|
995
|
+
return !1;
|
|
996
|
+
for (; o-- > 0; )
|
|
997
|
+
if (!r(e[o], t[o], o, o, e, t, n))
|
|
998
|
+
return !1;
|
|
999
|
+
return !0;
|
|
1000
|
+
}
|
|
1001
|
+
var Io = Kt(_n);
|
|
1002
|
+
function Dn(e, t) {
|
|
1003
|
+
return Zt(e.valueOf(), t.valueOf());
|
|
1004
|
+
}
|
|
1005
|
+
function Tn(e, t, r, n) {
|
|
1006
|
+
var o = e.size === t.size;
|
|
1007
|
+
if (!o)
|
|
1008
|
+
return !1;
|
|
1009
|
+
if (!e.size)
|
|
1010
|
+
return !0;
|
|
1011
|
+
var i = {}, l = 0;
|
|
1012
|
+
return e.forEach(function(c, d) {
|
|
1013
|
+
if (o) {
|
|
1014
|
+
var v = !1, g = 0;
|
|
1015
|
+
t.forEach(function(p, w) {
|
|
1016
|
+
!v && !i[g] && (v = r(d, w, l, g, e, t, n) && r(c, p, d, w, e, t, n)) && (i[g] = !0), g++;
|
|
1017
|
+
}), l++, o = v;
|
|
1018
|
+
}
|
|
1019
|
+
}), o;
|
|
1020
|
+
}
|
|
1021
|
+
var Wo = Kt(Tn), qo = "_owner", $o = Object.prototype.hasOwnProperty;
|
|
1022
|
+
function jn(e, t, r, n) {
|
|
1023
|
+
var o = Object.keys(e), i = o.length;
|
|
1024
|
+
if (Object.keys(t).length !== i)
|
|
1025
|
+
return !1;
|
|
1026
|
+
for (var l; i-- > 0; ) {
|
|
1027
|
+
if (l = o[i], l === qo) {
|
|
1028
|
+
var c = !!e.$$typeof, d = !!t.$$typeof;
|
|
1029
|
+
if ((c || d) && c !== d)
|
|
1030
|
+
return !1;
|
|
1031
|
+
}
|
|
1032
|
+
if (!$o.call(t, l) || !r(e[l], t[l], l, l, e, t, n))
|
|
1033
|
+
return !1;
|
|
1034
|
+
}
|
|
1035
|
+
return !0;
|
|
1036
|
+
}
|
|
1037
|
+
var Ho = Kt(jn);
|
|
1038
|
+
function zn(e, t) {
|
|
1039
|
+
return e.source === t.source && e.flags === t.flags;
|
|
1040
|
+
}
|
|
1041
|
+
function Mn(e, t, r, n) {
|
|
1042
|
+
var o = e.size === t.size;
|
|
1043
|
+
if (!o)
|
|
1044
|
+
return !1;
|
|
1045
|
+
if (!e.size)
|
|
1046
|
+
return !0;
|
|
1047
|
+
var i = {};
|
|
1048
|
+
return e.forEach(function(l, c) {
|
|
1049
|
+
if (o) {
|
|
1050
|
+
var d = !1, v = 0;
|
|
1051
|
+
t.forEach(function(g, p) {
|
|
1052
|
+
!d && !i[v] && (d = r(l, g, c, p, e, t, n)) && (i[v] = !0), v++;
|
|
1053
|
+
}), o = d;
|
|
1054
|
+
}
|
|
1055
|
+
}), o;
|
|
1056
|
+
}
|
|
1057
|
+
var Yo = Kt(Mn), Nn = Object.freeze({
|
|
1058
|
+
areArraysEqual: _n,
|
|
1059
|
+
areDatesEqual: Dn,
|
|
1060
|
+
areMapsEqual: Tn,
|
|
1061
|
+
areObjectsEqual: jn,
|
|
1062
|
+
areRegExpsEqual: zn,
|
|
1063
|
+
areSetsEqual: Mn,
|
|
1064
|
+
createIsNestedEqual: Cn
|
|
1065
|
+
}), kn = Object.freeze({
|
|
1066
|
+
areArraysEqual: Io,
|
|
1067
|
+
areDatesEqual: Dn,
|
|
1068
|
+
areMapsEqual: Wo,
|
|
1069
|
+
areObjectsEqual: Ho,
|
|
1070
|
+
areRegExpsEqual: zn,
|
|
1071
|
+
areSetsEqual: Yo,
|
|
1072
|
+
createIsNestedEqual: Cn
|
|
1073
|
+
}), Bo = Qt(Nn);
|
|
1074
|
+
function Ye(e, t) {
|
|
1075
|
+
return Bo(e, t, void 0);
|
|
1076
|
+
}
|
|
1077
|
+
Qt(On(Nn, { createIsNestedEqual: function() {
|
|
1078
|
+
return Zt;
|
|
1079
|
+
} }));
|
|
1080
|
+
Qt(kn);
|
|
1081
|
+
Qt(On(kn, {
|
|
1082
|
+
createIsNestedEqual: function() {
|
|
1083
|
+
return Zt;
|
|
1084
|
+
}
|
|
1085
|
+
}));
|
|
1086
|
+
function Fo(e = {}) {
|
|
1087
|
+
const { measureBeforeMount: t = !1, initialWidth: r = 1280 } = e, [n, o] = Te(r), [i, l] = Te(!t), c = se(null), d = se(null), v = pe(() => {
|
|
1088
|
+
const g = c.current;
|
|
1089
|
+
if (g) {
|
|
1090
|
+
const p = g.offsetWidth;
|
|
1091
|
+
o(p), i || l(!0);
|
|
1092
|
+
}
|
|
1093
|
+
}, [i]);
|
|
1094
|
+
return Be(() => {
|
|
1095
|
+
const g = c.current;
|
|
1096
|
+
if (g)
|
|
1097
|
+
return v(), typeof ResizeObserver < "u" && (d.current = new ResizeObserver((p) => {
|
|
1098
|
+
const w = p[0];
|
|
1099
|
+
if (w) {
|
|
1100
|
+
const P = w.contentRect.width;
|
|
1101
|
+
o(P);
|
|
1102
|
+
}
|
|
1103
|
+
}), d.current.observe(g)), () => {
|
|
1104
|
+
d.current && (d.current.disconnect(), d.current = null);
|
|
1105
|
+
};
|
|
1106
|
+
}, [v]), {
|
|
1107
|
+
width: n,
|
|
1108
|
+
mounted: i,
|
|
1109
|
+
containerRef: c,
|
|
1110
|
+
measureWidth: v
|
|
1111
|
+
};
|
|
1112
|
+
}
|
|
1113
|
+
var yt = { exports: {} }, sr = {}, Lt = { exports: {} }, It = { exports: {} }, te = {};
|
|
1114
|
+
var Ir;
|
|
1115
|
+
function Xo() {
|
|
1116
|
+
if (Ir) return te;
|
|
1117
|
+
Ir = 1;
|
|
1118
|
+
var e = typeof Symbol == "function" && Symbol.for, t = e ? /* @__PURE__ */ Symbol.for("react.element") : 60103, r = e ? /* @__PURE__ */ Symbol.for("react.portal") : 60106, n = e ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107, o = e ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108, i = e ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114, l = e ? /* @__PURE__ */ Symbol.for("react.provider") : 60109, c = e ? /* @__PURE__ */ Symbol.for("react.context") : 60110, d = e ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111, v = e ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111, g = e ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112, p = e ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113, w = e ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120, P = e ? /* @__PURE__ */ Symbol.for("react.memo") : 60115, O = e ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116, u = e ? /* @__PURE__ */ Symbol.for("react.block") : 60121, a = e ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117, s = e ? /* @__PURE__ */ Symbol.for("react.responder") : 60118, h = e ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
|
|
1119
|
+
function y(b) {
|
|
1120
|
+
if (typeof b == "object" && b !== null) {
|
|
1121
|
+
var R = b.$$typeof;
|
|
1122
|
+
switch (R) {
|
|
1123
|
+
case t:
|
|
1124
|
+
switch (b = b.type, b) {
|
|
1125
|
+
case d:
|
|
1126
|
+
case v:
|
|
1127
|
+
case n:
|
|
1128
|
+
case i:
|
|
1129
|
+
case o:
|
|
1130
|
+
case p:
|
|
1131
|
+
return b;
|
|
1132
|
+
default:
|
|
1133
|
+
switch (b = b && b.$$typeof, b) {
|
|
1134
|
+
case c:
|
|
1135
|
+
case g:
|
|
1136
|
+
case O:
|
|
1137
|
+
case P:
|
|
1138
|
+
case l:
|
|
1139
|
+
return b;
|
|
1140
|
+
default:
|
|
1141
|
+
return R;
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
case r:
|
|
1145
|
+
return R;
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
function S(b) {
|
|
1150
|
+
return y(b) === v;
|
|
1151
|
+
}
|
|
1152
|
+
return te.AsyncMode = d, te.ConcurrentMode = v, te.ContextConsumer = c, te.ContextProvider = l, te.Element = t, te.ForwardRef = g, te.Fragment = n, te.Lazy = O, te.Memo = P, te.Portal = r, te.Profiler = i, te.StrictMode = o, te.Suspense = p, te.isAsyncMode = function(b) {
|
|
1153
|
+
return S(b) || y(b) === d;
|
|
1154
|
+
}, te.isConcurrentMode = S, te.isContextConsumer = function(b) {
|
|
1155
|
+
return y(b) === c;
|
|
1156
|
+
}, te.isContextProvider = function(b) {
|
|
1157
|
+
return y(b) === l;
|
|
1158
|
+
}, te.isElement = function(b) {
|
|
1159
|
+
return typeof b == "object" && b !== null && b.$$typeof === t;
|
|
1160
|
+
}, te.isForwardRef = function(b) {
|
|
1161
|
+
return y(b) === g;
|
|
1162
|
+
}, te.isFragment = function(b) {
|
|
1163
|
+
return y(b) === n;
|
|
1164
|
+
}, te.isLazy = function(b) {
|
|
1165
|
+
return y(b) === O;
|
|
1166
|
+
}, te.isMemo = function(b) {
|
|
1167
|
+
return y(b) === P;
|
|
1168
|
+
}, te.isPortal = function(b) {
|
|
1169
|
+
return y(b) === r;
|
|
1170
|
+
}, te.isProfiler = function(b) {
|
|
1171
|
+
return y(b) === i;
|
|
1172
|
+
}, te.isStrictMode = function(b) {
|
|
1173
|
+
return y(b) === o;
|
|
1174
|
+
}, te.isSuspense = function(b) {
|
|
1175
|
+
return y(b) === p;
|
|
1176
|
+
}, te.isValidElementType = function(b) {
|
|
1177
|
+
return typeof b == "string" || typeof b == "function" || b === n || b === v || b === i || b === o || b === p || b === w || typeof b == "object" && b !== null && (b.$$typeof === O || b.$$typeof === P || b.$$typeof === l || b.$$typeof === c || b.$$typeof === g || b.$$typeof === a || b.$$typeof === s || b.$$typeof === h || b.$$typeof === u);
|
|
1178
|
+
}, te.typeOf = y, te;
|
|
1179
|
+
}
|
|
1180
|
+
var re = {};
|
|
1181
|
+
var Wr;
|
|
1182
|
+
function Uo() {
|
|
1183
|
+
return Wr || (Wr = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
1184
|
+
var e = typeof Symbol == "function" && Symbol.for, t = e ? /* @__PURE__ */ Symbol.for("react.element") : 60103, r = e ? /* @__PURE__ */ Symbol.for("react.portal") : 60106, n = e ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107, o = e ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108, i = e ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114, l = e ? /* @__PURE__ */ Symbol.for("react.provider") : 60109, c = e ? /* @__PURE__ */ Symbol.for("react.context") : 60110, d = e ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111, v = e ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111, g = e ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112, p = e ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113, w = e ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120, P = e ? /* @__PURE__ */ Symbol.for("react.memo") : 60115, O = e ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116, u = e ? /* @__PURE__ */ Symbol.for("react.block") : 60121, a = e ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117, s = e ? /* @__PURE__ */ Symbol.for("react.responder") : 60118, h = e ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
|
|
1185
|
+
function y(_) {
|
|
1186
|
+
return typeof _ == "string" || typeof _ == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
1187
|
+
_ === n || _ === v || _ === i || _ === o || _ === p || _ === w || typeof _ == "object" && _ !== null && (_.$$typeof === O || _.$$typeof === P || _.$$typeof === l || _.$$typeof === c || _.$$typeof === g || _.$$typeof === a || _.$$typeof === s || _.$$typeof === h || _.$$typeof === u);
|
|
1188
|
+
}
|
|
1189
|
+
function S(_) {
|
|
1190
|
+
if (typeof _ == "object" && _ !== null) {
|
|
1191
|
+
var ne = _.$$typeof;
|
|
1192
|
+
switch (ne) {
|
|
1193
|
+
case t:
|
|
1194
|
+
var je = _.type;
|
|
1195
|
+
switch (je) {
|
|
1196
|
+
case d:
|
|
1197
|
+
case v:
|
|
1198
|
+
case n:
|
|
1199
|
+
case i:
|
|
1200
|
+
case o:
|
|
1201
|
+
case p:
|
|
1202
|
+
return je;
|
|
1203
|
+
default:
|
|
1204
|
+
var _e = je && je.$$typeof;
|
|
1205
|
+
switch (_e) {
|
|
1206
|
+
case c:
|
|
1207
|
+
case g:
|
|
1208
|
+
case O:
|
|
1209
|
+
case P:
|
|
1210
|
+
case l:
|
|
1211
|
+
return _e;
|
|
1212
|
+
default:
|
|
1213
|
+
return ne;
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
case r:
|
|
1217
|
+
return ne;
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
var b = d, R = v, m = c, x = l, C = t, $ = g, W = n, G = O, k = P, H = r, J = i, X = o, V = p, ie = !1;
|
|
1222
|
+
function ge(_) {
|
|
1223
|
+
return ie || (ie = !0, 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.")), E(_) || S(_) === d;
|
|
1224
|
+
}
|
|
1225
|
+
function E(_) {
|
|
1226
|
+
return S(_) === v;
|
|
1227
|
+
}
|
|
1228
|
+
function f(_) {
|
|
1229
|
+
return S(_) === c;
|
|
1230
|
+
}
|
|
1231
|
+
function D(_) {
|
|
1232
|
+
return S(_) === l;
|
|
1233
|
+
}
|
|
1234
|
+
function z(_) {
|
|
1235
|
+
return typeof _ == "object" && _ !== null && _.$$typeof === t;
|
|
1236
|
+
}
|
|
1237
|
+
function j(_) {
|
|
1238
|
+
return S(_) === g;
|
|
1239
|
+
}
|
|
1240
|
+
function F(_) {
|
|
1241
|
+
return S(_) === n;
|
|
1242
|
+
}
|
|
1243
|
+
function A(_) {
|
|
1244
|
+
return S(_) === O;
|
|
1245
|
+
}
|
|
1246
|
+
function T(_) {
|
|
1247
|
+
return S(_) === P;
|
|
1248
|
+
}
|
|
1249
|
+
function I(_) {
|
|
1250
|
+
return S(_) === r;
|
|
1251
|
+
}
|
|
1252
|
+
function N(_) {
|
|
1253
|
+
return S(_) === i;
|
|
1254
|
+
}
|
|
1255
|
+
function q(_) {
|
|
1256
|
+
return S(_) === o;
|
|
1257
|
+
}
|
|
1258
|
+
function B(_) {
|
|
1259
|
+
return S(_) === p;
|
|
1260
|
+
}
|
|
1261
|
+
re.AsyncMode = b, re.ConcurrentMode = R, re.ContextConsumer = m, re.ContextProvider = x, re.Element = C, re.ForwardRef = $, re.Fragment = W, re.Lazy = G, re.Memo = k, re.Portal = H, re.Profiler = J, re.StrictMode = X, re.Suspense = V, re.isAsyncMode = ge, re.isConcurrentMode = E, re.isContextConsumer = f, re.isContextProvider = D, re.isElement = z, re.isForwardRef = j, re.isFragment = F, re.isLazy = A, re.isMemo = T, re.isPortal = I, re.isProfiler = N, re.isStrictMode = q, re.isSuspense = B, re.isValidElementType = y, re.typeOf = S;
|
|
1262
|
+
})()), re;
|
|
1263
|
+
}
|
|
1264
|
+
var qr;
|
|
1265
|
+
function An() {
|
|
1266
|
+
return qr || (qr = 1, process.env.NODE_ENV === "production" ? It.exports = Xo() : It.exports = Uo()), It.exports;
|
|
1267
|
+
}
|
|
1268
|
+
var ir, $r;
|
|
1269
|
+
function Go() {
|
|
1270
|
+
if ($r) return ir;
|
|
1271
|
+
$r = 1;
|
|
1272
|
+
var e = Object.getOwnPropertySymbols, t = Object.prototype.hasOwnProperty, r = Object.prototype.propertyIsEnumerable;
|
|
1273
|
+
function n(i) {
|
|
1274
|
+
if (i == null)
|
|
1275
|
+
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
1276
|
+
return Object(i);
|
|
1277
|
+
}
|
|
1278
|
+
function o() {
|
|
1279
|
+
try {
|
|
1280
|
+
if (!Object.assign)
|
|
1281
|
+
return !1;
|
|
1282
|
+
var i = new String("abc");
|
|
1283
|
+
if (i[5] = "de", Object.getOwnPropertyNames(i)[0] === "5")
|
|
1284
|
+
return !1;
|
|
1285
|
+
for (var l = {}, c = 0; c < 10; c++)
|
|
1286
|
+
l["_" + String.fromCharCode(c)] = c;
|
|
1287
|
+
var d = Object.getOwnPropertyNames(l).map(function(g) {
|
|
1288
|
+
return l[g];
|
|
1289
|
+
});
|
|
1290
|
+
if (d.join("") !== "0123456789")
|
|
1291
|
+
return !1;
|
|
1292
|
+
var v = {};
|
|
1293
|
+
return "abcdefghijklmnopqrst".split("").forEach(function(g) {
|
|
1294
|
+
v[g] = g;
|
|
1295
|
+
}), Object.keys(Object.assign({}, v)).join("") === "abcdefghijklmnopqrst";
|
|
1296
|
+
} catch {
|
|
1297
|
+
return !1;
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
return ir = o() ? Object.assign : function(i, l) {
|
|
1301
|
+
for (var c, d = n(i), v, g = 1; g < arguments.length; g++) {
|
|
1302
|
+
c = Object(arguments[g]);
|
|
1303
|
+
for (var p in c)
|
|
1304
|
+
t.call(c, p) && (d[p] = c[p]);
|
|
1305
|
+
if (e) {
|
|
1306
|
+
v = e(c);
|
|
1307
|
+
for (var w = 0; w < v.length; w++)
|
|
1308
|
+
r.call(c, v[w]) && (d[v[w]] = c[v[w]]);
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
return d;
|
|
1312
|
+
}, ir;
|
|
1313
|
+
}
|
|
1314
|
+
var lr, Hr;
|
|
1315
|
+
function Er() {
|
|
1316
|
+
if (Hr) return lr;
|
|
1317
|
+
Hr = 1;
|
|
1318
|
+
var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
1319
|
+
return lr = e, lr;
|
|
1320
|
+
}
|
|
1321
|
+
var cr, Yr;
|
|
1322
|
+
function Ln() {
|
|
1323
|
+
return Yr || (Yr = 1, cr = Function.call.bind(Object.prototype.hasOwnProperty)), cr;
|
|
1324
|
+
}
|
|
1325
|
+
var ur, Br;
|
|
1326
|
+
function Vo() {
|
|
1327
|
+
if (Br) return ur;
|
|
1328
|
+
Br = 1;
|
|
1329
|
+
var e = function() {
|
|
1330
|
+
};
|
|
1331
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1332
|
+
var t = /* @__PURE__ */ Er(), r = {}, n = /* @__PURE__ */ Ln();
|
|
1333
|
+
e = function(i) {
|
|
1334
|
+
var l = "Warning: " + i;
|
|
1335
|
+
typeof console < "u" && console.error(l);
|
|
1336
|
+
try {
|
|
1337
|
+
throw new Error(l);
|
|
1338
|
+
} catch {
|
|
1339
|
+
}
|
|
1340
|
+
};
|
|
1341
|
+
}
|
|
1342
|
+
function o(i, l, c, d, v) {
|
|
1343
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1344
|
+
for (var g in i)
|
|
1345
|
+
if (n(i, g)) {
|
|
1346
|
+
var p;
|
|
1347
|
+
try {
|
|
1348
|
+
if (typeof i[g] != "function") {
|
|
1349
|
+
var w = Error(
|
|
1350
|
+
(d || "React class") + ": " + c + " type `" + g + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[g] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
|
1351
|
+
);
|
|
1352
|
+
throw w.name = "Invariant Violation", w;
|
|
1353
|
+
}
|
|
1354
|
+
p = i[g](l, g, d, c, null, t);
|
|
1355
|
+
} catch (O) {
|
|
1356
|
+
p = O;
|
|
1357
|
+
}
|
|
1358
|
+
if (p && !(p instanceof Error) && e(
|
|
1359
|
+
(d || "React class") + ": type specification of " + c + " `" + g + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof p + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
|
1360
|
+
), p instanceof Error && !(p.message in r)) {
|
|
1361
|
+
r[p.message] = !0;
|
|
1362
|
+
var P = v ? v() : "";
|
|
1363
|
+
e(
|
|
1364
|
+
"Failed " + c + " type: " + p.message + (P ?? "")
|
|
1365
|
+
);
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
return o.resetWarningCache = function() {
|
|
1371
|
+
process.env.NODE_ENV !== "production" && (r = {});
|
|
1372
|
+
}, ur = o, ur;
|
|
1373
|
+
}
|
|
1374
|
+
var fr, Fr;
|
|
1375
|
+
function Jo() {
|
|
1376
|
+
if (Fr) return fr;
|
|
1377
|
+
Fr = 1;
|
|
1378
|
+
var e = An(), t = Go(), r = /* @__PURE__ */ Er(), n = /* @__PURE__ */ Ln(), o = /* @__PURE__ */ Vo(), i = function() {
|
|
1379
|
+
};
|
|
1380
|
+
process.env.NODE_ENV !== "production" && (i = function(c) {
|
|
1381
|
+
var d = "Warning: " + c;
|
|
1382
|
+
typeof console < "u" && console.error(d);
|
|
1383
|
+
try {
|
|
1384
|
+
throw new Error(d);
|
|
1385
|
+
} catch {
|
|
1386
|
+
}
|
|
1387
|
+
});
|
|
1388
|
+
function l() {
|
|
1389
|
+
return null;
|
|
1390
|
+
}
|
|
1391
|
+
return fr = function(c, d) {
|
|
1392
|
+
var v = typeof Symbol == "function" && Symbol.iterator, g = "@@iterator";
|
|
1393
|
+
function p(E) {
|
|
1394
|
+
var f = E && (v && E[v] || E[g]);
|
|
1395
|
+
if (typeof f == "function")
|
|
1396
|
+
return f;
|
|
1397
|
+
}
|
|
1398
|
+
var w = "<<anonymous>>", P = {
|
|
1399
|
+
array: s("array"),
|
|
1400
|
+
bigint: s("bigint"),
|
|
1401
|
+
bool: s("boolean"),
|
|
1402
|
+
func: s("function"),
|
|
1403
|
+
number: s("number"),
|
|
1404
|
+
object: s("object"),
|
|
1405
|
+
string: s("string"),
|
|
1406
|
+
symbol: s("symbol"),
|
|
1407
|
+
any: h(),
|
|
1408
|
+
arrayOf: y,
|
|
1409
|
+
element: S(),
|
|
1410
|
+
elementType: b(),
|
|
1411
|
+
instanceOf: R,
|
|
1412
|
+
node: $(),
|
|
1413
|
+
objectOf: x,
|
|
1414
|
+
oneOf: m,
|
|
1415
|
+
oneOfType: C,
|
|
1416
|
+
shape: G,
|
|
1417
|
+
exact: k
|
|
1418
|
+
};
|
|
1419
|
+
function O(E, f) {
|
|
1420
|
+
return E === f ? E !== 0 || 1 / E === 1 / f : E !== E && f !== f;
|
|
1421
|
+
}
|
|
1422
|
+
function u(E, f) {
|
|
1423
|
+
this.message = E, this.data = f && typeof f == "object" ? f : {}, this.stack = "";
|
|
1424
|
+
}
|
|
1425
|
+
u.prototype = Error.prototype;
|
|
1426
|
+
function a(E) {
|
|
1427
|
+
if (process.env.NODE_ENV !== "production")
|
|
1428
|
+
var f = {}, D = 0;
|
|
1429
|
+
function z(F, A, T, I, N, q, B) {
|
|
1430
|
+
if (I = I || w, q = q || T, B !== r) {
|
|
1431
|
+
if (d) {
|
|
1432
|
+
var _ = new Error(
|
|
1433
|
+
"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"
|
|
1434
|
+
);
|
|
1435
|
+
throw _.name = "Invariant Violation", _;
|
|
1436
|
+
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
|
|
1437
|
+
var ne = I + ":" + T;
|
|
1438
|
+
!f[ne] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
1439
|
+
D < 3 && (i(
|
|
1440
|
+
"You are manually calling a React.PropTypes validation function for the `" + q + "` prop on `" + I + "`. 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."
|
|
1441
|
+
), f[ne] = !0, D++);
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
return A[T] == null ? F ? A[T] === null ? new u("The " + N + " `" + q + "` is marked as required " + ("in `" + I + "`, but its value is `null`.")) : new u("The " + N + " `" + q + "` is marked as required in " + ("`" + I + "`, but its value is `undefined`.")) : null : E(A, T, I, N, q);
|
|
1445
|
+
}
|
|
1446
|
+
var j = z.bind(null, !1);
|
|
1447
|
+
return j.isRequired = z.bind(null, !0), j;
|
|
1448
|
+
}
|
|
1449
|
+
function s(E) {
|
|
1450
|
+
function f(D, z, j, F, A, T) {
|
|
1451
|
+
var I = D[z], N = X(I);
|
|
1452
|
+
if (N !== E) {
|
|
1453
|
+
var q = V(I);
|
|
1454
|
+
return new u(
|
|
1455
|
+
"Invalid " + F + " `" + A + "` of type " + ("`" + q + "` supplied to `" + j + "`, expected ") + ("`" + E + "`."),
|
|
1456
|
+
{ expectedType: E }
|
|
1457
|
+
);
|
|
1458
|
+
}
|
|
1459
|
+
return null;
|
|
1460
|
+
}
|
|
1461
|
+
return a(f);
|
|
1462
|
+
}
|
|
1463
|
+
function h() {
|
|
1464
|
+
return a(l);
|
|
1465
|
+
}
|
|
1466
|
+
function y(E) {
|
|
1467
|
+
function f(D, z, j, F, A) {
|
|
1468
|
+
if (typeof E != "function")
|
|
1469
|
+
return new u("Property `" + A + "` of component `" + j + "` has invalid PropType notation inside arrayOf.");
|
|
1470
|
+
var T = D[z];
|
|
1471
|
+
if (!Array.isArray(T)) {
|
|
1472
|
+
var I = X(T);
|
|
1473
|
+
return new u("Invalid " + F + " `" + A + "` of type " + ("`" + I + "` supplied to `" + j + "`, expected an array."));
|
|
1474
|
+
}
|
|
1475
|
+
for (var N = 0; N < T.length; N++) {
|
|
1476
|
+
var q = E(T, N, j, F, A + "[" + N + "]", r);
|
|
1477
|
+
if (q instanceof Error)
|
|
1478
|
+
return q;
|
|
1479
|
+
}
|
|
1480
|
+
return null;
|
|
1481
|
+
}
|
|
1482
|
+
return a(f);
|
|
1483
|
+
}
|
|
1484
|
+
function S() {
|
|
1485
|
+
function E(f, D, z, j, F) {
|
|
1486
|
+
var A = f[D];
|
|
1487
|
+
if (!c(A)) {
|
|
1488
|
+
var T = X(A);
|
|
1489
|
+
return new u("Invalid " + j + " `" + F + "` of type " + ("`" + T + "` supplied to `" + z + "`, expected a single ReactElement."));
|
|
1490
|
+
}
|
|
1491
|
+
return null;
|
|
1492
|
+
}
|
|
1493
|
+
return a(E);
|
|
1494
|
+
}
|
|
1495
|
+
function b() {
|
|
1496
|
+
function E(f, D, z, j, F) {
|
|
1497
|
+
var A = f[D];
|
|
1498
|
+
if (!e.isValidElementType(A)) {
|
|
1499
|
+
var T = X(A);
|
|
1500
|
+
return new u("Invalid " + j + " `" + F + "` of type " + ("`" + T + "` supplied to `" + z + "`, expected a single ReactElement type."));
|
|
1501
|
+
}
|
|
1502
|
+
return null;
|
|
1503
|
+
}
|
|
1504
|
+
return a(E);
|
|
1505
|
+
}
|
|
1506
|
+
function R(E) {
|
|
1507
|
+
function f(D, z, j, F, A) {
|
|
1508
|
+
if (!(D[z] instanceof E)) {
|
|
1509
|
+
var T = E.name || w, I = ge(D[z]);
|
|
1510
|
+
return new u("Invalid " + F + " `" + A + "` of type " + ("`" + I + "` supplied to `" + j + "`, expected ") + ("instance of `" + T + "`."));
|
|
1511
|
+
}
|
|
1512
|
+
return null;
|
|
1513
|
+
}
|
|
1514
|
+
return a(f);
|
|
1515
|
+
}
|
|
1516
|
+
function m(E) {
|
|
1517
|
+
if (!Array.isArray(E))
|
|
1518
|
+
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? i(
|
|
1519
|
+
"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])."
|
|
1520
|
+
) : i("Invalid argument supplied to oneOf, expected an array.")), l;
|
|
1521
|
+
function f(D, z, j, F, A) {
|
|
1522
|
+
for (var T = D[z], I = 0; I < E.length; I++)
|
|
1523
|
+
if (O(T, E[I]))
|
|
1524
|
+
return null;
|
|
1525
|
+
var N = JSON.stringify(E, function(B, _) {
|
|
1526
|
+
var ne = V(_);
|
|
1527
|
+
return ne === "symbol" ? String(_) : _;
|
|
1528
|
+
});
|
|
1529
|
+
return new u("Invalid " + F + " `" + A + "` of value `" + String(T) + "` " + ("supplied to `" + j + "`, expected one of " + N + "."));
|
|
1530
|
+
}
|
|
1531
|
+
return a(f);
|
|
1532
|
+
}
|
|
1533
|
+
function x(E) {
|
|
1534
|
+
function f(D, z, j, F, A) {
|
|
1535
|
+
if (typeof E != "function")
|
|
1536
|
+
return new u("Property `" + A + "` of component `" + j + "` has invalid PropType notation inside objectOf.");
|
|
1537
|
+
var T = D[z], I = X(T);
|
|
1538
|
+
if (I !== "object")
|
|
1539
|
+
return new u("Invalid " + F + " `" + A + "` of type " + ("`" + I + "` supplied to `" + j + "`, expected an object."));
|
|
1540
|
+
for (var N in T)
|
|
1541
|
+
if (n(T, N)) {
|
|
1542
|
+
var q = E(T, N, j, F, A + "." + N, r);
|
|
1543
|
+
if (q instanceof Error)
|
|
1544
|
+
return q;
|
|
1545
|
+
}
|
|
1546
|
+
return null;
|
|
1547
|
+
}
|
|
1548
|
+
return a(f);
|
|
1549
|
+
}
|
|
1550
|
+
function C(E) {
|
|
1551
|
+
if (!Array.isArray(E))
|
|
1552
|
+
return process.env.NODE_ENV !== "production" && i("Invalid argument supplied to oneOfType, expected an instance of array."), l;
|
|
1553
|
+
for (var f = 0; f < E.length; f++) {
|
|
1554
|
+
var D = E[f];
|
|
1555
|
+
if (typeof D != "function")
|
|
1556
|
+
return i(
|
|
1557
|
+
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + ie(D) + " at index " + f + "."
|
|
1558
|
+
), l;
|
|
1559
|
+
}
|
|
1560
|
+
function z(j, F, A, T, I) {
|
|
1561
|
+
for (var N = [], q = 0; q < E.length; q++) {
|
|
1562
|
+
var B = E[q], _ = B(j, F, A, T, I, r);
|
|
1563
|
+
if (_ == null)
|
|
1564
|
+
return null;
|
|
1565
|
+
_.data && n(_.data, "expectedType") && N.push(_.data.expectedType);
|
|
1566
|
+
}
|
|
1567
|
+
var ne = N.length > 0 ? ", expected one of type [" + N.join(", ") + "]" : "";
|
|
1568
|
+
return new u("Invalid " + T + " `" + I + "` supplied to " + ("`" + A + "`" + ne + "."));
|
|
1569
|
+
}
|
|
1570
|
+
return a(z);
|
|
1571
|
+
}
|
|
1572
|
+
function $() {
|
|
1573
|
+
function E(f, D, z, j, F) {
|
|
1574
|
+
return H(f[D]) ? null : new u("Invalid " + j + " `" + F + "` supplied to " + ("`" + z + "`, expected a ReactNode."));
|
|
1575
|
+
}
|
|
1576
|
+
return a(E);
|
|
1577
|
+
}
|
|
1578
|
+
function W(E, f, D, z, j) {
|
|
1579
|
+
return new u(
|
|
1580
|
+
(E || "React class") + ": " + f + " type `" + D + "." + z + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + j + "`."
|
|
1581
|
+
);
|
|
1582
|
+
}
|
|
1583
|
+
function G(E) {
|
|
1584
|
+
function f(D, z, j, F, A) {
|
|
1585
|
+
var T = D[z], I = X(T);
|
|
1586
|
+
if (I !== "object")
|
|
1587
|
+
return new u("Invalid " + F + " `" + A + "` of type `" + I + "` " + ("supplied to `" + j + "`, expected `object`."));
|
|
1588
|
+
for (var N in E) {
|
|
1589
|
+
var q = E[N];
|
|
1590
|
+
if (typeof q != "function")
|
|
1591
|
+
return W(j, F, A, N, V(q));
|
|
1592
|
+
var B = q(T, N, j, F, A + "." + N, r);
|
|
1593
|
+
if (B)
|
|
1594
|
+
return B;
|
|
1595
|
+
}
|
|
1596
|
+
return null;
|
|
1597
|
+
}
|
|
1598
|
+
return a(f);
|
|
1599
|
+
}
|
|
1600
|
+
function k(E) {
|
|
1601
|
+
function f(D, z, j, F, A) {
|
|
1602
|
+
var T = D[z], I = X(T);
|
|
1603
|
+
if (I !== "object")
|
|
1604
|
+
return new u("Invalid " + F + " `" + A + "` of type `" + I + "` " + ("supplied to `" + j + "`, expected `object`."));
|
|
1605
|
+
var N = t({}, D[z], E);
|
|
1606
|
+
for (var q in N) {
|
|
1607
|
+
var B = E[q];
|
|
1608
|
+
if (n(E, q) && typeof B != "function")
|
|
1609
|
+
return W(j, F, A, q, V(B));
|
|
1610
|
+
if (!B)
|
|
1611
|
+
return new u(
|
|
1612
|
+
"Invalid " + F + " `" + A + "` key `" + q + "` supplied to `" + j + "`.\nBad object: " + JSON.stringify(D[z], null, " ") + `
|
|
1613
|
+
Valid keys: ` + JSON.stringify(Object.keys(E), null, " ")
|
|
1614
|
+
);
|
|
1615
|
+
var _ = B(T, q, j, F, A + "." + q, r);
|
|
1616
|
+
if (_)
|
|
1617
|
+
return _;
|
|
1618
|
+
}
|
|
1619
|
+
return null;
|
|
1620
|
+
}
|
|
1621
|
+
return a(f);
|
|
1622
|
+
}
|
|
1623
|
+
function H(E) {
|
|
1624
|
+
switch (typeof E) {
|
|
1625
|
+
case "number":
|
|
1626
|
+
case "string":
|
|
1627
|
+
case "undefined":
|
|
1628
|
+
return !0;
|
|
1629
|
+
case "boolean":
|
|
1630
|
+
return !E;
|
|
1631
|
+
case "object":
|
|
1632
|
+
if (Array.isArray(E))
|
|
1633
|
+
return E.every(H);
|
|
1634
|
+
if (E === null || c(E))
|
|
1635
|
+
return !0;
|
|
1636
|
+
var f = p(E);
|
|
1637
|
+
if (f) {
|
|
1638
|
+
var D = f.call(E), z;
|
|
1639
|
+
if (f !== E.entries) {
|
|
1640
|
+
for (; !(z = D.next()).done; )
|
|
1641
|
+
if (!H(z.value))
|
|
1642
|
+
return !1;
|
|
1643
|
+
} else
|
|
1644
|
+
for (; !(z = D.next()).done; ) {
|
|
1645
|
+
var j = z.value;
|
|
1646
|
+
if (j && !H(j[1]))
|
|
1647
|
+
return !1;
|
|
1648
|
+
}
|
|
1649
|
+
} else
|
|
1650
|
+
return !1;
|
|
1651
|
+
return !0;
|
|
1652
|
+
default:
|
|
1653
|
+
return !1;
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
function J(E, f) {
|
|
1657
|
+
return E === "symbol" ? !0 : f ? f["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && f instanceof Symbol : !1;
|
|
1658
|
+
}
|
|
1659
|
+
function X(E) {
|
|
1660
|
+
var f = typeof E;
|
|
1661
|
+
return Array.isArray(E) ? "array" : E instanceof RegExp ? "object" : J(f, E) ? "symbol" : f;
|
|
1662
|
+
}
|
|
1663
|
+
function V(E) {
|
|
1664
|
+
if (typeof E > "u" || E === null)
|
|
1665
|
+
return "" + E;
|
|
1666
|
+
var f = X(E);
|
|
1667
|
+
if (f === "object") {
|
|
1668
|
+
if (E instanceof Date)
|
|
1669
|
+
return "date";
|
|
1670
|
+
if (E instanceof RegExp)
|
|
1671
|
+
return "regexp";
|
|
1672
|
+
}
|
|
1673
|
+
return f;
|
|
1674
|
+
}
|
|
1675
|
+
function ie(E) {
|
|
1676
|
+
var f = V(E);
|
|
1677
|
+
switch (f) {
|
|
1678
|
+
case "array":
|
|
1679
|
+
case "object":
|
|
1680
|
+
return "an " + f;
|
|
1681
|
+
case "boolean":
|
|
1682
|
+
case "date":
|
|
1683
|
+
case "regexp":
|
|
1684
|
+
return "a " + f;
|
|
1685
|
+
default:
|
|
1686
|
+
return f;
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
function ge(E) {
|
|
1690
|
+
return !E.constructor || !E.constructor.name ? w : E.constructor.name;
|
|
1691
|
+
}
|
|
1692
|
+
return P.checkPropTypes = o, P.resetWarningCache = o.resetWarningCache, P.PropTypes = P, P;
|
|
1693
|
+
}, fr;
|
|
1694
|
+
}
|
|
1695
|
+
var dr, Xr;
|
|
1696
|
+
function Ko() {
|
|
1697
|
+
if (Xr) return dr;
|
|
1698
|
+
Xr = 1;
|
|
1699
|
+
var e = /* @__PURE__ */ Er();
|
|
1700
|
+
function t() {
|
|
1701
|
+
}
|
|
1702
|
+
function r() {
|
|
1703
|
+
}
|
|
1704
|
+
return r.resetWarningCache = t, dr = function() {
|
|
1705
|
+
function n(l, c, d, v, g, p) {
|
|
1706
|
+
if (p !== e) {
|
|
1707
|
+
var w = new Error(
|
|
1708
|
+
"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"
|
|
1709
|
+
);
|
|
1710
|
+
throw w.name = "Invariant Violation", w;
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
n.isRequired = n;
|
|
1714
|
+
function o() {
|
|
1715
|
+
return n;
|
|
1716
|
+
}
|
|
1717
|
+
var i = {
|
|
1718
|
+
array: n,
|
|
1719
|
+
bigint: n,
|
|
1720
|
+
bool: n,
|
|
1721
|
+
func: n,
|
|
1722
|
+
number: n,
|
|
1723
|
+
object: n,
|
|
1724
|
+
string: n,
|
|
1725
|
+
symbol: n,
|
|
1726
|
+
any: n,
|
|
1727
|
+
arrayOf: o,
|
|
1728
|
+
element: n,
|
|
1729
|
+
elementType: n,
|
|
1730
|
+
instanceOf: o,
|
|
1731
|
+
node: n,
|
|
1732
|
+
objectOf: o,
|
|
1733
|
+
oneOf: o,
|
|
1734
|
+
oneOfType: o,
|
|
1735
|
+
shape: o,
|
|
1736
|
+
exact: o,
|
|
1737
|
+
checkPropTypes: r,
|
|
1738
|
+
resetWarningCache: t
|
|
1739
|
+
};
|
|
1740
|
+
return i.PropTypes = i, i;
|
|
1741
|
+
}, dr;
|
|
1742
|
+
}
|
|
1743
|
+
var Ur;
|
|
1744
|
+
function er() {
|
|
1745
|
+
if (Ur) return Lt.exports;
|
|
1746
|
+
if (Ur = 1, process.env.NODE_ENV !== "production") {
|
|
1747
|
+
var e = An(), t = !0;
|
|
1748
|
+
Lt.exports = /* @__PURE__ */ Jo()(e.isElement, t);
|
|
1749
|
+
} else
|
|
1750
|
+
Lt.exports = /* @__PURE__ */ Ko()();
|
|
1751
|
+
return Lt.exports;
|
|
1752
|
+
}
|
|
1753
|
+
var me = {}, Je = {}, Gr;
|
|
1754
|
+
function tr() {
|
|
1755
|
+
if (Gr) return Je;
|
|
1756
|
+
Gr = 1, Object.defineProperty(Je, "__esModule", {
|
|
1757
|
+
value: !0
|
|
1758
|
+
}), Je.dontSetMe = o, Je.findInArray = e, Je.int = n, Je.isFunction = t, Je.isNum = r;
|
|
1759
|
+
function e(i, l) {
|
|
1760
|
+
for (let c = 0, d = i.length; c < d; c++)
|
|
1761
|
+
if (l.apply(l, [i[c], c, i])) return i[c];
|
|
1762
|
+
}
|
|
1763
|
+
function t(i) {
|
|
1764
|
+
return typeof i == "function" || Object.prototype.toString.call(i) === "[object Function]";
|
|
1765
|
+
}
|
|
1766
|
+
function r(i) {
|
|
1767
|
+
return typeof i == "number" && !isNaN(i);
|
|
1768
|
+
}
|
|
1769
|
+
function n(i) {
|
|
1770
|
+
return parseInt(i, 10);
|
|
1771
|
+
}
|
|
1772
|
+
function o(i, l, c) {
|
|
1773
|
+
if (i[l])
|
|
1774
|
+
return new Error(`Invalid prop ${l} passed to ${c} - do not set this, set it on the child.`);
|
|
1775
|
+
}
|
|
1776
|
+
return Je;
|
|
1777
|
+
}
|
|
1778
|
+
var Ke = {}, Vr;
|
|
1779
|
+
function Zo() {
|
|
1780
|
+
if (Vr) return Ke;
|
|
1781
|
+
Vr = 1, Object.defineProperty(Ke, "__esModule", {
|
|
1782
|
+
value: !0
|
|
1783
|
+
}), Ke.browserPrefixToKey = r, Ke.browserPrefixToStyle = n, Ke.default = void 0, Ke.getPrefix = t;
|
|
1784
|
+
const e = ["Moz", "Webkit", "O", "ms"];
|
|
1785
|
+
function t() {
|
|
1786
|
+
let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "transform";
|
|
1787
|
+
if (typeof window > "u") return "";
|
|
1788
|
+
const l = window.document?.documentElement?.style;
|
|
1789
|
+
if (!l || i in l) return "";
|
|
1790
|
+
for (let c = 0; c < e.length; c++)
|
|
1791
|
+
if (r(i, e[c]) in l) return e[c];
|
|
1792
|
+
return "";
|
|
1793
|
+
}
|
|
1794
|
+
function r(i, l) {
|
|
1795
|
+
return l ? `${l}${o(i)}` : i;
|
|
1796
|
+
}
|
|
1797
|
+
function n(i, l) {
|
|
1798
|
+
return l ? `-${l.toLowerCase()}-${i}` : i;
|
|
1799
|
+
}
|
|
1800
|
+
function o(i) {
|
|
1801
|
+
let l = "", c = !0;
|
|
1802
|
+
for (let d = 0; d < i.length; d++)
|
|
1803
|
+
c ? (l += i[d].toUpperCase(), c = !1) : i[d] === "-" ? c = !0 : l += i[d];
|
|
1804
|
+
return l;
|
|
1805
|
+
}
|
|
1806
|
+
return Ke.default = t(), Ke;
|
|
1807
|
+
}
|
|
1808
|
+
var Jr;
|
|
1809
|
+
function Pr() {
|
|
1810
|
+
if (Jr) return me;
|
|
1811
|
+
Jr = 1, Object.defineProperty(me, "__esModule", {
|
|
1812
|
+
value: !0
|
|
1813
|
+
}), me.addClassName = b, me.addEvent = l, me.addUserSelectStyles = h, me.createCSSTransform = P, me.createSVGTransform = O, me.getTouch = a, me.getTouchIdentifier = s, me.getTranslation = u, me.innerHeight = g, me.innerWidth = p, me.matchesSelector = o, me.matchesSelectorAndParentsTo = i, me.offsetXYFromParent = w, me.outerHeight = d, me.outerWidth = v, me.removeClassName = R, me.removeEvent = c, me.scheduleRemoveUserSelectStyles = y;
|
|
1814
|
+
var e = tr(), t = r(Zo());
|
|
1815
|
+
function r(m, x) {
|
|
1816
|
+
if (typeof WeakMap == "function") var C = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap();
|
|
1817
|
+
return (r = function(W, G) {
|
|
1818
|
+
if (!G && W && W.__esModule) return W;
|
|
1819
|
+
var k, H, J = { __proto__: null, default: W };
|
|
1820
|
+
if (W === null || typeof W != "object" && typeof W != "function") return J;
|
|
1821
|
+
if (k = G ? $ : C) {
|
|
1822
|
+
if (k.has(W)) return k.get(W);
|
|
1823
|
+
k.set(W, J);
|
|
1824
|
+
}
|
|
1825
|
+
for (const X in W) X !== "default" && {}.hasOwnProperty.call(W, X) && ((H = (k = Object.defineProperty) && Object.getOwnPropertyDescriptor(W, X)) && (H.get || H.set) ? k(J, X, H) : J[X] = W[X]);
|
|
1826
|
+
return J;
|
|
1827
|
+
})(m, x);
|
|
1828
|
+
}
|
|
1829
|
+
let n = "";
|
|
1830
|
+
function o(m, x) {
|
|
1831
|
+
return n || (n = (0, e.findInArray)(["matches", "webkitMatchesSelector", "mozMatchesSelector", "msMatchesSelector", "oMatchesSelector"], function(C) {
|
|
1832
|
+
return (0, e.isFunction)(m[C]);
|
|
1833
|
+
})), (0, e.isFunction)(m[n]) ? m[n](x) : !1;
|
|
1834
|
+
}
|
|
1835
|
+
function i(m, x, C) {
|
|
1836
|
+
let $ = m;
|
|
1837
|
+
do {
|
|
1838
|
+
if (o($, x)) return !0;
|
|
1839
|
+
if ($ === C) return !1;
|
|
1840
|
+
$ = $.parentNode;
|
|
1841
|
+
} while ($);
|
|
1842
|
+
return !1;
|
|
1843
|
+
}
|
|
1844
|
+
function l(m, x, C, $) {
|
|
1845
|
+
if (!m) return;
|
|
1846
|
+
const W = {
|
|
1847
|
+
capture: !0,
|
|
1848
|
+
...$
|
|
1849
|
+
};
|
|
1850
|
+
m.addEventListener ? m.addEventListener(x, C, W) : m.attachEvent ? m.attachEvent("on" + x, C) : m["on" + x] = C;
|
|
1851
|
+
}
|
|
1852
|
+
function c(m, x, C, $) {
|
|
1853
|
+
if (!m) return;
|
|
1854
|
+
const W = {
|
|
1855
|
+
capture: !0,
|
|
1856
|
+
...$
|
|
1857
|
+
};
|
|
1858
|
+
m.removeEventListener ? m.removeEventListener(x, C, W) : m.detachEvent ? m.detachEvent("on" + x, C) : m["on" + x] = null;
|
|
1859
|
+
}
|
|
1860
|
+
function d(m) {
|
|
1861
|
+
let x = m.clientHeight;
|
|
1862
|
+
const C = m.ownerDocument.defaultView.getComputedStyle(m);
|
|
1863
|
+
return x += (0, e.int)(C.borderTopWidth), x += (0, e.int)(C.borderBottomWidth), x;
|
|
1864
|
+
}
|
|
1865
|
+
function v(m) {
|
|
1866
|
+
let x = m.clientWidth;
|
|
1867
|
+
const C = m.ownerDocument.defaultView.getComputedStyle(m);
|
|
1868
|
+
return x += (0, e.int)(C.borderLeftWidth), x += (0, e.int)(C.borderRightWidth), x;
|
|
1869
|
+
}
|
|
1870
|
+
function g(m) {
|
|
1871
|
+
let x = m.clientHeight;
|
|
1872
|
+
const C = m.ownerDocument.defaultView.getComputedStyle(m);
|
|
1873
|
+
return x -= (0, e.int)(C.paddingTop), x -= (0, e.int)(C.paddingBottom), x;
|
|
1874
|
+
}
|
|
1875
|
+
function p(m) {
|
|
1876
|
+
let x = m.clientWidth;
|
|
1877
|
+
const C = m.ownerDocument.defaultView.getComputedStyle(m);
|
|
1878
|
+
return x -= (0, e.int)(C.paddingLeft), x -= (0, e.int)(C.paddingRight), x;
|
|
1879
|
+
}
|
|
1880
|
+
function w(m, x, C) {
|
|
1881
|
+
const W = x === x.ownerDocument.body ? {
|
|
1882
|
+
left: 0,
|
|
1883
|
+
top: 0
|
|
1884
|
+
} : x.getBoundingClientRect(), G = (m.clientX + x.scrollLeft - W.left) / C, k = (m.clientY + x.scrollTop - W.top) / C;
|
|
1885
|
+
return {
|
|
1886
|
+
x: G,
|
|
1887
|
+
y: k
|
|
1888
|
+
};
|
|
1889
|
+
}
|
|
1890
|
+
function P(m, x) {
|
|
1891
|
+
const C = u(m, x, "px");
|
|
1892
|
+
return {
|
|
1893
|
+
[(0, t.browserPrefixToKey)("transform", t.default)]: C
|
|
1894
|
+
};
|
|
1895
|
+
}
|
|
1896
|
+
function O(m, x) {
|
|
1897
|
+
return u(m, x, "");
|
|
1898
|
+
}
|
|
1899
|
+
function u(m, x, C) {
|
|
1900
|
+
let {
|
|
1901
|
+
x: $,
|
|
1902
|
+
y: W
|
|
1903
|
+
} = m, G = `translate(${$}${C},${W}${C})`;
|
|
1904
|
+
if (x) {
|
|
1905
|
+
const k = `${typeof x.x == "string" ? x.x : x.x + C}`, H = `${typeof x.y == "string" ? x.y : x.y + C}`;
|
|
1906
|
+
G = `translate(${k}, ${H})` + G;
|
|
1907
|
+
}
|
|
1908
|
+
return G;
|
|
1909
|
+
}
|
|
1910
|
+
function a(m, x) {
|
|
1911
|
+
return m.targetTouches && (0, e.findInArray)(m.targetTouches, (C) => x === C.identifier) || m.changedTouches && (0, e.findInArray)(m.changedTouches, (C) => x === C.identifier);
|
|
1912
|
+
}
|
|
1913
|
+
function s(m) {
|
|
1914
|
+
if (m.targetTouches && m.targetTouches[0]) return m.targetTouches[0].identifier;
|
|
1915
|
+
if (m.changedTouches && m.changedTouches[0]) return m.changedTouches[0].identifier;
|
|
1916
|
+
}
|
|
1917
|
+
function h(m) {
|
|
1918
|
+
if (!m) return;
|
|
1919
|
+
let x = m.getElementById("react-draggable-style-el");
|
|
1920
|
+
x || (x = m.createElement("style"), x.type = "text/css", x.id = "react-draggable-style-el", x.innerHTML = `.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
1921
|
+
`, x.innerHTML += `.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
1922
|
+
`, m.getElementsByTagName("head")[0].appendChild(x)), m.body && b(m.body, "react-draggable-transparent-selection");
|
|
1923
|
+
}
|
|
1924
|
+
function y(m) {
|
|
1925
|
+
window.requestAnimationFrame ? window.requestAnimationFrame(() => {
|
|
1926
|
+
S(m);
|
|
1927
|
+
}) : S(m);
|
|
1928
|
+
}
|
|
1929
|
+
function S(m) {
|
|
1930
|
+
if (m)
|
|
1931
|
+
try {
|
|
1932
|
+
if (m.body && R(m.body, "react-draggable-transparent-selection"), m.selection)
|
|
1933
|
+
m.selection.empty();
|
|
1934
|
+
else {
|
|
1935
|
+
const x = (m.defaultView || window).getSelection();
|
|
1936
|
+
x && x.type !== "Caret" && x.removeAllRanges();
|
|
1937
|
+
}
|
|
1938
|
+
} catch {
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
function b(m, x) {
|
|
1942
|
+
m.classList ? m.classList.add(x) : m.className.match(new RegExp(`(?:^|\\s)${x}(?!\\S)`)) || (m.className += ` ${x}`);
|
|
1943
|
+
}
|
|
1944
|
+
function R(m, x) {
|
|
1945
|
+
m.classList ? m.classList.remove(x) : m.className = m.className.replace(new RegExp(`(?:^|\\s)${x}(?!\\S)`, "g"), "");
|
|
1946
|
+
}
|
|
1947
|
+
return me;
|
|
1948
|
+
}
|
|
1949
|
+
var We = {}, Kr;
|
|
1950
|
+
function In() {
|
|
1951
|
+
if (Kr) return We;
|
|
1952
|
+
Kr = 1, Object.defineProperty(We, "__esModule", {
|
|
1953
|
+
value: !0
|
|
1954
|
+
}), We.canDragX = o, We.canDragY = i, We.createCoreData = c, We.createDraggableData = d, We.getBoundPosition = r, We.getControlPosition = l, We.snapToGrid = n;
|
|
1955
|
+
var e = tr(), t = Pr();
|
|
1956
|
+
function r(p, w, P) {
|
|
1957
|
+
if (!p.props.bounds) return [w, P];
|
|
1958
|
+
let {
|
|
1959
|
+
bounds: O
|
|
1960
|
+
} = p.props;
|
|
1961
|
+
O = typeof O == "string" ? O : v(O);
|
|
1962
|
+
const u = g(p);
|
|
1963
|
+
if (typeof O == "string") {
|
|
1964
|
+
const {
|
|
1965
|
+
ownerDocument: a
|
|
1966
|
+
} = u, s = a.defaultView;
|
|
1967
|
+
let h;
|
|
1968
|
+
if (O === "parent" ? h = u.parentNode : h = u.getRootNode().querySelector(O), !(h instanceof s.HTMLElement))
|
|
1969
|
+
throw new Error('Bounds selector "' + O + '" could not find an element.');
|
|
1970
|
+
const y = h, S = s.getComputedStyle(u), b = s.getComputedStyle(y);
|
|
1971
|
+
O = {
|
|
1972
|
+
left: -u.offsetLeft + (0, e.int)(b.paddingLeft) + (0, e.int)(S.marginLeft),
|
|
1973
|
+
top: -u.offsetTop + (0, e.int)(b.paddingTop) + (0, e.int)(S.marginTop),
|
|
1974
|
+
right: (0, t.innerWidth)(y) - (0, t.outerWidth)(u) - u.offsetLeft + (0, e.int)(b.paddingRight) - (0, e.int)(S.marginRight),
|
|
1975
|
+
bottom: (0, t.innerHeight)(y) - (0, t.outerHeight)(u) - u.offsetTop + (0, e.int)(b.paddingBottom) - (0, e.int)(S.marginBottom)
|
|
1976
|
+
};
|
|
1977
|
+
}
|
|
1978
|
+
return (0, e.isNum)(O.right) && (w = Math.min(w, O.right)), (0, e.isNum)(O.bottom) && (P = Math.min(P, O.bottom)), (0, e.isNum)(O.left) && (w = Math.max(w, O.left)), (0, e.isNum)(O.top) && (P = Math.max(P, O.top)), [w, P];
|
|
1979
|
+
}
|
|
1980
|
+
function n(p, w, P) {
|
|
1981
|
+
const O = Math.round(w / p[0]) * p[0], u = Math.round(P / p[1]) * p[1];
|
|
1982
|
+
return [O, u];
|
|
1983
|
+
}
|
|
1984
|
+
function o(p) {
|
|
1985
|
+
return p.props.axis === "both" || p.props.axis === "x";
|
|
1986
|
+
}
|
|
1987
|
+
function i(p) {
|
|
1988
|
+
return p.props.axis === "both" || p.props.axis === "y";
|
|
1989
|
+
}
|
|
1990
|
+
function l(p, w, P) {
|
|
1991
|
+
const O = typeof w == "number" ? (0, t.getTouch)(p, w) : null;
|
|
1992
|
+
if (typeof w == "number" && !O) return null;
|
|
1993
|
+
const u = g(P), a = P.props.offsetParent || u.offsetParent || u.ownerDocument.body;
|
|
1994
|
+
return (0, t.offsetXYFromParent)(O || p, a, P.props.scale);
|
|
1995
|
+
}
|
|
1996
|
+
function c(p, w, P) {
|
|
1997
|
+
const O = !(0, e.isNum)(p.lastX), u = g(p);
|
|
1998
|
+
return O ? {
|
|
1999
|
+
node: u,
|
|
2000
|
+
deltaX: 0,
|
|
2001
|
+
deltaY: 0,
|
|
2002
|
+
lastX: w,
|
|
2003
|
+
lastY: P,
|
|
2004
|
+
x: w,
|
|
2005
|
+
y: P
|
|
2006
|
+
} : {
|
|
2007
|
+
node: u,
|
|
2008
|
+
deltaX: w - p.lastX,
|
|
2009
|
+
deltaY: P - p.lastY,
|
|
2010
|
+
lastX: p.lastX,
|
|
2011
|
+
lastY: p.lastY,
|
|
2012
|
+
x: w,
|
|
2013
|
+
y: P
|
|
2014
|
+
};
|
|
2015
|
+
}
|
|
2016
|
+
function d(p, w) {
|
|
2017
|
+
const P = p.props.scale;
|
|
2018
|
+
return {
|
|
2019
|
+
node: w.node,
|
|
2020
|
+
x: p.state.x + w.deltaX / P,
|
|
2021
|
+
y: p.state.y + w.deltaY / P,
|
|
2022
|
+
deltaX: w.deltaX / P,
|
|
2023
|
+
deltaY: w.deltaY / P,
|
|
2024
|
+
lastX: p.state.x,
|
|
2025
|
+
lastY: p.state.y
|
|
2026
|
+
};
|
|
2027
|
+
}
|
|
2028
|
+
function v(p) {
|
|
2029
|
+
return {
|
|
2030
|
+
left: p.left,
|
|
2031
|
+
top: p.top,
|
|
2032
|
+
right: p.right,
|
|
2033
|
+
bottom: p.bottom
|
|
2034
|
+
};
|
|
2035
|
+
}
|
|
2036
|
+
function g(p) {
|
|
2037
|
+
const w = p.findDOMNode();
|
|
2038
|
+
if (!w)
|
|
2039
|
+
throw new Error("<DraggableCore>: Unmounted during event!");
|
|
2040
|
+
return w;
|
|
2041
|
+
}
|
|
2042
|
+
return We;
|
|
2043
|
+
}
|
|
2044
|
+
var vt = {}, Wt = {}, Zr;
|
|
2045
|
+
function Wn() {
|
|
2046
|
+
if (Zr) return Wt;
|
|
2047
|
+
Zr = 1, Object.defineProperty(Wt, "__esModule", {
|
|
2048
|
+
value: !0
|
|
2049
|
+
}), Wt.default = e;
|
|
2050
|
+
function e() {
|
|
2051
|
+
}
|
|
2052
|
+
return Wt;
|
|
2053
|
+
}
|
|
2054
|
+
var Qr;
|
|
2055
|
+
function Qo() {
|
|
2056
|
+
if (Qr) return vt;
|
|
2057
|
+
Qr = 1, Object.defineProperty(vt, "__esModule", {
|
|
2058
|
+
value: !0
|
|
2059
|
+
}), vt.default = void 0;
|
|
2060
|
+
var e = d(Re), t = c(/* @__PURE__ */ er()), r = c(mn), n = Pr(), o = In(), i = tr(), l = c(Wn());
|
|
2061
|
+
function c(u) {
|
|
2062
|
+
return u && u.__esModule ? u : { default: u };
|
|
2063
|
+
}
|
|
2064
|
+
function d(u, a) {
|
|
2065
|
+
if (typeof WeakMap == "function") var s = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap();
|
|
2066
|
+
return (d = function(y, S) {
|
|
2067
|
+
if (!S && y && y.__esModule) return y;
|
|
2068
|
+
var b, R, m = { __proto__: null, default: y };
|
|
2069
|
+
if (y === null || typeof y != "object" && typeof y != "function") return m;
|
|
2070
|
+
if (b = S ? h : s) {
|
|
2071
|
+
if (b.has(y)) return b.get(y);
|
|
2072
|
+
b.set(y, m);
|
|
2073
|
+
}
|
|
2074
|
+
for (const x in y) x !== "default" && {}.hasOwnProperty.call(y, x) && ((R = (b = Object.defineProperty) && Object.getOwnPropertyDescriptor(y, x)) && (R.get || R.set) ? b(m, x, R) : m[x] = y[x]);
|
|
2075
|
+
return m;
|
|
2076
|
+
})(u, a);
|
|
2077
|
+
}
|
|
2078
|
+
function v(u, a, s) {
|
|
2079
|
+
return (a = g(a)) in u ? Object.defineProperty(u, a, { value: s, enumerable: !0, configurable: !0, writable: !0 }) : u[a] = s, u;
|
|
2080
|
+
}
|
|
2081
|
+
function g(u) {
|
|
2082
|
+
var a = p(u, "string");
|
|
2083
|
+
return typeof a == "symbol" ? a : a + "";
|
|
2084
|
+
}
|
|
2085
|
+
function p(u, a) {
|
|
2086
|
+
if (typeof u != "object" || !u) return u;
|
|
2087
|
+
var s = u[Symbol.toPrimitive];
|
|
2088
|
+
if (s !== void 0) {
|
|
2089
|
+
var h = s.call(u, a);
|
|
2090
|
+
if (typeof h != "object") return h;
|
|
2091
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2092
|
+
}
|
|
2093
|
+
return (a === "string" ? String : Number)(u);
|
|
2094
|
+
}
|
|
2095
|
+
const w = {
|
|
2096
|
+
touch: {
|
|
2097
|
+
start: "touchstart",
|
|
2098
|
+
move: "touchmove",
|
|
2099
|
+
stop: "touchend"
|
|
2100
|
+
},
|
|
2101
|
+
mouse: {
|
|
2102
|
+
start: "mousedown",
|
|
2103
|
+
move: "mousemove",
|
|
2104
|
+
stop: "mouseup"
|
|
2105
|
+
}
|
|
2106
|
+
};
|
|
2107
|
+
let P = w.mouse, O = class extends e.Component {
|
|
2108
|
+
constructor() {
|
|
2109
|
+
super(...arguments), v(this, "dragging", !1), v(this, "lastX", NaN), v(this, "lastY", NaN), v(this, "touchIdentifier", null), v(this, "mounted", !1), v(this, "handleDragStart", (a) => {
|
|
2110
|
+
if (this.props.onMouseDown(a), !this.props.allowAnyClick && typeof a.button == "number" && a.button !== 0) return !1;
|
|
2111
|
+
const s = this.findDOMNode();
|
|
2112
|
+
if (!s || !s.ownerDocument || !s.ownerDocument.body)
|
|
2113
|
+
throw new Error("<DraggableCore> not mounted on DragStart!");
|
|
2114
|
+
const {
|
|
2115
|
+
ownerDocument: h
|
|
2116
|
+
} = s;
|
|
2117
|
+
if (this.props.disabled || !(a.target instanceof h.defaultView.Node) || this.props.handle && !(0, n.matchesSelectorAndParentsTo)(a.target, this.props.handle, s) || this.props.cancel && (0, n.matchesSelectorAndParentsTo)(a.target, this.props.cancel, s))
|
|
2118
|
+
return;
|
|
2119
|
+
a.type === "touchstart" && !this.props.allowMobileScroll && a.preventDefault();
|
|
2120
|
+
const y = (0, n.getTouchIdentifier)(a);
|
|
2121
|
+
this.touchIdentifier = y;
|
|
2122
|
+
const S = (0, o.getControlPosition)(a, y, this);
|
|
2123
|
+
if (S == null) return;
|
|
2124
|
+
const {
|
|
2125
|
+
x: b,
|
|
2126
|
+
y: R
|
|
2127
|
+
} = S, m = (0, o.createCoreData)(this, b, R);
|
|
2128
|
+
(0, l.default)("DraggableCore: handleDragStart: %j", m), (0, l.default)("calling", this.props.onStart), !(this.props.onStart(a, m) === !1 || this.mounted === !1) && (this.props.enableUserSelectHack && (0, n.addUserSelectStyles)(h), this.dragging = !0, this.lastX = b, this.lastY = R, (0, n.addEvent)(h, P.move, this.handleDrag), (0, n.addEvent)(h, P.stop, this.handleDragStop));
|
|
2129
|
+
}), v(this, "handleDrag", (a) => {
|
|
2130
|
+
const s = (0, o.getControlPosition)(a, this.touchIdentifier, this);
|
|
2131
|
+
if (s == null) return;
|
|
2132
|
+
let {
|
|
2133
|
+
x: h,
|
|
2134
|
+
y
|
|
2135
|
+
} = s;
|
|
2136
|
+
if (Array.isArray(this.props.grid)) {
|
|
2137
|
+
let R = h - this.lastX, m = y - this.lastY;
|
|
2138
|
+
if ([R, m] = (0, o.snapToGrid)(this.props.grid, R, m), !R && !m) return;
|
|
2139
|
+
h = this.lastX + R, y = this.lastY + m;
|
|
2140
|
+
}
|
|
2141
|
+
const S = (0, o.createCoreData)(this, h, y);
|
|
2142
|
+
if ((0, l.default)("DraggableCore: handleDrag: %j", S), this.props.onDrag(a, S) === !1 || this.mounted === !1) {
|
|
2143
|
+
try {
|
|
2144
|
+
this.handleDragStop(new MouseEvent("mouseup"));
|
|
2145
|
+
} catch {
|
|
2146
|
+
const m = document.createEvent("MouseEvents");
|
|
2147
|
+
m.initMouseEvent("mouseup", !0, !0, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), this.handleDragStop(m);
|
|
2148
|
+
}
|
|
2149
|
+
return;
|
|
2150
|
+
}
|
|
2151
|
+
this.lastX = h, this.lastY = y;
|
|
2152
|
+
}), v(this, "handleDragStop", (a) => {
|
|
2153
|
+
if (!this.dragging) return;
|
|
2154
|
+
const s = (0, o.getControlPosition)(a, this.touchIdentifier, this);
|
|
2155
|
+
if (s == null) return;
|
|
2156
|
+
let {
|
|
2157
|
+
x: h,
|
|
2158
|
+
y
|
|
2159
|
+
} = s;
|
|
2160
|
+
if (Array.isArray(this.props.grid)) {
|
|
2161
|
+
let m = h - this.lastX || 0, x = y - this.lastY || 0;
|
|
2162
|
+
[m, x] = (0, o.snapToGrid)(this.props.grid, m, x), h = this.lastX + m, y = this.lastY + x;
|
|
2163
|
+
}
|
|
2164
|
+
const S = (0, o.createCoreData)(this, h, y);
|
|
2165
|
+
if (this.props.onStop(a, S) === !1 || this.mounted === !1) return !1;
|
|
2166
|
+
const R = this.findDOMNode();
|
|
2167
|
+
R && this.props.enableUserSelectHack && (0, n.scheduleRemoveUserSelectStyles)(R.ownerDocument), (0, l.default)("DraggableCore: handleDragStop: %j", S), this.dragging = !1, this.lastX = NaN, this.lastY = NaN, R && ((0, l.default)("DraggableCore: Removing handlers"), (0, n.removeEvent)(R.ownerDocument, P.move, this.handleDrag), (0, n.removeEvent)(R.ownerDocument, P.stop, this.handleDragStop));
|
|
2168
|
+
}), v(this, "onMouseDown", (a) => (P = w.mouse, this.handleDragStart(a))), v(this, "onMouseUp", (a) => (P = w.mouse, this.handleDragStop(a))), v(this, "onTouchStart", (a) => (P = w.touch, this.handleDragStart(a))), v(this, "onTouchEnd", (a) => (P = w.touch, this.handleDragStop(a)));
|
|
2169
|
+
}
|
|
2170
|
+
componentDidMount() {
|
|
2171
|
+
this.mounted = !0;
|
|
2172
|
+
const a = this.findDOMNode();
|
|
2173
|
+
a && (0, n.addEvent)(a, w.touch.start, this.onTouchStart, {
|
|
2174
|
+
passive: !1
|
|
2175
|
+
});
|
|
2176
|
+
}
|
|
2177
|
+
componentWillUnmount() {
|
|
2178
|
+
this.mounted = !1;
|
|
2179
|
+
const a = this.findDOMNode();
|
|
2180
|
+
if (a) {
|
|
2181
|
+
const {
|
|
2182
|
+
ownerDocument: s
|
|
2183
|
+
} = a;
|
|
2184
|
+
(0, n.removeEvent)(s, w.mouse.move, this.handleDrag), (0, n.removeEvent)(s, w.touch.move, this.handleDrag), (0, n.removeEvent)(s, w.mouse.stop, this.handleDragStop), (0, n.removeEvent)(s, w.touch.stop, this.handleDragStop), (0, n.removeEvent)(a, w.touch.start, this.onTouchStart, {
|
|
2185
|
+
passive: !1
|
|
2186
|
+
}), this.props.enableUserSelectHack && (0, n.scheduleRemoveUserSelectStyles)(s);
|
|
2187
|
+
}
|
|
2188
|
+
}
|
|
2189
|
+
// React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
|
|
2190
|
+
// the underlying DOM node ourselves. See the README for more information.
|
|
2191
|
+
findDOMNode() {
|
|
2192
|
+
return this.props?.nodeRef ? this.props?.nodeRef?.current : r.default.findDOMNode(this);
|
|
2193
|
+
}
|
|
2194
|
+
render() {
|
|
2195
|
+
return /* @__PURE__ */ e.cloneElement(e.Children.only(this.props.children), {
|
|
2196
|
+
// Note: mouseMove handler is attached to document so it will still function
|
|
2197
|
+
// when the user drags quickly and leaves the bounds of the element.
|
|
2198
|
+
onMouseDown: this.onMouseDown,
|
|
2199
|
+
onMouseUp: this.onMouseUp,
|
|
2200
|
+
// onTouchStart is added on `componentDidMount` so they can be added with
|
|
2201
|
+
// {passive: false}, which allows it to cancel. See
|
|
2202
|
+
// https://developers.google.com/web/updates/2017/01/scrolling-intervention
|
|
2203
|
+
onTouchEnd: this.onTouchEnd
|
|
2204
|
+
});
|
|
2205
|
+
}
|
|
2206
|
+
};
|
|
2207
|
+
return vt.default = O, v(O, "displayName", "DraggableCore"), v(O, "propTypes", {
|
|
2208
|
+
/**
|
|
2209
|
+
* `allowAnyClick` allows dragging using any mouse button.
|
|
2210
|
+
* By default, we only accept the left button.
|
|
2211
|
+
*
|
|
2212
|
+
* Defaults to `false`.
|
|
2213
|
+
*/
|
|
2214
|
+
allowAnyClick: t.default.bool,
|
|
2215
|
+
/**
|
|
2216
|
+
* `allowMobileScroll` turns off cancellation of the 'touchstart' event
|
|
2217
|
+
* on mobile devices. Only enable this if you are having trouble with click
|
|
2218
|
+
* events. Prefer using 'handle' / 'cancel' instead.
|
|
2219
|
+
*
|
|
2220
|
+
* Defaults to `false`.
|
|
2221
|
+
*/
|
|
2222
|
+
allowMobileScroll: t.default.bool,
|
|
2223
|
+
children: t.default.node.isRequired,
|
|
2224
|
+
/**
|
|
2225
|
+
* `disabled`, if true, stops the <Draggable> from dragging. All handlers,
|
|
2226
|
+
* with the exception of `onMouseDown`, will not fire.
|
|
2227
|
+
*/
|
|
2228
|
+
disabled: t.default.bool,
|
|
2229
|
+
/**
|
|
2230
|
+
* By default, we add 'user-select:none' attributes to the document body
|
|
2231
|
+
* to prevent ugly text selection during drag. If this is causing problems
|
|
2232
|
+
* for your app, set this to `false`.
|
|
2233
|
+
*/
|
|
2234
|
+
enableUserSelectHack: t.default.bool,
|
|
2235
|
+
/**
|
|
2236
|
+
* `offsetParent`, if set, uses the passed DOM node to compute drag offsets
|
|
2237
|
+
* instead of using the parent node.
|
|
2238
|
+
*/
|
|
2239
|
+
offsetParent: function(u, a) {
|
|
2240
|
+
if (u[a] && u[a].nodeType !== 1)
|
|
2241
|
+
throw new Error("Draggable's offsetParent must be a DOM Node.");
|
|
2242
|
+
},
|
|
2243
|
+
/**
|
|
2244
|
+
* `grid` specifies the x and y that dragging should snap to.
|
|
2245
|
+
*/
|
|
2246
|
+
grid: t.default.arrayOf(t.default.number),
|
|
2247
|
+
/**
|
|
2248
|
+
* `handle` specifies a selector to be used as the handle that initiates drag.
|
|
2249
|
+
*
|
|
2250
|
+
* Example:
|
|
2251
|
+
*
|
|
2252
|
+
* ```jsx
|
|
2253
|
+
* let App = React.createClass({
|
|
2254
|
+
* render: function () {
|
|
2255
|
+
* return (
|
|
2256
|
+
* <Draggable handle=".handle">
|
|
2257
|
+
* <div>
|
|
2258
|
+
* <div className="handle">Click me to drag</div>
|
|
2259
|
+
* <div>This is some other content</div>
|
|
2260
|
+
* </div>
|
|
2261
|
+
* </Draggable>
|
|
2262
|
+
* );
|
|
2263
|
+
* }
|
|
2264
|
+
* });
|
|
2265
|
+
* ```
|
|
2266
|
+
*/
|
|
2267
|
+
handle: t.default.string,
|
|
2268
|
+
/**
|
|
2269
|
+
* `cancel` specifies a selector to be used to prevent drag initialization.
|
|
2270
|
+
*
|
|
2271
|
+
* Example:
|
|
2272
|
+
*
|
|
2273
|
+
* ```jsx
|
|
2274
|
+
* let App = React.createClass({
|
|
2275
|
+
* render: function () {
|
|
2276
|
+
* return(
|
|
2277
|
+
* <Draggable cancel=".cancel">
|
|
2278
|
+
* <div>
|
|
2279
|
+
* <div className="cancel">You can't drag from here</div>
|
|
2280
|
+
* <div>Dragging here works fine</div>
|
|
2281
|
+
* </div>
|
|
2282
|
+
* </Draggable>
|
|
2283
|
+
* );
|
|
2284
|
+
* }
|
|
2285
|
+
* });
|
|
2286
|
+
* ```
|
|
2287
|
+
*/
|
|
2288
|
+
cancel: t.default.string,
|
|
2289
|
+
/* If running in React Strict mode, ReactDOM.findDOMNode() is deprecated.
|
|
2290
|
+
* Unfortunately, in order for <Draggable> to work properly, we need raw access
|
|
2291
|
+
* to the underlying DOM node. If you want to avoid the warning, pass a `nodeRef`
|
|
2292
|
+
* as in this example:
|
|
2293
|
+
*
|
|
2294
|
+
* function MyComponent() {
|
|
2295
|
+
* const nodeRef = React.useRef(null);
|
|
2296
|
+
* return (
|
|
2297
|
+
* <Draggable nodeRef={nodeRef}>
|
|
2298
|
+
* <div ref={nodeRef}>Example Target</div>
|
|
2299
|
+
* </Draggable>
|
|
2300
|
+
* );
|
|
2301
|
+
* }
|
|
2302
|
+
*
|
|
2303
|
+
* This can be used for arbitrarily nested components, so long as the ref ends up
|
|
2304
|
+
* pointing to the actual child DOM node and not a custom component.
|
|
2305
|
+
*/
|
|
2306
|
+
nodeRef: t.default.object,
|
|
2307
|
+
/**
|
|
2308
|
+
* Called when dragging starts.
|
|
2309
|
+
* If this function returns the boolean false, dragging will be canceled.
|
|
2310
|
+
*/
|
|
2311
|
+
onStart: t.default.func,
|
|
2312
|
+
/**
|
|
2313
|
+
* Called while dragging.
|
|
2314
|
+
* If this function returns the boolean false, dragging will be canceled.
|
|
2315
|
+
*/
|
|
2316
|
+
onDrag: t.default.func,
|
|
2317
|
+
/**
|
|
2318
|
+
* Called when dragging stops.
|
|
2319
|
+
* If this function returns the boolean false, the drag will remain active.
|
|
2320
|
+
*/
|
|
2321
|
+
onStop: t.default.func,
|
|
2322
|
+
/**
|
|
2323
|
+
* A workaround option which can be passed if onMouseDown needs to be accessed,
|
|
2324
|
+
* since it'll always be blocked (as there is internal use of onMouseDown)
|
|
2325
|
+
*/
|
|
2326
|
+
onMouseDown: t.default.func,
|
|
2327
|
+
/**
|
|
2328
|
+
* `scale`, if set, applies scaling while dragging an element
|
|
2329
|
+
*/
|
|
2330
|
+
scale: t.default.number,
|
|
2331
|
+
/**
|
|
2332
|
+
* These properties should be defined on the child, not here.
|
|
2333
|
+
*/
|
|
2334
|
+
className: i.dontSetMe,
|
|
2335
|
+
style: i.dontSetMe,
|
|
2336
|
+
transform: i.dontSetMe
|
|
2337
|
+
}), v(O, "defaultProps", {
|
|
2338
|
+
allowAnyClick: !1,
|
|
2339
|
+
// by default only accept left click
|
|
2340
|
+
allowMobileScroll: !1,
|
|
2341
|
+
disabled: !1,
|
|
2342
|
+
enableUserSelectHack: !0,
|
|
2343
|
+
onStart: function() {
|
|
2344
|
+
},
|
|
2345
|
+
onDrag: function() {
|
|
2346
|
+
},
|
|
2347
|
+
onStop: function() {
|
|
2348
|
+
},
|
|
2349
|
+
onMouseDown: function() {
|
|
2350
|
+
},
|
|
2351
|
+
scale: 1
|
|
2352
|
+
}), vt;
|
|
2353
|
+
}
|
|
2354
|
+
var en;
|
|
2355
|
+
function ea() {
|
|
2356
|
+
return en || (en = 1, (function(e) {
|
|
2357
|
+
Object.defineProperty(e, "__esModule", {
|
|
2358
|
+
value: !0
|
|
2359
|
+
}), Object.defineProperty(e, "DraggableCore", {
|
|
2360
|
+
enumerable: !0,
|
|
2361
|
+
get: function() {
|
|
2362
|
+
return d.default;
|
|
2363
|
+
}
|
|
2364
|
+
}), e.default = void 0;
|
|
2365
|
+
var t = p(Re), r = g(/* @__PURE__ */ er()), n = g(mn), o = mr, i = Pr(), l = In(), c = tr(), d = g(Qo()), v = g(Wn());
|
|
2366
|
+
function g(s) {
|
|
2367
|
+
return s && s.__esModule ? s : { default: s };
|
|
2368
|
+
}
|
|
2369
|
+
function p(s, h) {
|
|
2370
|
+
if (typeof WeakMap == "function") var y = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap();
|
|
2371
|
+
return (p = function(b, R) {
|
|
2372
|
+
if (!R && b && b.__esModule) return b;
|
|
2373
|
+
var m, x, C = { __proto__: null, default: b };
|
|
2374
|
+
if (b === null || typeof b != "object" && typeof b != "function") return C;
|
|
2375
|
+
if (m = R ? S : y) {
|
|
2376
|
+
if (m.has(b)) return m.get(b);
|
|
2377
|
+
m.set(b, C);
|
|
2378
|
+
}
|
|
2379
|
+
for (const $ in b) $ !== "default" && {}.hasOwnProperty.call(b, $) && ((x = (m = Object.defineProperty) && Object.getOwnPropertyDescriptor(b, $)) && (x.get || x.set) ? m(C, $, x) : C[$] = b[$]);
|
|
2380
|
+
return C;
|
|
2381
|
+
})(s, h);
|
|
2382
|
+
}
|
|
2383
|
+
function w() {
|
|
2384
|
+
return w = Object.assign ? Object.assign.bind() : function(s) {
|
|
2385
|
+
for (var h = 1; h < arguments.length; h++) {
|
|
2386
|
+
var y = arguments[h];
|
|
2387
|
+
for (var S in y) ({}).hasOwnProperty.call(y, S) && (s[S] = y[S]);
|
|
2388
|
+
}
|
|
2389
|
+
return s;
|
|
2390
|
+
}, w.apply(null, arguments);
|
|
2391
|
+
}
|
|
2392
|
+
function P(s, h, y) {
|
|
2393
|
+
return (h = O(h)) in s ? Object.defineProperty(s, h, { value: y, enumerable: !0, configurable: !0, writable: !0 }) : s[h] = y, s;
|
|
2394
|
+
}
|
|
2395
|
+
function O(s) {
|
|
2396
|
+
var h = u(s, "string");
|
|
2397
|
+
return typeof h == "symbol" ? h : h + "";
|
|
2398
|
+
}
|
|
2399
|
+
function u(s, h) {
|
|
2400
|
+
if (typeof s != "object" || !s) return s;
|
|
2401
|
+
var y = s[Symbol.toPrimitive];
|
|
2402
|
+
if (y !== void 0) {
|
|
2403
|
+
var S = y.call(s, h);
|
|
2404
|
+
if (typeof S != "object") return S;
|
|
2405
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2406
|
+
}
|
|
2407
|
+
return (h === "string" ? String : Number)(s);
|
|
2408
|
+
}
|
|
2409
|
+
class a extends t.Component {
|
|
2410
|
+
// React 16.3+
|
|
2411
|
+
// Arity (props, state)
|
|
2412
|
+
static getDerivedStateFromProps(h, y) {
|
|
2413
|
+
let {
|
|
2414
|
+
position: S
|
|
2415
|
+
} = h, {
|
|
2416
|
+
prevPropsPosition: b
|
|
2417
|
+
} = y;
|
|
2418
|
+
return S && (!b || S.x !== b.x || S.y !== b.y) ? ((0, v.default)("Draggable: getDerivedStateFromProps %j", {
|
|
2419
|
+
position: S,
|
|
2420
|
+
prevPropsPosition: b
|
|
2421
|
+
}), {
|
|
2422
|
+
x: S.x,
|
|
2423
|
+
y: S.y,
|
|
2424
|
+
prevPropsPosition: {
|
|
2425
|
+
...S
|
|
2426
|
+
}
|
|
2427
|
+
}) : null;
|
|
2428
|
+
}
|
|
2429
|
+
constructor(h) {
|
|
2430
|
+
super(h), P(this, "onDragStart", (y, S) => {
|
|
2431
|
+
if ((0, v.default)("Draggable: onDragStart: %j", S), this.props.onStart(y, (0, l.createDraggableData)(this, S)) === !1) return !1;
|
|
2432
|
+
this.setState({
|
|
2433
|
+
dragging: !0,
|
|
2434
|
+
dragged: !0
|
|
2435
|
+
});
|
|
2436
|
+
}), P(this, "onDrag", (y, S) => {
|
|
2437
|
+
if (!this.state.dragging) return !1;
|
|
2438
|
+
(0, v.default)("Draggable: onDrag: %j", S);
|
|
2439
|
+
const b = (0, l.createDraggableData)(this, S), R = {
|
|
2440
|
+
x: b.x,
|
|
2441
|
+
y: b.y,
|
|
2442
|
+
slackX: 0,
|
|
2443
|
+
slackY: 0
|
|
2444
|
+
};
|
|
2445
|
+
if (this.props.bounds) {
|
|
2446
|
+
const {
|
|
2447
|
+
x,
|
|
2448
|
+
y: C
|
|
2449
|
+
} = R;
|
|
2450
|
+
R.x += this.state.slackX, R.y += this.state.slackY;
|
|
2451
|
+
const [$, W] = (0, l.getBoundPosition)(this, R.x, R.y);
|
|
2452
|
+
R.x = $, R.y = W, R.slackX = this.state.slackX + (x - R.x), R.slackY = this.state.slackY + (C - R.y), b.x = R.x, b.y = R.y, b.deltaX = R.x - this.state.x, b.deltaY = R.y - this.state.y;
|
|
2453
|
+
}
|
|
2454
|
+
if (this.props.onDrag(y, b) === !1) return !1;
|
|
2455
|
+
this.setState(R);
|
|
2456
|
+
}), P(this, "onDragStop", (y, S) => {
|
|
2457
|
+
if (!this.state.dragging || this.props.onStop(y, (0, l.createDraggableData)(this, S)) === !1) return !1;
|
|
2458
|
+
(0, v.default)("Draggable: onDragStop: %j", S);
|
|
2459
|
+
const R = {
|
|
2460
|
+
dragging: !1,
|
|
2461
|
+
slackX: 0,
|
|
2462
|
+
slackY: 0
|
|
2463
|
+
};
|
|
2464
|
+
if (!!this.props.position) {
|
|
2465
|
+
const {
|
|
2466
|
+
x,
|
|
2467
|
+
y: C
|
|
2468
|
+
} = this.props.position;
|
|
2469
|
+
R.x = x, R.y = C;
|
|
2470
|
+
}
|
|
2471
|
+
this.setState(R);
|
|
2472
|
+
}), this.state = {
|
|
2473
|
+
// Whether or not we are currently dragging.
|
|
2474
|
+
dragging: !1,
|
|
2475
|
+
// Whether or not we have been dragged before.
|
|
2476
|
+
dragged: !1,
|
|
2477
|
+
// Current transform x and y.
|
|
2478
|
+
x: h.position ? h.position.x : h.defaultPosition.x,
|
|
2479
|
+
y: h.position ? h.position.y : h.defaultPosition.y,
|
|
2480
|
+
prevPropsPosition: {
|
|
2481
|
+
...h.position
|
|
2482
|
+
},
|
|
2483
|
+
// Used for compensating for out-of-bounds drags
|
|
2484
|
+
slackX: 0,
|
|
2485
|
+
slackY: 0,
|
|
2486
|
+
// Can only determine if SVG after mounting
|
|
2487
|
+
isElementSVG: !1
|
|
2488
|
+
}, h.position && !(h.onDrag || h.onStop) && 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.");
|
|
2489
|
+
}
|
|
2490
|
+
componentDidMount() {
|
|
2491
|
+
typeof window.SVGElement < "u" && this.findDOMNode() instanceof window.SVGElement && this.setState({
|
|
2492
|
+
isElementSVG: !0
|
|
2493
|
+
});
|
|
2494
|
+
}
|
|
2495
|
+
componentWillUnmount() {
|
|
2496
|
+
this.state.dragging && this.setState({
|
|
2497
|
+
dragging: !1
|
|
2498
|
+
});
|
|
2499
|
+
}
|
|
2500
|
+
// React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
|
|
2501
|
+
// the underlying DOM node ourselves. See the README for more information.
|
|
2502
|
+
findDOMNode() {
|
|
2503
|
+
return this.props?.nodeRef?.current ?? n.default.findDOMNode(this);
|
|
2504
|
+
}
|
|
2505
|
+
render() {
|
|
2506
|
+
const {
|
|
2507
|
+
axis: h,
|
|
2508
|
+
bounds: y,
|
|
2509
|
+
children: S,
|
|
2510
|
+
defaultPosition: b,
|
|
2511
|
+
defaultClassName: R,
|
|
2512
|
+
defaultClassNameDragging: m,
|
|
2513
|
+
defaultClassNameDragged: x,
|
|
2514
|
+
position: C,
|
|
2515
|
+
positionOffset: $,
|
|
2516
|
+
scale: W,
|
|
2517
|
+
...G
|
|
2518
|
+
} = this.props;
|
|
2519
|
+
let k = {}, H = null;
|
|
2520
|
+
const X = !!!C || this.state.dragging, V = C || b, ie = {
|
|
2521
|
+
// Set left if horizontal drag is enabled
|
|
2522
|
+
x: (0, l.canDragX)(this) && X ? this.state.x : V.x,
|
|
2523
|
+
// Set top if vertical drag is enabled
|
|
2524
|
+
y: (0, l.canDragY)(this) && X ? this.state.y : V.y
|
|
2525
|
+
};
|
|
2526
|
+
this.state.isElementSVG ? H = (0, i.createSVGTransform)(ie, $) : k = (0, i.createCSSTransform)(ie, $);
|
|
2527
|
+
const ge = (0, o.clsx)(S.props.className || "", R, {
|
|
2528
|
+
[m]: this.state.dragging,
|
|
2529
|
+
[x]: this.state.dragged
|
|
2530
|
+
});
|
|
2531
|
+
return /* @__PURE__ */ t.createElement(d.default, w({}, G, {
|
|
2532
|
+
onStart: this.onDragStart,
|
|
2533
|
+
onDrag: this.onDrag,
|
|
2534
|
+
onStop: this.onDragStop
|
|
2535
|
+
}), /* @__PURE__ */ t.cloneElement(t.Children.only(S), {
|
|
2536
|
+
className: ge,
|
|
2537
|
+
style: {
|
|
2538
|
+
...S.props.style,
|
|
2539
|
+
...k
|
|
2540
|
+
},
|
|
2541
|
+
transform: H
|
|
2542
|
+
}));
|
|
2543
|
+
}
|
|
2544
|
+
}
|
|
2545
|
+
e.default = a, P(a, "displayName", "Draggable"), P(a, "propTypes", {
|
|
2546
|
+
// Accepts all props <DraggableCore> accepts.
|
|
2547
|
+
...d.default.propTypes,
|
|
2548
|
+
/**
|
|
2549
|
+
* `axis` determines which axis the draggable can move.
|
|
2550
|
+
*
|
|
2551
|
+
* Note that all callbacks will still return data as normal. This only
|
|
2552
|
+
* controls flushing to the DOM.
|
|
2553
|
+
*
|
|
2554
|
+
* 'both' allows movement horizontally and vertically.
|
|
2555
|
+
* 'x' limits movement to horizontal axis.
|
|
2556
|
+
* 'y' limits movement to vertical axis.
|
|
2557
|
+
* 'none' limits all movement.
|
|
2558
|
+
*
|
|
2559
|
+
* Defaults to 'both'.
|
|
2560
|
+
*/
|
|
2561
|
+
axis: r.default.oneOf(["both", "x", "y", "none"]),
|
|
2562
|
+
/**
|
|
2563
|
+
* `bounds` determines the range of movement available to the element.
|
|
2564
|
+
* Available values are:
|
|
2565
|
+
*
|
|
2566
|
+
* 'parent' restricts movement within the Draggable's parent node.
|
|
2567
|
+
*
|
|
2568
|
+
* Alternatively, pass an object with the following properties, all of which are optional:
|
|
2569
|
+
*
|
|
2570
|
+
* {left: LEFT_BOUND, right: RIGHT_BOUND, bottom: BOTTOM_BOUND, top: TOP_BOUND}
|
|
2571
|
+
*
|
|
2572
|
+
* All values are in px.
|
|
2573
|
+
*
|
|
2574
|
+
* Example:
|
|
2575
|
+
*
|
|
2576
|
+
* ```jsx
|
|
2577
|
+
* let App = React.createClass({
|
|
2578
|
+
* render: function () {
|
|
2579
|
+
* return (
|
|
2580
|
+
* <Draggable bounds={{right: 300, bottom: 300}}>
|
|
2581
|
+
* <div>Content</div>
|
|
2582
|
+
* </Draggable>
|
|
2583
|
+
* );
|
|
2584
|
+
* }
|
|
2585
|
+
* });
|
|
2586
|
+
* ```
|
|
2587
|
+
*/
|
|
2588
|
+
bounds: r.default.oneOfType([r.default.shape({
|
|
2589
|
+
left: r.default.number,
|
|
2590
|
+
right: r.default.number,
|
|
2591
|
+
top: r.default.number,
|
|
2592
|
+
bottom: r.default.number
|
|
2593
|
+
}), r.default.string, r.default.oneOf([!1])]),
|
|
2594
|
+
defaultClassName: r.default.string,
|
|
2595
|
+
defaultClassNameDragging: r.default.string,
|
|
2596
|
+
defaultClassNameDragged: r.default.string,
|
|
2597
|
+
/**
|
|
2598
|
+
* `defaultPosition` specifies the x and y that the dragged item should start at
|
|
2599
|
+
*
|
|
2600
|
+
* Example:
|
|
2601
|
+
*
|
|
2602
|
+
* ```jsx
|
|
2603
|
+
* let App = React.createClass({
|
|
2604
|
+
* render: function () {
|
|
2605
|
+
* return (
|
|
2606
|
+
* <Draggable defaultPosition={{x: 25, y: 25}}>
|
|
2607
|
+
* <div>I start with transformX: 25px and transformY: 25px;</div>
|
|
2608
|
+
* </Draggable>
|
|
2609
|
+
* );
|
|
2610
|
+
* }
|
|
2611
|
+
* });
|
|
2612
|
+
* ```
|
|
2613
|
+
*/
|
|
2614
|
+
defaultPosition: r.default.shape({
|
|
2615
|
+
x: r.default.number,
|
|
2616
|
+
y: r.default.number
|
|
2617
|
+
}),
|
|
2618
|
+
positionOffset: r.default.shape({
|
|
2619
|
+
x: r.default.oneOfType([r.default.number, r.default.string]),
|
|
2620
|
+
y: r.default.oneOfType([r.default.number, r.default.string])
|
|
2621
|
+
}),
|
|
2622
|
+
/**
|
|
2623
|
+
* `position`, if present, defines the current position of the element.
|
|
2624
|
+
*
|
|
2625
|
+
* This is similar to how form elements in React work - if no `position` is supplied, the component
|
|
2626
|
+
* is uncontrolled.
|
|
2627
|
+
*
|
|
2628
|
+
* Example:
|
|
2629
|
+
*
|
|
2630
|
+
* ```jsx
|
|
2631
|
+
* let App = React.createClass({
|
|
2632
|
+
* render: function () {
|
|
2633
|
+
* return (
|
|
2634
|
+
* <Draggable position={{x: 25, y: 25}}>
|
|
2635
|
+
* <div>I start with transformX: 25px and transformY: 25px;</div>
|
|
2636
|
+
* </Draggable>
|
|
2637
|
+
* );
|
|
2638
|
+
* }
|
|
2639
|
+
* });
|
|
2640
|
+
* ```
|
|
2641
|
+
*/
|
|
2642
|
+
position: r.default.shape({
|
|
2643
|
+
x: r.default.number,
|
|
2644
|
+
y: r.default.number
|
|
2645
|
+
}),
|
|
2646
|
+
/**
|
|
2647
|
+
* These properties should be defined on the child, not here.
|
|
2648
|
+
*/
|
|
2649
|
+
className: c.dontSetMe,
|
|
2650
|
+
style: c.dontSetMe,
|
|
2651
|
+
transform: c.dontSetMe
|
|
2652
|
+
}), P(a, "defaultProps", {
|
|
2653
|
+
...d.default.defaultProps,
|
|
2654
|
+
axis: "both",
|
|
2655
|
+
bounds: !1,
|
|
2656
|
+
defaultClassName: "react-draggable",
|
|
2657
|
+
defaultClassNameDragging: "react-draggable-dragging",
|
|
2658
|
+
defaultClassNameDragged: "react-draggable-dragged",
|
|
2659
|
+
defaultPosition: {
|
|
2660
|
+
x: 0,
|
|
2661
|
+
y: 0
|
|
2662
|
+
},
|
|
2663
|
+
scale: 1
|
|
2664
|
+
});
|
|
2665
|
+
})(sr)), sr;
|
|
2666
|
+
}
|
|
2667
|
+
var tn;
|
|
2668
|
+
function Cr() {
|
|
2669
|
+
if (tn) return yt.exports;
|
|
2670
|
+
tn = 1;
|
|
2671
|
+
const {
|
|
2672
|
+
default: e,
|
|
2673
|
+
DraggableCore: t
|
|
2674
|
+
} = ea();
|
|
2675
|
+
return yt.exports = e, yt.exports.default = e, yt.exports.DraggableCore = t, yt.exports;
|
|
2676
|
+
}
|
|
2677
|
+
var ta = Cr(), bt = { exports: {} }, xt = {}, qt = {}, rn;
|
|
2678
|
+
function ra() {
|
|
2679
|
+
if (rn) return qt;
|
|
2680
|
+
rn = 1, qt.__esModule = !0, qt.cloneElement = c;
|
|
2681
|
+
var e = t(Re);
|
|
2682
|
+
function t(d) {
|
|
2683
|
+
return d && d.__esModule ? d : { default: d };
|
|
2684
|
+
}
|
|
2685
|
+
function r(d, v) {
|
|
2686
|
+
var g = Object.keys(d);
|
|
2687
|
+
if (Object.getOwnPropertySymbols) {
|
|
2688
|
+
var p = Object.getOwnPropertySymbols(d);
|
|
2689
|
+
v && (p = p.filter(function(w) {
|
|
2690
|
+
return Object.getOwnPropertyDescriptor(d, w).enumerable;
|
|
2691
|
+
})), g.push.apply(g, p);
|
|
2692
|
+
}
|
|
2693
|
+
return g;
|
|
2694
|
+
}
|
|
2695
|
+
function n(d) {
|
|
2696
|
+
for (var v = 1; v < arguments.length; v++) {
|
|
2697
|
+
var g = arguments[v] != null ? arguments[v] : {};
|
|
2698
|
+
v % 2 ? r(Object(g), !0).forEach(function(p) {
|
|
2699
|
+
o(d, p, g[p]);
|
|
2700
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(d, Object.getOwnPropertyDescriptors(g)) : r(Object(g)).forEach(function(p) {
|
|
2701
|
+
Object.defineProperty(d, p, Object.getOwnPropertyDescriptor(g, p));
|
|
2702
|
+
});
|
|
2703
|
+
}
|
|
2704
|
+
return d;
|
|
2705
|
+
}
|
|
2706
|
+
function o(d, v, g) {
|
|
2707
|
+
return (v = i(v)) in d ? Object.defineProperty(d, v, { value: g, enumerable: !0, configurable: !0, writable: !0 }) : d[v] = g, d;
|
|
2708
|
+
}
|
|
2709
|
+
function i(d) {
|
|
2710
|
+
var v = l(d, "string");
|
|
2711
|
+
return typeof v == "symbol" ? v : v + "";
|
|
2712
|
+
}
|
|
2713
|
+
function l(d, v) {
|
|
2714
|
+
if (typeof d != "object" || !d) return d;
|
|
2715
|
+
var g = d[Symbol.toPrimitive];
|
|
2716
|
+
if (g !== void 0) {
|
|
2717
|
+
var p = g.call(d, v);
|
|
2718
|
+
if (typeof p != "object") return p;
|
|
2719
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2720
|
+
}
|
|
2721
|
+
return (v === "string" ? String : Number)(d);
|
|
2722
|
+
}
|
|
2723
|
+
function c(d, v) {
|
|
2724
|
+
return v.style && d.props.style && (v.style = n(n({}, d.props.style), v.style)), v.className && d.props.className && (v.className = `${d.props.className} ${v.className}`), /* @__PURE__ */ e.default.cloneElement(d, v);
|
|
2725
|
+
}
|
|
2726
|
+
return qt;
|
|
2727
|
+
}
|
|
2728
|
+
var wt = {}, nn;
|
|
2729
|
+
function qn() {
|
|
2730
|
+
if (nn) return wt;
|
|
2731
|
+
nn = 1, wt.__esModule = !0, wt.resizableProps = void 0;
|
|
2732
|
+
var e = t(/* @__PURE__ */ er());
|
|
2733
|
+
Cr();
|
|
2734
|
+
function t(r) {
|
|
2735
|
+
return r && r.__esModule ? r : { default: r };
|
|
2736
|
+
}
|
|
2737
|
+
return wt.resizableProps = {
|
|
2738
|
+
/*
|
|
2739
|
+
* Restricts resizing to a particular axis (default: 'both')
|
|
2740
|
+
* 'both' - allows resizing by width or height
|
|
2741
|
+
* 'x' - only allows the width to be changed
|
|
2742
|
+
* 'y' - only allows the height to be changed
|
|
2743
|
+
* 'none' - disables resizing altogether
|
|
2744
|
+
* */
|
|
2745
|
+
axis: e.default.oneOf(["both", "x", "y", "none"]),
|
|
2746
|
+
className: e.default.string,
|
|
2747
|
+
/*
|
|
2748
|
+
* Require that one and only one child be present.
|
|
2749
|
+
* */
|
|
2750
|
+
children: e.default.element.isRequired,
|
|
2751
|
+
/*
|
|
2752
|
+
* These will be passed wholesale to react-draggable's DraggableCore
|
|
2753
|
+
* */
|
|
2754
|
+
draggableOpts: e.default.shape({
|
|
2755
|
+
allowAnyClick: e.default.bool,
|
|
2756
|
+
cancel: e.default.string,
|
|
2757
|
+
children: e.default.node,
|
|
2758
|
+
disabled: e.default.bool,
|
|
2759
|
+
enableUserSelectHack: e.default.bool,
|
|
2760
|
+
// #251: Check for Element to support SSR environments where DOM globals don't exist
|
|
2761
|
+
offsetParent: typeof Element < "u" ? e.default.instanceOf(Element) : e.default.any,
|
|
2762
|
+
grid: e.default.arrayOf(e.default.number),
|
|
2763
|
+
handle: e.default.string,
|
|
2764
|
+
nodeRef: e.default.object,
|
|
2765
|
+
onStart: e.default.func,
|
|
2766
|
+
onDrag: e.default.func,
|
|
2767
|
+
onStop: e.default.func,
|
|
2768
|
+
onMouseDown: e.default.func,
|
|
2769
|
+
scale: e.default.number
|
|
2770
|
+
}),
|
|
2771
|
+
/*
|
|
2772
|
+
* Initial height
|
|
2773
|
+
* */
|
|
2774
|
+
height: function() {
|
|
2775
|
+
for (var r = arguments.length, n = new Array(r), o = 0; o < r; o++)
|
|
2776
|
+
n[o] = arguments[o];
|
|
2777
|
+
const [i] = n;
|
|
2778
|
+
return i.axis === "both" || i.axis === "y" ? e.default.number.isRequired(...n) : e.default.number(...n);
|
|
2779
|
+
},
|
|
2780
|
+
/*
|
|
2781
|
+
* Customize cursor resize handle
|
|
2782
|
+
* */
|
|
2783
|
+
handle: e.default.oneOfType([e.default.node, e.default.func]),
|
|
2784
|
+
/*
|
|
2785
|
+
* If you change this, be sure to update your css
|
|
2786
|
+
* */
|
|
2787
|
+
handleSize: e.default.arrayOf(e.default.number),
|
|
2788
|
+
lockAspectRatio: e.default.bool,
|
|
2789
|
+
/*
|
|
2790
|
+
* Max X & Y measure
|
|
2791
|
+
* */
|
|
2792
|
+
maxConstraints: e.default.arrayOf(e.default.number),
|
|
2793
|
+
/*
|
|
2794
|
+
* Min X & Y measure
|
|
2795
|
+
* */
|
|
2796
|
+
minConstraints: e.default.arrayOf(e.default.number),
|
|
2797
|
+
/*
|
|
2798
|
+
* Called on stop resize event
|
|
2799
|
+
* */
|
|
2800
|
+
onResizeStop: e.default.func,
|
|
2801
|
+
/*
|
|
2802
|
+
* Called on start resize event
|
|
2803
|
+
* */
|
|
2804
|
+
onResizeStart: e.default.func,
|
|
2805
|
+
/*
|
|
2806
|
+
* Called on resize event
|
|
2807
|
+
* */
|
|
2808
|
+
onResize: e.default.func,
|
|
2809
|
+
/*
|
|
2810
|
+
* Defines which resize handles should be rendered (default: 'se')
|
|
2811
|
+
* 's' - South handle (bottom-center)
|
|
2812
|
+
* 'w' - West handle (left-center)
|
|
2813
|
+
* 'e' - East handle (right-center)
|
|
2814
|
+
* 'n' - North handle (top-center)
|
|
2815
|
+
* 'sw' - Southwest handle (bottom-left)
|
|
2816
|
+
* 'nw' - Northwest handle (top-left)
|
|
2817
|
+
* 'se' - Southeast handle (bottom-right)
|
|
2818
|
+
* 'ne' - Northeast handle (top-center)
|
|
2819
|
+
* */
|
|
2820
|
+
resizeHandles: e.default.arrayOf(e.default.oneOf(["s", "w", "e", "n", "sw", "nw", "se", "ne"])),
|
|
2821
|
+
/*
|
|
2822
|
+
* If `transform: scale(n)` is set on the parent, this should be set to `n`.
|
|
2823
|
+
* */
|
|
2824
|
+
transformScale: e.default.number,
|
|
2825
|
+
/*
|
|
2826
|
+
* Initial width
|
|
2827
|
+
*/
|
|
2828
|
+
width: function() {
|
|
2829
|
+
for (var r = arguments.length, n = new Array(r), o = 0; o < r; o++)
|
|
2830
|
+
n[o] = arguments[o];
|
|
2831
|
+
const [i] = n;
|
|
2832
|
+
return i.axis === "both" || i.axis === "x" ? e.default.number.isRequired(...n) : e.default.number(...n);
|
|
2833
|
+
}
|
|
2834
|
+
}, wt;
|
|
2835
|
+
}
|
|
2836
|
+
var on;
|
|
2837
|
+
function $n() {
|
|
2838
|
+
if (on) return xt;
|
|
2839
|
+
on = 1, xt.__esModule = !0, xt.default = void 0;
|
|
2840
|
+
var e = i(Re), t = Cr(), r = ra(), n = qn();
|
|
2841
|
+
const o = ["children", "className", "draggableOpts", "width", "height", "handle", "handleSize", "lockAspectRatio", "axis", "minConstraints", "maxConstraints", "onResize", "onResizeStop", "onResizeStart", "resizeHandles", "transformScale"];
|
|
2842
|
+
function i(u, a) {
|
|
2843
|
+
if (typeof WeakMap == "function") var s = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap();
|
|
2844
|
+
return (i = function(y, S) {
|
|
2845
|
+
if (!S && y && y.__esModule) return y;
|
|
2846
|
+
var b, R, m = { __proto__: null, default: y };
|
|
2847
|
+
if (y === null || typeof y != "object" && typeof y != "function") return m;
|
|
2848
|
+
if (b = S ? h : s) {
|
|
2849
|
+
if (b.has(y)) return b.get(y);
|
|
2850
|
+
b.set(y, m);
|
|
2851
|
+
}
|
|
2852
|
+
for (const x in y) x !== "default" && {}.hasOwnProperty.call(y, x) && ((R = (b = Object.defineProperty) && Object.getOwnPropertyDescriptor(y, x)) && (R.get || R.set) ? b(m, x, R) : m[x] = y[x]);
|
|
2853
|
+
return m;
|
|
2854
|
+
})(u, a);
|
|
2855
|
+
}
|
|
2856
|
+
function l() {
|
|
2857
|
+
return l = Object.assign ? Object.assign.bind() : function(u) {
|
|
2858
|
+
for (var a = 1; a < arguments.length; a++) {
|
|
2859
|
+
var s = arguments[a];
|
|
2860
|
+
for (var h in s) ({}).hasOwnProperty.call(s, h) && (u[h] = s[h]);
|
|
2861
|
+
}
|
|
2862
|
+
return u;
|
|
2863
|
+
}, l.apply(null, arguments);
|
|
2864
|
+
}
|
|
2865
|
+
function c(u, a) {
|
|
2866
|
+
if (u == null) return {};
|
|
2867
|
+
var s, h, y = d(u, a);
|
|
2868
|
+
if (Object.getOwnPropertySymbols) {
|
|
2869
|
+
var S = Object.getOwnPropertySymbols(u);
|
|
2870
|
+
for (h = 0; h < S.length; h++) s = S[h], a.indexOf(s) === -1 && {}.propertyIsEnumerable.call(u, s) && (y[s] = u[s]);
|
|
2871
|
+
}
|
|
2872
|
+
return y;
|
|
2873
|
+
}
|
|
2874
|
+
function d(u, a) {
|
|
2875
|
+
if (u == null) return {};
|
|
2876
|
+
var s = {};
|
|
2877
|
+
for (var h in u) if ({}.hasOwnProperty.call(u, h)) {
|
|
2878
|
+
if (a.indexOf(h) !== -1) continue;
|
|
2879
|
+
s[h] = u[h];
|
|
2880
|
+
}
|
|
2881
|
+
return s;
|
|
2882
|
+
}
|
|
2883
|
+
function v(u, a) {
|
|
2884
|
+
var s = Object.keys(u);
|
|
2885
|
+
if (Object.getOwnPropertySymbols) {
|
|
2886
|
+
var h = Object.getOwnPropertySymbols(u);
|
|
2887
|
+
a && (h = h.filter(function(y) {
|
|
2888
|
+
return Object.getOwnPropertyDescriptor(u, y).enumerable;
|
|
2889
|
+
})), s.push.apply(s, h);
|
|
2890
|
+
}
|
|
2891
|
+
return s;
|
|
2892
|
+
}
|
|
2893
|
+
function g(u) {
|
|
2894
|
+
for (var a = 1; a < arguments.length; a++) {
|
|
2895
|
+
var s = arguments[a] != null ? arguments[a] : {};
|
|
2896
|
+
a % 2 ? v(Object(s), !0).forEach(function(h) {
|
|
2897
|
+
p(u, h, s[h]);
|
|
2898
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(u, Object.getOwnPropertyDescriptors(s)) : v(Object(s)).forEach(function(h) {
|
|
2899
|
+
Object.defineProperty(u, h, Object.getOwnPropertyDescriptor(s, h));
|
|
2900
|
+
});
|
|
2901
|
+
}
|
|
2902
|
+
return u;
|
|
2903
|
+
}
|
|
2904
|
+
function p(u, a, s) {
|
|
2905
|
+
return (a = w(a)) in u ? Object.defineProperty(u, a, { value: s, enumerable: !0, configurable: !0, writable: !0 }) : u[a] = s, u;
|
|
2906
|
+
}
|
|
2907
|
+
function w(u) {
|
|
2908
|
+
var a = P(u, "string");
|
|
2909
|
+
return typeof a == "symbol" ? a : a + "";
|
|
2910
|
+
}
|
|
2911
|
+
function P(u, a) {
|
|
2912
|
+
if (typeof u != "object" || !u) return u;
|
|
2913
|
+
var s = u[Symbol.toPrimitive];
|
|
2914
|
+
if (s !== void 0) {
|
|
2915
|
+
var h = s.call(u, a);
|
|
2916
|
+
if (typeof h != "object") return h;
|
|
2917
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2918
|
+
}
|
|
2919
|
+
return (a === "string" ? String : Number)(u);
|
|
2920
|
+
}
|
|
2921
|
+
let O = class extends e.Component {
|
|
2922
|
+
constructor() {
|
|
2923
|
+
super(...arguments), this.handleRefs = {}, this.lastHandleRect = null, this.slack = null, this.lastSize = null;
|
|
2924
|
+
}
|
|
2925
|
+
componentWillUnmount() {
|
|
2926
|
+
this.resetData();
|
|
2927
|
+
}
|
|
2928
|
+
resetData() {
|
|
2929
|
+
this.lastHandleRect = this.slack = this.lastSize = null;
|
|
2930
|
+
}
|
|
2931
|
+
// Clamp width and height within provided constraints
|
|
2932
|
+
runConstraints(a, s) {
|
|
2933
|
+
const {
|
|
2934
|
+
minConstraints: h,
|
|
2935
|
+
maxConstraints: y,
|
|
2936
|
+
lockAspectRatio: S
|
|
2937
|
+
} = this.props;
|
|
2938
|
+
if (!h && !y && !S) return [a, s];
|
|
2939
|
+
if (S) {
|
|
2940
|
+
const C = this.props.width / this.props.height, $ = a - this.props.width, W = s - this.props.height;
|
|
2941
|
+
Math.abs($) > Math.abs(W * C) ? s = a / C : a = s * C;
|
|
2942
|
+
}
|
|
2943
|
+
const [b, R] = [a, s];
|
|
2944
|
+
let [m, x] = this.slack || [0, 0];
|
|
2945
|
+
return a += m, s += x, h && (a = Math.max(h[0], a), s = Math.max(h[1], s)), y && (a = Math.min(y[0], a), s = Math.min(y[1], s)), this.slack = [m + (b - a), x + (R - s)], [a, s];
|
|
2946
|
+
}
|
|
2947
|
+
/**
|
|
2948
|
+
* Wrapper around drag events to provide more useful data.
|
|
2949
|
+
*
|
|
2950
|
+
* @param {String} handlerName Handler name to wrap.
|
|
2951
|
+
* @return {Function} Handler function.
|
|
2952
|
+
*/
|
|
2953
|
+
resizeHandler(a, s) {
|
|
2954
|
+
return (h, y) => {
|
|
2955
|
+
let {
|
|
2956
|
+
node: S,
|
|
2957
|
+
deltaX: b,
|
|
2958
|
+
deltaY: R
|
|
2959
|
+
} = y;
|
|
2960
|
+
a === "onResizeStart" && this.resetData();
|
|
2961
|
+
const m = (this.props.axis === "both" || this.props.axis === "x") && s !== "n" && s !== "s", x = (this.props.axis === "both" || this.props.axis === "y") && s !== "e" && s !== "w";
|
|
2962
|
+
if (!m && !x) return;
|
|
2963
|
+
const C = s[0], $ = s[s.length - 1], W = S.getBoundingClientRect();
|
|
2964
|
+
if (this.lastHandleRect != null) {
|
|
2965
|
+
if ($ === "w") {
|
|
2966
|
+
const V = W.left - this.lastHandleRect.left;
|
|
2967
|
+
b += V;
|
|
2968
|
+
}
|
|
2969
|
+
if (C === "n") {
|
|
2970
|
+
const V = W.top - this.lastHandleRect.top;
|
|
2971
|
+
R += V;
|
|
2972
|
+
}
|
|
2973
|
+
}
|
|
2974
|
+
this.lastHandleRect = W, $ === "w" && (b = -b), C === "n" && (R = -R);
|
|
2975
|
+
let G = this.props.width + (m ? b / this.props.transformScale : 0), k = this.props.height + (x ? R / this.props.transformScale : 0);
|
|
2976
|
+
[G, k] = this.runConstraints(G, k), a === "onResizeStop" && this.lastSize && ({
|
|
2977
|
+
width: G,
|
|
2978
|
+
height: k
|
|
2979
|
+
} = this.lastSize);
|
|
2980
|
+
const H = G !== this.props.width || k !== this.props.height;
|
|
2981
|
+
a !== "onResizeStop" && (this.lastSize = {
|
|
2982
|
+
width: G,
|
|
2983
|
+
height: k
|
|
2984
|
+
});
|
|
2985
|
+
const J = typeof this.props[a] == "function" ? this.props[a] : null;
|
|
2986
|
+
J && !(a === "onResize" && !H) && (h.persist?.(), J(h, {
|
|
2987
|
+
node: S,
|
|
2988
|
+
size: {
|
|
2989
|
+
width: G,
|
|
2990
|
+
height: k
|
|
2991
|
+
},
|
|
2992
|
+
handle: s
|
|
2993
|
+
})), a === "onResizeStop" && this.resetData();
|
|
2994
|
+
};
|
|
2995
|
+
}
|
|
2996
|
+
// Render a resize handle given an axis & DOM ref. Ref *must* be attached for
|
|
2997
|
+
// the underlying draggable library to work properly.
|
|
2998
|
+
renderResizeHandle(a, s) {
|
|
2999
|
+
const {
|
|
3000
|
+
handle: h
|
|
3001
|
+
} = this.props;
|
|
3002
|
+
if (!h)
|
|
3003
|
+
return /* @__PURE__ */ e.createElement("span", {
|
|
3004
|
+
className: `react-resizable-handle react-resizable-handle-${a}`,
|
|
3005
|
+
ref: s
|
|
3006
|
+
});
|
|
3007
|
+
if (typeof h == "function")
|
|
3008
|
+
return h(a, s);
|
|
3009
|
+
const y = typeof h.type == "string", S = g({
|
|
3010
|
+
ref: s
|
|
3011
|
+
}, y ? {} : {
|
|
3012
|
+
handleAxis: a
|
|
3013
|
+
});
|
|
3014
|
+
return /* @__PURE__ */ e.cloneElement(h, S);
|
|
3015
|
+
}
|
|
3016
|
+
render() {
|
|
3017
|
+
const a = this.props, {
|
|
3018
|
+
children: s,
|
|
3019
|
+
className: h,
|
|
3020
|
+
draggableOpts: y,
|
|
3021
|
+
width: S,
|
|
3022
|
+
height: b,
|
|
3023
|
+
handle: R,
|
|
3024
|
+
handleSize: m,
|
|
3025
|
+
lockAspectRatio: x,
|
|
3026
|
+
axis: C,
|
|
3027
|
+
minConstraints: $,
|
|
3028
|
+
maxConstraints: W,
|
|
3029
|
+
onResize: G,
|
|
3030
|
+
onResizeStop: k,
|
|
3031
|
+
onResizeStart: H,
|
|
3032
|
+
resizeHandles: J,
|
|
3033
|
+
transformScale: X
|
|
3034
|
+
} = a, V = c(a, o);
|
|
3035
|
+
return (0, r.cloneElement)(s, g(g({}, V), {}, {
|
|
3036
|
+
className: `${h ? `${h} ` : ""}react-resizable`,
|
|
3037
|
+
children: [...e.Children.toArray(s.props.children), ...J.map((ie) => {
|
|
3038
|
+
const ge = this.handleRefs[ie] ?? (this.handleRefs[ie] = /* @__PURE__ */ e.createRef());
|
|
3039
|
+
return /* @__PURE__ */ e.createElement(t.DraggableCore, l({}, y, {
|
|
3040
|
+
nodeRef: ge,
|
|
3041
|
+
key: `resizableHandle-${ie}`,
|
|
3042
|
+
onStop: this.resizeHandler("onResizeStop", ie),
|
|
3043
|
+
onStart: this.resizeHandler("onResizeStart", ie),
|
|
3044
|
+
onDrag: this.resizeHandler("onResize", ie)
|
|
3045
|
+
}), this.renderResizeHandle(ie, ge));
|
|
3046
|
+
})]
|
|
3047
|
+
}));
|
|
3048
|
+
}
|
|
3049
|
+
};
|
|
3050
|
+
return xt.default = O, O.propTypes = n.resizableProps, O.defaultProps = {
|
|
3051
|
+
axis: "both",
|
|
3052
|
+
handleSize: [20, 20],
|
|
3053
|
+
lockAspectRatio: !1,
|
|
3054
|
+
minConstraints: [20, 20],
|
|
3055
|
+
maxConstraints: [1 / 0, 1 / 0],
|
|
3056
|
+
resizeHandles: ["se"],
|
|
3057
|
+
transformScale: 1
|
|
3058
|
+
}, xt;
|
|
3059
|
+
}
|
|
3060
|
+
var St = {}, an;
|
|
3061
|
+
function na() {
|
|
3062
|
+
if (an) return St;
|
|
3063
|
+
an = 1, St.__esModule = !0, St.default = void 0;
|
|
3064
|
+
var e = l(Re), t = i(/* @__PURE__ */ er()), r = i($n()), n = qn();
|
|
3065
|
+
const o = ["handle", "handleSize", "onResize", "onResizeStart", "onResizeStop", "draggableOpts", "minConstraints", "maxConstraints", "lockAspectRatio", "axis", "width", "height", "resizeHandles", "style", "transformScale"];
|
|
3066
|
+
function i(a) {
|
|
3067
|
+
return a && a.__esModule ? a : { default: a };
|
|
3068
|
+
}
|
|
3069
|
+
function l(a, s) {
|
|
3070
|
+
if (typeof WeakMap == "function") var h = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap();
|
|
3071
|
+
return (l = function(S, b) {
|
|
3072
|
+
if (!b && S && S.__esModule) return S;
|
|
3073
|
+
var R, m, x = { __proto__: null, default: S };
|
|
3074
|
+
if (S === null || typeof S != "object" && typeof S != "function") return x;
|
|
3075
|
+
if (R = b ? y : h) {
|
|
3076
|
+
if (R.has(S)) return R.get(S);
|
|
3077
|
+
R.set(S, x);
|
|
3078
|
+
}
|
|
3079
|
+
for (const C in S) C !== "default" && {}.hasOwnProperty.call(S, C) && ((m = (R = Object.defineProperty) && Object.getOwnPropertyDescriptor(S, C)) && (m.get || m.set) ? R(x, C, m) : x[C] = S[C]);
|
|
3080
|
+
return x;
|
|
3081
|
+
})(a, s);
|
|
3082
|
+
}
|
|
3083
|
+
function c() {
|
|
3084
|
+
return c = Object.assign ? Object.assign.bind() : function(a) {
|
|
3085
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
3086
|
+
var h = arguments[s];
|
|
3087
|
+
for (var y in h) ({}).hasOwnProperty.call(h, y) && (a[y] = h[y]);
|
|
3088
|
+
}
|
|
3089
|
+
return a;
|
|
3090
|
+
}, c.apply(null, arguments);
|
|
3091
|
+
}
|
|
3092
|
+
function d(a, s) {
|
|
3093
|
+
var h = Object.keys(a);
|
|
3094
|
+
if (Object.getOwnPropertySymbols) {
|
|
3095
|
+
var y = Object.getOwnPropertySymbols(a);
|
|
3096
|
+
s && (y = y.filter(function(S) {
|
|
3097
|
+
return Object.getOwnPropertyDescriptor(a, S).enumerable;
|
|
3098
|
+
})), h.push.apply(h, y);
|
|
3099
|
+
}
|
|
3100
|
+
return h;
|
|
3101
|
+
}
|
|
3102
|
+
function v(a) {
|
|
3103
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
3104
|
+
var h = arguments[s] != null ? arguments[s] : {};
|
|
3105
|
+
s % 2 ? d(Object(h), !0).forEach(function(y) {
|
|
3106
|
+
g(a, y, h[y]);
|
|
3107
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(h)) : d(Object(h)).forEach(function(y) {
|
|
3108
|
+
Object.defineProperty(a, y, Object.getOwnPropertyDescriptor(h, y));
|
|
3109
|
+
});
|
|
3110
|
+
}
|
|
3111
|
+
return a;
|
|
3112
|
+
}
|
|
3113
|
+
function g(a, s, h) {
|
|
3114
|
+
return (s = p(s)) in a ? Object.defineProperty(a, s, { value: h, enumerable: !0, configurable: !0, writable: !0 }) : a[s] = h, a;
|
|
3115
|
+
}
|
|
3116
|
+
function p(a) {
|
|
3117
|
+
var s = w(a, "string");
|
|
3118
|
+
return typeof s == "symbol" ? s : s + "";
|
|
3119
|
+
}
|
|
3120
|
+
function w(a, s) {
|
|
3121
|
+
if (typeof a != "object" || !a) return a;
|
|
3122
|
+
var h = a[Symbol.toPrimitive];
|
|
3123
|
+
if (h !== void 0) {
|
|
3124
|
+
var y = h.call(a, s);
|
|
3125
|
+
if (typeof y != "object") return y;
|
|
3126
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
3127
|
+
}
|
|
3128
|
+
return (s === "string" ? String : Number)(a);
|
|
3129
|
+
}
|
|
3130
|
+
function P(a, s) {
|
|
3131
|
+
if (a == null) return {};
|
|
3132
|
+
var h, y, S = O(a, s);
|
|
3133
|
+
if (Object.getOwnPropertySymbols) {
|
|
3134
|
+
var b = Object.getOwnPropertySymbols(a);
|
|
3135
|
+
for (y = 0; y < b.length; y++) h = b[y], s.indexOf(h) === -1 && {}.propertyIsEnumerable.call(a, h) && (S[h] = a[h]);
|
|
3136
|
+
}
|
|
3137
|
+
return S;
|
|
3138
|
+
}
|
|
3139
|
+
function O(a, s) {
|
|
3140
|
+
if (a == null) return {};
|
|
3141
|
+
var h = {};
|
|
3142
|
+
for (var y in a) if ({}.hasOwnProperty.call(a, y)) {
|
|
3143
|
+
if (s.indexOf(y) !== -1) continue;
|
|
3144
|
+
h[y] = a[y];
|
|
3145
|
+
}
|
|
3146
|
+
return h;
|
|
3147
|
+
}
|
|
3148
|
+
let u = class extends e.Component {
|
|
3149
|
+
constructor() {
|
|
3150
|
+
super(...arguments), this.state = {
|
|
3151
|
+
width: this.props.width,
|
|
3152
|
+
height: this.props.height,
|
|
3153
|
+
propsWidth: this.props.width,
|
|
3154
|
+
propsHeight: this.props.height
|
|
3155
|
+
}, this.onResize = (s, h) => {
|
|
3156
|
+
const {
|
|
3157
|
+
size: y
|
|
3158
|
+
} = h;
|
|
3159
|
+
this.props.onResize ? (s.persist?.(), this.setState(y, () => this.props.onResize && this.props.onResize(s, h))) : this.setState(y);
|
|
3160
|
+
};
|
|
3161
|
+
}
|
|
3162
|
+
static getDerivedStateFromProps(s, h) {
|
|
3163
|
+
return h.propsWidth !== s.width || h.propsHeight !== s.height ? {
|
|
3164
|
+
width: s.width,
|
|
3165
|
+
height: s.height,
|
|
3166
|
+
propsWidth: s.width,
|
|
3167
|
+
propsHeight: s.height
|
|
3168
|
+
} : null;
|
|
3169
|
+
}
|
|
3170
|
+
render() {
|
|
3171
|
+
const s = this.props, {
|
|
3172
|
+
handle: h,
|
|
3173
|
+
handleSize: y,
|
|
3174
|
+
onResize: S,
|
|
3175
|
+
onResizeStart: b,
|
|
3176
|
+
onResizeStop: R,
|
|
3177
|
+
draggableOpts: m,
|
|
3178
|
+
minConstraints: x,
|
|
3179
|
+
maxConstraints: C,
|
|
3180
|
+
lockAspectRatio: $,
|
|
3181
|
+
axis: W,
|
|
3182
|
+
width: G,
|
|
3183
|
+
height: k,
|
|
3184
|
+
resizeHandles: H,
|
|
3185
|
+
style: J,
|
|
3186
|
+
transformScale: X
|
|
3187
|
+
} = s, V = P(s, o);
|
|
3188
|
+
return /* @__PURE__ */ e.createElement(r.default, {
|
|
3189
|
+
axis: W,
|
|
3190
|
+
draggableOpts: m,
|
|
3191
|
+
handle: h,
|
|
3192
|
+
handleSize: y,
|
|
3193
|
+
height: this.state.height,
|
|
3194
|
+
lockAspectRatio: $,
|
|
3195
|
+
maxConstraints: C,
|
|
3196
|
+
minConstraints: x,
|
|
3197
|
+
onResizeStart: b,
|
|
3198
|
+
onResize: this.onResize,
|
|
3199
|
+
onResizeStop: R,
|
|
3200
|
+
resizeHandles: H,
|
|
3201
|
+
transformScale: X,
|
|
3202
|
+
width: this.state.width
|
|
3203
|
+
}, /* @__PURE__ */ e.createElement("div", c({}, V, {
|
|
3204
|
+
style: v(v({}, J), {}, {
|
|
3205
|
+
width: this.state.width + "px",
|
|
3206
|
+
height: this.state.height + "px"
|
|
3207
|
+
})
|
|
3208
|
+
})));
|
|
3209
|
+
}
|
|
3210
|
+
};
|
|
3211
|
+
return St.default = u, u.propTypes = v(v({}, n.resizableProps), {}, {
|
|
3212
|
+
children: t.default.element
|
|
3213
|
+
}), St;
|
|
3214
|
+
}
|
|
3215
|
+
var sn;
|
|
3216
|
+
function oa() {
|
|
3217
|
+
return sn || (sn = 1, bt.exports = function() {
|
|
3218
|
+
throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable");
|
|
3219
|
+
}, bt.exports.Resizable = $n().default, bt.exports.ResizableBox = na().default), bt.exports;
|
|
3220
|
+
}
|
|
3221
|
+
var aa = oa();
|
|
3222
|
+
function ln(e) {
|
|
3223
|
+
const {
|
|
3224
|
+
children: t,
|
|
3225
|
+
cols: r,
|
|
3226
|
+
containerWidth: n,
|
|
3227
|
+
margin: o,
|
|
3228
|
+
containerPadding: i,
|
|
3229
|
+
rowHeight: l,
|
|
3230
|
+
maxRows: c,
|
|
3231
|
+
isDraggable: d,
|
|
3232
|
+
isResizable: v,
|
|
3233
|
+
isBounded: g,
|
|
3234
|
+
static: p,
|
|
3235
|
+
useCSSTransforms: w = !0,
|
|
3236
|
+
usePercentages: P = !1,
|
|
3237
|
+
transformScale: O = 1,
|
|
3238
|
+
positionStrategy: u,
|
|
3239
|
+
dragThreshold: a = 0,
|
|
3240
|
+
droppingPosition: s,
|
|
3241
|
+
className: h = "",
|
|
3242
|
+
style: y,
|
|
3243
|
+
handle: S = "",
|
|
3244
|
+
cancel: b = "",
|
|
3245
|
+
x: R,
|
|
3246
|
+
y: m,
|
|
3247
|
+
w: x,
|
|
3248
|
+
h: C,
|
|
3249
|
+
minW: $ = 1,
|
|
3250
|
+
maxW: W = 1 / 0,
|
|
3251
|
+
minH: G = 1,
|
|
3252
|
+
maxH: k = 1 / 0,
|
|
3253
|
+
i: H,
|
|
3254
|
+
resizeHandles: J,
|
|
3255
|
+
resizeHandle: X,
|
|
3256
|
+
constraints: V = bn,
|
|
3257
|
+
layoutItem: ie,
|
|
3258
|
+
layout: ge = [],
|
|
3259
|
+
onDragStart: E,
|
|
3260
|
+
onDrag: f,
|
|
3261
|
+
onDragStop: D,
|
|
3262
|
+
onResizeStart: z,
|
|
3263
|
+
onResize: j,
|
|
3264
|
+
onResizeStop: F
|
|
3265
|
+
} = e, [A, T] = Te(!1), [I, N] = Te(!1), q = se(null), B = se({ left: 0, top: 0 }), _ = se({
|
|
3266
|
+
top: 0,
|
|
3267
|
+
left: 0,
|
|
3268
|
+
width: 0,
|
|
3269
|
+
height: 0
|
|
3270
|
+
}), ne = se(
|
|
3271
|
+
void 0
|
|
3272
|
+
), je = se(ge);
|
|
3273
|
+
je.current = ge;
|
|
3274
|
+
const _e = se(null), ye = se(null), Ee = se(!1), nt = se({ x: 0, y: 0 }), fe = se(!1), le = we(
|
|
3275
|
+
() => ({
|
|
3276
|
+
cols: r,
|
|
3277
|
+
containerPadding: i,
|
|
3278
|
+
containerWidth: n,
|
|
3279
|
+
margin: o,
|
|
3280
|
+
maxRows: c,
|
|
3281
|
+
rowHeight: l
|
|
3282
|
+
}),
|
|
3283
|
+
[r, i, n, o, c, l]
|
|
3284
|
+
), Pe = we(
|
|
3285
|
+
() => ({
|
|
3286
|
+
cols: r,
|
|
3287
|
+
maxRows: c,
|
|
3288
|
+
containerWidth: n,
|
|
3289
|
+
containerHeight: 0,
|
|
3290
|
+
// Auto-height grids don't have a fixed container height
|
|
3291
|
+
rowHeight: l,
|
|
3292
|
+
margin: o,
|
|
3293
|
+
// Use empty layout here - the actual layout will be accessed via layoutRef when needed
|
|
3294
|
+
// This prevents the context from changing when layout changes, avoiding callback recreation
|
|
3295
|
+
layout: []
|
|
3296
|
+
}),
|
|
3297
|
+
[r, c, n, l, o]
|
|
3298
|
+
), xe = pe(
|
|
3299
|
+
() => ({
|
|
3300
|
+
...Pe,
|
|
3301
|
+
layout: je.current
|
|
3302
|
+
}),
|
|
3303
|
+
[Pe]
|
|
3304
|
+
), ke = we(
|
|
3305
|
+
() => ie ?? {
|
|
3306
|
+
i: H,
|
|
3307
|
+
x: R,
|
|
3308
|
+
y: m,
|
|
3309
|
+
w: x,
|
|
3310
|
+
h: C,
|
|
3311
|
+
minW: $,
|
|
3312
|
+
maxW: W,
|
|
3313
|
+
minH: G,
|
|
3314
|
+
maxH: k
|
|
3315
|
+
},
|
|
3316
|
+
[ie, H, R, m, x, C, $, W, G, k]
|
|
3317
|
+
), Rt = pe(
|
|
3318
|
+
(Z) => {
|
|
3319
|
+
if (u?.calcStyle)
|
|
3320
|
+
return u.calcStyle(Z);
|
|
3321
|
+
if (w)
|
|
3322
|
+
return xn(Z);
|
|
3323
|
+
const Q = lo(Z);
|
|
3324
|
+
return P ? {
|
|
3325
|
+
...Q,
|
|
3326
|
+
left: zr(Z.left / n),
|
|
3327
|
+
width: zr(Z.width / n)
|
|
3328
|
+
} : Q;
|
|
3329
|
+
},
|
|
3330
|
+
[u, w, P, n]
|
|
3331
|
+
), Le = pe(
|
|
3332
|
+
(Z, { node: Q }) => {
|
|
3333
|
+
if (!E) return;
|
|
3334
|
+
const { offsetParent: he } = Q;
|
|
3335
|
+
if (!he) return;
|
|
3336
|
+
const oe = he.getBoundingClientRect(), ve = Q.getBoundingClientRect(), Ce = ve.left / O, De = oe.left / O, Oe = ve.top / O, Me = oe.top / O;
|
|
3337
|
+
let Ne;
|
|
3338
|
+
if (u?.calcDragPosition) {
|
|
3339
|
+
const U = Z;
|
|
3340
|
+
Ne = u.calcDragPosition(
|
|
3341
|
+
U.clientX,
|
|
3342
|
+
U.clientY,
|
|
3343
|
+
U.clientX - ve.left,
|
|
3344
|
+
U.clientY - ve.top
|
|
3345
|
+
);
|
|
3346
|
+
} else
|
|
3347
|
+
Ne = {
|
|
3348
|
+
left: Ce - De + he.scrollLeft,
|
|
3349
|
+
top: Oe - Me + he.scrollTop
|
|
3350
|
+
};
|
|
3351
|
+
if (B.current = Ne, a > 0) {
|
|
3352
|
+
const U = Z;
|
|
3353
|
+
nt.current = {
|
|
3354
|
+
x: U.clientX,
|
|
3355
|
+
y: U.clientY
|
|
3356
|
+
}, Ee.current = !0, fe.current = !1, T(!0);
|
|
3357
|
+
return;
|
|
3358
|
+
}
|
|
3359
|
+
T(!0);
|
|
3360
|
+
const Ge = Nt(
|
|
3361
|
+
le,
|
|
3362
|
+
Ne.top,
|
|
3363
|
+
Ne.left
|
|
3364
|
+
), { x: Ve, y: L } = kt(
|
|
3365
|
+
V,
|
|
3366
|
+
ke,
|
|
3367
|
+
Ge.x,
|
|
3368
|
+
Ge.y,
|
|
3369
|
+
xe()
|
|
3370
|
+
);
|
|
3371
|
+
E(H, Ve, L, {
|
|
3372
|
+
e: Z,
|
|
3373
|
+
node: Q,
|
|
3374
|
+
newPosition: Ne
|
|
3375
|
+
});
|
|
3376
|
+
},
|
|
3377
|
+
[
|
|
3378
|
+
E,
|
|
3379
|
+
O,
|
|
3380
|
+
le,
|
|
3381
|
+
u,
|
|
3382
|
+
a,
|
|
3383
|
+
V,
|
|
3384
|
+
ke,
|
|
3385
|
+
xe,
|
|
3386
|
+
H
|
|
3387
|
+
]
|
|
3388
|
+
), ot = pe(
|
|
3389
|
+
(Z, { node: Q, deltaX: he, deltaY: oe }) => {
|
|
3390
|
+
if (!f || !A) return;
|
|
3391
|
+
const ve = Z;
|
|
3392
|
+
if (Ee.current && !fe.current) {
|
|
3393
|
+
const Ve = ve.clientX - nt.current.x, L = ve.clientY - nt.current.y;
|
|
3394
|
+
if (Math.hypot(Ve, L) < a)
|
|
3395
|
+
return;
|
|
3396
|
+
if (fe.current = !0, Ee.current = !1, E) {
|
|
3397
|
+
const Y = Nt(
|
|
3398
|
+
le,
|
|
3399
|
+
B.current.top,
|
|
3400
|
+
B.current.left
|
|
3401
|
+
), { x: K, y: ae } = kt(
|
|
3402
|
+
V,
|
|
3403
|
+
ke,
|
|
3404
|
+
Y.x,
|
|
3405
|
+
Y.y,
|
|
3406
|
+
xe()
|
|
3407
|
+
);
|
|
3408
|
+
E(H, K, ae, {
|
|
3409
|
+
e: Z,
|
|
3410
|
+
node: Q,
|
|
3411
|
+
newPosition: B.current
|
|
3412
|
+
});
|
|
3413
|
+
}
|
|
3414
|
+
}
|
|
3415
|
+
let Ce = B.current.top + oe, De = B.current.left + he;
|
|
3416
|
+
if (g) {
|
|
3417
|
+
const { offsetParent: Ve } = Q;
|
|
3418
|
+
if (Ve) {
|
|
3419
|
+
const L = Ve.clientHeight - ct(C, l, o[1]);
|
|
3420
|
+
Ce = Ht(Ce, 0, L);
|
|
3421
|
+
const U = ut(le), Y = n - ct(x, U, o[0]);
|
|
3422
|
+
De = Ht(De, 0, Y);
|
|
3423
|
+
}
|
|
3424
|
+
}
|
|
3425
|
+
const Oe = { top: Ce, left: De };
|
|
3426
|
+
B.current = Oe;
|
|
3427
|
+
const Me = Nt(le, Ce, De), { x: Ne, y: Ge } = kt(
|
|
3428
|
+
V,
|
|
3429
|
+
ke,
|
|
3430
|
+
Me.x,
|
|
3431
|
+
Me.y,
|
|
3432
|
+
xe()
|
|
3433
|
+
);
|
|
3434
|
+
f(H, Ne, Ge, {
|
|
3435
|
+
e: Z,
|
|
3436
|
+
node: Q,
|
|
3437
|
+
newPosition: Oe
|
|
3438
|
+
});
|
|
3439
|
+
},
|
|
3440
|
+
[
|
|
3441
|
+
f,
|
|
3442
|
+
E,
|
|
3443
|
+
A,
|
|
3444
|
+
a,
|
|
3445
|
+
g,
|
|
3446
|
+
C,
|
|
3447
|
+
l,
|
|
3448
|
+
o,
|
|
3449
|
+
le,
|
|
3450
|
+
n,
|
|
3451
|
+
x,
|
|
3452
|
+
H,
|
|
3453
|
+
V,
|
|
3454
|
+
ke,
|
|
3455
|
+
xe
|
|
3456
|
+
]
|
|
3457
|
+
), Fe = pe(
|
|
3458
|
+
(Z, { node: Q }) => {
|
|
3459
|
+
if (!D || !A) return;
|
|
3460
|
+
const he = Ee.current;
|
|
3461
|
+
if (Ee.current = !1, fe.current = !1, nt.current = { x: 0, y: 0 }, he) {
|
|
3462
|
+
T(!1), B.current = { left: 0, top: 0 };
|
|
3463
|
+
return;
|
|
3464
|
+
}
|
|
3465
|
+
const { left: oe, top: ve } = B.current, Ce = { top: ve, left: oe };
|
|
3466
|
+
T(!1), B.current = { left: 0, top: 0 };
|
|
3467
|
+
const De = Nt(le, ve, oe), { x: Oe, y: Me } = kt(
|
|
3468
|
+
V,
|
|
3469
|
+
ke,
|
|
3470
|
+
De.x,
|
|
3471
|
+
De.y,
|
|
3472
|
+
xe()
|
|
3473
|
+
);
|
|
3474
|
+
D(H, Oe, Me, {
|
|
3475
|
+
e: Z,
|
|
3476
|
+
node: Q,
|
|
3477
|
+
newPosition: Ce
|
|
3478
|
+
});
|
|
3479
|
+
},
|
|
3480
|
+
[
|
|
3481
|
+
D,
|
|
3482
|
+
A,
|
|
3483
|
+
le,
|
|
3484
|
+
V,
|
|
3485
|
+
ke,
|
|
3486
|
+
xe,
|
|
3487
|
+
H
|
|
3488
|
+
]
|
|
3489
|
+
);
|
|
3490
|
+
_e.current = Le, ye.current = ot;
|
|
3491
|
+
const Ae = pe(
|
|
3492
|
+
(Z, { node: Q, size: he, handle: oe }, ve, Ce) => {
|
|
3493
|
+
const De = Ce === "onResizeStart" ? z : Ce === "onResize" ? j : F;
|
|
3494
|
+
if (!De) return;
|
|
3495
|
+
let Oe;
|
|
3496
|
+
Q ? Oe = yo(
|
|
3497
|
+
oe,
|
|
3498
|
+
ve,
|
|
3499
|
+
he,
|
|
3500
|
+
n
|
|
3501
|
+
) : Oe = {
|
|
3502
|
+
...he,
|
|
3503
|
+
top: ve.top,
|
|
3504
|
+
left: ve.left
|
|
3505
|
+
}, _.current = Oe;
|
|
3506
|
+
const Me = to(
|
|
3507
|
+
le,
|
|
3508
|
+
Oe.width,
|
|
3509
|
+
Oe.height
|
|
3510
|
+
), { w: Ne, h: Ge } = io(
|
|
3511
|
+
V,
|
|
3512
|
+
ke,
|
|
3513
|
+
Me.w,
|
|
3514
|
+
Me.h,
|
|
3515
|
+
oe,
|
|
3516
|
+
xe()
|
|
3517
|
+
);
|
|
3518
|
+
De(H, Ne, Ge, {
|
|
3519
|
+
e: Z.nativeEvent,
|
|
3520
|
+
node: Q,
|
|
3521
|
+
size: Oe,
|
|
3522
|
+
handle: oe
|
|
3523
|
+
});
|
|
3524
|
+
},
|
|
3525
|
+
[
|
|
3526
|
+
z,
|
|
3527
|
+
j,
|
|
3528
|
+
F,
|
|
3529
|
+
n,
|
|
3530
|
+
le,
|
|
3531
|
+
H,
|
|
3532
|
+
V,
|
|
3533
|
+
ke,
|
|
3534
|
+
xe
|
|
3535
|
+
]
|
|
3536
|
+
), at = pe(
|
|
3537
|
+
(Z, Q) => {
|
|
3538
|
+
N(!0);
|
|
3539
|
+
const he = gt(le, R, m, x, C), oe = {
|
|
3540
|
+
...Q,
|
|
3541
|
+
handle: Q.handle
|
|
3542
|
+
};
|
|
3543
|
+
Ae(Z, oe, he, "onResizeStart");
|
|
3544
|
+
},
|
|
3545
|
+
[Ae, le, R, m, x, C]
|
|
3546
|
+
), st = pe(
|
|
3547
|
+
(Z, Q) => {
|
|
3548
|
+
const he = gt(le, R, m, x, C), oe = {
|
|
3549
|
+
...Q,
|
|
3550
|
+
handle: Q.handle
|
|
3551
|
+
};
|
|
3552
|
+
Ae(Z, oe, he, "onResize");
|
|
3553
|
+
},
|
|
3554
|
+
[Ae, le, R, m, x, C]
|
|
3555
|
+
), Xe = pe(
|
|
3556
|
+
(Z, Q) => {
|
|
3557
|
+
N(!1), _.current = { top: 0, left: 0, width: 0, height: 0 };
|
|
3558
|
+
const he = gt(le, R, m, x, C), oe = {
|
|
3559
|
+
...Q,
|
|
3560
|
+
handle: Q.handle
|
|
3561
|
+
};
|
|
3562
|
+
Ae(Z, oe, he, "onResizeStop");
|
|
3563
|
+
},
|
|
3564
|
+
[Ae, le, R, m, x, C]
|
|
3565
|
+
);
|
|
3566
|
+
Be(() => {
|
|
3567
|
+
if (!s) return;
|
|
3568
|
+
const Z = q.current;
|
|
3569
|
+
if (!Z) return;
|
|
3570
|
+
const Q = ne.current || {
|
|
3571
|
+
left: 0,
|
|
3572
|
+
top: 0
|
|
3573
|
+
}, he = A && (s.left !== Q.left || s.top !== Q.top);
|
|
3574
|
+
if (A) {
|
|
3575
|
+
if (he) {
|
|
3576
|
+
const oe = s.left - B.current.left, ve = s.top - B.current.top, Ce = {
|
|
3577
|
+
node: Z,
|
|
3578
|
+
deltaX: oe,
|
|
3579
|
+
deltaY: ve,
|
|
3580
|
+
lastX: B.current.left,
|
|
3581
|
+
lastY: B.current.top,
|
|
3582
|
+
x: s.left,
|
|
3583
|
+
y: s.top
|
|
3584
|
+
};
|
|
3585
|
+
ye.current?.(
|
|
3586
|
+
s.e,
|
|
3587
|
+
Ce
|
|
3588
|
+
);
|
|
3589
|
+
}
|
|
3590
|
+
} else {
|
|
3591
|
+
const oe = {
|
|
3592
|
+
node: Z,
|
|
3593
|
+
deltaX: s.left,
|
|
3594
|
+
deltaY: s.top,
|
|
3595
|
+
lastX: 0,
|
|
3596
|
+
lastY: 0,
|
|
3597
|
+
x: s.left,
|
|
3598
|
+
y: s.top
|
|
3599
|
+
};
|
|
3600
|
+
_e.current?.(
|
|
3601
|
+
s.e,
|
|
3602
|
+
oe
|
|
3603
|
+
);
|
|
3604
|
+
}
|
|
3605
|
+
ne.current = s;
|
|
3606
|
+
}, [s, A, H]);
|
|
3607
|
+
const Ie = gt(
|
|
3608
|
+
le,
|
|
3609
|
+
R,
|
|
3610
|
+
m,
|
|
3611
|
+
x,
|
|
3612
|
+
C,
|
|
3613
|
+
A ? B.current : null,
|
|
3614
|
+
I ? _.current : null
|
|
3615
|
+
), ft = Re.Children.only(t), dt = gt(le, 0, 0, 1, 1), Et = [
|
|
3616
|
+
dt.width,
|
|
3617
|
+
dt.height
|
|
3618
|
+
], Pt = [1 / 0, 1 / 0], ze = ft.props, rr = ze.className, Ct = ze.style;
|
|
3619
|
+
let Ue = Re.cloneElement(ft, {
|
|
3620
|
+
ref: q,
|
|
3621
|
+
className: mr("react-grid-item", rr, h, {
|
|
3622
|
+
static: p,
|
|
3623
|
+
resizing: I,
|
|
3624
|
+
"react-draggable": d,
|
|
3625
|
+
"react-draggable-dragging": A,
|
|
3626
|
+
dropping: !!s,
|
|
3627
|
+
cssTransforms: w
|
|
3628
|
+
}),
|
|
3629
|
+
style: {
|
|
3630
|
+
...y,
|
|
3631
|
+
...Ct,
|
|
3632
|
+
...Rt(Ie)
|
|
3633
|
+
}
|
|
3634
|
+
});
|
|
3635
|
+
const Ot = X;
|
|
3636
|
+
return Ue = /* @__PURE__ */ M.jsx(
|
|
3637
|
+
aa.Resizable,
|
|
3638
|
+
{
|
|
3639
|
+
draggableOpts: { disabled: !v },
|
|
3640
|
+
className: v ? void 0 : "react-resizable-hide",
|
|
3641
|
+
width: Ie.width,
|
|
3642
|
+
height: Ie.height,
|
|
3643
|
+
minConstraints: Et,
|
|
3644
|
+
maxConstraints: Pt,
|
|
3645
|
+
onResizeStart: at,
|
|
3646
|
+
onResize: st,
|
|
3647
|
+
onResizeStop: Xe,
|
|
3648
|
+
transformScale: O,
|
|
3649
|
+
resizeHandles: J,
|
|
3650
|
+
handle: Ot,
|
|
3651
|
+
children: Ue
|
|
3652
|
+
}
|
|
3653
|
+
), Ue = /* @__PURE__ */ M.jsx(
|
|
3654
|
+
ta.DraggableCore,
|
|
3655
|
+
{
|
|
3656
|
+
disabled: !d,
|
|
3657
|
+
onStart: Le,
|
|
3658
|
+
onDrag: ot,
|
|
3659
|
+
onStop: Fe,
|
|
3660
|
+
handle: S,
|
|
3661
|
+
cancel: ".react-resizable-handle" + (b ? "," + b : ""),
|
|
3662
|
+
scale: O,
|
|
3663
|
+
nodeRef: q,
|
|
3664
|
+
children: Ue
|
|
3665
|
+
}
|
|
3666
|
+
), Ue;
|
|
3667
|
+
}
|
|
3668
|
+
var He = () => {
|
|
3669
|
+
}, cn = "react-grid-layout", Hn = !1;
|
|
3670
|
+
try {
|
|
3671
|
+
Hn = /firefox/i.test(navigator.userAgent);
|
|
3672
|
+
} catch {
|
|
3673
|
+
}
|
|
3674
|
+
function sa(e, t) {
|
|
3675
|
+
const r = Re.Children.toArray(e), n = Re.Children.toArray(t);
|
|
3676
|
+
if (r.length !== n.length) return !1;
|
|
3677
|
+
for (let o = 0; o < r.length; o++) {
|
|
3678
|
+
const i = r[o], l = n[o];
|
|
3679
|
+
if (i?.key !== l?.key) return !1;
|
|
3680
|
+
}
|
|
3681
|
+
return !0;
|
|
3682
|
+
}
|
|
3683
|
+
function un(e, t, r, n) {
|
|
3684
|
+
const o = [], i = /* @__PURE__ */ new Set();
|
|
3685
|
+
Re.Children.forEach(t, (c) => {
|
|
3686
|
+
if (!Re.isValidElement(c) || c.key === null) return;
|
|
3687
|
+
const d = String(c.key);
|
|
3688
|
+
i.add(d);
|
|
3689
|
+
const v = e.find((g) => g.i === d);
|
|
3690
|
+
if (v)
|
|
3691
|
+
o.push(rt(v));
|
|
3692
|
+
else {
|
|
3693
|
+
const p = c.props["data-grid"];
|
|
3694
|
+
p ? o.push({
|
|
3695
|
+
i: d,
|
|
3696
|
+
x: p.x ?? 0,
|
|
3697
|
+
y: p.y ?? 0,
|
|
3698
|
+
w: p.w ?? 1,
|
|
3699
|
+
h: p.h ?? 1,
|
|
3700
|
+
minW: p.minW,
|
|
3701
|
+
maxW: p.maxW,
|
|
3702
|
+
minH: p.minH,
|
|
3703
|
+
maxH: p.maxH,
|
|
3704
|
+
static: p.static,
|
|
3705
|
+
isDraggable: p.isDraggable,
|
|
3706
|
+
isResizable: p.isResizable,
|
|
3707
|
+
resizeHandles: p.resizeHandles,
|
|
3708
|
+
isBounded: p.isBounded
|
|
3709
|
+
}) : o.push({
|
|
3710
|
+
i: d,
|
|
3711
|
+
x: 0,
|
|
3712
|
+
y: Vt(o),
|
|
3713
|
+
w: 1,
|
|
3714
|
+
h: 1
|
|
3715
|
+
});
|
|
3716
|
+
}
|
|
3717
|
+
});
|
|
3718
|
+
const l = yr(o, { cols: r });
|
|
3719
|
+
return n.compact(l, r);
|
|
3720
|
+
}
|
|
3721
|
+
function ia(e) {
|
|
3722
|
+
const {
|
|
3723
|
+
// Required
|
|
3724
|
+
children: t,
|
|
3725
|
+
width: r,
|
|
3726
|
+
// Composable config interfaces
|
|
3727
|
+
gridConfig: n,
|
|
3728
|
+
dragConfig: o,
|
|
3729
|
+
resizeConfig: i,
|
|
3730
|
+
dropConfig: l,
|
|
3731
|
+
positionStrategy: c = bo,
|
|
3732
|
+
compactor: d,
|
|
3733
|
+
constraints: v = bn,
|
|
3734
|
+
// Layout data
|
|
3735
|
+
layout: g = [],
|
|
3736
|
+
droppingItem: p,
|
|
3737
|
+
// Container props
|
|
3738
|
+
autoSize: w = !0,
|
|
3739
|
+
className: P = "",
|
|
3740
|
+
style: O = {},
|
|
3741
|
+
innerRef: u,
|
|
3742
|
+
// Callbacks
|
|
3743
|
+
onLayoutChange: a = He,
|
|
3744
|
+
onDragStart: s = He,
|
|
3745
|
+
onDrag: h = He,
|
|
3746
|
+
onDragStop: y = He,
|
|
3747
|
+
onResizeStart: S = He,
|
|
3748
|
+
onResize: b = He,
|
|
3749
|
+
onResizeStop: R = He,
|
|
3750
|
+
onDrop: m = He,
|
|
3751
|
+
onDropDragOver: x = He
|
|
3752
|
+
} = e, C = we(
|
|
3753
|
+
() => ({ ...xo, ...n }),
|
|
3754
|
+
[n]
|
|
3755
|
+
), $ = we(
|
|
3756
|
+
() => ({ ...wo, ...o }),
|
|
3757
|
+
[o]
|
|
3758
|
+
), W = we(
|
|
3759
|
+
() => ({ ...So, ...i }),
|
|
3760
|
+
[i]
|
|
3761
|
+
), G = we(
|
|
3762
|
+
() => ({ ...Ro, ...l }),
|
|
3763
|
+
[l]
|
|
3764
|
+
), { cols: k, rowHeight: H, maxRows: J, margin: X, containerPadding: V } = C, {
|
|
3765
|
+
enabled: ie,
|
|
3766
|
+
bounded: ge,
|
|
3767
|
+
handle: E,
|
|
3768
|
+
cancel: f,
|
|
3769
|
+
threshold: D
|
|
3770
|
+
} = $, {
|
|
3771
|
+
enabled: z,
|
|
3772
|
+
handles: j,
|
|
3773
|
+
handleComponent: F
|
|
3774
|
+
} = W, {
|
|
3775
|
+
enabled: A,
|
|
3776
|
+
defaultItem: T,
|
|
3777
|
+
onDragOver: I
|
|
3778
|
+
} = G, N = d ?? Rr("vertical"), q = N.type, B = N.allowOverlap, _ = N.preventCollision ?? !1, ne = we(
|
|
3779
|
+
() => p ?? {
|
|
3780
|
+
i: "__dropping-elem__",
|
|
3781
|
+
...T
|
|
3782
|
+
},
|
|
3783
|
+
[p, T]
|
|
3784
|
+
), je = c.type === "transform", _e = c.scale, ye = V ?? X, [Ee, nt] = Te(!1), [fe, le] = Te(
|
|
3785
|
+
() => un(g, t, k, N)
|
|
3786
|
+
), [Pe, xe] = Te(null), [ke, Rt] = Te(!1), [Le, ot] = Te(
|
|
3787
|
+
null
|
|
3788
|
+
), [Fe, Ae] = Te(), at = se(null), st = se(null), Xe = se(null), Ie = se(0), ft = se(fe), dt = se(g), Et = se(t), Pt = se(q), ze = se(fe);
|
|
3789
|
+
ze.current = fe, Be(() => {
|
|
3790
|
+
nt(!0), Ye(fe, g) || a(fe);
|
|
3791
|
+
}, []), Be(() => {
|
|
3792
|
+
if (Pe || Le) return;
|
|
3793
|
+
const L = !Ye(g, dt.current), U = !sa(t, Et.current), Y = q !== Pt.current;
|
|
3794
|
+
if (L || U || Y) {
|
|
3795
|
+
const ae = un(
|
|
3796
|
+
L ? g : fe,
|
|
3797
|
+
t,
|
|
3798
|
+
k,
|
|
3799
|
+
N
|
|
3800
|
+
);
|
|
3801
|
+
Ye(ae, fe) || le(ae);
|
|
3802
|
+
}
|
|
3803
|
+
dt.current = g, Et.current = t, Pt.current = q;
|
|
3804
|
+
}, [
|
|
3805
|
+
g,
|
|
3806
|
+
t,
|
|
3807
|
+
k,
|
|
3808
|
+
q,
|
|
3809
|
+
N,
|
|
3810
|
+
Pe,
|
|
3811
|
+
Le,
|
|
3812
|
+
fe
|
|
3813
|
+
]), Be(() => {
|
|
3814
|
+
if (!Pe && !Ye(fe, ft.current)) {
|
|
3815
|
+
ft.current = fe;
|
|
3816
|
+
const L = fe.filter((U) => U.i !== ne.i);
|
|
3817
|
+
a(L);
|
|
3818
|
+
}
|
|
3819
|
+
}, [fe, Pe, a, ne.i]);
|
|
3820
|
+
const rr = we(() => {
|
|
3821
|
+
if (!w) return;
|
|
3822
|
+
const L = Vt(fe), U = ye[1];
|
|
3823
|
+
return L * H + (L - 1) * X[1] + U * 2 + "px";
|
|
3824
|
+
}, [w, fe, H, X, ye]), Ct = pe(
|
|
3825
|
+
(L, U, Y, K) => {
|
|
3826
|
+
const ae = ze.current, ee = Qe(ae, L);
|
|
3827
|
+
if (!ee) return;
|
|
3828
|
+
const ce = {
|
|
3829
|
+
w: ee.w,
|
|
3830
|
+
h: ee.h,
|
|
3831
|
+
x: ee.x,
|
|
3832
|
+
y: ee.y,
|
|
3833
|
+
i: L
|
|
3834
|
+
};
|
|
3835
|
+
at.current = rt(ee), Xe.current = ae, xe(ce), s(ae, ee, ee, null, K.e, K.node);
|
|
3836
|
+
},
|
|
3837
|
+
[s]
|
|
3838
|
+
), Ue = pe(
|
|
3839
|
+
(L, U, Y, K) => {
|
|
3840
|
+
const ae = ze.current, ee = at.current, ce = Qe(ae, L);
|
|
3841
|
+
if (!ce) return;
|
|
3842
|
+
const be = {
|
|
3843
|
+
w: ce.w,
|
|
3844
|
+
h: ce.h,
|
|
3845
|
+
x: ce.x,
|
|
3846
|
+
y: ce.y,
|
|
3847
|
+
i: L
|
|
3848
|
+
}, ue = et(
|
|
3849
|
+
ae,
|
|
3850
|
+
ce,
|
|
3851
|
+
U,
|
|
3852
|
+
Y,
|
|
3853
|
+
!0,
|
|
3854
|
+
_,
|
|
3855
|
+
q,
|
|
3856
|
+
k,
|
|
3857
|
+
B
|
|
3858
|
+
);
|
|
3859
|
+
h(ue, ee, ce, be, K.e, K.node), le(N.compact(ue, k)), xe(be);
|
|
3860
|
+
},
|
|
3861
|
+
[_, q, k, B, N, h]
|
|
3862
|
+
), Ot = pe(
|
|
3863
|
+
(L, U, Y, K) => {
|
|
3864
|
+
if (!Pe) return;
|
|
3865
|
+
const ae = ze.current, ee = at.current, ce = Qe(ae, L);
|
|
3866
|
+
if (!ce) return;
|
|
3867
|
+
const be = et(
|
|
3868
|
+
ae,
|
|
3869
|
+
ce,
|
|
3870
|
+
U,
|
|
3871
|
+
Y,
|
|
3872
|
+
!0,
|
|
3873
|
+
_,
|
|
3874
|
+
q,
|
|
3875
|
+
k,
|
|
3876
|
+
B
|
|
3877
|
+
), ue = N.compact(be, k);
|
|
3878
|
+
y(ue, ee, ce, null, K.e, K.node);
|
|
3879
|
+
const Se = Xe.current;
|
|
3880
|
+
at.current = null, Xe.current = null, xe(null), le(ue), Se && !Ye(Se, ue) && a(ue);
|
|
3881
|
+
},
|
|
3882
|
+
[
|
|
3883
|
+
Pe,
|
|
3884
|
+
_,
|
|
3885
|
+
q,
|
|
3886
|
+
k,
|
|
3887
|
+
B,
|
|
3888
|
+
N,
|
|
3889
|
+
y,
|
|
3890
|
+
a
|
|
3891
|
+
]
|
|
3892
|
+
), Z = pe(
|
|
3893
|
+
(L, U, Y, K) => {
|
|
3894
|
+
const ae = ze.current, ee = Qe(ae, L);
|
|
3895
|
+
ee && (st.current = rt(ee), Xe.current = ae, Rt(!0), S(ae, ee, ee, null, K.e, K.node));
|
|
3896
|
+
},
|
|
3897
|
+
[S]
|
|
3898
|
+
), Q = pe(
|
|
3899
|
+
(L, U, Y, K) => {
|
|
3900
|
+
const ae = ze.current, ee = st.current, { handle: ce } = K;
|
|
3901
|
+
let be = !1, ue, Se;
|
|
3902
|
+
const [_t, $e] = oo(ae, L, (de) => (ue = de.x, Se = de.y, ["sw", "w", "nw", "n", "ne"].includes(ce) && (["sw", "nw", "w"].includes(ce) && (ue = de.x + (de.w - U), U = de.x !== ue && ue < 0 ? de.w : U, ue = ue < 0 ? 0 : ue), ["ne", "n", "nw"].includes(ce) && (Se = de.y + (de.h - Y), Y = de.y !== Se && Se < 0 ? de.h : Y, Se = Se < 0 ? 0 : Se), be = !0), _ && !B && yn(ae, {
|
|
3903
|
+
...de,
|
|
3904
|
+
w: U,
|
|
3905
|
+
h: Y,
|
|
3906
|
+
x: ue ?? de.x,
|
|
3907
|
+
y: Se ?? de.y
|
|
3908
|
+
}).filter((Tt) => Tt.i !== de.i).length > 0 && (Se = de.y, Y = de.h, ue = de.x, U = de.w, be = !1), de.w = U, de.h = Y, de));
|
|
3909
|
+
if (!$e) return;
|
|
3910
|
+
let pt = _t;
|
|
3911
|
+
be && ue !== void 0 && Se !== void 0 && (pt = et(
|
|
3912
|
+
_t,
|
|
3913
|
+
$e,
|
|
3914
|
+
ue,
|
|
3915
|
+
Se,
|
|
3916
|
+
!0,
|
|
3917
|
+
_,
|
|
3918
|
+
q,
|
|
3919
|
+
k,
|
|
3920
|
+
B
|
|
3921
|
+
));
|
|
3922
|
+
const Dt = {
|
|
3923
|
+
w: $e.w,
|
|
3924
|
+
h: $e.h,
|
|
3925
|
+
x: $e.x,
|
|
3926
|
+
y: $e.y,
|
|
3927
|
+
i: L,
|
|
3928
|
+
static: !0
|
|
3929
|
+
};
|
|
3930
|
+
b(
|
|
3931
|
+
pt,
|
|
3932
|
+
ee,
|
|
3933
|
+
$e,
|
|
3934
|
+
Dt,
|
|
3935
|
+
K.e,
|
|
3936
|
+
K.node
|
|
3937
|
+
), le(N.compact(pt, k)), xe(Dt);
|
|
3938
|
+
},
|
|
3939
|
+
[_, q, k, B, N, b]
|
|
3940
|
+
), he = pe(
|
|
3941
|
+
(L, U, Y, K) => {
|
|
3942
|
+
const ae = ze.current, ee = st.current, ce = Qe(ae, L), be = N.compact(ae, k);
|
|
3943
|
+
R(
|
|
3944
|
+
be,
|
|
3945
|
+
ee,
|
|
3946
|
+
ce ?? null,
|
|
3947
|
+
null,
|
|
3948
|
+
K.e,
|
|
3949
|
+
K.node
|
|
3950
|
+
);
|
|
3951
|
+
const ue = Xe.current;
|
|
3952
|
+
st.current = null, Xe.current = null, xe(null), Rt(!1), le(be), ue && !Ye(ue, be) && a(be);
|
|
3953
|
+
},
|
|
3954
|
+
[k, N, R, a]
|
|
3955
|
+
), oe = pe(() => {
|
|
3956
|
+
const L = ze.current;
|
|
3957
|
+
if (!L.some((K) => K.i === ne.i)) {
|
|
3958
|
+
ot(null), xe(null), Ae(void 0);
|
|
3959
|
+
return;
|
|
3960
|
+
}
|
|
3961
|
+
const Y = N.compact(
|
|
3962
|
+
L.filter((K) => K.i !== ne.i),
|
|
3963
|
+
k
|
|
3964
|
+
);
|
|
3965
|
+
le(Y), ot(null), xe(null), Ae(void 0);
|
|
3966
|
+
}, [ne.i, k, N]), ve = pe(
|
|
3967
|
+
(L) => {
|
|
3968
|
+
if (L.preventDefault(), L.stopPropagation(), Hn && !L.nativeEvent.target?.classList.contains(
|
|
3969
|
+
cn
|
|
3970
|
+
))
|
|
3971
|
+
return !1;
|
|
3972
|
+
const U = I ? I(L.nativeEvent) : x(L);
|
|
3973
|
+
if (U === !1)
|
|
3974
|
+
return Le && oe(), !1;
|
|
3975
|
+
const {
|
|
3976
|
+
dragOffsetX: Y = 0,
|
|
3977
|
+
dragOffsetY: K = 0,
|
|
3978
|
+
...ae
|
|
3979
|
+
} = U ?? {}, ee = { ...ne, ...ae }, ce = L.currentTarget.getBoundingClientRect(), be = {
|
|
3980
|
+
cols: k,
|
|
3981
|
+
margin: X,
|
|
3982
|
+
maxRows: J,
|
|
3983
|
+
rowHeight: H,
|
|
3984
|
+
containerWidth: r,
|
|
3985
|
+
containerPadding: ye
|
|
3986
|
+
}, ue = ut(be), Se = ct(
|
|
3987
|
+
ee.w,
|
|
3988
|
+
ue,
|
|
3989
|
+
X[0]
|
|
3990
|
+
), _t = ct(
|
|
3991
|
+
ee.h,
|
|
3992
|
+
H,
|
|
3993
|
+
X[1]
|
|
3994
|
+
), $e = Se / 2, pt = _t / 2, Dt = L.clientX - ce.left + Y - $e, de = L.clientY - ce.top + K - pt, nr = Math.max(0, Dt), Tt = Math.max(0, de), jt = {
|
|
3995
|
+
left: nr / _e,
|
|
3996
|
+
top: Tt / _e,
|
|
3997
|
+
e: L.nativeEvent
|
|
3998
|
+
};
|
|
3999
|
+
if (Le)
|
|
4000
|
+
Fe && (Fe.left !== jt.left || Fe.top !== jt.top) && Ae(jt);
|
|
4001
|
+
else {
|
|
4002
|
+
const or = eo(
|
|
4003
|
+
be,
|
|
4004
|
+
Tt,
|
|
4005
|
+
nr,
|
|
4006
|
+
ee.w,
|
|
4007
|
+
ee.h
|
|
4008
|
+
);
|
|
4009
|
+
ot(/* @__PURE__ */ M.jsx("div", {}, ee.i)), Ae(jt), le([
|
|
4010
|
+
...ze.current,
|
|
4011
|
+
{
|
|
4012
|
+
...ee,
|
|
4013
|
+
x: or.x,
|
|
4014
|
+
y: or.y,
|
|
4015
|
+
static: !1,
|
|
4016
|
+
isDraggable: !0
|
|
4017
|
+
}
|
|
4018
|
+
]);
|
|
4019
|
+
}
|
|
4020
|
+
},
|
|
4021
|
+
[
|
|
4022
|
+
Le,
|
|
4023
|
+
Fe,
|
|
4024
|
+
ne,
|
|
4025
|
+
I,
|
|
4026
|
+
x,
|
|
4027
|
+
oe,
|
|
4028
|
+
_e,
|
|
4029
|
+
k,
|
|
4030
|
+
X,
|
|
4031
|
+
J,
|
|
4032
|
+
H,
|
|
4033
|
+
r,
|
|
4034
|
+
ye
|
|
4035
|
+
]
|
|
4036
|
+
), Ce = pe(
|
|
4037
|
+
(L) => {
|
|
4038
|
+
L.preventDefault(), L.stopPropagation(), Ie.current--, Ie.current < 0 && (Ie.current = 0), Ie.current === 0 && oe();
|
|
4039
|
+
},
|
|
4040
|
+
[oe]
|
|
4041
|
+
), De = pe((L) => {
|
|
4042
|
+
L.preventDefault(), L.stopPropagation(), Ie.current++;
|
|
4043
|
+
}, []), Oe = pe(
|
|
4044
|
+
(L) => {
|
|
4045
|
+
L.preventDefault(), L.stopPropagation();
|
|
4046
|
+
const U = ze.current, Y = U.find((K) => K.i === ne.i);
|
|
4047
|
+
Ie.current = 0, oe(), m(U, Y, L.nativeEvent);
|
|
4048
|
+
},
|
|
4049
|
+
[ne.i, oe, m]
|
|
4050
|
+
), Me = pe(
|
|
4051
|
+
(L, U) => {
|
|
4052
|
+
if (!L || !L.key) return null;
|
|
4053
|
+
const Y = Qe(fe, String(L.key));
|
|
4054
|
+
if (!Y) return null;
|
|
4055
|
+
const K = typeof Y.isDraggable == "boolean" ? Y.isDraggable : !Y.static && ie, ae = typeof Y.isResizable == "boolean" ? Y.isResizable : !Y.static && z, ee = Y.resizeHandles || [...j], ce = K && ge && Y.isBounded !== !1, be = F;
|
|
4056
|
+
return /* @__PURE__ */ M.jsx(
|
|
4057
|
+
ln,
|
|
4058
|
+
{
|
|
4059
|
+
containerWidth: r,
|
|
4060
|
+
cols: k,
|
|
4061
|
+
margin: X,
|
|
4062
|
+
containerPadding: ye,
|
|
4063
|
+
maxRows: J,
|
|
4064
|
+
rowHeight: H,
|
|
4065
|
+
cancel: f,
|
|
4066
|
+
handle: E,
|
|
4067
|
+
onDragStart: Ct,
|
|
4068
|
+
onDrag: Ue,
|
|
4069
|
+
onDragStop: Ot,
|
|
4070
|
+
onResizeStart: Z,
|
|
4071
|
+
onResize: Q,
|
|
4072
|
+
onResizeStop: he,
|
|
4073
|
+
isDraggable: K,
|
|
4074
|
+
isResizable: ae,
|
|
4075
|
+
isBounded: ce,
|
|
4076
|
+
useCSSTransforms: je && Ee,
|
|
4077
|
+
usePercentages: !Ee,
|
|
4078
|
+
transformScale: _e,
|
|
4079
|
+
positionStrategy: c,
|
|
4080
|
+
dragThreshold: D,
|
|
4081
|
+
w: Y.w,
|
|
4082
|
+
h: Y.h,
|
|
4083
|
+
x: Y.x,
|
|
4084
|
+
y: Y.y,
|
|
4085
|
+
i: Y.i,
|
|
4086
|
+
minH: Y.minH,
|
|
4087
|
+
minW: Y.minW,
|
|
4088
|
+
maxH: Y.maxH,
|
|
4089
|
+
maxW: Y.maxW,
|
|
4090
|
+
static: Y.static,
|
|
4091
|
+
droppingPosition: U ? Fe : void 0,
|
|
4092
|
+
resizeHandles: ee,
|
|
4093
|
+
resizeHandle: be,
|
|
4094
|
+
constraints: v,
|
|
4095
|
+
layoutItem: Y,
|
|
4096
|
+
layout: fe,
|
|
4097
|
+
children: L
|
|
4098
|
+
},
|
|
4099
|
+
Y.i
|
|
4100
|
+
);
|
|
4101
|
+
},
|
|
4102
|
+
[
|
|
4103
|
+
fe,
|
|
4104
|
+
r,
|
|
4105
|
+
k,
|
|
4106
|
+
X,
|
|
4107
|
+
ye,
|
|
4108
|
+
J,
|
|
4109
|
+
H,
|
|
4110
|
+
f,
|
|
4111
|
+
E,
|
|
4112
|
+
Ct,
|
|
4113
|
+
Ue,
|
|
4114
|
+
Ot,
|
|
4115
|
+
Z,
|
|
4116
|
+
Q,
|
|
4117
|
+
he,
|
|
4118
|
+
ie,
|
|
4119
|
+
z,
|
|
4120
|
+
ge,
|
|
4121
|
+
je,
|
|
4122
|
+
Ee,
|
|
4123
|
+
_e,
|
|
4124
|
+
c,
|
|
4125
|
+
D,
|
|
4126
|
+
Fe,
|
|
4127
|
+
j,
|
|
4128
|
+
F,
|
|
4129
|
+
v
|
|
4130
|
+
]
|
|
4131
|
+
), Ne = () => Pe ? /* @__PURE__ */ M.jsx(
|
|
4132
|
+
ln,
|
|
4133
|
+
{
|
|
4134
|
+
w: Pe.w,
|
|
4135
|
+
h: Pe.h,
|
|
4136
|
+
x: Pe.x,
|
|
4137
|
+
y: Pe.y,
|
|
4138
|
+
i: Pe.i,
|
|
4139
|
+
className: `react-grid-placeholder ${ke ? "placeholder-resizing" : ""}`,
|
|
4140
|
+
containerWidth: r,
|
|
4141
|
+
cols: k,
|
|
4142
|
+
margin: X,
|
|
4143
|
+
containerPadding: ye,
|
|
4144
|
+
maxRows: J,
|
|
4145
|
+
rowHeight: H,
|
|
4146
|
+
isDraggable: !1,
|
|
4147
|
+
isResizable: !1,
|
|
4148
|
+
isBounded: !1,
|
|
4149
|
+
useCSSTransforms: je,
|
|
4150
|
+
transformScale: _e,
|
|
4151
|
+
constraints: v,
|
|
4152
|
+
layout: fe,
|
|
4153
|
+
children: /* @__PURE__ */ M.jsx("div", {})
|
|
4154
|
+
}
|
|
4155
|
+
) : null, Ge = mr(cn, P), Ve = {
|
|
4156
|
+
height: rr,
|
|
4157
|
+
...O
|
|
4158
|
+
};
|
|
4159
|
+
return /* @__PURE__ */ M.jsxs(
|
|
4160
|
+
"div",
|
|
4161
|
+
{
|
|
4162
|
+
ref: u,
|
|
4163
|
+
className: Ge,
|
|
4164
|
+
style: Ve,
|
|
4165
|
+
onDrop: A ? Oe : void 0,
|
|
4166
|
+
onDragLeave: A ? Ce : void 0,
|
|
4167
|
+
onDragEnter: A ? De : void 0,
|
|
4168
|
+
onDragOver: A ? ve : void 0,
|
|
4169
|
+
children: [
|
|
4170
|
+
Re.Children.map(t, (L) => Re.isValidElement(L) ? Me(L) : null),
|
|
4171
|
+
A && Le && Me(Le, !0),
|
|
4172
|
+
Ne()
|
|
4173
|
+
]
|
|
4174
|
+
}
|
|
4175
|
+
);
|
|
4176
|
+
}
|
|
4177
|
+
var la = {
|
|
4178
|
+
lg: 1200,
|
|
4179
|
+
md: 996,
|
|
4180
|
+
sm: 768,
|
|
4181
|
+
xs: 480,
|
|
4182
|
+
xxs: 0
|
|
4183
|
+
}, ca = {
|
|
4184
|
+
lg: 12,
|
|
4185
|
+
md: 10,
|
|
4186
|
+
sm: 6,
|
|
4187
|
+
xs: 4,
|
|
4188
|
+
xxs: 2
|
|
4189
|
+
}, pr = () => {
|
|
4190
|
+
};
|
|
4191
|
+
function ua(e, t, r, n) {
|
|
4192
|
+
const o = [];
|
|
4193
|
+
Re.Children.forEach(t, (l) => {
|
|
4194
|
+
if (!Re.isValidElement(l) || l.key === null) return;
|
|
4195
|
+
const c = String(l.key), d = e.find((v) => v.i === c);
|
|
4196
|
+
if (d)
|
|
4197
|
+
o.push({
|
|
4198
|
+
...d,
|
|
4199
|
+
i: c
|
|
4200
|
+
});
|
|
4201
|
+
else {
|
|
4202
|
+
const g = l.props["data-grid"];
|
|
4203
|
+
g ? o.push({
|
|
4204
|
+
i: c,
|
|
4205
|
+
x: g.x ?? 0,
|
|
4206
|
+
y: g.y ?? 0,
|
|
4207
|
+
w: g.w ?? 1,
|
|
4208
|
+
h: g.h ?? 1,
|
|
4209
|
+
minW: g.minW,
|
|
4210
|
+
maxW: g.maxW,
|
|
4211
|
+
minH: g.minH,
|
|
4212
|
+
maxH: g.maxH,
|
|
4213
|
+
static: g.static,
|
|
4214
|
+
isDraggable: g.isDraggable,
|
|
4215
|
+
isResizable: g.isResizable,
|
|
4216
|
+
resizeHandles: g.resizeHandles,
|
|
4217
|
+
isBounded: g.isBounded
|
|
4218
|
+
}) : o.push({
|
|
4219
|
+
i: c,
|
|
4220
|
+
x: 0,
|
|
4221
|
+
y: Vt(o),
|
|
4222
|
+
w: 1,
|
|
4223
|
+
h: 1
|
|
4224
|
+
});
|
|
4225
|
+
}
|
|
4226
|
+
});
|
|
4227
|
+
const i = yr(o, { cols: r });
|
|
4228
|
+
return n.compact(i, r);
|
|
4229
|
+
}
|
|
4230
|
+
function fa(e) {
|
|
4231
|
+
const {
|
|
4232
|
+
children: t,
|
|
4233
|
+
width: r,
|
|
4234
|
+
breakpoint: n,
|
|
4235
|
+
breakpoints: o = la,
|
|
4236
|
+
cols: i = ca,
|
|
4237
|
+
layouts: l = {},
|
|
4238
|
+
rowHeight: c = 150,
|
|
4239
|
+
maxRows: d = 1 / 0,
|
|
4240
|
+
margin: v = [10, 10],
|
|
4241
|
+
containerPadding: g = null,
|
|
4242
|
+
compactor: p,
|
|
4243
|
+
onBreakpointChange: w = pr,
|
|
4244
|
+
onLayoutChange: P = pr,
|
|
4245
|
+
onWidthChange: O = pr,
|
|
4246
|
+
...u
|
|
4247
|
+
} = e, a = p ?? Rr("vertical"), s = a.type, h = a.allowOverlap, y = we(() => n ?? Mr(o, r), []), S = we(() => Nr(y, i), [y, i]), b = we(() => ar(
|
|
4248
|
+
l,
|
|
4249
|
+
o,
|
|
4250
|
+
y,
|
|
4251
|
+
y,
|
|
4252
|
+
S,
|
|
4253
|
+
s
|
|
4254
|
+
), []), [R, m] = Te(y), [x, C] = Te(S), [$, W] = Te(b), [G, k] = Te(l), H = se(r), J = se(n), X = se(o), V = se(i), ie = se(l), ge = se(s), E = se(G);
|
|
4255
|
+
Be(() => {
|
|
4256
|
+
E.current = G;
|
|
4257
|
+
}, [G]);
|
|
4258
|
+
const f = we(() => Ye(l, ie.current) ? null : ar(
|
|
4259
|
+
l,
|
|
4260
|
+
o,
|
|
4261
|
+
R,
|
|
4262
|
+
R,
|
|
4263
|
+
x,
|
|
4264
|
+
a
|
|
4265
|
+
), [l, o, R, x, a]), D = f ?? $;
|
|
4266
|
+
Be(() => {
|
|
4267
|
+
f !== null && (W(f), k(l), E.current = l, ie.current = l);
|
|
4268
|
+
}, [f, l]), Be(() => {
|
|
4269
|
+
if (s !== ge.current) {
|
|
4270
|
+
const T = a.compact(Ze(D), x), I = {
|
|
4271
|
+
...E.current,
|
|
4272
|
+
[R]: T
|
|
4273
|
+
};
|
|
4274
|
+
W(T), k(I), E.current = I, P(T, I), ge.current = s;
|
|
4275
|
+
}
|
|
4276
|
+
}, [
|
|
4277
|
+
s,
|
|
4278
|
+
a,
|
|
4279
|
+
D,
|
|
4280
|
+
x,
|
|
4281
|
+
h,
|
|
4282
|
+
R,
|
|
4283
|
+
P
|
|
4284
|
+
]), Be(() => {
|
|
4285
|
+
const T = r !== H.current, I = n !== J.current, N = !Ye(
|
|
4286
|
+
o,
|
|
4287
|
+
X.current
|
|
4288
|
+
), q = !Ye(i, V.current);
|
|
4289
|
+
if (T || I || N || q) {
|
|
4290
|
+
const B = n ?? Mr(o, r), _ = Nr(B, i), ne = R;
|
|
4291
|
+
if (ne !== B || N || q) {
|
|
4292
|
+
const ye = { ...E.current };
|
|
4293
|
+
ye[ne] || (ye[ne] = Ze($));
|
|
4294
|
+
let Ee = ar(
|
|
4295
|
+
ye,
|
|
4296
|
+
o,
|
|
4297
|
+
B,
|
|
4298
|
+
ne,
|
|
4299
|
+
_,
|
|
4300
|
+
a
|
|
4301
|
+
);
|
|
4302
|
+
Ee = ua(
|
|
4303
|
+
Ee,
|
|
4304
|
+
t,
|
|
4305
|
+
_,
|
|
4306
|
+
a
|
|
4307
|
+
), ye[B] = Ee, m(B), C(_), W(Ee), k(ye), E.current = ye, w(B, _), P(Ee, ye);
|
|
4308
|
+
}
|
|
4309
|
+
const je = At(
|
|
4310
|
+
v,
|
|
4311
|
+
B
|
|
4312
|
+
), _e = g ? At(
|
|
4313
|
+
g,
|
|
4314
|
+
B
|
|
4315
|
+
) : null;
|
|
4316
|
+
O(r, je, _, _e), H.current = r, J.current = n, X.current = o, V.current = i;
|
|
4317
|
+
}
|
|
4318
|
+
}, [
|
|
4319
|
+
r,
|
|
4320
|
+
n,
|
|
4321
|
+
o,
|
|
4322
|
+
i,
|
|
4323
|
+
R,
|
|
4324
|
+
x,
|
|
4325
|
+
$,
|
|
4326
|
+
t,
|
|
4327
|
+
a,
|
|
4328
|
+
s,
|
|
4329
|
+
h,
|
|
4330
|
+
v,
|
|
4331
|
+
g,
|
|
4332
|
+
w,
|
|
4333
|
+
P,
|
|
4334
|
+
O
|
|
4335
|
+
]);
|
|
4336
|
+
const z = pe(
|
|
4337
|
+
(T) => {
|
|
4338
|
+
const N = {
|
|
4339
|
+
...E.current,
|
|
4340
|
+
[R]: T
|
|
4341
|
+
};
|
|
4342
|
+
W(T), k(N), E.current = N, P(T, N);
|
|
4343
|
+
},
|
|
4344
|
+
[R, P]
|
|
4345
|
+
), j = we(() => At(
|
|
4346
|
+
v,
|
|
4347
|
+
R
|
|
4348
|
+
), [v, R]), F = we(() => g === null ? null : At(
|
|
4349
|
+
g,
|
|
4350
|
+
R
|
|
4351
|
+
), [g, R]), A = we(
|
|
4352
|
+
() => ({
|
|
4353
|
+
cols: x,
|
|
4354
|
+
rowHeight: c,
|
|
4355
|
+
maxRows: d,
|
|
4356
|
+
margin: j,
|
|
4357
|
+
containerPadding: F
|
|
4358
|
+
}),
|
|
4359
|
+
[x, c, d, j, F]
|
|
4360
|
+
);
|
|
4361
|
+
return /* @__PURE__ */ M.jsx(
|
|
4362
|
+
ia,
|
|
4363
|
+
{
|
|
4364
|
+
...u,
|
|
4365
|
+
width: r,
|
|
4366
|
+
gridConfig: A,
|
|
4367
|
+
compactor: a,
|
|
4368
|
+
onLayoutChange: z,
|
|
4369
|
+
layout: D,
|
|
4370
|
+
children: t
|
|
4371
|
+
}
|
|
4372
|
+
);
|
|
4373
|
+
}
|
|
4374
|
+
const da = [
|
|
4375
|
+
"hsl(var(--chart-1))",
|
|
4376
|
+
"hsl(var(--chart-2))",
|
|
4377
|
+
"hsl(var(--chart-3))",
|
|
4378
|
+
"hsl(var(--chart-4))",
|
|
4379
|
+
"hsl(var(--chart-5))"
|
|
4380
|
+
], Yn = ({
|
|
4381
|
+
schema: e,
|
|
4382
|
+
className: t,
|
|
4383
|
+
onLayoutChange: r,
|
|
4384
|
+
persistLayoutKey: n = "dashboard-layout"
|
|
4385
|
+
}) => {
|
|
4386
|
+
const { width: o, containerRef: i, mounted: l } = Fo(), [c, d] = it.useState(!1), [v, g] = it.useState(() => {
|
|
4387
|
+
if (typeof window < "u" && n) {
|
|
4388
|
+
const u = localStorage.getItem(n);
|
|
4389
|
+
if (u)
|
|
4390
|
+
try {
|
|
4391
|
+
return JSON.parse(u);
|
|
4392
|
+
} catch (a) {
|
|
4393
|
+
console.error("Failed to parse saved layout:", a);
|
|
4394
|
+
}
|
|
4395
|
+
}
|
|
4396
|
+
return {
|
|
4397
|
+
lg: e.widgets?.map((u, a) => ({
|
|
4398
|
+
i: u.id || `widget-${a}`,
|
|
4399
|
+
x: u.layout?.x || a % 4 * 3,
|
|
4400
|
+
y: u.layout?.y || Math.floor(a / 4) * 4,
|
|
4401
|
+
w: u.layout?.w || 3,
|
|
4402
|
+
h: u.layout?.h || 4
|
|
4403
|
+
})) || []
|
|
4404
|
+
};
|
|
4405
|
+
}), p = it.useCallback(
|
|
4406
|
+
(u, a) => {
|
|
4407
|
+
g(a), r?.(u);
|
|
4408
|
+
},
|
|
4409
|
+
[r]
|
|
4410
|
+
), w = it.useCallback(() => {
|
|
4411
|
+
typeof window < "u" && n && localStorage.setItem(n, JSON.stringify(v)), d(!1);
|
|
4412
|
+
}, [v, n]), P = it.useCallback(() => {
|
|
4413
|
+
const u = {
|
|
4414
|
+
lg: e.widgets?.map((a, s) => ({
|
|
4415
|
+
i: a.id || `widget-${s}`,
|
|
4416
|
+
x: a.layout?.x || s % 4 * 3,
|
|
4417
|
+
y: a.layout?.y || Math.floor(s / 4) * 4,
|
|
4418
|
+
w: a.layout?.w || 3,
|
|
4419
|
+
h: a.layout?.h || 4
|
|
4420
|
+
})) || []
|
|
4421
|
+
};
|
|
4422
|
+
g(u), typeof window < "u" && n && localStorage.removeItem(n);
|
|
4423
|
+
}, [e.widgets, n]), O = it.useCallback((u) => {
|
|
4424
|
+
if (u.component) return u.component;
|
|
4425
|
+
const a = u.type;
|
|
4426
|
+
if (a === "bar" || a === "line" || a === "area" || a === "pie" || a === "donut") {
|
|
4427
|
+
const s = Array.isArray(u.data) ? u.data : u.data?.items || [], h = u.options || {}, y = h.xField || "name", S = h.yField || "value";
|
|
4428
|
+
return {
|
|
4429
|
+
type: "chart",
|
|
4430
|
+
chartType: a,
|
|
4431
|
+
data: s,
|
|
4432
|
+
xAxisKey: y,
|
|
4433
|
+
series: [{ dataKey: S }],
|
|
4434
|
+
colors: da,
|
|
4435
|
+
className: "h-full"
|
|
4436
|
+
};
|
|
4437
|
+
}
|
|
4438
|
+
return a === "table" ? {
|
|
4439
|
+
type: "data-table",
|
|
4440
|
+
...u.options,
|
|
4441
|
+
data: u.data?.items || [],
|
|
4442
|
+
searchable: !1,
|
|
4443
|
+
pagination: !1,
|
|
4444
|
+
className: "border-0"
|
|
4445
|
+
} : u;
|
|
4446
|
+
}, []);
|
|
4447
|
+
return /* @__PURE__ */ M.jsxs("div", { ref: i, className: qe("w-full", t), "data-testid": "grid-layout", children: [
|
|
4448
|
+
/* @__PURE__ */ M.jsxs("div", { className: "mb-4 flex items-center justify-between", children: [
|
|
4449
|
+
/* @__PURE__ */ M.jsx("h2", { className: "text-2xl font-bold", children: e.title || "Dashboard" }),
|
|
4450
|
+
/* @__PURE__ */ M.jsx("div", { className: "flex gap-2", children: c ? /* @__PURE__ */ M.jsxs(M.Fragment, { children: [
|
|
4451
|
+
/* @__PURE__ */ M.jsxs(zt, { onClick: w, size: "sm", variant: "default", children: [
|
|
4452
|
+
/* @__PURE__ */ M.jsx(Un, { className: "h-4 w-4 mr-2" }),
|
|
4453
|
+
"Save Layout"
|
|
4454
|
+
] }),
|
|
4455
|
+
/* @__PURE__ */ M.jsxs(zt, { onClick: P, size: "sm", variant: "outline", children: [
|
|
4456
|
+
/* @__PURE__ */ M.jsx(Gn, { className: "h-4 w-4 mr-2" }),
|
|
4457
|
+
"Reset"
|
|
4458
|
+
] }),
|
|
4459
|
+
/* @__PURE__ */ M.jsx(zt, { onClick: () => d(!1), size: "sm", variant: "ghost", children: "Cancel" })
|
|
4460
|
+
] }) : /* @__PURE__ */ M.jsxs(zt, { onClick: () => d(!0), size: "sm", variant: "outline", children: [
|
|
4461
|
+
/* @__PURE__ */ M.jsx(Vn, { className: "h-4 w-4 mr-2" }),
|
|
4462
|
+
"Edit Layout"
|
|
4463
|
+
] }) })
|
|
4464
|
+
] }),
|
|
4465
|
+
l && /* @__PURE__ */ M.jsx(
|
|
4466
|
+
fa,
|
|
4467
|
+
{
|
|
4468
|
+
className: "layout",
|
|
4469
|
+
width: o,
|
|
4470
|
+
layouts: v,
|
|
4471
|
+
breakpoints: { lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0 },
|
|
4472
|
+
cols: { lg: 12, md: 10, sm: 6, xs: 4, xxs: 2 },
|
|
4473
|
+
rowHeight: 60,
|
|
4474
|
+
dragConfig: { enabled: c, handle: ".drag-handle" },
|
|
4475
|
+
resizeConfig: { enabled: c },
|
|
4476
|
+
onLayoutChange: p,
|
|
4477
|
+
children: e.widgets?.map((u, a) => {
|
|
4478
|
+
const s = u.id || `widget-${a}`, h = O(u), y = u.type === "metric";
|
|
4479
|
+
return /* @__PURE__ */ M.jsx("div", { className: "h-full", children: y ? /* @__PURE__ */ M.jsxs("div", { className: "h-full w-full relative", children: [
|
|
4480
|
+
c && /* @__PURE__ */ M.jsx("div", { className: "drag-handle absolute top-2 right-2 z-10 cursor-move p-1 bg-background/80 rounded border border-border", children: /* @__PURE__ */ M.jsx(Or, { className: "h-4 w-4" }) }),
|
|
4481
|
+
/* @__PURE__ */ M.jsx($t, { schema: h, className: "h-full w-full" })
|
|
4482
|
+
] }) : /* @__PURE__ */ M.jsxs(Ft, { className: qe(
|
|
4483
|
+
"h-full overflow-hidden border-border/50 shadow-sm transition-all",
|
|
4484
|
+
"bg-card/50 backdrop-blur-sm",
|
|
4485
|
+
c && "ring-2 ring-primary/20"
|
|
4486
|
+
), children: [
|
|
4487
|
+
u.title && /* @__PURE__ */ M.jsxs(Xt, { className: "pb-2 border-b border-border/40 bg-muted/20 flex flex-row items-center justify-between", children: [
|
|
4488
|
+
/* @__PURE__ */ M.jsx(Ut, { className: "text-base font-medium tracking-tight truncate", title: u.title, children: u.title }),
|
|
4489
|
+
c && /* @__PURE__ */ M.jsx("div", { className: "drag-handle cursor-move p-1 hover:bg-muted/40 rounded", children: /* @__PURE__ */ M.jsx(Or, { className: "h-4 w-4" }) })
|
|
4490
|
+
] }),
|
|
4491
|
+
/* @__PURE__ */ M.jsx(Gt, { className: "p-0 h-full", children: /* @__PURE__ */ M.jsx("div", { className: qe("h-full w-full overflow-auto p-4"), children: /* @__PURE__ */ M.jsx($t, { schema: h }) }) })
|
|
4492
|
+
] }) }, s);
|
|
4493
|
+
})
|
|
4494
|
+
}
|
|
4495
|
+
)
|
|
4496
|
+
] });
|
|
4497
|
+
}, Bn = ({
|
|
4498
|
+
label: e,
|
|
4499
|
+
value: t,
|
|
4500
|
+
trend: r,
|
|
4501
|
+
icon: n,
|
|
4502
|
+
className: o,
|
|
4503
|
+
description: i,
|
|
4504
|
+
...l
|
|
4505
|
+
}) => {
|
|
4506
|
+
const c = we(() => {
|
|
4507
|
+
if (typeof n == "string") {
|
|
4508
|
+
const d = fn[n];
|
|
4509
|
+
return d ? /* @__PURE__ */ M.jsx(d, { className: "h-4 w-4 text-muted-foreground" }) : null;
|
|
4510
|
+
}
|
|
4511
|
+
return n;
|
|
4512
|
+
}, [n]);
|
|
4513
|
+
return /* @__PURE__ */ M.jsxs(Ft, { className: qe("h-full", o), ...l, children: [
|
|
4514
|
+
/* @__PURE__ */ M.jsxs(Xt, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
4515
|
+
/* @__PURE__ */ M.jsx(Ut, { className: "text-sm font-medium", children: e }),
|
|
4516
|
+
c && /* @__PURE__ */ M.jsx("div", { className: "h-4 w-4 text-muted-foreground", children: c })
|
|
4517
|
+
] }),
|
|
4518
|
+
/* @__PURE__ */ M.jsxs(Gt, { children: [
|
|
4519
|
+
/* @__PURE__ */ M.jsx("div", { className: "text-2xl font-bold", children: t }),
|
|
4520
|
+
(r || i) && /* @__PURE__ */ M.jsxs("p", { className: "text-xs text-muted-foreground flex items-center mt-1", children: [
|
|
4521
|
+
r && /* @__PURE__ */ M.jsxs("span", { className: qe(
|
|
4522
|
+
"flex items-center mr-2",
|
|
4523
|
+
r.direction === "up" && "text-green-500",
|
|
4524
|
+
r.direction === "down" && "text-red-500",
|
|
4525
|
+
r.direction === "neutral" && "text-yellow-500"
|
|
4526
|
+
), children: [
|
|
4527
|
+
r.direction === "up" && /* @__PURE__ */ M.jsx(dn, { className: "h-3 w-3 mr-1" }),
|
|
4528
|
+
r.direction === "down" && /* @__PURE__ */ M.jsx(pn, { className: "h-3 w-3 mr-1" }),
|
|
4529
|
+
r.direction === "neutral" && /* @__PURE__ */ M.jsx(hn, { className: "h-3 w-3 mr-1" }),
|
|
4530
|
+
r.value,
|
|
4531
|
+
"%"
|
|
4532
|
+
] }),
|
|
4533
|
+
i || r?.label
|
|
4534
|
+
] })
|
|
4535
|
+
] })
|
|
4536
|
+
] });
|
|
4537
|
+
}, Fn = ({
|
|
4538
|
+
title: e,
|
|
4539
|
+
value: t,
|
|
4540
|
+
icon: r,
|
|
4541
|
+
trend: n,
|
|
4542
|
+
trendValue: o,
|
|
4543
|
+
description: i,
|
|
4544
|
+
className: l,
|
|
4545
|
+
...c
|
|
4546
|
+
}) => {
|
|
4547
|
+
const d = r && fn[r];
|
|
4548
|
+
return /* @__PURE__ */ M.jsxs(Ft, { className: qe("h-full", l), ...c, children: [
|
|
4549
|
+
/* @__PURE__ */ M.jsxs(Xt, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
4550
|
+
/* @__PURE__ */ M.jsx(Ut, { className: "text-sm font-medium", children: e }),
|
|
4551
|
+
d && /* @__PURE__ */ M.jsx(d, { className: "h-4 w-4 text-muted-foreground" })
|
|
4552
|
+
] }),
|
|
4553
|
+
/* @__PURE__ */ M.jsxs(Gt, { children: [
|
|
4554
|
+
/* @__PURE__ */ M.jsx("div", { className: "text-2xl font-bold", children: t }),
|
|
4555
|
+
(n || o || i) && /* @__PURE__ */ M.jsxs("p", { className: "text-xs text-muted-foreground flex items-center mt-1", children: [
|
|
4556
|
+
n && o && /* @__PURE__ */ M.jsxs("span", { className: qe(
|
|
4557
|
+
"flex items-center mr-2",
|
|
4558
|
+
n === "up" && "text-green-500",
|
|
4559
|
+
n === "down" && "text-red-500",
|
|
4560
|
+
n === "neutral" && "text-yellow-500"
|
|
4561
|
+
), children: [
|
|
4562
|
+
n === "up" && /* @__PURE__ */ M.jsx(dn, { className: "h-3 w-3 mr-1" }),
|
|
4563
|
+
n === "down" && /* @__PURE__ */ M.jsx(pn, { className: "h-3 w-3 mr-1" }),
|
|
4564
|
+
n === "neutral" && /* @__PURE__ */ M.jsx(hn, { className: "h-3 w-3 mr-1" }),
|
|
4565
|
+
o
|
|
4566
|
+
] }),
|
|
4567
|
+
i
|
|
4568
|
+
] })
|
|
4569
|
+
] })
|
|
4570
|
+
] });
|
|
4571
|
+
};
|
|
4572
|
+
Bt.register(
|
|
4573
|
+
"dashboard",
|
|
4574
|
+
gn,
|
|
4575
|
+
{
|
|
4576
|
+
namespace: "view",
|
|
4577
|
+
label: "Dashboard",
|
|
4578
|
+
category: "Complex",
|
|
4579
|
+
icon: "layout-dashboard",
|
|
4580
|
+
inputs: [
|
|
4581
|
+
{ name: "columns", type: "number", label: "Columns", defaultValue: 3 },
|
|
4582
|
+
{ name: "gap", type: "number", label: "Gap", defaultValue: 4 },
|
|
4583
|
+
{ name: "className", type: "string", label: "CSS Class" }
|
|
4584
|
+
],
|
|
4585
|
+
defaultProps: {
|
|
4586
|
+
columns: 3,
|
|
4587
|
+
widgets: []
|
|
4588
|
+
}
|
|
4589
|
+
}
|
|
4590
|
+
);
|
|
4591
|
+
Bt.register(
|
|
4592
|
+
"metric",
|
|
4593
|
+
Bn,
|
|
4594
|
+
{
|
|
4595
|
+
namespace: "plugin-dashboard",
|
|
4596
|
+
label: "Metric Widget",
|
|
4597
|
+
category: "Dashboard",
|
|
4598
|
+
inputs: [
|
|
4599
|
+
{ name: "label", type: "string", label: "Label" },
|
|
4600
|
+
{ name: "value", type: "string", label: "Value" }
|
|
4601
|
+
]
|
|
4602
|
+
}
|
|
4603
|
+
);
|
|
4604
|
+
Bt.register(
|
|
4605
|
+
"metric-card",
|
|
4606
|
+
Fn,
|
|
4607
|
+
{
|
|
4608
|
+
namespace: "plugin-dashboard",
|
|
4609
|
+
label: "Metric Card",
|
|
4610
|
+
category: "Dashboard",
|
|
4611
|
+
inputs: [
|
|
4612
|
+
{ name: "title", type: "string", label: "Title" },
|
|
4613
|
+
{ name: "value", type: "string", label: "Value", required: !0 },
|
|
4614
|
+
{ name: "icon", type: "string", label: "Icon (Lucide name)" },
|
|
4615
|
+
{ name: "trend", type: "enum", label: "Trend", enum: [
|
|
4616
|
+
{ label: "Up", value: "up" },
|
|
4617
|
+
{ label: "Down", value: "down" },
|
|
4618
|
+
{ label: "Neutral", value: "neutral" }
|
|
4619
|
+
] },
|
|
4620
|
+
{ name: "trendValue", type: "string", label: "Trend Value (e.g., +12%)" },
|
|
4621
|
+
{ name: "description", type: "string", label: "Description" }
|
|
4622
|
+
],
|
|
4623
|
+
defaultProps: {
|
|
4624
|
+
title: "Metric",
|
|
4625
|
+
value: "0"
|
|
4626
|
+
}
|
|
4627
|
+
}
|
|
4628
|
+
);
|
|
4629
|
+
Bt.register(
|
|
4630
|
+
"dashboard-grid",
|
|
4631
|
+
Yn,
|
|
4632
|
+
{
|
|
4633
|
+
namespace: "plugin-dashboard",
|
|
4634
|
+
label: "Dashboard Grid (Editable)",
|
|
4635
|
+
category: "Complex",
|
|
4636
|
+
icon: "layout-grid",
|
|
4637
|
+
inputs: [
|
|
4638
|
+
{ name: "title", type: "string", label: "Title" },
|
|
4639
|
+
{ name: "persistLayoutKey", type: "string", label: "Layout Storage Key", defaultValue: "dashboard-layout" },
|
|
4640
|
+
{ name: "className", type: "string", label: "CSS Class" }
|
|
4641
|
+
],
|
|
4642
|
+
defaultProps: {
|
|
4643
|
+
title: "Dashboard",
|
|
4644
|
+
widgets: [],
|
|
4645
|
+
persistLayoutKey: "dashboard-layout"
|
|
4646
|
+
}
|
|
4647
|
+
}
|
|
4648
|
+
);
|
|
4649
|
+
const Ra = {
|
|
4650
|
+
DashboardRenderer: gn,
|
|
4651
|
+
DashboardGridLayout: Yn,
|
|
4652
|
+
MetricWidget: Bn,
|
|
4653
|
+
MetricCard: Fn
|
|
4654
|
+
};
|
|
359
4655
|
export {
|
|
360
|
-
|
|
361
|
-
|
|
4656
|
+
Yn as DashboardGridLayout,
|
|
4657
|
+
gn as DashboardRenderer,
|
|
4658
|
+
Fn as MetricCard,
|
|
4659
|
+
Bn as MetricWidget,
|
|
4660
|
+
Ra as dashboardComponents
|
|
362
4661
|
};
|