@window-splitter/vue 1.0.2 → 1.1.1--canary.9d2f98a.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +6 -7
- package/.turbo/turbo-lint.log +18 -0
- package/.turbo/turbo-test.log +398 -0
- package/CHANGELOG.md +17 -0
- package/dist/Panel.vue.d.ts +2 -2
- package/dist/Panel.vue.d.ts.map +1 -1
- package/dist/PanelGroup.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 +577 -533
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/src/Panel.vue +8 -4
- package/src/PanelGroup.vue +2 -0
- package/src/VueWindowSplitter.test.ts +15 -9
- package/src/__snapshots__/VueWindowSplitter.test.ts.snap +1 -1
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.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
|
-
if (t.value.shiftKey && (n *= 15), n === 0)
|
|
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,27 +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-${
|
|
792
|
-
autosaveStrategy: e.autosaveStrategy
|
|
793
|
-
|
|
818
|
+
dragOvershoot: new b(0),
|
|
819
|
+
groupId: e.groupId || `group-${St++}`,
|
|
820
|
+
autosaveStrategy: e.autosaveStrategy,
|
|
821
|
+
shiftAmount: e.shiftAmount ?? 15
|
|
822
|
+
}, i = {
|
|
794
823
|
prepare: () => {
|
|
795
824
|
n.items = O(n);
|
|
796
825
|
},
|
|
797
826
|
clearLastKnownSize: () => {
|
|
798
|
-
n.items =
|
|
827
|
+
n.items = Re(n.items);
|
|
799
828
|
},
|
|
800
829
|
commit: () => {
|
|
801
|
-
n.dragOvershoot = new
|
|
830
|
+
n.dragOvershoot = new b(0), n.items = Ae(n);
|
|
802
831
|
},
|
|
803
832
|
onResize: () => {
|
|
804
833
|
var c, m;
|
|
805
834
|
for (const s of n.items)
|
|
806
|
-
if (
|
|
807
|
-
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);
|
|
808
837
|
(m = (c = s.onResize) == null ? void 0 : c.current) == null || m.call(c, {
|
|
809
838
|
pixel: f.toNumber(),
|
|
810
|
-
percentage:
|
|
839
|
+
percentage: h > 0 ? f.div(D(n)).toNumber() : -1
|
|
811
840
|
});
|
|
812
841
|
}
|
|
813
842
|
},
|
|
@@ -815,87 +844,91 @@ function St(e, t) {
|
|
|
815
844
|
if (!n.autosaveStrategy || typeof window > "u")
|
|
816
845
|
return;
|
|
817
846
|
const c = { ...n };
|
|
818
|
-
c.items =
|
|
847
|
+
c.items = Re(n.items), c.activeDragHandleId = n.activeDragHandleId;
|
|
819
848
|
const m = JSON.stringify(c);
|
|
820
|
-
n.autosaveStrategy === "localStorage" ? localStorage.setItem(n.groupId, m) :
|
|
849
|
+
n.autosaveStrategy === "localStorage" ? localStorage.setItem(n.groupId, m) : Pt(n.groupId, m);
|
|
821
850
|
},
|
|
822
851
|
removeItem: (c) => {
|
|
823
852
|
const m = n.items.findIndex((p) => p.id === c), s = n.items[m];
|
|
824
853
|
if (!s)
|
|
825
854
|
return;
|
|
826
|
-
const f = n.items.filter((p) => p.id !== c),
|
|
827
|
-
|
|
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;
|
|
828
857
|
},
|
|
829
858
|
notifyCollapseToggle: (c) => {
|
|
830
859
|
var s, f;
|
|
831
860
|
Z(c, ["collapsePanel", "expandPanel"]);
|
|
832
|
-
const m =
|
|
861
|
+
const m = E(n, c.panelId);
|
|
833
862
|
(f = (s = m.onCollapseChange) == null ? void 0 : s.current) == null || f.call(s, !m.collapsed);
|
|
834
863
|
},
|
|
835
864
|
runCollapseToggle: (c) => {
|
|
836
865
|
Z(c, ["collapsePanel", "expandPanel"]);
|
|
837
|
-
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,
|
|
838
868
|
handleId: m.item.id,
|
|
869
|
+
type: "dragHandle",
|
|
839
870
|
controlled: c.controlled,
|
|
840
|
-
value:
|
|
871
|
+
value: we({
|
|
841
872
|
delta: s,
|
|
842
873
|
orientation: n.orientation
|
|
843
874
|
})
|
|
844
875
|
});
|
|
845
|
-
|
|
876
|
+
se(n, f);
|
|
846
877
|
},
|
|
847
878
|
onAnimationEnd: (c) => {
|
|
848
879
|
var s, f;
|
|
849
|
-
|
|
850
|
-
const m =
|
|
851
|
-
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();
|
|
852
883
|
}
|
|
853
884
|
};
|
|
854
|
-
|
|
855
|
-
const
|
|
885
|
+
i.onAutosave();
|
|
886
|
+
const o = {
|
|
856
887
|
shouldNotifyCollapseToggle: (c) => {
|
|
857
888
|
Z(c, ["collapsePanel", "expandPanel"]);
|
|
858
|
-
const m =
|
|
889
|
+
const m = E(n, c.panelId);
|
|
859
890
|
return !c.controlled && m.collapseIsControlled === !0;
|
|
860
891
|
},
|
|
861
|
-
shouldCollapseToggle: (c) => (Z(c, ["collapsePanel", "expandPanel"]),
|
|
892
|
+
shouldCollapseToggle: (c) => (Z(c, ["collapsePanel", "expandPanel"]), E(n, c.panelId).collapseIsControlled === !0),
|
|
862
893
|
cannotExpandPanel: (c) => {
|
|
863
894
|
Z(c, ["expandPanel"]);
|
|
864
|
-
const m =
|
|
865
|
-
let
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
...
|
|
869
|
-
|
|
870
|
-
|
|
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,
|
|
871
904
|
controlled: c.controlled,
|
|
872
|
-
delta:
|
|
873
|
-
direction:
|
|
905
|
+
delta: f,
|
|
906
|
+
direction: h.direction,
|
|
874
907
|
isVirtual: !0
|
|
875
908
|
})
|
|
876
909
|
};
|
|
877
|
-
const p =
|
|
878
|
-
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;
|
|
879
912
|
}
|
|
880
913
|
};
|
|
881
914
|
function u(c) {
|
|
882
915
|
switch (r.current) {
|
|
883
916
|
case "dragging":
|
|
884
|
-
|
|
917
|
+
i.commit(), n.activeDragHandleId = void 0;
|
|
885
918
|
break;
|
|
886
919
|
}
|
|
887
920
|
switch (c) {
|
|
888
921
|
case "idle":
|
|
889
|
-
|
|
922
|
+
i.onAutosave();
|
|
890
923
|
break;
|
|
891
924
|
case "dragging":
|
|
892
|
-
|
|
925
|
+
i.prepare();
|
|
893
926
|
break;
|
|
894
927
|
case "togglingCollapse":
|
|
895
|
-
|
|
928
|
+
i.prepare(), i.clearLastKnownSize();
|
|
896
929
|
break;
|
|
897
930
|
}
|
|
898
|
-
r.current = c;
|
|
931
|
+
r.current = c, t == null || t(n);
|
|
899
932
|
}
|
|
900
933
|
function d(c) {
|
|
901
934
|
var m;
|
|
@@ -910,80 +943,80 @@ function St(e, t) {
|
|
|
910
943
|
if (!l) {
|
|
911
944
|
switch (c.type) {
|
|
912
945
|
case "registerPanel":
|
|
913
|
-
n.items =
|
|
946
|
+
n.items = ge(n.items, {
|
|
914
947
|
type: "panel",
|
|
915
|
-
currentValue:
|
|
948
|
+
currentValue: L(-1),
|
|
916
949
|
...c.data
|
|
917
950
|
});
|
|
918
951
|
break;
|
|
919
952
|
case "unregisterPanel":
|
|
920
|
-
|
|
953
|
+
i.prepare(), i.removeItem(c.id), i.clearLastKnownSize(), i.commit(), i.onResize(), i.onAutosave();
|
|
921
954
|
break;
|
|
922
955
|
case "registerPanelHandle": {
|
|
923
|
-
n.items =
|
|
956
|
+
n.items = ge(n.items, c.data);
|
|
924
957
|
break;
|
|
925
958
|
}
|
|
926
959
|
case "unregisterPanelHandle":
|
|
927
|
-
|
|
960
|
+
i.prepare(), i.removeItem(c.id), i.clearLastKnownSize(), i.commit(), i.onResize(), i.onAutosave();
|
|
928
961
|
break;
|
|
929
962
|
case "registerDynamicPanel": {
|
|
930
|
-
|
|
931
|
-
let s =
|
|
963
|
+
i.prepare();
|
|
964
|
+
let s = L(0);
|
|
932
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;
|
|
933
|
-
const f =
|
|
966
|
+
const f = ge(n.items, {
|
|
934
967
|
type: "panel",
|
|
935
968
|
...c.data,
|
|
936
969
|
currentValue: s
|
|
937
|
-
}),
|
|
938
|
-
|
|
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();
|
|
939
972
|
break;
|
|
940
973
|
}
|
|
941
974
|
case "rebindPanelCallbacks":
|
|
942
975
|
for (const s of n.items)
|
|
943
|
-
|
|
976
|
+
y(s) && s.id === c.data.id && (s.onCollapseChange = c.data.onCollapseChange, s.onResize = c.data.onResize);
|
|
944
977
|
break;
|
|
945
978
|
case "updateConstraints":
|
|
946
|
-
|
|
979
|
+
i.prepare();
|
|
947
980
|
for (const s of n.items)
|
|
948
|
-
if (
|
|
981
|
+
if (y(s) && s.id === c.data.id) {
|
|
949
982
|
const f = c.data;
|
|
950
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;
|
|
951
|
-
} else if (
|
|
984
|
+
} else if (k(s) && s.id === c.data.id) {
|
|
952
985
|
const f = c.data;
|
|
953
986
|
s.size = f.size;
|
|
954
987
|
}
|
|
955
|
-
|
|
988
|
+
i.clearLastKnownSize(), i.commit(), i.onResize(), i.onAutosave();
|
|
956
989
|
break;
|
|
957
990
|
case "setActualItemsSize": {
|
|
958
991
|
const s = n.items.map((p) => {
|
|
959
|
-
if (!
|
|
992
|
+
if (!y(p))
|
|
960
993
|
return p;
|
|
961
994
|
const v = c.childrenSizes[p.id] || p.lastKnownSize;
|
|
962
995
|
return { ...p, lastKnownSize: v };
|
|
963
996
|
});
|
|
964
|
-
let f = 0,
|
|
997
|
+
let f = 0, h = !1;
|
|
965
998
|
for (const p of s)
|
|
966
|
-
if (
|
|
999
|
+
if (y(p)) {
|
|
967
1000
|
const v = (m = p.lastKnownSize) == null ? void 0 : m[n.orientation === "horizontal" ? "width" : "height"];
|
|
968
1001
|
if (!v) {
|
|
969
|
-
n.items = s,
|
|
1002
|
+
n.items = s, h = !0;
|
|
970
1003
|
break;
|
|
971
1004
|
}
|
|
972
1005
|
f += v;
|
|
973
1006
|
} else
|
|
974
1007
|
f += p.size.value.toNumber();
|
|
975
|
-
|
|
1008
|
+
h ? n.items = s : f > D(n) && r.current !== "dragging" ? n.items = yt({
|
|
976
1009
|
...n,
|
|
977
1010
|
items: O({ ...n, items: s })
|
|
978
|
-
}).items : n.items = s,
|
|
1011
|
+
}).items : n.items = s, i.onResize();
|
|
979
1012
|
break;
|
|
980
1013
|
}
|
|
981
1014
|
case "setSize": {
|
|
982
|
-
n.size = c.size,
|
|
1015
|
+
n.size = c.size, i.onResize();
|
|
983
1016
|
break;
|
|
984
1017
|
}
|
|
985
1018
|
case "setOrientation":
|
|
986
|
-
n.orientation = c.orientation,
|
|
1019
|
+
n.orientation = c.orientation, i.clearLastKnownSize(), i.onResize();
|
|
987
1020
|
break;
|
|
988
1021
|
}
|
|
989
1022
|
if (r.current === "idle")
|
|
@@ -992,53 +1025,56 @@ function St(e, t) {
|
|
|
992
1025
|
u("dragging"), n.activeDragHandleId = c.handleId;
|
|
993
1026
|
break;
|
|
994
1027
|
case "setPanelPixelSize": {
|
|
995
|
-
|
|
996
|
-
const s =
|
|
997
|
-
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({
|
|
998
1031
|
context: n,
|
|
1032
|
+
panelId: c.panelId,
|
|
999
1033
|
direction: f.direction * (v ? 1 : -1),
|
|
1000
1034
|
handleId: f.item.id,
|
|
1001
|
-
delta:
|
|
1002
|
-
})),
|
|
1035
|
+
delta: g
|
|
1036
|
+
})), i.commit(), i.onResize(), i.onAutosave();
|
|
1003
1037
|
break;
|
|
1004
1038
|
}
|
|
1005
1039
|
case "collapsePanel":
|
|
1006
|
-
|
|
1007
|
-
|
|
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);
|
|
1008
1042
|
}));
|
|
1009
1043
|
break;
|
|
1010
1044
|
case "expandPanel":
|
|
1011
|
-
if (
|
|
1045
|
+
if (o.cannotExpandPanel(c))
|
|
1012
1046
|
break;
|
|
1013
|
-
|
|
1014
|
-
|
|
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);
|
|
1015
1049
|
}));
|
|
1016
1050
|
break;
|
|
1017
1051
|
}
|
|
1018
1052
|
else if (r.current === "dragging")
|
|
1019
1053
|
switch (c.type) {
|
|
1020
1054
|
case "dragHandle":
|
|
1021
|
-
|
|
1055
|
+
i.clearLastKnownSize(), se(n, oe(n, c)), i.onResize();
|
|
1022
1056
|
break;
|
|
1023
1057
|
case "dragHandleEnd":
|
|
1024
1058
|
u("idle");
|
|
1025
1059
|
break;
|
|
1026
1060
|
case "expandPanel":
|
|
1027
1061
|
case "collapsePanel":
|
|
1028
|
-
|
|
1062
|
+
o.shouldCollapseToggle(c) && i.runCollapseToggle(c);
|
|
1029
1063
|
break;
|
|
1030
1064
|
}
|
|
1031
1065
|
else if (r.current === "togglingCollapse")
|
|
1032
1066
|
switch (c.type) {
|
|
1033
1067
|
case "applyDelta":
|
|
1034
|
-
|
|
1068
|
+
se(n, oe(n, {
|
|
1069
|
+
panelId: c.panelId,
|
|
1035
1070
|
handleId: c.handleId,
|
|
1071
|
+
type: "collapsePanel",
|
|
1036
1072
|
disregardCollapseBuffer: !0,
|
|
1037
|
-
value:
|
|
1073
|
+
value: we({
|
|
1038
1074
|
delta: c.delta,
|
|
1039
1075
|
orientation: n.orientation
|
|
1040
1076
|
})
|
|
1041
|
-
})),
|
|
1077
|
+
})), i.onResize();
|
|
1042
1078
|
break;
|
|
1043
1079
|
}
|
|
1044
1080
|
t == null || t(n);
|
|
@@ -1046,7 +1082,7 @@ function St(e, t) {
|
|
|
1046
1082
|
}
|
|
1047
1083
|
return [n, d, r];
|
|
1048
1084
|
}
|
|
1049
|
-
function
|
|
1085
|
+
function At({ groupId: e, id: t, collapsible: a, collapsed: r }) {
|
|
1050
1086
|
const l = {
|
|
1051
1087
|
id: t,
|
|
1052
1088
|
"data-splitter-group-id": e,
|
|
@@ -1055,7 +1091,7 @@ function Ct({ groupId: e, id: t, collapsible: a, collapsed: r }) {
|
|
|
1055
1091
|
};
|
|
1056
1092
|
return a && (l["data-collapsed"] = r), l;
|
|
1057
1093
|
}
|
|
1058
|
-
function xt({ groupId: e, id: t, orientation: a, isDragging: r, activeDragHandleId: l, disabled: n, controlsId:
|
|
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 }) {
|
|
1059
1095
|
return {
|
|
1060
1096
|
id: t,
|
|
1061
1097
|
role: "separator",
|
|
@@ -1066,17 +1102,17 @@ function xt({ groupId: e, id: t, orientation: a, isDragging: r, activeDragHandle
|
|
|
1066
1102
|
"data-state": r ? "dragging" : l ? "inactive" : "idle",
|
|
1067
1103
|
"aria-label": "Resize Handle",
|
|
1068
1104
|
"aria-disabled": n,
|
|
1069
|
-
"aria-controls":
|
|
1070
|
-
"aria-valuemin":
|
|
1071
|
-
"aria-valuemax": u === "1fr" ? 100 : u ?
|
|
1072
|
-
"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
|
|
1073
1109
|
};
|
|
1074
1110
|
}
|
|
1075
|
-
function
|
|
1111
|
+
function Vt(e, t) {
|
|
1076
1112
|
const a = new ResizeObserver((l) => {
|
|
1077
1113
|
const n = {};
|
|
1078
|
-
for (const
|
|
1079
|
-
const u =
|
|
1114
|
+
for (const i of l) {
|
|
1115
|
+
const u = i.target.getAttribute("data-splitter-id"), d = i.borderBoxSize[0];
|
|
1080
1116
|
u && d && (n[u] = {
|
|
1081
1117
|
width: d.inlineSize,
|
|
1082
1118
|
height: d.blockSize
|
|
@@ -1090,9 +1126,9 @@ function At(e, t) {
|
|
|
1090
1126
|
a.disconnect();
|
|
1091
1127
|
};
|
|
1092
1128
|
}
|
|
1093
|
-
function
|
|
1094
|
-
const { onMoveStart: t, onMove: a, onMoveEnd: r } = e, l = { didMove: !1, lastPosition: null, id: null }, n = (s, f,
|
|
1095
|
-
|
|
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({
|
|
1096
1132
|
type: "movestart",
|
|
1097
1133
|
pointerType: f,
|
|
1098
1134
|
shiftKey: s.shiftKey,
|
|
@@ -1102,14 +1138,14 @@ function Vt(e) {
|
|
|
1102
1138
|
})), a == null || a({
|
|
1103
1139
|
type: "move",
|
|
1104
1140
|
pointerType: f,
|
|
1105
|
-
deltaX:
|
|
1141
|
+
deltaX: h,
|
|
1106
1142
|
deltaY: p,
|
|
1107
1143
|
shiftKey: s.shiftKey,
|
|
1108
1144
|
metaKey: s.metaKey,
|
|
1109
1145
|
ctrlKey: s.ctrlKey,
|
|
1110
1146
|
altKey: s.altKey
|
|
1111
1147
|
}));
|
|
1112
|
-
},
|
|
1148
|
+
}, i = (s, f) => {
|
|
1113
1149
|
l.didMove && (r == null || r({
|
|
1114
1150
|
type: "moveend",
|
|
1115
1151
|
pointerType: f,
|
|
@@ -1118,27 +1154,27 @@ function Vt(e) {
|
|
|
1118
1154
|
ctrlKey: s.ctrlKey,
|
|
1119
1155
|
altKey: s.altKey
|
|
1120
1156
|
}));
|
|
1121
|
-
},
|
|
1157
|
+
}, o = {}, u = () => {
|
|
1122
1158
|
l.didMove = !1;
|
|
1123
1159
|
}, d = (s) => {
|
|
1124
|
-
var f,
|
|
1160
|
+
var f, h;
|
|
1125
1161
|
if (s.pointerId === l.id) {
|
|
1126
1162
|
const p = s.pointerType || "mouse";
|
|
1127
|
-
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 };
|
|
1128
1164
|
}
|
|
1129
1165
|
}, c = (s) => {
|
|
1130
1166
|
if (s.pointerId === l.id) {
|
|
1131
1167
|
const f = s.pointerType || "mouse";
|
|
1132
|
-
|
|
1168
|
+
i(s, f), l.id = null, window.removeEventListener("pointermove", d, !1), window.removeEventListener("pointerup", c, !1), window.removeEventListener("pointercancel", c, !1);
|
|
1133
1169
|
}
|
|
1134
1170
|
};
|
|
1135
|
-
|
|
1171
|
+
o.onPointerDown = (s) => {
|
|
1136
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));
|
|
1137
1173
|
};
|
|
1138
|
-
const m = (s, f,
|
|
1139
|
-
u(), n(s, "keyboard", f,
|
|
1174
|
+
const m = (s, f, h) => {
|
|
1175
|
+
u(), n(s, "keyboard", f, h), i(s, "keyboard");
|
|
1140
1176
|
};
|
|
1141
|
-
return
|
|
1177
|
+
return o.onKeyDown = (s) => {
|
|
1142
1178
|
switch (s.key) {
|
|
1143
1179
|
case "Left":
|
|
1144
1180
|
case "ArrowLeft":
|
|
@@ -1157,9 +1193,9 @@ function Vt(e) {
|
|
|
1157
1193
|
s.preventDefault(), s.stopPropagation(), m(s, 0, 1);
|
|
1158
1194
|
break;
|
|
1159
1195
|
}
|
|
1160
|
-
}, { moveProps:
|
|
1196
|
+
}, { moveProps: o };
|
|
1161
1197
|
}
|
|
1162
|
-
const Et = /* @__PURE__ */
|
|
1198
|
+
const Et = /* @__PURE__ */ be({
|
|
1163
1199
|
__name: "Panel",
|
|
1164
1200
|
props: {
|
|
1165
1201
|
onResize: {},
|
|
@@ -1180,17 +1216,17 @@ const Et = /* @__PURE__ */ ze({
|
|
|
1180
1216
|
min: r,
|
|
1181
1217
|
max: l,
|
|
1182
1218
|
id: n,
|
|
1183
|
-
collapsible:
|
|
1184
|
-
collapsedSize:
|
|
1219
|
+
collapsible: i,
|
|
1220
|
+
collapsedSize: o,
|
|
1185
1221
|
onCollapseChange: u,
|
|
1186
1222
|
collapseAnimation: d,
|
|
1187
1223
|
onResize: c,
|
|
1188
1224
|
defaultCollapsed: m,
|
|
1189
1225
|
default: s,
|
|
1190
1226
|
isStaticAtRest: f,
|
|
1191
|
-
collapsed:
|
|
1227
|
+
collapsed: h,
|
|
1192
1228
|
...p
|
|
1193
|
-
} = a, v = n ||
|
|
1229
|
+
} = a, v = n || Ie(), g = X("send"), z = X("state"), S = X("isPrerender"), x = () => dt({
|
|
1194
1230
|
id: v,
|
|
1195
1231
|
min: a.min,
|
|
1196
1232
|
max: a.max,
|
|
@@ -1203,81 +1239,87 @@ const Et = /* @__PURE__ */ ze({
|
|
|
1203
1239
|
defaultCollapsed: m,
|
|
1204
1240
|
default: s,
|
|
1205
1241
|
isStaticAtRest: f
|
|
1206
|
-
}),
|
|
1207
|
-
var
|
|
1208
|
-
const w = (
|
|
1209
|
-
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)))
|
|
1210
1246
|
return w;
|
|
1211
1247
|
});
|
|
1212
|
-
let
|
|
1213
|
-
|
|
1248
|
+
let R = !1;
|
|
1249
|
+
C.value ? g == null || g({
|
|
1214
1250
|
type: "rebindPanelCallbacks",
|
|
1215
1251
|
data: {
|
|
1216
1252
|
id: v,
|
|
1217
1253
|
onCollapseChange: a.onCollapseChange ? { current: a.onCollapseChange } : void 0,
|
|
1218
1254
|
onResize: a.onResize ? { current: a.onResize } : void 0
|
|
1219
1255
|
}
|
|
1220
|
-
}) :
|
|
1256
|
+
}) : S != null && S.value ? g == null || g({ type: "registerPanel", data: x() }) : R = !0, G(() => {
|
|
1221
1257
|
var le;
|
|
1222
1258
|
const w = (le = z == null ? void 0 : z.value) == null ? void 0 : le.groupId;
|
|
1223
|
-
if (!w || !
|
|
1224
|
-
const
|
|
1225
|
-
if (!
|
|
1259
|
+
if (!w || !R) return;
|
|
1260
|
+
const P = document.getElementById(w);
|
|
1261
|
+
if (!P) return;
|
|
1226
1262
|
const U = document.getElementById(v);
|
|
1227
1263
|
if (!U) return;
|
|
1228
|
-
const re = Array.from(
|
|
1229
|
-
typeof re == "number" && (
|
|
1264
|
+
const re = Array.from(P.children).indexOf(U);
|
|
1265
|
+
typeof re == "number" && (g == null || g({
|
|
1230
1266
|
type: "registerDynamicPanel",
|
|
1231
|
-
data: { ...
|
|
1232
|
-
}),
|
|
1267
|
+
data: { ...x(), order: re }
|
|
1268
|
+
}), R = !1);
|
|
1233
1269
|
});
|
|
1234
|
-
const
|
|
1235
|
-
() => !
|
|
1270
|
+
const K = $(
|
|
1271
|
+
() => !R && ft(x(), C.value)
|
|
1236
1272
|
);
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
}),
|
|
1240
|
-
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 }));
|
|
1241
1277
|
}), t({
|
|
1242
1278
|
getId: () => v,
|
|
1243
|
-
collapse: () => {
|
|
1279
|
+
collapse: async () => {
|
|
1244
1280
|
var w;
|
|
1245
|
-
(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
|
+
});
|
|
1246
1285
|
},
|
|
1247
1286
|
isCollapsed: () => {
|
|
1248
|
-
var w,
|
|
1249
|
-
return !!((w =
|
|
1287
|
+
var w, P;
|
|
1288
|
+
return !!((w = C.value) != null && w.collapsible && ((P = C.value) != null && P.collapsed));
|
|
1250
1289
|
},
|
|
1251
|
-
expand: () => {
|
|
1290
|
+
expand: async () => {
|
|
1252
1291
|
var w;
|
|
1253
|
-
(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
|
+
});
|
|
1254
1296
|
},
|
|
1255
1297
|
isExpanded: () => {
|
|
1256
|
-
var w,
|
|
1257
|
-
return !!((w =
|
|
1298
|
+
var w, P;
|
|
1299
|
+
return !!((w = C.value) != null && w.collapsible && !((P = C.value) != null && P.collapsed));
|
|
1258
1300
|
},
|
|
1259
|
-
getPixelSize: () =>
|
|
1260
|
-
getPercentageSize: () =>
|
|
1261
|
-
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 })
|
|
1262
1304
|
});
|
|
1263
|
-
const M =
|
|
1305
|
+
const M = $(
|
|
1264
1306
|
() => {
|
|
1265
1307
|
var w;
|
|
1266
|
-
return (w =
|
|
1308
|
+
return (w = C.value) == null ? void 0 : w.collapseIsControlled;
|
|
1267
1309
|
}
|
|
1268
1310
|
);
|
|
1269
|
-
|
|
1311
|
+
ue(() => {
|
|
1270
1312
|
a.collapsed, requestAnimationFrame(() => {
|
|
1271
|
-
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 }));
|
|
1272
1314
|
});
|
|
1273
1315
|
});
|
|
1274
|
-
const
|
|
1275
|
-
var
|
|
1276
|
-
const w =
|
|
1316
|
+
const V = $(() => {
|
|
1317
|
+
var P;
|
|
1318
|
+
const w = C.value;
|
|
1277
1319
|
return {
|
|
1278
1320
|
...p,
|
|
1279
|
-
...
|
|
1280
|
-
groupId: (
|
|
1321
|
+
...At({
|
|
1322
|
+
groupId: (P = z == null ? void 0 : z.value) == null ? void 0 : P.groupId,
|
|
1281
1323
|
id: v,
|
|
1282
1324
|
collapsible: w == null ? void 0 : w.collapsible,
|
|
1283
1325
|
collapsed: w == null ? void 0 : w.collapsed
|
|
@@ -1289,44 +1331,46 @@ const Et = /* @__PURE__ */ ze({
|
|
|
1289
1331
|
}
|
|
1290
1332
|
};
|
|
1291
1333
|
});
|
|
1292
|
-
return (w,
|
|
1293
|
-
|
|
1334
|
+
return (w, P) => (Pe(), ye("div", Te(je(V.value)), [
|
|
1335
|
+
Se(w.$slots, "default")
|
|
1294
1336
|
], 16));
|
|
1295
1337
|
}
|
|
1296
|
-
}), Rt = ["id"],
|
|
1338
|
+
}), Rt = ["id"], Kt = /* @__PURE__ */ be({
|
|
1297
1339
|
__name: "PanelGroup",
|
|
1298
1340
|
props: {
|
|
1299
1341
|
snapshot: {},
|
|
1300
1342
|
autosaveId: {},
|
|
1301
1343
|
orientation: { default: "horizontal" },
|
|
1302
1344
|
autosaveStrategy: { default: "localStorage" },
|
|
1345
|
+
shiftAmount: {},
|
|
1303
1346
|
id: {}
|
|
1304
1347
|
},
|
|
1305
1348
|
setup(e, { expose: t }) {
|
|
1306
|
-
const a =
|
|
1349
|
+
const a = Ee(e, ["orientation", "autosaveStrategy", "snapshot", "autosaveId", "id", "shiftAmount"]);
|
|
1307
1350
|
let r = e.snapshot;
|
|
1308
1351
|
if (!r && typeof window < "u" && e.autosaveId && e.autosaveStrategy === "localStorage") {
|
|
1309
1352
|
const f = localStorage.getItem(e.autosaveId);
|
|
1310
1353
|
f && (r = JSON.parse(f));
|
|
1311
1354
|
}
|
|
1312
|
-
const l =
|
|
1313
|
-
|
|
1314
|
-
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(
|
|
1315
1358
|
{
|
|
1316
1359
|
orientation: e.orientation,
|
|
1317
1360
|
groupId: n,
|
|
1318
1361
|
autosaveStrategy: e.autosaveStrategy,
|
|
1319
|
-
|
|
1362
|
+
shiftAmount: e.shiftAmount,
|
|
1363
|
+
...r ? ct(r) : void 0
|
|
1320
1364
|
},
|
|
1321
1365
|
(f) => {
|
|
1322
1366
|
d.value = { ...f };
|
|
1323
1367
|
}
|
|
1324
1368
|
);
|
|
1325
|
-
|
|
1369
|
+
G(() => {
|
|
1326
1370
|
l.value = !1;
|
|
1327
1371
|
});
|
|
1328
|
-
const d =
|
|
1329
|
-
const f =
|
|
1372
|
+
const d = me(i), c = $(() => {
|
|
1373
|
+
const f = De(d.value);
|
|
1330
1374
|
return {
|
|
1331
1375
|
height: "100%",
|
|
1332
1376
|
display: "grid",
|
|
@@ -1334,59 +1378,59 @@ const Et = /* @__PURE__ */ ze({
|
|
|
1334
1378
|
gridTemplateRows: e.orientation === "vertical" ? f : void 0
|
|
1335
1379
|
};
|
|
1336
1380
|
});
|
|
1337
|
-
|
|
1338
|
-
const m =
|
|
1339
|
-
|
|
1340
|
-
const f = new ResizeObserver(([
|
|
1341
|
-
|
|
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 }));
|
|
1342
1386
|
});
|
|
1343
1387
|
return m.value && f.observe(m.value), () => f.disconnect();
|
|
1344
1388
|
});
|
|
1345
|
-
const s =
|
|
1389
|
+
const s = $(
|
|
1346
1390
|
() => {
|
|
1347
1391
|
var f;
|
|
1348
|
-
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(",");
|
|
1349
1393
|
}
|
|
1350
1394
|
);
|
|
1351
|
-
return
|
|
1352
|
-
|
|
1395
|
+
return G(() => {
|
|
1396
|
+
ue(() => {
|
|
1353
1397
|
s.value;
|
|
1354
|
-
const f =
|
|
1355
|
-
|
|
1398
|
+
const f = Vt(n, (h) => {
|
|
1399
|
+
o({ type: "setActualItemsSize", childrenSizes: h });
|
|
1356
1400
|
});
|
|
1357
|
-
|
|
1401
|
+
We(f);
|
|
1358
1402
|
});
|
|
1359
|
-
}),
|
|
1403
|
+
}), G(() => (o({ type: "unlockGroup" }), () => o({ type: "lockGroup" }))), t({
|
|
1360
1404
|
getId: () => n,
|
|
1361
|
-
getPixelSizes: () =>
|
|
1362
|
-
getPercentageSizes: () =>
|
|
1363
|
-
getTemplate: () =>
|
|
1405
|
+
getPixelSizes: () => wt(d.value),
|
|
1406
|
+
getPercentageSizes: () => bt(d.value),
|
|
1407
|
+
getTemplate: () => De({
|
|
1364
1408
|
...d.value,
|
|
1365
1409
|
items: O(d.value)
|
|
1366
1410
|
}),
|
|
1367
1411
|
getState: () => u.current === "idle" ? "idle" : "dragging",
|
|
1368
1412
|
setSizes: (f) => {
|
|
1369
|
-
var
|
|
1413
|
+
var h;
|
|
1370
1414
|
for (let p = 0; p < f.length; p++) {
|
|
1371
|
-
const v = (
|
|
1372
|
-
v &&
|
|
1415
|
+
const v = (h = d.value) == null ? void 0 : h.items[p], g = f[p];
|
|
1416
|
+
v && y(v) && g && o({
|
|
1373
1417
|
type: "setPanelPixelSize",
|
|
1374
1418
|
panelId: v.id,
|
|
1375
|
-
size:
|
|
1419
|
+
size: g
|
|
1376
1420
|
});
|
|
1377
1421
|
}
|
|
1378
1422
|
}
|
|
1379
|
-
}), (f,
|
|
1423
|
+
}), (f, h) => (Pe(), ye("div", Ke(a, {
|
|
1380
1424
|
id: Ue(n),
|
|
1381
1425
|
ref_key: "elementRef",
|
|
1382
1426
|
ref: m,
|
|
1383
1427
|
"data-panel-group-wrapper": "",
|
|
1384
1428
|
style: c.value
|
|
1385
1429
|
}), [
|
|
1386
|
-
|
|
1430
|
+
Se(f.$slots, "default")
|
|
1387
1431
|
], 16, Rt));
|
|
1388
1432
|
}
|
|
1389
|
-
}),
|
|
1433
|
+
}), kt = ["tabindex"], Nt = /* @__PURE__ */ be({
|
|
1390
1434
|
__name: "PanelResizer",
|
|
1391
1435
|
props: {
|
|
1392
1436
|
disabled: { type: Boolean },
|
|
@@ -1398,95 +1442,95 @@ const Et = /* @__PURE__ */ ze({
|
|
|
1398
1442
|
id: {}
|
|
1399
1443
|
},
|
|
1400
1444
|
setup(e) {
|
|
1401
|
-
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 = $(() => {
|
|
1402
1446
|
var p;
|
|
1403
|
-
const
|
|
1404
|
-
if (!(!
|
|
1405
|
-
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;
|
|
1406
1450
|
});
|
|
1407
1451
|
let d = !1;
|
|
1408
|
-
u.value || (
|
|
1409
|
-
var z,
|
|
1452
|
+
u.value || (i != null && i.value ? l == null || l({ type: "registerPanelHandle", data: o() }) : d = !0), G(() => {
|
|
1453
|
+
var z, S;
|
|
1410
1454
|
if (!((z = n == null ? void 0 : n.value) == null ? void 0 : z.groupId) || !d) return;
|
|
1411
|
-
const p = document.getElementById((
|
|
1455
|
+
const p = document.getElementById((S = n == null ? void 0 : n.value) == null ? void 0 : S.groupId);
|
|
1412
1456
|
if (!p) return;
|
|
1413
1457
|
const v = document.getElementById(r);
|
|
1414
1458
|
if (!v) return;
|
|
1415
|
-
const
|
|
1416
|
-
typeof
|
|
1459
|
+
const g = Array.from(p.children).indexOf(v);
|
|
1460
|
+
typeof g == "number" && (l == null || l({
|
|
1417
1461
|
type: "registerPanelHandle",
|
|
1418
|
-
data: { ...
|
|
1462
|
+
data: { ...o(), order: g }
|
|
1419
1463
|
}), d = !1);
|
|
1420
1464
|
});
|
|
1421
|
-
const c =
|
|
1422
|
-
() => !d &&
|
|
1465
|
+
const c = $(
|
|
1466
|
+
() => !d && pt(o(), u.value)
|
|
1423
1467
|
);
|
|
1424
|
-
|
|
1425
|
-
c.value && (l == null || l({ type: "updateConstraints", data:
|
|
1426
|
-
}),
|
|
1468
|
+
ue(() => {
|
|
1469
|
+
c.value && (l == null || l({ type: "updateConstraints", data: o() }));
|
|
1470
|
+
}), Be(() => {
|
|
1427
1471
|
requestAnimationFrame(() => l == null ? void 0 : l({ type: "unregisterPanelHandle", id: r }));
|
|
1428
1472
|
});
|
|
1429
|
-
const { moveProps: m } =
|
|
1473
|
+
const { moveProps: m } = Dt({
|
|
1430
1474
|
onMoveStart: () => {
|
|
1431
|
-
var
|
|
1432
|
-
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");
|
|
1433
1477
|
},
|
|
1434
|
-
onMove: (
|
|
1478
|
+
onMove: (h) => {
|
|
1435
1479
|
var p;
|
|
1436
|
-
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);
|
|
1437
1481
|
},
|
|
1438
1482
|
onMoveEnd: () => {
|
|
1439
|
-
var
|
|
1440
|
-
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";
|
|
1441
1485
|
}
|
|
1442
|
-
}), s = (
|
|
1486
|
+
}), s = (h) => {
|
|
1443
1487
|
if (n != null && n.value)
|
|
1444
1488
|
try {
|
|
1445
|
-
const p =
|
|
1446
|
-
|
|
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 }));
|
|
1447
1491
|
} catch {
|
|
1448
1492
|
}
|
|
1449
|
-
}, f =
|
|
1450
|
-
var
|
|
1451
|
-
const
|
|
1452
|
-
if (!
|
|
1453
|
-
const p = (z = n == null ? void 0 : n.value) == null ? void 0 : z.items[
|
|
1454
|
-
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 } : {
|
|
1455
1499
|
...t,
|
|
1456
1500
|
...xt({
|
|
1457
|
-
groupId: (
|
|
1501
|
+
groupId: (x = n == null ? void 0 : n.value) == null ? void 0 : x.groupId,
|
|
1458
1502
|
id: r,
|
|
1459
|
-
orientation: ((
|
|
1460
|
-
isDragging: ((
|
|
1461
|
-
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,
|
|
1462
1506
|
disabled: e.disabled,
|
|
1463
1507
|
controlsId: v.id,
|
|
1464
1508
|
min: v.min,
|
|
1465
1509
|
max: v.max,
|
|
1466
1510
|
currentValue: v.currentValue,
|
|
1467
|
-
groupSize:
|
|
1511
|
+
groupSize: D(n.value)
|
|
1468
1512
|
}),
|
|
1469
1513
|
onpointerdown: e.disabled ? void 0 : m.onPointerDown,
|
|
1470
1514
|
onkeydown: e.disabled ? void 0 : (w) => {
|
|
1471
1515
|
m.onKeyDown(w), s(w);
|
|
1472
1516
|
},
|
|
1473
1517
|
style: {
|
|
1474
|
-
cursor: n != null && n.value ?
|
|
1518
|
+
cursor: n != null && n.value ? Ve(n.value) : void 0,
|
|
1475
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%",
|
|
1476
|
-
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%"
|
|
1477
1521
|
}
|
|
1478
1522
|
};
|
|
1479
1523
|
});
|
|
1480
|
-
return (
|
|
1481
|
-
tabindex:
|
|
1524
|
+
return (h, p) => (Pe(), ye("div", Ke(f.value, {
|
|
1525
|
+
tabindex: h.disabled ? -1 : 0
|
|
1482
1526
|
}), [
|
|
1483
|
-
|
|
1484
|
-
], 16,
|
|
1527
|
+
Se(h.$slots, "default")
|
|
1528
|
+
], 16, kt));
|
|
1485
1529
|
}
|
|
1486
1530
|
});
|
|
1487
1531
|
export {
|
|
1488
1532
|
Et as Panel,
|
|
1489
|
-
|
|
1490
|
-
|
|
1533
|
+
Kt as PanelGroup,
|
|
1534
|
+
Nt as PanelResizer
|
|
1491
1535
|
};
|
|
1492
1536
|
//# sourceMappingURL=index.mjs.map
|