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