wj-elements 0.0.10 → 0.0.11

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.
@@ -1,16 +1,16 @@
1
1
  var i = Object.defineProperty;
2
- var a = (e, t, r) => t in e ? i(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var o = (e, t, r) => (a(e, typeof t != "symbol" ? t + "" : t, r), r);
4
- import c from "./wj-element.js";
2
+ var c = (e, t, s) => t in e ? i(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
+ var n = (e, t, s) => (c(e, typeof t != "symbol" ? t + "" : t, s), s);
4
+ import a from "./wj-element.js";
5
5
  import { b as u } from "./router-links-e0087f84.js";
6
6
  import "./wj-store.js";
7
7
  const l = `:host{display:block;background:transparent!important}:host(.active){cursor:pointer;font-weight:700}
8
8
  `;
9
- class m extends c {
9
+ class m extends a {
10
10
  constructor() {
11
11
  super();
12
- o(this, "className", "RouterLink");
13
- u(this, { selector: !1 });
12
+ n(this, "className", "RouterLink");
13
+ this.unbindRouterLinks = u(this, { selector: !1 });
14
14
  }
15
15
  static get cssStyleSheet() {
16
16
  return l;
@@ -21,9 +21,12 @@ class m extends c {
21
21
  setupAttributes() {
22
22
  this.isShadowRoot = "open", this.setAttribute("active-class", "active");
23
23
  }
24
- draw(r, p, d) {
25
- let s = document.createDocumentFragment(), n = document.createElement("slot");
26
- return s.appendChild(n), s;
24
+ draw(s, d, p) {
25
+ let r = document.createDocumentFragment(), o = document.createElement("slot");
26
+ return r.appendChild(o), r;
27
+ }
28
+ beforeDisconnect() {
29
+ this.unbindRouterLinks();
27
30
  }
28
31
  }
29
32
  customElements.get("wj-router-link") || window.customElements.define("wj-router-link", m);
@@ -586,7 +586,7 @@ function It(r, t) {
586
586
  function qt(r) {
587
587
  return r = r || window.event, r.which === null ? r.button : r.which;
588
588
  }
589
- function Q(r, t, e) {
589
+ function V(r, t, e) {
590
590
  e !== !0 && (r[t] = typeof e == "function" ? e : () => {
591
591
  });
592
592
  }
@@ -607,7 +607,7 @@ class Mt {
607
607
  location: "browser",
608
608
  logError: !0,
609
609
  qs: Dt
610
- }, t), Q(this, "log", this.options.log), Q(this, "logError", this.options.logError), t.routes && this.map(t.routes);
610
+ }, t), V(this, "log", this.options.log), V(this, "logError", this.options.logError), t.routes && this.map(t.routes);
611
611
  }
612
612
  /**
613
613
  * Add a middleware
@@ -863,10 +863,10 @@ class Wt {
863
863
  function kt(r) {
864
864
  j = r, S = r.options.outlet;
865
865
  }
866
- function Qt() {
866
+ function Vt() {
867
867
  j = null, $ = /* @__PURE__ */ Object.create(null), M = /* @__PURE__ */ Object.create(null), x = null;
868
868
  }
869
- function Vt(r, t) {
869
+ function Qt(r, t) {
870
870
  const e = Object.keys(r);
871
871
  return e.length === Object.keys(t).length && e.every((n) => t[n] === r[n]);
872
872
  }
@@ -893,7 +893,7 @@ function Jt(r, t) {
893
893
  function Zt(r, t) {
894
894
  let e, n, i;
895
895
  const s = Math.max(r.length, t.length);
896
- for (e = 0; e < s && (n = r[e], i = t[e], !(!(n && i) || n.name !== i.name || !Vt(n.params, i.params))); e++)
896
+ for (e = 0; e < s && (n = r[e], i = t[e], !(!(n && i) || n.name !== i.name || !Qt(n.params, i.params))); e++)
897
897
  ;
898
898
  return e;
899
899
  }
@@ -919,7 +919,7 @@ async function Xt(r) {
919
919
  }
920
920
  return t;
921
921
  }
922
- function V(r, t, e) {
922
+ function Q(r, t, e) {
923
923
  e && Object.keys(e).forEach((n) => {
924
924
  const i = e[n];
925
925
  t[n] = i instanceof Wt ? i.value(r) : i;
@@ -930,7 +930,7 @@ async function Yt(r, t, e) {
930
930
  const { path: n, pathname: i, routes: s, params: c, query: o } = r, u = { path: n, pathname: i, routes: s, params: c, query: o };
931
931
  for (let a = 0; a < e; a++) {
932
932
  const h = r.routes[a], g = $[h.name];
933
- g && (g.$route = u, V(r, g, h.options.properties));
933
+ g && (g.$route = u, Q(r, g, h.options.properties));
934
934
  }
935
935
  for (let a = 0; a < t.length; a++) {
936
936
  const { el: h, route: g } = t[a];
@@ -938,7 +938,7 @@ async function Yt(r, t, e) {
938
938
  const m = Jt(r, e + a - 1), f = m ? Kt(m) : zt();
939
939
  if (f) {
940
940
  const d = K.get(f) || f.firstElementChild;
941
- d && (f.removeChild(d), nt.add(d)), h.$route = u, V(r, h, g.options.properties), f.appendChild(h), K.set(f, h), await (h.updateComplete || Ht);
941
+ d && (f.removeChild(d), nt.add(d)), h.$route = u, Q(r, h, g.options.properties), f.appendChild(h), K.set(f, h), await (h.updateComplete || Ht);
942
942
  }
943
943
  }
944
944
  }
@@ -966,7 +966,7 @@ function re(r) {
966
966
  }
967
967
  const ne = {
968
968
  create: kt,
969
- destroy: Qt,
969
+ destroy: Vt,
970
970
  resolve: ee,
971
971
  done: re
972
972
  };
@@ -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(new URL(a, import.meta.url).href) : u !== "shadow" && (n[u] = a);
1036
+ u === "component" && a.indexOf(".js") > -1 ? (console.log("attributeValue", a, new URL(a, import.meta.url).href), 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) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wj-elements",
3
3
  "private": false,
4
- "version": "0.0.10",
4
+ "version": "0.0.11",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "./dist"