wj-elements 0.0.11 → 0.0.13
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/localize-20081fd1.js +55 -0
- package/dist/router-links-26e4a166.js +204 -0
- package/dist/style.css +2243 -2
- package/dist/wj-animation.js +35 -23
- package/dist/wj-aside.js +22 -16
- package/dist/wj-avatar.js +49 -30
- package/dist/wj-badge.js +22 -18
- package/dist/wj-breadcrumb.js +102 -50
- package/dist/wj-breadcrumbs.js +36 -19
- package/dist/wj-button-group.js +36 -22
- package/dist/wj-button.js +104 -39
- package/dist/wj-card-content.js +18 -14
- package/dist/wj-card-controls.js +18 -14
- package/dist/wj-card-header.js +20 -14
- package/dist/wj-card-subtitle.js +19 -15
- package/dist/wj-card-title.js +18 -14
- package/dist/wj-card.js +20 -14
- package/dist/wj-carousel-item.js +22 -16
- package/dist/wj-carousel.js +169 -92
- package/dist/wj-checkbox.js +46 -24
- package/dist/wj-chip.js +39 -21
- package/dist/wj-col.js +31 -17
- package/dist/wj-color-picker.js +877 -509
- package/dist/wj-container.js +20 -16
- package/dist/wj-copy-button.js +112 -64
- package/dist/wj-dialog.js +68 -42
- package/dist/wj-divider.js +20 -14
- package/dist/wj-dropdown.js +29 -17
- package/dist/wj-element.js +415 -241
- package/dist/wj-fetchAndParseCSS.js +49 -32
- package/dist/wj-file-upload-item.js +64 -38
- package/dist/wj-file-upload.js +237 -137
- package/dist/wj-footer.js +18 -14
- package/dist/wj-form.js +18 -14
- package/dist/wj-format-digital.js +40 -25
- package/dist/wj-grid.js +20 -16
- package/dist/wj-header.js +22 -16
- package/dist/wj-icon-picker.js +122 -68
- package/dist/wj-icon.js +144 -64
- package/dist/wj-img-comparer.js +72 -41
- package/dist/wj-img.js +31 -19
- package/dist/wj-infinite-scroll.js +90 -52
- package/dist/wj-input-file.js +50 -27
- package/dist/wj-input.js +169 -70
- package/dist/wj-item.js +34 -17
- package/dist/wj-label.js +21 -19
- package/dist/wj-list.js +20 -15
- package/dist/wj-main.js +18 -14
- package/dist/wj-masonry.js +140 -83
- package/dist/wj-master.js +492 -350
- package/dist/wj-menu-button.js +19 -15
- package/dist/wj-menu-item.js +150 -64
- package/dist/wj-menu-label.js +21 -17
- package/dist/wj-menu.js +24 -18
- package/dist/wj-popup.js +1140 -712
- package/dist/wj-progress-bar.js +100 -40
- package/dist/wj-radio-group.js +38 -25
- package/dist/wj-radio.js +46 -22
- package/dist/wj-rate.js +121 -71
- package/dist/wj-relative-time.js +48 -24
- package/dist/wj-route.js +11 -8
- package/dist/wj-router-link.js +22 -17
- package/dist/wj-router-outlet.js +135 -71
- package/dist/wj-routerx.js +1124 -641
- package/dist/wj-row.js +21 -19
- package/dist/wj-slider.js +97 -55
- package/dist/wj-split-view.js +81 -43
- package/dist/wj-store.js +195 -110
- package/dist/wj-textarea.js +86 -37
- package/dist/wj-thumbnail.js +19 -15
- package/dist/wj-toast.js +87 -34
- package/dist/wj-toggle.js +42 -24
- package/dist/wj-toolbar-action.js +27 -16
- package/dist/wj-toolbar.js +26 -19
- package/dist/wj-tooltip.js +40 -24
- package/dist/wj-visually-hidden.js +18 -14
- package/package.json +1 -1
- package/dist/localize-762a9f0f.js +0 -43
- package/dist/router-links-e0087f84.js +0 -146
package/dist/wj-input-file.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
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";
|
|
5
8
|
import "./wj-store.js";
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
constructor(t = {}) {
|
|
9
|
+
const styles = '/*\n[ WJ Input ]\n*/\n:host {\n --wj-input-font-family: var(--wj-font-family);\n --wj-input-background-color: var(--wj-background);\n --wj-input-color: var(--wj-color);\n --wj-input-color-invalid: var(--wj-color-danger);\n --wj-input-border-color: var(--wj-border-color);\n --wj-input-border-color-focus: var(--wj-color-primary);\n --wj-input-border-width: 1px;\n --wj-input-border-style: solid;\n --wj-input-border-radius: 4px;\n --wj-input-margin-bottom: .5rem;\n --wj-input-line-height: 20px;\n --wj-input-slot-padding-inline: .5rem;\n width: 100%;\n margin-bottom: var(--wj-input-margin-bottom);\n display: block;\n}\n:host .wrapper {\n display: flex;\n width: 100%;\n}\n:host .native-input .input-wrapper {\n width: 100%;\n position: relative;\n}\n:host .native-input.default {\n background-color: var(--wj-input-background-color);\n font-family: var(--wj-input-font-family);\n position: relative;\n border-radius: var(--wj-input-border-radius);\n border-width: var(--wj-input-border-width);\n border-style: var(--wj-input-border-style);\n border-color: var(--wj-input-border-color);\n padding-inline: 0;\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n transition: background-color 0.2s ease;\n cursor: text;\n}\n:host .native-input.default .input-wrapper {\n margin-inline: 0.5rem;\n}\n:host .native-input.default.focused {\n border-color: var(--wj-input-border-color-focus) !important;\n}\n:host .native-input.default.focused label {\n opacity: 0.67;\n font-size: 12px;\n letter-spacing: normal;\n}\n:host .native-input.default input {\n border: none;\n height: 25px;\n min-height: 25px;\n padding: 0;\n margin-top: -4px;\n background: none;\n box-shadow: none;\n width: 100%;\n}\n:host .native-input.default label {\n margin: 0;\n display: block;\n opacity: 1;\n cursor: text;\n transition: opacity 0.2s ease;\n line-height: var(--wj-input-line-height);\n}\n:host .native-input.default label.fade {\n opacity: 0.5;\n font-size: 12px;\n letter-spacing: normal;\n}\n:host .native-input.default ::slotted([slot=start]) {\n border-left: none;\n border-top: none;\n border-bottom: none;\n}\n:host .native-input.default ::slotted([slot=end]) {\n border-right: none;\n border-top: none;\n border-bottom: none;\n}\n:host .native-input.standard {\n background-color: var(--wj-input-background-color);\n font-family: var(--wj-input-font-family);\n position: relative;\n border-radius: var(--wj-input-border-radius);\n padding-inline: 0;\n padding-top: 0;\n padding-bottom: 0;\n transition: background-color 0.2s ease;\n cursor: text;\n}\n:host .native-input.standard.focused input {\n border-color: var(--wj-input-border-color-focus) !important;\n}\n:host .native-input.standard input {\n display: block;\n min-height: 32px;\n padding-inline: 0.5rem;\n padding-top: 0;\n padding-bottom: 0;\n background: none;\n box-shadow: none;\n width: 100%;\n box-sizing: border-box;\n border-radius: var(--wj-input-border-radius);\n border-width: var(--wj-input-border-width);\n border-style: var(--wj-input-border-style);\n border-color: var(--wj-input-border-color);\n}\n:host .native-input.standard label {\n margin: 0;\n display: inline-block;\n opacity: 1;\n cursor: text;\n transition: opacity 0.2s ease;\n line-height: var(--wj-input-line-height);\n}\n:host .native-input.standard .input-wrapper:hover .clear {\n visibility: visible;\n}\n:host .native-input.standard ::slotted([slot=start]) {\n border-right: none;\n border-radius: var(--wj-input-border-radius) 0 0 var(--wj-input-border-radius);\n}\n:host .native-input.standard ::slotted([slot=end]) {\n border-left: none;\n border-radius: 0 var(--wj-input-border-radius) var(--wj-input-border-radius) 0;\n}\n:host .native-input.standard.has-start input {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n:host .native-input.standard.has-end input {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n:host .native-input.standard .error-message {\n position: static;\n background: transparent;\n padding: 0.25rem 0;\n left: auto;\n transform: none;\n color: var(--wj-input-color-invalid);\n font-size: 12px;\n line-height: normal;\n}\n\n.clear {\n visibility: hidden;\n position: absolute;\n right: 0;\n top: 3px;\n --wj-padding-top: .25rem;\n --wj-padding-start: .25rem;\n --wj-padding-end: .25rem;\n --wj-padding-bottom: .25rem;\n --wj-button-margin-inline: 0 .25rem;\n}\n\n:host([required]) .input-wrapper::after {\n color: var(--wj-input-color-invalid);\n content: "*";\n font-family: var(--wj-force-mac-font-family);\n font-size: 20px;\n position: absolute;\n right: 10px;\n top: 2px;\n}\n\n:host([required]) .standard .input-wrapper::after {\n top: 0;\n}\n\n:host([invalid]) .error-message {\n display: block;\n}\n:host([invalid]) .default label {\n opacity: 1 !important;\n color: var(--wj-input-color-invalid) !important;\n animation-name: shake;\n animation-duration: 0.4s;\n animation-iteration-count: 1;\n}\n\n::slotted([slot=start]), ::slotted([slot=end]) {\n display: flex;\n align-items: center;\n border-width: var(--wj-input-border-width);\n border-style: var(--wj-input-border-style);\n border-color: var(--wj-input-border-color);\n padding-inline: var(--wj-input-slot-padding-inline);\n}\n\nslot[name=start], slot[name=end] {\n display: flex;\n}\n\ninput {\n background-color: var(--wj-input-background-color);\n border-width: var(--wj-input-border-width);\n border-style: var(--wj-input-border-style);\n border-color: var(--wj-input-border-color);\n font-family: var(--wjinput-font-family);\n color: var(--wj-input-color);\n appearance: none;\n outline: 0;\n padding: 0.25rem 0.5rem;\n line-height: var(--wj-input-line-height);\n font-size: 14px;\n font-weight: normal;\n vertical-align: middle;\n min-height: 32px;\n}\n\n.error-message {\n display: none;\n position: absolute;\n width: auto;\n max-width: 100%;\n min-width: auto;\n border-radius: 50px;\n background: black;\n padding: 0.25rem 0.5rem;\n top: 0;\n left: 50%;\n transform: translate(-50%, -50%);\n color: white;\n font-size: 12px;\n line-height: normal;\n}\n\n@keyframes shake {\n 8%, 41% {\n transform: translateX(-4px);\n }\n 25%, 58% {\n transform: translateX(4px);\n }\n 75% {\n transform: translateX(-2px);\n }\n 92% {\n transform: translateX(2px);\n }\n 0%, 100% {\n transform: translateX(0);\n }\n}';
|
|
10
|
+
class InputFile extends WJElement {
|
|
11
|
+
constructor(options = {}) {
|
|
10
12
|
super();
|
|
11
|
-
|
|
13
|
+
__publicField(this, "className", "Input");
|
|
12
14
|
}
|
|
13
15
|
static get cssStyleSheet() {
|
|
14
|
-
return
|
|
16
|
+
return styles;
|
|
15
17
|
}
|
|
16
18
|
static get observedAttributes() {
|
|
17
19
|
return [];
|
|
@@ -19,29 +21,50 @@ class w extends m {
|
|
|
19
21
|
setupAttributes() {
|
|
20
22
|
this.isShadowRoot = "open";
|
|
21
23
|
}
|
|
22
|
-
draw(
|
|
23
|
-
let
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
let
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
let
|
|
32
|
-
|
|
24
|
+
draw(context, store, params) {
|
|
25
|
+
let fragment = document.createDocumentFragment();
|
|
26
|
+
let native = document.createElement("div");
|
|
27
|
+
native.setAttribute("part", "native");
|
|
28
|
+
native.classList.add("native-input-file", this.variant || "default");
|
|
29
|
+
let fileInput = document.createElement("input");
|
|
30
|
+
fileInput.setAttribute("type", "file");
|
|
31
|
+
fileInput.setAttribute("multiple", "");
|
|
32
|
+
fileInput.setAttribute("hidden", "");
|
|
33
|
+
let input = document.createElement("wj-input");
|
|
34
|
+
input.setAttribute("variant", "standard");
|
|
35
|
+
input.setAttribute("type", "text");
|
|
36
|
+
input.setAttribute("placeholder", "Click to upload");
|
|
37
|
+
input.setAttribute("readonly", "");
|
|
38
|
+
let span = document.createElement("span");
|
|
39
|
+
span.setAttribute("slot", "start");
|
|
40
|
+
let icon = document.createElement("wj-icon");
|
|
41
|
+
icon.setAttribute("slot", "icon-only");
|
|
42
|
+
icon.setAttribute("name", "cloud-upload");
|
|
43
|
+
span.appendChild(icon);
|
|
44
|
+
input.appendChild(span);
|
|
45
|
+
native.appendChild(input);
|
|
46
|
+
native.appendChild(fileInput);
|
|
47
|
+
fragment.appendChild(native);
|
|
48
|
+
this.native = native;
|
|
49
|
+
this.input = input;
|
|
50
|
+
this.fileInput = fileInput;
|
|
51
|
+
return fragment;
|
|
33
52
|
}
|
|
34
53
|
afterDraw() {
|
|
35
54
|
this.input.addEventListener("click", () => {
|
|
36
55
|
this.fileInput.click();
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
56
|
+
});
|
|
57
|
+
this.fileInput.addEventListener("change", (e) => {
|
|
58
|
+
var files = e.target.files;
|
|
59
|
+
var fileNames = [];
|
|
60
|
+
for (var i = 0; i < files.length; i++) {
|
|
61
|
+
fileNames.push(files[i].name);
|
|
62
|
+
}
|
|
63
|
+
this.input.value = fileNames.join(", ");
|
|
41
64
|
});
|
|
42
65
|
}
|
|
43
66
|
}
|
|
44
|
-
customElements.get("wj-input-file") || window.customElements.define("wj-input-file",
|
|
67
|
+
customElements.get("wj-input-file") || window.customElements.define("wj-input-file", InputFile);
|
|
45
68
|
export {
|
|
46
|
-
|
|
69
|
+
InputFile
|
|
47
70
|
};
|
package/dist/wj-input.js
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
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";
|
|
5
8
|
import "./wj-store.js";
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
constructor(t = {}) {
|
|
9
|
+
const styles = '/*\n[ WJ Input ]\n*/\n:host {\n --wj-input-font-family: var(--wj-font-family);\n --wj-input-background-color: var(--wj-background);\n --wj-input-color: var(--wj-color);\n --wj-input-color-invalid: var(--wj-color-danger);\n --wj-input-border-color: var(--wj-border-color);\n --wj-input-border-color-focus: var(--wj-color-primary);\n --wj-input-border-width: 1px;\n --wj-input-border-style: solid;\n --wj-input-border-radius: 4px;\n --wj-input-margin-bottom: .5rem;\n --wj-input-line-height: 20px;\n --wj-input-slot-padding-inline: .5rem;\n width: 100%;\n margin-bottom: var(--wj-input-margin-bottom);\n display: block;\n}\n:host .wrapper {\n display: flex;\n width: 100%;\n}\n:host .native-input .input-wrapper {\n width: 100%;\n position: relative;\n}\n:host .native-input.default {\n background-color: var(--wj-input-background-color);\n font-family: var(--wj-input-font-family);\n position: relative;\n border-radius: var(--wj-input-border-radius);\n border-width: var(--wj-input-border-width);\n border-style: var(--wj-input-border-style);\n border-color: var(--wj-input-border-color);\n padding-inline: 0;\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n transition: background-color 0.2s ease;\n cursor: text;\n}\n:host .native-input.default .input-wrapper {\n margin-inline: 0.5rem;\n}\n:host .native-input.default.focused {\n border-color: var(--wj-input-border-color-focus) !important;\n}\n:host .native-input.default.focused label {\n opacity: 0.67;\n font-size: 12px;\n letter-spacing: normal;\n}\n:host .native-input.default input {\n border: none;\n height: 25px;\n min-height: 25px;\n padding: 0;\n margin-top: -4px;\n background: none;\n box-shadow: none;\n width: 100%;\n}\n:host .native-input.default label {\n margin: 0;\n display: block;\n opacity: 1;\n cursor: text;\n transition: opacity 0.2s ease;\n line-height: var(--wj-input-line-height);\n}\n:host .native-input.default label.fade {\n opacity: 0.5;\n font-size: 12px;\n letter-spacing: normal;\n}\n:host .native-input.default ::slotted([slot=start]) {\n border-left: none;\n border-top: none;\n border-bottom: none;\n}\n:host .native-input.default ::slotted([slot=end]) {\n border-right: none;\n border-top: none;\n border-bottom: none;\n}\n:host .native-input.standard {\n background-color: var(--wj-input-background-color);\n font-family: var(--wj-input-font-family);\n position: relative;\n border-radius: var(--wj-input-border-radius);\n padding-inline: 0;\n padding-top: 0;\n padding-bottom: 0;\n transition: background-color 0.2s ease;\n cursor: text;\n}\n:host .native-input.standard.focused input {\n border-color: var(--wj-input-border-color-focus) !important;\n}\n:host .native-input.standard input {\n display: block;\n min-height: 32px;\n padding-inline: 0.5rem;\n padding-top: 0;\n padding-bottom: 0;\n background: none;\n box-shadow: none;\n width: 100%;\n box-sizing: border-box;\n border-radius: var(--wj-input-border-radius);\n border-width: var(--wj-input-border-width);\n border-style: var(--wj-input-border-style);\n border-color: var(--wj-input-border-color);\n}\n:host .native-input.standard label {\n margin: 0;\n display: inline-block;\n opacity: 1;\n cursor: text;\n transition: opacity 0.2s ease;\n line-height: var(--wj-input-line-height);\n}\n:host .native-input.standard .input-wrapper:hover .clear {\n visibility: visible;\n}\n:host .native-input.standard ::slotted([slot=start]) {\n border-right: none;\n border-radius: var(--wj-input-border-radius) 0 0 var(--wj-input-border-radius);\n}\n:host .native-input.standard ::slotted([slot=end]) {\n border-left: none;\n border-radius: 0 var(--wj-input-border-radius) var(--wj-input-border-radius) 0;\n}\n:host .native-input.standard.has-start input {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n:host .native-input.standard.has-end input {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n:host .native-input.standard .error-message {\n position: static;\n background: transparent;\n padding: 0.25rem 0;\n left: auto;\n transform: none;\n color: var(--wj-input-color-invalid);\n font-size: 12px;\n line-height: normal;\n}\n\n.clear {\n visibility: hidden;\n position: absolute;\n right: 0;\n top: 3px;\n --wj-padding-top: .25rem;\n --wj-padding-start: .25rem;\n --wj-padding-end: .25rem;\n --wj-padding-bottom: .25rem;\n --wj-button-margin-inline: 0 .25rem;\n}\n\n:host([required]) .input-wrapper::after {\n color: var(--wj-input-color-invalid);\n content: "*";\n font-family: var(--wj-force-mac-font-family);\n font-size: 20px;\n position: absolute;\n right: 10px;\n top: 2px;\n}\n\n:host([required]) .standard .input-wrapper::after {\n top: 0;\n}\n\n:host([invalid]) .error-message {\n display: block;\n}\n:host([invalid]) .default label {\n opacity: 1 !important;\n color: var(--wj-input-color-invalid) !important;\n animation-name: shake;\n animation-duration: 0.4s;\n animation-iteration-count: 1;\n}\n\n::slotted([slot=start]), ::slotted([slot=end]) {\n display: flex;\n align-items: center;\n border-width: var(--wj-input-border-width);\n border-style: var(--wj-input-border-style);\n border-color: var(--wj-input-border-color);\n padding-inline: var(--wj-input-slot-padding-inline);\n}\n\nslot[name=start], slot[name=end] {\n display: flex;\n}\n\ninput {\n background-color: var(--wj-input-background-color);\n border-width: var(--wj-input-border-width);\n border-style: var(--wj-input-border-style);\n border-color: var(--wj-input-border-color);\n font-family: var(--wjinput-font-family);\n color: var(--wj-input-color);\n appearance: none;\n outline: 0;\n padding: 0.25rem 0.5rem;\n line-height: var(--wj-input-line-height);\n font-size: 14px;\n font-weight: normal;\n vertical-align: middle;\n min-height: 32px;\n}\n\n.error-message {\n display: none;\n position: absolute;\n width: auto;\n max-width: 100%;\n min-width: auto;\n border-radius: 50px;\n background: black;\n padding: 0.25rem 0.5rem;\n top: 0;\n left: 50%;\n transform: translate(-50%, -50%);\n color: white;\n font-size: 12px;\n line-height: normal;\n}\n\n@keyframes shake {\n 8%, 41% {\n transform: translateX(-4px);\n }\n 25%, 58% {\n transform: translateX(4px);\n }\n 75% {\n transform: translateX(-2px);\n }\n 92% {\n transform: translateX(2px);\n }\n 0%, 100% {\n transform: translateX(0);\n }\n}';
|
|
10
|
+
class Input extends WJElement {
|
|
11
|
+
constructor(options = {}) {
|
|
10
12
|
super();
|
|
11
|
-
|
|
12
|
-
this.invalid =
|
|
13
|
+
__publicField(this, "className", "Input");
|
|
14
|
+
this.invalid = false;
|
|
15
|
+
this.pristine = true;
|
|
16
|
+
this.internals = this.attachInternals();
|
|
13
17
|
}
|
|
14
|
-
set value(
|
|
15
|
-
this.setAttribute("value",
|
|
18
|
+
set value(value) {
|
|
19
|
+
this.setAttribute("value", value);
|
|
16
20
|
}
|
|
17
21
|
get value() {
|
|
18
22
|
return this.getAttribute("value") || "";
|
|
@@ -26,8 +30,8 @@ class w extends x {
|
|
|
26
30
|
get invalid() {
|
|
27
31
|
return this.hasAttribute("invalid");
|
|
28
32
|
}
|
|
29
|
-
set invalid(
|
|
30
|
-
|
|
33
|
+
set invalid(isInvalid) {
|
|
34
|
+
isInvalid && this.customErrorDisplay ? this.setAttribute("invalid", "") : this.removeAttribute("invalid");
|
|
31
35
|
}
|
|
32
36
|
get form() {
|
|
33
37
|
return this.internals.form;
|
|
@@ -54,7 +58,7 @@ class w extends x {
|
|
|
54
58
|
return this.internals.reportValidity();
|
|
55
59
|
}
|
|
56
60
|
static get cssStyleSheet() {
|
|
57
|
-
return
|
|
61
|
+
return styles;
|
|
58
62
|
}
|
|
59
63
|
static get observedAttributes() {
|
|
60
64
|
return ["value"];
|
|
@@ -62,28 +66,88 @@ class w extends x {
|
|
|
62
66
|
setupAttributes() {
|
|
63
67
|
this.isShadowRoot = "open";
|
|
64
68
|
}
|
|
65
|
-
draw(
|
|
66
|
-
let
|
|
67
|
-
|
|
68
|
-
let
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
let
|
|
75
|
-
|
|
76
|
-
let
|
|
77
|
-
|
|
78
|
-
let
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
69
|
+
draw(context, store, params) {
|
|
70
|
+
let hasSlotStart = this.hasSlot(this, "start");
|
|
71
|
+
let hasSlotEnd = this.hasSlot(this, "end");
|
|
72
|
+
let fragment = document.createDocumentFragment();
|
|
73
|
+
let native = document.createElement("div");
|
|
74
|
+
native.setAttribute("part", "native");
|
|
75
|
+
native.classList.add("native-input", this.variant || "default");
|
|
76
|
+
if (this.hasAttribute("invalid"))
|
|
77
|
+
native.classList.add("has-error");
|
|
78
|
+
let wrapper = document.createElement("div");
|
|
79
|
+
wrapper.classList.add("wrapper");
|
|
80
|
+
let inputWrapper = document.createElement("div");
|
|
81
|
+
inputWrapper.classList.add("input-wrapper");
|
|
82
|
+
let label = document.createElement("label");
|
|
83
|
+
label.innerText = this.label;
|
|
84
|
+
if (this.value && !this.hasAttribute("error"))
|
|
85
|
+
label.classList.add("fade");
|
|
86
|
+
let input = document.createElement("input");
|
|
87
|
+
input.setAttribute("type", "text");
|
|
88
|
+
input.setAttribute("part", "input");
|
|
89
|
+
input.setAttribute("value", this.value || "");
|
|
90
|
+
input.classList.add("form-control");
|
|
91
|
+
if (this.hasAttribute("placeholder"))
|
|
92
|
+
input.setAttribute("placeholder", this.placeholder);
|
|
93
|
+
if (this.hasAttribute("multiple"))
|
|
94
|
+
input.setAttribute("multiple", this.multiple);
|
|
95
|
+
if (this.hasAttribute("disabled"))
|
|
96
|
+
input.setAttribute("disabled", "");
|
|
97
|
+
if (this.hasAttribute("readonly"))
|
|
98
|
+
input.setAttribute("readonly", "");
|
|
99
|
+
if (this.hasAttribute("maxlength"))
|
|
100
|
+
input.setAttribute("maxlength", this.maxlength);
|
|
101
|
+
if (this.hasAttribute("max"))
|
|
102
|
+
input.setAttribute("max", this.max);
|
|
103
|
+
if (this.hasAttribute("min"))
|
|
104
|
+
input.setAttribute("min", this.min);
|
|
105
|
+
let error = document.createElement("div");
|
|
106
|
+
error.classList.add("error-message");
|
|
107
|
+
let start = null;
|
|
108
|
+
if (hasSlotStart) {
|
|
109
|
+
start = document.createElement("slot");
|
|
110
|
+
start.setAttribute("name", "start");
|
|
111
|
+
}
|
|
112
|
+
let end = null;
|
|
113
|
+
if (hasSlotEnd) {
|
|
114
|
+
end = document.createElement("slot");
|
|
115
|
+
end.setAttribute("name", "end");
|
|
116
|
+
}
|
|
117
|
+
if (hasSlotStart) {
|
|
118
|
+
wrapper.appendChild(start);
|
|
119
|
+
native.classList.add("has-start");
|
|
120
|
+
}
|
|
121
|
+
if (this.variant === "standard") {
|
|
122
|
+
if (this.label)
|
|
123
|
+
native.appendChild(label);
|
|
124
|
+
} else {
|
|
125
|
+
inputWrapper.appendChild(label);
|
|
85
126
|
}
|
|
86
|
-
|
|
127
|
+
inputWrapper.appendChild(input);
|
|
128
|
+
wrapper.appendChild(inputWrapper);
|
|
129
|
+
native.appendChild(wrapper);
|
|
130
|
+
if (this.hasAttribute("clearable")) {
|
|
131
|
+
this.clear = document.createElement("wj-button");
|
|
132
|
+
this.clear.classList.add("clear");
|
|
133
|
+
this.clear.setAttribute("fill", "link");
|
|
134
|
+
this.clear.setAttribute("part", "clear");
|
|
135
|
+
let clearIcon = document.createElement("wj-icon");
|
|
136
|
+
clearIcon.setAttribute("name", "x");
|
|
137
|
+
this.clear.appendChild(clearIcon);
|
|
138
|
+
inputWrapper.appendChild(this.clear);
|
|
139
|
+
}
|
|
140
|
+
if (hasSlotEnd) {
|
|
141
|
+
wrapper.appendChild(end);
|
|
142
|
+
native.classList.add("has-end");
|
|
143
|
+
}
|
|
144
|
+
native.appendChild(error);
|
|
145
|
+
fragment.appendChild(native);
|
|
146
|
+
this.native = native;
|
|
147
|
+
this.labelElement = label;
|
|
148
|
+
this.input = input;
|
|
149
|
+
this.errorMessage = error;
|
|
150
|
+
return fragment;
|
|
87
151
|
}
|
|
88
152
|
afterDraw() {
|
|
89
153
|
[
|
|
@@ -96,49 +160,84 @@ class w extends x {
|
|
|
96
160
|
"minLength",
|
|
97
161
|
"maxLength",
|
|
98
162
|
"pattern"
|
|
99
|
-
].forEach((
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
})
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
this.
|
|
108
|
-
|
|
109
|
-
|
|
163
|
+
].forEach((attr) => {
|
|
164
|
+
const attrValue = attr === "required" ? this.hasAttribute(attr) : this.getAttribute(attr);
|
|
165
|
+
if (attrValue !== null && attrValue !== void 0) {
|
|
166
|
+
this.input[attr] = attrValue;
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
this.input.addEventListener("focus", (e) => {
|
|
170
|
+
this.labelElement.classList.add("fade");
|
|
171
|
+
this.native.classList.add("focused");
|
|
172
|
+
});
|
|
173
|
+
this.input.addEventListener("blur", (e) => {
|
|
174
|
+
this.native.classList.remove("focused");
|
|
175
|
+
if (!e.target.value)
|
|
176
|
+
this.labelElement.classList.remove("fade");
|
|
177
|
+
});
|
|
178
|
+
this.input.addEventListener("input", (e) => {
|
|
179
|
+
if (this.validateOnChange) {
|
|
180
|
+
this.pristine = false;
|
|
181
|
+
}
|
|
182
|
+
this.input.classList.remove("pristine");
|
|
183
|
+
this.labelElement.classList.add("fade");
|
|
184
|
+
const clone = new e.constructor(e.type, e);
|
|
185
|
+
this.dispatchEvent(clone);
|
|
186
|
+
this.validateInput();
|
|
187
|
+
event.dispatchCustomEvent(this, "wj-input:input", {
|
|
110
188
|
value: this.input.value
|
|
111
189
|
});
|
|
112
|
-
}), this.addEventListener("invalid", (t) => {
|
|
113
|
-
this.invalid = !0, this.pristine = !1, this.errorMessage.textContent = this.internals.validationMessage, this.customErrorDisplay && t.preventDefault();
|
|
114
|
-
}), this.addEventListener("focus", () => this.input.focus()), this.clear && this.clear.addEventListener("wj:button-click", (t) => {
|
|
115
|
-
this.input.value = "", g.dispatchCustomEvent(this.clear, "wj-input:clear");
|
|
116
190
|
});
|
|
191
|
+
this.addEventListener("invalid", (e) => {
|
|
192
|
+
this.invalid = true;
|
|
193
|
+
this.pristine = false;
|
|
194
|
+
this.errorMessage.textContent = this.internals.validationMessage;
|
|
195
|
+
if (this.customErrorDisplay) {
|
|
196
|
+
e.preventDefault();
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
this.addEventListener("focus", () => this.input.focus());
|
|
200
|
+
if (this.clear) {
|
|
201
|
+
this.clear.addEventListener("wj:button-click", (e) => {
|
|
202
|
+
this.input.value = "";
|
|
203
|
+
event.dispatchCustomEvent(this.clear, "wj-input:clear");
|
|
204
|
+
});
|
|
205
|
+
}
|
|
117
206
|
}
|
|
118
207
|
validateInput() {
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
this.
|
|
127
|
-
let
|
|
128
|
-
this.hasAttribute("message")
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
208
|
+
const validState = this.input.validity;
|
|
209
|
+
this.invalid = false;
|
|
210
|
+
if (!validState.valid) {
|
|
211
|
+
for (let state in validState) {
|
|
212
|
+
const attr = `message-${state.toString()}`;
|
|
213
|
+
if (validState[state]) {
|
|
214
|
+
this.validationError = state.toString();
|
|
215
|
+
this.invalid = !this.pristine && !validState.valid;
|
|
216
|
+
let errorMessage = this.message;
|
|
217
|
+
if (!this.hasAttribute("message"))
|
|
218
|
+
errorMessage = this.hasAttribute(attr) ? this.getAttribute(attr) : this.input.validationMessage;
|
|
219
|
+
this.internals.setValidity(
|
|
220
|
+
{ [this.validationError]: true },
|
|
221
|
+
errorMessage
|
|
222
|
+
);
|
|
223
|
+
if (this.invalid && this.customErrorDisplay) {
|
|
224
|
+
this.dispatchEvent(new Event("invalid"));
|
|
225
|
+
}
|
|
132
226
|
}
|
|
133
227
|
}
|
|
228
|
+
} else {
|
|
229
|
+
this.internals.setValidity({});
|
|
230
|
+
this.pristine = false;
|
|
231
|
+
this.errorMessage.textContent = this.input.validationMessage;
|
|
232
|
+
}
|
|
134
233
|
}
|
|
135
|
-
hasSlot(
|
|
136
|
-
let
|
|
137
|
-
return
|
|
234
|
+
hasSlot(el, slotName = null) {
|
|
235
|
+
let selector = slotName ? `[slot="${slotName}"]` : "[slot]";
|
|
236
|
+
return el.querySelectorAll(selector).length > 0 ? true : false;
|
|
138
237
|
}
|
|
139
238
|
}
|
|
140
|
-
|
|
141
|
-
customElements.get("wj-input") || window.customElements.define("wj-input",
|
|
239
|
+
__publicField(Input, "formAssociated", true);
|
|
240
|
+
customElements.get("wj-input") || window.customElements.define("wj-input", Input);
|
|
142
241
|
export {
|
|
143
|
-
|
|
242
|
+
Input
|
|
144
243
|
};
|
package/dist/wj-item.js
CHANGED
|
@@ -1,30 +1,47 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
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";
|
|
5
8
|
import "./wj-store.js";
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
class p extends l {
|
|
9
|
+
const styles = '/*\n[ WJ Item ]\n*/\n:host {\n --wj-border-width: 0 0 1px 0;\n --wj-item-background: transparent;\n --wj-item-background-hover: var(--wj-color-contrast-3);\n --wj-item-padding-top: 0px;\n --wj-item-padding-bottom: 0px;\n --wj-item-padding-end: 0px;\n --wj-item-padding-start: 0px;\n --wj-item-inner-border-width: 0 0 1px 0;\n --wj-item-inner-padding-top: 0px;\n --wj-item-inner-padding-bottom: 0px;\n --wj-item-inner-padding-start: 0px;\n --wj-item-inner-padding-end: 0px;\n --wj-item-inner-box-shadow: none;\n --wj-item-min-height: 40px;\n --wj-item-transition: opacity 15ms linear, background-color 15ms linear;\n display: block;\n position: relative;\n align-items: center;\n justify-content: space-between;\n outline: none;\n color: var(--wj-item-color);\n text-align: initial;\n text-decoration: none;\n overflow: hidden;\n box-sizing: border-box;\n width: 100%;\n}\n\n.item-native {\n border-radius: var(--wj-item-border-radius);\n padding-top: var(--wj-item-padding-top);\n padding-bottom: var(--wj-item-padding-bottom);\n padding-inline: var(--wj-item-padding-start) var(--wj-item-padding-end);\n margin: 0;\n display: flex;\n position: relative;\n align-items: inherit;\n justify-content: inherit;\n width: 100%;\n min-height: var(--wj-item-min-height);\n transition: var(--wj-item-transition);\n outline: none;\n background: var(--wj-item-background);\n overflow: inherit;\n box-sizing: border-box;\n z-index: 1;\n text-decoration: none;\n color: var(--wj-item-color);\n}\n.item-native .item-inner {\n margin: 0;\n padding: var(--wj-item-inner-padding-top) var(--wj-item-inner-padding-end) var(--wj-item-inner-padding-bottom) var(--wj-item-inner-padding-start);\n display: flex;\n position: relative;\n flex: 1 1 0;\n flex-direction: inherit;\n align-items: inherit;\n align-self: stretch;\n min-height: inherit;\n border-width: var(--wj-border-width);\n border-style: var(--wj-border-style);\n border-color: var(--wj-border-color);\n box-shadow: var(--wj-item-inner-box-shadow);\n overflow: inherit;\n box-sizing: border-box;\n}\n.item-native .item-inner .input-wrapper {\n display: flex;\n flex: 1 1 0;\n flex-direction: inherit;\n align-items: inherit;\n align-self: stretch;\n text-overflow: ellipsis;\n overflow: inherit;\n box-sizing: border-box;\n}\n.item-native .item-bottom {\n padding: 0 var(--wj-item-inner-padding-end) 0 var(--wj-item-padding-start);\n display: flex;\n justify-content: space-between;\n}\n\n@media (any-hover: hover) {\n :host(:hover) .item-native {\n color: var(--wj-item-color);\n }\n :host(:hover) .item-native :after {\n transition: var(--wj-item-transition);\n z-index: -1;\n inset: 0;\n position: absolute;\n content: "";\n background: var(--wj-item-background-hover);\n opacity: 0.7;\n }\n}\nbutton,\na {\n cursor: pointer;\n user-select: none;\n -webkit-user-drag: none;\n}\n\n::slotted([slot=start]) {\n margin-inline: 0 1rem;\n}\n\n::slotted(wj-label:not([slot=end])) {\n flex: 1 1 0;\n}';
|
|
10
|
+
class Item extends WJElement {
|
|
9
11
|
constructor() {
|
|
10
12
|
super();
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
__publicField(this, "hostContext", (selector, el) => {
|
|
14
|
+
return el.closest(selector) !== null;
|
|
15
|
+
});
|
|
16
|
+
this.labelColorStyles = {};
|
|
17
|
+
this.itemStyles = /* @__PURE__ */ new Map();
|
|
18
|
+
this.inheritedAriaAttributes = {};
|
|
19
|
+
this.multipleInputs = false;
|
|
20
|
+
this.focusable = true;
|
|
21
|
+
this.button = false;
|
|
22
|
+
this.detailIcon = ``;
|
|
23
|
+
this.disabled = false;
|
|
24
|
+
this.counter = false;
|
|
25
|
+
this.routerDirection = "forward";
|
|
26
|
+
this.type = "button";
|
|
13
27
|
}
|
|
14
28
|
isClickable() {
|
|
15
29
|
return this.hasAttribute("href") || this.button;
|
|
16
30
|
}
|
|
17
31
|
static get cssStyleSheet() {
|
|
18
|
-
return
|
|
32
|
+
return styles;
|
|
19
33
|
}
|
|
20
34
|
setupAttributes() {
|
|
21
35
|
this.isShadowRoot = "open";
|
|
22
36
|
}
|
|
23
|
-
beforeDraw(
|
|
37
|
+
beforeDraw(context, store, params) {
|
|
24
38
|
}
|
|
25
|
-
draw(
|
|
26
|
-
const
|
|
27
|
-
|
|
39
|
+
draw(context, store, params) {
|
|
40
|
+
const TagType = this.isClickable() ? this.hasAttribute("href") === void 0 ? "button" : "a" : "div";
|
|
41
|
+
if (this.hostContext("wj-list", this)) {
|
|
42
|
+
this.classList.add("wj-item-list");
|
|
43
|
+
}
|
|
44
|
+
return `<${TagType} class="item-native" part="native">
|
|
28
45
|
<slot name="start"></slot>
|
|
29
46
|
<div class="item-inner">
|
|
30
47
|
<div class="input-wrapper">
|
|
@@ -33,14 +50,14 @@ class p extends l {
|
|
|
33
50
|
<slot name="end"></slot>
|
|
34
51
|
</div>
|
|
35
52
|
<div class="item-highlight"></div>
|
|
36
|
-
</${
|
|
53
|
+
</${TagType}>
|
|
37
54
|
<div class="item-bottom">
|
|
38
55
|
<slot name="error"></slot>
|
|
39
56
|
<slot name="helper"></slot>
|
|
40
57
|
</div>`;
|
|
41
58
|
}
|
|
42
59
|
}
|
|
43
|
-
customElements.get("wj-item") || window.customElements.define("wj-item",
|
|
60
|
+
customElements.get("wj-item") || window.customElements.define("wj-item", Item);
|
|
44
61
|
export {
|
|
45
|
-
|
|
62
|
+
Item
|
|
46
63
|
};
|
package/dist/wj-label.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
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";
|
|
5
8
|
import "./wj-store.js";
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
*/:host(.wj-color-primary){--wj-color: #7252D3 !important}:host(.wj-color-complete){--wj-color: #0072EC !important}:host(.wj-color-success){--wj-color-base: #19AD79 !important;--wj-color-contrast: #fff !important}:host(.wj-color-warning){--wj-color-base: #FFd945 !important;--wj-color-contrast: #4b4b4b !important}:host(.wj-color-danger){--wj-color-base: #D83C31 !important;--wj-color-contrast: #fff !important}:host(.wj-color-info){--wj-color-base: #3B4752 !important;--wj-color-contrast: #fff !important}:host(.wj-color-menu){--wj-color-base: #2b303b !important;--wj-color-contrast: #fff !important}:host{--wj-color: initial;display:block;font-size:inherit;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;box-sizing:border-box}:host(.wj-color){color:var(--wj-color-base)}:host(.wj-text-wrap),:host([text-wrap]){white-space:normal!important}:host(.label-fixed){flex:0 0 100px;width:100px;min-width:100px;max-width:200px}:host(.label-stacked),:host(.label-floating){margin:0;align-self:stretch;width:auto;max-width:100%}:host(.label-no-animate.label-floating){transition:none}::slotted(*) h1,::slotted(*) h2,::slotted(*) h3,::slotted(*) h4,::slotted(*) h5,::slotted(*) h6{text-overflow:inherit;overflow:inherit}:host(.wj-color){color:var(--wj-color)}::slotted(*:first-child){margin-top:0!important}::slotted(*:last-child){margin-bottom:0!important}
|
|
9
|
-
`;
|
|
10
|
-
class h extends w {
|
|
9
|
+
const styles = "/*!\n* direction.scss\n*/\n/* Skeleton Variables */\n:host(.wj-color-primary) {\n --wj-color: #7252D3 !important;\n}\n:host(.wj-color-complete) {\n --wj-color: #0072EC !important;\n}\n:host(.wj-color-success) {\n --wj-color-base: #19AD79 !important;\n --wj-color-contrast: #fff !important;\n}\n:host(.wj-color-warning) {\n --wj-color-base: #FFd945 !important;\n --wj-color-contrast: #4b4b4b !important;\n}\n:host(.wj-color-danger) {\n --wj-color-base: #D83C31 !important;\n --wj-color-contrast: #fff !important;\n}\n:host(.wj-color-info) {\n --wj-color-base: #3B4752 !important;\n --wj-color-contrast: #fff !important;\n}\n:host(.wj-color-menu) {\n --wj-color-base: #2b303b !important;\n --wj-color-contrast: #fff !important;\n}\n:host {\n --wj-color: initial;\n display: block;\n font-size: inherit;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n box-sizing: border-box;\n}\n:host(.wj-color) {\n color: var(--wj-color-base);\n}\n:host(.wj-text-wrap),\n:host([text-wrap]) {\n white-space: normal !important;\n}\n:host(.label-fixed) {\n flex: 0 0 100px;\n width: 100px;\n min-width: 100px;\n max-width: 200px;\n}\n:host(.label-stacked),\n:host(.label-floating) {\n margin: 0;\n align-self: stretch;\n width: auto;\n max-width: 100%;\n}\n:host(.label-no-animate.label-floating) {\n transition: none;\n}\n::slotted(*) h1,\n::slotted(*) h2,\n::slotted(*) h3,\n::slotted(*) h4,\n::slotted(*) h5,\n::slotted(*) h6 {\n text-overflow: inherit;\n overflow: inherit;\n}\n:host(.wj-color) {\n color: var(--wj-color);\n}\n::slotted(*:first-child) {\n margin-top: 0 !important;\n}\n::slotted(*:last-child) {\n margin-bottom: 0 !important;\n}";
|
|
10
|
+
class Label extends WJElement {
|
|
11
11
|
constructor() {
|
|
12
12
|
super();
|
|
13
|
-
|
|
13
|
+
__publicField(this, "className", "Label");
|
|
14
14
|
}
|
|
15
15
|
static get cssStyleSheet() {
|
|
16
|
-
return
|
|
16
|
+
return styles;
|
|
17
17
|
}
|
|
18
18
|
static get observedAttributes() {
|
|
19
19
|
return [];
|
|
@@ -21,16 +21,18 @@ class h extends w {
|
|
|
21
21
|
setupAttributes() {
|
|
22
22
|
this.isShadowRoot = "open";
|
|
23
23
|
}
|
|
24
|
-
beforeDraw(
|
|
24
|
+
beforeDraw(context, store, params) {
|
|
25
25
|
}
|
|
26
|
-
draw(
|
|
27
|
-
let
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
draw(context, store, params) {
|
|
27
|
+
let fragment = document.createDocumentFragment();
|
|
28
|
+
if (this.color)
|
|
29
|
+
this.classList.add("wj-color-" + params.color, "wj-color");
|
|
30
|
+
let element = document.createElement("slot");
|
|
31
|
+
fragment.appendChild(element);
|
|
32
|
+
return fragment;
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
|
-
customElements.get("wj-label") || window.customElements.define("wj-label",
|
|
35
|
+
customElements.get("wj-label") || window.customElements.define("wj-label", Label);
|
|
34
36
|
export {
|
|
35
|
-
|
|
37
|
+
Label
|
|
36
38
|
};
|