@window-splitter/vue 1.1.2 → 1.1.3
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 +5 -5
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +545 -545
- package/dist/index.mjs.map +1 -1
- package/package.json +20 -20
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as be, useId as Ie, inject as X, computed as
|
|
2
|
-
var
|
|
1
|
+
import { defineComponent as be, useId as Ie, inject as X, computed as H, onMounted as G, watchEffect as ue, onUnmounted as Be, createElementBlock as ye, openBlock as Pe, normalizeProps as We, guardReactiveProps as Ue, renderSlot as Se, createPropsRestProxy as Ee, ref as me, provide as ie, onWatcherCleanup as Ge, mergeProps as Ke, unref as Xe } from "vue";
|
|
2
|
+
var Ye = 20, Je = 1, J = 1e6, Qe = 1e6, Ze = -7, _e = 21, et = !1, ne = "[big.js] ", W = ne + "Invalid ", fe = W + "decimal places", tt = W + "rounding mode", Ne = ne + "Division by zero", I = {}, N = void 0, nt = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
|
|
3
3
|
function Oe() {
|
|
4
4
|
function e(t) {
|
|
5
5
|
var a = this;
|
|
@@ -9,19 +9,19 @@ function Oe() {
|
|
|
9
9
|
else {
|
|
10
10
|
if (typeof t != "string") {
|
|
11
11
|
if (e.strict === !0 && typeof t != "bigint")
|
|
12
|
-
throw TypeError(
|
|
12
|
+
throw TypeError(W + "value");
|
|
13
13
|
t = t === 0 && 1 / t < 0 ? "-0" : String(t);
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
at(a, t);
|
|
16
16
|
}
|
|
17
17
|
a.constructor = e;
|
|
18
18
|
}
|
|
19
|
-
return e.prototype = I, e.DP =
|
|
19
|
+
return e.prototype = I, e.DP = Ye, e.RM = Je, e.NE = Ze, e.PE = _e, e.strict = et, e.roundDown = 0, e.roundHalfUp = 1, e.roundHalfEven = 2, e.roundUp = 3, e;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function at(e, t) {
|
|
22
22
|
var a, r, l;
|
|
23
|
-
if (!
|
|
24
|
-
throw Error(
|
|
23
|
+
if (!nt.test(t))
|
|
24
|
+
throw Error(W + "number");
|
|
25
25
|
for (e.s = t.charAt(0) == "-" ? (t = t.slice(1), -1) : 1, (a = t.indexOf(".")) > -1 && (t = t.replace(".", "")), (r = t.search(/e/i)) > 0 ? (a < 0 && (a = r), a += +t.slice(r + 1), t = t.substring(0, r)) : a < 0 && (a = t.length), l = t.length, r = 0; r < l && t.charAt(r) == "0"; ) ++r;
|
|
26
26
|
if (r == l)
|
|
27
27
|
e.c = [e.e = 0];
|
|
@@ -31,10 +31,10 @@ function nt(e, t) {
|
|
|
31
31
|
}
|
|
32
32
|
return e;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function U(e, t, a, r) {
|
|
35
35
|
var l = e.c;
|
|
36
36
|
if (a === N && (a = e.constructor.RM), a !== 0 && a !== 1 && a !== 2 && a !== 3)
|
|
37
|
-
throw Error(
|
|
37
|
+
throw Error(tt);
|
|
38
38
|
if (t < 1)
|
|
39
39
|
r = a === 3 && (r || !!l[0]) || t === 0 && (a === 1 && l[0] >= 5 || a === 2 && (l[0] > 5 || l[0] === 5 && (r || l[1] !== N))), l.length = 1, r ? (e.e = e.e - t + 1, l[0] = 1) : l[0] = e.e = 0;
|
|
40
40
|
else if (t < l.length) {
|
|
@@ -68,13 +68,13 @@ I.abs = function() {
|
|
|
68
68
|
return e.s = 1, e;
|
|
69
69
|
};
|
|
70
70
|
I.cmp = function(e) {
|
|
71
|
-
var t, a = this, r = a.c, l = (e = new a.constructor(e)).c, n = a.s, i = e.s,
|
|
71
|
+
var t, a = this, r = a.c, l = (e = new a.constructor(e)).c, n = a.s, i = e.s, u = a.e, d = e.e;
|
|
72
72
|
if (!r[0] || !l[0]) return r[0] ? n : l[0] ? -i : 0;
|
|
73
73
|
if (n != i) return n;
|
|
74
|
-
if (t = n < 0,
|
|
75
|
-
for (i = (
|
|
74
|
+
if (t = n < 0, u != d) return u > d ^ t ? 1 : -1;
|
|
75
|
+
for (i = (u = r.length) < (d = l.length) ? u : d, n = -1; ++n < i; )
|
|
76
76
|
if (r[n] != l[n]) return r[n] > l[n] ^ t ? 1 : -1;
|
|
77
|
-
return
|
|
77
|
+
return u == d ? 0 : u > d ^ t ? 1 : -1;
|
|
78
78
|
};
|
|
79
79
|
I.div = function(e) {
|
|
80
80
|
var t = this, a = t.constructor, r = t.c, l = (e = new a(e)).c, n = t.s == e.s ? 1 : -1, i = a.DP;
|
|
@@ -84,33 +84,33 @@ I.div = function(e) {
|
|
|
84
84
|
throw Error(Ne);
|
|
85
85
|
if (!r[0])
|
|
86
86
|
return e.s = n, e.c = [e.e = 0], e;
|
|
87
|
-
var
|
|
88
|
-
for (
|
|
87
|
+
var u, d, c, s, m, o = l.slice(), f = u = l.length, g = r.length, p = r.slice(0, u), v = p.length, h = e, z = h.c = [], y = 0, x = i + (h.e = t.e - e.e) + 1;
|
|
88
|
+
for (h.s = n, n = x < 0 ? 0 : x, o.unshift(0); v++ < u; ) p.push(0);
|
|
89
89
|
do {
|
|
90
|
-
for (
|
|
91
|
-
if (
|
|
92
|
-
|
|
90
|
+
for (c = 0; c < 10; c++) {
|
|
91
|
+
if (u != (v = p.length))
|
|
92
|
+
s = u > v ? 1 : -1;
|
|
93
93
|
else
|
|
94
|
-
for (m = -1,
|
|
94
|
+
for (m = -1, s = 0; ++m < u; )
|
|
95
95
|
if (l[m] != p[m]) {
|
|
96
|
-
|
|
96
|
+
s = l[m] > p[m] ? 1 : -1;
|
|
97
97
|
break;
|
|
98
98
|
}
|
|
99
|
-
if (
|
|
100
|
-
for (
|
|
101
|
-
if (p[--v] <
|
|
99
|
+
if (s < 0) {
|
|
100
|
+
for (d = v == u ? l : o; v; ) {
|
|
101
|
+
if (p[--v] < d[v]) {
|
|
102
102
|
for (m = v; m && !p[--m]; ) p[m] = 9;
|
|
103
103
|
--p[m], p[v] += 10;
|
|
104
104
|
}
|
|
105
|
-
p[v] -=
|
|
105
|
+
p[v] -= d[v];
|
|
106
106
|
}
|
|
107
107
|
for (; !p[0]; ) p.shift();
|
|
108
108
|
} else
|
|
109
109
|
break;
|
|
110
110
|
}
|
|
111
|
-
z[
|
|
112
|
-
} while ((f++ <
|
|
113
|
-
return !z[0] &&
|
|
111
|
+
z[y++] = s ? c : ++c, p[0] && s ? p[v] = r[f] || 0 : p = [r[f]];
|
|
112
|
+
} while ((f++ < g || p[0] !== N) && n--);
|
|
113
|
+
return !z[0] && y != 1 && (z.shift(), h.e--, x--), y > x && U(h, x, a.RM, p[0] !== N), h;
|
|
114
114
|
};
|
|
115
115
|
I.eq = function(e) {
|
|
116
116
|
return this.cmp(e) === 0;
|
|
@@ -128,33 +128,33 @@ I.lte = function(e) {
|
|
|
128
128
|
return this.cmp(e) < 1;
|
|
129
129
|
};
|
|
130
130
|
I.minus = I.sub = function(e) {
|
|
131
|
-
var t, a, r, l, n = this, i = n.constructor,
|
|
132
|
-
if (
|
|
133
|
-
return e.s = -
|
|
134
|
-
var
|
|
135
|
-
if (!
|
|
136
|
-
return m[0] ? e.s = -
|
|
137
|
-
if (
|
|
138
|
-
for ((l =
|
|
131
|
+
var t, a, r, l, n = this, i = n.constructor, u = n.s, d = (e = new i(e)).s;
|
|
132
|
+
if (u != d)
|
|
133
|
+
return e.s = -d, n.plus(e);
|
|
134
|
+
var c = n.c.slice(), s = n.e, m = e.c, o = e.e;
|
|
135
|
+
if (!c[0] || !m[0])
|
|
136
|
+
return m[0] ? e.s = -d : c[0] ? e = new i(n) : e.s = 1, e;
|
|
137
|
+
if (u = s - o) {
|
|
138
|
+
for ((l = u < 0) ? (u = -u, r = c) : (o = s, r = m), r.reverse(), d = u; d--; ) r.push(0);
|
|
139
139
|
r.reverse();
|
|
140
140
|
} else
|
|
141
|
-
for (a = ((l =
|
|
142
|
-
if (d
|
|
143
|
-
l = d
|
|
141
|
+
for (a = ((l = c.length < m.length) ? c : m).length, u = d = 0; d < a; d++)
|
|
142
|
+
if (c[d] != m[d]) {
|
|
143
|
+
l = c[d] < m[d];
|
|
144
144
|
break;
|
|
145
145
|
}
|
|
146
|
-
if (l && (r =
|
|
147
|
-
for (
|
|
148
|
-
if (
|
|
149
|
-
for (t = a; t && !
|
|
150
|
-
--
|
|
146
|
+
if (l && (r = c, c = m, m = r, e.s = -e.s), (d = (a = m.length) - (t = c.length)) > 0) for (; d--; ) c[t++] = 0;
|
|
147
|
+
for (d = t; a > u; ) {
|
|
148
|
+
if (c[--a] < m[a]) {
|
|
149
|
+
for (t = a; t && !c[--t]; ) c[t] = 9;
|
|
150
|
+
--c[t], c[a] += 10;
|
|
151
151
|
}
|
|
152
|
-
|
|
152
|
+
c[a] -= m[a];
|
|
153
153
|
}
|
|
154
|
-
for (;
|
|
155
|
-
for (;
|
|
156
|
-
|
|
157
|
-
return
|
|
154
|
+
for (; c[--d] === 0; ) c.pop();
|
|
155
|
+
for (; c[0] === 0; )
|
|
156
|
+
c.shift(), --o;
|
|
157
|
+
return c[0] || (e.s = 1, c = [o = 0]), e.c = c, e.e = o, e;
|
|
158
158
|
};
|
|
159
159
|
I.mod = function(e) {
|
|
160
160
|
var t, a = this, r = a.constructor, l = a.s, n = (e = new r(e)).s;
|
|
@@ -170,58 +170,58 @@ I.plus = I.add = function(e) {
|
|
|
170
170
|
var t, a, r, l = this, n = l.constructor;
|
|
171
171
|
if (e = new n(e), l.s != e.s)
|
|
172
172
|
return e.s = -e.s, l.minus(e);
|
|
173
|
-
var i = l.e,
|
|
174
|
-
if (!
|
|
175
|
-
return
|
|
176
|
-
if (
|
|
177
|
-
for (t > 0 ? (
|
|
173
|
+
var i = l.e, u = l.c, d = e.e, c = e.c;
|
|
174
|
+
if (!u[0] || !c[0])
|
|
175
|
+
return c[0] || (u[0] ? e = new n(l) : e.s = l.s), e;
|
|
176
|
+
if (u = u.slice(), t = i - d) {
|
|
177
|
+
for (t > 0 ? (d = i, r = c) : (t = -t, r = u), r.reverse(); t--; ) r.push(0);
|
|
178
178
|
r.reverse();
|
|
179
179
|
}
|
|
180
|
-
for (
|
|
181
|
-
for (a && (
|
|
182
|
-
return e.c =
|
|
180
|
+
for (u.length - c.length < 0 && (r = c, c = u, u = r), t = c.length, a = 0; t; u[t] %= 10) a = (u[--t] = u[t] + c[t] + a) / 10 | 0;
|
|
181
|
+
for (a && (u.unshift(a), ++d), t = u.length; u[--t] === 0; ) u.pop();
|
|
182
|
+
return e.c = u, e.e = d, e;
|
|
183
183
|
};
|
|
184
184
|
I.pow = function(e) {
|
|
185
185
|
var t = this, a = new t.constructor("1"), r = a, l = e < 0;
|
|
186
|
-
if (e !== ~~e || e < -1e6 || e >
|
|
187
|
-
throw Error(
|
|
186
|
+
if (e !== ~~e || e < -1e6 || e > Qe)
|
|
187
|
+
throw Error(W + "exponent");
|
|
188
188
|
for (l && (e = -e); e & 1 && (r = r.times(t)), e >>= 1, !!e; )
|
|
189
189
|
t = t.times(t);
|
|
190
190
|
return l ? a.div(r) : r;
|
|
191
191
|
};
|
|
192
192
|
I.prec = function(e, t) {
|
|
193
193
|
if (e !== ~~e || e < 1 || e > J)
|
|
194
|
-
throw Error(
|
|
195
|
-
return
|
|
194
|
+
throw Error(W + "precision");
|
|
195
|
+
return U(new this.constructor(this), e, t);
|
|
196
196
|
};
|
|
197
197
|
I.round = function(e, t) {
|
|
198
198
|
if (e === N) e = 0;
|
|
199
199
|
else if (e !== ~~e || e < -1e6 || e > J)
|
|
200
200
|
throw Error(fe);
|
|
201
|
-
return
|
|
201
|
+
return U(new this.constructor(this), e + this.e + 1, t);
|
|
202
202
|
};
|
|
203
203
|
I.sqrt = function() {
|
|
204
|
-
var e, t, a, r = this, l = r.constructor, n = r.s, i = r.e,
|
|
204
|
+
var e, t, a, r = this, l = r.constructor, n = r.s, i = r.e, u = new l("0.5");
|
|
205
205
|
if (!r.c[0]) return new l(r);
|
|
206
206
|
if (n < 0)
|
|
207
207
|
throw Error(ne + "No square root");
|
|
208
208
|
n = Math.sqrt(r + ""), n === 0 || n === 1 / 0 ? (t = r.c.join(""), t.length + i & 1 || (t += "0"), n = Math.sqrt(t), i = ((i + 1) / 2 | 0) - (i < 0 || i & 1), e = new l((n == 1 / 0 ? "5e" : (n = n.toExponential()).slice(0, n.indexOf("e") + 1)) + i)) : e = new l(n + ""), i = e.e + (l.DP += 4);
|
|
209
209
|
do
|
|
210
|
-
a = e, e =
|
|
210
|
+
a = e, e = u.times(a.plus(r.div(a)));
|
|
211
211
|
while (a.c.slice(0, i).join("") !== e.c.slice(0, i).join(""));
|
|
212
|
-
return
|
|
212
|
+
return U(e, (l.DP -= 4) + e.e + 1, l.RM);
|
|
213
213
|
};
|
|
214
214
|
I.times = I.mul = function(e) {
|
|
215
|
-
var t, a = this, r = a.constructor, l = a.c, n = (e = new r(e)).c, i = l.length,
|
|
215
|
+
var t, a = this, r = a.constructor, l = a.c, n = (e = new r(e)).c, i = l.length, u = n.length, d = a.e, c = e.e;
|
|
216
216
|
if (e.s = a.s == e.s ? 1 : -1, !l[0] || !n[0])
|
|
217
217
|
return e.c = [e.e = 0], e;
|
|
218
|
-
for (e.e =
|
|
219
|
-
for (
|
|
220
|
-
for (
|
|
221
|
-
|
|
222
|
-
t[
|
|
218
|
+
for (e.e = d + c, i < u && (t = l, l = n, n = t, c = i, i = u, u = c), t = new Array(c = i + u); c--; ) t[c] = 0;
|
|
219
|
+
for (d = u; d--; ) {
|
|
220
|
+
for (u = 0, c = i + d; c > d; )
|
|
221
|
+
u = t[c] + n[d] * l[c - d - 1] + u, t[c--] = u % 10, u = u / 10 | 0;
|
|
222
|
+
t[c] = u;
|
|
223
223
|
}
|
|
224
|
-
for (
|
|
224
|
+
for (u ? ++e.e : t.shift(), d = t.length; !t[--d]; ) t.pop();
|
|
225
225
|
return e.c = t, e;
|
|
226
226
|
};
|
|
227
227
|
I.toExponential = function(e, t) {
|
|
@@ -229,7 +229,7 @@ I.toExponential = function(e, t) {
|
|
|
229
229
|
if (e !== N) {
|
|
230
230
|
if (e !== ~~e || e < 0 || e > J)
|
|
231
231
|
throw Error(fe);
|
|
232
|
-
for (a =
|
|
232
|
+
for (a = U(new a.constructor(a), ++e, t); a.c.length < e; ) a.c.push(0);
|
|
233
233
|
}
|
|
234
234
|
return Q(a, !0, !!r);
|
|
235
235
|
};
|
|
@@ -238,7 +238,7 @@ I.toFixed = function(e, t) {
|
|
|
238
238
|
if (e !== N) {
|
|
239
239
|
if (e !== ~~e || e < 0 || e > J)
|
|
240
240
|
throw Error(fe);
|
|
241
|
-
for (a =
|
|
241
|
+
for (a = U(new a.constructor(a), e + a.e + 1, t), e = e + a.e + 1; a.c.length < e; ) a.c.push(0);
|
|
242
242
|
}
|
|
243
243
|
return Q(a, !1, !!r);
|
|
244
244
|
};
|
|
@@ -256,8 +256,8 @@ I.toPrecision = function(e, t) {
|
|
|
256
256
|
var a = this, r = a.constructor, l = a.c[0];
|
|
257
257
|
if (e !== N) {
|
|
258
258
|
if (e !== ~~e || e < 1 || e > J)
|
|
259
|
-
throw Error(
|
|
260
|
-
for (a =
|
|
259
|
+
throw Error(W + "precision");
|
|
260
|
+
for (a = U(new r(a), e, t); a.c.length < e; ) a.c.push(0);
|
|
261
261
|
}
|
|
262
262
|
return Q(a, e <= a.e || a.e <= r.NE || a.e >= r.PE, !!l);
|
|
263
263
|
};
|
|
@@ -268,7 +268,7 @@ I.valueOf = function() {
|
|
|
268
268
|
return Q(e, e.e <= t.NE || e.e >= t.PE, !0);
|
|
269
269
|
};
|
|
270
270
|
var b = Oe();
|
|
271
|
-
function
|
|
271
|
+
function rt(e, t) {
|
|
272
272
|
e.forEach((a) => {
|
|
273
273
|
try {
|
|
274
274
|
t(a);
|
|
@@ -278,7 +278,7 @@ function at(e, t) {
|
|
|
278
278
|
});
|
|
279
279
|
}
|
|
280
280
|
let _ = 0;
|
|
281
|
-
function
|
|
281
|
+
function lt() {
|
|
282
282
|
let e = /* @__PURE__ */ new Set(), t = e;
|
|
283
283
|
return {
|
|
284
284
|
add(a) {
|
|
@@ -288,47 +288,47 @@ function rt() {
|
|
|
288
288
|
return _ -= t == e && e.has(a) ? 1 : 0, e.delete(a);
|
|
289
289
|
},
|
|
290
290
|
flush(a) {
|
|
291
|
-
t.size && (e = /* @__PURE__ */ new Set(), _ -= t.size,
|
|
291
|
+
t.size && (e = /* @__PURE__ */ new Set(), _ -= t.size, rt(t, (r) => r(a) && e.add(r)), _ += e.size, t = e);
|
|
292
292
|
}
|
|
293
293
|
};
|
|
294
294
|
}
|
|
295
|
-
const He =
|
|
296
|
-
}, ae = (e) =>
|
|
295
|
+
const He = lt(), $e = typeof window < "u" ? window.requestAnimationFrame : () => {
|
|
296
|
+
}, ae = (e) => it(e, He);
|
|
297
297
|
ae.now = typeof performance < "u" ? () => performance.now() : Date.now;
|
|
298
298
|
ae.batchedUpdates = (e) => e();
|
|
299
|
-
let
|
|
300
|
-
function
|
|
301
|
-
t.add(e),
|
|
302
|
-
}
|
|
303
|
-
function it() {
|
|
304
|
-
F < 0 && (F = 0, $e(Le));
|
|
299
|
+
let T = -1;
|
|
300
|
+
function it(e, t) {
|
|
301
|
+
t.add(e), ot();
|
|
305
302
|
}
|
|
306
303
|
function ot() {
|
|
307
|
-
|
|
304
|
+
T < 0 && (T = 0, $e(Le));
|
|
305
|
+
}
|
|
306
|
+
function st() {
|
|
307
|
+
T = -1;
|
|
308
308
|
}
|
|
309
309
|
function Le() {
|
|
310
|
-
~
|
|
310
|
+
~T && ($e(Le), ae.batchedUpdates(ut));
|
|
311
311
|
}
|
|
312
|
-
function
|
|
313
|
-
const e =
|
|
314
|
-
if (
|
|
315
|
-
|
|
312
|
+
function ut() {
|
|
313
|
+
const e = T;
|
|
314
|
+
if (T = ae.now(), !_) {
|
|
315
|
+
st();
|
|
316
316
|
return;
|
|
317
317
|
}
|
|
318
|
-
He.flush(e ? Math.min(64,
|
|
318
|
+
He.flush(e ? Math.min(64, T - e) : 16.667);
|
|
319
319
|
}
|
|
320
320
|
const xe = 50;
|
|
321
|
-
function
|
|
321
|
+
function ct(e) {
|
|
322
322
|
return { type: "percent", value: new b(e) };
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function $(e) {
|
|
325
325
|
return { type: "pixel", value: new b(e) };
|
|
326
326
|
}
|
|
327
|
-
function
|
|
328
|
-
let t =
|
|
329
|
-
return e.collapseAnimation && (typeof e.collapseAnimation == "string" ? t =
|
|
327
|
+
function dt(e) {
|
|
328
|
+
let t = ge.linear, a = 300;
|
|
329
|
+
return e.collapseAnimation && (typeof e.collapseAnimation == "string" ? t = ge[e.collapseAnimation] : (a = e.collapseAnimation.duration, t = typeof e.collapseAnimation.easing == "function" ? e.collapseAnimation.easing : ge[e.collapseAnimation.easing])), { ease: t, duration: a };
|
|
330
330
|
}
|
|
331
|
-
const
|
|
331
|
+
const ge = {
|
|
332
332
|
"ease-in-out": function(t) {
|
|
333
333
|
return ((t *= 2) <= 1 ? t * t : --t * (2 - t) + 1) / 2;
|
|
334
334
|
},
|
|
@@ -342,28 +342,28 @@ const he = {
|
|
|
342
342
|
function Ve(e) {
|
|
343
343
|
return e.orientation === "horizontal" ? e.dragOvershoot.gt(0) ? "w-resize" : e.dragOvershoot.lt(0) ? "e-resize" : "ew-resize" : e.dragOvershoot.gt(0) ? "n-resize" : e.dragOvershoot.lt(0) ? "s-resize" : "ns-resize";
|
|
344
344
|
}
|
|
345
|
-
function
|
|
345
|
+
function ft(e) {
|
|
346
346
|
if ("context" in e && (e = e.context), "items" in e) {
|
|
347
347
|
e.dragOvershoot = new b(e.dragOvershoot || 0);
|
|
348
348
|
for (const t of e.items)
|
|
349
|
-
|
|
349
|
+
P(t) ? (t.currentValue.value = new b(t.currentValue.value), t.collapsedSize.value = new b(t.collapsedSize.value), t.min.value = new b(t.min.value), t.default && (t.default.value = new b(t.default.value)), t.max && t.max !== "1fr" && (t.max.value = new b(t.max.value))) : t.size.value = new b(t.size.value);
|
|
350
350
|
return e;
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function j(e, t) {
|
|
354
354
|
if (!e)
|
|
355
355
|
throw new Error(t);
|
|
356
356
|
}
|
|
357
357
|
function Z(e, t) {
|
|
358
|
-
|
|
358
|
+
j(t.includes(e.type), `Invalid event type: ${t}. Expected: ${t.join(" | ")}`);
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function P(e) {
|
|
361
361
|
return !!(e && typeof e == "object" && "type" in e && e.type === "panel");
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function R(e) {
|
|
364
364
|
return !!(e && typeof e == "object" && "type" in e && e.type === "handle");
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function pt(e) {
|
|
367
367
|
const t = () => {
|
|
368
368
|
let r = null;
|
|
369
369
|
return (l) => {
|
|
@@ -377,77 +377,77 @@ function ft(e) {
|
|
|
377
377
|
};
|
|
378
378
|
return { ...{
|
|
379
379
|
type: "panel",
|
|
380
|
-
min:
|
|
381
|
-
max: e.max ?
|
|
380
|
+
min: F(e.min || "0px"),
|
|
381
|
+
max: e.max ? F(e.max) : "1fr",
|
|
382
382
|
collapsed: e.collapsible ? e.collapsed ?? e.defaultCollapsed ?? !1 : void 0,
|
|
383
383
|
collapsible: e.collapsible,
|
|
384
|
-
collapsedSize:
|
|
384
|
+
collapsedSize: F(e.collapsedSize ?? "0px"),
|
|
385
385
|
onCollapseChange: e.onCollapseChange,
|
|
386
386
|
onResize: { current: t() },
|
|
387
387
|
collapseIsControlled: typeof e.collapsed < "u",
|
|
388
388
|
sizeBeforeCollapse: void 0,
|
|
389
389
|
id: e.id,
|
|
390
390
|
collapseAnimation: e.collapseAnimation,
|
|
391
|
-
default: e.default ?
|
|
391
|
+
default: e.default ? F(e.default) : void 0,
|
|
392
392
|
isStaticAtRest: e.isStaticAtRest
|
|
393
|
-
}, currentValue:
|
|
393
|
+
}, currentValue: $(-1) };
|
|
394
394
|
}
|
|
395
395
|
function ee(e, t) {
|
|
396
396
|
return e.type === t.type && e.value.eq(t.value);
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function mt(e, t) {
|
|
399
399
|
return !!(!t || !ee(e.min, t.min) || e.max === "1fr" && t.max !== "1fr" || e.max !== "1fr" && t.max === "1fr" || e.max !== "1fr" && t.max !== "1fr" && !ee(e.max, t.max) || e.default && !t.default || !e.default && t.default || e.default && t.default && !ee(e.default, t.default) || !ee(e.collapsedSize, t.collapsedSize) || e.isStaticAtRest !== t.isStaticAtRest || e.collapseAnimation && !t.collapseAnimation || !e.collapseAnimation && t.collapseAnimation || typeof e.collapseAnimation == "string" && typeof t.collapseAnimation == "string" && e.collapseAnimation !== t.collapseAnimation || typeof e.collapseAnimation == "object" && typeof t.collapseAnimation == "object" && (e.collapseAnimation.duration !== t.collapseAnimation.duration || e.collapseAnimation.easing !== t.collapseAnimation.easing) || e.collapsible !== t.collapsible);
|
|
400
400
|
}
|
|
401
|
-
function
|
|
401
|
+
function gt(e, t) {
|
|
402
402
|
return !t || !ee(e.size, t.size);
|
|
403
403
|
}
|
|
404
404
|
function ht(e) {
|
|
405
405
|
return {
|
|
406
406
|
type: "handle",
|
|
407
407
|
...e,
|
|
408
|
-
size: typeof e.size == "string" ?
|
|
408
|
+
size: typeof e.size == "string" ? F(e.size) : e.size
|
|
409
409
|
};
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function F(e) {
|
|
412
412
|
if (e === "1fr" && (e = "100%"), e.endsWith("px"))
|
|
413
|
-
return
|
|
413
|
+
return $(parseFloat(e));
|
|
414
414
|
if (e.endsWith("%"))
|
|
415
|
-
return
|
|
415
|
+
return ct(parseFloat(e) / 100);
|
|
416
416
|
throw new Error(`Invalid unit: ${e}`);
|
|
417
417
|
}
|
|
418
418
|
function Y(e, t) {
|
|
419
419
|
return t.type === "pixel" ? e === 0 ? 0 : t.value.div(e).toNumber() : t.value.toNumber();
|
|
420
420
|
}
|
|
421
|
-
function
|
|
421
|
+
function V(e) {
|
|
422
422
|
return e.orientation === "horizontal" ? e.size.width : e.size.height;
|
|
423
423
|
}
|
|
424
|
-
function
|
|
425
|
-
const a = t === "1fr" ?
|
|
426
|
-
return a.type === "pixel" ? a.value : a.value.mul(
|
|
424
|
+
function C(e, t) {
|
|
425
|
+
const a = t === "1fr" ? F(t) : t;
|
|
426
|
+
return a.type === "pixel" ? a.value : a.value.mul(V(e));
|
|
427
427
|
}
|
|
428
|
-
function
|
|
429
|
-
const r =
|
|
428
|
+
function O(e, t, a) {
|
|
429
|
+
const r = C(e, t.min), l = C(e, t.max);
|
|
430
430
|
return a.gte(r) && a.lte(l) ? a : a.lt(r) ? r : l;
|
|
431
431
|
}
|
|
432
|
-
function
|
|
432
|
+
function B(e, t) {
|
|
433
433
|
const a = e.items.find((r) => r.id === t);
|
|
434
|
-
if (a &&
|
|
434
|
+
if (a && P(a))
|
|
435
435
|
return a;
|
|
436
436
|
throw new Error(`Expected panel with id: ${t}`);
|
|
437
437
|
}
|
|
438
438
|
function Ce(e, t) {
|
|
439
439
|
const a = e.items.findIndex((r) => r.id === t);
|
|
440
|
-
if (a !== -1 &&
|
|
440
|
+
if (a !== -1 && R(e.items[a]))
|
|
441
441
|
return a;
|
|
442
442
|
throw new Error(`Expected panel handle with id: ${t}`);
|
|
443
443
|
}
|
|
444
|
-
function
|
|
444
|
+
function vt(e, t) {
|
|
445
445
|
if (!e.items.length)
|
|
446
446
|
throw new Error("No items in group");
|
|
447
447
|
const a = Ce(e, t), r = e.items[a - 1], l = e.items[a + 1];
|
|
448
|
-
if (r &&
|
|
448
|
+
if (r && P(r) && r.collapsible)
|
|
449
449
|
return r;
|
|
450
|
-
if (l &&
|
|
450
|
+
if (l && P(l) && l.collapsible)
|
|
451
451
|
return l;
|
|
452
452
|
throw new Error(`No collapsible panel found for handle: ${t}`);
|
|
453
453
|
}
|
|
@@ -455,25 +455,25 @@ function ce(e, t) {
|
|
|
455
455
|
const a = e.items.findIndex((l) => l.id === t);
|
|
456
456
|
if (e.activeDragHandleId) {
|
|
457
457
|
const l = Ce(e, e.activeDragHandleId), n = e.items[l];
|
|
458
|
-
if (n &&
|
|
458
|
+
if (n && R(n))
|
|
459
459
|
return {
|
|
460
460
|
item: n,
|
|
461
461
|
direction: l > a ? 1 : -1
|
|
462
462
|
};
|
|
463
463
|
}
|
|
464
|
-
|
|
464
|
+
j(a !== -1, `Expected panel before: ${t}`);
|
|
465
465
|
let r = e.items[a + 1];
|
|
466
|
-
if (r &&
|
|
466
|
+
if (r && R(r))
|
|
467
467
|
return { item: r, direction: 1 };
|
|
468
|
-
if (r = e.items[a - 1], r &&
|
|
468
|
+
if (r = e.items[a - 1], r && R(r))
|
|
469
469
|
return { item: r, direction: -1 };
|
|
470
470
|
throw new Error(`Cant find handle for panel: ${t}`);
|
|
471
471
|
}
|
|
472
472
|
function Me(e, t) {
|
|
473
473
|
const a = e.items.findIndex((l) => l.id === t);
|
|
474
|
-
|
|
474
|
+
j(a !== -1, `Expected panel before: ${t}`);
|
|
475
475
|
let r = e.items[a + 1];
|
|
476
|
-
return r &&
|
|
476
|
+
return r && R(r) && te(e, e.items, a + 1, 1, "add") ? { item: r, direction: 1 } : (r = e.items[a - 1], r && R(r) && te(e, e.items, a - 1, -1, "add") ? { item: r, direction: -1 } : ce(e, t));
|
|
477
477
|
}
|
|
478
478
|
function qe(e) {
|
|
479
479
|
const t = {}, a = e.map((i) => i.order).filter((i) => i !== void 0);
|
|
@@ -484,84 +484,84 @@ function qe(e) {
|
|
|
484
484
|
r++;
|
|
485
485
|
t[i.id] = r;
|
|
486
486
|
}
|
|
487
|
-
const l = e.filter((i) => i.order === void 0), n = e.filter((i) => i.order !== void 0).sort((i,
|
|
487
|
+
const l = e.filter((i) => i.order === void 0), n = e.filter((i) => i.order !== void 0).sort((i, u) => i.order - u.order);
|
|
488
488
|
for (const i of n)
|
|
489
489
|
l.splice(i.order, 0, i);
|
|
490
490
|
return l;
|
|
491
491
|
}
|
|
492
|
-
function
|
|
493
|
-
return
|
|
492
|
+
function wt(e, t, a) {
|
|
493
|
+
return j(t.currentValue.type === "pixel", `panelHasSpace only works with number values: ${t.id} ${t.currentValue}`), t.collapsible ? !t.collapsed : a === "add" ? t.currentValue.value.gte(C(e, t.min)) && t.currentValue.value.lt(C(e, t.max)) : t.currentValue.value.gt(C(e, t.min));
|
|
494
494
|
}
|
|
495
495
|
function te(e, t, a, r, l, n) {
|
|
496
496
|
const i = r === -1 ? t.slice(0, a + 1).reverse() : t.slice(a);
|
|
497
|
-
for (const
|
|
498
|
-
if (!
|
|
497
|
+
for (const u of i) {
|
|
498
|
+
if (!P(u))
|
|
499
499
|
continue;
|
|
500
|
-
const
|
|
501
|
-
if (
|
|
502
|
-
return
|
|
500
|
+
const d = n ? ve(e, u) : u;
|
|
501
|
+
if (wt(e, d, l))
|
|
502
|
+
return u;
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
505
|
function pe(e) {
|
|
506
506
|
let t = new b(0);
|
|
507
507
|
for (const a of e.items)
|
|
508
|
-
|
|
508
|
+
R(a) ? t = t.add(a.size.value) : (a.collapsed && a.currentValue.type === "pixel" || a.isStaticAtRest) && (t = t.add(a.currentValue.value));
|
|
509
509
|
return t;
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function k(e) {
|
|
512
512
|
return e.type === "pixel" ? `${e.value.toNumber()}px` : `${e.value.mul(100).toNumber()}%`;
|
|
513
513
|
}
|
|
514
|
-
function
|
|
515
|
-
return
|
|
514
|
+
function zt(e) {
|
|
515
|
+
return E(e).map((t) => P(t) ? t.currentValue.value.toNumber() : C(e, t.size).toNumber());
|
|
516
516
|
}
|
|
517
|
-
function
|
|
518
|
-
return
|
|
517
|
+
function bt(e, t) {
|
|
518
|
+
return B({ ...e, items: E(e) }, t).currentValue.value.toNumber();
|
|
519
519
|
}
|
|
520
|
-
function
|
|
520
|
+
function It(e) {
|
|
521
521
|
return Ae({
|
|
522
522
|
...e,
|
|
523
|
-
items:
|
|
524
|
-
}).map((a) =>
|
|
523
|
+
items: E(e)
|
|
524
|
+
}).map((a) => R(a) ? Y(V(e), a.size) : Y(V(e), a.currentValue));
|
|
525
525
|
}
|
|
526
|
-
function
|
|
527
|
-
const a =
|
|
528
|
-
return Y(
|
|
526
|
+
function yt(e, t) {
|
|
527
|
+
const a = E(e), r = B({ ...e, items: a }, t);
|
|
528
|
+
return Y(V(e), r.currentValue);
|
|
529
529
|
}
|
|
530
530
|
function De(e) {
|
|
531
531
|
const t = pe(e);
|
|
532
532
|
let a = !1;
|
|
533
533
|
return e.items.map((r) => {
|
|
534
534
|
if (r.type === "panel") {
|
|
535
|
-
const l =
|
|
535
|
+
const l = k(r.min);
|
|
536
536
|
if (r.currentValue.type === "pixel" && r.currentValue.value.toNumber() !== -1) {
|
|
537
537
|
if (r.isStaticAtRest) {
|
|
538
|
-
const n = r.max === "1fr" ? "100%" :
|
|
539
|
-
return `clamp(${l}, ${
|
|
538
|
+
const n = r.max === "1fr" ? "100%" : k(r.max);
|
|
539
|
+
return `clamp(${l}, ${k(r.currentValue)}, ${n})`;
|
|
540
540
|
}
|
|
541
|
-
return
|
|
541
|
+
return k(r.currentValue);
|
|
542
542
|
} else if (r.currentValue.type === "percent") {
|
|
543
543
|
if (!a && (r.max === "1fr" || r.max.type === "percent" && r.max.value.eq(100)))
|
|
544
544
|
return a = !0, `minmax(${l}, 1fr)`;
|
|
545
|
-
const n = r.max === "1fr" ? "100%" :
|
|
545
|
+
const n = r.max === "1fr" ? "100%" : k(r.max);
|
|
546
546
|
return `minmax(${l}, min(calc(${r.currentValue.value} * (100% - ${t}px)), ${n}))`;
|
|
547
547
|
} else {
|
|
548
548
|
if (r.collapsible && r.collapsed)
|
|
549
|
-
return
|
|
549
|
+
return k(r.collapsedSize);
|
|
550
550
|
if (r.default) {
|
|
551
|
-
if (e.items.some((
|
|
552
|
-
return
|
|
553
|
-
const i = r.max === "1fr" ? "1fr" :
|
|
554
|
-
return `minmax(${
|
|
551
|
+
if (e.items.some((u) => P(u) && u.id !== r.id && !u.collapsed && (u.max === "1fr" || u.max.type === "percent" && u.max.value.eq(100))))
|
|
552
|
+
return k(r.default);
|
|
553
|
+
const i = r.max === "1fr" ? "1fr" : k(r.max);
|
|
554
|
+
return `minmax(${k(r.default)}, ${i})`;
|
|
555
555
|
} else {
|
|
556
|
-
const n = r.max === "1fr" ? "1fr" :
|
|
556
|
+
const n = r.max === "1fr" ? "1fr" : k(r.max);
|
|
557
557
|
return `minmax(${l}, ${n})`;
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
}
|
|
561
|
-
return
|
|
561
|
+
return k(r.size);
|
|
562
562
|
}).join(" ");
|
|
563
563
|
}
|
|
564
|
-
function
|
|
564
|
+
function he(e, t) {
|
|
565
565
|
const a = e.findIndex((l) => l.id === t.id || typeof l.order == "number" && l.order === t.order);
|
|
566
566
|
let r = e;
|
|
567
567
|
return a !== -1 && (r = e.filter((l, n) => n !== a)), qe([...r, t]);
|
|
@@ -569,19 +569,19 @@ function ge(e, t) {
|
|
|
569
569
|
function ve(e, t) {
|
|
570
570
|
return {
|
|
571
571
|
...t,
|
|
572
|
-
min:
|
|
573
|
-
max:
|
|
572
|
+
min: $(-1e5),
|
|
573
|
+
max: $(1e5)
|
|
574
574
|
};
|
|
575
575
|
}
|
|
576
|
-
function
|
|
576
|
+
function E(e) {
|
|
577
577
|
const t = pe(e), a = [];
|
|
578
578
|
for (const r of e.items) {
|
|
579
|
-
if (!r || !
|
|
579
|
+
if (!r || !P(r)) {
|
|
580
580
|
a.push({ ...r });
|
|
581
581
|
continue;
|
|
582
582
|
}
|
|
583
583
|
if (r.lastKnownSize) {
|
|
584
|
-
const n =
|
|
584
|
+
const n = $(e.orientation === "horizontal" ? r.lastKnownSize.width : r.lastKnownSize.height);
|
|
585
585
|
a.push({ ...r, currentValue: n });
|
|
586
586
|
continue;
|
|
587
587
|
}
|
|
@@ -589,71 +589,71 @@ function O(e) {
|
|
|
589
589
|
a.push({ ...r });
|
|
590
590
|
continue;
|
|
591
591
|
}
|
|
592
|
-
const l = new b(
|
|
592
|
+
const l = new b(V(e)).minus(t).mul(r.currentValue.value);
|
|
593
593
|
a.push({
|
|
594
594
|
...r,
|
|
595
|
-
currentValue:
|
|
595
|
+
currentValue: $(l.toNumber())
|
|
596
596
|
});
|
|
597
597
|
}
|
|
598
598
|
return a;
|
|
599
599
|
}
|
|
600
600
|
function oe(e, t) {
|
|
601
|
-
var
|
|
602
|
-
const a = Ce(e, t.handleId), r = e.items[a],
|
|
603
|
-
let
|
|
604
|
-
if (t.value.shiftKey && (
|
|
601
|
+
var D, K, L, M;
|
|
602
|
+
const a = Ce(e, t.handleId), r = e.items[a], n = e.items.some((w) => P(w) && w.currentValue.type !== "pixel") ? E(e) : [...e.items];
|
|
603
|
+
let i = e.orientation === "horizontal" ? t.value.deltaX : t.value.deltaY;
|
|
604
|
+
if (t.value.shiftKey && (i *= e.shiftAmount ?? 15), i === 0)
|
|
605
605
|
return {};
|
|
606
|
-
const
|
|
607
|
-
if (!
|
|
606
|
+
const u = i / Math.abs(i), d = te(e, n, a + u, u, "subtract", t.disregardCollapseBuffer);
|
|
607
|
+
if (!d)
|
|
608
608
|
return {
|
|
609
|
-
dragOvershoot: e.dragOvershoot.add(
|
|
609
|
+
dragOvershoot: e.dragOvershoot.add(i)
|
|
610
610
|
};
|
|
611
|
-
|
|
612
|
-
const
|
|
613
|
-
(
|
|
614
|
-
te(e,
|
|
615
|
-
if (
|
|
611
|
+
j(P(d), `Expected panel before: ${r.id}`);
|
|
612
|
+
const c = t.type === "collapsePanel" && // If we have the panel id just use that
|
|
613
|
+
(n.find((w) => w.id === t.panelId && d.id !== t.panelId) || // otherwise fallback to the next panel with space
|
|
614
|
+
te(e, n, a - u, u * -1, "add", t.disregardCollapseBuffer)) || n[a - u];
|
|
615
|
+
if (j(c && P(c), `Expected panel after: ${r.id}`), c.currentValue.value.eq(C(e, c.max)))
|
|
616
616
|
return {
|
|
617
|
-
dragOvershoot: e.dragOvershoot.add(
|
|
617
|
+
dragOvershoot: e.dragOvershoot.add(i)
|
|
618
618
|
};
|
|
619
|
-
const
|
|
619
|
+
const s = e.dragOvershoot.add(i);
|
|
620
620
|
if (!t.disregardCollapseBuffer && !t.controlled) {
|
|
621
|
-
const
|
|
622
|
-
!
|
|
623
|
-
if (
|
|
624
|
-
return { dragOvershoot:
|
|
621
|
+
const w = s.lt(0) && u > 0, S = s.gt(0) && u > 0, q = s.gt(0) && u < 0, re = s.lt(0) && u < 0, le = c.currentValue.value.add(new b(s).mul(q ? u : 1)), Te = C(e, c.min), je = s.abs().lt(xe) && // Let the panel expand at it's min size
|
|
622
|
+
!c.currentValue.value.add(s.abs()).gte(c.min.value) && c.collapsible && c.collapsed && (S || re);
|
|
623
|
+
if (le.lte(Te) && (s.eq(0) || q || w || je))
|
|
624
|
+
return { dragOvershoot: s };
|
|
625
625
|
}
|
|
626
|
-
if (!t.disregardCollapseBuffer && !t.controlled &&
|
|
627
|
-
const
|
|
628
|
-
if (
|
|
629
|
-
return { dragOvershoot:
|
|
626
|
+
if (!t.disregardCollapseBuffer && !t.controlled && d.collapsible && d.currentValue.value.eq(C(e, d.min))) {
|
|
627
|
+
const w = d.currentValue.value.sub(s.abs());
|
|
628
|
+
if (s.abs().lt(xe) && w.gt(C(e, d.collapsedSize)))
|
|
629
|
+
return { dragOvershoot: s };
|
|
630
630
|
}
|
|
631
|
-
const
|
|
632
|
-
let
|
|
633
|
-
const
|
|
634
|
-
let
|
|
631
|
+
const m = ve(e, d), o = d.currentValue.value, f = d.currentValue.value.minus(new b(i).mul(u));
|
|
632
|
+
let g = t.disregardCollapseBuffer ? O(e, m, f) : O(e, d, f);
|
|
633
|
+
const p = ve(e, c), v = c.currentValue.value, h = o.minus(g), z = c.currentValue.value.add(h);
|
|
634
|
+
let y = t.disregardCollapseBuffer ? O(e, p, z) : O(e, c, z);
|
|
635
635
|
if (t.disregardCollapseBuffer)
|
|
636
|
-
|
|
637
|
-
else if (
|
|
638
|
-
if ((
|
|
639
|
-
return
|
|
640
|
-
const
|
|
636
|
+
c.collapsible && c.collapsed && (c.collapsed = !1);
|
|
637
|
+
else if (c.collapsible && c.collapsed) {
|
|
638
|
+
if ((D = c.onCollapseChange) != null && D.current && c.collapseIsControlled && !t.controlled && !t.isVirtual)
|
|
639
|
+
return c.onCollapseChange.current(!1), { dragOvershoot: s };
|
|
640
|
+
const w = (
|
|
641
641
|
// Take the size it was at
|
|
642
|
-
|
|
642
|
+
C(e, c.collapsedSize).add(e.dragOvershoot.abs()).sub(y.add(Math.abs(i)))
|
|
643
643
|
);
|
|
644
|
-
if (
|
|
645
|
-
return { dragOvershoot:
|
|
646
|
-
|
|
644
|
+
if (w.gt(0) && (y = y.add(w)), g = g.minus(y.minus(v).minus(Math.abs(i))), g.lt(d.min.value) && !d.collapsible)
|
|
645
|
+
return { dragOvershoot: s };
|
|
646
|
+
c.collapsed = !1, (K = c.onCollapseChange) != null && K.current && !c.collapseIsControlled && !t.controlled && !t.isVirtual && c.onCollapseChange.current(!1);
|
|
647
647
|
}
|
|
648
|
-
const
|
|
649
|
-
if (!t.disregardCollapseBuffer &&
|
|
650
|
-
if ((
|
|
651
|
-
return
|
|
652
|
-
|
|
648
|
+
const x = d.currentValue.value.eq(C(e, d.min));
|
|
649
|
+
if (!t.disregardCollapseBuffer && d.collapsible && x) {
|
|
650
|
+
if ((L = d.onCollapseChange) != null && L.current && d.collapseIsControlled && !t.controlled && !t.isVirtual)
|
|
651
|
+
return d.onCollapseChange.current(!0), { dragOvershoot: s };
|
|
652
|
+
d.collapsed = !0, g = C(e, d.collapsedSize), y = c.currentValue.value.add(o.minus(g)), (M = d.onCollapseChange) != null && M.current && !d.collapseIsControlled && !t.controlled && !t.isVirtual && d.onCollapseChange.current(!0);
|
|
653
653
|
}
|
|
654
|
-
|
|
655
|
-
const
|
|
656
|
-
return
|
|
654
|
+
d.currentValue = { type: "pixel", value: g }, c.currentValue = { type: "pixel", value: y };
|
|
655
|
+
const A = new b(V(e)).minus(n.reduce((w, S) => w.add(P(S) ? S.currentValue.value : S.size.value), new b(0)));
|
|
656
|
+
return A.eq(0) || (d.currentValue.value = O(e, d, d.currentValue.value.add(A))), { items: n };
|
|
657
657
|
}
|
|
658
658
|
function Ae(e) {
|
|
659
659
|
const t = [...e.items];
|
|
@@ -669,7 +669,7 @@ function Ae(e) {
|
|
|
669
669
|
...r,
|
|
670
670
|
currentValue: {
|
|
671
671
|
type: "percent",
|
|
672
|
-
value: r.currentValue.value.div(new b(
|
|
672
|
+
value: r.currentValue.value.div(new b(V(e)).sub(a))
|
|
673
673
|
}
|
|
674
674
|
});
|
|
675
675
|
}), t;
|
|
@@ -686,115 +686,115 @@ function we({ delta: e, orientation: t = "horizontal", shiftKey: a = !1 }) {
|
|
|
686
686
|
deltaY: t === "horizontal" ? 0 : e
|
|
687
687
|
};
|
|
688
688
|
}
|
|
689
|
-
function de({ context: e, handleId: t, delta: a, direction: r, controlled: l, disregardCollapseBuffer: n, isVirtual: i, panelId:
|
|
690
|
-
let
|
|
691
|
-
for (let
|
|
692
|
-
|
|
689
|
+
function de({ context: e, handleId: t, delta: a, direction: r, controlled: l, disregardCollapseBuffer: n, isVirtual: i, panelId: u }) {
|
|
690
|
+
let d = e;
|
|
691
|
+
for (let c = 0; c < a.abs().toNumber(); c++)
|
|
692
|
+
d = oe({
|
|
693
693
|
...e,
|
|
694
|
-
...
|
|
694
|
+
...d
|
|
695
695
|
}, {
|
|
696
696
|
handleId: t,
|
|
697
697
|
type: "collapsePanel",
|
|
698
698
|
controlled: l,
|
|
699
699
|
disregardCollapseBuffer: n,
|
|
700
700
|
isVirtual: i,
|
|
701
|
-
panelId:
|
|
701
|
+
panelId: u,
|
|
702
702
|
value: we({
|
|
703
703
|
delta: r,
|
|
704
704
|
orientation: e.orientation
|
|
705
705
|
})
|
|
706
706
|
});
|
|
707
|
-
return
|
|
707
|
+
return d;
|
|
708
708
|
}
|
|
709
709
|
function ze(e, t, a, r) {
|
|
710
710
|
let l = !1, n = 1, i = new b(r);
|
|
711
711
|
for (; i.toNumber() !== 0; ) {
|
|
712
|
-
const
|
|
713
|
-
if (!
|
|
712
|
+
const u = te(e, t, a + n, n, r.gt(0) ? "add" : "subtract");
|
|
713
|
+
if (!u) {
|
|
714
714
|
if (l)
|
|
715
715
|
break;
|
|
716
716
|
n = n === 1 ? -1 : 1, l = !0;
|
|
717
717
|
continue;
|
|
718
718
|
}
|
|
719
|
-
const
|
|
720
|
-
|
|
719
|
+
const d = u.currentValue.value, c = O(e, u, d.add(i));
|
|
720
|
+
u.currentValue.value = c, i = i.sub(c.sub(d)), n = n === 1 ? -1 : 1;
|
|
721
721
|
}
|
|
722
722
|
}
|
|
723
|
-
function
|
|
724
|
-
if (e.items.some((
|
|
723
|
+
function Pt(e) {
|
|
724
|
+
if (e.items.some((d) => P(d) && d.currentValue.value.eq(-1)))
|
|
725
725
|
return e;
|
|
726
|
-
const t = new b(
|
|
727
|
-
if (
|
|
728
|
-
return
|
|
729
|
-
if (
|
|
730
|
-
return
|
|
731
|
-
const
|
|
732
|
-
return
|
|
733
|
-
}).reduce((
|
|
726
|
+
const t = new b(V(e)), a = t.sub(pe(e).toNumber()), l = e.items.map((d) => {
|
|
727
|
+
if (R(d))
|
|
728
|
+
return d.size.value;
|
|
729
|
+
if (d.collapsed)
|
|
730
|
+
return C(e, d.currentValue);
|
|
731
|
+
const c = d.currentValue.type === "pixel" && d.currentValue.value || d.currentValue.value.mul(a);
|
|
732
|
+
return O(e, d, c);
|
|
733
|
+
}).reduce((d, c) => d.add(c), new b(0)), n = l.abs().sub(t);
|
|
734
734
|
if (n.eq(0) || t.eq(0))
|
|
735
735
|
return e;
|
|
736
|
-
let i = { ...e, items:
|
|
737
|
-
const
|
|
738
|
-
if (
|
|
739
|
-
const
|
|
736
|
+
let i = { ...e, items: E(e) };
|
|
737
|
+
const u = i.items.find((d) => !!(P(d) && d.collapsible));
|
|
738
|
+
if (u) {
|
|
739
|
+
const d = i.items.findIndex((m) => m.id === u.id), c = ce(i, u.id), s = u.currentValue.value.sub(C(i, u.collapsedSize));
|
|
740
740
|
i = {
|
|
741
741
|
...i,
|
|
742
742
|
...de({
|
|
743
|
-
handleId:
|
|
744
|
-
delta:
|
|
745
|
-
direction:
|
|
746
|
-
panelId:
|
|
743
|
+
handleId: c.item.id,
|
|
744
|
+
delta: s,
|
|
745
|
+
direction: c.direction * -1,
|
|
746
|
+
panelId: u.id,
|
|
747
747
|
context: {
|
|
748
748
|
...i,
|
|
749
749
|
// act like its the old size so the space is distributed correctly
|
|
750
750
|
size: { width: l.toNumber(), height: l.toNumber() }
|
|
751
751
|
}
|
|
752
752
|
})
|
|
753
|
-
}, ze(i, i.items,
|
|
753
|
+
}, ze(i, i.items, d, n.neg());
|
|
754
754
|
}
|
|
755
755
|
return { ...i, items: Ae(i) };
|
|
756
756
|
}
|
|
757
757
|
function Re(e) {
|
|
758
758
|
return e.map((t) => ({ ...t, lastKnownSize: void 0 }));
|
|
759
759
|
}
|
|
760
|
-
function
|
|
760
|
+
function St(e, t) {
|
|
761
761
|
document.cookie = `${e}=${encodeURIComponent(`${t}`)};path=/;max-age=31536000`;
|
|
762
762
|
}
|
|
763
763
|
function Fe(e, t) {
|
|
764
|
-
const a =
|
|
764
|
+
const a = B(e, t.panelId);
|
|
765
765
|
if (t.type === "expandPanel")
|
|
766
|
-
return new b(a.sizeBeforeCollapse ??
|
|
767
|
-
const r =
|
|
766
|
+
return new b(a.sizeBeforeCollapse ?? C(e, a.min)).minus(a.currentValue.value);
|
|
767
|
+
const r = C(e, a.collapsedSize);
|
|
768
768
|
return a.currentValue.value.minus(r);
|
|
769
769
|
}
|
|
770
770
|
function ke(e, t, a, r) {
|
|
771
|
-
const l =
|
|
771
|
+
const l = B(e, t.panelId), n = Me(e, t.panelId);
|
|
772
772
|
let i = new b(n.direction);
|
|
773
|
-
const
|
|
774
|
-
context:
|
|
773
|
+
const u = Fe(e, t), d = { ...e, items: E(e) }, c = de({
|
|
774
|
+
context: d,
|
|
775
775
|
panelId: t.panelId,
|
|
776
776
|
handleId: n.item.id,
|
|
777
|
-
delta:
|
|
777
|
+
delta: u,
|
|
778
778
|
direction: n.direction,
|
|
779
779
|
isVirtual: !0
|
|
780
780
|
});
|
|
781
|
-
return new Promise((
|
|
781
|
+
return new Promise((s, m) => {
|
|
782
782
|
r.signal.addEventListener("abort", () => {
|
|
783
783
|
m(new Error("Operation was canceled"));
|
|
784
784
|
}), t.type === "collapsePanel" && (l.sizeBeforeCollapse = l.currentValue.value.toNumber(), i = i.mul(new b(-1)));
|
|
785
|
-
const
|
|
786
|
-
let v = 0,
|
|
785
|
+
const o = 60, { duration: f, ease: g } = dt(l), p = Math.ceil(l.collapseAnimation ? f / (1e3 / o) : 1);
|
|
786
|
+
let v = 0, h = new b(0);
|
|
787
787
|
function z() {
|
|
788
|
-
const
|
|
788
|
+
const y = ++v / p, x = new b(l.collapseAnimation ? g(y) : 1), A = x.mul(u).sub(h).mul(i);
|
|
789
789
|
if (a({
|
|
790
790
|
type: "applyDelta",
|
|
791
791
|
handleId: n.item.id,
|
|
792
792
|
delta: A.toNumber(),
|
|
793
793
|
panelId: l.id
|
|
794
|
-
}),
|
|
795
|
-
e.items.find((K) =>
|
|
796
|
-
const
|
|
797
|
-
return
|
|
794
|
+
}), h = h.add(A.abs().mul(A.gt(0) && i.lt(0) || A.lt(0) && i.gt(0) ? -1 : 1)), x.eq(1)) {
|
|
795
|
+
e.items.find((K) => P(K) && K.currentValue.value.round(void 0, b.roundHalfEven).lt(0)) && se(e, c);
|
|
796
|
+
const D = t.type === "expandPanel" ? "expand" : "collapse";
|
|
797
|
+
return s({ panelId: l.id, action: D, resolve: t.resolve }), !1;
|
|
798
798
|
}
|
|
799
799
|
return !0;
|
|
800
800
|
}
|
|
@@ -805,8 +805,8 @@ function se(e, t) {
|
|
|
805
805
|
for (const a in t)
|
|
806
806
|
e[a] = t[a];
|
|
807
807
|
}
|
|
808
|
-
let
|
|
809
|
-
function
|
|
808
|
+
let Ct = 0;
|
|
809
|
+
function At(e, t) {
|
|
810
810
|
const a = new AbortController(), r = {
|
|
811
811
|
current: "idle"
|
|
812
812
|
};
|
|
@@ -816,12 +816,12 @@ function Ct(e, t) {
|
|
|
816
816
|
items: e.items || [],
|
|
817
817
|
orientation: e.orientation || "horizontal",
|
|
818
818
|
dragOvershoot: new b(0),
|
|
819
|
-
groupId: e.groupId || `group-${
|
|
819
|
+
groupId: e.groupId || `group-${Ct++}`,
|
|
820
820
|
autosaveStrategy: e.autosaveStrategy,
|
|
821
821
|
shiftAmount: e.shiftAmount ?? 15
|
|
822
822
|
}, i = {
|
|
823
823
|
prepare: () => {
|
|
824
|
-
n.items =
|
|
824
|
+
n.items = E(n);
|
|
825
825
|
},
|
|
826
826
|
clearLastKnownSize: () => {
|
|
827
827
|
n.items = Re(n.items);
|
|
@@ -830,94 +830,94 @@ function Ct(e, t) {
|
|
|
830
830
|
n.dragOvershoot = new b(0), n.items = Ae(n);
|
|
831
831
|
},
|
|
832
832
|
onResize: () => {
|
|
833
|
-
var
|
|
834
|
-
for (const
|
|
835
|
-
if (
|
|
836
|
-
const f =
|
|
837
|
-
(m = (
|
|
833
|
+
var s, m;
|
|
834
|
+
for (const o of n.items)
|
|
835
|
+
if (P(o)) {
|
|
836
|
+
const f = o.lastKnownSize ? new b(n.orientation === "horizontal" ? o.lastKnownSize.width : o.lastKnownSize.height) : O(n, o, C(n, o.currentValue)), g = V(n);
|
|
837
|
+
(m = (s = o.onResize) == null ? void 0 : s.current) == null || m.call(s, {
|
|
838
838
|
pixel: f.toNumber(),
|
|
839
|
-
percentage:
|
|
839
|
+
percentage: g > 0 ? f.div(V(n)).toNumber() : -1
|
|
840
840
|
});
|
|
841
841
|
}
|
|
842
842
|
},
|
|
843
843
|
onAutosave: () => {
|
|
844
844
|
if (!n.autosaveStrategy || typeof window > "u")
|
|
845
845
|
return;
|
|
846
|
-
const
|
|
847
|
-
|
|
848
|
-
const m = JSON.stringify(
|
|
849
|
-
n.autosaveStrategy === "localStorage" ? localStorage.setItem(n.groupId, m) :
|
|
846
|
+
const s = { ...n };
|
|
847
|
+
s.items = Re(n.items), s.activeDragHandleId = n.activeDragHandleId;
|
|
848
|
+
const m = JSON.stringify(s);
|
|
849
|
+
n.autosaveStrategy === "localStorage" ? localStorage.setItem(n.groupId, m) : St(n.groupId, m);
|
|
850
850
|
},
|
|
851
|
-
removeItem: (
|
|
852
|
-
const m = n.items.findIndex((p) => p.id ===
|
|
853
|
-
if (!
|
|
851
|
+
removeItem: (s) => {
|
|
852
|
+
const m = n.items.findIndex((p) => p.id === s), o = n.items[m];
|
|
853
|
+
if (!o)
|
|
854
854
|
return;
|
|
855
|
-
const f = n.items.filter((p) => p.id !==
|
|
856
|
-
ze(n, f, m,
|
|
855
|
+
const f = n.items.filter((p) => p.id !== s), g = P(o) ? o.currentValue.value : o.size.value;
|
|
856
|
+
ze(n, f, m, g), n.items = f;
|
|
857
857
|
},
|
|
858
|
-
notifyCollapseToggle: (
|
|
859
|
-
var
|
|
860
|
-
Z(
|
|
861
|
-
const m =
|
|
862
|
-
(f = (
|
|
858
|
+
notifyCollapseToggle: (s) => {
|
|
859
|
+
var o, f;
|
|
860
|
+
Z(s, ["collapsePanel", "expandPanel"]);
|
|
861
|
+
const m = B(n, s.panelId);
|
|
862
|
+
(f = (o = m.onCollapseChange) == null ? void 0 : o.current) == null || f.call(o, !m.collapsed);
|
|
863
863
|
},
|
|
864
|
-
runCollapseToggle: (
|
|
865
|
-
Z(
|
|
866
|
-
const m = ce(n,
|
|
867
|
-
panelId:
|
|
864
|
+
runCollapseToggle: (s) => {
|
|
865
|
+
Z(s, ["collapsePanel", "expandPanel"]);
|
|
866
|
+
const m = ce(n, s.panelId), o = s.type === "collapsePanel" ? m.direction * -1 : m.direction, f = oe(n, {
|
|
867
|
+
panelId: s.panelId,
|
|
868
868
|
handleId: m.item.id,
|
|
869
869
|
type: "dragHandle",
|
|
870
|
-
controlled:
|
|
870
|
+
controlled: s.controlled,
|
|
871
871
|
value: we({
|
|
872
|
-
delta:
|
|
872
|
+
delta: o,
|
|
873
873
|
orientation: n.orientation
|
|
874
874
|
})
|
|
875
875
|
});
|
|
876
876
|
se(n, f);
|
|
877
877
|
},
|
|
878
|
-
onAnimationEnd: (
|
|
879
|
-
var
|
|
880
|
-
|
|
881
|
-
const m =
|
|
882
|
-
m.collapsed =
|
|
878
|
+
onAnimationEnd: (s) => {
|
|
879
|
+
var o, f;
|
|
880
|
+
j(s, "Expected output from animation actor");
|
|
881
|
+
const m = B(n, s.panelId);
|
|
882
|
+
m.collapsed = s.action === "collapse", m.collapsed && (m.currentValue = m.collapsedSize), m.collapseIsControlled || (f = (o = m.onCollapseChange) == null ? void 0 : o.current) == null || f.call(o, m.collapsed), i.commit();
|
|
883
883
|
}
|
|
884
884
|
};
|
|
885
885
|
i.onAutosave();
|
|
886
|
-
const
|
|
887
|
-
shouldNotifyCollapseToggle: (
|
|
888
|
-
Z(
|
|
889
|
-
const m =
|
|
890
|
-
return !
|
|
886
|
+
const u = {
|
|
887
|
+
shouldNotifyCollapseToggle: (s) => {
|
|
888
|
+
Z(s, ["collapsePanel", "expandPanel"]);
|
|
889
|
+
const m = B(n, s.panelId);
|
|
890
|
+
return !s.controlled && m.collapseIsControlled === !0;
|
|
891
891
|
},
|
|
892
|
-
shouldCollapseToggle: (
|
|
893
|
-
cannotExpandPanel: (
|
|
894
|
-
Z(
|
|
895
|
-
const m =
|
|
896
|
-
let
|
|
897
|
-
const f = Fe(n,
|
|
898
|
-
|
|
899
|
-
...
|
|
892
|
+
shouldCollapseToggle: (s) => (Z(s, ["collapsePanel", "expandPanel"]), B(n, s.panelId).collapseIsControlled === !0),
|
|
893
|
+
cannotExpandPanel: (s) => {
|
|
894
|
+
Z(s, ["expandPanel"]);
|
|
895
|
+
const m = E(n);
|
|
896
|
+
let o = { ...n, items: m };
|
|
897
|
+
const f = Fe(n, s), g = Me(o, s.panelId);
|
|
898
|
+
o = {
|
|
899
|
+
...o,
|
|
900
900
|
...de({
|
|
901
|
-
context:
|
|
902
|
-
panelId:
|
|
903
|
-
handleId:
|
|
904
|
-
controlled:
|
|
901
|
+
context: o,
|
|
902
|
+
panelId: s.panelId,
|
|
903
|
+
handleId: g.item.id,
|
|
904
|
+
controlled: s.controlled,
|
|
905
905
|
delta: f,
|
|
906
|
-
direction:
|
|
906
|
+
direction: g.direction,
|
|
907
907
|
isVirtual: !0
|
|
908
908
|
})
|
|
909
909
|
};
|
|
910
|
-
const p =
|
|
911
|
-
return v.gt(
|
|
910
|
+
const p = o.items.find((z) => z.id === s.panelId), v = o.items.reduce((z, y) => z.add(P(y) ? y.currentValue.value : y.size.value), new b(0)), h = p && P(p) && !p.currentValue.value.eq(p.collapsedSize.value);
|
|
911
|
+
return v.gt(V(n)) || !h;
|
|
912
912
|
}
|
|
913
913
|
};
|
|
914
|
-
function
|
|
914
|
+
function d(s) {
|
|
915
915
|
switch (r.current) {
|
|
916
916
|
case "dragging":
|
|
917
917
|
i.commit(), n.activeDragHandleId = void 0;
|
|
918
918
|
break;
|
|
919
919
|
}
|
|
920
|
-
switch (
|
|
920
|
+
switch (s) {
|
|
921
921
|
case "idle":
|
|
922
922
|
i.onAutosave();
|
|
923
923
|
break;
|
|
@@ -928,11 +928,11 @@ function Ct(e, t) {
|
|
|
928
928
|
i.prepare(), i.clearLastKnownSize();
|
|
929
929
|
break;
|
|
930
930
|
}
|
|
931
|
-
r.current =
|
|
931
|
+
r.current = s, t == null || t(n);
|
|
932
932
|
}
|
|
933
|
-
function
|
|
933
|
+
function c(s) {
|
|
934
934
|
var m;
|
|
935
|
-
switch (
|
|
935
|
+
switch (s.type) {
|
|
936
936
|
case "lockGroup":
|
|
937
937
|
l = !0;
|
|
938
938
|
break;
|
|
@@ -941,149 +941,149 @@ function Ct(e, t) {
|
|
|
941
941
|
break;
|
|
942
942
|
}
|
|
943
943
|
if (!l) {
|
|
944
|
-
switch (
|
|
944
|
+
switch (s.type) {
|
|
945
945
|
case "updateItemIndex":
|
|
946
|
-
n.items = qe(n.items.map((
|
|
946
|
+
n.items = qe(n.items.map((o) => o.id === s.itemId ? { ...o, order: s.index } : o));
|
|
947
947
|
break;
|
|
948
948
|
case "registerPanel":
|
|
949
|
-
n.items =
|
|
949
|
+
n.items = he(n.items, {
|
|
950
950
|
type: "panel",
|
|
951
|
-
currentValue:
|
|
952
|
-
...
|
|
951
|
+
currentValue: $(-1),
|
|
952
|
+
...s.data
|
|
953
953
|
});
|
|
954
954
|
break;
|
|
955
955
|
case "unregisterPanel":
|
|
956
|
-
i.prepare(), i.removeItem(
|
|
956
|
+
i.prepare(), i.removeItem(s.id), i.clearLastKnownSize(), i.commit(), i.onResize(), i.onAutosave();
|
|
957
957
|
break;
|
|
958
958
|
case "registerPanelHandle": {
|
|
959
|
-
n.items =
|
|
959
|
+
n.items = he(n.items, s.data);
|
|
960
960
|
break;
|
|
961
961
|
}
|
|
962
962
|
case "unregisterPanelHandle":
|
|
963
|
-
i.prepare(), i.removeItem(
|
|
963
|
+
i.prepare(), i.removeItem(s.id), i.clearLastKnownSize(), i.commit(), i.onResize(), i.onAutosave();
|
|
964
964
|
break;
|
|
965
965
|
case "registerDynamicPanel": {
|
|
966
966
|
i.prepare();
|
|
967
|
-
let
|
|
968
|
-
|
|
967
|
+
let o = $(0);
|
|
968
|
+
s.data.collapsible && s.data.collapsed && s.data.collapsedSize ? o = {
|
|
969
969
|
type: "pixel",
|
|
970
|
-
value:
|
|
971
|
-
} :
|
|
970
|
+
value: C(n, s.data.collapsedSize)
|
|
971
|
+
} : s.data.default ? o = {
|
|
972
972
|
type: "pixel",
|
|
973
|
-
value:
|
|
974
|
-
} :
|
|
973
|
+
value: C(n, s.data.default)
|
|
974
|
+
} : o = {
|
|
975
975
|
type: "pixel",
|
|
976
|
-
value:
|
|
976
|
+
value: C(n, s.data.min)
|
|
977
977
|
};
|
|
978
|
-
const f =
|
|
978
|
+
const f = he(n.items, {
|
|
979
979
|
type: "panel",
|
|
980
|
-
...
|
|
981
|
-
currentValue:
|
|
982
|
-
}),
|
|
983
|
-
ze(p, f,
|
|
980
|
+
...s.data,
|
|
981
|
+
currentValue: o
|
|
982
|
+
}), g = f.findIndex((h) => h.id === s.data.id), p = { ...n }, v = n.items.reduce((h, z) => R(z) ? h.add(C(n, z.size)) : h.add(z.currentValue.value), new b(0)).minus(V(n));
|
|
983
|
+
ze(p, f, g, o.value.add(v).neg()), n.items = f, i.clearLastKnownSize(), i.commit(), i.onResize(), i.onAutosave();
|
|
984
984
|
break;
|
|
985
985
|
}
|
|
986
986
|
case "rebindPanelCallbacks":
|
|
987
|
-
for (const
|
|
988
|
-
|
|
987
|
+
for (const o of n.items)
|
|
988
|
+
P(o) && o.id === s.data.id && (o.onCollapseChange = s.data.onCollapseChange, o.onResize = s.data.onResize);
|
|
989
989
|
break;
|
|
990
990
|
case "updateConstraints":
|
|
991
991
|
i.prepare();
|
|
992
|
-
for (const
|
|
993
|
-
if (
|
|
994
|
-
const f =
|
|
995
|
-
|
|
996
|
-
} else if (
|
|
997
|
-
const f =
|
|
998
|
-
|
|
992
|
+
for (const o of n.items)
|
|
993
|
+
if (P(o) && o.id === s.data.id) {
|
|
994
|
+
const f = s.data;
|
|
995
|
+
o.min = f.min, o.max = f.max, o.default = f.default, o.collapsedSize = f.collapsedSize, o.isStaticAtRest = f.isStaticAtRest, o.collapseAnimation = f.collapseAnimation, o.collapsible = f.collapsible;
|
|
996
|
+
} else if (R(o) && o.id === s.data.id) {
|
|
997
|
+
const f = s.data;
|
|
998
|
+
o.size = f.size;
|
|
999
999
|
}
|
|
1000
1000
|
i.clearLastKnownSize(), i.commit(), i.onResize(), i.onAutosave();
|
|
1001
1001
|
break;
|
|
1002
1002
|
case "setActualItemsSize": {
|
|
1003
|
-
const
|
|
1004
|
-
if (!
|
|
1003
|
+
const o = n.items.map((p) => {
|
|
1004
|
+
if (!P(p))
|
|
1005
1005
|
return p;
|
|
1006
|
-
const v =
|
|
1006
|
+
const v = s.childrenSizes[p.id] || p.lastKnownSize;
|
|
1007
1007
|
return { ...p, lastKnownSize: v };
|
|
1008
1008
|
});
|
|
1009
|
-
let f = 0,
|
|
1010
|
-
for (const p of
|
|
1011
|
-
if (
|
|
1009
|
+
let f = 0, g = !1;
|
|
1010
|
+
for (const p of o)
|
|
1011
|
+
if (P(p)) {
|
|
1012
1012
|
const v = (m = p.lastKnownSize) == null ? void 0 : m[n.orientation === "horizontal" ? "width" : "height"];
|
|
1013
1013
|
if (!v) {
|
|
1014
|
-
n.items =
|
|
1014
|
+
n.items = o, g = !0;
|
|
1015
1015
|
break;
|
|
1016
1016
|
}
|
|
1017
1017
|
f += v;
|
|
1018
1018
|
} else
|
|
1019
1019
|
f += p.size.value.toNumber();
|
|
1020
|
-
|
|
1020
|
+
g ? n.items = o : f > V(n) && r.current !== "dragging" ? n.items = Pt({
|
|
1021
1021
|
...n,
|
|
1022
|
-
items:
|
|
1023
|
-
}).items : n.items =
|
|
1022
|
+
items: E({ ...n, items: o })
|
|
1023
|
+
}).items : n.items = o, i.onResize();
|
|
1024
1024
|
break;
|
|
1025
1025
|
}
|
|
1026
1026
|
case "setSize": {
|
|
1027
|
-
n.size =
|
|
1027
|
+
n.size = s.size, i.onResize();
|
|
1028
1028
|
break;
|
|
1029
1029
|
}
|
|
1030
1030
|
case "setOrientation":
|
|
1031
|
-
n.orientation =
|
|
1031
|
+
n.orientation = s.orientation, i.clearLastKnownSize(), i.onResize();
|
|
1032
1032
|
break;
|
|
1033
1033
|
}
|
|
1034
1034
|
if (r.current === "idle")
|
|
1035
|
-
switch (
|
|
1035
|
+
switch (s.type) {
|
|
1036
1036
|
case "dragHandleStart":
|
|
1037
|
-
|
|
1037
|
+
d("dragging"), n.activeDragHandleId = s.handleId;
|
|
1038
1038
|
break;
|
|
1039
1039
|
case "setPanelPixelSize": {
|
|
1040
1040
|
i.prepare(), i.clearLastKnownSize();
|
|
1041
|
-
const
|
|
1042
|
-
|
|
1041
|
+
const o = B(n, s.panelId), f = ce(n, s.panelId), g = o.currentValue.value, p = O(n, o, C(n, F(s.size))), v = p.gt(g), h = v ? p.minus(g) : g.minus(p);
|
|
1042
|
+
o.sizeBeforeCollapse = p.toNumber(), Object.assign(n, de({
|
|
1043
1043
|
context: n,
|
|
1044
|
-
panelId:
|
|
1044
|
+
panelId: s.panelId,
|
|
1045
1045
|
direction: f.direction * (v ? 1 : -1),
|
|
1046
1046
|
handleId: f.item.id,
|
|
1047
|
-
delta:
|
|
1047
|
+
delta: h
|
|
1048
1048
|
})), i.commit(), i.onResize(), i.onAutosave();
|
|
1049
1049
|
break;
|
|
1050
1050
|
}
|
|
1051
1051
|
case "collapsePanel":
|
|
1052
|
-
|
|
1053
|
-
i.onAnimationEnd(f),
|
|
1052
|
+
u.shouldNotifyCollapseToggle(s) ? i.notifyCollapseToggle(s) : B(n, s.panelId).collapsed || (d("togglingCollapse"), a.abort(), ke(n, s, c, a).then((f) => {
|
|
1053
|
+
i.onAnimationEnd(f), d("idle"), s.resolve && requestAnimationFrame(s.resolve);
|
|
1054
1054
|
}));
|
|
1055
1055
|
break;
|
|
1056
1056
|
case "expandPanel":
|
|
1057
|
-
if (
|
|
1057
|
+
if (u.cannotExpandPanel(s))
|
|
1058
1058
|
break;
|
|
1059
|
-
|
|
1060
|
-
i.onAnimationEnd(f),
|
|
1059
|
+
u.shouldNotifyCollapseToggle(s) ? i.notifyCollapseToggle(s) : B(n, s.panelId).collapsed && (d("togglingCollapse"), a.abort(), ke(n, s, c, a).then((f) => {
|
|
1060
|
+
i.onAnimationEnd(f), d("idle"), s.resolve && requestAnimationFrame(s.resolve);
|
|
1061
1061
|
}));
|
|
1062
1062
|
break;
|
|
1063
1063
|
}
|
|
1064
1064
|
else if (r.current === "dragging")
|
|
1065
|
-
switch (
|
|
1065
|
+
switch (s.type) {
|
|
1066
1066
|
case "dragHandle":
|
|
1067
|
-
i.clearLastKnownSize(), se(n, oe(n,
|
|
1067
|
+
i.clearLastKnownSize(), se(n, oe(n, s)), i.onResize();
|
|
1068
1068
|
break;
|
|
1069
1069
|
case "dragHandleEnd":
|
|
1070
|
-
|
|
1070
|
+
d("idle");
|
|
1071
1071
|
break;
|
|
1072
1072
|
case "expandPanel":
|
|
1073
1073
|
case "collapsePanel":
|
|
1074
|
-
|
|
1074
|
+
u.shouldCollapseToggle(s) && i.runCollapseToggle(s);
|
|
1075
1075
|
break;
|
|
1076
1076
|
}
|
|
1077
1077
|
else if (r.current === "togglingCollapse")
|
|
1078
|
-
switch (
|
|
1078
|
+
switch (s.type) {
|
|
1079
1079
|
case "applyDelta":
|
|
1080
1080
|
se(n, oe(n, {
|
|
1081
|
-
panelId:
|
|
1082
|
-
handleId:
|
|
1081
|
+
panelId: s.panelId,
|
|
1082
|
+
handleId: s.handleId,
|
|
1083
1083
|
type: "collapsePanel",
|
|
1084
1084
|
disregardCollapseBuffer: !0,
|
|
1085
1085
|
value: we({
|
|
1086
|
-
delta:
|
|
1086
|
+
delta: s.delta,
|
|
1087
1087
|
orientation: n.orientation
|
|
1088
1088
|
})
|
|
1089
1089
|
})), i.onResize();
|
|
@@ -1092,9 +1092,9 @@ function Ct(e, t) {
|
|
|
1092
1092
|
t == null || t(n);
|
|
1093
1093
|
}
|
|
1094
1094
|
}
|
|
1095
|
-
return [n,
|
|
1095
|
+
return [n, c, r];
|
|
1096
1096
|
}
|
|
1097
|
-
function
|
|
1097
|
+
function xt({ groupId: e, id: t, collapsible: a, collapsed: r }) {
|
|
1098
1098
|
const l = {
|
|
1099
1099
|
id: t,
|
|
1100
1100
|
"data-splitter-group-id": e,
|
|
@@ -1103,7 +1103,7 @@ function At({ groupId: e, id: t, collapsible: a, collapsed: r }) {
|
|
|
1103
1103
|
};
|
|
1104
1104
|
return a && (l["data-collapsed"] = r), l;
|
|
1105
1105
|
}
|
|
1106
|
-
function
|
|
1106
|
+
function Vt({ groupId: e, id: t, orientation: a, isDragging: r, activeDragHandleId: l, disabled: n, controlsId: i, min: u, max: d, currentValue: c, groupSize: s }) {
|
|
1107
1107
|
return {
|
|
1108
1108
|
id: t,
|
|
1109
1109
|
role: "separator",
|
|
@@ -1115,19 +1115,19 @@ function xt({ groupId: e, id: t, orientation: a, isDragging: r, activeDragHandle
|
|
|
1115
1115
|
"aria-label": "Resize Handle",
|
|
1116
1116
|
"aria-disabled": n,
|
|
1117
1117
|
"aria-controls": i,
|
|
1118
|
-
"aria-valuemin":
|
|
1119
|
-
"aria-valuemax":
|
|
1120
|
-
"aria-valuenow":
|
|
1118
|
+
"aria-valuemin": u ? Y(s, u) : void 0,
|
|
1119
|
+
"aria-valuemax": d === "1fr" ? 100 : d ? Y(s, d) : void 0,
|
|
1120
|
+
"aria-valuenow": c ? Y(s, c) : void 0
|
|
1121
1121
|
};
|
|
1122
1122
|
}
|
|
1123
|
-
function
|
|
1123
|
+
function Dt(e, t) {
|
|
1124
1124
|
const a = new ResizeObserver((l) => {
|
|
1125
1125
|
const n = {};
|
|
1126
1126
|
for (const i of l) {
|
|
1127
|
-
const
|
|
1128
|
-
|
|
1129
|
-
width:
|
|
1130
|
-
height:
|
|
1127
|
+
const d = i.target.getAttribute("data-splitter-id"), c = i.borderBoxSize[0];
|
|
1128
|
+
d && c && (n[d] = {
|
|
1129
|
+
width: c.inlineSize,
|
|
1130
|
+
height: c.blockSize
|
|
1131
1131
|
});
|
|
1132
1132
|
}
|
|
1133
1133
|
t(n);
|
|
@@ -1138,76 +1138,76 @@ function Vt(e, t) {
|
|
|
1138
1138
|
a.disconnect();
|
|
1139
1139
|
};
|
|
1140
1140
|
}
|
|
1141
|
-
function
|
|
1142
|
-
const { onMoveStart: t, onMove: a, onMoveEnd: r } = e, l = { didMove: !1, lastPosition: null, id: null }, n = (
|
|
1143
|
-
|
|
1141
|
+
function Rt(e) {
|
|
1142
|
+
const { onMoveStart: t, onMove: a, onMoveEnd: r } = e, l = { didMove: !1, lastPosition: null, id: null }, n = (o, f, g, p) => {
|
|
1143
|
+
g === 0 && p === 0 || (l.didMove || (l.didMove = !0, t == null || t({
|
|
1144
1144
|
type: "movestart",
|
|
1145
1145
|
pointerType: f,
|
|
1146
|
-
shiftKey:
|
|
1147
|
-
metaKey:
|
|
1148
|
-
ctrlKey:
|
|
1149
|
-
altKey:
|
|
1146
|
+
shiftKey: o.shiftKey,
|
|
1147
|
+
metaKey: o.metaKey,
|
|
1148
|
+
ctrlKey: o.ctrlKey,
|
|
1149
|
+
altKey: o.altKey
|
|
1150
1150
|
})), a == null || a({
|
|
1151
1151
|
type: "move",
|
|
1152
1152
|
pointerType: f,
|
|
1153
|
-
deltaX:
|
|
1153
|
+
deltaX: g,
|
|
1154
1154
|
deltaY: p,
|
|
1155
|
-
shiftKey:
|
|
1156
|
-
metaKey:
|
|
1157
|
-
ctrlKey:
|
|
1158
|
-
altKey:
|
|
1155
|
+
shiftKey: o.shiftKey,
|
|
1156
|
+
metaKey: o.metaKey,
|
|
1157
|
+
ctrlKey: o.ctrlKey,
|
|
1158
|
+
altKey: o.altKey
|
|
1159
1159
|
}));
|
|
1160
|
-
}, i = (
|
|
1160
|
+
}, i = (o, f) => {
|
|
1161
1161
|
l.didMove && (r == null || r({
|
|
1162
1162
|
type: "moveend",
|
|
1163
1163
|
pointerType: f,
|
|
1164
|
-
shiftKey:
|
|
1165
|
-
metaKey:
|
|
1166
|
-
ctrlKey:
|
|
1167
|
-
altKey:
|
|
1164
|
+
shiftKey: o.shiftKey,
|
|
1165
|
+
metaKey: o.metaKey,
|
|
1166
|
+
ctrlKey: o.ctrlKey,
|
|
1167
|
+
altKey: o.altKey
|
|
1168
1168
|
}));
|
|
1169
|
-
},
|
|
1169
|
+
}, u = {}, d = () => {
|
|
1170
1170
|
l.didMove = !1;
|
|
1171
|
-
},
|
|
1172
|
-
var f,
|
|
1173
|
-
if (
|
|
1174
|
-
const p =
|
|
1175
|
-
n(
|
|
1171
|
+
}, c = (o) => {
|
|
1172
|
+
var f, g;
|
|
1173
|
+
if (o.pointerId === l.id) {
|
|
1174
|
+
const p = o.pointerType || "mouse";
|
|
1175
|
+
n(o, p, o.pageX - (((f = l.lastPosition) == null ? void 0 : f.pageX) ?? 0), o.pageY - (((g = l.lastPosition) == null ? void 0 : g.pageY) ?? 0)), l.lastPosition = { pageX: o.pageX, pageY: o.pageY };
|
|
1176
1176
|
}
|
|
1177
|
-
},
|
|
1178
|
-
if (
|
|
1179
|
-
const f =
|
|
1180
|
-
i(
|
|
1177
|
+
}, s = (o) => {
|
|
1178
|
+
if (o.pointerId === l.id) {
|
|
1179
|
+
const f = o.pointerType || "mouse";
|
|
1180
|
+
i(o, f), l.id = null, window.removeEventListener("pointermove", c, !1), window.removeEventListener("pointerup", s, !1), window.removeEventListener("pointercancel", s, !1);
|
|
1181
1181
|
}
|
|
1182
1182
|
};
|
|
1183
|
-
|
|
1184
|
-
|
|
1183
|
+
u.onPointerDown = (o) => {
|
|
1184
|
+
o.button === 0 && l.id == null && (d(), o.stopPropagation(), o.preventDefault(), l.lastPosition = { pageX: o.pageX, pageY: o.pageY }, l.id = o.pointerId, window.addEventListener("pointermove", c, !1), window.addEventListener("pointerup", s, !1), window.addEventListener("pointercancel", s, !1));
|
|
1185
1185
|
};
|
|
1186
|
-
const m = (
|
|
1187
|
-
|
|
1186
|
+
const m = (o, f, g) => {
|
|
1187
|
+
d(), n(o, "keyboard", f, g), i(o, "keyboard");
|
|
1188
1188
|
};
|
|
1189
|
-
return
|
|
1190
|
-
switch (
|
|
1189
|
+
return u.onKeyDown = (o) => {
|
|
1190
|
+
switch (o.key) {
|
|
1191
1191
|
case "Left":
|
|
1192
1192
|
case "ArrowLeft":
|
|
1193
|
-
|
|
1193
|
+
o.preventDefault(), o.stopPropagation(), m(o, -1, 0);
|
|
1194
1194
|
break;
|
|
1195
1195
|
case "Right":
|
|
1196
1196
|
case "ArrowRight":
|
|
1197
|
-
|
|
1197
|
+
o.preventDefault(), o.stopPropagation(), m(o, 1, 0);
|
|
1198
1198
|
break;
|
|
1199
1199
|
case "Up":
|
|
1200
1200
|
case "ArrowUp":
|
|
1201
|
-
|
|
1201
|
+
o.preventDefault(), o.stopPropagation(), m(o, 0, -1);
|
|
1202
1202
|
break;
|
|
1203
1203
|
case "Down":
|
|
1204
1204
|
case "ArrowDown":
|
|
1205
|
-
|
|
1205
|
+
o.preventDefault(), o.stopPropagation(), m(o, 0, 1);
|
|
1206
1206
|
break;
|
|
1207
1207
|
}
|
|
1208
|
-
}, { moveProps:
|
|
1208
|
+
}, { moveProps: u };
|
|
1209
1209
|
}
|
|
1210
|
-
const
|
|
1210
|
+
const Kt = /* @__PURE__ */ be({
|
|
1211
1211
|
__name: "Panel",
|
|
1212
1212
|
props: {
|
|
1213
1213
|
onResize: {},
|
|
@@ -1229,16 +1229,16 @@ const Et = /* @__PURE__ */ be({
|
|
|
1229
1229
|
max: l,
|
|
1230
1230
|
id: n,
|
|
1231
1231
|
collapsible: i,
|
|
1232
|
-
collapsedSize:
|
|
1233
|
-
onCollapseChange:
|
|
1234
|
-
collapseAnimation:
|
|
1235
|
-
onResize:
|
|
1232
|
+
collapsedSize: u,
|
|
1233
|
+
onCollapseChange: d,
|
|
1234
|
+
collapseAnimation: c,
|
|
1235
|
+
onResize: s,
|
|
1236
1236
|
defaultCollapsed: m,
|
|
1237
|
-
default:
|
|
1237
|
+
default: o,
|
|
1238
1238
|
isStaticAtRest: f,
|
|
1239
|
-
collapsed:
|
|
1239
|
+
collapsed: g,
|
|
1240
1240
|
...p
|
|
1241
|
-
} = a, v = n || Ie(),
|
|
1241
|
+
} = a, v = n || Ie(), h = X("send"), z = X("state"), y = X("isPrerender"), x = () => pt({
|
|
1242
1242
|
id: v,
|
|
1243
1243
|
min: a.min,
|
|
1244
1244
|
max: a.max,
|
|
@@ -1249,50 +1249,50 @@ const Et = /* @__PURE__ */ be({
|
|
|
1249
1249
|
collapseAnimation: a.collapseAnimation,
|
|
1250
1250
|
onResize: a.onResize ? { current: a.onResize } : void 0,
|
|
1251
1251
|
defaultCollapsed: m,
|
|
1252
|
-
default:
|
|
1252
|
+
default: o,
|
|
1253
1253
|
isStaticAtRest: f
|
|
1254
|
-
}), A =
|
|
1254
|
+
}), A = H(() => {
|
|
1255
1255
|
var S;
|
|
1256
|
-
const w = (S = z == null ? void 0 : z.value) == null ? void 0 : S.items.find((
|
|
1257
|
-
if (!(!w || !
|
|
1256
|
+
const w = (S = z == null ? void 0 : z.value) == null ? void 0 : S.items.find((q) => q.id === v);
|
|
1257
|
+
if (!(!w || !P(w)))
|
|
1258
1258
|
return w;
|
|
1259
1259
|
});
|
|
1260
|
-
let
|
|
1261
|
-
A.value ?
|
|
1260
|
+
let D = !1;
|
|
1261
|
+
A.value ? h == null || h({
|
|
1262
1262
|
type: "rebindPanelCallbacks",
|
|
1263
1263
|
data: {
|
|
1264
1264
|
id: v,
|
|
1265
1265
|
onCollapseChange: a.onCollapseChange ? { current: a.onCollapseChange } : void 0,
|
|
1266
1266
|
onResize: a.onResize ? { current: a.onResize } : void 0
|
|
1267
1267
|
}
|
|
1268
|
-
}) :
|
|
1268
|
+
}) : y != null && y.value ? h == null || h({ type: "registerPanel", data: x() }) : D = !0, G(() => {
|
|
1269
1269
|
var le;
|
|
1270
1270
|
const w = (le = z == null ? void 0 : z.value) == null ? void 0 : le.groupId;
|
|
1271
|
-
if (!w || !
|
|
1271
|
+
if (!w || !D) return;
|
|
1272
1272
|
const S = document.getElementById(w);
|
|
1273
1273
|
if (!S) return;
|
|
1274
|
-
const
|
|
1275
|
-
if (!
|
|
1276
|
-
const re = Array.from(S.children).indexOf(
|
|
1277
|
-
typeof re == "number" && (
|
|
1274
|
+
const q = document.getElementById(v);
|
|
1275
|
+
if (!q) return;
|
|
1276
|
+
const re = Array.from(S.children).indexOf(q);
|
|
1277
|
+
typeof re == "number" && (h == null || h({
|
|
1278
1278
|
type: "registerDynamicPanel",
|
|
1279
1279
|
data: { ...x(), order: re }
|
|
1280
|
-
}),
|
|
1280
|
+
}), D = !1);
|
|
1281
1281
|
});
|
|
1282
|
-
const K =
|
|
1283
|
-
() => !
|
|
1282
|
+
const K = H(
|
|
1283
|
+
() => !D && mt(x(), A.value)
|
|
1284
1284
|
);
|
|
1285
1285
|
ue(() => {
|
|
1286
|
-
K.value && (
|
|
1286
|
+
K.value && (h == null || h({ type: "updateConstraints", data: x() }));
|
|
1287
1287
|
}), Be(() => {
|
|
1288
|
-
requestAnimationFrame(() =>
|
|
1288
|
+
requestAnimationFrame(() => h == null ? void 0 : h({ type: "unregisterPanel", id: v }));
|
|
1289
1289
|
}), t({
|
|
1290
1290
|
getId: () => v,
|
|
1291
1291
|
collapse: async () => {
|
|
1292
1292
|
var w;
|
|
1293
1293
|
if ((w = A.value) != null && w.collapsible)
|
|
1294
1294
|
return await new Promise((S) => {
|
|
1295
|
-
|
|
1295
|
+
h == null || h({ type: "collapsePanel", panelId: v, controlled: !0, resolve: S });
|
|
1296
1296
|
});
|
|
1297
1297
|
},
|
|
1298
1298
|
isCollapsed: () => {
|
|
@@ -1303,18 +1303,18 @@ const Et = /* @__PURE__ */ be({
|
|
|
1303
1303
|
var w;
|
|
1304
1304
|
if ((w = A.value) != null && w.collapsible)
|
|
1305
1305
|
return await new Promise((S) => {
|
|
1306
|
-
|
|
1306
|
+
h == null || h({ type: "expandPanel", panelId: v, controlled: !0, resolve: S });
|
|
1307
1307
|
});
|
|
1308
1308
|
},
|
|
1309
1309
|
isExpanded: () => {
|
|
1310
1310
|
var w, S;
|
|
1311
1311
|
return !!((w = A.value) != null && w.collapsible && !((S = A.value) != null && S.collapsed));
|
|
1312
1312
|
},
|
|
1313
|
-
getPixelSize: () =>
|
|
1314
|
-
getPercentageSize: () =>
|
|
1315
|
-
setSize: (w) =>
|
|
1313
|
+
getPixelSize: () => bt(z.value, v),
|
|
1314
|
+
getPercentageSize: () => yt(z.value, v),
|
|
1315
|
+
setSize: (w) => h == null ? void 0 : h({ type: "setPanelPixelSize", panelId: v, size: w })
|
|
1316
1316
|
});
|
|
1317
|
-
const
|
|
1317
|
+
const L = H(
|
|
1318
1318
|
() => {
|
|
1319
1319
|
var w;
|
|
1320
1320
|
return (w = A.value) == null ? void 0 : w.collapseIsControlled;
|
|
@@ -1322,15 +1322,15 @@ const Et = /* @__PURE__ */ be({
|
|
|
1322
1322
|
);
|
|
1323
1323
|
ue(() => {
|
|
1324
1324
|
a.collapsed, requestAnimationFrame(() => {
|
|
1325
|
-
|
|
1325
|
+
L.value && (a.collapsed ? h == null || h({ type: "collapsePanel", panelId: v, controlled: !0 }) : h == null || h({ type: "expandPanel", panelId: v, controlled: !0 }));
|
|
1326
1326
|
});
|
|
1327
1327
|
});
|
|
1328
|
-
const
|
|
1328
|
+
const M = H(() => {
|
|
1329
1329
|
var S;
|
|
1330
1330
|
const w = A.value;
|
|
1331
1331
|
return {
|
|
1332
1332
|
...p,
|
|
1333
|
-
...
|
|
1333
|
+
...xt({
|
|
1334
1334
|
groupId: (S = z == null ? void 0 : z.value) == null ? void 0 : S.groupId,
|
|
1335
1335
|
id: v,
|
|
1336
1336
|
collapsible: w == null ? void 0 : w.collapsible,
|
|
@@ -1343,11 +1343,11 @@ const Et = /* @__PURE__ */ be({
|
|
|
1343
1343
|
}
|
|
1344
1344
|
};
|
|
1345
1345
|
});
|
|
1346
|
-
return (w, S) => (Pe(), ye("div",
|
|
1346
|
+
return (w, S) => (Pe(), ye("div", We(Ue(M.value)), [
|
|
1347
1347
|
Se(w.$slots, "default")
|
|
1348
1348
|
], 16));
|
|
1349
1349
|
}
|
|
1350
|
-
}),
|
|
1350
|
+
}), kt = ["id"], Nt = /* @__PURE__ */ be({
|
|
1351
1351
|
__name: "PanelGroup",
|
|
1352
1352
|
props: {
|
|
1353
1353
|
snapshot: {},
|
|
@@ -1366,23 +1366,23 @@ const Et = /* @__PURE__ */ be({
|
|
|
1366
1366
|
}
|
|
1367
1367
|
const l = me(!0);
|
|
1368
1368
|
ie("isPrerender", l);
|
|
1369
|
-
const n = e.autosaveId || e.id || Ie(), [i,
|
|
1369
|
+
const n = e.autosaveId || e.id || Ie(), [i, u, d] = At(
|
|
1370
1370
|
{
|
|
1371
1371
|
orientation: e.orientation,
|
|
1372
1372
|
groupId: n,
|
|
1373
1373
|
autosaveStrategy: e.autosaveStrategy,
|
|
1374
1374
|
shiftAmount: e.shiftAmount,
|
|
1375
|
-
...r ?
|
|
1375
|
+
...r ? ft(r) : void 0
|
|
1376
1376
|
},
|
|
1377
1377
|
(f) => {
|
|
1378
|
-
|
|
1378
|
+
c.value = { ...f };
|
|
1379
1379
|
}
|
|
1380
1380
|
);
|
|
1381
1381
|
G(() => {
|
|
1382
1382
|
l.value = !1;
|
|
1383
1383
|
});
|
|
1384
|
-
const
|
|
1385
|
-
const f = De(
|
|
1384
|
+
const c = me(i), s = H(() => {
|
|
1385
|
+
const f = De(c.value);
|
|
1386
1386
|
return {
|
|
1387
1387
|
height: "100%",
|
|
1388
1388
|
display: "grid",
|
|
@@ -1390,59 +1390,59 @@ const Et = /* @__PURE__ */ be({
|
|
|
1390
1390
|
gridTemplateRows: e.orientation === "vertical" ? f : void 0
|
|
1391
1391
|
};
|
|
1392
1392
|
});
|
|
1393
|
-
ie("send",
|
|
1393
|
+
ie("send", u), ie("state", c), ie("id", d);
|
|
1394
1394
|
const m = me(null);
|
|
1395
1395
|
G(() => {
|
|
1396
|
-
const f = new ResizeObserver(([
|
|
1397
|
-
|
|
1396
|
+
const f = new ResizeObserver(([g]) => {
|
|
1397
|
+
g && g.contentRect.width > 0 && g.contentRect.height > 0 && (u == null || u({ type: "setSize", size: g.contentRect }));
|
|
1398
1398
|
});
|
|
1399
1399
|
return m.value && f.observe(m.value), () => f.disconnect();
|
|
1400
1400
|
});
|
|
1401
|
-
const
|
|
1401
|
+
const o = H(
|
|
1402
1402
|
() => {
|
|
1403
1403
|
var f;
|
|
1404
|
-
return (f =
|
|
1404
|
+
return (f = c.value) == null ? void 0 : f.items.map((g) => g.id).join(",");
|
|
1405
1405
|
}
|
|
1406
1406
|
);
|
|
1407
1407
|
return G(() => {
|
|
1408
1408
|
ue(() => {
|
|
1409
|
-
|
|
1410
|
-
const f =
|
|
1411
|
-
|
|
1409
|
+
o.value;
|
|
1410
|
+
const f = Dt(n, (g) => {
|
|
1411
|
+
u({ type: "setActualItemsSize", childrenSizes: g });
|
|
1412
1412
|
});
|
|
1413
|
-
|
|
1413
|
+
Ge(f);
|
|
1414
1414
|
});
|
|
1415
|
-
}), G(() => (
|
|
1415
|
+
}), G(() => (u({ type: "unlockGroup" }), () => u({ type: "lockGroup" }))), t({
|
|
1416
1416
|
getId: () => n,
|
|
1417
|
-
getPixelSizes: () =>
|
|
1418
|
-
getPercentageSizes: () =>
|
|
1417
|
+
getPixelSizes: () => zt(c.value),
|
|
1418
|
+
getPercentageSizes: () => It(c.value),
|
|
1419
1419
|
getTemplate: () => De({
|
|
1420
|
-
...
|
|
1421
|
-
items:
|
|
1420
|
+
...c.value,
|
|
1421
|
+
items: E(c.value)
|
|
1422
1422
|
}),
|
|
1423
|
-
getState: () =>
|
|
1423
|
+
getState: () => d.current === "idle" ? "idle" : "dragging",
|
|
1424
1424
|
setSizes: (f) => {
|
|
1425
|
-
var
|
|
1425
|
+
var g;
|
|
1426
1426
|
for (let p = 0; p < f.length; p++) {
|
|
1427
|
-
const v = (
|
|
1428
|
-
v &&
|
|
1427
|
+
const v = (g = c.value) == null ? void 0 : g.items[p], h = f[p];
|
|
1428
|
+
v && P(v) && h && u({
|
|
1429
1429
|
type: "setPanelPixelSize",
|
|
1430
1430
|
panelId: v.id,
|
|
1431
|
-
size:
|
|
1431
|
+
size: h
|
|
1432
1432
|
});
|
|
1433
1433
|
}
|
|
1434
1434
|
}
|
|
1435
|
-
}), (f,
|
|
1436
|
-
id:
|
|
1435
|
+
}), (f, g) => (Pe(), ye("div", Ke(a, {
|
|
1436
|
+
id: Xe(n),
|
|
1437
1437
|
ref_key: "elementRef",
|
|
1438
1438
|
ref: m,
|
|
1439
1439
|
"data-panel-group-wrapper": "",
|
|
1440
|
-
style:
|
|
1440
|
+
style: s.value
|
|
1441
1441
|
}), [
|
|
1442
1442
|
Se(f.$slots, "default")
|
|
1443
|
-
], 16,
|
|
1443
|
+
], 16, kt));
|
|
1444
1444
|
}
|
|
1445
|
-
}),
|
|
1445
|
+
}), Bt = ["tabindex"], Ot = /* @__PURE__ */ be({
|
|
1446
1446
|
__name: "PanelResizer",
|
|
1447
1447
|
props: {
|
|
1448
1448
|
disabled: { type: Boolean },
|
|
@@ -1454,95 +1454,95 @@ const Et = /* @__PURE__ */ be({
|
|
|
1454
1454
|
id: {}
|
|
1455
1455
|
},
|
|
1456
1456
|
setup(e) {
|
|
1457
|
-
const t = Ee(e, ["size", "id", "onDragStart", "onDrag", "onDragEnd", "disabled"]), r = e.id || Ie(), l = X("send"), n = X("state"), i = X("isPrerender"),
|
|
1457
|
+
const t = Ee(e, ["size", "id", "onDragStart", "onDrag", "onDragEnd", "disabled"]), r = e.id || Ie(), l = X("send"), n = X("state"), i = X("isPrerender"), u = () => ht({ size: e.size, id: r }), d = H(() => {
|
|
1458
1458
|
var p;
|
|
1459
|
-
const
|
|
1460
|
-
if (!(!
|
|
1461
|
-
return
|
|
1459
|
+
const g = (p = n == null ? void 0 : n.value) == null ? void 0 : p.items.find((v) => v.id === r);
|
|
1460
|
+
if (!(!g || !R(g)))
|
|
1461
|
+
return g;
|
|
1462
1462
|
});
|
|
1463
|
-
let
|
|
1464
|
-
|
|
1465
|
-
var z,
|
|
1466
|
-
if (!((z = n == null ? void 0 : n.value) == null ? void 0 : z.groupId) || !
|
|
1467
|
-
const p = document.getElementById((
|
|
1463
|
+
let c = !1;
|
|
1464
|
+
d.value || (i != null && i.value ? l == null || l({ type: "registerPanelHandle", data: u() }) : c = !0), G(() => {
|
|
1465
|
+
var z, y;
|
|
1466
|
+
if (!((z = n == null ? void 0 : n.value) == null ? void 0 : z.groupId) || !c) return;
|
|
1467
|
+
const p = document.getElementById((y = n == null ? void 0 : n.value) == null ? void 0 : y.groupId);
|
|
1468
1468
|
if (!p) return;
|
|
1469
1469
|
const v = document.getElementById(r);
|
|
1470
1470
|
if (!v) return;
|
|
1471
|
-
const
|
|
1472
|
-
typeof
|
|
1471
|
+
const h = Array.from(p.children).indexOf(v);
|
|
1472
|
+
typeof h == "number" && (l == null || l({
|
|
1473
1473
|
type: "registerPanelHandle",
|
|
1474
|
-
data: { ...
|
|
1475
|
-
}),
|
|
1474
|
+
data: { ...u(), order: h }
|
|
1475
|
+
}), c = !1);
|
|
1476
1476
|
});
|
|
1477
|
-
const
|
|
1478
|
-
() => !
|
|
1477
|
+
const s = H(
|
|
1478
|
+
() => !c && gt(u(), d.value)
|
|
1479
1479
|
);
|
|
1480
1480
|
ue(() => {
|
|
1481
|
-
|
|
1481
|
+
s.value && (l == null || l({ type: "updateConstraints", data: u() }));
|
|
1482
1482
|
}), Be(() => {
|
|
1483
1483
|
requestAnimationFrame(() => l == null ? void 0 : l({ type: "unregisterPanelHandle", id: r }));
|
|
1484
1484
|
});
|
|
1485
|
-
const { moveProps: m } =
|
|
1485
|
+
const { moveProps: m } = Rt({
|
|
1486
1486
|
onMoveStart: () => {
|
|
1487
|
-
var
|
|
1488
|
-
l == null || l({ type: "dragHandleStart", handleId: r }), (
|
|
1487
|
+
var g;
|
|
1488
|
+
l == null || l({ type: "dragHandleStart", handleId: r }), (g = e.onDragStart) == null || g.call(e), n != null && n.value && (document.body.style.cursor = Ve(n == null ? void 0 : n.value) || "auto");
|
|
1489
1489
|
},
|
|
1490
|
-
onMove: (
|
|
1490
|
+
onMove: (g) => {
|
|
1491
1491
|
var p;
|
|
1492
|
-
l == null || l({ type: "dragHandle", handleId: r, value:
|
|
1492
|
+
l == null || l({ type: "dragHandle", handleId: r, value: g }), (p = e.onDrag) == null || p.call(e);
|
|
1493
1493
|
},
|
|
1494
1494
|
onMoveEnd: () => {
|
|
1495
|
-
var
|
|
1496
|
-
l == null || l({ type: "dragHandleEnd", handleId: r }), (
|
|
1495
|
+
var g;
|
|
1496
|
+
l == null || l({ type: "dragHandleEnd", handleId: r }), (g = e.onDragEnd) == null || g.call(e), document.body.style.cursor = "auto";
|
|
1497
1497
|
}
|
|
1498
|
-
}),
|
|
1498
|
+
}), o = (g) => {
|
|
1499
1499
|
if (n != null && n.value)
|
|
1500
1500
|
try {
|
|
1501
|
-
const p =
|
|
1502
|
-
|
|
1501
|
+
const p = vt(n == null ? void 0 : n.value, r);
|
|
1502
|
+
g.key === "Enter" && p && (p.collapsed ? l == null || l({ type: "expandPanel", panelId: p.id }) : l == null || l({ type: "collapsePanel", panelId: p.id }));
|
|
1503
1503
|
} catch {
|
|
1504
1504
|
}
|
|
1505
|
-
}, f =
|
|
1506
|
-
var
|
|
1507
|
-
const
|
|
1508
|
-
if (!
|
|
1509
|
-
const p = (z = n == null ? void 0 : n.value) == null ? void 0 : z.items[
|
|
1510
|
-
return !v || !
|
|
1505
|
+
}, f = H(() => {
|
|
1506
|
+
var h, z, y, x, A, D, K, L, M;
|
|
1507
|
+
const g = (h = n == null ? void 0 : n.value) == null ? void 0 : h.items.findIndex((w) => w.id === r);
|
|
1508
|
+
if (!g) return { id: r };
|
|
1509
|
+
const p = (z = n == null ? void 0 : n.value) == null ? void 0 : z.items[g], v = (y = n == null ? void 0 : n.value) == null ? void 0 : y.items[g - 1];
|
|
1510
|
+
return !v || !P(v) ? { id: r } : {
|
|
1511
1511
|
...t,
|
|
1512
|
-
...
|
|
1512
|
+
...Vt({
|
|
1513
1513
|
groupId: (x = n == null ? void 0 : n.value) == null ? void 0 : x.groupId,
|
|
1514
1514
|
id: r,
|
|
1515
1515
|
orientation: ((A = n == null ? void 0 : n.value) == null ? void 0 : A.orientation) || "horizontal",
|
|
1516
|
-
isDragging: ((
|
|
1516
|
+
isDragging: ((D = n == null ? void 0 : n.value) == null ? void 0 : D.activeDragHandleId) === r,
|
|
1517
1517
|
activeDragHandleId: (K = n == null ? void 0 : n.value) == null ? void 0 : K.activeDragHandleId,
|
|
1518
1518
|
disabled: e.disabled,
|
|
1519
1519
|
controlsId: v.id,
|
|
1520
1520
|
min: v.min,
|
|
1521
1521
|
max: v.max,
|
|
1522
1522
|
currentValue: v.currentValue,
|
|
1523
|
-
groupSize:
|
|
1523
|
+
groupSize: V(n.value)
|
|
1524
1524
|
}),
|
|
1525
1525
|
onpointerdown: e.disabled ? void 0 : m.onPointerDown,
|
|
1526
1526
|
onkeydown: e.disabled ? void 0 : (w) => {
|
|
1527
|
-
m.onKeyDown(w),
|
|
1527
|
+
m.onKeyDown(w), o(w);
|
|
1528
1528
|
},
|
|
1529
1529
|
style: {
|
|
1530
1530
|
cursor: n != null && n.value ? Ve(n.value) : void 0,
|
|
1531
|
-
width: ((
|
|
1532
|
-
height: ((
|
|
1531
|
+
width: ((L = n == null ? void 0 : n.value) == null ? void 0 : L.orientation) === "horizontal" ? `${p == null ? void 0 : p.size.value.toNumber()}px` : "100%",
|
|
1532
|
+
height: ((M = n == null ? void 0 : n.value) == null ? void 0 : M.orientation) === "vertical" ? `${p == null ? void 0 : p.size.value.toNumber()}px` : "100%"
|
|
1533
1533
|
}
|
|
1534
1534
|
};
|
|
1535
1535
|
});
|
|
1536
|
-
return (
|
|
1537
|
-
tabindex:
|
|
1536
|
+
return (g, p) => (Pe(), ye("div", Ke(f.value, {
|
|
1537
|
+
tabindex: g.disabled ? -1 : 0
|
|
1538
1538
|
}), [
|
|
1539
|
-
Se(
|
|
1540
|
-
], 16,
|
|
1539
|
+
Se(g.$slots, "default")
|
|
1540
|
+
], 16, Bt));
|
|
1541
1541
|
}
|
|
1542
1542
|
});
|
|
1543
1543
|
export {
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1544
|
+
Kt as Panel,
|
|
1545
|
+
Nt as PanelGroup,
|
|
1546
|
+
Ot as PanelResizer
|
|
1547
1547
|
};
|
|
1548
1548
|
//# sourceMappingURL=index.mjs.map
|