@fox-js/fox 3.1.1-4 → 3.1.1-5
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/libs/index.cjs.js +2 -2
- package/libs/index.esm.js +93 -93
- package/libs/index.umd.js +2 -2
- package/package.json +2 -1
package/libs/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref as ss, shallowReactive as ns, reactive as is, effectScope as os, watch as ls, toRaw as Ot, getCurrentInstance as Dt, onUnmounted as ut, shallowRef as as, defineComponent as Sr, inject as Q, provide as se, h as he } from "vue";
|
|
2
2
|
/*!
|
|
3
|
-
* fox v3.1.0
|
|
3
|
+
* fox v3.1.0 Thu Aug 22 2024 23:19:31 GMT+0800 (中国标准时间)
|
|
4
4
|
*/
|
|
5
5
|
const me = typeof window < "u", _ = function() {
|
|
6
6
|
return window;
|
|
@@ -93,7 +93,7 @@ class le {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
const pt = ds ? Promise.resolve() : null;
|
|
96
|
-
function
|
|
96
|
+
function He(s, ...e) {
|
|
97
97
|
pt !== null ? e && e.length > 0 ? pt.then(() => {
|
|
98
98
|
s(e);
|
|
99
99
|
}) : pt.then(s) : e && e.length > 0 ? setTimeout(() => {
|
|
@@ -757,7 +757,7 @@ class Ps {
|
|
|
757
757
|
this.name = e, this.level = t, this.rootName = r, this.rootIndex = n;
|
|
758
758
|
}
|
|
759
759
|
}
|
|
760
|
-
class
|
|
760
|
+
class Pe {
|
|
761
761
|
/**
|
|
762
762
|
* 目标路由
|
|
763
763
|
*/
|
|
@@ -788,7 +788,7 @@ class He {
|
|
|
788
788
|
* @returns
|
|
789
789
|
*/
|
|
790
790
|
static from(e) {
|
|
791
|
-
const t = new
|
|
791
|
+
const t = new Pe(e.to, e.from), r = e.data ?? {};
|
|
792
792
|
return $(!0, t.data, r), t;
|
|
793
793
|
}
|
|
794
794
|
/**
|
|
@@ -1014,7 +1014,7 @@ class gt {
|
|
|
1014
1014
|
layers = [];
|
|
1015
1015
|
}
|
|
1016
1016
|
var q = /* @__PURE__ */ ((s) => (s[s.Push = 0] = "Push", s[s.Replace = 1] = "Replace", s[s.Put = 2] = "Put", s[s.Append = 3] = "Append", s[s.Open = 4] = "Open", s))(q || {});
|
|
1017
|
-
const Cs = "FoxBeforeEnter", Fs = "FoxEnter", As = "FoxLeave", _s = "FoxLeave", Mt = "FoxLeaveEnd", k = Symbol("chainKey"), N = Symbol("cursorKey"), vt = Symbol("$persistentModeKey"), A = Symbol("statusKey"), Z = Symbol("argsKey"), Be = Symbol("exArgsKey"), ve = Symbol("successFnsKey"),
|
|
1017
|
+
const Cs = "FoxBeforeEnter", Fs = "FoxEnter", As = "FoxLeave", _s = "FoxLeave", Mt = "FoxLeaveEnd", k = Symbol("chainKey"), N = Symbol("cursorKey"), vt = Symbol("$persistentModeKey"), A = Symbol("statusKey"), Z = Symbol("argsKey"), Be = Symbol("exArgsKey"), ve = Symbol("successFnsKey"), _e = Symbol("errorFnsKey"), ae = Symbol("sessionKey"), ee = Symbol("_go");
|
|
1018
1018
|
class ot {
|
|
1019
1019
|
/**
|
|
1020
1020
|
* 事件链路
|
|
@@ -1047,7 +1047,7 @@ class ot {
|
|
|
1047
1047
|
/**
|
|
1048
1048
|
* 错误函数
|
|
1049
1049
|
*/
|
|
1050
|
-
[
|
|
1050
|
+
[_e] = [];
|
|
1051
1051
|
/**
|
|
1052
1052
|
* 链路session
|
|
1053
1053
|
*/
|
|
@@ -1078,10 +1078,10 @@ class ot {
|
|
|
1078
1078
|
let a = [{
|
|
1079
1079
|
session: this[ae]
|
|
1080
1080
|
}, ...this[Be]];
|
|
1081
|
-
for (; this[
|
|
1081
|
+
for (; this[_e].length > 0; )
|
|
1082
1082
|
try {
|
|
1083
|
-
let l = this[
|
|
1084
|
-
typeof l == "function" &&
|
|
1083
|
+
let l = this[_e].shift();
|
|
1084
|
+
typeof l == "function" && He(() => {
|
|
1085
1085
|
Reflect.apply(l, {}, a);
|
|
1086
1086
|
});
|
|
1087
1087
|
} catch (l) {
|
|
@@ -1094,7 +1094,7 @@ class ot {
|
|
|
1094
1094
|
}, ...this[Z]];
|
|
1095
1095
|
for (; this[ve].length > 0; ) {
|
|
1096
1096
|
let l = this[ve].shift();
|
|
1097
|
-
typeof l == "function" &&
|
|
1097
|
+
typeof l == "function" && He(() => {
|
|
1098
1098
|
Reflect.apply(l, {}, a);
|
|
1099
1099
|
});
|
|
1100
1100
|
}
|
|
@@ -1126,7 +1126,7 @@ class ot {
|
|
|
1126
1126
|
//session
|
|
1127
1127
|
session: this[ae]
|
|
1128
1128
|
};
|
|
1129
|
-
|
|
1129
|
+
He(() => {
|
|
1130
1130
|
Reflect.apply(n, {}, [a, ...this[Z]]);
|
|
1131
1131
|
});
|
|
1132
1132
|
} catch (o) {
|
|
@@ -1174,7 +1174,7 @@ class ot {
|
|
|
1174
1174
|
}, ...this[Z]];
|
|
1175
1175
|
for (; this[ve].length > 0; ) {
|
|
1176
1176
|
let n = this[ve].shift();
|
|
1177
|
-
|
|
1177
|
+
He(() => {
|
|
1178
1178
|
Reflect.apply(n, this, r);
|
|
1179
1179
|
});
|
|
1180
1180
|
}
|
|
@@ -1195,7 +1195,7 @@ class ot {
|
|
|
1195
1195
|
* @returns
|
|
1196
1196
|
*/
|
|
1197
1197
|
wait(e, t) {
|
|
1198
|
-
return e && typeof e == "function" && this[ve].push(e), t && typeof t == "function" && this[
|
|
1198
|
+
return e && typeof e == "function" && this[ve].push(e), t && typeof t == "function" && this[_e].push(t), this[A] === "Busy" ? this : (Reflect.apply(this[ee], this, [0, ...this[Z]]), this);
|
|
1199
1199
|
}
|
|
1200
1200
|
/**
|
|
1201
1201
|
* 加入异常处理任务
|
|
@@ -1203,7 +1203,7 @@ class ot {
|
|
|
1203
1203
|
* @returns
|
|
1204
1204
|
*/
|
|
1205
1205
|
exception(e) {
|
|
1206
|
-
return e && typeof e == "function" && this[
|
|
1206
|
+
return e && typeof e == "function" && this[_e].push(e), this[A] === "Busy" ? this : Reflect.apply(this[ee], this, [0, ...this[Z]]);
|
|
1207
1207
|
}
|
|
1208
1208
|
/**
|
|
1209
1209
|
* 判断事件链是否已经执行完成
|
|
@@ -1333,7 +1333,7 @@ class nr {
|
|
|
1333
1333
|
let i = r[n];
|
|
1334
1334
|
if (i.policy == 1 ? r.splice(n, 1) : n++, typeof i.callback == "function")
|
|
1335
1335
|
try {
|
|
1336
|
-
|
|
1336
|
+
He(() => {
|
|
1337
1337
|
Reflect.apply(i.callback, {}, t);
|
|
1338
1338
|
});
|
|
1339
1339
|
} catch (o) {
|
|
@@ -1352,12 +1352,12 @@ class nr {
|
|
|
1352
1352
|
return Reflect.apply(this.emit, this, [e, ...t]);
|
|
1353
1353
|
}
|
|
1354
1354
|
}
|
|
1355
|
-
const
|
|
1355
|
+
const Te = Symbol("registerKey");
|
|
1356
1356
|
class Ks {
|
|
1357
1357
|
/**
|
|
1358
1358
|
* 数据列表
|
|
1359
1359
|
*/
|
|
1360
|
-
[
|
|
1360
|
+
[Te] = /* @__PURE__ */ new Map();
|
|
1361
1361
|
/**
|
|
1362
1362
|
* 构造函数
|
|
1363
1363
|
*/
|
|
@@ -1369,7 +1369,7 @@ class Ks {
|
|
|
1369
1369
|
* @param value
|
|
1370
1370
|
*/
|
|
1371
1371
|
set(e, t) {
|
|
1372
|
-
this[
|
|
1372
|
+
this[Te].set(e, t);
|
|
1373
1373
|
}
|
|
1374
1374
|
/**
|
|
1375
1375
|
* 获取数据
|
|
@@ -1377,7 +1377,7 @@ class Ks {
|
|
|
1377
1377
|
* @returns
|
|
1378
1378
|
*/
|
|
1379
1379
|
get(e) {
|
|
1380
|
-
return this[
|
|
1380
|
+
return this[Te].get(e);
|
|
1381
1381
|
}
|
|
1382
1382
|
/**
|
|
1383
1383
|
* 是否有对应的数据
|
|
@@ -1385,7 +1385,7 @@ class Ks {
|
|
|
1385
1385
|
* @returns
|
|
1386
1386
|
*/
|
|
1387
1387
|
has(e) {
|
|
1388
|
-
return this[
|
|
1388
|
+
return this[Te].has(e);
|
|
1389
1389
|
}
|
|
1390
1390
|
/**
|
|
1391
1391
|
* 删除数据
|
|
@@ -1393,7 +1393,7 @@ class Ks {
|
|
|
1393
1393
|
* @returns
|
|
1394
1394
|
*/
|
|
1395
1395
|
delete(e) {
|
|
1396
|
-
return this[
|
|
1396
|
+
return this[Te].delete(e);
|
|
1397
1397
|
}
|
|
1398
1398
|
}
|
|
1399
1399
|
const de = Symbol("lc");
|
|
@@ -1828,7 +1828,7 @@ class ne {
|
|
|
1828
1828
|
this.route = e, this.model = t, this.index = r, this.active = n;
|
|
1829
1829
|
}
|
|
1830
1830
|
}
|
|
1831
|
-
class
|
|
1831
|
+
class Ke {
|
|
1832
1832
|
/**
|
|
1833
1833
|
* model slots列表
|
|
1834
1834
|
*/
|
|
@@ -1973,7 +1973,7 @@ class zs {
|
|
|
1973
1973
|
this.submitRecorder.time === e && (this.submitRecorder.route = void 0);
|
|
1974
1974
|
}
|
|
1975
1975
|
}
|
|
1976
|
-
const
|
|
1976
|
+
const Ee = Symbol("_notifyChange");
|
|
1977
1977
|
class fr {
|
|
1978
1978
|
//当前路由
|
|
1979
1979
|
currentRoute;
|
|
@@ -1988,8 +1988,8 @@ class fr {
|
|
|
1988
1988
|
this.currentRoute = e, this.routes = t;
|
|
1989
1989
|
}
|
|
1990
1990
|
}
|
|
1991
|
-
const ue = Symbol("historyChangeConsumerKey"), cr = Symbol("_navigateFirstRoute"), Ve = Symbol("_getRouteMark"), St = Symbol("_getUrlSearch"), Pt = Symbol("_generateLocation"), We = Symbol("_setRouteMarkRecorder"),
|
|
1992
|
-
function
|
|
1991
|
+
const ue = Symbol("historyChangeConsumerKey"), cr = Symbol("_navigateFirstRoute"), Ve = Symbol("_getRouteMark"), St = Symbol("_getUrlSearch"), Pt = Symbol("_generateLocation"), We = Symbol("_setRouteMarkRecorder"), $e = Symbol("beforeRestoreFiltersKey"), hr = Symbol("_beforeRestore"), yr = "Symbol(_fox_restore_point)";
|
|
1992
|
+
function qe(s, ...e) {
|
|
1993
1993
|
return typeof s == "function" ? Reflect.apply(s, null, [...e]) : s;
|
|
1994
1994
|
}
|
|
1995
1995
|
function dr(s) {
|
|
@@ -2044,7 +2044,7 @@ class Hr {
|
|
|
2044
2044
|
/**
|
|
2045
2045
|
* before restore 过滤器队列(用于刷新还原)
|
|
2046
2046
|
*/
|
|
2047
|
-
[
|
|
2047
|
+
[$e] = new Array();
|
|
2048
2048
|
/**
|
|
2049
2049
|
* 回退timeout
|
|
2050
2050
|
*/
|
|
@@ -2079,9 +2079,9 @@ class Hr {
|
|
|
2079
2079
|
this[ue] = !1;
|
|
2080
2080
|
return;
|
|
2081
2081
|
}
|
|
2082
|
-
if (
|
|
2082
|
+
if (qe(this.historyMonitor)) {
|
|
2083
2083
|
const r = t.history.state;
|
|
2084
|
-
this[
|
|
2084
|
+
this[Ee](r);
|
|
2085
2085
|
try {
|
|
2086
2086
|
let n = [];
|
|
2087
2087
|
if (typeof r == "string" ? n = JSON.parse(r) : n = r, Array.isArray(n) && n.length > 0) {
|
|
@@ -2110,7 +2110,7 @@ class Hr {
|
|
|
2110
2110
|
* @param routes
|
|
2111
2111
|
*/
|
|
2112
2112
|
[hr](e, t, r, n) {
|
|
2113
|
-
for (let i of this[
|
|
2113
|
+
for (let i of this[$e])
|
|
2114
2114
|
try {
|
|
2115
2115
|
const o = Reflect.apply(i, {}, [e, t, r, n]);
|
|
2116
2116
|
if (o === !1)
|
|
@@ -2125,7 +2125,7 @@ class Hr {
|
|
|
2125
2125
|
* @param filter
|
|
2126
2126
|
*/
|
|
2127
2127
|
beforeRestoreEach(e) {
|
|
2128
|
-
this[
|
|
2128
|
+
this[$e].push(e);
|
|
2129
2129
|
}
|
|
2130
2130
|
/**
|
|
2131
2131
|
* 移除before restore filter
|
|
@@ -2133,8 +2133,8 @@ class Hr {
|
|
|
2133
2133
|
* @returns
|
|
2134
2134
|
*/
|
|
2135
2135
|
removeBeforeRestoreEach(e) {
|
|
2136
|
-
const t = this[
|
|
2137
|
-
return t !== -1 ? (this[
|
|
2136
|
+
const t = this[$e].indexOf(e);
|
|
2137
|
+
return t !== -1 ? (this[$e].splice(t, 1), !0) : !1;
|
|
2138
2138
|
}
|
|
2139
2139
|
/**
|
|
2140
2140
|
* 导航到第一个route
|
|
@@ -2148,7 +2148,7 @@ class Hr {
|
|
|
2148
2148
|
const a = o.routes.filter((l, u) => (l.params = l.params ? Fr(l.params) : {}, this[hr](l, u, e, o.routes)));
|
|
2149
2149
|
if (a.length > 0) {
|
|
2150
2150
|
const l = this[St](), u = a.length - 1;
|
|
2151
|
-
a[u].query = l || a[u].query, this[
|
|
2151
|
+
a[u].query = l || a[u].query, this[Ee](a);
|
|
2152
2152
|
return;
|
|
2153
2153
|
}
|
|
2154
2154
|
}
|
|
@@ -2158,7 +2158,7 @@ class Hr {
|
|
|
2158
2158
|
let n;
|
|
2159
2159
|
r != -1 ? n = e.substring(r + 1) : n = e;
|
|
2160
2160
|
const i = new S();
|
|
2161
|
-
i.path = n, i.query = this[St](), this[
|
|
2161
|
+
i.path = n, i.query = this[St](), this[Ee]([i]);
|
|
2162
2162
|
}
|
|
2163
2163
|
/**
|
|
2164
2164
|
* 设置当前route mark的记录
|
|
@@ -2191,7 +2191,7 @@ class Hr {
|
|
|
2191
2191
|
/**
|
|
2192
2192
|
* 通知修改
|
|
2193
2193
|
*/
|
|
2194
|
-
[
|
|
2194
|
+
[Ee](e) {
|
|
2195
2195
|
typeof this.changeHandler == "function" && this.changeHandler(e);
|
|
2196
2196
|
}
|
|
2197
2197
|
/**
|
|
@@ -2243,7 +2243,7 @@ class Hr {
|
|
|
2243
2243
|
let i = !1;
|
|
2244
2244
|
for (let f = n.length - 1; f >= 0; f--) {
|
|
2245
2245
|
const c = S.from(n[f]);
|
|
2246
|
-
if (!(c.historyUpdatePolicy === "traceless" ||
|
|
2246
|
+
if (!(c.historyUpdatePolicy === "traceless" || qe(this.traceless, c)) && S.isSame(c, e)) {
|
|
2247
2247
|
i = !0;
|
|
2248
2248
|
break;
|
|
2249
2249
|
}
|
|
@@ -2268,7 +2268,7 @@ class Hr {
|
|
|
2268
2268
|
let p = !1;
|
|
2269
2269
|
for (let m = h - 1; m >= 0; m--) {
|
|
2270
2270
|
const g = S.from(c[m]);
|
|
2271
|
-
if (!(g.traceless === !0 ||
|
|
2271
|
+
if (!(g.traceless === !0 || qe(this.traceless, g)) && S.isSame(g, e)) {
|
|
2272
2272
|
p = !0;
|
|
2273
2273
|
break;
|
|
2274
2274
|
}
|
|
@@ -2298,7 +2298,7 @@ class Hr {
|
|
|
2298
2298
|
*/
|
|
2299
2299
|
push(e) {
|
|
2300
2300
|
const t = this[Pt](e.currentRoute);
|
|
2301
|
-
e.currentRoute.historyUpdatePolicy !== "traceless" &&
|
|
2301
|
+
e.currentRoute.historyUpdatePolicy !== "traceless" && !qe(this.traceless, e.currentRoute) && _().history.pushState(e.routes, "", t), this.setRouteMark(e);
|
|
2302
2302
|
}
|
|
2303
2303
|
/**
|
|
2304
2304
|
* 替换当前记录
|
|
@@ -2306,7 +2306,7 @@ class Hr {
|
|
|
2306
2306
|
*/
|
|
2307
2307
|
replace(e) {
|
|
2308
2308
|
const t = this[Pt](e.currentRoute);
|
|
2309
|
-
(e.currentRoute.historyUpdatePolicy !== "traceless" ||
|
|
2309
|
+
(e.currentRoute.historyUpdatePolicy !== "traceless" || !qe(this.traceless, e.currentRoute)) && _().history.replaceState(e.routes, "", t), this.setRouteMark(e);
|
|
2310
2310
|
}
|
|
2311
2311
|
/**
|
|
2312
2312
|
* 生成Location
|
|
@@ -2414,7 +2414,7 @@ class Gs {
|
|
|
2414
2414
|
/**
|
|
2415
2415
|
* 通知修改
|
|
2416
2416
|
*/
|
|
2417
|
-
[
|
|
2417
|
+
[Ee](e) {
|
|
2418
2418
|
typeof this.changeHandler == "function" && this.changeHandler(e);
|
|
2419
2419
|
}
|
|
2420
2420
|
/**
|
|
@@ -2431,7 +2431,7 @@ class Gs {
|
|
|
2431
2431
|
let n = !1;
|
|
2432
2432
|
if (typeof t == "function" ? n = t() : n = t, !n) {
|
|
2433
2433
|
const i = this.queue[r];
|
|
2434
|
-
this[
|
|
2434
|
+
this[Ee](i.routes);
|
|
2435
2435
|
}
|
|
2436
2436
|
}
|
|
2437
2437
|
}
|
|
@@ -2491,7 +2491,7 @@ class Gs {
|
|
|
2491
2491
|
function Qs(s = "", e = 50) {
|
|
2492
2492
|
return new Gs(s, e);
|
|
2493
2493
|
}
|
|
2494
|
-
const ze = Symbol("_constructRouteModel"), Je = Symbol("_findRouteModel"), Et = Symbol("_findRootView"), mr = Symbol("_getFirstView"), fe = Symbol("_removeView"), pr = Symbol("_buildPage"), gr = Symbol("_resolveComponent"), vr = Symbol("_update"), ie = Symbol("_merge"), Ct = Symbol("_handleHistoryChange"), Ge = Symbol("_handleRouteUpdated"), Qe = Symbol("routeUpdatedCallback"), w = Symbol("currentRoutes"), Xe = Symbol("routeSessionCacheKey"), wr = Symbol("_addRouteRecorder"),
|
|
2494
|
+
const ze = Symbol("_constructRouteModel"), Je = Symbol("_findRouteModel"), Et = Symbol("_findRootView"), mr = Symbol("_getFirstView"), fe = Symbol("_removeView"), pr = Symbol("_buildPage"), gr = Symbol("_resolveComponent"), vr = Symbol("_update"), ie = Symbol("_merge"), Ct = Symbol("_handleHistoryChange"), Ge = Symbol("_handleRouteUpdated"), Qe = Symbol("routeUpdatedCallback"), w = Symbol("currentRoutes"), Xe = Symbol("routeSessionCacheKey"), wr = Symbol("_addRouteRecorder"), je = Symbol("_removeRouteRecorder"), Ye = Symbol("_cloneRouteRecorder"), L = Symbol("_handleError"), Ze = Symbol("errorCallback"), B = Symbol("registerKey"), et = Symbol("notFoundKey"), Ft = Symbol("notFoundPathKey"), V = Symbol("forestKey"), C = Symbol("historyKey"), Le = Symbol("beforeFiltersKey"), Oe = Symbol("afterFiltersKey"), Me = Symbol("destroyFiltersKey"), At = Symbol("propsFilterKey"), be = Symbol("mainDispatcherKey"), _t = Symbol("initKey"), ce = Symbol("readyKey"), Tt = Symbol("readyHandlersKey"), tt = Symbol("_markReady"), br = Symbol("_createNextFn"), Kt = Symbol("_start"), $t = Symbol("_before"), qt = Symbol("_after"), xr = Symbol("_destroy"), jt = Symbol("_load"), Ie = Symbol("_unload"), Ne = Symbol("routerGuardKey");
|
|
2495
2495
|
function Xs(s) {
|
|
2496
2496
|
return s.layers.length == 0 || s.layers[0].views.length == 0;
|
|
2497
2497
|
}
|
|
@@ -2556,15 +2556,15 @@ class Zs {
|
|
|
2556
2556
|
/**
|
|
2557
2557
|
* before过滤器队列
|
|
2558
2558
|
*/
|
|
2559
|
-
[
|
|
2559
|
+
[Le] = new Array();
|
|
2560
2560
|
/**
|
|
2561
2561
|
* after过滤器队列
|
|
2562
2562
|
*/
|
|
2563
|
-
[
|
|
2563
|
+
[Oe] = new Array();
|
|
2564
2564
|
/**
|
|
2565
2565
|
* destroy过滤器队列
|
|
2566
2566
|
*/
|
|
2567
|
-
[
|
|
2567
|
+
[Me] = new Array();
|
|
2568
2568
|
/**
|
|
2569
2569
|
* 属性传递过滤器
|
|
2570
2570
|
*/
|
|
@@ -2576,7 +2576,7 @@ class Zs {
|
|
|
2576
2576
|
/**
|
|
2577
2577
|
* 路由守护者
|
|
2578
2578
|
*/
|
|
2579
|
-
[
|
|
2579
|
+
[Ne] = new zs();
|
|
2580
2580
|
/**
|
|
2581
2581
|
* 是否初始化
|
|
2582
2582
|
*/
|
|
@@ -2663,7 +2663,7 @@ class Zs {
|
|
|
2663
2663
|
try {
|
|
2664
2664
|
if (!e) {
|
|
2665
2665
|
let o = [...this[w]].reverse();
|
|
2666
|
-
return this[
|
|
2666
|
+
return this[Ie](o), me && _().location.reload(), Promise.resolve();
|
|
2667
2667
|
}
|
|
2668
2668
|
let t = null, r = [], n = [], i = 0;
|
|
2669
2669
|
for (; i < e.length && i < this[w].length && S.isSame(e[i], this[w][i]); i++)
|
|
@@ -2672,7 +2672,7 @@ class Zs {
|
|
|
2672
2672
|
if (t !== null)
|
|
2673
2673
|
return this.restore([t]);
|
|
2674
2674
|
} else if (n.length > 0) {
|
|
2675
|
-
if (this[
|
|
2675
|
+
if (this[Ie](n)) {
|
|
2676
2676
|
if (r.length > 0)
|
|
2677
2677
|
return this.restore(r);
|
|
2678
2678
|
if (t !== null)
|
|
@@ -2736,7 +2736,7 @@ class Zs {
|
|
|
2736
2736
|
*
|
|
2737
2737
|
* @param route
|
|
2738
2738
|
*/
|
|
2739
|
-
[
|
|
2739
|
+
[je](e) {
|
|
2740
2740
|
if (!this[w])
|
|
2741
2741
|
return;
|
|
2742
2742
|
let t = -1;
|
|
@@ -2815,22 +2815,22 @@ class Zs {
|
|
|
2815
2815
|
* @param filter
|
|
2816
2816
|
*/
|
|
2817
2817
|
beforeEach(e) {
|
|
2818
|
-
this[
|
|
2818
|
+
this[Le].push(e);
|
|
2819
2819
|
}
|
|
2820
2820
|
/**
|
|
2821
2821
|
* 移除before filter
|
|
2822
2822
|
* @param filter
|
|
2823
2823
|
*/
|
|
2824
2824
|
removeBeforeEach(e) {
|
|
2825
|
-
const t = this[
|
|
2826
|
-
return t !== -1 ? (this[
|
|
2825
|
+
const t = this[Le].indexOf(e);
|
|
2826
|
+
return t !== -1 ? (this[Le].splice(t, 1), !0) : !1;
|
|
2827
2827
|
}
|
|
2828
2828
|
/**
|
|
2829
2829
|
* 添加after filter
|
|
2830
2830
|
* @param filter
|
|
2831
2831
|
*/
|
|
2832
2832
|
afterEach(e) {
|
|
2833
|
-
this[
|
|
2833
|
+
this[Oe].push(e);
|
|
2834
2834
|
}
|
|
2835
2835
|
/**
|
|
2836
2836
|
* 移除after filter
|
|
@@ -2838,15 +2838,15 @@ class Zs {
|
|
|
2838
2838
|
* @returns
|
|
2839
2839
|
*/
|
|
2840
2840
|
removeAfterEach(e) {
|
|
2841
|
-
const t = this[
|
|
2842
|
-
return t !== -1 ? (this[
|
|
2841
|
+
const t = this[Oe].indexOf(e);
|
|
2842
|
+
return t !== -1 ? (this[Oe].splice(t, 1), !0) : !1;
|
|
2843
2843
|
}
|
|
2844
2844
|
/**
|
|
2845
2845
|
* 添加destroy filter
|
|
2846
2846
|
* @param filter
|
|
2847
2847
|
*/
|
|
2848
2848
|
destroyEach(e) {
|
|
2849
|
-
this[
|
|
2849
|
+
this[Me].push(e);
|
|
2850
2850
|
}
|
|
2851
2851
|
/**
|
|
2852
2852
|
* 移除after filter
|
|
@@ -2854,8 +2854,8 @@ class Zs {
|
|
|
2854
2854
|
* @returns
|
|
2855
2855
|
*/
|
|
2856
2856
|
removeDestroyEach(e) {
|
|
2857
|
-
const t = this[
|
|
2858
|
-
return t !== -1 ? (this[
|
|
2857
|
+
const t = this[Me].indexOf(e);
|
|
2858
|
+
return t !== -1 ? (this[Me].splice(t, 1), !0) : !1;
|
|
2859
2859
|
}
|
|
2860
2860
|
/**
|
|
2861
2861
|
* 添加before restore filter
|
|
@@ -3146,7 +3146,7 @@ class Zs {
|
|
|
3146
3146
|
return;
|
|
3147
3147
|
}
|
|
3148
3148
|
let l = null;
|
|
3149
|
-
if (i !== -1 && (l = this[w][i]), this[
|
|
3149
|
+
if (i !== -1 && (l = this[w][i]), this[Ie](a)) {
|
|
3150
3150
|
if (t === !1)
|
|
3151
3151
|
return n.resolve(), r(!0), !0;
|
|
3152
3152
|
const u = () => (n.resolve(), r(!0), !0), f = this[w].length;
|
|
@@ -3203,7 +3203,7 @@ class Zs {
|
|
|
3203
3203
|
t.resolve();
|
|
3204
3204
|
return;
|
|
3205
3205
|
}
|
|
3206
|
-
this[
|
|
3206
|
+
this[Ie](n) && this[Ge](), t.resolve();
|
|
3207
3207
|
} catch (r) {
|
|
3208
3208
|
this[L](r), t.resolve();
|
|
3209
3209
|
}
|
|
@@ -3217,7 +3217,7 @@ class Zs {
|
|
|
3217
3217
|
let t = this[H](e);
|
|
3218
3218
|
if (!t)
|
|
3219
3219
|
return this[L]("resolve route fail", t), this;
|
|
3220
|
-
let r = this[
|
|
3220
|
+
let r = this[Ne].acquire(t);
|
|
3221
3221
|
return r == null ? (this[L]("route forbid", t), this) : (this[be].post((n) => {
|
|
3222
3222
|
try {
|
|
3223
3223
|
let i = this[Kt](t);
|
|
@@ -3232,7 +3232,7 @@ class Zs {
|
|
|
3232
3232
|
} catch (u) {
|
|
3233
3233
|
console.error(u.message, u);
|
|
3234
3234
|
}
|
|
3235
|
-
if (
|
|
3235
|
+
if (Pe.clear(o.session), this[Ne].release(r), this[Ge](l), typeof t.success == "function")
|
|
3236
3236
|
try {
|
|
3237
3237
|
Reflect.apply(t.success, {}, []);
|
|
3238
3238
|
} catch (u) {
|
|
@@ -3241,11 +3241,11 @@ class Zs {
|
|
|
3241
3241
|
this[ce] === !1 && this[tt](!0), i = null, n.resolve();
|
|
3242
3242
|
},
|
|
3243
3243
|
(o, a) => {
|
|
3244
|
-
this[
|
|
3244
|
+
this[Ne].release(r), a !== null && this[L](a, t), this[ce] === !1 && this[tt](!1), Pe.clear(o.session), i = null, n.resolve();
|
|
3245
3245
|
}
|
|
3246
3246
|
);
|
|
3247
3247
|
} catch (i) {
|
|
3248
|
-
this[
|
|
3248
|
+
this[Ne].release(r), this[L](i, t), n.resolve();
|
|
3249
3249
|
}
|
|
3250
3250
|
}), this);
|
|
3251
3251
|
}
|
|
@@ -3280,7 +3280,7 @@ class Zs {
|
|
|
3280
3280
|
* @returns {EventChain}
|
|
3281
3281
|
*/
|
|
3282
3282
|
[Kt](e) {
|
|
3283
|
-
const t = this[w].length > 0 ? this[w][
|
|
3283
|
+
const t = this[w].length > 0 ? this[w][this[w].length - 1] : void 0, r = new Pe(e, t), n = {
|
|
3284
3284
|
//路由
|
|
3285
3285
|
route: e,
|
|
3286
3286
|
//查找结果
|
|
@@ -3293,7 +3293,7 @@ class Zs {
|
|
|
3293
3293
|
* @param chain
|
|
3294
3294
|
*/
|
|
3295
3295
|
[$t](e) {
|
|
3296
|
-
for (let t of this[
|
|
3296
|
+
for (let t of this[Le])
|
|
3297
3297
|
e.post((r) => {
|
|
3298
3298
|
const n = this[br](r);
|
|
3299
3299
|
Reflect.apply(t, {}, [r.session.to, r.session.from, n, r.session]);
|
|
@@ -3305,7 +3305,7 @@ class Zs {
|
|
|
3305
3305
|
*/
|
|
3306
3306
|
[qt](e) {
|
|
3307
3307
|
e.post((t) => {
|
|
3308
|
-
for (let r of this[
|
|
3308
|
+
for (let r of this[Oe])
|
|
3309
3309
|
try {
|
|
3310
3310
|
Reflect.apply(r, {}, [t.session.to, t.session.from, t.session]);
|
|
3311
3311
|
} catch (n) {
|
|
@@ -3320,7 +3320,7 @@ class Zs {
|
|
|
3320
3320
|
* @param session
|
|
3321
3321
|
*/
|
|
3322
3322
|
[xr](e, t) {
|
|
3323
|
-
for (let r of this[
|
|
3323
|
+
for (let r of this[Me])
|
|
3324
3324
|
try {
|
|
3325
3325
|
Reflect.apply(r, {}, [e, t]);
|
|
3326
3326
|
} catch (n) {
|
|
@@ -3352,7 +3352,7 @@ class Zs {
|
|
|
3352
3352
|
return;
|
|
3353
3353
|
}
|
|
3354
3354
|
}
|
|
3355
|
-
const i =
|
|
3355
|
+
const i = Pe.from(t.session);
|
|
3356
3356
|
this[pr](r, n, i).then(
|
|
3357
3357
|
(o) => {
|
|
3358
3358
|
this[V], t.session.updateResult = o ?? {
|
|
@@ -3371,7 +3371,7 @@ class Zs {
|
|
|
3371
3371
|
*
|
|
3372
3372
|
* @param routes
|
|
3373
3373
|
*/
|
|
3374
|
-
[
|
|
3374
|
+
[Ie](e) {
|
|
3375
3375
|
if (e.length == 0)
|
|
3376
3376
|
return !0;
|
|
3377
3377
|
let t = this[V], r = [];
|
|
@@ -3426,7 +3426,7 @@ class Zs {
|
|
|
3426
3426
|
let i = e.layers[t.y].views[t.x], o = !1, a = [], l = !1, u = [...i.slots.value];
|
|
3427
3427
|
for (let c = u.length - 1; c >= 0; c--) {
|
|
3428
3428
|
let h = u[c];
|
|
3429
|
-
(!r || r.indexOf(h.index) != -1) && (h.route && i[G] && (this[
|
|
3429
|
+
(!r || r.indexOf(h.index) != -1) && (h.route && i[G] && (this[je](h.route), h.active === !0 && h.route.opsType == q.Append && (l = !0)), a.push(new U(i, h.index, t.y)), u.splice(c, 1));
|
|
3430
3430
|
}
|
|
3431
3431
|
if (u.length == 0)
|
|
3432
3432
|
n ? i.slots.value = u : e.layers[t.y].views.splice(t.x, 1);
|
|
@@ -3447,7 +3447,7 @@ class Zs {
|
|
|
3447
3447
|
let p = d.slots.value;
|
|
3448
3448
|
for (let m = p.length - 1; m >= 0; m--) {
|
|
3449
3449
|
let g = p[m];
|
|
3450
|
-
g.route && d[G] && this[
|
|
3450
|
+
g.route && d[G] && this[je](g.route), h.push(new U(d, g.index, f)), p.splice(m, 1);
|
|
3451
3451
|
}
|
|
3452
3452
|
e.layers[f].views.splice(y, 1);
|
|
3453
3453
|
}
|
|
@@ -3546,7 +3546,7 @@ class Zs {
|
|
|
3546
3546
|
if (a || n === rt.All) {
|
|
3547
3547
|
if (o.layers.length == 0 && (o.layers[0] = new Rt()), o.layers[0].views.length == 0) {
|
|
3548
3548
|
let h = t.root ?? te;
|
|
3549
|
-
f = new
|
|
3549
|
+
f = new Ke(h, !0, null), o.layers[0].views = [f];
|
|
3550
3550
|
} else
|
|
3551
3551
|
f = o.layers[0].views[0];
|
|
3552
3552
|
u = { x: 0, y: 0 };
|
|
@@ -3582,7 +3582,7 @@ class Zs {
|
|
|
3582
3582
|
status: "error",
|
|
3583
3583
|
message: "can not insert view(not find root node ref)"
|
|
3584
3584
|
};
|
|
3585
|
-
f = new
|
|
3585
|
+
f = new Ke(l, !0, d), o.layers[y].views.push(f), u = { x: o.layers[y].views.length - 1, y };
|
|
3586
3586
|
}
|
|
3587
3587
|
else
|
|
3588
3588
|
f = o.layers[u.y].views[u.x];
|
|
@@ -3634,7 +3634,7 @@ class Zs {
|
|
|
3634
3634
|
let d = c + 1, p = 1, m = new U(f, t.index, c);
|
|
3635
3635
|
this[ie](o, d, e, p, m);
|
|
3636
3636
|
} else {
|
|
3637
|
-
y.route !== null && this[
|
|
3637
|
+
y.route !== null && this[je](y.route);
|
|
3638
3638
|
let d = !1;
|
|
3639
3639
|
const p = t.active ?? !0;
|
|
3640
3640
|
y.active !== p && (y.active = p, d = !0), t.active = p, t.index = y.index, y.route = t;
|
|
@@ -3673,7 +3673,7 @@ class Zs {
|
|
|
3673
3673
|
let z = v + 1, re = T + 1;
|
|
3674
3674
|
this[ie](o, z, e, re, b);
|
|
3675
3675
|
} else {
|
|
3676
|
-
E[G] && Y.route !== null && this[
|
|
3676
|
+
E[G] && Y.route !== null && this[je](Y.route);
|
|
3677
3677
|
let z = [];
|
|
3678
3678
|
for (let re = 1; re < I.length; re++)
|
|
3679
3679
|
z.push(I[re].index);
|
|
@@ -3711,7 +3711,7 @@ class Zs {
|
|
|
3711
3711
|
for (; a < e.layers.length && o < r.layers.length; a++, o++) {
|
|
3712
3712
|
let l = e.layers[a].views;
|
|
3713
3713
|
for (let u of r.layers[o].models) {
|
|
3714
|
-
let f = new
|
|
3714
|
+
let f = new Ke(u.name, !1, i), c = new ne(null, u);
|
|
3715
3715
|
f.slots.value = [c], l.push(f);
|
|
3716
3716
|
}
|
|
3717
3717
|
}
|
|
@@ -3719,7 +3719,7 @@ class Zs {
|
|
|
3719
3719
|
let l = new Rt();
|
|
3720
3720
|
l.views = [];
|
|
3721
3721
|
for (let u of r.layers[o].models) {
|
|
3722
|
-
let f = new
|
|
3722
|
+
let f = new Ke(u.name, !1, i), c = new ne(null, u);
|
|
3723
3723
|
f.slots.value = [c], l.views.push(f);
|
|
3724
3724
|
}
|
|
3725
3725
|
e.layers.push(l);
|
|
@@ -3764,7 +3764,7 @@ class Zs {
|
|
|
3764
3764
|
index: o,
|
|
3765
3765
|
level: t - 1
|
|
3766
3766
|
});
|
|
3767
|
-
let u = new
|
|
3767
|
+
let u = new Ke(e, !0, a);
|
|
3768
3768
|
if (u[ye] = l, t == this[V].layers.length) {
|
|
3769
3769
|
let f = new Rt();
|
|
3770
3770
|
f.views = [u], this[V].layers.push(f);
|
|
@@ -3844,10 +3844,10 @@ function Qt(s) {
|
|
|
3844
3844
|
hide: t
|
|
3845
3845
|
}), e;
|
|
3846
3846
|
}
|
|
3847
|
-
function
|
|
3847
|
+
function Fe(s, e) {
|
|
3848
3848
|
s.classList.contains(e) || s.classList.add(e);
|
|
3849
3849
|
}
|
|
3850
|
-
function
|
|
3850
|
+
function Ce(s, e) {
|
|
3851
3851
|
s.classList.remove(e);
|
|
3852
3852
|
}
|
|
3853
3853
|
const yn = me && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : setTimeout;
|
|
@@ -3899,9 +3899,9 @@ function yt(s) {
|
|
|
3899
3899
|
function Wr(s, e, t, r = {}, n, i = -1) {
|
|
3900
3900
|
if (e || yt(n)) {
|
|
3901
3901
|
const o = Dr(r, e);
|
|
3902
|
-
o &&
|
|
3902
|
+
o && Fe(t, o);
|
|
3903
3903
|
const a = kr(r, e);
|
|
3904
|
-
a &&
|
|
3904
|
+
a && Fe(t, a);
|
|
3905
3905
|
const l = nn(r, e);
|
|
3906
3906
|
j(s, l, [t, e, n, i]);
|
|
3907
3907
|
}
|
|
@@ -3918,18 +3918,18 @@ function zr(s, e, t, r = {}, n, i, o, a) {
|
|
|
3918
3918
|
}
|
|
3919
3919
|
ht(() => {
|
|
3920
3920
|
Vr(s, t, i, o, n, () => {
|
|
3921
|
-
u &&
|
|
3921
|
+
u && Ce(t, u), f && Ce(t, f), x(h) && j(s, h, [t, e, i, o]), x(a) && a(s, a, [t]);
|
|
3922
3922
|
}, () => {
|
|
3923
3923
|
x(y) && j(s, y, [t, e, i, o]);
|
|
3924
|
-
}), l &&
|
|
3924
|
+
}), l && Ce(t, l), f && Fe(t, f), x(c) && j(s, c, [t, e, i, o]);
|
|
3925
3925
|
});
|
|
3926
3926
|
}
|
|
3927
3927
|
function Jr(s, e, t, r = {}, n, i = -1) {
|
|
3928
3928
|
if (e || yt(n)) {
|
|
3929
3929
|
const o = Ur(r, e);
|
|
3930
|
-
o &&
|
|
3930
|
+
o && Fe(t, o);
|
|
3931
3931
|
const a = Br(r, e);
|
|
3932
|
-
a &&
|
|
3932
|
+
a && Fe(t, a);
|
|
3933
3933
|
const l = un(r, e);
|
|
3934
3934
|
j(s, l, [t, e, n, i]);
|
|
3935
3935
|
}
|
|
@@ -3946,10 +3946,10 @@ function Gr(s, e, t, r = {}, n, i, o, a, l) {
|
|
|
3946
3946
|
}
|
|
3947
3947
|
ht(() => {
|
|
3948
3948
|
Vr(s, t, o, a, n, () => {
|
|
3949
|
-
f &&
|
|
3949
|
+
f && Ce(t, f), c && Ce(t, c), x(y) && j(s, y, [t, e, o, a]), x(l) && j(s, l, [t]), !e && x(i) && i();
|
|
3950
3950
|
}, () => {
|
|
3951
3951
|
x(d) && j(s, d, [t, e, o, a]), x(l) && j(s, l, [t]), !e && x(i) && i();
|
|
3952
|
-
}), u &&
|
|
3952
|
+
}), u && Ce(t, u), c && Fe(t, c), x(h) && j(s, h, [t, e, o, a]);
|
|
3953
3953
|
});
|
|
3954
3954
|
}
|
|
3955
3955
|
function Nt(s, e, t = {}, r, n = -1) {
|
|
@@ -4331,14 +4331,14 @@ const Ht = Sr({
|
|
|
4331
4331
|
const D = I.node;
|
|
4332
4332
|
v.active ? d.unshift(() => {
|
|
4333
4333
|
const dt = () => {
|
|
4334
|
-
let
|
|
4335
|
-
|
|
4334
|
+
let Ae = ir(D);
|
|
4335
|
+
Ae != null && or(Ae, It.ACTIVATED);
|
|
4336
4336
|
};
|
|
4337
4337
|
dn(t, D, s, v.route, g, b, dt);
|
|
4338
4338
|
}) : d.push(() => {
|
|
4339
4339
|
const dt = () => {
|
|
4340
|
-
const
|
|
4341
|
-
|
|
4340
|
+
const Ae = ir(D);
|
|
4341
|
+
Ae != null && or(Ae, It.DEACTIVATED);
|
|
4342
4342
|
};
|
|
4343
4343
|
mn(t, D, s, v.route, g, b, dt);
|
|
4344
4344
|
});
|