aoi-comp 1.0.8 → 1.0.10
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 +14 -1
- package/dist/{BufferResource-DPOGqxQ8.js → BufferResource-B9J7sakh.js} +2 -2
- package/dist/{CanvasPool-Btji3eOu.js → CanvasPool-Cj7pAl_V.js} +1 -1
- package/dist/{Geometry-CmoUjYuy.js → Geometry-DZRVpJxo.js} +2 -2
- package/dist/{RenderTargetSystem-BwBGe2Se.js → RenderTargetSystem-DpDerUml.js} +1 -1
- package/dist/{browserAll-BIc-EcPU.js → browserAll-Cgvv18r-.js} +3 -3
- package/dist/{canvasUtils-BZU-qDXH.js → canvasUtils-CQY_EQew.js} +1 -1
- package/dist/comps.js +4494 -4250
- package/dist/{getTextureBatchBindGroup-B9kZnBNO.js → getTextureBatchBindGroup-C-2vhNcM.js} +1 -1
- package/dist/hooks-RFqzmuuL.js +562 -0
- package/dist/hooks.js +2 -2
- package/dist/index.js +1 -1
- package/dist/{init-pj0uFHxN.js → init-CQ75H2tH.js} +3 -3
- package/dist/{init-W_GeGJkn.js → init-DCk4OmUj.js} +2 -2
- package/dist/{packages-B-izsU7O.js → packages-BBu_5vmp.js} +517 -441
- package/dist/style.css +1 -1
- package/dist/utils.js +2 -2
- package/dist/webworkerAll-0PJXJVS3.js +2 -0
- package/package.json +5 -5
- package/dist/hooks-DVVg7e1H.js +0 -527
- package/dist/webworkerAll-CSNhSmU-.js +0 -2
package/dist/hooks-DVVg7e1H.js
DELETED
|
@@ -1,527 +0,0 @@
|
|
|
1
|
-
import { $ as e, E as t, F as n, G as r, J as i, K as a, R as o, Z as s, f as c, ht as l, nt as u, o as d, pt as f, s as p, t as m, tt as h, u as g, ut as _, w as v, y } from "./packages-B-izsU7O.js";
|
|
2
|
-
import { message as b } from "antd";
|
|
3
|
-
import { createContext as x, use as S, useCallback as C, useContext as w, useEffect as T, useMemo as E, useRef as D, useState as O } from "react";
|
|
4
|
-
//#region node_modules/.pnpm/react-i18next@17.0.13_i18ne_77b937ecedfb676debf3096b5685165d/node_modules/react-i18next/dist/es/utils.js
|
|
5
|
-
var k = (e, t, n, r) => {
|
|
6
|
-
let i = [n, {
|
|
7
|
-
code: t,
|
|
8
|
-
...r || {}
|
|
9
|
-
}];
|
|
10
|
-
if (e?.services?.logger?.forward) return e.services.logger.forward(i, "warn", "react-i18next::", !0);
|
|
11
|
-
I(i[0]) && (i[0] = `react-i18next:: ${i[0]}`), e?.services?.logger?.warn ? e.services.logger.warn(...i) : console?.warn && console.warn(...i);
|
|
12
|
-
}, A = {}, j = (e, t, n, r) => {
|
|
13
|
-
I(n) && A[n] || (I(n) && (A[n] = /* @__PURE__ */ new Date()), k(e, t, n, r));
|
|
14
|
-
}, M = (e, t) => () => {
|
|
15
|
-
if (e.isInitialized) t();
|
|
16
|
-
else {
|
|
17
|
-
let n = () => {
|
|
18
|
-
setTimeout(() => {
|
|
19
|
-
e.off("initialized", n);
|
|
20
|
-
}, 0), t();
|
|
21
|
-
};
|
|
22
|
-
e.on("initialized", n);
|
|
23
|
-
}
|
|
24
|
-
}, N = (e, t, n) => {
|
|
25
|
-
e.loadNamespaces(t, M(e, n));
|
|
26
|
-
}, P = (e, t, n, r) => {
|
|
27
|
-
if (I(n) && (n = [n]), e.options.preload && e.options.preload.indexOf(t) > -1) return N(e, n, r);
|
|
28
|
-
n.forEach((t) => {
|
|
29
|
-
e.options.ns.indexOf(t) < 0 && e.options.ns.push(t);
|
|
30
|
-
}), e.loadLanguages(t, M(e, r));
|
|
31
|
-
}, F = (e, t, n = {}) => !t.languages || !t.languages.length ? (j(t, "NO_LANGUAGES", "i18n.languages were undefined or empty", { languages: t.languages }), !0) : t.hasLoadedNamespace(e, {
|
|
32
|
-
lng: n.lng,
|
|
33
|
-
precheck: (t, r) => {
|
|
34
|
-
if (n.bindI18n && n.bindI18n.indexOf("languageChanging") > -1 && t.services.backendConnector.backend && t.isLanguageChangingTo && !r(t.isLanguageChangingTo, e)) return !1;
|
|
35
|
-
}
|
|
36
|
-
}), I = (e) => typeof e == "string", L = (e) => typeof e == "object" && !!e, R = x(), z = class {
|
|
37
|
-
constructor() {
|
|
38
|
-
this.usedNamespaces = {};
|
|
39
|
-
}
|
|
40
|
-
addUsedNamespaces(e) {
|
|
41
|
-
e.forEach((e) => {
|
|
42
|
-
this.usedNamespaces[e] || (this.usedNamespaces[e] = !0);
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
getUsedNamespaces() {
|
|
46
|
-
return Object.keys(this.usedNamespaces);
|
|
47
|
-
}
|
|
48
|
-
}, B = /* @__PURE__ */ f(((e) => {
|
|
49
|
-
var t = l("react");
|
|
50
|
-
function n(e, t) {
|
|
51
|
-
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
52
|
-
}
|
|
53
|
-
var r = typeof Object.is == "function" ? Object.is : n, i = t.useState, a = t.useEffect, o = t.useLayoutEffect, s = t.useDebugValue;
|
|
54
|
-
function c(e, t) {
|
|
55
|
-
var n = t(), r = i({ inst: {
|
|
56
|
-
value: n,
|
|
57
|
-
getSnapshot: t
|
|
58
|
-
} }), c = r[0].inst, l = r[1];
|
|
59
|
-
return o(function() {
|
|
60
|
-
c.value = n, c.getSnapshot = t, u(c) && l({ inst: c });
|
|
61
|
-
}, [
|
|
62
|
-
e,
|
|
63
|
-
n,
|
|
64
|
-
t
|
|
65
|
-
]), a(function() {
|
|
66
|
-
return u(c) && l({ inst: c }), e(function() {
|
|
67
|
-
u(c) && l({ inst: c });
|
|
68
|
-
});
|
|
69
|
-
}, [e]), s(n), n;
|
|
70
|
-
}
|
|
71
|
-
function u(e) {
|
|
72
|
-
var t = e.getSnapshot;
|
|
73
|
-
e = e.value;
|
|
74
|
-
try {
|
|
75
|
-
var n = t();
|
|
76
|
-
return !r(e, n);
|
|
77
|
-
} catch {
|
|
78
|
-
return !0;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
function d(e, t) {
|
|
82
|
-
return t();
|
|
83
|
-
}
|
|
84
|
-
var f = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? d : c;
|
|
85
|
-
e.useSyncExternalStore = t.useSyncExternalStore === void 0 ? f : t.useSyncExternalStore;
|
|
86
|
-
})), V = /* @__PURE__ */ f(((e) => {
|
|
87
|
-
process.env.NODE_ENV !== "production" && (function() {
|
|
88
|
-
function t(e, t) {
|
|
89
|
-
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
90
|
-
}
|
|
91
|
-
function n(e, t) {
|
|
92
|
-
f || a.startTransition === void 0 || (f = !0, console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
|
|
93
|
-
var n = t();
|
|
94
|
-
if (!p) {
|
|
95
|
-
var i = t();
|
|
96
|
-
o(n, i) || (console.error("The result of getSnapshot should be cached to avoid an infinite loop"), p = !0);
|
|
97
|
-
}
|
|
98
|
-
i = s({ inst: {
|
|
99
|
-
value: n,
|
|
100
|
-
getSnapshot: t
|
|
101
|
-
} });
|
|
102
|
-
var l = i[0].inst, m = i[1];
|
|
103
|
-
return u(function() {
|
|
104
|
-
l.value = n, l.getSnapshot = t, r(l) && m({ inst: l });
|
|
105
|
-
}, [
|
|
106
|
-
e,
|
|
107
|
-
n,
|
|
108
|
-
t
|
|
109
|
-
]), c(function() {
|
|
110
|
-
return r(l) && m({ inst: l }), e(function() {
|
|
111
|
-
r(l) && m({ inst: l });
|
|
112
|
-
});
|
|
113
|
-
}, [e]), d(n), n;
|
|
114
|
-
}
|
|
115
|
-
function r(e) {
|
|
116
|
-
var t = e.getSnapshot;
|
|
117
|
-
e = e.value;
|
|
118
|
-
try {
|
|
119
|
-
var n = t();
|
|
120
|
-
return !o(e, n);
|
|
121
|
-
} catch {
|
|
122
|
-
return !0;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
function i(e, t) {
|
|
126
|
-
return t();
|
|
127
|
-
}
|
|
128
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
129
|
-
var a = l("react"), o = typeof Object.is == "function" ? Object.is : t, s = a.useState, c = a.useEffect, u = a.useLayoutEffect, d = a.useDebugValue, f = !1, p = !1, m = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? i : n;
|
|
130
|
-
e.useSyncExternalStore = a.useSyncExternalStore === void 0 ? m : a.useSyncExternalStore, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
131
|
-
})();
|
|
132
|
-
})), H = (/* @__PURE__ */ f(((e, t) => {
|
|
133
|
-
t.exports = process.env.NODE_ENV === "production" ? B() : V();
|
|
134
|
-
})))(), U = {
|
|
135
|
-
t: (e, t) => {
|
|
136
|
-
if (I(t)) return t;
|
|
137
|
-
if (L(t) && I(t.defaultValue)) return t.defaultValue;
|
|
138
|
-
if (typeof e == "function") return "";
|
|
139
|
-
if (Array.isArray(e)) {
|
|
140
|
-
let t = e[e.length - 1];
|
|
141
|
-
return typeof t == "function" ? "" : t;
|
|
142
|
-
}
|
|
143
|
-
return e;
|
|
144
|
-
},
|
|
145
|
-
ready: !1
|
|
146
|
-
}, W = () => () => {}, G = (e, t = {}) => {
|
|
147
|
-
let { i18n: n } = t, { i18n: r, defaultNS: i } = w(R) || {}, a = n || r || h();
|
|
148
|
-
a && !a.reportNamespaces && (a.reportNamespaces = new z()), a || j(a, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.");
|
|
149
|
-
let o = E(() => ({
|
|
150
|
-
...u(),
|
|
151
|
-
...a?.options?.react,
|
|
152
|
-
...t
|
|
153
|
-
}), [a, t]), { useSuspense: s, keyPrefix: c } = o, l = e || i || a?.options?.defaultNS, d = I(l) ? [l] : l || ["translation"], f = E(() => d, d);
|
|
154
|
-
a?.reportNamespaces?.addUsedNamespaces?.(f);
|
|
155
|
-
let p = D(0), m = C((e) => {
|
|
156
|
-
if (!a) return W;
|
|
157
|
-
let { bindI18n: t, bindI18nStore: n } = o, r = () => {
|
|
158
|
-
p.current += 1, e();
|
|
159
|
-
};
|
|
160
|
-
return t && a.on(t, r), n && a.store.on(n, r), () => {
|
|
161
|
-
t && t.split(" ").forEach((e) => a.off(e, r)), n && n.split(" ").forEach((e) => a.store.off(e, r));
|
|
162
|
-
};
|
|
163
|
-
}, [a, o]), g = D(), _ = C(() => {
|
|
164
|
-
if (!a) return U;
|
|
165
|
-
let e = !!(a.isInitialized || a.initializedStoreOnce) && f.every((e) => F(e, a, o)), n = t.lng || a.language, r = p.current, i = g.current;
|
|
166
|
-
if (i && i.ready === e && i.lng === n && i.keyPrefix === c && i.revision === r) return i;
|
|
167
|
-
let s = {
|
|
168
|
-
t: a.getFixedT(n, o.nsMode === "fallback" ? f : f[0], c, { scopeNs: f }),
|
|
169
|
-
ready: e,
|
|
170
|
-
lng: n,
|
|
171
|
-
keyPrefix: c,
|
|
172
|
-
revision: r
|
|
173
|
-
};
|
|
174
|
-
return g.current = s, s;
|
|
175
|
-
}, [
|
|
176
|
-
a,
|
|
177
|
-
f,
|
|
178
|
-
c,
|
|
179
|
-
o,
|
|
180
|
-
t.lng
|
|
181
|
-
]), [v, y] = O(0), { t: b, ready: x } = (0, H.useSyncExternalStore)(m, _, _);
|
|
182
|
-
T(() => {
|
|
183
|
-
if (a && !x && !s) {
|
|
184
|
-
let e = () => y((e) => e + 1);
|
|
185
|
-
t.lng ? P(a, t.lng, f, e) : N(a, f, e);
|
|
186
|
-
}
|
|
187
|
-
}, [
|
|
188
|
-
a,
|
|
189
|
-
t.lng,
|
|
190
|
-
f,
|
|
191
|
-
x,
|
|
192
|
-
s,
|
|
193
|
-
v
|
|
194
|
-
]);
|
|
195
|
-
let S = a || {}, k = D(null), A = D(), M = (e) => {
|
|
196
|
-
let t = Object.getOwnPropertyDescriptors(e);
|
|
197
|
-
t.__original && delete t.__original;
|
|
198
|
-
let n = Object.create(Object.getPrototypeOf(e), t);
|
|
199
|
-
if (!Object.prototype.hasOwnProperty.call(n, "__original")) try {
|
|
200
|
-
Object.defineProperty(n, "__original", {
|
|
201
|
-
value: e,
|
|
202
|
-
writable: !1,
|
|
203
|
-
enumerable: !1,
|
|
204
|
-
configurable: !1
|
|
205
|
-
});
|
|
206
|
-
} catch {}
|
|
207
|
-
return n;
|
|
208
|
-
}, L = E(() => {
|
|
209
|
-
let e = S, t = e?.language, n = e;
|
|
210
|
-
e && (k.current && k.current.__original === e && A.current === t ? n = k.current : (n = M(e), k.current = n, A.current = t));
|
|
211
|
-
let r = !x && !s ? (...e) => (j(a, "USE_T_BEFORE_READY", "useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."), b(...e)) : b, i = [
|
|
212
|
-
r,
|
|
213
|
-
n,
|
|
214
|
-
x
|
|
215
|
-
];
|
|
216
|
-
return i.t = r, i.i18n = n, i.ready = x, i;
|
|
217
|
-
}, [
|
|
218
|
-
b,
|
|
219
|
-
S,
|
|
220
|
-
x,
|
|
221
|
-
S.resolvedLanguage,
|
|
222
|
-
S.language,
|
|
223
|
-
S.languages
|
|
224
|
-
]);
|
|
225
|
-
if (a && s && !x) {
|
|
226
|
-
let e = !1;
|
|
227
|
-
try {
|
|
228
|
-
e = process.env.NODE_ENV !== "production";
|
|
229
|
-
} catch {}
|
|
230
|
-
throw e && j(a, "SUSPENDED_WHILE_LOADING", "useTranslation: suspended while translations are loading (useSuspense is true by default). Add a <Suspense> boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook"), new Promise((e) => {
|
|
231
|
-
let n = () => e();
|
|
232
|
-
t.lng ? P(a, t.lng, f, n) : N(a, f, n);
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
return L;
|
|
236
|
-
}, K = { app: x("app") }, q = (e = "app") => {
|
|
237
|
-
K[e] || (K[e] = x(e));
|
|
238
|
-
let t = S(K[e]);
|
|
239
|
-
if (!t) throw Error(i.use.contextErr({ key: e }));
|
|
240
|
-
return t;
|
|
241
|
-
}, J = (e) => {
|
|
242
|
-
let t = D(), n = D();
|
|
243
|
-
return t.current = e, n.current ||= (...e) => t.current(...e), n.current;
|
|
244
|
-
}, Y = (t = {}) => {
|
|
245
|
-
let [n, r] = O(Object.keys(t).reduce((e, t) => (e[t] = `vast-${t}-0`, e), {})), i = D(t), a = D(!1), o = J((e) => {
|
|
246
|
-
let t = `vast-${e}-${v("-")}`;
|
|
247
|
-
r({
|
|
248
|
-
...n,
|
|
249
|
-
[e]: t
|
|
250
|
-
});
|
|
251
|
-
}), c = (n, r = t) => {
|
|
252
|
-
let a = n ? r[n] : r;
|
|
253
|
-
if (typeof a != "object" || !a) return;
|
|
254
|
-
let c = new Proxy(a, {
|
|
255
|
-
get(t, r, i) {
|
|
256
|
-
let a = e(t), c = Reflect.get(t, r, a === "map" || a === "set" ? t : i);
|
|
257
|
-
return s(c, "function") ? [
|
|
258
|
-
"add",
|
|
259
|
-
"set",
|
|
260
|
-
"delete",
|
|
261
|
-
"clear",
|
|
262
|
-
"fill",
|
|
263
|
-
"pop",
|
|
264
|
-
"push",
|
|
265
|
-
"reverse",
|
|
266
|
-
"shift",
|
|
267
|
-
"sort",
|
|
268
|
-
"splice",
|
|
269
|
-
"unshift"
|
|
270
|
-
].includes(r) ? (...e) => {
|
|
271
|
-
let i = c.apply(t, e);
|
|
272
|
-
return o(n ?? r), i;
|
|
273
|
-
} : (...e) => c.apply(t, e) : c;
|
|
274
|
-
},
|
|
275
|
-
set(e, t, r, i) {
|
|
276
|
-
if (Reflect.get(e, t, i) === r) return !0;
|
|
277
|
-
let a = Reflect.set(e, t, r, i);
|
|
278
|
-
return o(n ?? t), a;
|
|
279
|
-
},
|
|
280
|
-
deleteProperty(e, t) {
|
|
281
|
-
if (!Reflect.has(e, t)) return !0;
|
|
282
|
-
let r = Reflect.deleteProperty(e, t);
|
|
283
|
-
return o(n ?? t), r;
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
|
-
if (n) i.current[n] = c;
|
|
287
|
-
else return c;
|
|
288
|
-
};
|
|
289
|
-
if (!a.current) {
|
|
290
|
-
i.current = c();
|
|
291
|
-
for (let e in t) c(e);
|
|
292
|
-
a.current = !0;
|
|
293
|
-
}
|
|
294
|
-
return T(() => () => {
|
|
295
|
-
for (let e in i.current) delete i.current[e];
|
|
296
|
-
a.current = !1;
|
|
297
|
-
}, []), [n, i.current];
|
|
298
|
-
}, X = (e, t) => {
|
|
299
|
-
let [n, r] = O(!0), i = D({
|
|
300
|
-
isMounted: !1,
|
|
301
|
-
lastCallId: 0
|
|
302
|
-
}).current;
|
|
303
|
-
T(() => {
|
|
304
|
-
i.isMounted = !0;
|
|
305
|
-
let e = !t?.length && a();
|
|
306
|
-
return async () => {
|
|
307
|
-
(await e)?.(), i.isMounted = !1;
|
|
308
|
-
};
|
|
309
|
-
}, []);
|
|
310
|
-
let a = C((...t) => {
|
|
311
|
-
let a = ++i.lastCallId;
|
|
312
|
-
return n || r(!0), e(...t).then((e) => (i.isMounted && a === i.lastCallId && r(!1), e), (e) => (i.isMounted && a === i.lastCallId && r(!1), e));
|
|
313
|
-
}, t);
|
|
314
|
-
return [n, a];
|
|
315
|
-
}, Z = (e = "simple", t = []) => {
|
|
316
|
-
let n = {
|
|
317
|
-
exe: m.exe,
|
|
318
|
-
cv: m.cv,
|
|
319
|
-
db: m.db
|
|
320
|
-
}, r = D([
|
|
321
|
-
"store",
|
|
322
|
-
"system",
|
|
323
|
-
"project",
|
|
324
|
-
"level",
|
|
325
|
-
"defects",
|
|
326
|
-
"running",
|
|
327
|
-
...t
|
|
328
|
-
]).current, a = S(K.app);
|
|
329
|
-
switch (e) {
|
|
330
|
-
case "privatize": return Object.assign(n, a);
|
|
331
|
-
case "simple": return r.reduce((e, t) => (e[t] = a[t], e), n);
|
|
332
|
-
case "action": return [r.reduce((e, t) => (e[t] = a[t], e), n), {
|
|
333
|
-
sysAction: a.sysAction,
|
|
334
|
-
setRunning: a.setRunning,
|
|
335
|
-
proAction: a.proAction
|
|
336
|
-
}];
|
|
337
|
-
default: throw Error(i.use.patternErr({ pattern: e }));
|
|
338
|
-
}
|
|
339
|
-
}, Q = (e, t, n = { immediate: !1 }) => {
|
|
340
|
-
let r = D({
|
|
341
|
-
oldValue: null,
|
|
342
|
-
isInit: n.immediate,
|
|
343
|
-
isWatch: !0
|
|
344
|
-
}).current;
|
|
345
|
-
return T(() => {
|
|
346
|
-
r.isWatch && (r.isInit ? (p(t, r.oldValue) || e(t, r.oldValue), r.oldValue = d(t)) : r.isInit = !0);
|
|
347
|
-
}, t), () => {
|
|
348
|
-
r.isWatch = !1;
|
|
349
|
-
};
|
|
350
|
-
}, ee = (e = "") => {
|
|
351
|
-
if (!e) throw Error(i.use.prefixErr());
|
|
352
|
-
let { t } = G("translation", { keyPrefix: e });
|
|
353
|
-
return t;
|
|
354
|
-
}, te = (e, t, n = !1) => {
|
|
355
|
-
let i = J(e);
|
|
356
|
-
return T(() => (n && i(), a(t, i), () => r(t, i)), []), i;
|
|
357
|
-
}, $ = (e, t) => {
|
|
358
|
-
let n = D({
|
|
359
|
-
immediate: !1,
|
|
360
|
-
fps: 17,
|
|
361
|
-
beforeFn: null
|
|
362
|
-
}).current;
|
|
363
|
-
if (s(t, "boolean")) n.immediate = t;
|
|
364
|
-
else if (s(t, "number")) n.fps = t;
|
|
365
|
-
else if (s(t, "function")) n.beforeFn = t;
|
|
366
|
-
else if (s(t, "object")) for (let e in t) Object.hasOwn(n, e) && (n[e] = t[e]);
|
|
367
|
-
let r = y(e, 60 * n.fps);
|
|
368
|
-
T(() => (n.beforeFn?.(), n.immediate && r(), window.addEventListener("resize", r), () => window.removeEventListener("resize", r)), []);
|
|
369
|
-
}, ne = (e, t, n) => {
|
|
370
|
-
let [r, i] = O({
|
|
371
|
-
width: n?.width || 0,
|
|
372
|
-
height: n?.height || 0
|
|
373
|
-
}), a = D(), o = D({
|
|
374
|
-
immediate: !1,
|
|
375
|
-
fps: 12,
|
|
376
|
-
beforeFn: null
|
|
377
|
-
}).current;
|
|
378
|
-
if (s(n, "boolean")) o.immediate = n;
|
|
379
|
-
else if (s(n, "number")) o.fps = n;
|
|
380
|
-
else if (s(n, "function")) o.beforeFn = n;
|
|
381
|
-
else if (s(n, "object")) for (let e in n) Object.hasOwn(o, e) && (o[e] = n[e]);
|
|
382
|
-
let c = () => a.current?.observe?.(t.current), l = () => a.current?.unobserve?.(t.current), u = J((t) => {
|
|
383
|
-
let n = t[0].contentRect, { width: a, height: o } = n;
|
|
384
|
-
(a !== r.width || o !== r.height) && e?.(n, r), i({
|
|
385
|
-
width: a,
|
|
386
|
-
height: o
|
|
387
|
-
});
|
|
388
|
-
});
|
|
389
|
-
return T(() => {
|
|
390
|
-
if (t.current) return a.current = new ResizeObserver(y(u, 10 * o.fps)), a.current.observe(t.current), () => a.current?.disconnect?.();
|
|
391
|
-
}, [t, e]), $(() => {
|
|
392
|
-
if (!t.current) return;
|
|
393
|
-
let e = t.current;
|
|
394
|
-
i({
|
|
395
|
-
width: e.offsetWidth,
|
|
396
|
-
height: e.offsetHeight
|
|
397
|
-
});
|
|
398
|
-
}, n), [r, {
|
|
399
|
-
observe: c,
|
|
400
|
-
unobserve: l
|
|
401
|
-
}];
|
|
402
|
-
}, re = (e = "app", t = !1) => {
|
|
403
|
-
let { context: n } = Z("privatize"), r = D(b.useMessage()), i = D([]), a = (e, t, { key: n, duration: a = 3, onClose: o } = {}) => {
|
|
404
|
-
let s = n || `msg_${v()}`;
|
|
405
|
-
return i.current.push(s), r.current[0].open({
|
|
406
|
-
key: s,
|
|
407
|
-
type: e,
|
|
408
|
-
content: t,
|
|
409
|
-
duration: a,
|
|
410
|
-
classNames: { root: "aoi-message" },
|
|
411
|
-
onClose: () => {
|
|
412
|
-
let e = i.current.indexOf(s);
|
|
413
|
-
e !== -1 && i.current.splice(e, 1), o?.();
|
|
414
|
-
}
|
|
415
|
-
}), s;
|
|
416
|
-
}, o = (e, t = {}) => a("success", e, t), s = (e, t = {}) => a("error", e, t);
|
|
417
|
-
return T(() => {
|
|
418
|
-
if (!n.msgs) return;
|
|
419
|
-
let i = n.msgs.get(e);
|
|
420
|
-
return i ? r.current = i : t || n.msgs.set(e, r.current), () => {
|
|
421
|
-
t && n.msgs.delete(e);
|
|
422
|
-
};
|
|
423
|
-
}, []), [{
|
|
424
|
-
success: o,
|
|
425
|
-
error: s,
|
|
426
|
-
info: (e, t = {}) => a("info", e, t),
|
|
427
|
-
warning: (e, t = {}) => a("warning", e, t),
|
|
428
|
-
loading: (e, t = {}) => {
|
|
429
|
-
let n = a("loading", e, {
|
|
430
|
-
duration: 0,
|
|
431
|
-
...t
|
|
432
|
-
});
|
|
433
|
-
return {
|
|
434
|
-
key: n,
|
|
435
|
-
ok: (e) => o(e, { key: n }),
|
|
436
|
-
err: (e) => s(e, { key: n })
|
|
437
|
-
};
|
|
438
|
-
}
|
|
439
|
-
}, t ? r.current[1] : void 0];
|
|
440
|
-
}, ie = (e, r = {}) => {
|
|
441
|
-
let [a, o] = O(r), l = D(s(e, "function")).current, u = () => {
|
|
442
|
-
c(e, (e) => {
|
|
443
|
-
let t = {};
|
|
444
|
-
for (let n in r) t[n] = e?.[n] ?? r[n];
|
|
445
|
-
o(t);
|
|
446
|
-
});
|
|
447
|
-
}, d = (n) => {
|
|
448
|
-
t(e, n);
|
|
449
|
-
}, f = J((t, r, s = null) => {
|
|
450
|
-
a[t] = r, o({
|
|
451
|
-
...a,
|
|
452
|
-
[t]: r
|
|
453
|
-
}), l && e(t, r), s?.(i.tool.setOk(), { key: n });
|
|
454
|
-
}), p = J((t, r = null) => {
|
|
455
|
-
o({
|
|
456
|
-
...a,
|
|
457
|
-
...t
|
|
458
|
-
}), l && e(t), r?.(i.tool.setOk(), { key: n });
|
|
459
|
-
});
|
|
460
|
-
T(() => {
|
|
461
|
-
l || u();
|
|
462
|
-
}, []);
|
|
463
|
-
let m = Q(([e]) => {
|
|
464
|
-
d(e);
|
|
465
|
-
}, [a]);
|
|
466
|
-
return l && m(), [a, {
|
|
467
|
-
setData: p,
|
|
468
|
-
setKey: f
|
|
469
|
-
}];
|
|
470
|
-
}, ae = (e, t = o) => {
|
|
471
|
-
let [n, r] = O([]), [i, a] = O(0), [s, c] = O({
|
|
472
|
-
current: 1,
|
|
473
|
-
pageSize: t[0]
|
|
474
|
-
}), l = D([]);
|
|
475
|
-
return [n, {
|
|
476
|
-
value: l.current,
|
|
477
|
-
current: s.current,
|
|
478
|
-
pageSize: s.pageSize,
|
|
479
|
-
options: t,
|
|
480
|
-
total: i,
|
|
481
|
-
setValue: (t, n) => {
|
|
482
|
-
let i = s.pageSize, o = s.current;
|
|
483
|
-
g(n) && (o = 1, !e && (l.current = t), a(n), c({
|
|
484
|
-
current: o,
|
|
485
|
-
pageSize: i
|
|
486
|
-
}));
|
|
487
|
-
let u = (o - 1) * i, d = u + i;
|
|
488
|
-
r(e ? t : t.slice(u, d));
|
|
489
|
-
},
|
|
490
|
-
onChange: (t, n) => {
|
|
491
|
-
let i = (t - 1) * n, a = i + n, o = {
|
|
492
|
-
current: t,
|
|
493
|
-
pageSize: n
|
|
494
|
-
};
|
|
495
|
-
e ? e(o) : r(l.current.slice(i, a)), c(o);
|
|
496
|
-
}
|
|
497
|
-
}];
|
|
498
|
-
}, oe = () => {
|
|
499
|
-
let [e, t] = O({
|
|
500
|
-
ok: 0,
|
|
501
|
-
ng: 0
|
|
502
|
-
}), n = J((n) => {
|
|
503
|
-
let r = { ...e };
|
|
504
|
-
r[n ? "ok" : "ng"] += 1, t(r);
|
|
505
|
-
});
|
|
506
|
-
return {
|
|
507
|
-
statis: e,
|
|
508
|
-
data: E(() => [{
|
|
509
|
-
label: "OK",
|
|
510
|
-
value: e.ok,
|
|
511
|
-
color: _.ok
|
|
512
|
-
}, {
|
|
513
|
-
label: "NG",
|
|
514
|
-
value: e.ng,
|
|
515
|
-
color: _.ng
|
|
516
|
-
}], [e]),
|
|
517
|
-
increment: n,
|
|
518
|
-
clear: () => {
|
|
519
|
-
t({
|
|
520
|
-
ok: 0,
|
|
521
|
-
ng: 0
|
|
522
|
-
});
|
|
523
|
-
}
|
|
524
|
-
};
|
|
525
|
-
};
|
|
526
|
-
//#endregion
|
|
527
|
-
export { R as _, ie as a, k as b, te as c, ee as d, $ as f, G as g, Q as h, X as i, ae as l, Y as m, K as n, re as o, Z as p, q as r, ne as s, oe as t, J as u, L as v, j as x, I as y };
|