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.
Files changed (66) hide show
  1. package/dist/router-links-e0087f84.js +146 -0
  2. package/dist/style.css +2 -2365
  3. package/dist/wj-aside.js +18 -22
  4. package/dist/wj-avatar.js +32 -49
  5. package/dist/wj-badge.js +18 -22
  6. package/dist/wj-breadcrumb.js +53 -103
  7. package/dist/wj-breadcrumbs.js +21 -36
  8. package/dist/wj-button-group.js +24 -36
  9. package/dist/wj-button.js +37 -80
  10. package/dist/wj-card-content.js +16 -18
  11. package/dist/wj-card-controls.js +16 -18
  12. package/dist/wj-card-header.js +16 -20
  13. package/dist/wj-card-subtitle.js +17 -19
  14. package/dist/wj-card-title.js +16 -18
  15. package/dist/wj-card.js +16 -20
  16. package/dist/wj-checkbox.js +24 -46
  17. package/dist/wj-chip.js +21 -39
  18. package/dist/wj-col.js +18 -32
  19. package/dist/wj-color-picker.js +503 -868
  20. package/dist/wj-container.js +18 -20
  21. package/dist/wj-copy-button.js +66 -112
  22. package/dist/wj-dialog.js +43 -67
  23. package/dist/wj-divider.js +16 -20
  24. package/dist/wj-dropdown.js +22 -31
  25. package/dist/wj-element.js +241 -416
  26. package/dist/wj-footer.js +16 -18
  27. package/dist/wj-form.js +16 -18
  28. package/dist/wj-grid.js +17 -21
  29. package/dist/wj-header.js +18 -22
  30. package/dist/wj-icon-picker.js +66 -107
  31. package/dist/wj-icon.js +67 -140
  32. package/dist/wj-img-comparer.js +43 -72
  33. package/dist/wj-img.js +21 -31
  34. package/dist/wj-infinite-scroll.js +49 -84
  35. package/dist/wj-input.js +67 -146
  36. package/dist/wj-item.js +19 -34
  37. package/dist/wj-label.js +19 -21
  38. package/dist/wj-list.js +17 -20
  39. package/dist/wj-main.js +16 -18
  40. package/dist/wj-master.js +331 -462
  41. package/dist/wj-menu-button.js +18 -21
  42. package/dist/wj-menu-item.js +67 -144
  43. package/dist/wj-menu-label.js +17 -21
  44. package/dist/wj-menu.js +20 -24
  45. package/dist/wj-popup.js +714 -1140
  46. package/dist/wj-progress-bar.js +42 -100
  47. package/dist/wj-radio-group.js +27 -38
  48. package/dist/wj-radio.js +24 -46
  49. package/dist/wj-route.js +8 -11
  50. package/dist/wj-router-link.js +19 -22
  51. package/dist/wj-router-outlet.js +71 -135
  52. package/dist/wj-routerx.js +641 -1121
  53. package/dist/wj-row.js +20 -22
  54. package/dist/wj-slider.js +55 -97
  55. package/dist/wj-split-view.js +45 -81
  56. package/dist/wj-store.js +110 -195
  57. package/dist/wj-textarea.js +39 -86
  58. package/dist/wj-thumbnail.js +17 -19
  59. package/dist/wj-toast.js +34 -88
  60. package/dist/wj-toggle.js +24 -42
  61. package/dist/wj-toolbar-action.js +16 -27
  62. package/dist/wj-toolbar.js +21 -26
  63. package/dist/wj-tooltip.js +27 -41
  64. package/dist/wj-visually-hidden.js +16 -18
  65. package/package.json +1 -1
  66. package/dist/router-links-26e4a166.js +0 -204
