@window-splitter/vue 1.1.1 → 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 +572 -560
- 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 tt(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 nt(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 at() {
|
|
|
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),
|
|
299
|
+
let T = -1;
|
|
300
|
+
function it(e, t) {
|
|
301
|
+
t.add(e), ot();
|
|
302
302
|
}
|
|
303
|
-
function
|
|
304
|
-
|
|
303
|
+
function ot() {
|
|
304
|
+
T < 0 && (T = 0, $e(Le));
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
|
|
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 dt(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
|
-
function
|
|
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,27 +455,27 @@ 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
|
-
function
|
|
478
|
+
function qe(e) {
|
|
479
479
|
const t = {}, a = e.map((i) => i.order).filter((i) => i !== void 0);
|
|
480
480
|
let r = 0;
|
|
481
481
|
for (const i of e)
|
|
@@ -484,104 +484,104 @@ function gt(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
|
-
return a !== -1 && (r = e.filter((l, n) => n !== a)),
|
|
567
|
+
return a !== -1 && (r = e.filter((l, n) => n !== a)), qe([...r, t]);
|
|
568
568
|
}
|
|
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
|
-
function
|
|
764
|
-
const a =
|
|
763
|
+
function Fe(e, t) {
|
|
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
|
-
delta:
|
|
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 =
|
|
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,137 +941,149 @@ function Ct(e, t) {
|
|
|
941
941
|
break;
|
|
942
942
|
}
|
|
943
943
|
if (!l) {
|
|
944
|
-
switch (
|
|
944
|
+
switch (s.type) {
|
|
945
|
+
case "updateItemIndex":
|
|
946
|
+
n.items = qe(n.items.map((o) => o.id === s.itemId ? { ...o, order: s.index } : o));
|
|
947
|
+
break;
|
|
945
948
|
case "registerPanel":
|
|
946
|
-
n.items =
|
|
949
|
+
n.items = he(n.items, {
|
|
947
950
|
type: "panel",
|
|
948
|
-
currentValue:
|
|
949
|
-
...
|
|
951
|
+
currentValue: $(-1),
|
|
952
|
+
...s.data
|
|
950
953
|
});
|
|
951
954
|
break;
|
|
952
955
|
case "unregisterPanel":
|
|
953
|
-
i.prepare(), i.removeItem(
|
|
956
|
+
i.prepare(), i.removeItem(s.id), i.clearLastKnownSize(), i.commit(), i.onResize(), i.onAutosave();
|
|
954
957
|
break;
|
|
955
958
|
case "registerPanelHandle": {
|
|
956
|
-
n.items =
|
|
959
|
+
n.items = he(n.items, s.data);
|
|
957
960
|
break;
|
|
958
961
|
}
|
|
959
962
|
case "unregisterPanelHandle":
|
|
960
|
-
i.prepare(), i.removeItem(
|
|
963
|
+
i.prepare(), i.removeItem(s.id), i.clearLastKnownSize(), i.commit(), i.onResize(), i.onAutosave();
|
|
961
964
|
break;
|
|
962
965
|
case "registerDynamicPanel": {
|
|
963
966
|
i.prepare();
|
|
964
|
-
let
|
|
965
|
-
|
|
966
|
-
|
|
967
|
+
let o = $(0);
|
|
968
|
+
s.data.collapsible && s.data.collapsed && s.data.collapsedSize ? o = {
|
|
969
|
+
type: "pixel",
|
|
970
|
+
value: C(n, s.data.collapsedSize)
|
|
971
|
+
} : s.data.default ? o = {
|
|
972
|
+
type: "pixel",
|
|
973
|
+
value: C(n, s.data.default)
|
|
974
|
+
} : o = {
|
|
975
|
+
type: "pixel",
|
|
976
|
+
value: C(n, s.data.min)
|
|
977
|
+
};
|
|
978
|
+
const f = he(n.items, {
|
|
967
979
|
type: "panel",
|
|
968
|
-
...
|
|
969
|
-
currentValue:
|
|
970
|
-
}),
|
|
971
|
-
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();
|
|
972
984
|
break;
|
|
973
985
|
}
|
|
974
986
|
case "rebindPanelCallbacks":
|
|
975
|
-
for (const
|
|
976
|
-
|
|
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);
|
|
977
989
|
break;
|
|
978
990
|
case "updateConstraints":
|
|
979
991
|
i.prepare();
|
|
980
|
-
for (const
|
|
981
|
-
if (
|
|
982
|
-
const f =
|
|
983
|
-
|
|
984
|
-
} else if (
|
|
985
|
-
const f =
|
|
986
|
-
|
|
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;
|
|
987
999
|
}
|
|
988
1000
|
i.clearLastKnownSize(), i.commit(), i.onResize(), i.onAutosave();
|
|
989
1001
|
break;
|
|
990
1002
|
case "setActualItemsSize": {
|
|
991
|
-
const
|
|
992
|
-
if (!
|
|
1003
|
+
const o = n.items.map((p) => {
|
|
1004
|
+
if (!P(p))
|
|
993
1005
|
return p;
|
|
994
|
-
const v =
|
|
1006
|
+
const v = s.childrenSizes[p.id] || p.lastKnownSize;
|
|
995
1007
|
return { ...p, lastKnownSize: v };
|
|
996
1008
|
});
|
|
997
|
-
let f = 0,
|
|
998
|
-
for (const p of
|
|
999
|
-
if (
|
|
1009
|
+
let f = 0, g = !1;
|
|
1010
|
+
for (const p of o)
|
|
1011
|
+
if (P(p)) {
|
|
1000
1012
|
const v = (m = p.lastKnownSize) == null ? void 0 : m[n.orientation === "horizontal" ? "width" : "height"];
|
|
1001
1013
|
if (!v) {
|
|
1002
|
-
n.items =
|
|
1014
|
+
n.items = o, g = !0;
|
|
1003
1015
|
break;
|
|
1004
1016
|
}
|
|
1005
1017
|
f += v;
|
|
1006
1018
|
} else
|
|
1007
1019
|
f += p.size.value.toNumber();
|
|
1008
|
-
|
|
1020
|
+
g ? n.items = o : f > V(n) && r.current !== "dragging" ? n.items = Pt({
|
|
1009
1021
|
...n,
|
|
1010
|
-
items:
|
|
1011
|
-
}).items : n.items =
|
|
1022
|
+
items: E({ ...n, items: o })
|
|
1023
|
+
}).items : n.items = o, i.onResize();
|
|
1012
1024
|
break;
|
|
1013
1025
|
}
|
|
1014
1026
|
case "setSize": {
|
|
1015
|
-
n.size =
|
|
1027
|
+
n.size = s.size, i.onResize();
|
|
1016
1028
|
break;
|
|
1017
1029
|
}
|
|
1018
1030
|
case "setOrientation":
|
|
1019
|
-
n.orientation =
|
|
1031
|
+
n.orientation = s.orientation, i.clearLastKnownSize(), i.onResize();
|
|
1020
1032
|
break;
|
|
1021
1033
|
}
|
|
1022
1034
|
if (r.current === "idle")
|
|
1023
|
-
switch (
|
|
1035
|
+
switch (s.type) {
|
|
1024
1036
|
case "dragHandleStart":
|
|
1025
|
-
|
|
1037
|
+
d("dragging"), n.activeDragHandleId = s.handleId;
|
|
1026
1038
|
break;
|
|
1027
1039
|
case "setPanelPixelSize": {
|
|
1028
1040
|
i.prepare(), i.clearLastKnownSize();
|
|
1029
|
-
const
|
|
1030
|
-
|
|
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({
|
|
1031
1043
|
context: n,
|
|
1032
|
-
panelId:
|
|
1044
|
+
panelId: s.panelId,
|
|
1033
1045
|
direction: f.direction * (v ? 1 : -1),
|
|
1034
1046
|
handleId: f.item.id,
|
|
1035
|
-
delta:
|
|
1047
|
+
delta: h
|
|
1036
1048
|
})), i.commit(), i.onResize(), i.onAutosave();
|
|
1037
1049
|
break;
|
|
1038
1050
|
}
|
|
1039
1051
|
case "collapsePanel":
|
|
1040
|
-
|
|
1041
|
-
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);
|
|
1042
1054
|
}));
|
|
1043
1055
|
break;
|
|
1044
1056
|
case "expandPanel":
|
|
1045
|
-
if (
|
|
1057
|
+
if (u.cannotExpandPanel(s))
|
|
1046
1058
|
break;
|
|
1047
|
-
|
|
1048
|
-
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);
|
|
1049
1061
|
}));
|
|
1050
1062
|
break;
|
|
1051
1063
|
}
|
|
1052
1064
|
else if (r.current === "dragging")
|
|
1053
|
-
switch (
|
|
1065
|
+
switch (s.type) {
|
|
1054
1066
|
case "dragHandle":
|
|
1055
|
-
i.clearLastKnownSize(), se(n, oe(n,
|
|
1067
|
+
i.clearLastKnownSize(), se(n, oe(n, s)), i.onResize();
|
|
1056
1068
|
break;
|
|
1057
1069
|
case "dragHandleEnd":
|
|
1058
|
-
|
|
1070
|
+
d("idle");
|
|
1059
1071
|
break;
|
|
1060
1072
|
case "expandPanel":
|
|
1061
1073
|
case "collapsePanel":
|
|
1062
|
-
|
|
1074
|
+
u.shouldCollapseToggle(s) && i.runCollapseToggle(s);
|
|
1063
1075
|
break;
|
|
1064
1076
|
}
|
|
1065
1077
|
else if (r.current === "togglingCollapse")
|
|
1066
|
-
switch (
|
|
1078
|
+
switch (s.type) {
|
|
1067
1079
|
case "applyDelta":
|
|
1068
1080
|
se(n, oe(n, {
|
|
1069
|
-
panelId:
|
|
1070
|
-
handleId:
|
|
1081
|
+
panelId: s.panelId,
|
|
1082
|
+
handleId: s.handleId,
|
|
1071
1083
|
type: "collapsePanel",
|
|
1072
1084
|
disregardCollapseBuffer: !0,
|
|
1073
1085
|
value: we({
|
|
1074
|
-
delta:
|
|
1086
|
+
delta: s.delta,
|
|
1075
1087
|
orientation: n.orientation
|
|
1076
1088
|
})
|
|
1077
1089
|
})), i.onResize();
|
|
@@ -1080,9 +1092,9 @@ function Ct(e, t) {
|
|
|
1080
1092
|
t == null || t(n);
|
|
1081
1093
|
}
|
|
1082
1094
|
}
|
|
1083
|
-
return [n,
|
|
1095
|
+
return [n, c, r];
|
|
1084
1096
|
}
|
|
1085
|
-
function
|
|
1097
|
+
function xt({ groupId: e, id: t, collapsible: a, collapsed: r }) {
|
|
1086
1098
|
const l = {
|
|
1087
1099
|
id: t,
|
|
1088
1100
|
"data-splitter-group-id": e,
|
|
@@ -1091,7 +1103,7 @@ function At({ groupId: e, id: t, collapsible: a, collapsed: r }) {
|
|
|
1091
1103
|
};
|
|
1092
1104
|
return a && (l["data-collapsed"] = r), l;
|
|
1093
1105
|
}
|
|
1094
|
-
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 }) {
|
|
1095
1107
|
return {
|
|
1096
1108
|
id: t,
|
|
1097
1109
|
role: "separator",
|
|
@@ -1103,19 +1115,19 @@ function xt({ groupId: e, id: t, orientation: a, isDragging: r, activeDragHandle
|
|
|
1103
1115
|
"aria-label": "Resize Handle",
|
|
1104
1116
|
"aria-disabled": n,
|
|
1105
1117
|
"aria-controls": i,
|
|
1106
|
-
"aria-valuemin":
|
|
1107
|
-
"aria-valuemax":
|
|
1108
|
-
"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
|
|
1109
1121
|
};
|
|
1110
1122
|
}
|
|
1111
|
-
function
|
|
1123
|
+
function Dt(e, t) {
|
|
1112
1124
|
const a = new ResizeObserver((l) => {
|
|
1113
1125
|
const n = {};
|
|
1114
1126
|
for (const i of l) {
|
|
1115
|
-
const
|
|
1116
|
-
|
|
1117
|
-
width:
|
|
1118
|
-
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
|
|
1119
1131
|
});
|
|
1120
1132
|
}
|
|
1121
1133
|
t(n);
|
|
@@ -1126,76 +1138,76 @@ function Vt(e, t) {
|
|
|
1126
1138
|
a.disconnect();
|
|
1127
1139
|
};
|
|
1128
1140
|
}
|
|
1129
|
-
function
|
|
1130
|
-
const { onMoveStart: t, onMove: a, onMoveEnd: r } = e, l = { didMove: !1, lastPosition: null, id: null }, n = (
|
|
1131
|
-
|
|
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({
|
|
1132
1144
|
type: "movestart",
|
|
1133
1145
|
pointerType: f,
|
|
1134
|
-
shiftKey:
|
|
1135
|
-
metaKey:
|
|
1136
|
-
ctrlKey:
|
|
1137
|
-
altKey:
|
|
1146
|
+
shiftKey: o.shiftKey,
|
|
1147
|
+
metaKey: o.metaKey,
|
|
1148
|
+
ctrlKey: o.ctrlKey,
|
|
1149
|
+
altKey: o.altKey
|
|
1138
1150
|
})), a == null || a({
|
|
1139
1151
|
type: "move",
|
|
1140
1152
|
pointerType: f,
|
|
1141
|
-
deltaX:
|
|
1153
|
+
deltaX: g,
|
|
1142
1154
|
deltaY: p,
|
|
1143
|
-
shiftKey:
|
|
1144
|
-
metaKey:
|
|
1145
|
-
ctrlKey:
|
|
1146
|
-
altKey:
|
|
1155
|
+
shiftKey: o.shiftKey,
|
|
1156
|
+
metaKey: o.metaKey,
|
|
1157
|
+
ctrlKey: o.ctrlKey,
|
|
1158
|
+
altKey: o.altKey
|
|
1147
1159
|
}));
|
|
1148
|
-
}, i = (
|
|
1160
|
+
}, i = (o, f) => {
|
|
1149
1161
|
l.didMove && (r == null || r({
|
|
1150
1162
|
type: "moveend",
|
|
1151
1163
|
pointerType: f,
|
|
1152
|
-
shiftKey:
|
|
1153
|
-
metaKey:
|
|
1154
|
-
ctrlKey:
|
|
1155
|
-
altKey:
|
|
1164
|
+
shiftKey: o.shiftKey,
|
|
1165
|
+
metaKey: o.metaKey,
|
|
1166
|
+
ctrlKey: o.ctrlKey,
|
|
1167
|
+
altKey: o.altKey
|
|
1156
1168
|
}));
|
|
1157
|
-
},
|
|
1169
|
+
}, u = {}, d = () => {
|
|
1158
1170
|
l.didMove = !1;
|
|
1159
|
-
},
|
|
1160
|
-
var f,
|
|
1161
|
-
if (
|
|
1162
|
-
const p =
|
|
1163
|
-
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 };
|
|
1164
1176
|
}
|
|
1165
|
-
},
|
|
1166
|
-
if (
|
|
1167
|
-
const f =
|
|
1168
|
-
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);
|
|
1169
1181
|
}
|
|
1170
1182
|
};
|
|
1171
|
-
|
|
1172
|
-
|
|
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));
|
|
1173
1185
|
};
|
|
1174
|
-
const m = (
|
|
1175
|
-
|
|
1186
|
+
const m = (o, f, g) => {
|
|
1187
|
+
d(), n(o, "keyboard", f, g), i(o, "keyboard");
|
|
1176
1188
|
};
|
|
1177
|
-
return
|
|
1178
|
-
switch (
|
|
1189
|
+
return u.onKeyDown = (o) => {
|
|
1190
|
+
switch (o.key) {
|
|
1179
1191
|
case "Left":
|
|
1180
1192
|
case "ArrowLeft":
|
|
1181
|
-
|
|
1193
|
+
o.preventDefault(), o.stopPropagation(), m(o, -1, 0);
|
|
1182
1194
|
break;
|
|
1183
1195
|
case "Right":
|
|
1184
1196
|
case "ArrowRight":
|
|
1185
|
-
|
|
1197
|
+
o.preventDefault(), o.stopPropagation(), m(o, 1, 0);
|
|
1186
1198
|
break;
|
|
1187
1199
|
case "Up":
|
|
1188
1200
|
case "ArrowUp":
|
|
1189
|
-
|
|
1201
|
+
o.preventDefault(), o.stopPropagation(), m(o, 0, -1);
|
|
1190
1202
|
break;
|
|
1191
1203
|
case "Down":
|
|
1192
1204
|
case "ArrowDown":
|
|
1193
|
-
|
|
1205
|
+
o.preventDefault(), o.stopPropagation(), m(o, 0, 1);
|
|
1194
1206
|
break;
|
|
1195
1207
|
}
|
|
1196
|
-
}, { moveProps:
|
|
1208
|
+
}, { moveProps: u };
|
|
1197
1209
|
}
|
|
1198
|
-
const
|
|
1210
|
+
const Kt = /* @__PURE__ */ be({
|
|
1199
1211
|
__name: "Panel",
|
|
1200
1212
|
props: {
|
|
1201
1213
|
onResize: {},
|
|
@@ -1217,16 +1229,16 @@ const Et = /* @__PURE__ */ be({
|
|
|
1217
1229
|
max: l,
|
|
1218
1230
|
id: n,
|
|
1219
1231
|
collapsible: i,
|
|
1220
|
-
collapsedSize:
|
|
1221
|
-
onCollapseChange:
|
|
1222
|
-
collapseAnimation:
|
|
1223
|
-
onResize:
|
|
1232
|
+
collapsedSize: u,
|
|
1233
|
+
onCollapseChange: d,
|
|
1234
|
+
collapseAnimation: c,
|
|
1235
|
+
onResize: s,
|
|
1224
1236
|
defaultCollapsed: m,
|
|
1225
|
-
default:
|
|
1237
|
+
default: o,
|
|
1226
1238
|
isStaticAtRest: f,
|
|
1227
|
-
collapsed:
|
|
1239
|
+
collapsed: g,
|
|
1228
1240
|
...p
|
|
1229
|
-
} = a, v = n || Ie(),
|
|
1241
|
+
} = a, v = n || Ie(), h = X("send"), z = X("state"), y = X("isPrerender"), x = () => pt({
|
|
1230
1242
|
id: v,
|
|
1231
1243
|
min: a.min,
|
|
1232
1244
|
max: a.max,
|
|
@@ -1237,89 +1249,89 @@ const Et = /* @__PURE__ */ be({
|
|
|
1237
1249
|
collapseAnimation: a.collapseAnimation,
|
|
1238
1250
|
onResize: a.onResize ? { current: a.onResize } : void 0,
|
|
1239
1251
|
defaultCollapsed: m,
|
|
1240
|
-
default:
|
|
1252
|
+
default: o,
|
|
1241
1253
|
isStaticAtRest: f
|
|
1242
|
-
}),
|
|
1243
|
-
var
|
|
1244
|
-
const w = (
|
|
1245
|
-
if (!(!w || !
|
|
1254
|
+
}), A = H(() => {
|
|
1255
|
+
var S;
|
|
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)))
|
|
1246
1258
|
return w;
|
|
1247
1259
|
});
|
|
1248
|
-
let
|
|
1249
|
-
|
|
1260
|
+
let D = !1;
|
|
1261
|
+
A.value ? h == null || h({
|
|
1250
1262
|
type: "rebindPanelCallbacks",
|
|
1251
1263
|
data: {
|
|
1252
1264
|
id: v,
|
|
1253
1265
|
onCollapseChange: a.onCollapseChange ? { current: a.onCollapseChange } : void 0,
|
|
1254
1266
|
onResize: a.onResize ? { current: a.onResize } : void 0
|
|
1255
1267
|
}
|
|
1256
|
-
}) :
|
|
1268
|
+
}) : y != null && y.value ? h == null || h({ type: "registerPanel", data: x() }) : D = !0, G(() => {
|
|
1257
1269
|
var le;
|
|
1258
1270
|
const w = (le = z == null ? void 0 : z.value) == null ? void 0 : le.groupId;
|
|
1259
|
-
if (!w || !
|
|
1260
|
-
const
|
|
1261
|
-
if (!
|
|
1262
|
-
const
|
|
1263
|
-
if (!
|
|
1264
|
-
const re = Array.from(
|
|
1265
|
-
typeof re == "number" && (
|
|
1271
|
+
if (!w || !D) return;
|
|
1272
|
+
const S = document.getElementById(w);
|
|
1273
|
+
if (!S) return;
|
|
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({
|
|
1266
1278
|
type: "registerDynamicPanel",
|
|
1267
1279
|
data: { ...x(), order: re }
|
|
1268
|
-
}),
|
|
1280
|
+
}), D = !1);
|
|
1269
1281
|
});
|
|
1270
|
-
const K =
|
|
1271
|
-
() => !
|
|
1282
|
+
const K = H(
|
|
1283
|
+
() => !D && mt(x(), A.value)
|
|
1272
1284
|
);
|
|
1273
1285
|
ue(() => {
|
|
1274
|
-
K.value && (
|
|
1286
|
+
K.value && (h == null || h({ type: "updateConstraints", data: x() }));
|
|
1275
1287
|
}), Be(() => {
|
|
1276
|
-
requestAnimationFrame(() =>
|
|
1288
|
+
requestAnimationFrame(() => h == null ? void 0 : h({ type: "unregisterPanel", id: v }));
|
|
1277
1289
|
}), t({
|
|
1278
1290
|
getId: () => v,
|
|
1279
1291
|
collapse: async () => {
|
|
1280
1292
|
var w;
|
|
1281
|
-
if ((w =
|
|
1282
|
-
return await new Promise((
|
|
1283
|
-
|
|
1293
|
+
if ((w = A.value) != null && w.collapsible)
|
|
1294
|
+
return await new Promise((S) => {
|
|
1295
|
+
h == null || h({ type: "collapsePanel", panelId: v, controlled: !0, resolve: S });
|
|
1284
1296
|
});
|
|
1285
1297
|
},
|
|
1286
1298
|
isCollapsed: () => {
|
|
1287
|
-
var w,
|
|
1288
|
-
return !!((w =
|
|
1299
|
+
var w, S;
|
|
1300
|
+
return !!((w = A.value) != null && w.collapsible && ((S = A.value) != null && S.collapsed));
|
|
1289
1301
|
},
|
|
1290
1302
|
expand: async () => {
|
|
1291
1303
|
var w;
|
|
1292
|
-
if ((w =
|
|
1293
|
-
return await new Promise((
|
|
1294
|
-
|
|
1304
|
+
if ((w = A.value) != null && w.collapsible)
|
|
1305
|
+
return await new Promise((S) => {
|
|
1306
|
+
h == null || h({ type: "expandPanel", panelId: v, controlled: !0, resolve: S });
|
|
1295
1307
|
});
|
|
1296
1308
|
},
|
|
1297
1309
|
isExpanded: () => {
|
|
1298
|
-
var w,
|
|
1299
|
-
return !!((w =
|
|
1310
|
+
var w, S;
|
|
1311
|
+
return !!((w = A.value) != null && w.collapsible && !((S = A.value) != null && S.collapsed));
|
|
1300
1312
|
},
|
|
1301
|
-
getPixelSize: () =>
|
|
1302
|
-
getPercentageSize: () =>
|
|
1303
|
-
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 })
|
|
1304
1316
|
});
|
|
1305
|
-
const
|
|
1317
|
+
const L = H(
|
|
1306
1318
|
() => {
|
|
1307
1319
|
var w;
|
|
1308
|
-
return (w =
|
|
1320
|
+
return (w = A.value) == null ? void 0 : w.collapseIsControlled;
|
|
1309
1321
|
}
|
|
1310
1322
|
);
|
|
1311
1323
|
ue(() => {
|
|
1312
1324
|
a.collapsed, requestAnimationFrame(() => {
|
|
1313
|
-
|
|
1325
|
+
L.value && (a.collapsed ? h == null || h({ type: "collapsePanel", panelId: v, controlled: !0 }) : h == null || h({ type: "expandPanel", panelId: v, controlled: !0 }));
|
|
1314
1326
|
});
|
|
1315
1327
|
});
|
|
1316
|
-
const
|
|
1317
|
-
var
|
|
1318
|
-
const w =
|
|
1328
|
+
const M = H(() => {
|
|
1329
|
+
var S;
|
|
1330
|
+
const w = A.value;
|
|
1319
1331
|
return {
|
|
1320
1332
|
...p,
|
|
1321
|
-
...
|
|
1322
|
-
groupId: (
|
|
1333
|
+
...xt({
|
|
1334
|
+
groupId: (S = z == null ? void 0 : z.value) == null ? void 0 : S.groupId,
|
|
1323
1335
|
id: v,
|
|
1324
1336
|
collapsible: w == null ? void 0 : w.collapsible,
|
|
1325
1337
|
collapsed: w == null ? void 0 : w.collapsed
|
|
@@ -1331,11 +1343,11 @@ const Et = /* @__PURE__ */ be({
|
|
|
1331
1343
|
}
|
|
1332
1344
|
};
|
|
1333
1345
|
});
|
|
1334
|
-
return (w,
|
|
1346
|
+
return (w, S) => (Pe(), ye("div", We(Ue(M.value)), [
|
|
1335
1347
|
Se(w.$slots, "default")
|
|
1336
1348
|
], 16));
|
|
1337
1349
|
}
|
|
1338
|
-
}),
|
|
1350
|
+
}), kt = ["id"], Nt = /* @__PURE__ */ be({
|
|
1339
1351
|
__name: "PanelGroup",
|
|
1340
1352
|
props: {
|
|
1341
1353
|
snapshot: {},
|
|
@@ -1354,23 +1366,23 @@ const Et = /* @__PURE__ */ be({
|
|
|
1354
1366
|
}
|
|
1355
1367
|
const l = me(!0);
|
|
1356
1368
|
ie("isPrerender", l);
|
|
1357
|
-
const n = e.autosaveId || e.id || Ie(), [i,
|
|
1369
|
+
const n = e.autosaveId || e.id || Ie(), [i, u, d] = At(
|
|
1358
1370
|
{
|
|
1359
1371
|
orientation: e.orientation,
|
|
1360
1372
|
groupId: n,
|
|
1361
1373
|
autosaveStrategy: e.autosaveStrategy,
|
|
1362
1374
|
shiftAmount: e.shiftAmount,
|
|
1363
|
-
...r ?
|
|
1375
|
+
...r ? ft(r) : void 0
|
|
1364
1376
|
},
|
|
1365
1377
|
(f) => {
|
|
1366
|
-
|
|
1378
|
+
c.value = { ...f };
|
|
1367
1379
|
}
|
|
1368
1380
|
);
|
|
1369
1381
|
G(() => {
|
|
1370
1382
|
l.value = !1;
|
|
1371
1383
|
});
|
|
1372
|
-
const
|
|
1373
|
-
const f = De(
|
|
1384
|
+
const c = me(i), s = H(() => {
|
|
1385
|
+
const f = De(c.value);
|
|
1374
1386
|
return {
|
|
1375
1387
|
height: "100%",
|
|
1376
1388
|
display: "grid",
|
|
@@ -1378,59 +1390,59 @@ const Et = /* @__PURE__ */ be({
|
|
|
1378
1390
|
gridTemplateRows: e.orientation === "vertical" ? f : void 0
|
|
1379
1391
|
};
|
|
1380
1392
|
});
|
|
1381
|
-
ie("send",
|
|
1393
|
+
ie("send", u), ie("state", c), ie("id", d);
|
|
1382
1394
|
const m = me(null);
|
|
1383
1395
|
G(() => {
|
|
1384
|
-
const f = new ResizeObserver(([
|
|
1385
|
-
|
|
1396
|
+
const f = new ResizeObserver(([g]) => {
|
|
1397
|
+
g && g.contentRect.width > 0 && g.contentRect.height > 0 && (u == null || u({ type: "setSize", size: g.contentRect }));
|
|
1386
1398
|
});
|
|
1387
1399
|
return m.value && f.observe(m.value), () => f.disconnect();
|
|
1388
1400
|
});
|
|
1389
|
-
const
|
|
1401
|
+
const o = H(
|
|
1390
1402
|
() => {
|
|
1391
1403
|
var f;
|
|
1392
|
-
return (f =
|
|
1404
|
+
return (f = c.value) == null ? void 0 : f.items.map((g) => g.id).join(",");
|
|
1393
1405
|
}
|
|
1394
1406
|
);
|
|
1395
1407
|
return G(() => {
|
|
1396
1408
|
ue(() => {
|
|
1397
|
-
|
|
1398
|
-
const f =
|
|
1399
|
-
|
|
1409
|
+
o.value;
|
|
1410
|
+
const f = Dt(n, (g) => {
|
|
1411
|
+
u({ type: "setActualItemsSize", childrenSizes: g });
|
|
1400
1412
|
});
|
|
1401
|
-
|
|
1413
|
+
Ge(f);
|
|
1402
1414
|
});
|
|
1403
|
-
}), G(() => (
|
|
1415
|
+
}), G(() => (u({ type: "unlockGroup" }), () => u({ type: "lockGroup" }))), t({
|
|
1404
1416
|
getId: () => n,
|
|
1405
|
-
getPixelSizes: () =>
|
|
1406
|
-
getPercentageSizes: () =>
|
|
1417
|
+
getPixelSizes: () => zt(c.value),
|
|
1418
|
+
getPercentageSizes: () => It(c.value),
|
|
1407
1419
|
getTemplate: () => De({
|
|
1408
|
-
...
|
|
1409
|
-
items:
|
|
1420
|
+
...c.value,
|
|
1421
|
+
items: E(c.value)
|
|
1410
1422
|
}),
|
|
1411
|
-
getState: () =>
|
|
1423
|
+
getState: () => d.current === "idle" ? "idle" : "dragging",
|
|
1412
1424
|
setSizes: (f) => {
|
|
1413
|
-
var
|
|
1425
|
+
var g;
|
|
1414
1426
|
for (let p = 0; p < f.length; p++) {
|
|
1415
|
-
const v = (
|
|
1416
|
-
v &&
|
|
1427
|
+
const v = (g = c.value) == null ? void 0 : g.items[p], h = f[p];
|
|
1428
|
+
v && P(v) && h && u({
|
|
1417
1429
|
type: "setPanelPixelSize",
|
|
1418
1430
|
panelId: v.id,
|
|
1419
|
-
size:
|
|
1431
|
+
size: h
|
|
1420
1432
|
});
|
|
1421
1433
|
}
|
|
1422
1434
|
}
|
|
1423
|
-
}), (f,
|
|
1424
|
-
id:
|
|
1435
|
+
}), (f, g) => (Pe(), ye("div", Ke(a, {
|
|
1436
|
+
id: Xe(n),
|
|
1425
1437
|
ref_key: "elementRef",
|
|
1426
1438
|
ref: m,
|
|
1427
1439
|
"data-panel-group-wrapper": "",
|
|
1428
|
-
style:
|
|
1440
|
+
style: s.value
|
|
1429
1441
|
}), [
|
|
1430
1442
|
Se(f.$slots, "default")
|
|
1431
|
-
], 16,
|
|
1443
|
+
], 16, kt));
|
|
1432
1444
|
}
|
|
1433
|
-
}),
|
|
1445
|
+
}), Bt = ["tabindex"], Ot = /* @__PURE__ */ be({
|
|
1434
1446
|
__name: "PanelResizer",
|
|
1435
1447
|
props: {
|
|
1436
1448
|
disabled: { type: Boolean },
|
|
@@ -1442,95 +1454,95 @@ const Et = /* @__PURE__ */ be({
|
|
|
1442
1454
|
id: {}
|
|
1443
1455
|
},
|
|
1444
1456
|
setup(e) {
|
|
1445
|
-
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(() => {
|
|
1446
1458
|
var p;
|
|
1447
|
-
const
|
|
1448
|
-
if (!(!
|
|
1449
|
-
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;
|
|
1450
1462
|
});
|
|
1451
|
-
let
|
|
1452
|
-
|
|
1453
|
-
var z,
|
|
1454
|
-
if (!((z = n == null ? void 0 : n.value) == null ? void 0 : z.groupId) || !
|
|
1455
|
-
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);
|
|
1456
1468
|
if (!p) return;
|
|
1457
1469
|
const v = document.getElementById(r);
|
|
1458
1470
|
if (!v) return;
|
|
1459
|
-
const
|
|
1460
|
-
typeof
|
|
1471
|
+
const h = Array.from(p.children).indexOf(v);
|
|
1472
|
+
typeof h == "number" && (l == null || l({
|
|
1461
1473
|
type: "registerPanelHandle",
|
|
1462
|
-
data: { ...
|
|
1463
|
-
}),
|
|
1474
|
+
data: { ...u(), order: h }
|
|
1475
|
+
}), c = !1);
|
|
1464
1476
|
});
|
|
1465
|
-
const
|
|
1466
|
-
() => !
|
|
1477
|
+
const s = H(
|
|
1478
|
+
() => !c && gt(u(), d.value)
|
|
1467
1479
|
);
|
|
1468
1480
|
ue(() => {
|
|
1469
|
-
|
|
1481
|
+
s.value && (l == null || l({ type: "updateConstraints", data: u() }));
|
|
1470
1482
|
}), Be(() => {
|
|
1471
1483
|
requestAnimationFrame(() => l == null ? void 0 : l({ type: "unregisterPanelHandle", id: r }));
|
|
1472
1484
|
});
|
|
1473
|
-
const { moveProps: m } =
|
|
1485
|
+
const { moveProps: m } = Rt({
|
|
1474
1486
|
onMoveStart: () => {
|
|
1475
|
-
var
|
|
1476
|
-
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");
|
|
1477
1489
|
},
|
|
1478
|
-
onMove: (
|
|
1490
|
+
onMove: (g) => {
|
|
1479
1491
|
var p;
|
|
1480
|
-
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);
|
|
1481
1493
|
},
|
|
1482
1494
|
onMoveEnd: () => {
|
|
1483
|
-
var
|
|
1484
|
-
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";
|
|
1485
1497
|
}
|
|
1486
|
-
}),
|
|
1498
|
+
}), o = (g) => {
|
|
1487
1499
|
if (n != null && n.value)
|
|
1488
1500
|
try {
|
|
1489
|
-
const p =
|
|
1490
|
-
|
|
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 }));
|
|
1491
1503
|
} catch {
|
|
1492
1504
|
}
|
|
1493
|
-
}, f =
|
|
1494
|
-
var
|
|
1495
|
-
const
|
|
1496
|
-
if (!
|
|
1497
|
-
const p = (z = n == null ? void 0 : n.value) == null ? void 0 : z.items[
|
|
1498
|
-
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 } : {
|
|
1499
1511
|
...t,
|
|
1500
|
-
...
|
|
1512
|
+
...Vt({
|
|
1501
1513
|
groupId: (x = n == null ? void 0 : n.value) == null ? void 0 : x.groupId,
|
|
1502
1514
|
id: r,
|
|
1503
|
-
orientation: ((
|
|
1504
|
-
isDragging: ((
|
|
1515
|
+
orientation: ((A = n == null ? void 0 : n.value) == null ? void 0 : A.orientation) || "horizontal",
|
|
1516
|
+
isDragging: ((D = n == null ? void 0 : n.value) == null ? void 0 : D.activeDragHandleId) === r,
|
|
1505
1517
|
activeDragHandleId: (K = n == null ? void 0 : n.value) == null ? void 0 : K.activeDragHandleId,
|
|
1506
1518
|
disabled: e.disabled,
|
|
1507
1519
|
controlsId: v.id,
|
|
1508
1520
|
min: v.min,
|
|
1509
1521
|
max: v.max,
|
|
1510
1522
|
currentValue: v.currentValue,
|
|
1511
|
-
groupSize:
|
|
1523
|
+
groupSize: V(n.value)
|
|
1512
1524
|
}),
|
|
1513
1525
|
onpointerdown: e.disabled ? void 0 : m.onPointerDown,
|
|
1514
1526
|
onkeydown: e.disabled ? void 0 : (w) => {
|
|
1515
|
-
m.onKeyDown(w),
|
|
1527
|
+
m.onKeyDown(w), o(w);
|
|
1516
1528
|
},
|
|
1517
1529
|
style: {
|
|
1518
1530
|
cursor: n != null && n.value ? Ve(n.value) : void 0,
|
|
1519
|
-
width: ((
|
|
1520
|
-
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%"
|
|
1521
1533
|
}
|
|
1522
1534
|
};
|
|
1523
1535
|
});
|
|
1524
|
-
return (
|
|
1525
|
-
tabindex:
|
|
1536
|
+
return (g, p) => (Pe(), ye("div", Ke(f.value, {
|
|
1537
|
+
tabindex: g.disabled ? -1 : 0
|
|
1526
1538
|
}), [
|
|
1527
|
-
Se(
|
|
1528
|
-
], 16,
|
|
1539
|
+
Se(g.$slots, "default")
|
|
1540
|
+
], 16, Bt));
|
|
1529
1541
|
}
|
|
1530
1542
|
});
|
|
1531
1543
|
export {
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1544
|
+
Kt as Panel,
|
|
1545
|
+
Nt as PanelGroup,
|
|
1546
|
+
Ot as PanelResizer
|
|
1535
1547
|
};
|
|
1536
1548
|
//# sourceMappingURL=index.mjs.map
|