react-state-custom 1.0.27 → 1.0.28
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/README.md +2 -0
- package/dist/index.es.js +527 -393
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/react-state-custom.css +1 -1
- package/dist/state-utils/createAutoCtx.d.ts +2 -1
- package/dist/state-utils/createRootCtx.d.ts +2 -1
- package/dist/state-utils/paramsToId.d.ts +3 -1
- package/package.json +5 -4
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { jsx as v, Fragment as $, jsxs as
|
|
3
|
-
var
|
|
1
|
+
import D, { useRef as P, useMemo as x, useEffect as w, useState as N, useCallback as ee, Fragment as te, useContext as se } from "react";
|
|
2
|
+
import { jsx as v, Fragment as $, jsxs as R } from "react/jsx-runtime";
|
|
3
|
+
var j = { exports: {} }, A = {};
|
|
4
4
|
/**
|
|
5
5
|
* @license React
|
|
6
6
|
* react-compiler-runtime.production.js
|
|
@@ -10,16 +10,16 @@ var L = { exports: {} }, U = {};
|
|
|
10
10
|
* This source code is licensed under the MIT license found in the
|
|
11
11
|
* LICENSE file in the root directory of this source tree.
|
|
12
12
|
*/
|
|
13
|
-
var
|
|
14
|
-
function
|
|
15
|
-
if (
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
return
|
|
19
|
-
return
|
|
20
|
-
},
|
|
13
|
+
var B;
|
|
14
|
+
function ne() {
|
|
15
|
+
if (B) return A;
|
|
16
|
+
B = 1;
|
|
17
|
+
var n = D.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
18
|
+
return A.c = function(e) {
|
|
19
|
+
return n.H.useMemoCache(e);
|
|
20
|
+
}, A;
|
|
21
21
|
}
|
|
22
|
-
var
|
|
22
|
+
var K = {};
|
|
23
23
|
/**
|
|
24
24
|
* @license React
|
|
25
25
|
* react-compiler-runtime.development.js
|
|
@@ -29,12 +29,12 @@ var V = {};
|
|
|
29
29
|
* This source code is licensed under the MIT license found in the
|
|
30
30
|
* LICENSE file in the root directory of this source tree.
|
|
31
31
|
*/
|
|
32
|
-
var
|
|
33
|
-
function
|
|
34
|
-
return
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
var t =
|
|
32
|
+
var V;
|
|
33
|
+
function ie() {
|
|
34
|
+
return V || (V = 1, process.env.NODE_ENV !== "production" && function() {
|
|
35
|
+
var n = D.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
36
|
+
K.c = function(e) {
|
|
37
|
+
var t = n.H;
|
|
38
38
|
return t === null && console.error(
|
|
39
39
|
`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
40
40
|
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
@@ -43,50 +43,50 @@ function ne() {
|
|
|
43
43
|
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`
|
|
44
44
|
), t.useMemoCache(e);
|
|
45
45
|
};
|
|
46
|
-
}()),
|
|
46
|
+
}()), K;
|
|
47
47
|
}
|
|
48
|
-
var
|
|
49
|
-
function
|
|
50
|
-
return
|
|
48
|
+
var I;
|
|
49
|
+
function re() {
|
|
50
|
+
return I || (I = 1, process.env.NODE_ENV === "production" ? j.exports = ne() : j.exports = ie()), j.exports;
|
|
51
51
|
}
|
|
52
|
-
var
|
|
53
|
-
function
|
|
54
|
-
let t = null,
|
|
52
|
+
var _ = re();
|
|
53
|
+
function H(n, e) {
|
|
54
|
+
let t = null, s = function(...r) {
|
|
55
55
|
t && clearTimeout(t), t = setTimeout(() => {
|
|
56
|
-
|
|
56
|
+
n(...r);
|
|
57
57
|
}, e);
|
|
58
58
|
};
|
|
59
|
-
return
|
|
59
|
+
return s.cancel = () => clearTimeout(t), s;
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
const e = /* @__PURE__ */ new Map(), t = function(...
|
|
63
|
-
const
|
|
64
|
-
if (e.has(
|
|
65
|
-
return e.get(
|
|
66
|
-
const
|
|
67
|
-
return e.set(
|
|
61
|
+
function oe(n) {
|
|
62
|
+
const e = /* @__PURE__ */ new Map(), t = function(...s) {
|
|
63
|
+
const r = JSON.stringify(s);
|
|
64
|
+
if (e.has(r))
|
|
65
|
+
return e.get(r);
|
|
66
|
+
const i = n(...s);
|
|
67
|
+
return e.set(r, i), i;
|
|
68
68
|
};
|
|
69
69
|
return t.cache = e, t;
|
|
70
70
|
}
|
|
71
|
-
const
|
|
71
|
+
const F = () => Math.random().toString().slice(2), ae = (n) => {
|
|
72
72
|
const e = P({
|
|
73
73
|
values: [],
|
|
74
|
-
id:
|
|
74
|
+
id: F()
|
|
75
75
|
});
|
|
76
76
|
let t = !1;
|
|
77
|
-
return t = t || !
|
|
78
|
-
},
|
|
79
|
-
class
|
|
77
|
+
return t = t || !n != !e.current.values, t = t || n?.length != e.current.values?.length, t = t || n?.some((s, r) => s != e.current.values[r]), t && (e.current.values = n, e.current.id = F()), e.current.id;
|
|
78
|
+
}, M = "@--change-event";
|
|
79
|
+
class le extends Event {
|
|
80
80
|
constructor(e, t) {
|
|
81
81
|
super(String(e)), this.event = e, this.value = t;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
class
|
|
84
|
+
class G extends Event {
|
|
85
85
|
constructor(e) {
|
|
86
|
-
super(
|
|
86
|
+
super(M, e), this.value = e;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
class
|
|
89
|
+
class ce extends EventTarget {
|
|
90
90
|
/**
|
|
91
91
|
* Create a new Context instance.
|
|
92
92
|
* @param name - The name of the context (for debugging).
|
|
@@ -111,8 +111,8 @@ class ie extends EventTarget {
|
|
|
111
111
|
publish(e, t) {
|
|
112
112
|
if (t != this.data[e]) {
|
|
113
113
|
this.data[e] = t;
|
|
114
|
-
let
|
|
115
|
-
this.dispatchEvent(
|
|
114
|
+
let s = new le(e, t);
|
|
115
|
+
this.dispatchEvent(s), this.dispatchEvent(new G(s));
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
/**
|
|
@@ -122,249 +122,249 @@ class ie extends EventTarget {
|
|
|
122
122
|
* @returns Unsubscribe function.
|
|
123
123
|
*/
|
|
124
124
|
subscribe(e, t) {
|
|
125
|
-
const
|
|
126
|
-
event:
|
|
127
|
-
value:
|
|
125
|
+
const s = ({
|
|
126
|
+
event: r,
|
|
127
|
+
value: i
|
|
128
128
|
}) => {
|
|
129
|
-
t(
|
|
129
|
+
t(i);
|
|
130
130
|
};
|
|
131
|
-
return this.addEventListener(String(e),
|
|
131
|
+
return this.addEventListener(String(e), s), e in this.data && t(this.data[e]), () => this.removeEventListener(String(e), s);
|
|
132
132
|
}
|
|
133
133
|
subscribeAll(e) {
|
|
134
|
-
const t = (
|
|
135
|
-
if (
|
|
134
|
+
const t = (s) => {
|
|
135
|
+
if (s instanceof G) {
|
|
136
136
|
const {
|
|
137
|
-
value:
|
|
138
|
-
} =
|
|
139
|
-
e(
|
|
137
|
+
value: r
|
|
138
|
+
} = s;
|
|
139
|
+
e(r.event, this.data);
|
|
140
140
|
}
|
|
141
141
|
};
|
|
142
|
-
return this.addEventListener(String(
|
|
142
|
+
return this.addEventListener(String(M), t), () => this.removeEventListener(String(M), t);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
const
|
|
146
|
-
const e =
|
|
147
|
-
return
|
|
145
|
+
const k = oe((n) => new ce(n)), z = (n = "noname") => {
|
|
146
|
+
const e = x(() => k(n), [n]);
|
|
147
|
+
return w(() => (e.useCounter += 1, () => {
|
|
148
148
|
e.useCounter -= 1, e.useCounter <= 0 && setTimeout(() => {
|
|
149
|
-
e.useCounter <= 0 &&
|
|
149
|
+
e.useCounter <= 0 && k.cache.delete(JSON.stringify([n]));
|
|
150
150
|
}, 100);
|
|
151
151
|
}), [e]), e;
|
|
152
|
-
},
|
|
153
|
-
const t =
|
|
152
|
+
}, Y = (n, ...e) => {
|
|
153
|
+
const t = _.c(6), s = e;
|
|
154
154
|
new Error("[ctx] useRegistryChecker failed " + JSON.stringify({
|
|
155
|
-
names:
|
|
156
|
-
ctx:
|
|
155
|
+
names: s,
|
|
156
|
+
ctx: n?.name ?? "undefined"
|
|
157
157
|
}));
|
|
158
|
-
let a;
|
|
159
|
-
t[0] !== s || t[1] !== n ? (a = () => {
|
|
160
|
-
if (s)
|
|
161
|
-
return n.some((l) => s.registry.has(l)), n.forEach((l) => s.registry.add(l)), () => {
|
|
162
|
-
n.forEach((l) => s.registry.delete(l));
|
|
163
|
-
};
|
|
164
|
-
}, t[0] = s, t[1] = n, t[2] = a) : a = t[2];
|
|
165
|
-
let r;
|
|
166
|
-
t[3] !== s || t[4] !== n.length ? (r = [s, n.length], t[3] = s, t[4] = n.length, t[5] = r) : r = t[5], g(a, r);
|
|
167
|
-
}, ke = (s, e, t) => {
|
|
168
|
-
const n = C.c(5);
|
|
169
|
-
let a, r;
|
|
170
|
-
n[0] !== s || n[1] !== e || n[2] !== t ? (a = () => {
|
|
171
|
-
s && s.data[e] != t && s.publish(e, t);
|
|
172
|
-
}, r = [e, t, s], n[0] = s, n[1] = e, n[2] = t, n[3] = a, n[4] = r) : (a = n[3], r = n[4]), g(a, r), W(s, e);
|
|
173
|
-
}, le = (s, e, t) => {
|
|
174
|
-
const n = C.c(11), a = t === void 0 ? 0 : t;
|
|
175
158
|
let r;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
159
|
+
t[0] !== n || t[1] !== s ? (r = () => {
|
|
160
|
+
if (n)
|
|
161
|
+
return s.some((l) => n.registry.has(l)), s.forEach((l) => n.registry.add(l)), () => {
|
|
162
|
+
s.forEach((l) => n.registry.delete(l));
|
|
163
|
+
};
|
|
164
|
+
}, t[0] = n, t[1] = s, t[2] = r) : r = t[2];
|
|
165
|
+
let i;
|
|
166
|
+
t[3] !== n || t[4] !== s.length ? (i = [n, s.length], t[3] = n, t[4] = s.length, t[5] = i) : i = t[5], w(r, i);
|
|
167
|
+
}, ke = (n, e, t) => {
|
|
168
|
+
const s = _.c(5);
|
|
169
|
+
let r, i;
|
|
170
|
+
s[0] !== n || s[1] !== e || s[2] !== t ? (r = () => {
|
|
171
|
+
n && n.data[e] != t && n.publish(e, t);
|
|
172
|
+
}, i = [e, t, n], s[0] = n, s[1] = e, s[2] = t, s[3] = r, s[4] = i) : (r = s[3], i = s[4]), w(r, i), Y(n, e);
|
|
173
|
+
}, ue = (n, e, t) => {
|
|
174
|
+
const s = _.c(11), r = t === void 0 ? 0 : t;
|
|
175
|
+
let i;
|
|
176
|
+
s[0] !== n?.data || s[1] !== e ? (i = () => ({
|
|
177
|
+
value: n?.data?.[e]
|
|
178
|
+
}), s[0] = n?.data, s[1] = e, s[2] = i) : i = s[2];
|
|
179
|
+
const [l, a] = N(i), {
|
|
180
180
|
value: o
|
|
181
181
|
} = l;
|
|
182
182
|
let u;
|
|
183
|
-
|
|
184
|
-
if (
|
|
185
|
-
const d =
|
|
183
|
+
s[3] !== n || s[4] !== r || s[5] !== e || s[6] !== o ? (u = () => {
|
|
184
|
+
if (n) {
|
|
185
|
+
const d = r == 0 ? (m) => a({
|
|
186
186
|
value: m
|
|
187
|
-
}) :
|
|
187
|
+
}) : H((m) => a({
|
|
188
188
|
value: m
|
|
189
|
-
}),
|
|
190
|
-
return o !=
|
|
191
|
-
value:
|
|
189
|
+
}), r), f = n.subscribe(e, d);
|
|
190
|
+
return o != n.data[e] && a({
|
|
191
|
+
value: n.data[e]
|
|
192
192
|
}), () => {
|
|
193
193
|
f();
|
|
194
194
|
};
|
|
195
195
|
}
|
|
196
|
-
},
|
|
196
|
+
}, s[3] = n, s[4] = r, s[5] = e, s[6] = o, s[7] = u) : u = s[7];
|
|
197
197
|
let c;
|
|
198
|
-
return
|
|
199
|
-
},
|
|
200
|
-
const [,
|
|
201
|
-
return
|
|
202
|
-
if (
|
|
203
|
-
let
|
|
204
|
-
let o = t(
|
|
205
|
-
o !=
|
|
206
|
-
},
|
|
207
|
-
return l(), () =>
|
|
198
|
+
return s[8] !== n || s[9] !== e ? (c = [e, n], s[8] = n, s[9] = e, s[10] = c) : c = s[10], w(u, c), n?.data[e];
|
|
199
|
+
}, We = (n, e, t) => {
|
|
200
|
+
const [, s] = N(0), r = x(() => t(n?.data[e]), [t, n?.data[e]]);
|
|
201
|
+
return w(() => {
|
|
202
|
+
if (n) {
|
|
203
|
+
let i = r, l = () => {
|
|
204
|
+
let o = t(n.data[e]);
|
|
205
|
+
o != i && (i = o, s((u) => u + 1));
|
|
206
|
+
}, a = n.subscribe(e, l);
|
|
207
|
+
return l(), () => a();
|
|
208
208
|
}
|
|
209
|
-
}, [e,
|
|
210
|
-
},
|
|
211
|
-
|
|
212
|
-
if (
|
|
213
|
-
for (let [t,
|
|
214
|
-
|
|
215
|
-
}, [
|
|
216
|
-
},
|
|
217
|
-
const t =
|
|
218
|
-
let
|
|
219
|
-
if (t[0] !==
|
|
209
|
+
}, [e, n]), r;
|
|
210
|
+
}, q = (n, ...e) => {
|
|
211
|
+
w(() => {
|
|
212
|
+
if (n)
|
|
213
|
+
for (let [t, s] of e)
|
|
214
|
+
n.data[t] != s && n.publish(t, s);
|
|
215
|
+
}, [n, ae(e.flat())]), Y(n, ...e.map((t) => t[0]));
|
|
216
|
+
}, je = (n, ...e) => {
|
|
217
|
+
const t = _.c(18), s = e, [, r] = N(0);
|
|
218
|
+
let i;
|
|
219
|
+
if (t[0] !== n?.data || t[1] !== s) {
|
|
220
220
|
let c;
|
|
221
|
-
t[3] !==
|
|
221
|
+
t[3] !== n?.data ? (c = (d) => n?.data?.[d], t[3] = n?.data, t[4] = c) : c = t[4], i = s.map(c), t[0] = n?.data, t[1] = s, t[2] = i;
|
|
222
222
|
} else
|
|
223
|
-
|
|
224
|
-
const l =
|
|
225
|
-
let
|
|
226
|
-
t[5] !==
|
|
227
|
-
if (
|
|
223
|
+
i = t[2];
|
|
224
|
+
const l = i;
|
|
225
|
+
let a;
|
|
226
|
+
t[5] !== n || t[6] !== s || t[7] !== l || t[8] !== r ? (a = () => {
|
|
227
|
+
if (n) {
|
|
228
228
|
let c = l;
|
|
229
|
-
const d =
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
}, 1), f =
|
|
229
|
+
const d = H(() => {
|
|
230
|
+
const g = s.map((h) => n?.data?.[h]);
|
|
231
|
+
s.some((h, p) => c[p] != g[p]) && (c = g, r(he));
|
|
232
|
+
}, 1), f = s.map((g) => n.subscribe(g, d)), m = setTimeout(d, 1);
|
|
233
233
|
return () => {
|
|
234
|
-
clearTimeout(m), d.cancel(), f.forEach(
|
|
234
|
+
clearTimeout(m), d.cancel(), f.forEach(de);
|
|
235
235
|
};
|
|
236
236
|
}
|
|
237
|
-
}, t[5] =
|
|
237
|
+
}, t[5] = n, t[6] = s, t[7] = l, t[8] = r, t[9] = a) : a = t[9];
|
|
238
238
|
let o;
|
|
239
|
-
t[10] !==
|
|
239
|
+
t[10] !== n || t[11] !== s ? (o = [n, ...s], t[10] = n, t[11] = s, t[12] = o) : o = t[12], w(a, o);
|
|
240
240
|
let u;
|
|
241
|
-
if (t[13] !==
|
|
241
|
+
if (t[13] !== s || t[14] !== l) {
|
|
242
242
|
let c;
|
|
243
|
-
t[16] !== l ? (c = (d, f) => [d, l[f]], t[16] = l, t[17] = c) : c = t[17], u = Object.fromEntries(
|
|
243
|
+
t[16] !== l ? (c = (d, f) => [d, l[f]], t[16] = l, t[17] = c) : c = t[17], u = Object.fromEntries(s.map(c)), t[13] = s, t[14] = l, t[15] = u;
|
|
244
244
|
} else
|
|
245
245
|
u = t[15];
|
|
246
246
|
return u;
|
|
247
|
-
},
|
|
248
|
-
const
|
|
249
|
-
let
|
|
250
|
-
if (
|
|
247
|
+
}, Le = (n, e, ...t) => {
|
|
248
|
+
const s = _.c(14), r = e === void 0 ? 50 : e, i = t, [, l] = N(0);
|
|
249
|
+
let a;
|
|
250
|
+
if (s[0] !== n?.data || s[1] !== i) {
|
|
251
251
|
let d;
|
|
252
|
-
|
|
252
|
+
s[3] !== n?.data ? (d = (f) => n?.data?.[f], s[3] = n?.data, s[4] = d) : d = s[4], a = i.map(d), s[0] = n?.data, s[1] = i, s[2] = a;
|
|
253
253
|
} else
|
|
254
|
-
|
|
255
|
-
const o =
|
|
254
|
+
a = s[2];
|
|
255
|
+
const o = a;
|
|
256
256
|
let u;
|
|
257
|
-
|
|
258
|
-
if (
|
|
257
|
+
s[5] !== n || s[6] !== r || s[7] !== i || s[8] !== o || s[9] !== l ? (u = () => {
|
|
258
|
+
if (n) {
|
|
259
259
|
let d = o;
|
|
260
|
-
const f =
|
|
261
|
-
const h =
|
|
262
|
-
|
|
263
|
-
},
|
|
260
|
+
const f = H(() => {
|
|
261
|
+
const h = i.map((p) => n?.data?.[p]);
|
|
262
|
+
i.some((p, b) => d[b] != h[b]) && (d = h, l(fe));
|
|
263
|
+
}, r), m = i.map((h) => n.subscribe(h, f)), g = setTimeout(f, 1);
|
|
264
264
|
return () => {
|
|
265
|
-
clearTimeout(
|
|
265
|
+
clearTimeout(g), f.cancel(), m.forEach(pe);
|
|
266
266
|
};
|
|
267
267
|
}
|
|
268
|
-
},
|
|
268
|
+
}, s[5] = n, s[6] = r, s[7] = i, s[8] = o, s[9] = l, s[10] = u) : u = s[10];
|
|
269
269
|
let c;
|
|
270
|
-
return
|
|
270
|
+
return s[11] !== n || s[12] !== i ? (c = [n, ...i], s[11] = n, s[12] = i, s[13] = c) : c = s[13], w(u, c), o;
|
|
271
271
|
};
|
|
272
|
-
function
|
|
273
|
-
return
|
|
272
|
+
function he(n) {
|
|
273
|
+
return n + 1;
|
|
274
274
|
}
|
|
275
|
-
function
|
|
276
|
-
return
|
|
275
|
+
function de(n) {
|
|
276
|
+
return n();
|
|
277
277
|
}
|
|
278
|
-
function fe(
|
|
279
|
-
return
|
|
278
|
+
function fe(n) {
|
|
279
|
+
return n + 1;
|
|
280
280
|
}
|
|
281
|
-
function
|
|
282
|
-
return
|
|
281
|
+
function pe(n) {
|
|
282
|
+
return n();
|
|
283
283
|
}
|
|
284
|
-
const
|
|
285
|
-
const t =
|
|
284
|
+
const J = (n = void 0) => Object.keys(n ?? {}).sort().map((e) => {
|
|
285
|
+
const t = n?.[e];
|
|
286
286
|
if (t !== null && (typeof t == "object" || typeof t == "function"))
|
|
287
287
|
throw new Error(`Parameter "${e}" must be a primitive value (string, number, bigint, null, or undefined), but received ${typeof t}`);
|
|
288
288
|
return e + "=" + t;
|
|
289
|
-
}).join("&"),
|
|
290
|
-
const t = (
|
|
291
|
-
const o =
|
|
289
|
+
}).join("&"), Ae = (n, e) => {
|
|
290
|
+
const t = (a) => [n, J(a)].filter(Boolean).join("?"), s = /* @__PURE__ */ new Set(), r = (a) => {
|
|
291
|
+
const o = _.c(5), u = e(a), c = t(a), d = z(c);
|
|
292
292
|
let f;
|
|
293
293
|
o[0] === Symbol.for("react.memo_cache_sentinel") ? (f = new Error(), o[0] = f) : f = o[0];
|
|
294
294
|
const m = f.stack;
|
|
295
|
-
let
|
|
296
|
-
o[1] !== u ? (
|
|
295
|
+
let g;
|
|
296
|
+
o[1] !== u ? (g = Object.entries(u), o[1] = u, o[2] = g) : g = o[2], q(d, ...g);
|
|
297
297
|
let h;
|
|
298
298
|
return o[3] !== c ? (h = () => {
|
|
299
|
-
if (
|
|
300
|
-
const
|
|
301
|
-
throw
|
|
299
|
+
if (s.has(c)) {
|
|
300
|
+
const p = new Error("RootContext " + c + " are mounted more than once");
|
|
301
|
+
throw p.stack = m, p;
|
|
302
302
|
}
|
|
303
|
-
return
|
|
304
|
-
|
|
303
|
+
return s.add(c), () => {
|
|
304
|
+
s.delete(c);
|
|
305
305
|
};
|
|
306
|
-
}, o[3] = c, o[4] = h) : h = o[4],
|
|
307
|
-
},
|
|
308
|
-
const o =
|
|
306
|
+
}, o[3] = c, o[4] = h) : h = o[4], w(h), u;
|
|
307
|
+
}, i = (a) => {
|
|
308
|
+
const o = _.c(1);
|
|
309
309
|
let u;
|
|
310
310
|
return o[0] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ v($, {}), o[0] = u) : u = o[0], u;
|
|
311
|
-
}, l = (
|
|
312
|
-
const o =
|
|
311
|
+
}, l = (a) => {
|
|
312
|
+
const o = _.c(3), u = r(a);
|
|
313
313
|
let c;
|
|
314
|
-
return o[0] !==
|
|
314
|
+
return o[0] !== a || o[1] !== u ? (c = /* @__PURE__ */ v(i, { ...a, ...u }), o[0] = a, o[1] = u, o[2] = c) : c = o[2], c;
|
|
315
315
|
};
|
|
316
|
-
return
|
|
317
|
-
name:
|
|
316
|
+
return r.displayName = `useState[${n}]`, l.displayName = `StateContainer[${n}]`, i.displayName = `Debug[${n}]`, {
|
|
317
|
+
name: n,
|
|
318
318
|
getCtxName: t,
|
|
319
|
-
useRootState:
|
|
319
|
+
useRootState: r,
|
|
320
320
|
Root: l,
|
|
321
321
|
/**
|
|
322
322
|
* Strict consumer: throws if the corresponding Root for these props isn't mounted.
|
|
323
323
|
* Use in development/tests to fail fast when wiring is incorrect.
|
|
324
324
|
*/
|
|
325
|
-
useCtxStateStrict: (
|
|
326
|
-
const o = t(
|
|
327
|
-
return
|
|
328
|
-
if (!
|
|
325
|
+
useCtxStateStrict: (a) => {
|
|
326
|
+
const o = t(a), u = x(() => new Error().stack, []);
|
|
327
|
+
return w(() => {
|
|
328
|
+
if (!s.has(o)) {
|
|
329
329
|
const c = new Error("RootContext [" + o + "] is not mounted");
|
|
330
330
|
throw c.stack = u, c;
|
|
331
331
|
}
|
|
332
|
-
}, [o]),
|
|
332
|
+
}, [o]), z(o);
|
|
333
333
|
},
|
|
334
334
|
/**
|
|
335
335
|
* Lenient consumer: schedules a console.error if the Root isn't mounted instead of throwing.
|
|
336
336
|
* Useful in production to avoid hard crashes while still surfacing misconfiguration.
|
|
337
337
|
*/
|
|
338
|
-
useCtxState: (
|
|
339
|
-
const o = t(
|
|
340
|
-
return
|
|
341
|
-
if (!
|
|
338
|
+
useCtxState: (a) => {
|
|
339
|
+
const o = t(a), u = x(() => new Error().stack, []);
|
|
340
|
+
return w(() => {
|
|
341
|
+
if (!s.has(o)) {
|
|
342
342
|
const c = new Error("RootContext [" + o + "] is not mounted");
|
|
343
343
|
c.stack = u;
|
|
344
344
|
let d = setTimeout(() => console.error(c), 1e3);
|
|
345
345
|
return () => clearTimeout(d);
|
|
346
346
|
}
|
|
347
|
-
}, [
|
|
347
|
+
}, [s.has(o)]), z(o);
|
|
348
348
|
}
|
|
349
349
|
};
|
|
350
|
-
},
|
|
351
|
-
const e =
|
|
350
|
+
}, me = (n) => {
|
|
351
|
+
const e = _.c(1);
|
|
352
352
|
let t;
|
|
353
353
|
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ v($, {}), e[0] = t) : t = e[0], t;
|
|
354
|
-
},
|
|
355
|
-
useStateFn:
|
|
354
|
+
}, ge = ({
|
|
355
|
+
useStateFn: n,
|
|
356
356
|
params: e,
|
|
357
357
|
debugging: t
|
|
358
358
|
}) => {
|
|
359
|
-
const
|
|
360
|
-
return t ? /* @__PURE__ */ v(
|
|
361
|
-
},
|
|
362
|
-
Wrapper:
|
|
359
|
+
const s = n(e);
|
|
360
|
+
return t ? /* @__PURE__ */ v(me, { ...s }) : /* @__PURE__ */ v($, {});
|
|
361
|
+
}, Ke = ({
|
|
362
|
+
Wrapper: n = te,
|
|
363
363
|
debugging: e = !1
|
|
364
364
|
}) => {
|
|
365
|
-
const t =
|
|
366
|
-
const d = [
|
|
367
|
-
return
|
|
365
|
+
const t = z("auto-ctx"), [s, r] = N({}), i = ee((a, o, u, c = 0) => {
|
|
366
|
+
const d = [a, J(u)].filter(Boolean).join("?");
|
|
367
|
+
return r((f) => ({
|
|
368
368
|
...f,
|
|
369
369
|
[d]: {
|
|
370
370
|
...f[d] ?? {
|
|
@@ -375,7 +375,7 @@ const B = (s = void 0) => Object.keys(s ?? {}).sort().map((e) => {
|
|
|
375
375
|
keepUntil: void 0,
|
|
376
376
|
useStateFn: o
|
|
377
377
|
}
|
|
378
|
-
})), () =>
|
|
378
|
+
})), () => r(({
|
|
379
379
|
[d]: f,
|
|
380
380
|
...m
|
|
381
381
|
}) => ({
|
|
@@ -388,23 +388,23 @@ const B = (s = void 0) => Object.keys(s ?? {}).sort().map((e) => {
|
|
|
388
388
|
}
|
|
389
389
|
} : {}
|
|
390
390
|
}));
|
|
391
|
-
}, []), l =
|
|
392
|
-
counter:
|
|
391
|
+
}, []), l = x(() => Object.entries(s).filter(([, {
|
|
392
|
+
counter: a,
|
|
393
393
|
keepUntil: o
|
|
394
|
-
}]) =>
|
|
395
|
-
keepUntil:
|
|
394
|
+
}]) => a <= 0 && o).toSorted(([, {
|
|
395
|
+
keepUntil: a = 0
|
|
396
396
|
}], [, {
|
|
397
397
|
keepUntil: o = 0
|
|
398
|
-
}]) =>
|
|
399
|
-
return
|
|
398
|
+
}]) => a - o)?.at(0), [s]);
|
|
399
|
+
return w(() => {
|
|
400
400
|
if (l) {
|
|
401
|
-
const [
|
|
401
|
+
const [a, {
|
|
402
402
|
keepUntil: o
|
|
403
403
|
}] = l;
|
|
404
404
|
if (typeof o > "u") throw new Error("Invalid state mgr");
|
|
405
405
|
let u = setTimeout(() => {
|
|
406
|
-
|
|
407
|
-
[
|
|
406
|
+
r(({
|
|
407
|
+
[a]: c,
|
|
408
408
|
...d
|
|
409
409
|
}) => d);
|
|
410
410
|
}, Math.max(0, o - Date.now()));
|
|
@@ -412,46 +412,46 @@ const B = (s = void 0) => Object.keys(s ?? {}).sort().map((e) => {
|
|
|
412
412
|
clearTimeout(u);
|
|
413
413
|
};
|
|
414
414
|
}
|
|
415
|
-
}, [l]),
|
|
416
|
-
counter:
|
|
415
|
+
}, [l]), q(t, ["subscribe", i], ["state", s]), /* @__PURE__ */ v($, { children: Object.entries(s).filter(([, {
|
|
416
|
+
counter: a,
|
|
417
417
|
keepUntil: o = 0
|
|
418
|
-
}]) =>
|
|
418
|
+
}]) => a > 0 || o >= Date.now()).map(([a, {
|
|
419
419
|
useStateFn: o,
|
|
420
420
|
params: u
|
|
421
|
-
}]) => /* @__PURE__ */ v(
|
|
422
|
-
},
|
|
423
|
-
useRootState:
|
|
421
|
+
}]) => /* @__PURE__ */ v(n, { children: /* @__PURE__ */ v(ge, { params: u, useStateFn: o, debugging: e }, a) }, a)) });
|
|
422
|
+
}, Me = ({
|
|
423
|
+
useRootState: n,
|
|
424
424
|
getCtxName: e,
|
|
425
425
|
name: t
|
|
426
|
-
},
|
|
427
|
-
useCtxState: (
|
|
428
|
-
const
|
|
429
|
-
return
|
|
426
|
+
}, s = 0) => ({
|
|
427
|
+
useCtxState: (r) => {
|
|
428
|
+
const i = e(r), l = ue(z("auto-ctx"), "subscribe");
|
|
429
|
+
return w(() => l?.(t, n, r, s), [n, l, t, i, s]), z(i);
|
|
430
430
|
}
|
|
431
|
-
}),
|
|
432
|
-
const [, e] =
|
|
431
|
+
}), Ue = (n) => {
|
|
432
|
+
const [, e] = N(0), {
|
|
433
433
|
proxy: t,
|
|
434
|
-
finalGetter:
|
|
435
|
-
openGetter:
|
|
436
|
-
clean:
|
|
437
|
-
} =
|
|
438
|
-
const l = /* @__PURE__ */ new Set(),
|
|
439
|
-
get(h,
|
|
434
|
+
finalGetter: s,
|
|
435
|
+
openGetter: r,
|
|
436
|
+
clean: i
|
|
437
|
+
} = x(() => {
|
|
438
|
+
const l = /* @__PURE__ */ new Set(), a = {}, o = /* @__PURE__ */ new Map(), u = new Proxy(n?.data, {
|
|
439
|
+
get(h, p) {
|
|
440
440
|
if (c)
|
|
441
|
-
return l.add(
|
|
441
|
+
return l.add(p), a[p] = h[p];
|
|
442
442
|
throw new Error("useQuickSubscribe: Cannot access context data outside render phase. Destructure needed properties immediately during render.");
|
|
443
443
|
},
|
|
444
444
|
ownKeys(h) {
|
|
445
445
|
return console.warn("useQuickSubscribe: Rest object operations aren't recommended as they bypass selective subscription and may cause performance issues"), Reflect.ownKeys(h);
|
|
446
446
|
}
|
|
447
447
|
});
|
|
448
|
-
let c = !0, d =
|
|
449
|
-
[...l.values()].some((h) =>
|
|
448
|
+
let c = !0, d = H(() => {
|
|
449
|
+
[...l.values()].some((h) => a[h] != n?.data?.[h]) && e((h) => h + 1);
|
|
450
450
|
}, 0), f = () => {
|
|
451
451
|
c = !0, l.clear();
|
|
452
452
|
}, m = () => {
|
|
453
453
|
c = !1, [...l.values()].filter((h) => !o.has(h)).forEach((h) => {
|
|
454
|
-
o.set(h,
|
|
454
|
+
o.set(h, n?.subscribe(h, d));
|
|
455
455
|
}), [...o.keys()].filter((h) => !l.has(h)).forEach((h) => {
|
|
456
456
|
o.get(h)?.(), o.delete(h);
|
|
457
457
|
});
|
|
@@ -464,239 +464,373 @@ const B = (s = void 0) => Object.keys(s ?? {}).sort().map((e) => {
|
|
|
464
464
|
f(), m(), e((h) => h + 1);
|
|
465
465
|
}
|
|
466
466
|
};
|
|
467
|
-
}, [
|
|
468
|
-
return
|
|
467
|
+
}, [n]);
|
|
468
|
+
return r(), setTimeout(s, 0), w(() => () => i(), [i]), t;
|
|
469
469
|
};
|
|
470
|
-
function
|
|
471
|
-
const e =
|
|
470
|
+
function ve(n) {
|
|
471
|
+
const e = _.c(4);
|
|
472
472
|
let t;
|
|
473
|
-
e[0] !==
|
|
474
|
-
const
|
|
475
|
-
let
|
|
476
|
-
return e[2] !==
|
|
477
|
-
highlight:
|
|
478
|
-
}, e[2] =
|
|
473
|
+
e[0] !== n ? (t = n ? Se(n.trim().toLowerCase().split(" "), "gi") : void 0, e[0] = n, e[1] = t) : t = e[1];
|
|
474
|
+
const s = t;
|
|
475
|
+
let r;
|
|
476
|
+
return e[2] !== s ? (r = {
|
|
477
|
+
highlight: s
|
|
478
|
+
}, e[2] = s, e[3] = r) : r = e[3], r;
|
|
479
479
|
}
|
|
480
|
-
function be(
|
|
481
|
-
return
|
|
480
|
+
function be(n) {
|
|
481
|
+
return n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
482
482
|
}
|
|
483
|
-
function
|
|
484
|
-
const t =
|
|
483
|
+
function Se(n, e = "gi") {
|
|
484
|
+
const t = n.map(be).join("|");
|
|
485
485
|
return new RegExp(`(${t})`, e);
|
|
486
486
|
}
|
|
487
|
-
function
|
|
487
|
+
function Ce(n, e) {
|
|
488
488
|
const t = [];
|
|
489
|
-
let
|
|
490
|
-
for (const
|
|
491
|
-
const [
|
|
492
|
-
l >
|
|
489
|
+
let s = 0;
|
|
490
|
+
for (const r of n.matchAll(e)) {
|
|
491
|
+
const [i] = r, l = r.index;
|
|
492
|
+
l > s && t.push(n.slice(s, l)), t.push(/* @__PURE__ */ v("mark", { children: i }, l)), s = l + i.length;
|
|
493
493
|
}
|
|
494
|
-
return
|
|
494
|
+
return s < n.length && t.push(n.slice(s)), t;
|
|
495
495
|
}
|
|
496
|
-
const
|
|
496
|
+
const X = D.createContext({
|
|
497
497
|
highlight: void 0
|
|
498
|
-
}),
|
|
499
|
-
const e =
|
|
498
|
+
}), Ee = (n) => {
|
|
499
|
+
const e = _.c(3), {
|
|
500
500
|
children: t,
|
|
501
|
-
highlight:
|
|
502
|
-
} =
|
|
503
|
-
let
|
|
504
|
-
return e[0] !== t || e[1] !==
|
|
505
|
-
},
|
|
506
|
-
const e =
|
|
501
|
+
highlight: s
|
|
502
|
+
} = n, r = ve(s);
|
|
503
|
+
let i;
|
|
504
|
+
return e[0] !== t || e[1] !== r ? (i = /* @__PURE__ */ v(X.Provider, { value: r, children: t }), e[0] = t, e[1] = r, e[2] = i) : i = e[2], i;
|
|
505
|
+
}, we = (n) => {
|
|
506
|
+
const e = _.c(5), {
|
|
507
507
|
text: t
|
|
508
|
-
} =
|
|
509
|
-
highlight:
|
|
510
|
-
} =
|
|
511
|
-
let
|
|
512
|
-
e[0] !==
|
|
513
|
-
const
|
|
508
|
+
} = n, {
|
|
509
|
+
highlight: s
|
|
510
|
+
} = se(X);
|
|
511
|
+
let r;
|
|
512
|
+
e[0] !== s || e[1] !== t ? (r = s ? Ce(t, s) : t, e[0] = s, e[1] = t, e[2] = r) : r = e[2];
|
|
513
|
+
const i = r;
|
|
514
514
|
let l;
|
|
515
|
-
return e[3] !==
|
|
516
|
-
},
|
|
517
|
-
const e =
|
|
515
|
+
return e[3] !== i ? (l = /* @__PURE__ */ v($, { children: i }), e[3] = i, e[4] = l) : l = e[4], l;
|
|
516
|
+
}, Q = (n) => {
|
|
517
|
+
const e = _.c(5), {
|
|
518
518
|
name: t,
|
|
519
|
-
value:
|
|
520
|
-
} =
|
|
521
|
-
let
|
|
519
|
+
value: s
|
|
520
|
+
} = n;
|
|
521
|
+
let r;
|
|
522
522
|
try {
|
|
523
|
-
let
|
|
524
|
-
e[0] !== t || e[1] !==
|
|
525
|
-
[t]:
|
|
526
|
-
}, null, 2), e[0] = t, e[1] =
|
|
527
|
-
} catch (
|
|
528
|
-
|
|
523
|
+
let a;
|
|
524
|
+
e[0] !== t || e[1] !== s ? (a = JSON.stringify({
|
|
525
|
+
[t]: s
|
|
526
|
+
}, null, 2), e[0] = t, e[1] = s, e[2] = a) : a = e[2], r = a;
|
|
527
|
+
} catch (a) {
|
|
528
|
+
r = String(a);
|
|
529
529
|
}
|
|
530
|
-
const
|
|
530
|
+
const i = r;
|
|
531
531
|
let l;
|
|
532
|
-
return e[3] !==
|
|
533
|
-
}, _e = (
|
|
534
|
-
const e =
|
|
535
|
-
let t,
|
|
536
|
-
if (e[0] !==
|
|
532
|
+
return e[3] !== i ? (l = /* @__PURE__ */ v("pre", { children: i }), e[3] = i, e[4] = l) : l = e[4], l;
|
|
533
|
+
}, _e = (n) => {
|
|
534
|
+
const e = _.c(26);
|
|
535
|
+
let t, s, r, i;
|
|
536
|
+
if (e[0] !== n) {
|
|
537
537
|
const {
|
|
538
|
-
selectedKey:
|
|
539
|
-
setKey:
|
|
540
|
-
currentKey:
|
|
538
|
+
selectedKey: S,
|
|
539
|
+
setKey: C,
|
|
540
|
+
currentKey: E,
|
|
541
541
|
highlight: O,
|
|
542
|
-
...
|
|
543
|
-
} =
|
|
544
|
-
|
|
542
|
+
...y
|
|
543
|
+
} = n;
|
|
544
|
+
r = S, i = C, t = E, s = y, e[0] = n, e[1] = t, e[2] = s, e[3] = r, e[4] = i;
|
|
545
545
|
} else
|
|
546
|
-
t = e[1],
|
|
546
|
+
t = e[1], s = e[2], r = e[3], i = e[4];
|
|
547
547
|
let l;
|
|
548
|
-
e[5] !== t ? (l =
|
|
549
|
-
const
|
|
548
|
+
e[5] !== t ? (l = k(t), e[5] = t, e[6] = l) : l = e[6];
|
|
549
|
+
const a = l, o = P(void 0);
|
|
550
550
|
let u, c;
|
|
551
|
-
e[7] !==
|
|
551
|
+
e[7] !== a ? (u = () => {
|
|
552
552
|
if (o.current) {
|
|
553
|
-
const
|
|
553
|
+
const S = H(() => {
|
|
554
554
|
o.current && (o.current?.classList.add("state-key-updated"), requestAnimationFrame(() => o.current?.classList.remove("state-key-updated")));
|
|
555
555
|
}, 5);
|
|
556
|
-
return
|
|
556
|
+
return a.subscribeAll(S);
|
|
557
557
|
}
|
|
558
|
-
}, c = [
|
|
559
|
-
const d = t ==
|
|
558
|
+
}, c = [a, o], e[7] = a, e[8] = u, e[9] = c) : (u = e[8], c = e[9]), w(u, c);
|
|
559
|
+
const d = t == r;
|
|
560
560
|
let f;
|
|
561
|
-
e[10] !== t || e[11] !==
|
|
561
|
+
e[10] !== t || e[11] !== i ? (f = () => i(t), e[10] = t, e[11] = i, e[12] = f) : f = e[12];
|
|
562
562
|
const m = String(t);
|
|
563
|
-
let
|
|
564
|
-
e[13] !== m ? (
|
|
563
|
+
let g;
|
|
564
|
+
e[13] !== m ? (g = /* @__PURE__ */ v("div", { className: "state-key-name", children: /* @__PURE__ */ v(we, { text: m }) }), e[13] = m, e[14] = g) : g = e[14];
|
|
565
565
|
let h;
|
|
566
|
-
e[15] !==
|
|
567
|
-
let
|
|
568
|
-
e[17] !== h.length ? (
|
|
566
|
+
e[15] !== a.data ? (h = Object.keys(a.data), e[15] = a.data, e[16] = h) : h = e[16];
|
|
567
|
+
let p;
|
|
568
|
+
e[17] !== h.length ? (p = /* @__PURE__ */ R("div", { className: "state-key-meta", children: [
|
|
569
569
|
h.length,
|
|
570
570
|
" items"
|
|
571
|
-
] }), e[17] = h.length, e[18] =
|
|
572
|
-
let
|
|
573
|
-
return e[19] !== t || e[20] !==
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
] }), e[19] = t, e[20] =
|
|
577
|
-
}
|
|
578
|
-
|
|
571
|
+
] }), e[17] = h.length, e[18] = p) : p = e[18];
|
|
572
|
+
let b;
|
|
573
|
+
return e[19] !== t || e[20] !== s || e[21] !== d || e[22] !== f || e[23] !== g || e[24] !== p ? (b = /* @__PURE__ */ R("div", { ref: o, className: "state-key", title: t, "data-active": d, onClick: f, ...s, children: [
|
|
574
|
+
g,
|
|
575
|
+
p
|
|
576
|
+
] }), e[19] = t, e[20] = s, e[21] = d, e[22] = f, e[23] = g, e[24] = p, e[25] = b) : b = e[25], b;
|
|
577
|
+
};
|
|
578
|
+
function T() {
|
|
579
|
+
return T = Object.assign ? Object.assign.bind() : function(n) {
|
|
580
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
581
|
+
var t = arguments[e];
|
|
582
|
+
for (var s in t) ({}).hasOwnProperty.call(t, s) && (n[s] = t[s]);
|
|
583
|
+
}
|
|
584
|
+
return n;
|
|
585
|
+
}, T.apply(null, arguments);
|
|
586
|
+
}
|
|
587
|
+
function ye(n, e) {
|
|
588
|
+
if (n == null) return {};
|
|
589
|
+
var t = {};
|
|
590
|
+
for (var s in n) if ({}.hasOwnProperty.call(n, s)) {
|
|
591
|
+
if (e.indexOf(s) !== -1) continue;
|
|
592
|
+
t[s] = n[s];
|
|
593
|
+
}
|
|
594
|
+
return t;
|
|
595
|
+
}
|
|
596
|
+
var Ne = ["prefixCls", "className", "children", "mode", "visiable", "visible", "renderBar", "lineBar", "disable", "onDragEnd", "onDragging"];
|
|
597
|
+
class U extends D.Component {
|
|
598
|
+
constructor(e) {
|
|
599
|
+
super(e), this.state = {
|
|
600
|
+
dragging: !1
|
|
601
|
+
}, this.warpper = void 0, this.paneNumber = void 0, this.startX = void 0, this.startY = void 0, this.move = void 0, this.target = void 0, this.boxWidth = void 0, this.boxHeight = void 0, this.preWidth = void 0, this.nextWidth = void 0, this.preHeight = void 0, this.nextHeight = void 0, this.preSize = void 0, this.nextSize = void 0, this.onDragEnd = this.onDragEnd.bind(this), this.onDragging = this.onDragging.bind(this);
|
|
602
|
+
}
|
|
603
|
+
componentWillUnmount() {
|
|
604
|
+
this.removeEvent();
|
|
605
|
+
}
|
|
606
|
+
removeEvent() {
|
|
607
|
+
window.removeEventListener("mousemove", this.onDragging, !1), window.removeEventListener("mouseup", this.onDragEnd, !1);
|
|
608
|
+
}
|
|
609
|
+
onMouseDown(e, t) {
|
|
610
|
+
if (!(!t.target || !this.warpper)) {
|
|
611
|
+
this.paneNumber = e, this.startX = t.clientX, this.startY = t.clientY, this.move = !0, this.target = t.target.parentNode;
|
|
612
|
+
var s = this.target.previousElementSibling, r = this.target.nextElementSibling;
|
|
613
|
+
this.boxWidth = this.warpper.clientWidth, this.boxHeight = this.warpper.clientHeight, s && (this.preWidth = s.clientWidth, this.preHeight = s.clientHeight), r && (this.nextWidth = r.clientWidth, this.nextHeight = r.clientHeight), window.addEventListener("mousemove", this.onDragging), window.addEventListener("mouseup", this.onDragEnd, !1), this.setState({
|
|
614
|
+
dragging: !0
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
onDragging(e) {
|
|
619
|
+
if (this.move) {
|
|
620
|
+
this.state.dragging || this.setState({
|
|
621
|
+
dragging: !0
|
|
622
|
+
});
|
|
623
|
+
var {
|
|
624
|
+
mode: t,
|
|
625
|
+
onDragging: s
|
|
626
|
+
} = this.props, r = this.target.nextElementSibling, i = this.target.previousElementSibling, l = e.clientX - this.startX, a = e.clientY - this.startY;
|
|
627
|
+
if (this.preSize = 0, this.nextSize = 0, t === "horizontal") {
|
|
628
|
+
if (this.preSize = this.preWidth + l > -1 ? this.preWidth + l : 0, this.nextSize = this.nextWidth - l > -1 ? this.nextWidth - l : 0, this.preSize === 0 || this.nextSize === 0)
|
|
629
|
+
return;
|
|
630
|
+
this.preSize = (this.preSize / this.boxWidth >= 1 ? 1 : this.preSize / this.boxWidth) * 100, this.nextSize = (this.nextSize / this.boxWidth >= 1 ? 1 : this.nextSize / this.boxWidth) * 100, i && r && (i.style.width = this.preSize + "%", r.style.width = this.nextSize + "%");
|
|
631
|
+
}
|
|
632
|
+
if (t === "vertical" && this.preHeight + a > -1 && this.nextHeight - a > -1) {
|
|
633
|
+
if (this.preSize = this.preHeight + a > -1 ? this.preHeight + a : 0, this.nextSize = this.nextHeight - a > -1 ? this.nextHeight - a : 0, this.preSize = (this.preSize / this.boxHeight >= 1 ? 1 : this.preSize / this.boxHeight) * 100, this.nextSize = (this.nextSize / this.boxHeight >= 1 ? 1 : this.nextSize / this.boxHeight) * 100, this.preSize === 0 || this.nextSize === 0)
|
|
634
|
+
return;
|
|
635
|
+
i && r && (i.style.height = this.preSize + "%", r.style.height = this.nextSize + "%");
|
|
636
|
+
}
|
|
637
|
+
s && s(this.preSize, this.nextSize, this.paneNumber);
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
onDragEnd() {
|
|
641
|
+
var {
|
|
642
|
+
onDragEnd: e
|
|
643
|
+
} = this.props;
|
|
644
|
+
this.move = !1, e && e(this.preSize, this.nextSize, this.paneNumber), this.removeEvent(), this.setState({
|
|
645
|
+
dragging: !1
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
render() {
|
|
649
|
+
var e, t = this.props, {
|
|
650
|
+
prefixCls: s,
|
|
651
|
+
className: r,
|
|
652
|
+
children: i,
|
|
653
|
+
mode: l,
|
|
654
|
+
visible: a = (e = this.props.visible) != null ? e : this.props.visiable,
|
|
655
|
+
renderBar: o,
|
|
656
|
+
lineBar: u,
|
|
657
|
+
disable: c
|
|
658
|
+
} = t, d = ye(t, Ne), {
|
|
659
|
+
dragging: f
|
|
660
|
+
} = this.state, m = [s, r, s + "-" + l, f ? "dragging" : null].filter(Boolean).join(" ").trim(), g = D.Children.toArray(i);
|
|
661
|
+
return /* @__PURE__ */ v("div", T({
|
|
662
|
+
className: m
|
|
663
|
+
}, d, {
|
|
664
|
+
ref: (h) => this.warpper = h,
|
|
665
|
+
children: D.Children.map(g, (h, p) => {
|
|
666
|
+
var b = Object.assign({}, h.props, {
|
|
667
|
+
className: [s + "-pane", h.props.className].filter(Boolean).join(" ").trim(),
|
|
668
|
+
style: T({}, h.props.style)
|
|
669
|
+
}), S = a === !0 || a && a.includes(p + 1) || !1, C = {
|
|
670
|
+
className: [s + "-bar", u ? s + "-line-bar" : null, u ? null : s + "-large-bar"].filter(Boolean).join(" ").trim()
|
|
671
|
+
};
|
|
672
|
+
(c === !0 || c && c.includes(p + 1)) && (C.className = [C.className, c ? "disable" : null].filter(Boolean).join(" ").trim());
|
|
673
|
+
var E = null;
|
|
674
|
+
return p !== 0 && S && o ? E = o(T({}, C, {
|
|
675
|
+
onMouseDown: this.onMouseDown.bind(this, p + 1)
|
|
676
|
+
})) : p !== 0 && S && (E = /* @__PURE__ */ D.createElement("div", T({}, C), /* @__PURE__ */ v("div", {
|
|
677
|
+
onMouseDown: this.onMouseDown.bind(this, p + 1)
|
|
678
|
+
}))), /* @__PURE__ */ R(D.Fragment, {
|
|
679
|
+
children: [E, /* @__PURE__ */ D.cloneElement(h, T({}, b))]
|
|
680
|
+
}, p);
|
|
681
|
+
})
|
|
682
|
+
}));
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
U.defaultProps = {
|
|
686
|
+
prefixCls: "w-split",
|
|
687
|
+
visiable: !0,
|
|
688
|
+
mode: "horizontal"
|
|
689
|
+
};
|
|
690
|
+
const L = k.cache, De = (n) => {
|
|
691
|
+
const e = _.c(27), {
|
|
579
692
|
Component: t
|
|
580
|
-
} =
|
|
693
|
+
} = n, [s, r] = N(Te), [i, l] = N(""), [a, o] = N("");
|
|
581
694
|
let u, c;
|
|
582
695
|
e[0] === Symbol.for("react.memo_cache_sentinel") ? (u = () => {
|
|
583
|
-
const
|
|
584
|
-
|
|
696
|
+
const y = setInterval(() => {
|
|
697
|
+
r(ze);
|
|
585
698
|
}, 50);
|
|
586
|
-
return () => clearInterval(
|
|
587
|
-
}, c = [
|
|
699
|
+
return () => clearInterval(y);
|
|
700
|
+
}, c = [L], e[0] = u, e[1] = c) : (u = e[0], c = e[1]), w(u, c);
|
|
588
701
|
let d;
|
|
589
|
-
e[2] !==
|
|
702
|
+
e[2] !== i ? (d = i.toLowerCase().split(" "), e[2] = i, e[3] = d) : d = e[3];
|
|
590
703
|
const f = d;
|
|
591
704
|
let m;
|
|
592
|
-
e[4] !== f ? (m = (
|
|
593
|
-
const
|
|
594
|
-
return f.every((
|
|
705
|
+
e[4] !== f ? (m = (y) => {
|
|
706
|
+
const W = y.toLowerCase();
|
|
707
|
+
return f.every((Z) => W.includes(Z));
|
|
595
708
|
}, e[4] = f, e[5] = m) : m = e[5];
|
|
596
|
-
const
|
|
709
|
+
const g = m;
|
|
597
710
|
let h;
|
|
598
|
-
e[6] === Symbol.for("react.memo_cache_sentinel") ? (h = (
|
|
711
|
+
e[6] === Symbol.for("react.memo_cache_sentinel") ? (h = (y) => l(y.target.value), e[6] = h) : h = e[6];
|
|
712
|
+
let p;
|
|
713
|
+
e[7] !== i ? (p = /* @__PURE__ */ v("input", { placeholder: "Type to Filter ...", className: "state-filter", value: i, onChange: h }), e[7] = i, e[8] = p) : p = e[8];
|
|
599
714
|
let b;
|
|
600
|
-
e[
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
let _;
|
|
604
|
-
e[13] !== i ? (_ = (K) => /* @__PURE__ */ v(_e, { selectedKey: i, setKey: o, currentKey: K }, K), e[13] = i, e[14] = _) : _ = e[14], S = n.map(we).filter(De).filter(p).map(_), e[9] = n, e[10] = p, e[11] = i, e[12] = S;
|
|
715
|
+
if (e[9] !== s || e[10] !== g || e[11] !== a) {
|
|
716
|
+
let y;
|
|
717
|
+
e[13] !== a ? (y = (W) => /* @__PURE__ */ v(_e, { selectedKey: a, setKey: o, currentKey: W }, W), e[13] = a, e[14] = y) : y = e[14], b = s.map(xe).filter($e).filter(g).map(y), e[9] = s, e[10] = g, e[11] = a, e[12] = b;
|
|
605
718
|
} else
|
|
606
|
-
|
|
719
|
+
b = e[12];
|
|
720
|
+
let S;
|
|
721
|
+
e[15] !== i || e[16] !== b ? (S = /* @__PURE__ */ v(Ee, { highlight: i, children: b }), e[15] = i, e[16] = b, e[17] = S) : S = e[17];
|
|
722
|
+
let C;
|
|
723
|
+
e[18] !== p || e[19] !== S ? (C = /* @__PURE__ */ R("div", { className: "state-list", children: [
|
|
724
|
+
p,
|
|
725
|
+
S
|
|
726
|
+
] }), e[18] = p, e[19] = S, e[20] = C) : C = e[20];
|
|
607
727
|
let E;
|
|
608
|
-
e[
|
|
609
|
-
let y;
|
|
610
|
-
e[18] !== b || e[19] !== E ? (y = /* @__PURE__ */ T("div", { className: "state-list", children: [
|
|
611
|
-
b,
|
|
612
|
-
E
|
|
613
|
-
] }), e[18] = b, e[19] = E, e[20] = y) : y = e[20];
|
|
614
|
-
let N;
|
|
615
|
-
e[21] !== t || e[22] !== i ? (N = /* @__PURE__ */ v("div", { className: "state-view", children: /* @__PURE__ */ v(Ee, { dataKey: i, Component: t }, i) }), e[21] = t, e[22] = i, e[23] = N) : N = e[23];
|
|
728
|
+
e[21] !== t || e[22] !== a ? (E = /* @__PURE__ */ v("div", { className: "state-view", children: /* @__PURE__ */ v(Re, { dataKey: a, Component: t }, a) }), e[21] = t, e[22] = a, e[23] = E) : E = e[23];
|
|
616
729
|
let O;
|
|
617
|
-
return e[24] !==
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
] }), e[24] =
|
|
621
|
-
},
|
|
622
|
-
const e =
|
|
730
|
+
return e[24] !== E || e[25] !== C ? (O = /* @__PURE__ */ R(U, { mode: "horizontal", className: "main-panel", children: [
|
|
731
|
+
C,
|
|
732
|
+
E
|
|
733
|
+
] }), e[24] = E, e[25] = C, e[26] = O) : O = e[26], O;
|
|
734
|
+
}, Re = (n) => {
|
|
735
|
+
const e = _.c(11), {
|
|
623
736
|
dataKey: t,
|
|
624
|
-
Component:
|
|
625
|
-
} =
|
|
626
|
-
let
|
|
627
|
-
e[0] !== t ? (
|
|
628
|
-
const l =
|
|
737
|
+
Component: s
|
|
738
|
+
} = n, r = s === void 0 ? Q : s;
|
|
739
|
+
let i;
|
|
740
|
+
e[0] !== t ? (i = k(t), e[0] = t, e[1] = i) : i = e[1];
|
|
741
|
+
const l = i, a = l?.data;
|
|
629
742
|
let o;
|
|
630
|
-
e[2] !==
|
|
631
|
-
...
|
|
632
|
-
}, e[2] =
|
|
633
|
-
const [u, c] =
|
|
743
|
+
e[2] !== a ? (o = {
|
|
744
|
+
...a
|
|
745
|
+
}, e[2] = a, e[3] = o) : o = e[3];
|
|
746
|
+
const [u, c] = N(o);
|
|
634
747
|
let d, f;
|
|
635
748
|
e[4] !== l ? (d = () => {
|
|
636
|
-
const
|
|
637
|
-
return l.subscribeAll((h,
|
|
638
|
-
...
|
|
749
|
+
const g = H(c, 5);
|
|
750
|
+
return l.subscribeAll((h, p) => g({
|
|
751
|
+
...p
|
|
639
752
|
}));
|
|
640
|
-
}, f = [l], e[4] = l, e[5] = d, e[6] = f) : (d = e[5], f = e[6]),
|
|
753
|
+
}, f = [l], e[4] = l, e[5] = d, e[6] = f) : (d = e[5], f = e[6]), w(d, f);
|
|
641
754
|
let m;
|
|
642
|
-
return e[7] !==
|
|
755
|
+
return e[7] !== r || e[8] !== u || e[9] !== t ? (m = /* @__PURE__ */ v(r, { value: u, name: t }), e[7] = r, e[8] = u, e[9] = t, e[10] = m) : m = e[10], m;
|
|
643
756
|
};
|
|
644
|
-
function
|
|
645
|
-
return [...
|
|
757
|
+
function Te() {
|
|
758
|
+
return [...L.keys()];
|
|
646
759
|
}
|
|
647
|
-
function
|
|
648
|
-
return
|
|
760
|
+
function ze(n) {
|
|
761
|
+
return n.length != L.size ? [...L.keys()] : n;
|
|
649
762
|
}
|
|
650
|
-
function
|
|
651
|
-
return JSON.parse(
|
|
763
|
+
function xe(n) {
|
|
764
|
+
return JSON.parse(n)?.[0];
|
|
652
765
|
}
|
|
653
|
-
function
|
|
654
|
-
return
|
|
766
|
+
function $e(n) {
|
|
767
|
+
return n != "auto-ctx" && n;
|
|
655
768
|
}
|
|
656
|
-
const
|
|
657
|
-
const e =
|
|
658
|
-
let t,
|
|
659
|
-
e[0] !==
|
|
660
|
-
toggleButton:
|
|
661
|
-
Component:
|
|
769
|
+
const Be = (n) => {
|
|
770
|
+
const e = _.c(29);
|
|
771
|
+
let t, s, r;
|
|
772
|
+
e[0] !== n ? ({
|
|
773
|
+
toggleButton: s,
|
|
774
|
+
Component: r,
|
|
662
775
|
...t
|
|
663
|
-
} =
|
|
664
|
-
const
|
|
776
|
+
} = n, e[0] = n, e[1] = t, e[2] = s, e[3] = r) : (t = e[1], s = e[2], r = e[3]);
|
|
777
|
+
const i = r === void 0 ? Q : r, [l, a] = N(!1);
|
|
665
778
|
let o;
|
|
666
|
-
e[4] === Symbol.for("react.memo_cache_sentinel") ? (o = () =>
|
|
779
|
+
e[4] === Symbol.for("react.memo_cache_sentinel") ? (o = () => a(!0), e[4] = o) : o = e[4];
|
|
667
780
|
const u = t?.children ?? "Toggle Dev Tool";
|
|
668
781
|
let c;
|
|
669
782
|
e[5] !== l || e[6] !== t || e[7] !== u ? (c = /* @__PURE__ */ v("button", { className: "react-state-dev-btn", "data-active": l, onClick: o, ...t, children: u }), e[5] = l, e[6] = t, e[7] = u, e[8] = c) : c = e[8];
|
|
670
783
|
let d;
|
|
671
|
-
e[9] === Symbol.for("react.memo_cache_sentinel") ? (d =
|
|
672
|
-
|
|
673
|
-
|
|
784
|
+
e[9] === Symbol.for("react.memo_cache_sentinel") ? (d = {
|
|
785
|
+
height: "100%"
|
|
786
|
+
}, e[9] = d) : d = e[9];
|
|
787
|
+
const f = l ? "66.66%" : "100%";
|
|
674
788
|
let m;
|
|
675
|
-
e[
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
789
|
+
e[10] !== f ? (m = /* @__PURE__ */ v("div", { style: {
|
|
790
|
+
height: f
|
|
791
|
+
} }), e[10] = f, e[11] = m) : m = e[11];
|
|
792
|
+
const g = l ? "33.33%" : "0";
|
|
793
|
+
let h;
|
|
794
|
+
e[12] !== g ? (h = {
|
|
795
|
+
height: g,
|
|
796
|
+
backgroundColor: "var(--rs-bg-color)",
|
|
797
|
+
position: "relative"
|
|
798
|
+
}, e[12] = g, e[13] = h) : h = e[13];
|
|
679
799
|
let p;
|
|
680
|
-
|
|
800
|
+
e[14] !== l ? (p = l && /* @__PURE__ */ v("button", { className: "close-btn", onClick: () => a(!1), children: "[x]" }), e[14] = l, e[15] = p) : p = e[15];
|
|
801
|
+
let b;
|
|
802
|
+
e[16] !== i || e[17] !== l ? (b = l && /* @__PURE__ */ v(De, { Component: i }), e[16] = i, e[17] = l, e[18] = b) : b = e[18];
|
|
803
|
+
let S;
|
|
804
|
+
e[19] !== h || e[20] !== p || e[21] !== b ? (S = /* @__PURE__ */ R("div", { className: "react-state-dev-panel", style: h, children: [
|
|
805
|
+
p,
|
|
806
|
+
b
|
|
807
|
+
] }), e[19] = h, e[20] = p, e[21] = b, e[22] = S) : S = e[22];
|
|
808
|
+
let C;
|
|
809
|
+
e[23] !== S || e[24] !== m ? (C = /* @__PURE__ */ v("div", { className: "react-state-dev-container", children: /* @__PURE__ */ R(U, { mode: "vertical", style: d, children: [
|
|
810
|
+
m,
|
|
811
|
+
S
|
|
812
|
+
] }) }), e[23] = S, e[24] = m, e[25] = C) : C = e[25];
|
|
813
|
+
let E;
|
|
814
|
+
return e[26] !== C || e[27] !== c ? (E = /* @__PURE__ */ R($, { children: [
|
|
681
815
|
c,
|
|
682
|
-
|
|
683
|
-
] }), e[
|
|
816
|
+
C
|
|
817
|
+
] }), e[26] = C, e[27] = c, e[28] = E) : E = e[28], E;
|
|
684
818
|
};
|
|
685
819
|
export {
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
820
|
+
Ke as AutoRootCtx,
|
|
821
|
+
ce as Context,
|
|
822
|
+
Be as DevToolContainer,
|
|
823
|
+
Me as createAutoCtx,
|
|
824
|
+
Ae as createRootCtx,
|
|
825
|
+
k as getContext,
|
|
826
|
+
ae as useArrayChangeId,
|
|
827
|
+
z as useDataContext,
|
|
694
828
|
ke as useDataSource,
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
829
|
+
q as useDataSourceMultiple,
|
|
830
|
+
ue as useDataSubscribe,
|
|
831
|
+
je as useDataSubscribeMultiple,
|
|
832
|
+
Le as useDataSubscribeMultipleWithDebounce,
|
|
833
|
+
We as useDataSubscribeWithTransform,
|
|
834
|
+
Ue as useQuickSubscribe
|
|
701
835
|
};
|
|
702
836
|
//# sourceMappingURL=index.es.js.map
|