@@ -1,21 +1,20 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
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 styles = "/*!\n* direction.scss\n*/\n/* Skeleton Variables */\n/*\n[ Progress bar ]\n*/\n:host(.wj-color-primary) #bar {\n --wj-progress-bar-color: #7252D3;\n}\n:host(.wj-color-complete) #bar {\n --wj-progress-bar-color: #0072EC;\n}\n:host(.wj-color-success) #bar {\n --wj-progress-bar-color: #19AD79;\n}\n:host(.wj-color-warning) #bar {\n --wj-progress-bar-color: #FFd945;\n}\n:host(.wj-color-danger) #bar {\n --wj-progress-bar-color: #D83C31;\n}\n:host(.wj-color-dark) #bar {\n --wj-progress-bar-color: #212121;\n}\n:host(.wj-color-light) #bar {\n --wj-progress-bar-color: #fff;\n}\n:host {\n --wj-progress-bar-color: #212121;\n --wj-progress-bar-text-size: 1rem;\n}\n:host .progress {\n position: relative;\n display: flex;\n align-items: center;\n}\n:host .slot-wrapper {\n display: flex;\n position: absolute;\n top: 0;\n align-items: center;\n width: 100%;\n height: 100%;\n justify-content: center;\n}\n:host #bar {\n stroke: var(--wj-progress-bar-color, red);\n}\n:host text {\n transform: rotate(90deg);\n transform-origin: center;\n text-anchor: middle;\n dominant-baseline: middle;\n font-size: var(--wj-progress-bar-text-size);\n}\n:host(.wj-color) #bar {\n stroke: var(--wj-progress-bar-color);\n}\n::slotted([slot=start]) {\n margin-inline: 0 1rem;\n}\n::slotted([slot=end]) {\n margin-inline: 1rem 0;\n}";
10
- class ProgressBar extends WJElement {
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
- __publicField(this, "className", "ProgressBar");
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(value) {
18
- this.setAttribute("radius", value);
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(value) {
27
- this.setAttribute("stroke", value);
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 styles;
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(context, store, params) {
45
- let xy = this.radius + this.stroke / 2;
46
- let fragment = document.createDocumentFragment();
47
- if (params.color)
48
- this.classList.add("wj-color-" + params.color, "wj-color");
49
- let element = document.createElement("div");
50
- element.classList.add("progress");
51
- let slot = document.createElement("slot");
52
- let slotWrapper = document.createElement("div");
53
- slotWrapper.classList.add("slot-wrapper");
54
- let slotStart = document.createElement("slot");
55
- slotStart.setAttribute("name", "start");
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
- svg.setAttribute("width", this.diameter);
63
- svg.setAttribute("height", this.diameter);
64
- svg.setAttribute("viewBox", `0 0 ${this.diameter} ${this.diameter}`);
65
- svg.setAttribute("style", "transform: rotate(-90deg)");
66
- background = document.createElementNS("http://www.w3.org/2000/svg", "circle");
67
- background.setAttribute("r", this.radius);
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(context, store, params) {
117
- if (this.type === "circle") {
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(radius = 70) {
125
- return 2 * Math.PI * radius;
66
+ getCircleDasharray(e = 70) {
67
+ return 2 * Math.PI * e;
126
68
  }
127
- getCircleDashoffset(progress = 0, radius) {
128
- return this.getCircleDasharray(radius) * ((100 - progress) / 100);
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", ProgressBar);
73
+ customElements.get("wj-progress-bar") || window.customElements.define("wj-progress-bar", x);
132
74
  export {
133
- ProgressBar
75
+ x as ProgressBar
134
76
  };
@@ -1,20 +1,20 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- return value;
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 styles = "/*!\n* direction.scss\n*/\n/* Skeleton Variables */\n/*\n[ Radio Group ]\n*/\n.wj-inline {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 0.5rem;\n}";
11
- class RadioGroup extends WJElement {
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
- __publicField(this, "className", "RadioGroup");
14
+ n(this, "className", "RadioGroup");
15
15
  }
16
16
  static get cssStyleSheet() {
17
- return styles;
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(context, store, params) {
26
- let fragment = document.createDocumentFragment();
27
- let native = document.createElement("div");
28
- native.classList.add("native-radio-group", this.hasAttribute("inline") ? "wj-inline" : "ddd");
29
- let slot = document.createElement("slot");
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
- if (this.value) {
36
- this.setRadioToChekced(this.getRadioByValue(this.value));
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(value) {
44
- return this.getAllElements().filter((el) => el instanceof Radio && el.value === value)[0];
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((el) => {
48
- if (el instanceof Radio)
49
- el.checked = false;
40
+ this.getAllElements().forEach((e) => {
41
+ e instanceof o && (e.checked = !1);
50
42
  });
51
43
  }
52
- setRadioToChekced(radio) {
53
- if (radio instanceof Radio) {
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", RadioGroup);
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 __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
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 styles = '/*!\n* direction.scss\n*/\n/* Skeleton Variables */\n/*\n[ Radio ]\n*/\n:host {\n --wj-radio-margin-top: 0;\n --wj-radio-margin-bottom: .5rem;\n --wj-radio-margin-inline: 0;\n display: block;\n margin-top: var(--wj-radio-margin-top);\n margin-bottom: var(--wj-radio-margin-bottom);\n margin-inline: var(--wj-radio-margin-inline);\n line-height: 100%;\n padding-left: 0px;\n}\n:host label {\n display: inline-flex;\n cursor: pointer;\n position: relative;\n padding-left: 25px;\n min-width: 16px;\n min-height: 16px;\n margin-bottom: 0;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -moz-user-select: none; /* Old versions of Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none; /* Non-prefixed version, currently supported by Chrome, Opera and Firefox */\n align-items: center;\n}\n:host label:before {\n content: "";\n position: absolute;\n width: 16px;\n height: 16px;\n left: 0;\n -webkit-box-sizing: inherit;\n box-sizing: border-box;\n background-color: #fff;\n border: 1px solid #c9c9c9;\n}\n.native-radio input[type=radio] + label:before {\n border-radius: 99px;\n -webkit-transition: border 0.3s 0s cubic-bezier(0.455, 0.03, 0.215, 1.33);\n transition: border 0.3s 0s cubic-bezier(0.455, 0.03, 0.215, 1.33);\n}\n.native-radio input[type=radio]:checked + label:before {\n border-color: #757575;\n border-width: 5px;\n}\n.native-radio input[type=radio]:hover:active:not(:checked) + label:before {\n background-color: rgba(0, 0, 0, 0.08);\n}\n.native-radio input[type=radio]:focus + label {\n color: #212121;\n}\n.native-radio input[type=radio]:focus + label:before {\n outline: none !important;\n box-shadow: 0 0 0 0px #78c8fe;\n}\n.native-radio input[type=radio] {\n opacity: 0;\n position: absolute;\n top: 3px;\n width: 16px;\n height: 16px;\n}\n.native-radio input[type=radio][disabled] + label {\n cursor: not-allowed !important;\n color: #4b4b4b;\n opacity: 0.58;\n}\n.native-radio input[type=radio][disabled] + label:before {\n cursor: not-allowed !important;\n background: #ececec;\n}\n.success input[type=radio]:checked + label:before {\n border-color: #19AD79;\n}\n.primary input[type=radio]:checked + label:before {\n border-color: #7252D3;\n}\n.complete input[type=radio]:checked + label:before {\n border-color: #0072EC;\n}\n.warning input[type=radio]:checked + label:before {\n border-color: #FFd945;\n}\n.danger input[type=radio]:checked + label:before {\n border-color: #D83C31;\n}\n.neutral input[type=radio]:checked + label:before {\n border-color: #3B4752;\n}';
10
- class Radio extends WJElement {
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
- __publicField(this, "className", "Radio");
14
- __publicField(this, "inputEvent", (e) => {
13
+ a(this, "className", "Radio");
14
+ a(this, "inputEvent", (e) => {
15
15
  this.checked = e.target.checked;
16
16
  });
17
- this._checked = false;
17
+ this._checked = !1;
18
18
  }
19
- set checked(value) {
20
- this._checked = value;
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 styles;
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(context, store, params) {
39
- let fragment = document.createDocumentFragment();
40
- let native = document.createElement("div");
41
- native.classList.add("native-radio");
42
- if (this.color)
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
- if (!this.hasAttribute("disabled")) {
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
- event.removeElement(this);
44
+ n.removeElement(this);
67
45
  }
68
46
  }
69
- customElements.get("wj-radio") || window.customElements.define("wj-radio", 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 __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
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 Route extends WJElement {
6
+ class n extends m {
10
7
  constructor() {
11
8
  super();
12
- __publicField(this, "className", "Route");
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", Route);
15
+ customElements.get("wj-route") || window.customElements.define("wj-route", n);
19
16
  export {
20
- Route
17
+ n as Route
21
18
  };
@@ -1,37 +1,34 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- return value;
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 styles = "/*!\n* direction.scss\n*/\n/* Skeleton Variables */\n/*\n[ Router Link ]\n*/\n:host {\n display: block;\n}\n:host(.active) {\n cursor: pointer;\n font-weight: bold;\n}";
11
- class RouterLink extends WJElement {
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
- __publicField(this, "className", "RouterLink");
15
- bindRouterLinks(this, { selector: false });
14
+ o(this, "className", "RouterLink");
15
+ l(this, { selector: !1 });
16
16
  }
17
17
  static get cssStyleSheet() {
18
- return styles;
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(context, store, params) {
28
- let fragment = document.createDocumentFragment();
29
- let element = document.createElement("slot");
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", RouterLink);
31
+ customElements.get("wj-router-link") || window.customElements.define("wj-router-link", m);
35
32
  export {
36
- RouterLink
33
+ m as RouterLink
37
34
  };