wj-elements 0.0.3 → 0.0.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/dist/router-links-e0087f84.js +146 -0
- package/dist/style.css +2 -2365
- package/dist/wj-aside.js +18 -22
- package/dist/wj-avatar.js +32 -49
- package/dist/wj-badge.js +18 -22
- package/dist/wj-breadcrumb.js +53 -103
- package/dist/wj-breadcrumbs.js +21 -36
- package/dist/wj-button-group.js +24 -36
- package/dist/wj-button.js +37 -80
- package/dist/wj-card-content.js +16 -18
- package/dist/wj-card-controls.js +16 -18
- package/dist/wj-card-header.js +16 -20
- package/dist/wj-card-subtitle.js +17 -19
- package/dist/wj-card-title.js +16 -18
- package/dist/wj-card.js +16 -20
- package/dist/wj-checkbox.js +24 -46
- package/dist/wj-chip.js +21 -39
- package/dist/wj-col.js +18 -32
- package/dist/wj-color-picker.js +503 -868
- package/dist/wj-container.js +18 -20
- package/dist/wj-copy-button.js +66 -112
- package/dist/wj-dialog.js +43 -67
- package/dist/wj-divider.js +16 -20
- package/dist/wj-dropdown.js +22 -31
- package/dist/wj-element.js +241 -416
- package/dist/wj-footer.js +16 -18
- package/dist/wj-form.js +16 -18
- package/dist/wj-grid.js +17 -21
- package/dist/wj-header.js +18 -22
- package/dist/wj-icon-picker.js +66 -107
- package/dist/wj-icon.js +67 -142
- package/dist/wj-img-comparer.js +43 -72
- package/dist/wj-img.js +21 -31
- package/dist/wj-infinite-scroll.js +49 -84
- package/dist/wj-input.js +67 -146
- package/dist/wj-item.js +19 -34
- package/dist/wj-label.js +19 -21
- package/dist/wj-list.js +17 -20
- package/dist/wj-main.js +16 -18
- package/dist/wj-master.js +331 -462
- package/dist/wj-menu-button.js +18 -21
- package/dist/wj-menu-item.js +67 -144
- package/dist/wj-menu-label.js +17 -21
- package/dist/wj-menu.js +20 -24
- package/dist/wj-popup.js +714 -1140
- package/dist/wj-progress-bar.js +42 -100
- package/dist/wj-radio-group.js +27 -38
- package/dist/wj-radio.js +24 -46
- package/dist/wj-route.js +8 -11
- package/dist/wj-router-link.js +19 -22
- package/dist/wj-router-outlet.js +71 -135
- package/dist/wj-routerx.js +641 -1121
- package/dist/wj-row.js +20 -22
- package/dist/wj-slider.js +55 -97
- package/dist/wj-split-view.js +45 -81
- package/dist/wj-store.js +110 -195
- package/dist/wj-textarea.js +39 -86
- package/dist/wj-thumbnail.js +17 -19
- package/dist/wj-toast.js +34 -88
- package/dist/wj-toggle.js +24 -42
- package/dist/wj-toolbar-action.js +16 -27
- package/dist/wj-toolbar.js +21 -26
- package/dist/wj-tooltip.js +27 -41
- package/dist/wj-visually-hidden.js +16 -18
- package/package.json +1 -1
- package/dist/router-links-26e4a166.js +0 -204
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
const h = Symbol("routerLinksData"), l = Symbol("unbindRouterLinks"), p = Promise.resolve(), f = /* @__PURE__ */ new Set();
|
|
2
|
+
let u;
|
|
3
|
+
const y = function(t, r, e, n, s) {
|
|
4
|
+
const a = function(c) {
|
|
5
|
+
for (var o = c.target; o; o = o.parentNode)
|
|
6
|
+
o.matches && o.matches(e) && (c.selectorTarget = o, n.call(s, c));
|
|
7
|
+
};
|
|
8
|
+
return a.eventName = r, t.addEventListener(r, a, !1), a;
|
|
9
|
+
};
|
|
10
|
+
function v(t) {
|
|
11
|
+
return !!(t.metaKey || t.altKey || t.ctrlKey || t.shiftKey);
|
|
12
|
+
}
|
|
13
|
+
const A = function(t, r) {
|
|
14
|
+
const e = r.eventName;
|
|
15
|
+
t.removeEventListener(e, r, !1);
|
|
16
|
+
}, q = (t) => {
|
|
17
|
+
if (t.indexOf("-") === -1)
|
|
18
|
+
return t;
|
|
19
|
+
const r = t.split("-");
|
|
20
|
+
let e = "";
|
|
21
|
+
for (let n = 0; n < r.length; n++) {
|
|
22
|
+
const s = r[n];
|
|
23
|
+
e += n ? s.charAt(0).toUpperCase() + s.slice(1) : s;
|
|
24
|
+
}
|
|
25
|
+
return e;
|
|
26
|
+
};
|
|
27
|
+
function L(t, r) {
|
|
28
|
+
t.forEach(function(e) {
|
|
29
|
+
if (e.type === "attributes") {
|
|
30
|
+
const n = e.attributeName;
|
|
31
|
+
(n.indexOf("param-") === 0 || n.indexOf("query-") === 0) && d(e.target, r.ownerEl);
|
|
32
|
+
} else
|
|
33
|
+
e.addedNodes.forEach((n) => {
|
|
34
|
+
n.nodeType === 1 && (n.getAttribute("route") && d(n, r.ownerEl), k(r.ownerEl, n));
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
const C = { childList: !0, subtree: !0, attributes: !0 };
|
|
39
|
+
function b(t, r, e) {
|
|
40
|
+
const n = t.attributes;
|
|
41
|
+
for (let s = 0; s < n.length; s++) {
|
|
42
|
+
const a = n[s];
|
|
43
|
+
if (a.name.indexOf(r) === 0) {
|
|
44
|
+
const c = q(a.name.slice(r.length));
|
|
45
|
+
e[c] = a.value;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return e;
|
|
49
|
+
}
|
|
50
|
+
function N(t, r, e, n, s) {
|
|
51
|
+
let a = s[e];
|
|
52
|
+
return typeof a == "function" && (a = a.call(t, r, n)), a || {};
|
|
53
|
+
}
|
|
54
|
+
function i(t, r, e, n, s) {
|
|
55
|
+
const a = t[h].options, c = N(t, r, n, e, a), o = e.closest(a.selector || "[routerlinks]");
|
|
56
|
+
return o && b(o, s, c), b(e, s, c);
|
|
57
|
+
}
|
|
58
|
+
function g(t, r, e, n) {
|
|
59
|
+
const s = t.hasAttribute("active-class") ? t.getAttribute("active-class") : "active";
|
|
60
|
+
if (s) {
|
|
61
|
+
const a = u.isActive(r, e, n, t.hasAttribute("exact"));
|
|
62
|
+
t.classList.toggle(s, a);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function d(t, r) {
|
|
66
|
+
const e = t.getAttribute("route");
|
|
67
|
+
if (!e)
|
|
68
|
+
return;
|
|
69
|
+
const n = i(r, e, t, "params", "param-"), s = i(r, e, t, "query", "query-");
|
|
70
|
+
try {
|
|
71
|
+
const a = u.generate(e, n, s), c = t.tagName === "A" ? t : t.querySelector("a");
|
|
72
|
+
c && c.setAttribute("href", a), u.state.activeTransition || g(t, e, n, s);
|
|
73
|
+
} catch (a) {
|
|
74
|
+
console.warn(`Error generating link for "${e}": ${a}`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function k(t, r) {
|
|
78
|
+
r.querySelectorAll("[route]").forEach((n) => {
|
|
79
|
+
d(n, t);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function E(t) {
|
|
83
|
+
if (t.button !== 0 || v(t))
|
|
84
|
+
return;
|
|
85
|
+
t.preventDefault();
|
|
86
|
+
const r = t.selectorTarget, e = r.getAttribute("route");
|
|
87
|
+
if (!e)
|
|
88
|
+
return;
|
|
89
|
+
const n = i(this, e, r, "params", "param-"), s = i(this, e, r, "query", "query-"), a = r.hasAttribute("replace") ? "replaceWith" : "transitionTo";
|
|
90
|
+
u[a](e, n, s);
|
|
91
|
+
}
|
|
92
|
+
function S(t, r = {}) {
|
|
93
|
+
const { selector: e = "[routerlinks]" } = r, n = e ? t.querySelectorAll(e) : [t], s = new MutationObserver(L), a = [];
|
|
94
|
+
return s.ownerEl = t, t[h] = { options: r, rootEls: n, observer: s }, n.forEach((c) => {
|
|
95
|
+
a.push(y(c, "click", "[route]", E, t)), k(t, c), s.observe(c, C);
|
|
96
|
+
}), f.add(t), function() {
|
|
97
|
+
f.delete(t), a.forEach((c, o) => A(n[o], c));
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
const m = (t, r = {}) => class extends t {
|
|
101
|
+
connectedCallback() {
|
|
102
|
+
super.connectedCallback && super.connectedCallback(), (this.updateComplete || p).then(() => {
|
|
103
|
+
this[l] = S(this, r);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
disconnectedCallback() {
|
|
107
|
+
super.disconnectedCallback && super.disconnectedCallback(), this[l] && this[l]();
|
|
108
|
+
}
|
|
109
|
+
}, x = (t, r) => {
|
|
110
|
+
if (typeof t == "function")
|
|
111
|
+
return m(t, r);
|
|
112
|
+
if (t.kind === "class") {
|
|
113
|
+
const { kind: e, elements: n } = t;
|
|
114
|
+
return {
|
|
115
|
+
kind: e,
|
|
116
|
+
elements: n,
|
|
117
|
+
finisher(s) {
|
|
118
|
+
return m(s, r);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
return (e) => x(e, t);
|
|
123
|
+
};
|
|
124
|
+
function R(t) {
|
|
125
|
+
u = t;
|
|
126
|
+
}
|
|
127
|
+
function T() {
|
|
128
|
+
f.forEach((t) => {
|
|
129
|
+
t[h].rootEls.forEach((e) => {
|
|
130
|
+
const n = e.getAttribute("route");
|
|
131
|
+
if (!n)
|
|
132
|
+
return;
|
|
133
|
+
const s = i(t, n, e, "params", "param-"), a = i(t, n, e, "query", "query-");
|
|
134
|
+
g(e, n, s, a);
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
const K = {
|
|
139
|
+
create: R,
|
|
140
|
+
done: T
|
|
141
|
+
};
|
|
142
|
+
export {
|
|
143
|
+
S as b,
|
|
144
|
+
K as r,
|
|
145
|
+
x as w
|
|
146
|
+
};
|