wj-elements 0.0.8 → 0.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/dist/wj-routerx.js +15 -15
- package/package.json +1 -1
package/dist/wj-routerx.js
CHANGED
|
@@ -267,7 +267,7 @@ class Ct {
|
|
|
267
267
|
if (t == null)
|
|
268
268
|
if (this._hasPushState || !this._wantsHashChange || e) {
|
|
269
269
|
t = decodeURI(this.location.pathname + this.location.search);
|
|
270
|
-
const n = this.root.replace(
|
|
270
|
+
const n = this.root.replace(Ut, "");
|
|
271
271
|
t.indexOf(n) || (t = t.slice(n.length));
|
|
272
272
|
} else
|
|
273
273
|
t = this.getHash();
|
|
@@ -326,7 +326,7 @@ class Ct {
|
|
|
326
326
|
return !1;
|
|
327
327
|
(!e || e === !0) && (e = { trigger: !!e });
|
|
328
328
|
let n = this.root + (t = this.getFragment(t || ""));
|
|
329
|
-
if (t = t.replace(
|
|
329
|
+
if (t = t.replace(St, ""), this.fragment !== t) {
|
|
330
330
|
if (this.fragment = t, t === "" && n !== "/" && (n = n.slice(0, -1)), this._hasPushState)
|
|
331
331
|
this.history[e.replace ? "replaceState" : "pushState"]({}, document.title, n);
|
|
332
332
|
else if (this._wantsHashChange)
|
|
@@ -358,7 +358,7 @@ class Ct {
|
|
|
358
358
|
return this._hasPushState;
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
|
-
const B = /^[#\/]|\s+$/g, $t = /^\/+|\/+$/g,
|
|
361
|
+
const B = /^[#\/]|\s+$/g, $t = /^\/+|\/+$/g, Ut = /\/$/, St = /#.*$/;
|
|
362
362
|
class xt {
|
|
363
363
|
constructor(t = {}) {
|
|
364
364
|
this.path = t.path || "", this.options = C({
|
|
@@ -523,13 +523,13 @@ function k(r) {
|
|
|
523
523
|
if (!w)
|
|
524
524
|
if (l < t.middleware.length) {
|
|
525
525
|
E = t.middleware[l], b = E.name || "anonymous", e("Transition #" + h, "resolving middleware:", b);
|
|
526
|
-
let
|
|
526
|
+
let U;
|
|
527
527
|
try {
|
|
528
|
-
|
|
528
|
+
U = E.resolve ? E.resolve(p, v) : v, q(p !== U, "Middleware %s returned a transition which resulted in a deadlock", b);
|
|
529
529
|
} catch (T) {
|
|
530
530
|
return t.state.activeTransition = null, W(t, p, T), f(T);
|
|
531
531
|
}
|
|
532
|
-
Promise.resolve(
|
|
532
|
+
Promise.resolve(U).then(function(T) {
|
|
533
533
|
y(l + 1, T);
|
|
534
534
|
}).catch(function(T) {
|
|
535
535
|
e("Transition #" + h, "resolving middleware:", b, "FAILED"), t.state.activeTransition = null, W(t, p, T), f(T);
|
|
@@ -542,8 +542,8 @@ function k(r) {
|
|
|
542
542
|
pathname: u,
|
|
543
543
|
params: o,
|
|
544
544
|
query: a
|
|
545
|
-
}, t.middleware.forEach((
|
|
546
|
-
|
|
545
|
+
}, t.middleware.forEach((U) => {
|
|
546
|
+
U.done && U.done(p);
|
|
547
547
|
}), m();
|
|
548
548
|
}
|
|
549
549
|
return r.noop ? m() : Promise.resolve().then(() => y(0)), r.noop && (p.noop = !0), p;
|
|
@@ -842,7 +842,7 @@ function Ft(r, t = document, e = jt) {
|
|
|
842
842
|
return _t(t, (n, i) => e(n, i, r));
|
|
843
843
|
}
|
|
844
844
|
const Ht = Promise.resolve();
|
|
845
|
-
let $ = /* @__PURE__ */ Object.create(null), M = /* @__PURE__ */ Object.create(null), j,
|
|
845
|
+
let $ = /* @__PURE__ */ Object.create(null), M = /* @__PURE__ */ Object.create(null), j, S, x;
|
|
846
846
|
function Bt(r) {
|
|
847
847
|
const t = parseFloat(r);
|
|
848
848
|
return r == t ? t : r;
|
|
@@ -861,7 +861,7 @@ class Wt {
|
|
|
861
861
|
}
|
|
862
862
|
}
|
|
863
863
|
function kt(r) {
|
|
864
|
-
j = r,
|
|
864
|
+
j = r, S = r.options.outlet;
|
|
865
865
|
}
|
|
866
866
|
function Qt() {
|
|
867
867
|
j = null, $ = /* @__PURE__ */ Object.create(null), M = /* @__PURE__ */ Object.create(null), x = null;
|
|
@@ -876,10 +876,10 @@ function Kt(r) {
|
|
|
876
876
|
function zt() {
|
|
877
877
|
if (x)
|
|
878
878
|
return x;
|
|
879
|
-
if (!
|
|
879
|
+
if (!S)
|
|
880
880
|
return document.body;
|
|
881
|
-
if (x = typeof
|
|
882
|
-
throw new Error(`slick-router(wc): Invalid outlet option ${
|
|
881
|
+
if (x = typeof S == "string" ? document.querySelector(S) : S, !x)
|
|
882
|
+
throw new Error(`slick-router(wc): Invalid outlet option ${S}`);
|
|
883
883
|
return x;
|
|
884
884
|
}
|
|
885
885
|
function Jt(r, t) {
|
|
@@ -1025,7 +1025,7 @@ class se extends at {
|
|
|
1025
1025
|
outlet: this.outlet || "wj-router-outlet",
|
|
1026
1026
|
log: !1,
|
|
1027
1027
|
logError: !1,
|
|
1028
|
-
root: "/",
|
|
1028
|
+
root: this.root || "/",
|
|
1029
1029
|
pushState: !0
|
|
1030
1030
|
}), this.router.map(c), this.router.use(this.setBreadcrumb), this.router.use(ne), this.router.use(ct), this.router.use(ie), this.router.use(this.resetScrollPosition), this.router.listen(), Ft(this.router);
|
|
1031
1031
|
}
|
|
@@ -1033,7 +1033,7 @@ class se extends at {
|
|
|
1033
1033
|
const n = {}, i = e.attributes;
|
|
1034
1034
|
for (let o = 0; o < i.length; o++) {
|
|
1035
1035
|
const u = i[o].name, a = i[o].value;
|
|
1036
|
-
u === "component" && a.indexOf(".js") > -1 ? n.component = () => import(a) : u !== "shadow" && (n[u] = a);
|
|
1036
|
+
u === "component" && a.indexOf(".js") > -1 ? n.component = () => import(new URL(a, import.meta.url).href) : u !== "shadow" && (n[u] = a);
|
|
1037
1037
|
}
|
|
1038
1038
|
const s = [];
|
|
1039
1039
|
return Array.from(e.children).forEach((o) => {
|