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-master.js
CHANGED
|
@@ -1,140 +1,145 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
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, { WjElementUtils, event } from "./wj-element.js";
|
|
8
|
+
import { defaultStoreActions, store } from "./wj-store.js";
|
|
9
|
+
import { b, w } from "./router-links-26e4a166.js";
|
|
10
|
+
import { fetchAndParseCSS } from "./wj-fetchAndParseCSS.js";
|
|
11
|
+
import { L as Localizer } from "./localize-20081fd1.js";
|
|
12
|
+
import { Aside } from "./wj-aside.js";
|
|
13
|
+
import { Animation } from "./wj-animation.js";
|
|
14
|
+
import { Avatar } from "./wj-avatar.js";
|
|
15
|
+
import { Badge } from "./wj-badge.js";
|
|
16
|
+
import { Breadcrumb } from "./wj-breadcrumb.js";
|
|
17
|
+
import { Breadcrumbs } from "./wj-breadcrumbs.js";
|
|
18
|
+
import { Button } from "./wj-button.js";
|
|
19
|
+
import { ButtonGroup } from "./wj-button-group.js";
|
|
20
|
+
import { Card } from "./wj-card.js";
|
|
21
|
+
import { CardContent } from "./wj-card-content.js";
|
|
22
|
+
import { CardControls } from "./wj-card-controls.js";
|
|
23
|
+
import { CardHeader } from "./wj-card-header.js";
|
|
24
|
+
import { CardSubtitle } from "./wj-card-subtitle.js";
|
|
25
|
+
import { CardTitle } from "./wj-card-title.js";
|
|
26
|
+
import { Carousel } from "./wj-carousel.js";
|
|
27
|
+
import { CarouselItem } from "./wj-carousel-item.js";
|
|
28
|
+
import { Checkbox } from "./wj-checkbox.js";
|
|
29
|
+
import { Chip } from "./wj-chip.js";
|
|
30
|
+
import { Col } from "./wj-col.js";
|
|
31
|
+
import { ColorPicker } from "./wj-color-picker.js";
|
|
32
|
+
import { Container } from "./wj-container.js";
|
|
33
|
+
import { CopyButton } from "./wj-copy-button.js";
|
|
34
|
+
import { Dialog } from "./wj-dialog.js";
|
|
35
|
+
import { Divider } from "./wj-divider.js";
|
|
36
|
+
import { Dropdown } from "./wj-dropdown.js";
|
|
37
|
+
import { FileUpload } from "./wj-file-upload.js";
|
|
38
|
+
import { FileUploadItem } from "./wj-file-upload-item.js";
|
|
39
|
+
import { Footer } from "./wj-footer.js";
|
|
40
|
+
import { FormatDigital } from "./wj-format-digital.js";
|
|
41
|
+
import { Grid } from "./wj-grid.js";
|
|
42
|
+
import { Header } from "./wj-header.js";
|
|
43
|
+
import { Icon } from "./wj-icon.js";
|
|
44
|
+
import { IconPicker } from "./wj-icon-picker.js";
|
|
45
|
+
import { Img } from "./wj-img.js";
|
|
46
|
+
import { ImgComparer } from "./wj-img-comparer.js";
|
|
47
|
+
import { InfiniteScroll } from "./wj-infinite-scroll.js";
|
|
48
|
+
import { Input } from "./wj-input.js";
|
|
49
|
+
import { InputFile } from "./wj-input-file.js";
|
|
50
|
+
import { Item } from "./wj-item.js";
|
|
51
|
+
import { Label } from "./wj-label.js";
|
|
52
|
+
import { List } from "./wj-list.js";
|
|
53
|
+
import { Main } from "./wj-main.js";
|
|
54
|
+
import { Masonry } from "./wj-masonry.js";
|
|
55
|
+
import { Menu } from "./wj-menu.js";
|
|
56
|
+
import { MenuButton } from "./wj-menu-button.js";
|
|
57
|
+
import { MenuItem } from "./wj-menu-item.js";
|
|
58
|
+
import { MenuLabel } from "./wj-menu-label.js";
|
|
59
|
+
import { Popup } from "./wj-popup.js";
|
|
60
|
+
import { ProgressBar } from "./wj-progress-bar.js";
|
|
61
|
+
import { Radio } from "./wj-radio.js";
|
|
62
|
+
import { RadioGroup } from "./wj-radio-group.js";
|
|
63
|
+
import { Rate } from "./wj-rate.js";
|
|
64
|
+
import { RelativeTime } from "./wj-relative-time.js";
|
|
65
|
+
import { Route } from "./wj-route.js";
|
|
66
|
+
import { Routerx } from "./wj-routerx.js";
|
|
67
|
+
import { RouterLink } from "./wj-router-link.js";
|
|
65
68
|
import "./wj-router-outlet.js";
|
|
66
|
-
import { Row
|
|
67
|
-
import { Slider
|
|
68
|
-
import { SplitView
|
|
69
|
-
import { Textarea
|
|
70
|
-
import { Thumbnail
|
|
71
|
-
import { Toast
|
|
72
|
-
import { Toggle
|
|
73
|
-
import { Toolbar
|
|
74
|
-
import { ToolbarAction
|
|
75
|
-
import { Tooltip
|
|
76
|
-
import { VisuallyHidden
|
|
77
|
-
const
|
|
69
|
+
import { Row } from "./wj-row.js";
|
|
70
|
+
import { Slider } from "./wj-slider.js";
|
|
71
|
+
import { SplitView } from "./wj-split-view.js";
|
|
72
|
+
import { Textarea } from "./wj-textarea.js";
|
|
73
|
+
import { Thumbnail } from "./wj-thumbnail.js";
|
|
74
|
+
import { Toast } from "./wj-toast.js";
|
|
75
|
+
import { Toggle } from "./wj-toggle.js";
|
|
76
|
+
import { Toolbar } from "./wj-toolbar.js";
|
|
77
|
+
import { ToolbarAction } from "./wj-toolbar-action.js";
|
|
78
|
+
import { Tooltip } from "./wj-tooltip.js";
|
|
79
|
+
import { VisuallyHidden } from "./wj-visually-hidden.js";
|
|
80
|
+
const light = "";
|
|
81
|
+
const dark = "";
|
|
82
|
+
const sk = {
|
|
78
83
|
code: "sk",
|
|
79
84
|
name: "Slovak",
|
|
80
85
|
dir: "ltr",
|
|
81
|
-
welcome: "Vitajte",
|
|
86
|
+
"welcome": "Vitajte",
|
|
82
87
|
"wj.file.upload.button": "Vybrať súbor",
|
|
83
88
|
"wj.file.upload.uploaded": "Nahraných: ",
|
|
84
89
|
"wj.file.upload.from": "z"
|
|
85
90
|
};
|
|
86
|
-
|
|
87
|
-
const
|
|
91
|
+
Localizer.registerTranslation(sk);
|
|
92
|
+
const en = {
|
|
88
93
|
code: "en",
|
|
89
94
|
name: "English",
|
|
90
95
|
dir: "ltr",
|
|
91
|
-
welcome: "Welcome",
|
|
96
|
+
"welcome": "Welcome",
|
|
92
97
|
"wj.file.upload.button": "Browse files",
|
|
93
98
|
"wj.file.upload.uploaded": "Uploaded: ",
|
|
94
99
|
"wj.file.upload.from": "from"
|
|
95
100
|
};
|
|
96
|
-
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
class k extends u {
|
|
101
|
+
Localizer.registerTranslation(en);
|
|
102
|
+
const styles$7 = "/*\n[ WJ Example Element ]\n*/\n:host {\n color: red;\n}";
|
|
103
|
+
class ExampleElement extends WJElement {
|
|
100
104
|
constructor() {
|
|
101
105
|
super();
|
|
102
|
-
|
|
106
|
+
__publicField(this, "className", "ExampleElement");
|
|
103
107
|
}
|
|
104
108
|
static get cssStyleSheet() {
|
|
105
|
-
return
|
|
109
|
+
return styles$7;
|
|
106
110
|
}
|
|
107
111
|
static get observedAttributes() {
|
|
108
112
|
return [];
|
|
109
113
|
}
|
|
110
114
|
setupAttributes() {
|
|
111
|
-
this.isShadowRoot = "open"
|
|
112
|
-
|
|
115
|
+
this.isShadowRoot = "open";
|
|
116
|
+
WjElementUtils.setAttributesToElement(this, {
|
|
117
|
+
"test": "test"
|
|
113
118
|
});
|
|
114
119
|
}
|
|
115
|
-
beforeDraw(
|
|
120
|
+
beforeDraw(context, store2, params) {
|
|
116
121
|
}
|
|
117
|
-
draw(
|
|
118
|
-
console.log(
|
|
119
|
-
let
|
|
120
|
-
|
|
122
|
+
draw(context, store2, params) {
|
|
123
|
+
console.log(context, store2, params);
|
|
124
|
+
let fragment = document.createDocumentFragment();
|
|
125
|
+
let element = document.createElement("div");
|
|
126
|
+
element.innerHTML = params.text;
|
|
127
|
+
fragment.appendChild(element);
|
|
128
|
+
return fragment;
|
|
121
129
|
}
|
|
122
|
-
afterDraw(
|
|
130
|
+
afterDraw(context, store2, params) {
|
|
123
131
|
console.log("afterDraw", this.params);
|
|
124
132
|
}
|
|
125
133
|
}
|
|
126
|
-
customElements.get("wj-example-element") || window.customElements.define("wj-example-element",
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
*/:host{display:inline-block}:host .native-button-group{display:flex;flex-wrap:nowrap;line-height:1}:host slot{display:contents}::slotted(wj-button){margin:0}
|
|
130
|
-
`;
|
|
131
|
-
class O extends u {
|
|
134
|
+
customElements.get("wj-example-element") || window.customElements.define("wj-example-element", ExampleElement);
|
|
135
|
+
const styles$6 = "/*!\n* direction.scss\n*/\n/* Skeleton Variables */\n/*\n[ Button Group ]\n*/\n:host {\n display: inline-block;\n}\n:host .native-button-group {\n display: flex;\n flex-wrap: nowrap;\n line-height: 1;\n}\n:host slot {\n display: contents;\n}\n::slotted(wj-button) {\n margin: 0;\n}";
|
|
136
|
+
class NavMenu extends WJElement {
|
|
132
137
|
constructor() {
|
|
133
138
|
super();
|
|
134
|
-
|
|
139
|
+
__publicField(this, "className", "ButtonGroup");
|
|
135
140
|
}
|
|
136
141
|
static get cssStyleSheet() {
|
|
137
|
-
return
|
|
142
|
+
return styles$6;
|
|
138
143
|
}
|
|
139
144
|
static get observedAttributes() {
|
|
140
145
|
return [];
|
|
@@ -142,30 +147,35 @@ class O extends u {
|
|
|
142
147
|
setupAttributes() {
|
|
143
148
|
this.isShadowRoot = "open";
|
|
144
149
|
}
|
|
145
|
-
draw(
|
|
146
|
-
let
|
|
147
|
-
|
|
150
|
+
draw(context, store2, params) {
|
|
151
|
+
let fragment = document.createDocumentFragment();
|
|
152
|
+
let element = document.createElement("div");
|
|
153
|
+
element.classList.add("native-button-group");
|
|
154
|
+
element.setAttribute("part", "native");
|
|
155
|
+
this.slotElement = document.createElement("slot");
|
|
156
|
+
element.appendChild(this.slotElement);
|
|
157
|
+
fragment.appendChild(element);
|
|
158
|
+
return fragment;
|
|
148
159
|
}
|
|
149
160
|
}
|
|
150
|
-
customElements.get("wj-button-group") || window.customElements.define("wj-button-group",
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
class R extends u {
|
|
161
|
+
customElements.get("wj-button-group") || window.customElements.define("wj-button-group", NavMenu);
|
|
162
|
+
const styles$5 = "/*\n[ WJ Option ]\n*/\n:host {\n --wj-option-padding-top: .5rem;\n --wj-option-padding-bottom: .5rem;\n --wj-option-highlighted: var(--wj-color-contrast-3);\n display: block;\n}\n:host wj-icon {\n visibility: hidden;\n margin-inline: 0.5rem;\n}\n\n:host([selected]) wj-icon {\n visibility: visible;\n}\n\n.native-option {\n display: flex;\n align-items: center;\n padding-top: var(--wj-option-padding-top);\n padding-bottom: var(--wj-option-padding-bottom);\n}\n\n.native-option:hover {\n background-color: var(--wj-option-highlighted);\n}\n\n::slotted([slot=start]) {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n margin-inline-end: 0.5rem;\n}\n\n::slotted([slot=end]) {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n margin-inline: auto 0.5rem;\n}";
|
|
163
|
+
class Option extends WJElement {
|
|
154
164
|
constructor() {
|
|
155
165
|
super();
|
|
156
|
-
|
|
166
|
+
__publicField(this, "className", "Option");
|
|
157
167
|
}
|
|
158
|
-
set selected(
|
|
159
|
-
return
|
|
168
|
+
set selected(value) {
|
|
169
|
+
return value ? this.setAttribute("selected", "") : this.removeAttribute("selected");
|
|
160
170
|
}
|
|
161
|
-
set value(
|
|
162
|
-
this.setAttribute("value",
|
|
171
|
+
set value(value) {
|
|
172
|
+
this.setAttribute("value", value);
|
|
163
173
|
}
|
|
164
|
-
set text(
|
|
165
|
-
this.innerText =
|
|
174
|
+
set text(value) {
|
|
175
|
+
this.innerText = value;
|
|
166
176
|
}
|
|
167
177
|
static get cssStyleSheet() {
|
|
168
|
-
return
|
|
178
|
+
return styles$5;
|
|
169
179
|
}
|
|
170
180
|
static get observedAttributes() {
|
|
171
181
|
return [];
|
|
@@ -173,25 +183,34 @@ class R extends u {
|
|
|
173
183
|
setupAttributes() {
|
|
174
184
|
this.isShadowRoot = "open";
|
|
175
185
|
}
|
|
176
|
-
draw(
|
|
177
|
-
let
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
let
|
|
182
|
-
|
|
183
|
-
let
|
|
184
|
-
|
|
186
|
+
draw(context, store2, params) {
|
|
187
|
+
let fragment = document.createDocumentFragment();
|
|
188
|
+
let element = document.createElement("div");
|
|
189
|
+
element.classList.add("native-option");
|
|
190
|
+
element.setAttribute("part", "native");
|
|
191
|
+
let icon = document.createElement("wj-icon");
|
|
192
|
+
icon.setAttribute("name", "check");
|
|
193
|
+
let start = document.createElement("slot");
|
|
194
|
+
start.setAttribute("name", "start");
|
|
195
|
+
let slot = document.createElement("slot");
|
|
196
|
+
let end = document.createElement("slot");
|
|
197
|
+
end.setAttribute("name", "end");
|
|
198
|
+
element.appendChild(icon);
|
|
199
|
+
element.appendChild(start);
|
|
200
|
+
element.appendChild(slot);
|
|
201
|
+
element.appendChild(end);
|
|
202
|
+
fragment.appendChild(element);
|
|
203
|
+
return fragment;
|
|
185
204
|
}
|
|
186
205
|
afterDraw() {
|
|
187
|
-
|
|
206
|
+
event.addListener(this, "click", "wj:option-change");
|
|
188
207
|
}
|
|
189
208
|
}
|
|
190
|
-
customElements.get("wj-option") || window.customElements.define("wj-option",
|
|
191
|
-
class
|
|
209
|
+
customElements.get("wj-option") || window.customElements.define("wj-option", Option);
|
|
210
|
+
class Options extends WJElement {
|
|
192
211
|
constructor() {
|
|
193
212
|
super();
|
|
194
|
-
|
|
213
|
+
__publicField(this, "className", "Options");
|
|
195
214
|
}
|
|
196
215
|
static get cssStyleSheet() {
|
|
197
216
|
return styles;
|
|
@@ -204,52 +223,66 @@ class z extends u {
|
|
|
204
223
|
}
|
|
205
224
|
async beforeDraw() {
|
|
206
225
|
this.response = await this.getPages();
|
|
207
|
-
let
|
|
208
|
-
this.response.forEach((
|
|
209
|
-
let
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
226
|
+
let fragment = document.createDocumentFragment();
|
|
227
|
+
this.response.forEach((item, index) => {
|
|
228
|
+
let option = document.createElement("wj-option");
|
|
229
|
+
option.setAttribute("value", item[this.itemValue] || item.value);
|
|
230
|
+
option.innerText = item[this.itemText] || item.text;
|
|
231
|
+
fragment.appendChild(option);
|
|
232
|
+
});
|
|
233
|
+
this.parentElement.appendChild(fragment);
|
|
234
|
+
event.dispatchCustomEvent(this, "wj:options-load", {});
|
|
235
|
+
}
|
|
236
|
+
async getPages(page) {
|
|
237
|
+
const response = await fetch(this.url);
|
|
238
|
+
if (!response.ok) {
|
|
239
|
+
throw new Error(`An error occurred: ${response.status}`);
|
|
240
|
+
}
|
|
241
|
+
return await response.json();
|
|
218
242
|
}
|
|
219
243
|
}
|
|
220
|
-
customElements.get("wj-options") || window.customElements.define("wj-options",
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
class M extends u {
|
|
244
|
+
customElements.get("wj-options") || window.customElements.define("wj-options", Options);
|
|
245
|
+
const styles$4 = "/*\n[ WJ Select ]\n*/\n:host {\n --wj-select-border-width: 1px;\n --wj-select-border-style: solid;\n --wj-select-border-color: var(--wj-border-color);\n --wj-select-options-border-width: 1px;\n --wj-select-options-border-style: var(--wj-border-style);\n --wj-select-options-border-color: var(--wj-border-color);\n --wj-select-background: var(--wj-background);\n --wj-select-line-height: 20px;\n --wj-select-color: var(--wj-color);\n --wj-select-border-radius: var(--wj-border-radius-medium);\n width: 100%;\n display: block;\n}\n:host [slot=arrow] {\n transform: rotate(0deg);\n transition: all 0.2s ease-in;\n}\n\n.native-select.default .wrapper {\n display: block;\n border-width: var(--wj-select-border-width);\n border-style: var(--wj-select-border-style);\n border-color: var(--wj-select-border-color);\n border-radius: var(--wj-select-border-radius);\n padding-inline: 0.5rem;\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n}\n.native-select.default .input-wrapper {\n padding: 0;\n min-height: 25px;\n margin-top: -4px;\n}\n.native-select.default.focused wj-label {\n opacity: 0.67;\n font-size: 12px;\n letter-spacing: normal;\n}\n.native-select.default wj-label {\n margin: 0;\n display: block;\n opacity: 1;\n cursor: text;\n transition: opacity 0.2s ease 0s;\n line-height: var(--wj-select-line-height);\n}\n.native-select.default wj-label.fade {\n opacity: 0.5;\n font-size: 12px;\n letter-spacing: normal;\n}\n.native-select.standard .input-wrapper {\n border-width: var(--wj-select-border-width);\n border-style: var(--wj-select-border-style);\n border-color: var(--wj-select-border-color);\n border-radius: var(--wj-select-border-radius);\n width: 100%;\n}\n\n.wrapper {\n display: flex;\n width: 100%;\n}\n\n.input-wrapper {\n display: grid;\n grid-template-columns: 1fr auto auto;\n align-items: center;\n background-color: var(--wj-select-background);\n min-height: 28px;\n color: var(--wj-select-color);\n line-height: var(--wj-select-line-height);\n appearance: none;\n padding: 2px 0.5rem;\n font-size: 14px;\n font-weight: normal;\n vertical-align: middle;\n}\n\ninput {\n border: medium;\n height: 25px;\n min-height: 25px;\n padding: 0;\n background: none;\n box-shadow: none;\n width: 100%;\n outline: 0;\n}\n\n::placeholder {\n opacity: 1;\n}\n\n:host [active] .input-wrapper {\n border-radius: var(--wj-select-border-radius) var(--wj-select-border-radius) 0 0;\n}\n:host [active] [slot=arrow] {\n transform: rotate(180deg);\n transition: all 0.2s ease-in;\n}\n\n.option-wrapper {\n border-width: var(--wj-select-options-border-width);\n border-style: var(--wj-select-options-border-style);\n border-color: var(--wj-select-options-border-color);\n border-radius: 0 0 var(--wj-select-border-radius) var(--wj-select-border-radius);\n margin-top: -1px;\n background: var(--wj-select-background);\n overflow: auto;\n}\n\n:host([multiple]) input {\n position: absolute;\n z-index: -1;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n opacity: 0;\n}\n\n:host([multiple]) .chips {\n display: flex;\n flex: 1;\n align-items: center;\n flex-wrap: wrap;\n}\n\n:host([disabled]) .input-wrapper {\n opacity: 0.5;\n pointer-events: none;\n cursor: not-allowed;\n}\n\n.counter {\n padding-inline: 0.5rem;\n}\n\nwj-chip {\n --wj-chip-margin: 0 .25rem 0 0;\n}\n\nwj-button {\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}";
|
|
246
|
+
class Select extends WJElement {
|
|
224
247
|
constructor() {
|
|
225
248
|
super();
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
let
|
|
229
|
-
this.hasAttribute("multiple")
|
|
230
|
-
|
|
231
|
-
|
|
249
|
+
__publicField(this, "className", "Select");
|
|
250
|
+
__publicField(this, "optionChange", (e) => {
|
|
251
|
+
let allOptions = this.getAllOptions();
|
|
252
|
+
if (!this.hasAttribute("multiple")) {
|
|
253
|
+
allOptions.forEach((option) => {
|
|
254
|
+
option.selected = false;
|
|
255
|
+
option.removeAttribute("selected");
|
|
256
|
+
});
|
|
257
|
+
this.popup.removeAttribute("active");
|
|
258
|
+
}
|
|
259
|
+
e.target.selected = !e.target.hasAttribute("selected");
|
|
260
|
+
this.selections(e.target);
|
|
232
261
|
});
|
|
233
|
-
|
|
234
|
-
let
|
|
235
|
-
|
|
262
|
+
__publicField(this, "removeChip", (e) => {
|
|
263
|
+
let option = e.target.option;
|
|
264
|
+
option.selected = false;
|
|
265
|
+
option.removeAttribute("selected");
|
|
266
|
+
e.target.parentNode.removeChild(e.target);
|
|
267
|
+
this.selections(null, 0);
|
|
236
268
|
});
|
|
237
|
-
this._selected = []
|
|
269
|
+
this._selected = [];
|
|
270
|
+
this.counterEl = null;
|
|
238
271
|
}
|
|
239
|
-
set selected(
|
|
240
|
-
this._selected =
|
|
272
|
+
set selected(value) {
|
|
273
|
+
this._selected = value;
|
|
241
274
|
}
|
|
242
275
|
get selected() {
|
|
243
276
|
return this.getSelected();
|
|
244
277
|
}
|
|
245
|
-
set trigger(
|
|
246
|
-
this.setAttribute("trigger",
|
|
278
|
+
set trigger(value) {
|
|
279
|
+
this.setAttribute("trigger", value);
|
|
247
280
|
}
|
|
248
281
|
get trigger() {
|
|
249
282
|
return this.getAttribute("trigger") || "click";
|
|
250
283
|
}
|
|
251
284
|
static get cssStyleSheet() {
|
|
252
|
-
return
|
|
285
|
+
return styles$4;
|
|
253
286
|
}
|
|
254
287
|
static get observedAttributes() {
|
|
255
288
|
return ["active", "value"];
|
|
@@ -257,42 +290,97 @@ class M extends u {
|
|
|
257
290
|
setupAttributes() {
|
|
258
291
|
this.isShadowRoot = "open";
|
|
259
292
|
}
|
|
260
|
-
draw(
|
|
261
|
-
let
|
|
293
|
+
draw(context, store2, params) {
|
|
294
|
+
let fragment = document.createDocumentFragment();
|
|
262
295
|
this.classList.add("wj-placement", "wj-" + this.placement || "wj-start");
|
|
263
|
-
let
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
let
|
|
270
|
-
|
|
271
|
-
let
|
|
272
|
-
|
|
273
|
-
let
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
let
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
+
let native = document.createElement("div");
|
|
297
|
+
native.setAttribute("part", "native");
|
|
298
|
+
native.classList.add("native-select", this.variant || "default");
|
|
299
|
+
let wrapper = document.createElement("div");
|
|
300
|
+
wrapper.classList.add("wrapper");
|
|
301
|
+
wrapper.setAttribute("slot", "anchor");
|
|
302
|
+
let label = document.createElement("wj-label");
|
|
303
|
+
label.innerText = this.label || "";
|
|
304
|
+
let inputWrapper = document.createElement("div");
|
|
305
|
+
inputWrapper.classList.add("input-wrapper");
|
|
306
|
+
let input = document.createElement("input");
|
|
307
|
+
input.setAttribute("type", "text");
|
|
308
|
+
input.setAttribute("part", "input");
|
|
309
|
+
input.setAttribute("autocomplete", "off");
|
|
310
|
+
input.setAttribute("readonly", "");
|
|
311
|
+
input.setAttribute("placeholder", this.placeholder || "");
|
|
312
|
+
let arrow = document.createElement("wj-icon");
|
|
313
|
+
arrow.setAttribute("name", "chevron-down");
|
|
314
|
+
arrow.setAttribute("slot", "arrow");
|
|
315
|
+
let chips = document.createElement("div");
|
|
316
|
+
chips.classList.add("chips");
|
|
317
|
+
chips.innerText = this.placeholder || "";
|
|
318
|
+
let optionsWrapper = document.createElement("div");
|
|
319
|
+
optionsWrapper.classList.add("option-wrapper");
|
|
320
|
+
optionsWrapper.style.setProperty("height", this.maxHeight || "auto");
|
|
321
|
+
let slot = document.createElement("slot");
|
|
322
|
+
let clear = document.createElement("wj-button");
|
|
323
|
+
clear.setAttribute("fill", "link");
|
|
324
|
+
clear.setAttribute("part", "clear");
|
|
325
|
+
let clearIcon = document.createElement("wj-icon");
|
|
326
|
+
clearIcon.setAttribute("name", "x");
|
|
327
|
+
clear.appendChild(clearIcon);
|
|
328
|
+
let popup = document.createElement("wj-popup");
|
|
329
|
+
popup.setAttribute("placement", "bottom-start");
|
|
330
|
+
popup.setAttribute("manual", "");
|
|
331
|
+
popup.setAttribute("size", "");
|
|
332
|
+
if (this.hasAttribute("disabled"))
|
|
333
|
+
popup.setAttribute("disabled", "");
|
|
334
|
+
if (this.variant === "standard") {
|
|
335
|
+
if (this.hasAttribute("label"))
|
|
336
|
+
native.appendChild(label);
|
|
337
|
+
} else {
|
|
338
|
+
wrapper.appendChild(label);
|
|
339
|
+
}
|
|
340
|
+
inputWrapper.appendChild(input);
|
|
341
|
+
if (this.hasAttribute("multiple"))
|
|
342
|
+
inputWrapper.appendChild(chips);
|
|
343
|
+
if (this.hasAttribute("clearable"))
|
|
344
|
+
inputWrapper.appendChild(clear);
|
|
345
|
+
inputWrapper.appendChild(arrow);
|
|
346
|
+
optionsWrapper.appendChild(slot);
|
|
347
|
+
wrapper.appendChild(inputWrapper);
|
|
348
|
+
popup.appendChild(wrapper);
|
|
349
|
+
popup.appendChild(optionsWrapper);
|
|
350
|
+
if (this.trigger === "click")
|
|
351
|
+
popup.setAttribute("manual", "");
|
|
352
|
+
native.appendChild(popup);
|
|
353
|
+
this.native = native;
|
|
354
|
+
this.popup = popup;
|
|
355
|
+
this.labelElement = label;
|
|
356
|
+
this.input = input;
|
|
357
|
+
this.optionsWrapper = optionsWrapper;
|
|
358
|
+
this.chips = chips;
|
|
359
|
+
this.clear = clear;
|
|
360
|
+
fragment.appendChild(native);
|
|
361
|
+
return fragment;
|
|
362
|
+
}
|
|
363
|
+
afterDraw(context, store2, params) {
|
|
364
|
+
this.input.addEventListener("focus", (e) => {
|
|
365
|
+
this.labelElement.classList.add("fade");
|
|
366
|
+
this.native.classList.add("focused");
|
|
367
|
+
});
|
|
368
|
+
this.input.addEventListener("blur", (e) => {
|
|
369
|
+
this.native.classList.remove("focused");
|
|
370
|
+
if (!e.target.value)
|
|
371
|
+
this.labelElement.classList.remove("fade");
|
|
372
|
+
});
|
|
373
|
+
this.addEventListener("wj:option-change", this.optionChange);
|
|
374
|
+
this.clear.addEventListener("wj:button-click", (e) => {
|
|
375
|
+
this.getAllOptions().forEach((option) => {
|
|
376
|
+
option.selected = false;
|
|
377
|
+
option.removeAttribute("selected");
|
|
378
|
+
});
|
|
379
|
+
this.selections();
|
|
380
|
+
e.stopPropagation();
|
|
381
|
+
});
|
|
382
|
+
this.selections();
|
|
383
|
+
this.optionsWrapper.addEventListener("wj:options-load", (e) => {
|
|
296
384
|
this.optionsWrapper.scrollTo(0, 0);
|
|
297
385
|
});
|
|
298
386
|
}
|
|
@@ -302,107 +390,160 @@ class M extends u {
|
|
|
302
390
|
getSelectedOptions() {
|
|
303
391
|
return this.querySelectorAll("wj-option[selected]");
|
|
304
392
|
}
|
|
305
|
-
getSelected(
|
|
306
|
-
let
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
393
|
+
getSelected(option) {
|
|
394
|
+
let selectedOptions = this.getSelectedOptions();
|
|
395
|
+
selectedOptions = Array.isArray(selectedOptions) ? selectedOptions : Array.from(selectedOptions);
|
|
396
|
+
selectedOptions = selectedOptions.map((option2) => {
|
|
397
|
+
return {
|
|
398
|
+
value: option2.value,
|
|
399
|
+
text: option2.textContent.trim()
|
|
400
|
+
};
|
|
401
|
+
});
|
|
402
|
+
return selectedOptions;
|
|
403
|
+
}
|
|
404
|
+
selectionChanged(option = null, length = 0) {
|
|
405
|
+
if (this.hasAttribute("multiple")) {
|
|
406
|
+
this.value = this.selectedOptions.map((el) => el).reverse();
|
|
407
|
+
if (this.placeholder && length === 0) {
|
|
408
|
+
this.chips.innerHTML = this.placeholder;
|
|
409
|
+
this.input.value = "";
|
|
410
|
+
} else {
|
|
411
|
+
if (this.counterEl instanceof HTMLElement || length > +this.maxOptions) {
|
|
412
|
+
this.counter();
|
|
413
|
+
} else {
|
|
414
|
+
if (option != null)
|
|
415
|
+
this.chips.appendChild(this.getChip(option));
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
} else {
|
|
419
|
+
let value = (option == null ? void 0 : option.textContent.trim()) || "";
|
|
420
|
+
this.value = value;
|
|
421
|
+
this.input.value = value;
|
|
318
422
|
}
|
|
319
423
|
}
|
|
320
|
-
selections(
|
|
321
|
-
let
|
|
322
|
-
this.selectedOptions = Array.isArray(
|
|
323
|
-
|
|
324
|
-
|
|
424
|
+
selections(option) {
|
|
425
|
+
let options = this.getSelectedOptions();
|
|
426
|
+
this.selectedOptions = Array.isArray(options) ? options : Array.from(options);
|
|
427
|
+
if (this.selectedOptions.length >= +this.maxOptions) {
|
|
428
|
+
this.counterEl = null;
|
|
429
|
+
}
|
|
430
|
+
this.chips.innerHTML = "";
|
|
431
|
+
if (this.selectedOptions.length > 0) {
|
|
432
|
+
this.selectedOptions.forEach((option2, index) => {
|
|
433
|
+
this.selectionChanged(option2, ++index);
|
|
434
|
+
});
|
|
435
|
+
} else {
|
|
436
|
+
this.selectionChanged();
|
|
437
|
+
}
|
|
325
438
|
}
|
|
326
439
|
counter() {
|
|
327
440
|
if (this.counterEl && this.value.length === +this.maxOptions) {
|
|
328
|
-
this.counterEl.remove()
|
|
441
|
+
this.counterEl.remove();
|
|
442
|
+
this.counterEl = null;
|
|
329
443
|
return;
|
|
330
444
|
}
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
445
|
+
if (!this.counterEl) {
|
|
446
|
+
this.counterEl = document.createElement("span");
|
|
447
|
+
this.counterEl.classList.add("counter");
|
|
448
|
+
this.chips.appendChild(this.counterEl);
|
|
449
|
+
}
|
|
450
|
+
this.counterEl.innerText = `+${this.value.length - +this.maxOptions}`;
|
|
451
|
+
}
|
|
452
|
+
getChip(option) {
|
|
453
|
+
let chip = document.createElement("wj-chip");
|
|
454
|
+
chip.setAttribute("removable", "");
|
|
455
|
+
chip.addEventListener("wj:chip-remove", this.removeChip);
|
|
456
|
+
chip.option = option;
|
|
457
|
+
let label = document.createElement("wj-label");
|
|
458
|
+
label.innerText = option.textContent.trim();
|
|
459
|
+
chip.appendChild(label);
|
|
460
|
+
return chip;
|
|
338
461
|
}
|
|
339
462
|
}
|
|
340
|
-
customElements.get("wj-select") || window.customElements.define("wj-select",
|
|
341
|
-
const
|
|
342
|
-
|
|
343
|
-
class P extends u {
|
|
463
|
+
customElements.get("wj-select") || window.customElements.define("wj-select", Select);
|
|
464
|
+
const styles$3 = '/*\n[ WJ Tab ]\n*/\n:host {\n --wj-font-size: 10px;\n --wj-tab-text-transfrom: uppercase;\n --wj-tab-font-weight: 500;\n --wj-tab-letter-spacing: 0.06em;\n --wj-tab-padding-inline: 1rem;\n --wj-tab-padding-top: .75rem;\n --wj-tab-padding-bottom: .75rem;\n --wj-tab-color-active: var(--wj-color-primary-11);\n --wj-tab-color-hover: var(--wj-color-primary-1);\n display: block;\n position: relative;\n}\n:host a {\n display: block;\n align-items: center;\n white-space: nowrap;\n font-family: var(--wj-font-family-secondary);\n font-size: var(--wj-font-size);\n letter-spacing: var(--wj-tab-letter-spacing);\n text-transform: var(--wj-tab-text-transfrom);\n font-weight: var(--wj-tab-font-weight);\n text-decoration: none;\n padding-inline: var(--wj-tab-padding-inline);\n padding-top: var(--wj-tab-padding-top);\n padding-bottom: var(--wj-tab-padding-bottom);\n color: var(--wj-color);\n}\n:host a > svg {\n inline-size: 1.5em;\n pointer-events: none;\n}\n:host a:hover {\n background: var(--wj-tab-color-hover);\n}\n:host a:hover:after {\n display: block;\n}\n:host a:after {\n content: " ";\n display: none;\n block-size: 0.15rem;\n writing-mode: var(--wj-tab-writing-mode);\n background: var(--wj-tab-color-active);\n position: absolute;\n bottom: var(--wj-tab-bottom);\n left: var(--wj-tab-start);\n right: var(--wj-tab-end);\n top: var(--wj-tab-top);\n}\n\n:host([disabled]) a {\n opacity: 0.5;\n cursor: not-allowed;\n background: inherit;\n}\n:host([disabled]) a:after {\n display: none;\n}\n\n:host([active]) a:after {\n display: block;\n}';
|
|
465
|
+
class Tab extends WJElement {
|
|
344
466
|
constructor() {
|
|
345
467
|
super();
|
|
346
|
-
|
|
347
|
-
this.last =
|
|
468
|
+
__publicField(this, "className", "Tab");
|
|
469
|
+
this.last = false;
|
|
348
470
|
}
|
|
349
471
|
static get cssStyleSheet() {
|
|
350
|
-
return
|
|
472
|
+
return styles$3;
|
|
351
473
|
}
|
|
352
474
|
setupAttributes() {
|
|
353
475
|
this.isShadowRoot = "open";
|
|
354
476
|
}
|
|
355
|
-
draw(
|
|
356
|
-
let
|
|
357
|
-
|
|
477
|
+
draw(context, store2, params) {
|
|
478
|
+
let fragment = document.createDocumentFragment();
|
|
479
|
+
let a = document.createElement("a");
|
|
480
|
+
a.setAttribute("href", "#" + this.panel);
|
|
481
|
+
a.innerHTML = this.innerHTML;
|
|
482
|
+
fragment.appendChild(a);
|
|
483
|
+
return fragment;
|
|
358
484
|
}
|
|
359
485
|
afterDraw() {
|
|
360
|
-
|
|
486
|
+
event.addListener(this, "click", "wj:tab-change");
|
|
361
487
|
}
|
|
362
488
|
}
|
|
363
|
-
customElements.get("wj-tab") || window.customElements.define("wj-tab",
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
-
class $ extends u {
|
|
489
|
+
customElements.get("wj-tab") || window.customElements.define("wj-tab", Tab);
|
|
490
|
+
const styles$2 = "/*\n[ WJ Tab Group ]\n*/\n:host {\n --wj-tab-top: 0;\n --wj-tab-start: 0;\n --wj-tab-end: 0;\n --wj-tab-bottom: 0;\n}\n\n.native-tab-group {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n position: relative;\n}\n\n.native-tab-group > header {\n display: flex;\n flex-direction: column;\n}\n.native-tab-group > header > nav {\n display: flex;\n}\n\n.native-tab-group > section {\n width: 100%;\n}\n.native-tab-group > section > article {\n scroll-snap-align: start;\n overflow-y: auto;\n overscroll-behavior-y: contain;\n}\n\n:host([variant=top]) {\n --wj-tab-top: auto !important;\n --wj-tab-writing-mode: horizontal-tb;\n}\n:host([variant=top]) .native-tab-group {\n flex-direction: column;\n}\n:host([variant=top]) nav {\n border-bottom: 1px solid var(--wj-border-color);\n}\n\n:host([variant=start]) {\n --wj-tab-start: auto !important;\n --wj-tab-writing-mode: vertical-rl;\n}\n:host([variant=start]) .native-tab-group {\n flex-direction: row;\n}\n:host([variant=start]) nav {\n flex-direction: column;\n border-right: 1px solid var(--wj-border-color);\n}\n\n:host([variant=end]) {\n --wj-tab-writing-mode: vertical-rl;\n}\n:host([variant=end]) .native-tab-group {\n flex-direction: row-reverse;\n}\n:host([variant=end]) nav {\n flex-direction: column;\n border-left: 1px solid var(--wj-border-color);\n}\n\n:host([variant=bottom]) {\n --wj-tab-bottom: auto !important;\n --wj-tab-writing-mode: horizontal-tb;\n}\n:host([variant=bottom]) .native-tab-group {\n flex-direction: column-reverse;\n}\n:host([variant=bottom]) nav {\n border-top: 1px solid var(--wj-border-color);\n}";
|
|
491
|
+
class TabGroup extends WJElement {
|
|
367
492
|
constructor() {
|
|
368
493
|
super();
|
|
369
|
-
|
|
494
|
+
__publicField(this, "className", "TabGroup");
|
|
370
495
|
}
|
|
371
496
|
static get cssStyleSheet() {
|
|
372
|
-
return
|
|
497
|
+
return styles$2;
|
|
373
498
|
}
|
|
374
499
|
setupAttributes() {
|
|
375
500
|
this.isShadowRoot = "open";
|
|
376
501
|
}
|
|
377
|
-
draw(
|
|
378
|
-
let
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
502
|
+
draw(context, store2, params) {
|
|
503
|
+
let fragment = document.createDocumentFragment();
|
|
504
|
+
let native = document.createElement("div");
|
|
505
|
+
native.classList.add("native-tab-group");
|
|
506
|
+
let header = document.createElement("header");
|
|
507
|
+
header.classList.add("scroll-snap-x");
|
|
508
|
+
let nav = document.createElement("nav");
|
|
509
|
+
let section = document.createElement("section");
|
|
510
|
+
let slot = document.createElement("slot");
|
|
511
|
+
let slotNav = document.createElement("slot");
|
|
512
|
+
slotNav.setAttribute("name", "nav");
|
|
513
|
+
header.appendChild(nav);
|
|
514
|
+
nav.appendChild(slotNav);
|
|
515
|
+
section.appendChild(slot);
|
|
516
|
+
native.appendChild(header);
|
|
517
|
+
native.appendChild(section);
|
|
518
|
+
fragment.appendChild(native);
|
|
519
|
+
return fragment;
|
|
384
520
|
}
|
|
385
521
|
afterDraw() {
|
|
386
|
-
let
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
522
|
+
let activeTab = this.getActiveTab();
|
|
523
|
+
let activeTabName = activeTab ? activeTab[0].name : this.getTabAll()[0].panel;
|
|
524
|
+
this.setActiveTab(activeTabName);
|
|
525
|
+
this.addEventListener("wj:tab-change", (e) => {
|
|
526
|
+
if (e.detail.context.hasAttribute("disabled"))
|
|
527
|
+
return false;
|
|
528
|
+
this.setActiveTab(e.detail.context.panel);
|
|
391
529
|
});
|
|
392
530
|
}
|
|
393
531
|
removeActiveTab() {
|
|
394
|
-
this.getPanelAll().forEach((
|
|
395
|
-
|
|
396
|
-
})
|
|
397
|
-
|
|
532
|
+
this.getPanelAll().forEach((el) => {
|
|
533
|
+
el.removeAttribute("active");
|
|
534
|
+
});
|
|
535
|
+
this.getTabAll().forEach((el) => {
|
|
536
|
+
el.removeAttribute("active");
|
|
398
537
|
});
|
|
399
538
|
}
|
|
400
|
-
setActiveTab(
|
|
401
|
-
this.removeActiveTab()
|
|
539
|
+
setActiveTab(tab) {
|
|
540
|
+
this.removeActiveTab();
|
|
541
|
+
this.querySelector(`[panel="${tab}"]`).setAttribute("active", "");
|
|
542
|
+
this.querySelector(`[name="${tab}"]`).setAttribute("active", "");
|
|
402
543
|
}
|
|
403
544
|
getActiveTab() {
|
|
404
|
-
let
|
|
405
|
-
return
|
|
545
|
+
let activeTabs = Array.from(this.context.querySelectorAll("[active]"));
|
|
546
|
+
return activeTabs.length > 0 ? activeTabs[0] : null;
|
|
406
547
|
}
|
|
407
548
|
getTabAll() {
|
|
408
549
|
return this.context.querySelector('[name="nav"]').assignedElements();
|
|
@@ -411,107 +552,108 @@ class $ extends u {
|
|
|
411
552
|
return Array.from(this.querySelectorAll("wj-tab-panel"));
|
|
412
553
|
}
|
|
413
554
|
}
|
|
414
|
-
customElements.get("wj-tab-group") || window.customElements.define("wj-tab-group",
|
|
415
|
-
const
|
|
416
|
-
|
|
417
|
-
class H extends u {
|
|
555
|
+
customElements.get("wj-tab-group") || window.customElements.define("wj-tab-group", TabGroup);
|
|
556
|
+
const styles$1 = "/*\n[ WJ Tab Panel ]\n*/\n:host {\n display: none;\n flex-wrap: wrap;\n align-items: center;\n padding: 1rem;\n}\n\n:host([active]) {\n display: block;\n}";
|
|
557
|
+
class TabPanel extends WJElement {
|
|
418
558
|
constructor() {
|
|
419
559
|
super();
|
|
420
|
-
|
|
560
|
+
__publicField(this, "className", "TabPanel");
|
|
421
561
|
}
|
|
422
562
|
static get cssStyleSheet() {
|
|
423
|
-
return
|
|
563
|
+
return styles$1;
|
|
424
564
|
}
|
|
425
565
|
setupAttributes() {
|
|
426
566
|
this.isShadowRoot = "open";
|
|
427
567
|
}
|
|
428
|
-
draw(
|
|
429
|
-
let
|
|
430
|
-
|
|
568
|
+
draw(context, store2, params) {
|
|
569
|
+
let fragment = document.createDocumentFragment();
|
|
570
|
+
let element = document.createElement("slot");
|
|
571
|
+
fragment.appendChild(element);
|
|
572
|
+
return fragment;
|
|
431
573
|
}
|
|
432
574
|
}
|
|
433
|
-
customElements.get("wj-tab-panel") || window.customElements.define("wj-tab-panel",
|
|
575
|
+
customElements.get("wj-tab-panel") || window.customElements.define("wj-tab-panel", TabPanel);
|
|
434
576
|
export {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
577
|
+
Animation,
|
|
578
|
+
Aside,
|
|
579
|
+
Avatar,
|
|
580
|
+
Badge,
|
|
581
|
+
Breadcrumb,
|
|
582
|
+
Breadcrumbs,
|
|
583
|
+
Button,
|
|
584
|
+
ButtonGroup,
|
|
585
|
+
Card,
|
|
586
|
+
CardContent,
|
|
587
|
+
CardControls,
|
|
588
|
+
CardHeader,
|
|
589
|
+
CardSubtitle,
|
|
590
|
+
CardTitle,
|
|
591
|
+
Carousel,
|
|
592
|
+
CarouselItem,
|
|
593
|
+
Checkbox,
|
|
594
|
+
Chip,
|
|
595
|
+
Col,
|
|
596
|
+
ColorPicker,
|
|
597
|
+
Container,
|
|
598
|
+
CopyButton,
|
|
599
|
+
Dialog,
|
|
600
|
+
Divider,
|
|
601
|
+
Dropdown,
|
|
602
|
+
ExampleElement,
|
|
603
|
+
FileUpload,
|
|
604
|
+
FileUploadItem,
|
|
605
|
+
Footer,
|
|
606
|
+
FormatDigital,
|
|
607
|
+
Grid,
|
|
608
|
+
Header,
|
|
609
|
+
Icon,
|
|
610
|
+
IconPicker,
|
|
611
|
+
Img,
|
|
612
|
+
ImgComparer,
|
|
613
|
+
InfiniteScroll,
|
|
614
|
+
Input,
|
|
615
|
+
InputFile,
|
|
616
|
+
Item,
|
|
617
|
+
Label,
|
|
618
|
+
List,
|
|
619
|
+
Localizer,
|
|
620
|
+
Main,
|
|
621
|
+
Masonry,
|
|
622
|
+
Menu,
|
|
623
|
+
MenuButton,
|
|
624
|
+
MenuItem,
|
|
625
|
+
MenuLabel,
|
|
626
|
+
NavMenu,
|
|
627
|
+
Option,
|
|
628
|
+
Options,
|
|
629
|
+
Popup,
|
|
630
|
+
ProgressBar,
|
|
631
|
+
Radio,
|
|
632
|
+
RadioGroup,
|
|
633
|
+
Rate,
|
|
634
|
+
RelativeTime,
|
|
635
|
+
Route,
|
|
636
|
+
RouterLink,
|
|
637
|
+
Routerx,
|
|
638
|
+
Row,
|
|
639
|
+
Select,
|
|
640
|
+
Slider,
|
|
641
|
+
SplitView,
|
|
642
|
+
Tab,
|
|
643
|
+
TabGroup,
|
|
644
|
+
TabPanel,
|
|
645
|
+
Textarea,
|
|
646
|
+
Thumbnail,
|
|
647
|
+
Toast,
|
|
648
|
+
Toggle,
|
|
649
|
+
Toolbar,
|
|
650
|
+
ToolbarAction,
|
|
651
|
+
Tooltip,
|
|
652
|
+
VisuallyHidden,
|
|
653
|
+
WJElement,
|
|
654
|
+
b as bindRouterLinks,
|
|
655
|
+
defaultStoreActions,
|
|
656
|
+
fetchAndParseCSS,
|
|
657
|
+
store,
|
|
658
|
+
w as withRouterLinks
|
|
517
659
|
};
|