wj-elements 0.0.2 → 0.0.4
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 -140
- 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
package/dist/wj-progress-bar.js
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
return value;
|
|
6
|
-
};
|
|
7
|
-
import WJElement from "./wj-element.js";
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var A = (o, i, e) => i in o ? m(o, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[i] = e;
|
|
3
|
+
var g = (o, i, e) => (A(o, typeof i != "symbol" ? i + "" : i, e), e);
|
|
4
|
+
import f from "./wj-element.js";
|
|
8
5
|
import "./wj-store.js";
|
|
9
|
-
const
|
|
10
|
-
|
|
6
|
+
const k = `/*!
|
|
7
|
+
* direction.scss
|
|
8
|
+
*/:host(.wj-color-primary) #bar{--wj-progress-bar-color: #7252D3}:host(.wj-color-complete) #bar{--wj-progress-bar-color: #0072EC}:host(.wj-color-success) #bar{--wj-progress-bar-color: #19AD79}:host(.wj-color-warning) #bar{--wj-progress-bar-color: #FFd945}:host(.wj-color-danger) #bar{--wj-progress-bar-color: #D83C31}:host(.wj-color-dark) #bar{--wj-progress-bar-color: #212121}:host(.wj-color-light) #bar{--wj-progress-bar-color: #fff}:host{--wj-progress-bar-color: #212121;--wj-progress-bar-text-size: 1rem}:host .progress{position:relative;display:flex;align-items:center}:host .slot-wrapper{display:flex;position:absolute;top:0;align-items:center;width:100%;height:100%;justify-content:center}:host #bar{stroke:var(--wj-progress-bar-color, red)}:host text{transform:rotate(90deg);transform-origin:center;text-anchor:middle;dominant-baseline:middle;font-size:var(--wj-progress-bar-text-size)}:host(.wj-color) #bar{stroke:var(--wj-progress-bar-color)}::slotted([slot=start]){margin-inline:0 1rem}::slotted([slot=end]){margin-inline:1rem 0}
|
|
9
|
+
`;
|
|
10
|
+
class x extends f {
|
|
11
11
|
constructor() {
|
|
12
12
|
super();
|
|
13
|
-
|
|
14
|
-
this.timerInterval = null;
|
|
15
|
-
this.timeLimit = 60;
|
|
13
|
+
g(this, "className", "ProgressBar");
|
|
14
|
+
this.timerInterval = null, this.timeLimit = 60;
|
|
16
15
|
}
|
|
17
|
-
set radius(
|
|
18
|
-
this.setAttribute("radius",
|
|
16
|
+
set radius(e) {
|
|
17
|
+
this.setAttribute("radius", e);
|
|
19
18
|
}
|
|
20
19
|
get radius() {
|
|
21
20
|
return +this.getAttribute("radius") || 70;
|
|
@@ -23,8 +22,8 @@ class ProgressBar extends WJElement {
|
|
|
23
22
|
get diameter() {
|
|
24
23
|
return this.radius * 2 + this.stroke;
|
|
25
24
|
}
|
|
26
|
-
set stroke(
|
|
27
|
-
this.setAttribute("stroke",
|
|
25
|
+
set stroke(e) {
|
|
26
|
+
this.setAttribute("stroke", e);
|
|
28
27
|
}
|
|
29
28
|
get stroke() {
|
|
30
29
|
return +this.getAttribute("stroke") || 6;
|
|
@@ -33,7 +32,7 @@ class ProgressBar extends WJElement {
|
|
|
33
32
|
return this.getAttribute("linecap") || "square";
|
|
34
33
|
}
|
|
35
34
|
static get cssStyleSheet() {
|
|
36
|
-
return
|
|
35
|
+
return k;
|
|
37
36
|
}
|
|
38
37
|
static get observedAttributes() {
|
|
39
38
|
return ["progress"];
|
|
@@ -41,94 +40,37 @@ class ProgressBar extends WJElement {
|
|
|
41
40
|
setupAttributes() {
|
|
42
41
|
this.isShadowRoot = "open";
|
|
43
42
|
}
|
|
44
|
-
draw(
|
|
45
|
-
let
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
let
|
|
50
|
-
|
|
51
|
-
let
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
let slotEnd = document.createElement("slot");
|
|
57
|
-
slotEnd.setAttribute("name", "end");
|
|
58
|
-
let svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
59
|
-
let background;
|
|
60
|
-
let bar;
|
|
43
|
+
draw(e, h, l) {
|
|
44
|
+
let n = this.radius + this.stroke / 2, u = document.createDocumentFragment();
|
|
45
|
+
l.color && this.classList.add("wj-color-" + l.color, "wj-color");
|
|
46
|
+
let a = document.createElement("div");
|
|
47
|
+
a.classList.add("progress");
|
|
48
|
+
let w = document.createElement("slot"), d = document.createElement("div");
|
|
49
|
+
d.classList.add("slot-wrapper");
|
|
50
|
+
let b = document.createElement("slot");
|
|
51
|
+
b.setAttribute("name", "start");
|
|
52
|
+
let p = document.createElement("slot");
|
|
53
|
+
p.setAttribute("name", "end");
|
|
54
|
+
let s = document.createElementNS("http://www.w3.org/2000/svg", "svg"), r, t;
|
|
61
55
|
if ((this == null ? void 0 : this.type) === "circle") {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
background.setAttribute("cx", xy);
|
|
69
|
-
background.setAttribute("cy", xy);
|
|
70
|
-
background.setAttribute("fill", "transparent");
|
|
71
|
-
bar = document.createElementNS("http://www.w3.org/2000/svg", "circle");
|
|
72
|
-
bar.setAttribute("r", this.radius);
|
|
73
|
-
bar.setAttribute("cx", xy);
|
|
74
|
-
bar.setAttribute("cy", xy);
|
|
75
|
-
bar.setAttribute("fill", "transparent");
|
|
76
|
-
bar.setAttribute("stroke-dasharray", "0");
|
|
77
|
-
bar.setAttribute("stroke-dashoffset", "0");
|
|
78
|
-
let text = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
79
|
-
text.setAttribute("x", "50%");
|
|
80
|
-
text.setAttribute("y", "50%");
|
|
81
|
-
text.innerHTML = this.progress + "%";
|
|
82
|
-
svg.appendChild(text);
|
|
83
|
-
} else {
|
|
84
|
-
svg.setAttribute("width", "100%");
|
|
85
|
-
svg.setAttribute("height", this.stroke);
|
|
86
|
-
svg.setAttribute("preserveAspectRatio", "none");
|
|
87
|
-
background = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
88
|
-
background.setAttribute("x1", 0);
|
|
89
|
-
background.setAttribute("y1", this.stroke / 2);
|
|
90
|
-
background.setAttribute("x2", "100%");
|
|
91
|
-
background.setAttribute("y2", this.stroke / 2);
|
|
92
|
-
bar = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
93
|
-
bar.setAttribute("x1", 0);
|
|
94
|
-
bar.setAttribute("y1", this.stroke / 2);
|
|
95
|
-
bar.setAttribute("x2", this.progress + "%");
|
|
96
|
-
bar.setAttribute("y2", this.stroke / 2);
|
|
97
|
-
}
|
|
98
|
-
background.setAttribute("stroke", "#e0e0e0");
|
|
99
|
-
background.setAttribute("stroke-linecap", this.linecap);
|
|
100
|
-
background.setAttribute("stroke-width", this.stroke + "px");
|
|
101
|
-
bar.setAttribute("stroke-linecap", this.linecap);
|
|
102
|
-
bar.setAttribute("stroke-width", this.stroke + "px");
|
|
103
|
-
bar.setAttribute("id", "bar");
|
|
104
|
-
svg.appendChild(background);
|
|
105
|
-
svg.appendChild(bar);
|
|
106
|
-
slotWrapper.appendChild(slot);
|
|
107
|
-
element.appendChild(slotStart);
|
|
108
|
-
element.appendChild(slotWrapper);
|
|
109
|
-
element.appendChild(svg);
|
|
110
|
-
element.appendChild(slotEnd);
|
|
111
|
-
fragment.appendChild(element);
|
|
112
|
-
this.background = background;
|
|
113
|
-
this.bar = bar;
|
|
114
|
-
return fragment;
|
|
56
|
+
s.setAttribute("width", this.diameter), s.setAttribute("height", this.diameter), s.setAttribute("viewBox", `0 0 ${this.diameter} ${this.diameter}`), s.setAttribute("style", "transform: rotate(-90deg)"), r = document.createElementNS("http://www.w3.org/2000/svg", "circle"), r.setAttribute("r", this.radius), r.setAttribute("cx", n), r.setAttribute("cy", n), r.setAttribute("fill", "transparent"), t = document.createElementNS("http://www.w3.org/2000/svg", "circle"), t.setAttribute("r", this.radius), t.setAttribute("cx", n), t.setAttribute("cy", n), t.setAttribute("fill", "transparent"), t.setAttribute("stroke-dasharray", "0"), t.setAttribute("stroke-dashoffset", "0");
|
|
57
|
+
let c = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
58
|
+
c.setAttribute("x", "50%"), c.setAttribute("y", "50%"), c.innerHTML = this.progress + "%", s.appendChild(c);
|
|
59
|
+
} else
|
|
60
|
+
s.setAttribute("width", "100%"), s.setAttribute("height", this.stroke), s.setAttribute("preserveAspectRatio", "none"), r = document.createElementNS("http://www.w3.org/2000/svg", "line"), r.setAttribute("x1", 0), r.setAttribute("y1", this.stroke / 2), r.setAttribute("x2", "100%"), r.setAttribute("y2", this.stroke / 2), t = document.createElementNS("http://www.w3.org/2000/svg", "line"), t.setAttribute("x1", 0), t.setAttribute("y1", this.stroke / 2), t.setAttribute("x2", this.progress + "%"), t.setAttribute("y2", this.stroke / 2);
|
|
61
|
+
return r.setAttribute("stroke", "#e0e0e0"), r.setAttribute("stroke-linecap", this.linecap), r.setAttribute("stroke-width", this.stroke + "px"), t.setAttribute("stroke-linecap", this.linecap), t.setAttribute("stroke-width", this.stroke + "px"), t.setAttribute("id", "bar"), s.appendChild(r), s.appendChild(t), d.appendChild(w), a.appendChild(b), a.appendChild(d), a.appendChild(s), a.appendChild(p), u.appendChild(a), this.background = r, this.bar = t, u;
|
|
115
62
|
}
|
|
116
|
-
afterDraw(
|
|
117
|
-
|
|
118
|
-
this.background.setAttribute("stroke-dasharray", this.getCircleDashoffset(100) + "px");
|
|
119
|
-
this.background.setAttribute("stroke-dashoffset", "0px");
|
|
120
|
-
this.bar.setAttribute("stroke-dasharray", this.getCircleDasharray(this.radius) + "px");
|
|
121
|
-
this.bar.setAttribute("stroke-dashoffset", this.getCircleDashoffset(params.progress, this.radius) + "px");
|
|
122
|
-
}
|
|
63
|
+
afterDraw(e, h, l) {
|
|
64
|
+
this.type === "circle" && (this.background.setAttribute("stroke-dasharray", this.getCircleDashoffset(100) + "px"), this.background.setAttribute("stroke-dashoffset", "0px"), this.bar.setAttribute("stroke-dasharray", this.getCircleDasharray(this.radius) + "px"), this.bar.setAttribute("stroke-dashoffset", this.getCircleDashoffset(l.progress, this.radius) + "px"));
|
|
123
65
|
}
|
|
124
|
-
getCircleDasharray(
|
|
125
|
-
return 2 * Math.PI *
|
|
66
|
+
getCircleDasharray(e = 70) {
|
|
67
|
+
return 2 * Math.PI * e;
|
|
126
68
|
}
|
|
127
|
-
getCircleDashoffset(
|
|
128
|
-
return this.getCircleDasharray(
|
|
69
|
+
getCircleDashoffset(e = 0, h) {
|
|
70
|
+
return this.getCircleDasharray(h) * ((100 - e) / 100);
|
|
129
71
|
}
|
|
130
72
|
}
|
|
131
|
-
customElements.get("wj-progress-bar") || window.customElements.define("wj-progress-bar",
|
|
73
|
+
customElements.get("wj-progress-bar") || window.customElements.define("wj-progress-bar", x);
|
|
132
74
|
export {
|
|
133
|
-
ProgressBar
|
|
75
|
+
x as ProgressBar
|
|
134
76
|
};
|
package/dist/wj-radio-group.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
import WJElement from "./wj-element.js";
|
|
8
|
-
import { Radio } from "./wj-radio.js";
|
|
1
|
+
var l = Object.defineProperty;
|
|
2
|
+
var c = (i, t, e) => t in i ? l(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var n = (i, t, e) => (c(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
import u from "./wj-element.js";
|
|
5
|
+
import { Radio as o } from "./wj-radio.js";
|
|
9
6
|
import "./wj-store.js";
|
|
10
|
-
const
|
|
11
|
-
|
|
7
|
+
const h = `/*!
|
|
8
|
+
* direction.scss
|
|
9
|
+
*/.wj-inline{display:flex;flex-direction:row;flex-wrap:wrap;gap:.5rem}
|
|
10
|
+
`;
|
|
11
|
+
class m extends u {
|
|
12
12
|
constructor() {
|
|
13
13
|
super();
|
|
14
|
-
|
|
14
|
+
n(this, "className", "RadioGroup");
|
|
15
15
|
}
|
|
16
16
|
static get cssStyleSheet() {
|
|
17
|
-
return
|
|
17
|
+
return h;
|
|
18
18
|
}
|
|
19
19
|
static get observedAttributes() {
|
|
20
20
|
return [];
|
|
@@ -22,44 +22,33 @@ class RadioGroup extends WJElement {
|
|
|
22
22
|
setupAttributes() {
|
|
23
23
|
this.isShadowRoot = "open";
|
|
24
24
|
}
|
|
25
|
-
draw(
|
|
26
|
-
let
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
native.appendChild(slot);
|
|
31
|
-
fragment.appendChild(native);
|
|
32
|
-
return fragment;
|
|
25
|
+
draw(e, s, p) {
|
|
26
|
+
let a = document.createDocumentFragment(), r = document.createElement("div");
|
|
27
|
+
r.classList.add("native-radio-group", this.hasAttribute("inline") ? "wj-inline" : "ddd");
|
|
28
|
+
let d = document.createElement("slot");
|
|
29
|
+
return r.appendChild(d), a.appendChild(r), a;
|
|
33
30
|
}
|
|
34
31
|
afterDraw() {
|
|
35
|
-
|
|
36
|
-
this.
|
|
37
|
-
}
|
|
38
|
-
this.addEventListener("wj:radio:input", (e) => {
|
|
39
|
-
this.removeCheck();
|
|
40
|
-
this.setRadioToChekced(e.detail.context);
|
|
32
|
+
this.value && this.setRadioToChekced(this.getRadioByValue(this.value)), this.addEventListener("wj:radio:input", (e) => {
|
|
33
|
+
this.removeCheck(), this.setRadioToChekced(e.detail.context);
|
|
41
34
|
});
|
|
42
35
|
}
|
|
43
|
-
getRadioByValue(
|
|
44
|
-
return this.getAllElements().filter((
|
|
36
|
+
getRadioByValue(e) {
|
|
37
|
+
return this.getAllElements().filter((s) => s instanceof o && s.value === e)[0];
|
|
45
38
|
}
|
|
46
39
|
removeCheck() {
|
|
47
|
-
this.getAllElements().forEach((
|
|
48
|
-
|
|
49
|
-
el.checked = false;
|
|
40
|
+
this.getAllElements().forEach((e) => {
|
|
41
|
+
e instanceof o && (e.checked = !1);
|
|
50
42
|
});
|
|
51
43
|
}
|
|
52
|
-
setRadioToChekced(
|
|
53
|
-
|
|
54
|
-
this.setAttribute("value", radio.value);
|
|
55
|
-
radio.checked = true;
|
|
56
|
-
}
|
|
44
|
+
setRadioToChekced(e) {
|
|
45
|
+
e instanceof o && (this.setAttribute("value", e.value), e.checked = !0);
|
|
57
46
|
}
|
|
58
47
|
getAllElements() {
|
|
59
48
|
return Array.from(this.childNodes);
|
|
60
49
|
}
|
|
61
50
|
}
|
|
62
|
-
customElements.get("wj-radio-group") || window.customElements.define("wj-radio-group",
|
|
51
|
+
customElements.get("wj-radio-group") || window.customElements.define("wj-radio-group", m);
|
|
63
52
|
export {
|
|
64
|
-
RadioGroup
|
|
53
|
+
m as RadioGroup
|
|
65
54
|
};
|
package/dist/wj-radio.js
CHANGED
|
@@ -1,33 +1,29 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
return value;
|
|
6
|
-
};
|
|
7
|
-
import WJElement, { event } from "./wj-element.js";
|
|
1
|
+
var c = Object.defineProperty;
|
|
2
|
+
var s = (i, t, e) => t in i ? c(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var a = (i, t, e) => (s(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
import l, { event as n } from "./wj-element.js";
|
|
8
5
|
import "./wj-store.js";
|
|
9
|
-
const
|
|
10
|
-
|
|
6
|
+
const b = `/*!
|
|
7
|
+
* direction.scss
|
|
8
|
+
*/:host{--wj-radio-margin-top: 0;--wj-radio-margin-bottom: .5rem;--wj-radio-margin-inline: 0;display:block;margin-top:var(--wj-radio-margin-top);margin-bottom:var(--wj-radio-margin-bottom);margin-inline:var(--wj-radio-margin-inline);line-height:100%;padding-left:0}:host label{display:inline-flex;cursor:pointer;position:relative;padding-left:25px;min-width:16px;min-height:16px;margin-bottom:0;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;align-items:center}:host label:before{content:"";position:absolute;width:16px;height:16px;left:0;-webkit-box-sizing:inherit;box-sizing:border-box;background-color:#fff;border:1px solid #c9c9c9}.native-radio input[type=radio]+label:before{border-radius:99px;-webkit-transition:border .3s 0s cubic-bezier(.455,.03,.215,1.33);transition:border .3s 0s cubic-bezier(.455,.03,.215,1.33)}.native-radio input[type=radio]:checked+label:before{border-color:#757575;border-width:5px}.native-radio input[type=radio]:hover:active:not(:checked)+label:before{background-color:#00000014}.native-radio input[type=radio]:focus+label{color:#212121}.native-radio input[type=radio]:focus+label:before{outline:none!important;box-shadow:0 0 #78c8fe}.native-radio input[type=radio]{opacity:0;position:absolute;top:3px;width:16px;height:16px}.native-radio input[type=radio][disabled]+label{cursor:not-allowed!important;color:#4b4b4b;opacity:.58}.native-radio input[type=radio][disabled]+label:before{cursor:not-allowed!important;background:#ececec}.success input[type=radio]:checked+label:before{border-color:#19ad79}.primary input[type=radio]:checked+label:before{border-color:#7252d3}.complete input[type=radio]:checked+label:before{border-color:#0072ec}.warning input[type=radio]:checked+label:before{border-color:#ffd945}.danger input[type=radio]:checked+label:before{border-color:#d83c31}.neutral input[type=radio]:checked+label:before{border-color:#3b4752}
|
|
9
|
+
`;
|
|
10
|
+
class p extends l {
|
|
11
11
|
constructor() {
|
|
12
12
|
super();
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
a(this, "className", "Radio");
|
|
14
|
+
a(this, "inputEvent", (e) => {
|
|
15
15
|
this.checked = e.target.checked;
|
|
16
16
|
});
|
|
17
|
-
this._checked =
|
|
17
|
+
this._checked = !1;
|
|
18
18
|
}
|
|
19
|
-
set checked(
|
|
20
|
-
this._checked =
|
|
21
|
-
if (value)
|
|
22
|
-
this.setAttribute("checked", "");
|
|
23
|
-
else
|
|
24
|
-
this.removeAttribute("checked");
|
|
19
|
+
set checked(e) {
|
|
20
|
+
this._checked = e, e ? this.setAttribute("checked", "") : this.removeAttribute("checked");
|
|
25
21
|
}
|
|
26
22
|
get checked() {
|
|
27
23
|
return this._checked;
|
|
28
24
|
}
|
|
29
25
|
static get cssStyleSheet() {
|
|
30
|
-
return
|
|
26
|
+
return b;
|
|
31
27
|
}
|
|
32
28
|
static get observedAttributes() {
|
|
33
29
|
return ["checked"];
|
|
@@ -35,38 +31,20 @@ class Radio extends WJElement {
|
|
|
35
31
|
setupAttributes() {
|
|
36
32
|
this.isShadowRoot = "open";
|
|
37
33
|
}
|
|
38
|
-
draw(
|
|
39
|
-
let
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
native.classList.add(this.color);
|
|
44
|
-
this.input = document.createElement("input");
|
|
45
|
-
this.input.type = "radio";
|
|
46
|
-
this.input.id = "radio";
|
|
47
|
-
this.input.name = this.name + "-radio";
|
|
48
|
-
this.input.checked = this.hasAttribute("checked");
|
|
49
|
-
this.input.disabled = this.hasAttribute("disabled");
|
|
50
|
-
this.input.indeterminate = this.hasAttribute("indeterminate");
|
|
51
|
-
let label = document.createElement("label");
|
|
52
|
-
label.htmlFor = "radio";
|
|
53
|
-
label.innerHTML = "<slot></slot>";
|
|
54
|
-
native.appendChild(this.input);
|
|
55
|
-
native.appendChild(label);
|
|
56
|
-
fragment.appendChild(native);
|
|
57
|
-
return fragment;
|
|
34
|
+
draw(e, h, u) {
|
|
35
|
+
let d = document.createDocumentFragment(), o = document.createElement("div");
|
|
36
|
+
o.classList.add("native-radio"), this.color && o.classList.add(this.color), this.input = document.createElement("input"), this.input.type = "radio", this.input.id = "radio", this.input.name = this.name + "-radio", this.input.checked = this.hasAttribute("checked"), this.input.disabled = this.hasAttribute("disabled"), this.input.indeterminate = this.hasAttribute("indeterminate");
|
|
37
|
+
let r = document.createElement("label");
|
|
38
|
+
return r.htmlFor = "radio", r.innerHTML = "<slot></slot>", o.appendChild(this.input), o.appendChild(r), d.appendChild(o), d;
|
|
58
39
|
}
|
|
59
40
|
afterDraw() {
|
|
60
|
-
|
|
61
|
-
event.addListener(this, "click", "wj:radio:change");
|
|
62
|
-
event.addListener(this, "click", "wj:radio:input");
|
|
63
|
-
}
|
|
41
|
+
this.hasAttribute("disabled") || (n.addListener(this, "click", "wj:radio:change"), n.addListener(this, "click", "wj:radio:input"));
|
|
64
42
|
}
|
|
65
43
|
disconnectedCallback() {
|
|
66
|
-
|
|
44
|
+
n.removeElement(this);
|
|
67
45
|
}
|
|
68
46
|
}
|
|
69
|
-
customElements.get("wj-radio") || window.customElements.define("wj-radio",
|
|
47
|
+
customElements.get("wj-radio") || window.customElements.define("wj-radio", p);
|
|
70
48
|
export {
|
|
71
|
-
Radio
|
|
49
|
+
p as Radio
|
|
72
50
|
};
|
package/dist/wj-route.js
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
return value;
|
|
6
|
-
};
|
|
7
|
-
import WJElement from "./wj-element.js";
|
|
1
|
+
var r = Object.defineProperty;
|
|
2
|
+
var u = (t, e, o) => e in t ? r(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
|
|
3
|
+
var s = (t, e, o) => (u(t, typeof e != "symbol" ? e + "" : e, o), o);
|
|
4
|
+
import m from "./wj-element.js";
|
|
8
5
|
import "./wj-store.js";
|
|
9
|
-
class
|
|
6
|
+
class n extends m {
|
|
10
7
|
constructor() {
|
|
11
8
|
super();
|
|
12
|
-
|
|
9
|
+
s(this, "className", "Route");
|
|
13
10
|
}
|
|
14
11
|
static get observedAttributes() {
|
|
15
12
|
return [];
|
|
16
13
|
}
|
|
17
14
|
}
|
|
18
|
-
customElements.get("wj-route") || window.customElements.define("wj-route",
|
|
15
|
+
customElements.get("wj-route") || window.customElements.define("wj-route", n);
|
|
19
16
|
export {
|
|
20
|
-
Route
|
|
17
|
+
n as Route
|
|
21
18
|
};
|
package/dist/wj-router-link.js
CHANGED
|
@@ -1,37 +1,34 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
import WJElement from "./wj-element.js";
|
|
8
|
-
import { b as bindRouterLinks } from "./router-links-26e4a166.js";
|
|
1
|
+
var i = Object.defineProperty;
|
|
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 o = (e, t, s) => (c(e, typeof t != "symbol" ? t + "" : t, s), s);
|
|
4
|
+
import a from "./wj-element.js";
|
|
5
|
+
import { b as l } from "./router-links-e0087f84.js";
|
|
9
6
|
import "./wj-store.js";
|
|
10
|
-
const
|
|
11
|
-
|
|
7
|
+
const u = `/*!
|
|
8
|
+
* direction.scss
|
|
9
|
+
*/:host{display:block}:host(.active){cursor:pointer;font-weight:700}
|
|
10
|
+
`;
|
|
11
|
+
class m extends a {
|
|
12
12
|
constructor() {
|
|
13
13
|
super();
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
o(this, "className", "RouterLink");
|
|
15
|
+
l(this, { selector: !1 });
|
|
16
16
|
}
|
|
17
17
|
static get cssStyleSheet() {
|
|
18
|
-
return
|
|
18
|
+
return u;
|
|
19
19
|
}
|
|
20
20
|
static get observedAttributes() {
|
|
21
21
|
return [];
|
|
22
22
|
}
|
|
23
23
|
setupAttributes() {
|
|
24
|
-
this.isShadowRoot = "open";
|
|
25
|
-
this.setAttribute("active-class", "active");
|
|
24
|
+
this.isShadowRoot = "open", this.setAttribute("active-class", "active");
|
|
26
25
|
}
|
|
27
|
-
draw(
|
|
28
|
-
let
|
|
29
|
-
|
|
30
|
-
fragment.appendChild(element);
|
|
31
|
-
return fragment;
|
|
26
|
+
draw(s, d, p) {
|
|
27
|
+
let r = document.createDocumentFragment(), n = document.createElement("slot");
|
|
28
|
+
return r.appendChild(n), r;
|
|
32
29
|
}
|
|
33
30
|
}
|
|
34
|
-
customElements.get("wj-router-link") || window.customElements.define("wj-router-link",
|
|
31
|
+
customElements.get("wj-router-link") || window.customElements.define("wj-router-link", m);
|
|
35
32
|
export {
|
|
36
|
-
RouterLink
|
|
33
|
+
m as RouterLink
|
|
37
34
|
};
|