@fox-js/fox 3.0.1-33 → 3.0.1-35
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 +220 -222
- package/libs/index.umd.js +2 -2
- package/package.json +1 -1
package/libs/index.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as gr, getCurrentInstance as Lt, onUnmounted as ot, shallowRef as Wr, defineComponent as wr, inject as G, provide as se, h as he } from "vue";
|
|
2
2
|
/*!
|
|
3
|
-
* fox v3.0.0
|
|
3
|
+
* fox v3.0.0 Fri Jan 05 2024 00:02:58 GMT+0800 (中国标准时间)
|
|
4
4
|
*/
|
|
5
|
-
const Ae = typeof window < "u",
|
|
5
|
+
const Ae = typeof window < "u", $ = function() {
|
|
6
6
|
return window;
|
|
7
7
|
}, Ve = function() {
|
|
8
8
|
return window.document;
|
|
@@ -14,17 +14,17 @@ function zr(s) {
|
|
|
14
14
|
function ft() {
|
|
15
15
|
if (!Ae)
|
|
16
16
|
return "/";
|
|
17
|
-
let s =
|
|
17
|
+
let s = $().location, e = `${s.protocol}//${s.host}`;
|
|
18
18
|
return e += zr(s.pathname), e;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function Tt(s, e, t) {
|
|
21
21
|
s.addEventListener ? s.addEventListener(e, t, !1) : s.attachEvent ? s.attachEvent(`on${e}`, t) : s[`on${e}`] = t;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function $t(s, e, t) {
|
|
24
24
|
s.removeEventListener ? s.removeEventListener(e, t) : s.detachEvent ? s.detachEvent(`on${e}`, t) : s[`on${e}`] = null;
|
|
25
25
|
}
|
|
26
|
-
const ln = Array.isArray, an = (s) =>
|
|
27
|
-
function
|
|
26
|
+
const ln = Array.isArray, an = (s) => Mt(s) === "[object Map]", un = (s) => Mt(s) === "[object Set]", fn = (s) => s instanceof Date, x = (s) => typeof s == "function", cn = (s) => typeof s == "string", hn = (s) => typeof s == "symbol", Jr = (s) => s !== null && typeof s == "object", yn = (s) => Jr(s) && x(s.then) && x(s.catch), Gr = (s) => s == null, Qr = Object.prototype.toString, Mt = (s) => Qr.call(s), Xr = (s) => Mt(s) === "[object Object]", Yr = typeof Symbol == "function" && typeof Symbol.toStringTag == "symbol";
|
|
27
|
+
function br(s) {
|
|
28
28
|
return s.__esModule || Yr && s[Symbol.toStringTag] === "Module";
|
|
29
29
|
}
|
|
30
30
|
const Zr = typeof Promise < "u" && Promise.toString().indexOf("[native code]") !== -1;
|
|
@@ -45,7 +45,7 @@ function q(...s) {
|
|
|
45
45
|
}
|
|
46
46
|
return e;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function Nt(s, e, t = !1) {
|
|
49
49
|
if (!t)
|
|
50
50
|
q(!0, s, e);
|
|
51
51
|
else {
|
|
@@ -58,7 +58,7 @@ function It(s, e, t = !1) {
|
|
|
58
58
|
if (typeof i == "object") {
|
|
59
59
|
if (!Array.isArray(i) && !Xr(i))
|
|
60
60
|
continue;
|
|
61
|
-
n =
|
|
61
|
+
n = Nt(n, i, t), s[r] = n;
|
|
62
62
|
} else {
|
|
63
63
|
if (typeof i == "function")
|
|
64
64
|
continue;
|
|
@@ -89,7 +89,7 @@ function He(s, ...e) {
|
|
|
89
89
|
s(e);
|
|
90
90
|
}) : setTimeout(s);
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function xr(s) {
|
|
93
93
|
return s == null ? !1 : typeof s == "boolean" ? s : typeof s == "string" ? s.toLocaleLowerCase() === "true" : !!s;
|
|
94
94
|
}
|
|
95
95
|
function dn(s) {
|
|
@@ -105,16 +105,16 @@ const es = {
|
|
|
105
105
|
"[object RegExp]": "regExp",
|
|
106
106
|
"[object Object]": "object"
|
|
107
107
|
};
|
|
108
|
-
function
|
|
108
|
+
function Wt(s) {
|
|
109
109
|
let t = Object.prototype.toString.call(s);
|
|
110
110
|
return s == null ? String(s) : es[t] || "object";
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function zt(s, e) {
|
|
113
113
|
if (s == e)
|
|
114
114
|
return !0;
|
|
115
115
|
if (s === void 0 || e === void 0)
|
|
116
116
|
return !1;
|
|
117
|
-
let t =
|
|
117
|
+
let t = Wt(s), r = Wt(e);
|
|
118
118
|
if (t !== r)
|
|
119
119
|
return !1;
|
|
120
120
|
if (t === "object") {
|
|
@@ -123,7 +123,7 @@ function Jt(s, e) {
|
|
|
123
123
|
return !1;
|
|
124
124
|
for (let o = 0; o < n.length; o++) {
|
|
125
125
|
let a = n[o], l = s[a], u = e[a];
|
|
126
|
-
if (!
|
|
126
|
+
if (!zt(l, u))
|
|
127
127
|
return !1;
|
|
128
128
|
}
|
|
129
129
|
return !0;
|
|
@@ -132,25 +132,25 @@ function Jt(s, e) {
|
|
|
132
132
|
return !1;
|
|
133
133
|
for (let n = 0; n < s.length; n++) {
|
|
134
134
|
let i = s[n], o = e[n];
|
|
135
|
-
if (!
|
|
135
|
+
if (!zt(i, o))
|
|
136
136
|
return !1;
|
|
137
137
|
}
|
|
138
138
|
return !0;
|
|
139
139
|
}
|
|
140
140
|
return !1;
|
|
141
141
|
}
|
|
142
|
-
const
|
|
142
|
+
const Rr = (s) => {
|
|
143
143
|
const e = {};
|
|
144
144
|
for (let t of Reflect.ownKeys(s)) {
|
|
145
145
|
let r = s[t];
|
|
146
|
-
r && !Array.isArray(r) && typeof r == "object" && (r =
|
|
146
|
+
r && !Array.isArray(r) && typeof r == "object" && (r = Rr(r)), typeof t == "symbol" ? e[String(t)] = r : e[t] = r;
|
|
147
147
|
}
|
|
148
148
|
return e;
|
|
149
|
-
}, ts = /^Symbol\((.*)\)$/,
|
|
149
|
+
}, ts = /^Symbol\((.*)\)$/, Sr = (s) => {
|
|
150
150
|
const e = {};
|
|
151
151
|
for (let t of Reflect.ownKeys(s)) {
|
|
152
152
|
let r = s[t];
|
|
153
|
-
r && !Array.isArray(r) && typeof r == "object" && (r =
|
|
153
|
+
r && !Array.isArray(r) && typeof r == "object" && (r = Sr(r));
|
|
154
154
|
const n = ts.exec(t);
|
|
155
155
|
if (n && n[1]) {
|
|
156
156
|
const i = Symbol.for(n[1]);
|
|
@@ -159,8 +159,8 @@ const Sr = (s) => {
|
|
|
159
159
|
e[t] = r;
|
|
160
160
|
}
|
|
161
161
|
return e;
|
|
162
|
-
},
|
|
163
|
-
class
|
|
162
|
+
}, Jt = Symbol("idKey"), pe = Symbol("valueKey"), R = Symbol("childrenKey"), Q = Symbol("growKey");
|
|
163
|
+
class Pr {
|
|
164
164
|
/**
|
|
165
165
|
* 自动创建解决策略
|
|
166
166
|
*/
|
|
@@ -168,11 +168,11 @@ class Cr {
|
|
|
168
168
|
/**
|
|
169
169
|
* id
|
|
170
170
|
*/
|
|
171
|
-
[
|
|
171
|
+
[Jt];
|
|
172
172
|
/**
|
|
173
173
|
* value
|
|
174
174
|
*/
|
|
175
|
-
[pe] =
|
|
175
|
+
[pe] = gr();
|
|
176
176
|
/**
|
|
177
177
|
* children
|
|
178
178
|
*/
|
|
@@ -182,7 +182,7 @@ class Cr {
|
|
|
182
182
|
* @param id
|
|
183
183
|
*/
|
|
184
184
|
constructor(e) {
|
|
185
|
-
this[
|
|
185
|
+
this[Jt] = e;
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
class rs {
|
|
@@ -200,7 +200,7 @@ class rs {
|
|
|
200
200
|
if (r)
|
|
201
201
|
return De(r);
|
|
202
202
|
if (e[Q])
|
|
203
|
-
return r =
|
|
203
|
+
return r = Ht(t), r[Q] = e[Q], e[R].set(t, r), De(r);
|
|
204
204
|
}
|
|
205
205
|
/**
|
|
206
206
|
* 拦截set操作
|
|
@@ -210,7 +210,7 @@ class rs {
|
|
|
210
210
|
* @returns
|
|
211
211
|
*/
|
|
212
212
|
set(e, t, r) {
|
|
213
|
-
return t == "value" ? (e[pe].value = r, !0) : t === "grow" ? (e[Q] =
|
|
213
|
+
return t == "value" ? (e[pe].value = r, !0) : t === "grow" ? (e[Q] = xr(r), !0) : r == null ? (e[R].delete(t), !0) : (console.error(`illegal property:${t}`), !1);
|
|
214
214
|
}
|
|
215
215
|
/**
|
|
216
216
|
* 拦截删除property属性
|
|
@@ -222,13 +222,13 @@ class rs {
|
|
|
222
222
|
return t === "value" || t == "grow" ? (console.error(`can not delete property:${String(t)}`), !1) : (e[R].delete(t), !0);
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
const
|
|
226
|
-
function
|
|
227
|
-
const e = new
|
|
228
|
-
return Reflect.set(e,
|
|
225
|
+
const It = "__proxy__";
|
|
226
|
+
function Ht(s) {
|
|
227
|
+
const e = new Pr(s);
|
|
228
|
+
return Reflect.set(e, It, new Proxy(e, new rs())), e;
|
|
229
229
|
}
|
|
230
230
|
function De(s) {
|
|
231
|
-
return Reflect.get(s,
|
|
231
|
+
return Reflect.get(s, It);
|
|
232
232
|
}
|
|
233
233
|
class ss {
|
|
234
234
|
/**
|
|
@@ -279,7 +279,7 @@ class ss {
|
|
|
279
279
|
if (this.persistPolicy === "custom")
|
|
280
280
|
e = this.storage;
|
|
281
281
|
else if (Ae) {
|
|
282
|
-
const t =
|
|
282
|
+
const t = $();
|
|
283
283
|
e = this.persistPolicy === "session" ? t.sessionStorage : t.localStorage;
|
|
284
284
|
}
|
|
285
285
|
return e;
|
|
@@ -365,7 +365,7 @@ class ss {
|
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
|
-
class
|
|
368
|
+
class Cr extends Pr {
|
|
369
369
|
/**
|
|
370
370
|
* 持久化处理器
|
|
371
371
|
*/
|
|
@@ -388,7 +388,7 @@ class Ar extends Cr {
|
|
|
388
388
|
let r = this;
|
|
389
389
|
for (let n = 0; n < t - 1; n++) {
|
|
390
390
|
let i = e[n], o;
|
|
391
|
-
r[R].has(i) ? o = r[R].get(i) : (o =
|
|
391
|
+
r[R].has(i) ? o = r[R].get(i) : (o = Ht(i), r[R].set(i, o)), r = o;
|
|
392
392
|
}
|
|
393
393
|
return r[pe].value = e[t - 1], this._persistHandler.put(e), !0;
|
|
394
394
|
}
|
|
@@ -459,7 +459,7 @@ class Ar extends Cr {
|
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
461
|
const ns = ["put", "get", "contains", "remove", "clear", "_persistHandler"];
|
|
462
|
-
function
|
|
462
|
+
function Gt(s) {
|
|
463
463
|
return ns.includes(s);
|
|
464
464
|
}
|
|
465
465
|
class is {
|
|
@@ -475,13 +475,13 @@ class is {
|
|
|
475
475
|
return e[Q];
|
|
476
476
|
if (t === R)
|
|
477
477
|
return e[R];
|
|
478
|
-
if (typeof t == "string" &&
|
|
478
|
+
if (typeof t == "string" && Gt(t))
|
|
479
479
|
return e[t];
|
|
480
480
|
let r = String(t), n = e[R].get(r);
|
|
481
481
|
if (n)
|
|
482
482
|
return De(n);
|
|
483
483
|
if (e[Q])
|
|
484
|
-
return n =
|
|
484
|
+
return n = Ht(r), n[Q] = e[Q], e[R].set(r, n), De(n);
|
|
485
485
|
}
|
|
486
486
|
/**
|
|
487
487
|
* 拦截set操作
|
|
@@ -491,7 +491,7 @@ class is {
|
|
|
491
491
|
* @returns
|
|
492
492
|
*/
|
|
493
493
|
set(e, t, r) {
|
|
494
|
-
return t == "value" ? (e[pe].value = r, !0) : t === "grow" ? (e[Q] =
|
|
494
|
+
return t == "value" ? (e[pe].value = r, !0) : t === "grow" ? (e[Q] = xr(r), !0) : Gt(t) ? !1 : r == null ? (e[R].delete(t), !0) : (console.error(`illegal property:${t}`), !1);
|
|
495
495
|
}
|
|
496
496
|
/**
|
|
497
497
|
* 拦截删除property属性
|
|
@@ -504,10 +504,10 @@ class is {
|
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
function os(s) {
|
|
507
|
-
const e = new
|
|
508
|
-
return Reflect.set(e,
|
|
507
|
+
const e = new Cr(s), t = new is(), r = new Proxy(e, t);
|
|
508
|
+
return Reflect.set(e, It, r), e;
|
|
509
509
|
}
|
|
510
|
-
const
|
|
510
|
+
const Qt = new Proxy(Cr, {
|
|
511
511
|
/**
|
|
512
512
|
* 拦截构造函数
|
|
513
513
|
* @param target
|
|
@@ -518,8 +518,8 @@ const Xt = new Proxy(Ar, {
|
|
|
518
518
|
const t = os(e[0] ?? {});
|
|
519
519
|
return De(t);
|
|
520
520
|
}
|
|
521
|
-
}), te = "default",
|
|
522
|
-
function
|
|
521
|
+
}), te = "default", Ar = Symbol("sync"), I = Symbol("resolveRoute");
|
|
522
|
+
function Xt(s) {
|
|
523
523
|
let e = !1;
|
|
524
524
|
return function(...t) {
|
|
525
525
|
if (!e)
|
|
@@ -529,9 +529,9 @@ function Yt(s) {
|
|
|
529
529
|
function ls(s) {
|
|
530
530
|
let e = s.src;
|
|
531
531
|
return new Promise((t, r) => {
|
|
532
|
-
const n =
|
|
533
|
-
|
|
534
|
-
}), i =
|
|
532
|
+
const n = Xt((a) => {
|
|
533
|
+
br(a) && (a = a.default), s.component = a, console.debug("success load async module"), t();
|
|
534
|
+
}), i = Xt((a) => {
|
|
535
535
|
console.debug("reject load async module"), r(a);
|
|
536
536
|
});
|
|
537
537
|
let o;
|
|
@@ -706,7 +706,7 @@ class S {
|
|
|
706
706
|
*/
|
|
707
707
|
static clone(e, t) {
|
|
708
708
|
let r = new S();
|
|
709
|
-
return
|
|
709
|
+
return Nt(r, e, t), r;
|
|
710
710
|
}
|
|
711
711
|
/**
|
|
712
712
|
* 判断路由是否相同
|
|
@@ -796,7 +796,7 @@ class us {
|
|
|
796
796
|
return ls(this);
|
|
797
797
|
}
|
|
798
798
|
}
|
|
799
|
-
class
|
|
799
|
+
class Yt {
|
|
800
800
|
/**
|
|
801
801
|
* 节点
|
|
802
802
|
*/
|
|
@@ -1042,7 +1042,7 @@ class fs {
|
|
|
1042
1042
|
this.callback = e, this.policy = t;
|
|
1043
1043
|
}
|
|
1044
1044
|
}
|
|
1045
|
-
class
|
|
1045
|
+
class Zt {
|
|
1046
1046
|
/**
|
|
1047
1047
|
* 注册表
|
|
1048
1048
|
*/
|
|
@@ -1217,7 +1217,7 @@ function nt(s, e = !1) {
|
|
|
1217
1217
|
}
|
|
1218
1218
|
return null;
|
|
1219
1219
|
}
|
|
1220
|
-
function
|
|
1220
|
+
function Er(s, e = !1) {
|
|
1221
1221
|
let t = null, r = s;
|
|
1222
1222
|
for (; r && !(Reflect.has(r, de) && (t = r[de], t)); )
|
|
1223
1223
|
r = r.$parent;
|
|
@@ -1227,7 +1227,7 @@ function Fr(s, e = !1) {
|
|
|
1227
1227
|
}
|
|
1228
1228
|
return t;
|
|
1229
1229
|
}
|
|
1230
|
-
function
|
|
1230
|
+
function Fr(s, e) {
|
|
1231
1231
|
let t = s;
|
|
1232
1232
|
for (; t; ) {
|
|
1233
1233
|
if (Reflect.has(t, de)) {
|
|
@@ -1240,12 +1240,12 @@ function _r(s, e) {
|
|
|
1240
1240
|
return null;
|
|
1241
1241
|
}
|
|
1242
1242
|
function pn(s, e, t) {
|
|
1243
|
-
|
|
1243
|
+
Er(s, !0)?.set(e, t);
|
|
1244
1244
|
}
|
|
1245
1245
|
function mn(s, e) {
|
|
1246
|
-
|
|
1246
|
+
Er(s, !0)?.delete(e);
|
|
1247
1247
|
}
|
|
1248
|
-
function
|
|
1248
|
+
function er(s) {
|
|
1249
1249
|
if (Array.isArray(s.children) && s.children.length > 0) {
|
|
1250
1250
|
let e = s.children[0];
|
|
1251
1251
|
if (e != null && e.component != null && e.component.proxy != null)
|
|
@@ -1258,7 +1258,7 @@ function hs(s) {
|
|
|
1258
1258
|
let e = s.get(it);
|
|
1259
1259
|
e || (e = [], s.set(it, e));
|
|
1260
1260
|
}
|
|
1261
|
-
function
|
|
1261
|
+
function tr(s, e) {
|
|
1262
1262
|
let t = s.get(it);
|
|
1263
1263
|
if (t != null)
|
|
1264
1264
|
for (let r = t.length - 1; r >= 0; r--) {
|
|
@@ -1310,22 +1310,22 @@ function ps(s, e, t, r) {
|
|
|
1310
1310
|
}
|
|
1311
1311
|
return n != -1 ? (s.splice(n, 1), !0) : !1;
|
|
1312
1312
|
}
|
|
1313
|
-
function
|
|
1313
|
+
function _r(s) {
|
|
1314
1314
|
return (e, t) => {
|
|
1315
1315
|
let r;
|
|
1316
1316
|
if (t)
|
|
1317
1317
|
r = t;
|
|
1318
1318
|
else {
|
|
1319
|
-
const i =
|
|
1319
|
+
const i = Lt();
|
|
1320
1320
|
if (i == null || i.proxy == null) {
|
|
1321
1321
|
console.error("can not get current instance or proxy");
|
|
1322
1322
|
return;
|
|
1323
1323
|
}
|
|
1324
1324
|
r = i.proxy;
|
|
1325
1325
|
}
|
|
1326
|
-
const n =
|
|
1326
|
+
const n = Fr(r, it);
|
|
1327
1327
|
if (n == null) {
|
|
1328
|
-
console.warn("
|
|
1328
|
+
console.warn("hooks context not found");
|
|
1329
1329
|
return;
|
|
1330
1330
|
}
|
|
1331
1331
|
ot(() => {
|
|
@@ -1333,21 +1333,21 @@ function Kr(s) {
|
|
|
1333
1333
|
}), ds(n, s, e, r);
|
|
1334
1334
|
};
|
|
1335
1335
|
}
|
|
1336
|
-
const vn =
|
|
1336
|
+
const vn = _r(
|
|
1337
1337
|
"a"
|
|
1338
1338
|
/* ACTIVATED */
|
|
1339
|
-
), gn =
|
|
1339
|
+
), gn = _r(
|
|
1340
1340
|
"da"
|
|
1341
1341
|
/* DEACTIVATED */
|
|
1342
|
-
),
|
|
1343
|
-
function
|
|
1344
|
-
s.set(
|
|
1342
|
+
), Kr = Symbol("routeKey");
|
|
1343
|
+
function rr(s, e) {
|
|
1344
|
+
s.set(Kr, e);
|
|
1345
1345
|
}
|
|
1346
|
-
function
|
|
1347
|
-
let e =
|
|
1346
|
+
function Dt(s) {
|
|
1347
|
+
let e = Fr(s, Kr);
|
|
1348
1348
|
return typeof e == "function" ? e() : e ?? null;
|
|
1349
1349
|
}
|
|
1350
|
-
const lt = Symbol("rk"), dt = Symbol("vd"),
|
|
1350
|
+
const lt = Symbol("rk"), dt = Symbol("vd"), sr = Symbol("rv"), pt = Symbol("rvi"), nr = Symbol("pv"), mt = Symbol("pvi");
|
|
1351
1351
|
function ms(s) {
|
|
1352
1352
|
for (var e = [], t = 0; t < s.length; ) {
|
|
1353
1353
|
var r = s[t];
|
|
@@ -1416,7 +1416,7 @@ function ms(s) {
|
|
|
1416
1416
|
}
|
|
1417
1417
|
return e.push({ type: "END", index: t, value: "" }), e;
|
|
1418
1418
|
}
|
|
1419
|
-
function
|
|
1419
|
+
function Tr(s, e) {
|
|
1420
1420
|
e === void 0 && (e = {});
|
|
1421
1421
|
for (var t = ms(s), r = e.prefixes, n = r === void 0 ? "./" : r, i = "[^".concat(Re(e.delimiter || "/#?"), "]+?"), o = [], a = 0, l = 0, u = "", f = function(E) {
|
|
1422
1422
|
if (l < t.length && t[l].type === E)
|
|
@@ -1467,11 +1467,11 @@ function $r(s, e) {
|
|
|
1467
1467
|
return o;
|
|
1468
1468
|
}
|
|
1469
1469
|
function vs(s, e) {
|
|
1470
|
-
return gs(
|
|
1470
|
+
return gs(Tr(s, e), e);
|
|
1471
1471
|
}
|
|
1472
1472
|
function gs(s, e) {
|
|
1473
1473
|
e === void 0 && (e = {});
|
|
1474
|
-
var t =
|
|
1474
|
+
var t = Vt(e), r = e.encode, n = r === void 0 ? function(l) {
|
|
1475
1475
|
return l;
|
|
1476
1476
|
} : r, i = e.validate, o = i === void 0 ? !0 : i, a = s.map(function(l) {
|
|
1477
1477
|
if (typeof l == "object")
|
|
@@ -1517,7 +1517,7 @@ function gs(s, e) {
|
|
|
1517
1517
|
};
|
|
1518
1518
|
}
|
|
1519
1519
|
function ws(s, e) {
|
|
1520
|
-
var t = [], r =
|
|
1520
|
+
var t = [], r = $r(s, t, e);
|
|
1521
1521
|
return bs(r, t, e);
|
|
1522
1522
|
}
|
|
1523
1523
|
function bs(s, e, t) {
|
|
@@ -1544,7 +1544,7 @@ function bs(s, e, t) {
|
|
|
1544
1544
|
function Re(s) {
|
|
1545
1545
|
return s.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
|
|
1546
1546
|
}
|
|
1547
|
-
function
|
|
1547
|
+
function Vt(s) {
|
|
1548
1548
|
return s && s.sensitive ? "" : "i";
|
|
1549
1549
|
}
|
|
1550
1550
|
function xs(s, e) {
|
|
@@ -1563,12 +1563,12 @@ function xs(s, e) {
|
|
|
1563
1563
|
}
|
|
1564
1564
|
function Rs(s, e, t) {
|
|
1565
1565
|
var r = s.map(function(n) {
|
|
1566
|
-
return
|
|
1566
|
+
return $r(n, e, t).source;
|
|
1567
1567
|
});
|
|
1568
|
-
return new RegExp("(?:".concat(r.join("|"), ")"),
|
|
1568
|
+
return new RegExp("(?:".concat(r.join("|"), ")"), Vt(t));
|
|
1569
1569
|
}
|
|
1570
1570
|
function Ss(s, e, t) {
|
|
1571
|
-
return Ps(
|
|
1571
|
+
return Ps(Tr(s, t), e, t);
|
|
1572
1572
|
}
|
|
1573
1573
|
function Ps(s, e, t) {
|
|
1574
1574
|
t === void 0 && (t = {});
|
|
@@ -1599,12 +1599,12 @@ function Ps(s, e, t) {
|
|
|
1599
1599
|
var C = s[s.length - 1], U = typeof C == "string" ? p.indexOf(C[C.length - 1]) > -1 : C === void 0;
|
|
1600
1600
|
n || (v += "(?:".concat(p, "(?=").concat(m, "))?")), U || (v += "(?=".concat(p, "|").concat(m, ")"));
|
|
1601
1601
|
}
|
|
1602
|
-
return new RegExp(v,
|
|
1602
|
+
return new RegExp(v, Vt(t));
|
|
1603
1603
|
}
|
|
1604
|
-
function
|
|
1604
|
+
function $r(s, e, t) {
|
|
1605
1605
|
return s instanceof RegExp ? xs(s, e) : Array.isArray(s) ? Rs(s, e, t) : Ss(s, e, t);
|
|
1606
1606
|
}
|
|
1607
|
-
var
|
|
1607
|
+
var T = /* @__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))(T || {}), Ze = /* @__PURE__ */ ((s) => (s[s.Part = 0] = "Part", s[s.All = 1] = "All", s))(Ze || {});
|
|
1608
1608
|
const J = Symbol("rootKey"), z = Symbol("rootNodeKey"), ye = Symbol("parentNodeKey"), et = Symbol("nameKey");
|
|
1609
1609
|
class ne {
|
|
1610
1610
|
/**
|
|
@@ -1784,7 +1784,7 @@ class Es {
|
|
|
1784
1784
|
}
|
|
1785
1785
|
}
|
|
1786
1786
|
const Se = Symbol("_notifyChange");
|
|
1787
|
-
class
|
|
1787
|
+
class ir {
|
|
1788
1788
|
//当前路由
|
|
1789
1789
|
currentRoute;
|
|
1790
1790
|
//当前页面的路由集合
|
|
@@ -1798,11 +1798,11 @@ class or {
|
|
|
1798
1798
|
this.currentRoute = e, this.routes = t;
|
|
1799
1799
|
}
|
|
1800
1800
|
}
|
|
1801
|
-
const ue = Symbol("historyChangeConsumerKey"),
|
|
1801
|
+
const ue = Symbol("historyChangeConsumerKey"), or = Symbol("_navigateFirstRoute"), ke = Symbol("_getRouteMark"), gt = Symbol("_getUrlSearch"), wt = Symbol("_generateLocation"), Te = Symbol("_setRouteMarkRecorder"), $e = Symbol("beforeRestoreFiltersKey"), lr = Symbol("_beforeRestore"), ar = "Symbol(_fox_restore_point)";
|
|
1802
1802
|
function qe(s, ...e) {
|
|
1803
1803
|
return typeof s == "function" ? Reflect.apply(s, null, [...e]) : s;
|
|
1804
1804
|
}
|
|
1805
|
-
function
|
|
1805
|
+
function ur(s) {
|
|
1806
1806
|
if (!Array.isArray(s))
|
|
1807
1807
|
return !1;
|
|
1808
1808
|
if (s.length === 0)
|
|
@@ -1854,7 +1854,7 @@ class qr {
|
|
|
1854
1854
|
/**
|
|
1855
1855
|
* before restore 过滤器队列(用于刷新还原)
|
|
1856
1856
|
*/
|
|
1857
|
-
[
|
|
1857
|
+
[$e] = new Array();
|
|
1858
1858
|
/**
|
|
1859
1859
|
* 回退timeout
|
|
1860
1860
|
*/
|
|
@@ -1871,7 +1871,7 @@ class qr {
|
|
|
1871
1871
|
* @param backTimeout
|
|
1872
1872
|
*/
|
|
1873
1873
|
constructor(e = "hash", t = "", r = "", n = !0, i = !0, o = !1, a, l) {
|
|
1874
|
-
this.mode = e, this.base = t, this.query = r, this.firstNavigate = n, this.historyMonitor = i, this.traceless = o, this.storage = a ??
|
|
1874
|
+
this.mode = e, this.base = t, this.query = r, this.firstNavigate = n, this.historyMonitor = i, this.traceless = o, this.storage = a ?? $().sessionStorage, this.backTimeout = l ?? 320;
|
|
1875
1875
|
}
|
|
1876
1876
|
/**
|
|
1877
1877
|
* 初始化
|
|
@@ -1879,7 +1879,7 @@ class qr {
|
|
|
1879
1879
|
* @returns
|
|
1880
1880
|
*/
|
|
1881
1881
|
init(e = !0) {
|
|
1882
|
-
const t =
|
|
1882
|
+
const t = $();
|
|
1883
1883
|
return typeof this.historyChange != "function" && (this.historyChange = () => {
|
|
1884
1884
|
if (typeof this[ue] == "function") {
|
|
1885
1885
|
const r = this[ue]();
|
|
@@ -1896,20 +1896,20 @@ class qr {
|
|
|
1896
1896
|
let n = [];
|
|
1897
1897
|
if (typeof r == "string" ? n = JSON.parse(r) : n = r, Array.isArray(n) && n.length > 0) {
|
|
1898
1898
|
const i = this[ke]() ?? "/";
|
|
1899
|
-
this[
|
|
1899
|
+
this[Te](i, n);
|
|
1900
1900
|
}
|
|
1901
1901
|
} catch {
|
|
1902
1902
|
}
|
|
1903
1903
|
}
|
|
1904
|
-
}),
|
|
1904
|
+
}), Tt(t, "popstate", this.historyChange), this.firstNavigate && e && this[or](), Promise.resolve();
|
|
1905
1905
|
}
|
|
1906
1906
|
/**
|
|
1907
1907
|
* 销毁
|
|
1908
1908
|
*/
|
|
1909
1909
|
destroy() {
|
|
1910
1910
|
if (this.historyChange) {
|
|
1911
|
-
const e =
|
|
1912
|
-
|
|
1911
|
+
const e = $();
|
|
1912
|
+
$t(e, "popstate", this.historyChange);
|
|
1913
1913
|
}
|
|
1914
1914
|
}
|
|
1915
1915
|
/**
|
|
@@ -1919,8 +1919,8 @@ class qr {
|
|
|
1919
1919
|
* @param mark
|
|
1920
1920
|
* @param routes
|
|
1921
1921
|
*/
|
|
1922
|
-
[
|
|
1923
|
-
for (let i of this[
|
|
1922
|
+
[lr](e, t, r, n) {
|
|
1923
|
+
for (let i of this[$e])
|
|
1924
1924
|
try {
|
|
1925
1925
|
const o = Reflect.apply(i, {}, [e, t, r, n]);
|
|
1926
1926
|
if (o === !1)
|
|
@@ -1935,7 +1935,7 @@ class qr {
|
|
|
1935
1935
|
* @param filter
|
|
1936
1936
|
*/
|
|
1937
1937
|
beforeRestoreEach(e) {
|
|
1938
|
-
this[
|
|
1938
|
+
this[$e].push(e);
|
|
1939
1939
|
}
|
|
1940
1940
|
/**
|
|
1941
1941
|
* 移除before restore filter
|
|
@@ -1943,19 +1943,19 @@ class qr {
|
|
|
1943
1943
|
* @returns
|
|
1944
1944
|
*/
|
|
1945
1945
|
removeBeforeRestoreEach(e) {
|
|
1946
|
-
const t = this[
|
|
1947
|
-
return t !== -1 ? (this[
|
|
1946
|
+
const t = this[$e].indexOf(e);
|
|
1947
|
+
return t !== -1 ? (this[$e].splice(t, 1), !0) : !1;
|
|
1948
1948
|
}
|
|
1949
1949
|
/**
|
|
1950
1950
|
* 导航到第一个route
|
|
1951
1951
|
*/
|
|
1952
|
-
[
|
|
1953
|
-
const e = this[ke]() ?? "/", t = this.storage.getItem(
|
|
1952
|
+
[or]() {
|
|
1953
|
+
const e = this[ke]() ?? "/", t = this.storage.getItem(ar);
|
|
1954
1954
|
if (t)
|
|
1955
1955
|
try {
|
|
1956
1956
|
const o = JSON.parse(t);
|
|
1957
1957
|
if (o.mark === e && Array.isArray(o.routes) && o.routes.length > 0) {
|
|
1958
|
-
const a = o.routes.filter((l, u) => (l.params = l.params ?
|
|
1958
|
+
const a = o.routes.filter((l, u) => (l.params = l.params ? Sr(l.params) : {}, this[lr](l, u, e, o.routes)));
|
|
1959
1959
|
if (a.length > 0) {
|
|
1960
1960
|
const l = this[gt](), u = a.length - 1;
|
|
1961
1961
|
a[u].query = l || a[u].query, this[Se](a);
|
|
@@ -1975,16 +1975,16 @@ class qr {
|
|
|
1975
1975
|
* @param mark
|
|
1976
1976
|
* @param routes
|
|
1977
1977
|
*/
|
|
1978
|
-
[
|
|
1978
|
+
[Te](e, t) {
|
|
1979
1979
|
try {
|
|
1980
1980
|
t.forEach((i) => {
|
|
1981
|
-
i.params = i.params ?
|
|
1981
|
+
i.params = i.params ? Rr(i.params) : {};
|
|
1982
1982
|
});
|
|
1983
1983
|
const n = JSON.stringify({
|
|
1984
1984
|
mark: e,
|
|
1985
1985
|
routes: t
|
|
1986
1986
|
});
|
|
1987
|
-
this.storage.setItem(
|
|
1987
|
+
this.storage.setItem(ar, n);
|
|
1988
1988
|
} catch (r) {
|
|
1989
1989
|
console.error(r.message, r);
|
|
1990
1990
|
}
|
|
@@ -1996,7 +1996,7 @@ class qr {
|
|
|
1996
1996
|
*/
|
|
1997
1997
|
setRestorePoint(e) {
|
|
1998
1998
|
const t = this[ke]() ?? "/";
|
|
1999
|
-
this[
|
|
1999
|
+
this[Te](t, e);
|
|
2000
2000
|
}
|
|
2001
2001
|
/**
|
|
2002
2002
|
* 通知修改
|
|
@@ -2008,7 +2008,7 @@ class qr {
|
|
|
2008
2008
|
* 获取当前标志
|
|
2009
2009
|
*/
|
|
2010
2010
|
[ke]() {
|
|
2011
|
-
const e =
|
|
2011
|
+
const e = $();
|
|
2012
2012
|
if (this.mode === "path") {
|
|
2013
2013
|
let t = e.location.pathname;
|
|
2014
2014
|
return this.base && t.indexOf(this.base) === 0 && (t = t.substring(this.base.length)), t;
|
|
@@ -2023,7 +2023,7 @@ class qr {
|
|
|
2023
2023
|
* 获取当前search
|
|
2024
2024
|
*/
|
|
2025
2025
|
[gt]() {
|
|
2026
|
-
let t =
|
|
2026
|
+
let t = $().location.search;
|
|
2027
2027
|
return t.length > 0 && t.indexOf("?") === 0 && (t = t.substring(1)), t;
|
|
2028
2028
|
}
|
|
2029
2029
|
/**
|
|
@@ -2039,7 +2039,7 @@ class qr {
|
|
|
2039
2039
|
* @param consume
|
|
2040
2040
|
*/
|
|
2041
2041
|
go(e, t = !1) {
|
|
2042
|
-
const r =
|
|
2042
|
+
const r = $();
|
|
2043
2043
|
this[ue] = t, r.history.go(e);
|
|
2044
2044
|
}
|
|
2045
2045
|
/**
|
|
@@ -2048,8 +2048,8 @@ class qr {
|
|
|
2048
2048
|
* @param trigger
|
|
2049
2049
|
*/
|
|
2050
2050
|
goBack(e, t) {
|
|
2051
|
-
const r =
|
|
2052
|
-
if (
|
|
2051
|
+
const r = $(), n = r.history.state;
|
|
2052
|
+
if (ur(n) && n.length > 0) {
|
|
2053
2053
|
let i = !1;
|
|
2054
2054
|
for (let f = n.length - 1; f >= 0; f--) {
|
|
2055
2055
|
const c = S.from(n[f]);
|
|
@@ -2066,12 +2066,10 @@ class qr {
|
|
|
2066
2066
|
let a = null;
|
|
2067
2067
|
const l = () => {
|
|
2068
2068
|
r.history.go(-1), a = setTimeout(l, o);
|
|
2069
|
-
}
|
|
2070
|
-
a = setTimeout(l, o);
|
|
2071
|
-
const u = () => {
|
|
2069
|
+
}, u = () => {
|
|
2072
2070
|
clearTimeout(a);
|
|
2073
|
-
const c =
|
|
2074
|
-
if (
|
|
2071
|
+
const c = $().history.state;
|
|
2072
|
+
if (ur(c) && c.length > 0) {
|
|
2075
2073
|
let h = c.length;
|
|
2076
2074
|
const y = c[h - 1], d = S.from(y);
|
|
2077
2075
|
if (S.isSame(d, e))
|
|
@@ -2085,12 +2083,14 @@ class qr {
|
|
|
2085
2083
|
break;
|
|
2086
2084
|
}
|
|
2087
2085
|
}
|
|
2088
|
-
return m ? (
|
|
2086
|
+
return m ? (setTimeout(() => {
|
|
2087
|
+
a = setTimeout(l, o), this.go(-1, u);
|
|
2088
|
+
}, 0), !0) : (t(), !0);
|
|
2089
2089
|
}
|
|
2090
2090
|
}
|
|
2091
2091
|
return t(), !0;
|
|
2092
2092
|
};
|
|
2093
|
-
this.go(-1, u);
|
|
2093
|
+
a = setTimeout(l, o), this.go(-1, u);
|
|
2094
2094
|
} else
|
|
2095
2095
|
t();
|
|
2096
2096
|
}
|
|
@@ -2100,9 +2100,9 @@ class qr {
|
|
|
2100
2100
|
*/
|
|
2101
2101
|
push(e) {
|
|
2102
2102
|
const t = this[wt](e.currentRoute);
|
|
2103
|
-
e.currentRoute.traceless !== !0 && !qe(this.traceless, e.currentRoute) &&
|
|
2103
|
+
e.currentRoute.traceless !== !0 && !qe(this.traceless, e.currentRoute) && $().history.pushState(e.routes, "", t);
|
|
2104
2104
|
const r = e.currentRoute.fullPath;
|
|
2105
|
-
this[
|
|
2105
|
+
this[Te](r, e.routes);
|
|
2106
2106
|
}
|
|
2107
2107
|
/**
|
|
2108
2108
|
* 替换当前记录
|
|
@@ -2110,16 +2110,16 @@ class qr {
|
|
|
2110
2110
|
*/
|
|
2111
2111
|
replace(e) {
|
|
2112
2112
|
const t = this[wt](e.currentRoute);
|
|
2113
|
-
e.currentRoute.traceless !== !0 && !qe(this.traceless, e.currentRoute) &&
|
|
2113
|
+
e.currentRoute.traceless !== !0 && !qe(this.traceless, e.currentRoute) && $().history.replaceState(e.routes, "", t);
|
|
2114
2114
|
const r = e.currentRoute.fullPath;
|
|
2115
|
-
this[
|
|
2115
|
+
this[Te](r, e.routes);
|
|
2116
2116
|
}
|
|
2117
2117
|
/**
|
|
2118
2118
|
* 生成Location
|
|
2119
2119
|
* @param route
|
|
2120
2120
|
*/
|
|
2121
2121
|
[wt](e) {
|
|
2122
|
-
const t =
|
|
2122
|
+
const t = $();
|
|
2123
2123
|
let r = "";
|
|
2124
2124
|
if (e.query) {
|
|
2125
2125
|
let a = "";
|
|
@@ -2140,7 +2140,7 @@ class qr {
|
|
|
2140
2140
|
}
|
|
2141
2141
|
}
|
|
2142
2142
|
function wn(s = !0, e = null, t = "", r = !0, n = !1, i) {
|
|
2143
|
-
return e !== null && (e =
|
|
2143
|
+
return e !== null && (e = $().location.pathname), e && e.endsWith("/") && (e = e.substring(0, e.length - 1)), new qr("path", e ?? "", t, s, r, n, i);
|
|
2144
2144
|
}
|
|
2145
2145
|
function Fs(s = !0, e = "", t = !0, r = !1, n) {
|
|
2146
2146
|
return new qr("hash", "", e, s, t, r, n);
|
|
@@ -2291,11 +2291,11 @@ class _s {
|
|
|
2291
2291
|
function Ks(s = "", e = 50) {
|
|
2292
2292
|
return new _s(s, e);
|
|
2293
2293
|
}
|
|
2294
|
-
const Ue = Symbol("_constructRouteModel"), We = Symbol("_findRouteModel"), bt = Symbol("_findRootView"),
|
|
2295
|
-
function
|
|
2294
|
+
const Ue = Symbol("_constructRouteModel"), We = Symbol("_findRouteModel"), bt = Symbol("_findRootView"), fr = Symbol("_getFirstView"), fe = Symbol("_removeView"), cr = Symbol("_buildPage"), hr = Symbol("_resolveComponent"), yr = Symbol("_update"), ie = Symbol("_merge"), xt = Symbol("_handleHistoryChange"), ze = Symbol("_handleRouteUpdated"), Je = Symbol("routeUpdatedCallback"), w = Symbol("currentRoutes"), ge = Symbol("current"), dr = Symbol("_addRouteRecorder"), je = Symbol("_removeRouteRecorder"), Ge = Symbol("_cloneRouteRecorder"), j = Symbol("_handleError"), Qe = Symbol("errorCallback"), B = Symbol("registerKey"), Xe = Symbol("notFoundKey"), Rt = Symbol("notFoundPathKey"), k = Symbol("forestKey"), A = Symbol("historyKey"), Oe = Symbol("beforeFiltersKey"), Le = Symbol("afterFiltersKey"), Me = Symbol("destroyFiltersKey"), St = Symbol("propsFilterKey"), we = Symbol("mainDispatcherKey"), Pt = Symbol("initKey"), ce = Symbol("readyKey"), Ct = Symbol("readyHandlersKey"), Ye = Symbol("_markReady"), pr = Symbol("_createNextFn"), At = Symbol("_start"), Et = Symbol("_before"), Ft = Symbol("_after"), mr = Symbol("_destroy"), _t = Symbol("_load"), Ne = Symbol("_unload"), Ie = Symbol("routerGuardKey");
|
|
2295
|
+
function Ts(s) {
|
|
2296
2296
|
return s.layers.length == 0 || s.layers[0].views.length == 0;
|
|
2297
2297
|
}
|
|
2298
|
-
function
|
|
2298
|
+
function $s(s) {
|
|
2299
2299
|
let e = [];
|
|
2300
2300
|
return s.layers.forEach((t) => {
|
|
2301
2301
|
t.models == null || t.models == null || t.models.forEach((r) => {
|
|
@@ -2380,7 +2380,7 @@ class qs {
|
|
|
2380
2380
|
/**
|
|
2381
2381
|
* 当前最新路由
|
|
2382
2382
|
*/
|
|
2383
|
-
[ge] =
|
|
2383
|
+
[ge] = gr(null);
|
|
2384
2384
|
/**
|
|
2385
2385
|
* 获取当前最新route
|
|
2386
2386
|
*/
|
|
@@ -2462,7 +2462,7 @@ class qs {
|
|
|
2462
2462
|
try {
|
|
2463
2463
|
if (!e) {
|
|
2464
2464
|
let o = [...this[w]].reverse();
|
|
2465
|
-
return this[Ne](o), Ae &&
|
|
2465
|
+
return this[Ne](o), Ae && $().location.reload(), Promise.resolve();
|
|
2466
2466
|
}
|
|
2467
2467
|
let t = null, r = [], n = [], i = 0;
|
|
2468
2468
|
for (; i < e.length && i < this[w].length && S.isSame(e[i], this[w][i]); i++)
|
|
@@ -2505,8 +2505,8 @@ class qs {
|
|
|
2505
2505
|
* 加入路由记录
|
|
2506
2506
|
* @param route
|
|
2507
2507
|
*/
|
|
2508
|
-
[
|
|
2509
|
-
if (e.opsType ===
|
|
2508
|
+
[dr](e) {
|
|
2509
|
+
if (e.opsType === T.Open) {
|
|
2510
2510
|
let t = !1;
|
|
2511
2511
|
const r = this[w].length - 1;
|
|
2512
2512
|
for (let n = r; n >= 0; n--) {
|
|
@@ -2551,7 +2551,7 @@ class qs {
|
|
|
2551
2551
|
}
|
|
2552
2552
|
if (t != -1) {
|
|
2553
2553
|
let r = this[w][t];
|
|
2554
|
-
this[w].splice(t, 1), this[
|
|
2554
|
+
this[w].splice(t, 1), this[mr](r, r.session);
|
|
2555
2555
|
}
|
|
2556
2556
|
}
|
|
2557
2557
|
/**
|
|
@@ -2777,12 +2777,12 @@ class qs {
|
|
|
2777
2777
|
for (let u of l) {
|
|
2778
2778
|
let f = new ht();
|
|
2779
2779
|
f.name = u.name, u.path && u.path.length > 0 ? t !== "/" ? f.path = `${t}${u.path}` : f.path = u.path : (i = !0, f.path = t);
|
|
2780
|
-
let c = new
|
|
2780
|
+
let c = new Yt();
|
|
2781
2781
|
c.models = [...n], f.layers = [c, ...u.layers], o.push(f);
|
|
2782
2782
|
}
|
|
2783
2783
|
}
|
|
2784
2784
|
if (!i) {
|
|
2785
|
-
const a = new
|
|
2785
|
+
const a = new Yt();
|
|
2786
2786
|
a.models = n;
|
|
2787
2787
|
const l = new ht();
|
|
2788
2788
|
l.name = e.name, l.path = t, l.layers = [a], o.splice(0, 0, l);
|
|
@@ -2860,7 +2860,7 @@ class qs {
|
|
|
2860
2860
|
let r = t.path.indexOf("?");
|
|
2861
2861
|
r !== -1 && r < t.path.length - 1 && (t.query = t.path.substring(r + 1), t.path = t.path.substring(0, r));
|
|
2862
2862
|
}
|
|
2863
|
-
t.root = t.root ?? te, t.opsType = t.opsType ?? this.options.defaultOperationType ??
|
|
2863
|
+
t.root = t.root ?? te, t.opsType = t.opsType ?? this.options.defaultOperationType ?? T.Push;
|
|
2864
2864
|
}
|
|
2865
2865
|
return t;
|
|
2866
2866
|
}
|
|
@@ -2870,7 +2870,7 @@ class qs {
|
|
|
2870
2870
|
*/
|
|
2871
2871
|
push(...e) {
|
|
2872
2872
|
let t = this[I](e);
|
|
2873
|
-
return t ? (t.opsType = t.opsType ||
|
|
2873
|
+
return t ? (t.opsType = t.opsType || T.Push, this.to(t)) : (this[j]("resolve route fail", t), this);
|
|
2874
2874
|
}
|
|
2875
2875
|
/**
|
|
2876
2876
|
* 路由跳转(operation类型为Put)
|
|
@@ -2878,7 +2878,7 @@ class qs {
|
|
|
2878
2878
|
*/
|
|
2879
2879
|
put(...e) {
|
|
2880
2880
|
let t = this[I](e);
|
|
2881
|
-
return t ? (t.opsType =
|
|
2881
|
+
return t ? (t.opsType = T.Put, t.traceless = !0, this.to(t)) : (this[j]("resolve route fail", t), this);
|
|
2882
2882
|
}
|
|
2883
2883
|
/**
|
|
2884
2884
|
* 路由跳转(operation类型为Replace)
|
|
@@ -2886,7 +2886,7 @@ class qs {
|
|
|
2886
2886
|
*/
|
|
2887
2887
|
replace(...e) {
|
|
2888
2888
|
let t = this[I](e);
|
|
2889
|
-
return t ? (t.opsType =
|
|
2889
|
+
return t ? (t.opsType = T.Replace, this.to(t)) : (this[j]("resolve route fail", t), this);
|
|
2890
2890
|
}
|
|
2891
2891
|
/**
|
|
2892
2892
|
* 路由跳转(operation类型为Append)
|
|
@@ -2894,7 +2894,7 @@ class qs {
|
|
|
2894
2894
|
*/
|
|
2895
2895
|
append(...e) {
|
|
2896
2896
|
let t = this[I](e);
|
|
2897
|
-
return t ? (t.opsType =
|
|
2897
|
+
return t ? (t.opsType = T.Append, this.to(t)) : (this[j]("resolve route fail", t), this);
|
|
2898
2898
|
}
|
|
2899
2899
|
/**
|
|
2900
2900
|
* 移除
|
|
@@ -2914,12 +2914,12 @@ class qs {
|
|
|
2914
2914
|
if (e.root ? o = e.root : o = this[w][0].root ?? te, e.all)
|
|
2915
2915
|
for (let u = this[w].length - 1; u > 0; u--) {
|
|
2916
2916
|
let f = this[w][u];
|
|
2917
|
-
f.opsType ===
|
|
2917
|
+
f.opsType === T.Append && f.root === o && (a.splice(0, 0, f), i = u - 1);
|
|
2918
2918
|
}
|
|
2919
2919
|
else if (e.until)
|
|
2920
2920
|
for (let u = this[w].length - 1; u > 0; u--) {
|
|
2921
2921
|
let f = this[w][u];
|
|
2922
|
-
if (f.opsType ===
|
|
2922
|
+
if (f.opsType === T.Append && f.root === o) {
|
|
2923
2923
|
if (e.until.charAt(0) === "/" && e.until === f.path) {
|
|
2924
2924
|
i = u;
|
|
2925
2925
|
break;
|
|
@@ -2932,11 +2932,11 @@ class qs {
|
|
|
2932
2932
|
}
|
|
2933
2933
|
} else {
|
|
2934
2934
|
o = te;
|
|
2935
|
-
let u = this[
|
|
2935
|
+
let u = this[fr](this[k]);
|
|
2936
2936
|
u && (o = u.name);
|
|
2937
2937
|
for (let f = this[w].length - 1; f > 0; f--) {
|
|
2938
2938
|
let c = this[w][f];
|
|
2939
|
-
if (c.opsType ===
|
|
2939
|
+
if (c.opsType === T.Append && c.root === o) {
|
|
2940
2940
|
a.push(c), i = f - 1;
|
|
2941
2941
|
break;
|
|
2942
2942
|
}
|
|
@@ -2951,8 +2951,8 @@ class qs {
|
|
|
2951
2951
|
if (i !== -1 && (l = this[w][i]), this[Ne](a)) {
|
|
2952
2952
|
if (t === !1)
|
|
2953
2953
|
return n.resolve(), r(!0), !0;
|
|
2954
|
-
const u = () => (n.resolve(), r(!0), !0);
|
|
2955
|
-
if (l && S.isSame(l, this[w][
|
|
2954
|
+
const u = () => (n.resolve(), r(!0), !0), f = this[w].length;
|
|
2955
|
+
if (l && S.isSame(l, this[w][f - 1])) {
|
|
2956
2956
|
this[A]?.goBack(l, u);
|
|
2957
2957
|
return;
|
|
2958
2958
|
}
|
|
@@ -2970,7 +2970,7 @@ class qs {
|
|
|
2970
2970
|
*/
|
|
2971
2971
|
open(...e) {
|
|
2972
2972
|
let t = this[I](e);
|
|
2973
|
-
return t ? (t.opsType =
|
|
2973
|
+
return t ? (t.opsType = T.Open, this.to(t)) : (this[j]("resolve route fail", t), this);
|
|
2974
2974
|
}
|
|
2975
2975
|
/**
|
|
2976
2976
|
* 关闭路由跳转的页面
|
|
@@ -3029,8 +3029,8 @@ class qs {
|
|
|
3029
3029
|
if (o.session.updateResult && o.session.updateResult.status === "success")
|
|
3030
3030
|
try {
|
|
3031
3031
|
let u = S.clone(l, !0);
|
|
3032
|
-
const f = new
|
|
3033
|
-
l.opsType ===
|
|
3032
|
+
const f = new ir(u, this[Ge]());
|
|
3033
|
+
l.opsType === T.Replace ? this[A]?.replace(f) : this[A]?.push(f);
|
|
3034
3034
|
} catch (u) {
|
|
3035
3035
|
console.error(u.message, u);
|
|
3036
3036
|
}
|
|
@@ -3061,7 +3061,7 @@ class qs {
|
|
|
3061
3061
|
/**
|
|
3062
3062
|
* 创建next函数
|
|
3063
3063
|
*/
|
|
3064
|
-
[
|
|
3064
|
+
[pr](e) {
|
|
3065
3065
|
return (t, r) => {
|
|
3066
3066
|
if (typeof t == "boolean")
|
|
3067
3067
|
e.session.redirect = !1, t ? e.resolve() : e.reject(r ?? null);
|
|
@@ -3088,7 +3088,7 @@ class qs {
|
|
|
3088
3088
|
//查找结果
|
|
3089
3089
|
find: null
|
|
3090
3090
|
};
|
|
3091
|
-
return this[We](n), n.find && (r.routeModel = n.find, e.matched =
|
|
3091
|
+
return this[We](n), n.find && (r.routeModel = n.find, e.matched = $s(n.find), Array.isArray(e.matched) && e.matched.length > 0 && (e.meta = n.find.layers[0].models[0].meta)), new st(r);
|
|
3092
3092
|
}
|
|
3093
3093
|
/**
|
|
3094
3094
|
* 执行before事件
|
|
@@ -3097,7 +3097,7 @@ class qs {
|
|
|
3097
3097
|
[Et](e) {
|
|
3098
3098
|
for (let t of this[Oe])
|
|
3099
3099
|
e.post((r) => {
|
|
3100
|
-
const n = this[
|
|
3100
|
+
const n = this[pr](r);
|
|
3101
3101
|
Reflect.apply(t, {}, [r.session.to, r.session.from, n, r.session]);
|
|
3102
3102
|
});
|
|
3103
3103
|
}
|
|
@@ -3121,7 +3121,7 @@ class qs {
|
|
|
3121
3121
|
* @param route
|
|
3122
3122
|
* @param session
|
|
3123
3123
|
*/
|
|
3124
|
-
[
|
|
3124
|
+
[mr](e, t) {
|
|
3125
3125
|
for (let r of this[Me])
|
|
3126
3126
|
try {
|
|
3127
3127
|
Reflect.apply(r, {}, [e, t]);
|
|
@@ -3154,7 +3154,7 @@ class qs {
|
|
|
3154
3154
|
}
|
|
3155
3155
|
}
|
|
3156
3156
|
let i = rt.from(t.session);
|
|
3157
|
-
this[
|
|
3157
|
+
this[cr](r, n, i).then(
|
|
3158
3158
|
(o) => {
|
|
3159
3159
|
this[k], t.session.updateResult = o ?? {
|
|
3160
3160
|
status: "success",
|
|
@@ -3213,7 +3213,7 @@ class qs {
|
|
|
3213
3213
|
* 查找first view
|
|
3214
3214
|
* @param page
|
|
3215
3215
|
*/
|
|
3216
|
-
[
|
|
3216
|
+
[fr](e) {
|
|
3217
3217
|
return e.layers.length > 0 && e.layers[0].views.length > 0 ? e.layers[0].views[0] : null;
|
|
3218
3218
|
}
|
|
3219
3219
|
/**
|
|
@@ -3229,7 +3229,7 @@ class qs {
|
|
|
3229
3229
|
let i = e.layers[t.y].views[t.x], o = !1, a = [], l = !1, u = [...i.slots.value];
|
|
3230
3230
|
for (let c = u.length - 1; c >= 0; c--) {
|
|
3231
3231
|
let h = u[c];
|
|
3232
|
-
(!r || r.indexOf(h.index) != -1) && (h.route && i[J] && (this[je](h.route), h.active === !0 && h.route.opsType ==
|
|
3232
|
+
(!r || r.indexOf(h.index) != -1) && (h.route && i[J] && (this[je](h.route), h.active === !0 && h.route.opsType == T.Append && (l = !0)), a.push(new V(i, h.index, t.y)), u.splice(c, 1));
|
|
3233
3233
|
}
|
|
3234
3234
|
if (u.length == 0)
|
|
3235
3235
|
n ? i.slots.value = u : e.layers[t.y].views.splice(t.x, 1);
|
|
@@ -3291,7 +3291,7 @@ class qs {
|
|
|
3291
3291
|
}
|
|
3292
3292
|
this[we].post((a) => {
|
|
3293
3293
|
if (i && o === !0) {
|
|
3294
|
-
const l = S.clone(i, !0), u = new
|
|
3294
|
+
const l = S.clone(i, !0), u = new ir(l, this[Ge]());
|
|
3295
3295
|
this[A]?.replace(u);
|
|
3296
3296
|
}
|
|
3297
3297
|
a.resolve(), r();
|
|
@@ -3304,10 +3304,10 @@ class qs {
|
|
|
3304
3304
|
* @param routeModel
|
|
3305
3305
|
* @returns
|
|
3306
3306
|
*/
|
|
3307
|
-
[
|
|
3307
|
+
[cr](e, t, r) {
|
|
3308
3308
|
const n = e.updateType ?? Ze.Part;
|
|
3309
|
-
return this[
|
|
3310
|
-
const o = this[
|
|
3309
|
+
return this[hr](t).then(() => {
|
|
3310
|
+
const o = this[yr](t, e, r, n);
|
|
3311
3311
|
if (o.status === "error")
|
|
3312
3312
|
throw Error(o.message);
|
|
3313
3313
|
return o;
|
|
@@ -3316,7 +3316,7 @@ class qs {
|
|
|
3316
3316
|
/**
|
|
3317
3317
|
* 解析组件
|
|
3318
3318
|
*/
|
|
3319
|
-
[
|
|
3319
|
+
[hr](e) {
|
|
3320
3320
|
let t = [];
|
|
3321
3321
|
for (let r = 0; r < e.layers.length; r++) {
|
|
3322
3322
|
let n = e.layers[r];
|
|
@@ -3335,14 +3335,14 @@ class qs {
|
|
|
3335
3335
|
* @param updateType
|
|
3336
3336
|
* @returns
|
|
3337
3337
|
*/
|
|
3338
|
-
[
|
|
3338
|
+
[yr](e, t, r, n) {
|
|
3339
3339
|
if (e.layers[0].models.length !== 1)
|
|
3340
3340
|
return {
|
|
3341
3341
|
status: "error",
|
|
3342
3342
|
message: "illegal route structure(multi root node)"
|
|
3343
3343
|
};
|
|
3344
3344
|
const i = e.layers[0].models[0];
|
|
3345
|
-
let o = this[k], a =
|
|
3345
|
+
let o = this[k], a = Ts(o), l = t.root ?? te, u;
|
|
3346
3346
|
!a && n == Ze.Part && (u = this[bt](o, t));
|
|
3347
3347
|
let f, c = 0;
|
|
3348
3348
|
if (u == null || u == null)
|
|
@@ -3389,7 +3389,7 @@ class qs {
|
|
|
3389
3389
|
}
|
|
3390
3390
|
else
|
|
3391
3391
|
f = o.layers[u.y].views[u.x];
|
|
3392
|
-
if (c = u.y, f[J] = !0, t.opsType ===
|
|
3392
|
+
if (c = u.y, f[J] = !0, t.opsType === T.Append) {
|
|
3393
3393
|
t.index = t.index ?? le.get(), t.active = !0;
|
|
3394
3394
|
let h = f.slots.value;
|
|
3395
3395
|
if (h.length > 0) {
|
|
@@ -3400,7 +3400,7 @@ class qs {
|
|
|
3400
3400
|
f.slots.value = [...h, y];
|
|
3401
3401
|
let d = c + 1, m = 1, p = new V(f, t.index, c);
|
|
3402
3402
|
this[ie](o, d, e, m, p);
|
|
3403
|
-
} else if (t.opsType ===
|
|
3403
|
+
} else if (t.opsType === T.Open) {
|
|
3404
3404
|
let h = f.slots.value;
|
|
3405
3405
|
const y = t.active ?? !0;
|
|
3406
3406
|
let d = !1;
|
|
@@ -3496,7 +3496,7 @@ class qs {
|
|
|
3496
3496
|
let h = f[z];
|
|
3497
3497
|
h && (t.slot = new as(l, c, h?.view.name, h?.index ?? 0));
|
|
3498
3498
|
}
|
|
3499
|
-
return r.to = void 0, r.routeModel = void 0, t.session = r, this[
|
|
3499
|
+
return r.to = void 0, r.routeModel = void 0, t.session = r, this[dr](t), {
|
|
3500
3500
|
status: "success",
|
|
3501
3501
|
message: ""
|
|
3502
3502
|
};
|
|
@@ -3538,7 +3538,7 @@ class qs {
|
|
|
3538
3538
|
* @param parentViewIndex
|
|
3539
3539
|
* @returns
|
|
3540
3540
|
*/
|
|
3541
|
-
[
|
|
3541
|
+
[Ar](e, t, r, n, i, o) {
|
|
3542
3542
|
if (t < 0 || t > this[k].layers.length)
|
|
3543
3543
|
return null;
|
|
3544
3544
|
if (t < this[k].layers.length) {
|
|
@@ -3629,7 +3629,7 @@ function Ws(s, e = !1) {
|
|
|
3629
3629
|
let t = null;
|
|
3630
3630
|
return e ? t = s.hideCancelled ?? s.leaveCancelled : t = s.leaveCancelled, t;
|
|
3631
3631
|
}
|
|
3632
|
-
function
|
|
3632
|
+
function Bt(s) {
|
|
3633
3633
|
let e, t = s.duration;
|
|
3634
3634
|
return typeof t == "object" ? e = {
|
|
3635
3635
|
enter: t.enter ?? -1,
|
|
@@ -3650,7 +3650,7 @@ function Ce(s, e) {
|
|
|
3650
3650
|
s.classList.remove(e);
|
|
3651
3651
|
}
|
|
3652
3652
|
const zs = Ae && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : setTimeout;
|
|
3653
|
-
function
|
|
3653
|
+
function kt(s) {
|
|
3654
3654
|
zs(s);
|
|
3655
3655
|
}
|
|
3656
3656
|
function H(s, e, t) {
|
|
@@ -3666,25 +3666,25 @@ function Lr(s, e, t, r = -1, n, i, o, a) {
|
|
|
3666
3666
|
}
|
|
3667
3667
|
const l = ["animationend", "transitionend"], u = (f) => {
|
|
3668
3668
|
l.forEach((c) => {
|
|
3669
|
-
|
|
3669
|
+
$t(e, c, u);
|
|
3670
3670
|
}), Reflect.apply(i, s, [e, t, r]), a && Reflect.apply(a, s, []);
|
|
3671
3671
|
};
|
|
3672
3672
|
l.forEach((f) => {
|
|
3673
|
-
|
|
3673
|
+
Tt(e, f, u);
|
|
3674
3674
|
});
|
|
3675
3675
|
}
|
|
3676
3676
|
if (x(o)) {
|
|
3677
3677
|
const l = "animationcancel", u = (f) => {
|
|
3678
|
-
Reflect.apply(o, s, [e, t, r]),
|
|
3678
|
+
Reflect.apply(o, s, [e, t, r]), $t(e, l, u);
|
|
3679
3679
|
};
|
|
3680
|
-
|
|
3680
|
+
Tt(e, l, u);
|
|
3681
3681
|
}
|
|
3682
3682
|
}
|
|
3683
|
-
function
|
|
3684
|
-
return !Ae || s === null ? !1 : s.opsType ===
|
|
3683
|
+
function Ut(s) {
|
|
3684
|
+
return !Ae || s === null ? !1 : s.opsType === T.Append || s.opsType === T.Open;
|
|
3685
3685
|
}
|
|
3686
3686
|
function Mr(s, e, t, r = {}, n, i = -1) {
|
|
3687
|
-
if (e ||
|
|
3687
|
+
if (e || Ut(n)) {
|
|
3688
3688
|
const o = jr(r, e);
|
|
3689
3689
|
o && Pe(t, o);
|
|
3690
3690
|
const a = Or(r, e);
|
|
@@ -3694,7 +3694,7 @@ function Mr(s, e, t, r = {}, n, i = -1) {
|
|
|
3694
3694
|
}
|
|
3695
3695
|
}
|
|
3696
3696
|
function Nr(s, e, t, r = {}, n, i, o, a) {
|
|
3697
|
-
if (!
|
|
3697
|
+
if (!Ut(i) && !e) {
|
|
3698
3698
|
x(a) && a(s, a, [t]);
|
|
3699
3699
|
return;
|
|
3700
3700
|
}
|
|
@@ -3703,7 +3703,7 @@ function Nr(s, e, t, r = {}, n, i, o, a) {
|
|
|
3703
3703
|
x(a) && a(s, a, [t]);
|
|
3704
3704
|
return;
|
|
3705
3705
|
}
|
|
3706
|
-
|
|
3706
|
+
kt(() => {
|
|
3707
3707
|
Lr(s, t, i, o, n, () => {
|
|
3708
3708
|
u && Ce(t, u), f && Ce(t, f), x(h) && H(s, h, [t, e, i, o]), x(a) && a(s, a, [t]);
|
|
3709
3709
|
}, () => {
|
|
@@ -3712,7 +3712,7 @@ function Nr(s, e, t, r = {}, n, i, o, a) {
|
|
|
3712
3712
|
});
|
|
3713
3713
|
}
|
|
3714
3714
|
function Ir(s, e, t, r = {}, n, i, o, a, l) {
|
|
3715
|
-
if (!
|
|
3715
|
+
if (console.info("------------- leave -------------"), !Ut(o) && !e) {
|
|
3716
3716
|
!e && x(i) && i();
|
|
3717
3717
|
return;
|
|
3718
3718
|
}
|
|
@@ -3721,7 +3721,7 @@ function Ir(s, e, t, r = {}, n, i, o, a, l) {
|
|
|
3721
3721
|
!e && x(i) && i();
|
|
3722
3722
|
return;
|
|
3723
3723
|
}
|
|
3724
|
-
u && Pe(t, u), f && Pe(t, f), x(h) && H(s, h, [t, e, o, a]),
|
|
3724
|
+
u && Pe(t, u), f && Pe(t, f), x(h) && H(s, h, [t, e, o, a]), kt(() => {
|
|
3725
3725
|
Lr(s, t, o, a, n, () => {
|
|
3726
3726
|
f && Ce(t, f), c && Ce(t, c), x(y) && H(s, y, [t, e, o, a]), x(l) && H(s, l, [t]), !e && x(i) && i();
|
|
3727
3727
|
}, () => {
|
|
@@ -3729,8 +3729,8 @@ function Ir(s, e, t, r = {}, n, i, o, a, l) {
|
|
|
3729
3729
|
}), u && Ce(t, u), c && Pe(t, c);
|
|
3730
3730
|
});
|
|
3731
3731
|
}
|
|
3732
|
-
function
|
|
3733
|
-
const n = e.mode ?? "default", i =
|
|
3732
|
+
function jt(s, e = {}, t, r = -1) {
|
|
3733
|
+
const n = e.mode ?? "default", i = Bt(e);
|
|
3734
3734
|
return {
|
|
3735
3735
|
//mode
|
|
3736
3736
|
mode: n,
|
|
@@ -3749,7 +3749,7 @@ function Ot(s, e = {}, t, r = -1) {
|
|
|
3749
3749
|
Ir(s, !1, a, e, i.leave, l, t, r);
|
|
3750
3750
|
},
|
|
3751
3751
|
//clone
|
|
3752
|
-
clone: (a) =>
|
|
3752
|
+
clone: (a) => jt(s, e, t, r)
|
|
3753
3753
|
};
|
|
3754
3754
|
}
|
|
3755
3755
|
function Hr(s) {
|
|
@@ -3760,7 +3760,7 @@ function Js(s, e, t = {}, r, n, i, o) {
|
|
|
3760
3760
|
const a = Hr(e);
|
|
3761
3761
|
if (a == null)
|
|
3762
3762
|
return;
|
|
3763
|
-
const l =
|
|
3763
|
+
const l = Bt(t);
|
|
3764
3764
|
Mr(s, !0, a, t, r, n), Nr(s, !0, a, t, l.show, r, n, (u) => {
|
|
3765
3765
|
x(o) && H(s, o, [u]);
|
|
3766
3766
|
});
|
|
@@ -3772,7 +3772,7 @@ function Gs(s, e, t = {}, r, n, i, o) {
|
|
|
3772
3772
|
const a = Hr(e);
|
|
3773
3773
|
if (a == null)
|
|
3774
3774
|
return;
|
|
3775
|
-
const l =
|
|
3775
|
+
const l = Bt(t);
|
|
3776
3776
|
Ir(s, !0, a, t, l.hide, null, r, n, (u) => {
|
|
3777
3777
|
x(o) && H(s, o, [u]);
|
|
3778
3778
|
});
|
|
@@ -3780,7 +3780,7 @@ function Gs(s, e, t = {}, r, n, i, o) {
|
|
|
3780
3780
|
x(o) && H(s, o, []);
|
|
3781
3781
|
}
|
|
3782
3782
|
function Qs(s, e = {}) {
|
|
3783
|
-
|
|
3783
|
+
kt(() => {
|
|
3784
3784
|
for (let t = 0; t < s.length; t++)
|
|
3785
3785
|
Reflect.apply(s[t], e, []);
|
|
3786
3786
|
});
|
|
@@ -3813,7 +3813,7 @@ class Xs {
|
|
|
3813
3813
|
this.node = e, this.state = t;
|
|
3814
3814
|
}
|
|
3815
3815
|
}
|
|
3816
|
-
const
|
|
3816
|
+
const Ot = wr({
|
|
3817
3817
|
//名称
|
|
3818
3818
|
name: "RouterView",
|
|
3819
3819
|
//继承特性
|
|
@@ -4026,12 +4026,12 @@ const Lt = br({
|
|
|
4026
4026
|
},
|
|
4027
4027
|
//setup
|
|
4028
4028
|
setup(s, e) {
|
|
4029
|
-
const t =
|
|
4029
|
+
const t = Lt();
|
|
4030
4030
|
if (t === null || t.proxy === null) {
|
|
4031
4031
|
console.error("instance or instance.proxy not exist");
|
|
4032
4032
|
return;
|
|
4033
4033
|
}
|
|
4034
|
-
const r = s.multi === !0, n = G(lt, null), i = G(dt, 0), o = G(
|
|
4034
|
+
const r = s.multi === !0, n = G(lt, null), i = G(dt, 0), o = G(sr, null), a = G(pt, -1);
|
|
4035
4035
|
let l = null;
|
|
4036
4036
|
const u = s.modelSlot;
|
|
4037
4037
|
if (u) {
|
|
@@ -4040,20 +4040,20 @@ const Lt = br({
|
|
|
4040
4040
|
return;
|
|
4041
4041
|
}
|
|
4042
4042
|
const h = nt(t.proxy, !0);
|
|
4043
|
-
hs(h),
|
|
4043
|
+
hs(h), rr(h, () => u.route ?? null);
|
|
4044
4044
|
} else {
|
|
4045
4045
|
if (n == null) {
|
|
4046
4046
|
console.error("router is not been injected");
|
|
4047
4047
|
return;
|
|
4048
4048
|
}
|
|
4049
|
-
const c = s.name, h = G(
|
|
4050
|
-
if (l = n[
|
|
4049
|
+
const c = s.name, h = G(nr, null), y = G(mt, 0);
|
|
4050
|
+
if (l = n[Ar](c, i, o, a, h, y), l === null)
|
|
4051
4051
|
return;
|
|
4052
|
-
se(
|
|
4052
|
+
se(nr, l);
|
|
4053
4053
|
const d = l[J] === !0;
|
|
4054
|
-
if (d && se(
|
|
4054
|
+
if (d && se(sr, l), !r && (se(pt, -1), se(dt, i + 1), se(mt, -1), d)) {
|
|
4055
4055
|
const m = nt(t.proxy, !0);
|
|
4056
|
-
|
|
4056
|
+
rr(m, () => {
|
|
4057
4057
|
const p = l.slots.value;
|
|
4058
4058
|
return p.length > 0 ? p[0].route : null;
|
|
4059
4059
|
});
|
|
@@ -4068,7 +4068,7 @@ const Lt = br({
|
|
|
4068
4068
|
for (let v = 0; v < y.length; v++) {
|
|
4069
4069
|
const g = y[v], _ = `${s.name}_${g.index}`, b = oe(s.transition, g.route, v) ?? !0, K = { modelSlot: g };
|
|
4070
4070
|
let E;
|
|
4071
|
-
e.slots.default ? E = he(
|
|
4071
|
+
e.slots.default ? E = he(Ot, K, { default: e.slots.default }) : E = he(Ot, K);
|
|
4072
4072
|
const P = {}, C = oe(s.viewClass, g.route, v);
|
|
4073
4073
|
typeof C == "string" && C.length > 0 && (P[C] = !0);
|
|
4074
4074
|
const U = oe(s.viewActiveClass, g.route, v), L = oe(s.viewInactiveClass, g.route, v), M = f.value.get(_);
|
|
@@ -4076,14 +4076,14 @@ const Lt = br({
|
|
|
4076
4076
|
const Y = M.node;
|
|
4077
4077
|
g.active ? d.unshift(() => {
|
|
4078
4078
|
const ut = () => {
|
|
4079
|
-
let Ee =
|
|
4080
|
-
Ee != null &&
|
|
4079
|
+
let Ee = er(Y);
|
|
4080
|
+
Ee != null && tr(Ee, qt.ACTIVATED);
|
|
4081
4081
|
};
|
|
4082
4082
|
Js(t, Y, s, g.route, v, b, ut);
|
|
4083
4083
|
}) : d.push(() => {
|
|
4084
4084
|
const ut = () => {
|
|
4085
|
-
const Ee =
|
|
4086
|
-
Ee != null &&
|
|
4085
|
+
const Ee = er(Y);
|
|
4086
|
+
Ee != null && tr(Ee, qt.DEACTIVATED);
|
|
4087
4087
|
};
|
|
4088
4088
|
Gs(t, Y, s, g.route, v, b, ut);
|
|
4089
4089
|
});
|
|
@@ -4102,14 +4102,12 @@ const Lt = br({
|
|
|
4102
4102
|
}
|
|
4103
4103
|
const re = oe(s.viewTag, g.route, v), at = he(re, X, { default: () => [E] });
|
|
4104
4104
|
if (c.set(_, new Xs(at, g.active)), f.value.delete(_), b) {
|
|
4105
|
-
const Y =
|
|
4105
|
+
const Y = jt(t, s, g.route, v);
|
|
4106
4106
|
at.transition = Y;
|
|
4107
4107
|
}
|
|
4108
4108
|
h.push(at);
|
|
4109
4109
|
}
|
|
4110
|
-
f.value
|
|
4111
|
-
v.node.transition = null;
|
|
4112
|
-
}), f.value = c, Qs(d, t);
|
|
4110
|
+
f.value = c, Qs(d, t);
|
|
4113
4111
|
const m = oe(s.tag, null, -1), p = {};
|
|
4114
4112
|
return Object.assign(p, e.attrs), he(m, p, { default: () => h });
|
|
4115
4113
|
} else if (u != null) {
|
|
@@ -4128,7 +4126,7 @@ const Lt = br({
|
|
|
4128
4126
|
} else {
|
|
4129
4127
|
const c = l.slots.value;
|
|
4130
4128
|
if (c.length > 0) {
|
|
4131
|
-
const h = c[0], y = h.route ?? (t.proxy &&
|
|
4129
|
+
const h = c[0], y = h.route ?? (t.proxy && Dt(t.proxy)) ?? null, d = h.model, m = {};
|
|
4132
4130
|
if (d.props) {
|
|
4133
4131
|
if (typeof d.props == "object") {
|
|
4134
4132
|
const g = be(d.props, n?.propsFilter);
|
|
@@ -4140,7 +4138,7 @@ const Lt = br({
|
|
|
4140
4138
|
}
|
|
4141
4139
|
const p = he(d.component, m);
|
|
4142
4140
|
if (oe(s.transition, y, -1) ?? !0) {
|
|
4143
|
-
const g =
|
|
4141
|
+
const g = jt(t, s, y, -1);
|
|
4144
4142
|
p.transition = g;
|
|
4145
4143
|
}
|
|
4146
4144
|
return Kt(e.slots.default, { Component: p, route: y }) ?? p;
|
|
@@ -4169,7 +4167,7 @@ function en(s, e) {
|
|
|
4169
4167
|
function xe(s, e) {
|
|
4170
4168
|
return typeof s == "function" ? Reflect.apply(s, {}, [e]) : s;
|
|
4171
4169
|
}
|
|
4172
|
-
let tn =
|
|
4170
|
+
let tn = wr({
|
|
4173
4171
|
//名称
|
|
4174
4172
|
name: "RouterLink",
|
|
4175
4173
|
//继承特性
|
|
@@ -4304,7 +4302,7 @@ class rn {
|
|
|
4304
4302
|
this.register.clear();
|
|
4305
4303
|
}
|
|
4306
4304
|
}
|
|
4307
|
-
class
|
|
4305
|
+
class vr {
|
|
4308
4306
|
/**
|
|
4309
4307
|
* module manager
|
|
4310
4308
|
*/
|
|
@@ -4608,7 +4606,7 @@ class gr {
|
|
|
4608
4606
|
};
|
|
4609
4607
|
}
|
|
4610
4608
|
l.defer = !0, l.src = i;
|
|
4611
|
-
const f =
|
|
4609
|
+
const f = $();
|
|
4612
4610
|
f.define = this.createDefine(o, t), r.appendChild(l);
|
|
4613
4611
|
});
|
|
4614
4612
|
}
|
|
@@ -4737,7 +4735,7 @@ class gr {
|
|
|
4737
4735
|
if (e.indexOf("./") == 0)
|
|
4738
4736
|
return `${ft()}${e.slice(2)}`;
|
|
4739
4737
|
if (e.indexOf("//") == 0)
|
|
4740
|
-
return `${
|
|
4738
|
+
return `${$().location.protocol}${e}`;
|
|
4741
4739
|
if (t) {
|
|
4742
4740
|
let n = this.options.alias[e];
|
|
4743
4741
|
if (!n) {
|
|
@@ -4846,7 +4844,7 @@ class nn {
|
|
|
4846
4844
|
}
|
|
4847
4845
|
const Vr = Symbol("fk"), Br = Symbol("fbk"), kr = Symbol("fepk");
|
|
4848
4846
|
function bn(s = {}) {
|
|
4849
|
-
const e = new qs(s), t = new
|
|
4847
|
+
const e = new qs(s), t = new Qt(), r = new Zt(), n = new vr(), i = {
|
|
4850
4848
|
/**
|
|
4851
4849
|
* 返回router
|
|
4852
4850
|
*/
|
|
@@ -4863,13 +4861,13 @@ function bn(s = {}) {
|
|
|
4863
4861
|
* 返回Bus类型
|
|
4864
4862
|
*/
|
|
4865
4863
|
get Bus() {
|
|
4866
|
-
return
|
|
4864
|
+
return Qt;
|
|
4867
4865
|
},
|
|
4868
4866
|
/**
|
|
4869
4867
|
* 返回全局event proxy
|
|
4870
4868
|
*/
|
|
4871
4869
|
get EventProxy() {
|
|
4872
|
-
return
|
|
4870
|
+
return Zt;
|
|
4873
4871
|
},
|
|
4874
4872
|
/**
|
|
4875
4873
|
* 返回event proxy类型
|
|
@@ -4887,7 +4885,7 @@ function bn(s = {}) {
|
|
|
4887
4885
|
* 返回Require构造函数
|
|
4888
4886
|
*/
|
|
4889
4887
|
get Require() {
|
|
4890
|
-
return
|
|
4888
|
+
return vr;
|
|
4891
4889
|
},
|
|
4892
4890
|
/**
|
|
4893
4891
|
* 返回require
|
|
@@ -4905,19 +4903,19 @@ function bn(s = {}) {
|
|
|
4905
4903
|
* 返回clone
|
|
4906
4904
|
*/
|
|
4907
4905
|
get clone() {
|
|
4908
|
-
return
|
|
4906
|
+
return Nt;
|
|
4909
4907
|
},
|
|
4910
4908
|
/**
|
|
4911
4909
|
* 判断是否为es模块
|
|
4912
4910
|
*/
|
|
4913
4911
|
get isESModule() {
|
|
4914
|
-
return
|
|
4912
|
+
return br;
|
|
4915
4913
|
},
|
|
4916
4914
|
/**
|
|
4917
4915
|
* 安装
|
|
4918
4916
|
*/
|
|
4919
4917
|
install(o) {
|
|
4920
|
-
o.provide(lt, e), o.provide(Vr, i), o.provide(Br, t), o.provide(kr, r), o.component(js,
|
|
4918
|
+
o.provide(lt, e), o.provide(Vr, i), o.provide(Br, t), o.provide(kr, r), o.component(js, Ot), o.component(Os, tn), Reflect.defineProperty(o.config.globalProperties, "$fox", {
|
|
4921
4919
|
get() {
|
|
4922
4920
|
return i;
|
|
4923
4921
|
}
|
|
@@ -4957,7 +4955,7 @@ function bn(s = {}) {
|
|
|
4957
4955
|
computed: {
|
|
4958
4956
|
//获取当前route
|
|
4959
4957
|
$route() {
|
|
4960
|
-
return
|
|
4958
|
+
return Dt(this);
|
|
4961
4959
|
}
|
|
4962
4960
|
}
|
|
4963
4961
|
}), e.init();
|
|
@@ -4969,7 +4967,7 @@ function Ur(s) {
|
|
|
4969
4967
|
return s ? s.$router : G(lt);
|
|
4970
4968
|
}
|
|
4971
4969
|
function xn(s) {
|
|
4972
|
-
return s || (s =
|
|
4970
|
+
return s || (s = Lt()?.proxy ?? void 0), s ? Dt(s) : null;
|
|
4973
4971
|
}
|
|
4974
4972
|
function Rn(s) {
|
|
4975
4973
|
return s ? s.$fox : G(Vr);
|
|
@@ -5007,11 +5005,11 @@ function An(s) {
|
|
|
5007
5005
|
});
|
|
5008
5006
|
}
|
|
5009
5007
|
export {
|
|
5010
|
-
|
|
5008
|
+
Qt as Bus,
|
|
5011
5009
|
st as EventChain,
|
|
5012
|
-
|
|
5010
|
+
Zt as EventProxy,
|
|
5013
5011
|
S as Route,
|
|
5014
|
-
|
|
5012
|
+
Nt as clone,
|
|
5015
5013
|
bn as createFox,
|
|
5016
5014
|
Ks as createMemoryHistory,
|
|
5017
5015
|
Fs as createWebHashHistory,
|
|
@@ -5021,11 +5019,11 @@ export {
|
|
|
5021
5019
|
Br as foxBusKey,
|
|
5022
5020
|
kr as foxEventProxyKey,
|
|
5023
5021
|
Vr as foxKey,
|
|
5024
|
-
|
|
5022
|
+
Fr as injectContextValue,
|
|
5025
5023
|
ln as isArray,
|
|
5026
5024
|
fn as isDate,
|
|
5027
|
-
|
|
5028
|
-
|
|
5025
|
+
br as isESModule,
|
|
5026
|
+
zt as isEqual,
|
|
5029
5027
|
x as isFunction,
|
|
5030
5028
|
an as isMap,
|
|
5031
5029
|
Gr as isNil,
|
|
@@ -5041,10 +5039,10 @@ export {
|
|
|
5041
5039
|
gn as onFoxInactivated,
|
|
5042
5040
|
pn as provideContextValue,
|
|
5043
5041
|
ae as sessionKey,
|
|
5044
|
-
|
|
5042
|
+
xr as toBoolean,
|
|
5045
5043
|
dn as toNumber,
|
|
5046
|
-
|
|
5047
|
-
|
|
5044
|
+
Mt as toTypeString,
|
|
5045
|
+
Wt as typeOf,
|
|
5048
5046
|
Sn as useBus,
|
|
5049
5047
|
Pn as useEventProxy,
|
|
5050
5048
|
Rn as useFox,
|