wj-elements 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/router-links-e0087f84.js +146 -0
- package/dist/style.css +2 -2365
- package/dist/wj-aside.js +18 -22
- package/dist/wj-avatar.js +32 -49
- package/dist/wj-badge.js +18 -22
- package/dist/wj-breadcrumb.js +53 -103
- package/dist/wj-breadcrumbs.js +21 -36
- package/dist/wj-button-group.js +24 -36
- package/dist/wj-button.js +37 -80
- package/dist/wj-card-content.js +16 -18
- package/dist/wj-card-controls.js +16 -18
- package/dist/wj-card-header.js +16 -20
- package/dist/wj-card-subtitle.js +17 -19
- package/dist/wj-card-title.js +16 -18
- package/dist/wj-card.js +16 -20
- package/dist/wj-checkbox.js +24 -46
- package/dist/wj-chip.js +21 -39
- package/dist/wj-col.js +18 -32
- package/dist/wj-color-picker.js +503 -868
- package/dist/wj-container.js +18 -20
- package/dist/wj-copy-button.js +66 -112
- package/dist/wj-dialog.js +43 -67
- package/dist/wj-divider.js +16 -20
- package/dist/wj-dropdown.js +22 -31
- package/dist/wj-element.js +241 -416
- package/dist/wj-footer.js +16 -18
- package/dist/wj-form.js +16 -18
- package/dist/wj-grid.js +17 -21
- package/dist/wj-header.js +18 -22
- package/dist/wj-icon-picker.js +66 -107
- package/dist/wj-icon.js +67 -142
- package/dist/wj-img-comparer.js +43 -72
- package/dist/wj-img.js +21 -31
- package/dist/wj-infinite-scroll.js +49 -84
- package/dist/wj-input.js +67 -146
- package/dist/wj-item.js +19 -34
- package/dist/wj-label.js +19 -21
- package/dist/wj-list.js +17 -20
- package/dist/wj-main.js +16 -18
- package/dist/wj-master.js +331 -462
- package/dist/wj-menu-button.js +18 -21
- package/dist/wj-menu-item.js +67 -144
- package/dist/wj-menu-label.js +17 -21
- package/dist/wj-menu.js +20 -24
- package/dist/wj-popup.js +714 -1140
- package/dist/wj-progress-bar.js +42 -100
- package/dist/wj-radio-group.js +27 -38
- package/dist/wj-radio.js +24 -46
- package/dist/wj-route.js +8 -11
- package/dist/wj-router-link.js +19 -22
- package/dist/wj-router-outlet.js +71 -135
- package/dist/wj-routerx.js +641 -1121
- package/dist/wj-row.js +20 -22
- package/dist/wj-slider.js +55 -97
- package/dist/wj-split-view.js +45 -81
- package/dist/wj-store.js +110 -195
- package/dist/wj-textarea.js +39 -86
- package/dist/wj-thumbnail.js +17 -19
- package/dist/wj-toast.js +34 -88
- package/dist/wj-toggle.js +24 -42
- package/dist/wj-toolbar-action.js +16 -27
- package/dist/wj-toolbar.js +21 -26
- package/dist/wj-tooltip.js +27 -41
- package/dist/wj-visually-hidden.js +16 -18
- package/package.json +1 -1
- package/dist/router-links-26e4a166.js +0 -204
package/dist/wj-master.js
CHANGED
|
@@ -1,112 +1,108 @@
|
|
|
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 { Route } from "./wj-route.js";
|
|
54
|
-
import { Routerx } from "./wj-routerx.js";
|
|
55
|
-
import { RouterLink } from "./wj-router-link.js";
|
|
1
|
+
var j = Object.defineProperty;
|
|
2
|
+
var A = (s, i, t) => i in s ? j(s, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[i] = t;
|
|
3
|
+
var d = (s, i, t) => (A(s, typeof i != "symbol" ? i + "" : i, t), t);
|
|
4
|
+
import u, { WjElementUtils as E, event as v } from "./wj-element.js";
|
|
5
|
+
import { defaultStoreActions as V, store as _ } from "./wj-store.js";
|
|
6
|
+
import { b as U, w as K } from "./router-links-e0087f84.js";
|
|
7
|
+
import { Aside as X } from "./wj-aside.js";
|
|
8
|
+
import { Avatar as Z } from "./wj-avatar.js";
|
|
9
|
+
import { Badge as et } from "./wj-badge.js";
|
|
10
|
+
import { Breadcrumb as ot } from "./wj-breadcrumb.js";
|
|
11
|
+
import { Breadcrumbs as it } from "./wj-breadcrumbs.js";
|
|
12
|
+
import { Button as nt } from "./wj-button.js";
|
|
13
|
+
import { ButtonGroup as ct } from "./wj-button-group.js";
|
|
14
|
+
import { Card as pt } from "./wj-card.js";
|
|
15
|
+
import { CardContent as ut } from "./wj-card-content.js";
|
|
16
|
+
import { CardControls as bt } from "./wj-card-controls.js";
|
|
17
|
+
import { CardHeader as gt } from "./wj-card-header.js";
|
|
18
|
+
import { CardSubtitle as ft } from "./wj-card-subtitle.js";
|
|
19
|
+
import { CardTitle as jt } from "./wj-card-title.js";
|
|
20
|
+
import { Checkbox as Et } from "./wj-checkbox.js";
|
|
21
|
+
import { Chip as Ct } from "./wj-chip.js";
|
|
22
|
+
import { Col as Tt } from "./wj-col.js";
|
|
23
|
+
import { ColorPicker as Lt } from "./wj-color-picker.js";
|
|
24
|
+
import { Container as Dt } from "./wj-container.js";
|
|
25
|
+
import { CopyButton as Nt } from "./wj-copy-button.js";
|
|
26
|
+
import { Dialog as Mt } from "./wj-dialog.js";
|
|
27
|
+
import { Divider as Ht } from "./wj-divider.js";
|
|
28
|
+
import { Dropdown as Bt } from "./wj-dropdown.js";
|
|
29
|
+
import { Footer as It } from "./wj-footer.js";
|
|
30
|
+
import { Grid as Gt } from "./wj-grid.js";
|
|
31
|
+
import { Header as Vt } from "./wj-header.js";
|
|
32
|
+
import { Icon as Jt } from "./wj-icon.js";
|
|
33
|
+
import { IconPicker as Kt } from "./wj-icon-picker.js";
|
|
34
|
+
import { Img as Xt } from "./wj-img.js";
|
|
35
|
+
import { ImgComparer as Zt } from "./wj-img-comparer.js";
|
|
36
|
+
import { InfiniteScroll as ee } from "./wj-infinite-scroll.js";
|
|
37
|
+
import { Input as oe } from "./wj-input.js";
|
|
38
|
+
import { Item as ie } from "./wj-item.js";
|
|
39
|
+
import { Label as ne } from "./wj-label.js";
|
|
40
|
+
import { List as ce } from "./wj-list.js";
|
|
41
|
+
import { Main as pe } from "./wj-main.js";
|
|
42
|
+
import { Menu as ue } from "./wj-menu.js";
|
|
43
|
+
import { MenuButton as be } from "./wj-menu-button.js";
|
|
44
|
+
import { MenuItem as ge } from "./wj-menu-item.js";
|
|
45
|
+
import { MenuLabel as fe } from "./wj-menu-label.js";
|
|
46
|
+
import { Popup as je } from "./wj-popup.js";
|
|
47
|
+
import { ProgressBar as Ee } from "./wj-progress-bar.js";
|
|
48
|
+
import { Radio as Ce } from "./wj-radio.js";
|
|
49
|
+
import { RadioGroup as Te } from "./wj-radio-group.js";
|
|
50
|
+
import { Route as Le } from "./wj-route.js";
|
|
51
|
+
import { Routerx as De } from "./wj-routerx.js";
|
|
52
|
+
import { RouterLink as Ne } from "./wj-router-link.js";
|
|
56
53
|
import "./wj-router-outlet.js";
|
|
57
|
-
import { Row } from "./wj-row.js";
|
|
58
|
-
import { Slider } from "./wj-slider.js";
|
|
59
|
-
import { SplitView } from "./wj-split-view.js";
|
|
60
|
-
import { Textarea } from "./wj-textarea.js";
|
|
61
|
-
import { Thumbnail } from "./wj-thumbnail.js";
|
|
62
|
-
import { Toast } from "./wj-toast.js";
|
|
63
|
-
import { Toggle } from "./wj-toggle.js";
|
|
64
|
-
import { Toolbar } from "./wj-toolbar.js";
|
|
65
|
-
import { ToolbarAction } from "./wj-toolbar-action.js";
|
|
66
|
-
import { Tooltip } from "./wj-tooltip.js";
|
|
67
|
-
import { VisuallyHidden } from "./wj-visually-hidden.js";
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
class
|
|
54
|
+
import { Row as Me } from "./wj-row.js";
|
|
55
|
+
import { Slider as He } from "./wj-slider.js";
|
|
56
|
+
import { SplitView as Be } from "./wj-split-view.js";
|
|
57
|
+
import { Textarea as Ie } from "./wj-textarea.js";
|
|
58
|
+
import { Thumbnail as Ge } from "./wj-thumbnail.js";
|
|
59
|
+
import { Toast as Ve } from "./wj-toast.js";
|
|
60
|
+
import { Toggle as Je } from "./wj-toggle.js";
|
|
61
|
+
import { Toolbar as Ke } from "./wj-toolbar.js";
|
|
62
|
+
import { ToolbarAction as Xe } from "./wj-toolbar-action.js";
|
|
63
|
+
import { Tooltip as Ze } from "./wj-tooltip.js";
|
|
64
|
+
import { VisuallyHidden as er } from "./wj-visually-hidden.js";
|
|
65
|
+
const y = `:host{color:red}
|
|
66
|
+
`;
|
|
67
|
+
class C extends u {
|
|
71
68
|
constructor() {
|
|
72
69
|
super();
|
|
73
|
-
|
|
70
|
+
d(this, "className", "ExampleElement");
|
|
74
71
|
}
|
|
75
72
|
static get cssStyleSheet() {
|
|
76
|
-
return
|
|
73
|
+
return y;
|
|
77
74
|
}
|
|
78
75
|
static get observedAttributes() {
|
|
79
76
|
return [];
|
|
80
77
|
}
|
|
81
78
|
setupAttributes() {
|
|
82
|
-
this.isShadowRoot = "open"
|
|
83
|
-
|
|
84
|
-
"test": "test"
|
|
79
|
+
this.isShadowRoot = "open", E.setAttributesToElement(this, {
|
|
80
|
+
test: "test"
|
|
85
81
|
});
|
|
86
82
|
}
|
|
87
|
-
beforeDraw(
|
|
83
|
+
beforeDraw(t, e, o) {
|
|
88
84
|
}
|
|
89
|
-
draw(
|
|
90
|
-
console.log(
|
|
91
|
-
let
|
|
92
|
-
|
|
93
|
-
element.innerHTML = params.text;
|
|
94
|
-
fragment.appendChild(element);
|
|
95
|
-
return fragment;
|
|
85
|
+
draw(t, e, o) {
|
|
86
|
+
console.log(t, e, o);
|
|
87
|
+
let a = document.createDocumentFragment(), r = document.createElement("div");
|
|
88
|
+
return r.innerHTML = o.text, a.appendChild(r), a;
|
|
96
89
|
}
|
|
97
|
-
afterDraw(
|
|
90
|
+
afterDraw(t, e, o) {
|
|
98
91
|
console.log("afterDraw", this.params);
|
|
99
92
|
}
|
|
100
93
|
}
|
|
101
|
-
customElements.get("wj-example-element") || window.customElements.define("wj-example-element",
|
|
102
|
-
const
|
|
103
|
-
|
|
94
|
+
customElements.get("wj-example-element") || window.customElements.define("wj-example-element", C);
|
|
95
|
+
const S = `/*!
|
|
96
|
+
* direction.scss
|
|
97
|
+
*/: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}
|
|
98
|
+
`;
|
|
99
|
+
class T extends u {
|
|
104
100
|
constructor() {
|
|
105
101
|
super();
|
|
106
|
-
|
|
102
|
+
d(this, "className", "ButtonGroup");
|
|
107
103
|
}
|
|
108
104
|
static get cssStyleSheet() {
|
|
109
|
-
return
|
|
105
|
+
return S;
|
|
110
106
|
}
|
|
111
107
|
static get observedAttributes() {
|
|
112
108
|
return [];
|
|
@@ -114,29 +110,26 @@ class NavMenu extends WJElement {
|
|
|
114
110
|
setupAttributes() {
|
|
115
111
|
this.isShadowRoot = "open";
|
|
116
112
|
}
|
|
117
|
-
draw(
|
|
118
|
-
let
|
|
119
|
-
|
|
120
|
-
element.classList.add("native-button-group");
|
|
121
|
-
element.setAttribute("part", "native");
|
|
122
|
-
this.slotElement = document.createElement("slot");
|
|
123
|
-
element.appendChild(this.slotElement);
|
|
124
|
-
fragment.appendChild(element);
|
|
125
|
-
return fragment;
|
|
113
|
+
draw(t, e, o) {
|
|
114
|
+
let a = document.createDocumentFragment(), r = document.createElement("div");
|
|
115
|
+
return r.classList.add("native-button-group"), r.setAttribute("part", "native"), this.slotElement = document.createElement("slot"), r.appendChild(this.slotElement), a.appendChild(r), a;
|
|
126
116
|
}
|
|
127
117
|
}
|
|
128
|
-
customElements.get("wj-button-group") || window.customElements.define("wj-button-group",
|
|
129
|
-
const
|
|
130
|
-
|
|
118
|
+
customElements.get("wj-button-group") || window.customElements.define("wj-button-group", T);
|
|
119
|
+
const k = `/*!
|
|
120
|
+
* direction.scss
|
|
121
|
+
*/:host{--wj-option-padding-top: .5rem;--wj-option-padding-bottom: .5rem;--wj-option-highlighted: #f4f4f4;display:block}:host wj-icon{visibility:hidden;margin-inline:.5rem}:host([selected]) wj-icon{visibility:visible}.native-option{display:flex;align-items:center;padding-top:var(--wj-option-padding-top);padding-bottom:var(--wj-option-padding-bottom)}.native-option:hover{background-color:var(--wj-option-highlighted)}::slotted([slot=start]){flex:0 0 auto;display:flex;align-items:center;margin-inline-end:.5rem}::slotted([slot=end]){flex:0 0 auto;display:flex;align-items:center;margin-inline:auto .5rem}
|
|
122
|
+
`;
|
|
123
|
+
class L extends u {
|
|
131
124
|
constructor() {
|
|
132
125
|
super();
|
|
133
|
-
|
|
126
|
+
d(this, "className", "Option");
|
|
134
127
|
}
|
|
135
|
-
set selected(
|
|
136
|
-
return
|
|
128
|
+
set selected(t) {
|
|
129
|
+
return t ? this.setAttribute("selected", "") : this.removeAttribute("selected");
|
|
137
130
|
}
|
|
138
131
|
static get cssStyleSheet() {
|
|
139
|
-
return
|
|
132
|
+
return k;
|
|
140
133
|
}
|
|
141
134
|
static get observedAttributes() {
|
|
142
135
|
return [];
|
|
@@ -144,38 +137,32 @@ class Option extends WJElement {
|
|
|
144
137
|
setupAttributes() {
|
|
145
138
|
this.isShadowRoot = "open";
|
|
146
139
|
}
|
|
147
|
-
draw(
|
|
148
|
-
let
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
let
|
|
153
|
-
|
|
154
|
-
let
|
|
155
|
-
|
|
156
|
-
let slot = document.createElement("slot");
|
|
157
|
-
let end = document.createElement("slot");
|
|
158
|
-
end.setAttribute("name", "end");
|
|
159
|
-
element.appendChild(icon);
|
|
160
|
-
element.appendChild(start);
|
|
161
|
-
element.appendChild(slot);
|
|
162
|
-
element.appendChild(end);
|
|
163
|
-
fragment.appendChild(element);
|
|
164
|
-
return fragment;
|
|
140
|
+
draw(t, e, o) {
|
|
141
|
+
let a = document.createDocumentFragment(), r = document.createElement("div");
|
|
142
|
+
r.classList.add("native-option"), r.setAttribute("part", "native");
|
|
143
|
+
let n = document.createElement("wj-icon");
|
|
144
|
+
n.setAttribute("name", "check");
|
|
145
|
+
let p = document.createElement("slot");
|
|
146
|
+
p.setAttribute("name", "start");
|
|
147
|
+
let c = document.createElement("slot"), l = document.createElement("slot");
|
|
148
|
+
return l.setAttribute("name", "end"), r.appendChild(n), r.appendChild(p), r.appendChild(c), r.appendChild(l), a.appendChild(r), a;
|
|
165
149
|
}
|
|
166
150
|
afterDraw() {
|
|
167
|
-
|
|
151
|
+
v.addListener(this, "click", "wj:option-change");
|
|
168
152
|
}
|
|
169
153
|
}
|
|
170
|
-
customElements.get("wj-option") || window.customElements.define("wj-option",
|
|
171
|
-
const
|
|
172
|
-
|
|
154
|
+
customElements.get("wj-option") || window.customElements.define("wj-option", L);
|
|
155
|
+
const O = `/*!
|
|
156
|
+
* direction.scss
|
|
157
|
+
*/
|
|
158
|
+
`;
|
|
159
|
+
class D extends u {
|
|
173
160
|
constructor() {
|
|
174
161
|
super();
|
|
175
|
-
|
|
162
|
+
d(this, "className", "Options");
|
|
176
163
|
}
|
|
177
164
|
static get cssStyleSheet() {
|
|
178
|
-
return
|
|
165
|
+
return O;
|
|
179
166
|
}
|
|
180
167
|
static get observedAttributes() {
|
|
181
168
|
return [];
|
|
@@ -185,66 +172,54 @@ class Options extends WJElement {
|
|
|
185
172
|
}
|
|
186
173
|
async beforeDraw() {
|
|
187
174
|
this.response = await this.getPages();
|
|
188
|
-
let
|
|
189
|
-
this.response.forEach((
|
|
190
|
-
let
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
this.
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
const response = await fetch(this.url);
|
|
200
|
-
if (!response.ok) {
|
|
201
|
-
throw new Error(`An error occurred: ${response.status}`);
|
|
202
|
-
}
|
|
203
|
-
return await response.json();
|
|
175
|
+
let t = document.createDocumentFragment();
|
|
176
|
+
this.response.forEach((e, o) => {
|
|
177
|
+
let a = document.createElement("wj-option");
|
|
178
|
+
a.setAttribute("value", e[this.itemValue] || e.value), a.innerText = e[this.itemText] || e.text, t.appendChild(a);
|
|
179
|
+
}), this.parentElement.appendChild(t), v.dispatchCustomEvent(this, "wj:options-load", {});
|
|
180
|
+
}
|
|
181
|
+
async getPages(t) {
|
|
182
|
+
const e = await fetch(this.url);
|
|
183
|
+
if (!e.ok)
|
|
184
|
+
throw new Error(`An error occurred: ${e.status}`);
|
|
185
|
+
return await e.json();
|
|
204
186
|
}
|
|
205
187
|
}
|
|
206
|
-
customElements.get("wj-options") || window.customElements.define("wj-options",
|
|
207
|
-
const
|
|
208
|
-
|
|
188
|
+
customElements.get("wj-options") || window.customElements.define("wj-options", D);
|
|
189
|
+
const R = `/*!
|
|
190
|
+
* direction.scss
|
|
191
|
+
*/:host{--wj-select-border-width: 1px;--wj-select-border-style: solid;--wj-select-border-color: var(--wj-border-color);--wj-select-options-border-width: 1px;--wj-select-options-border-style: solid;--wj-select-options-border-color: var(--wj-border-color);--wj-select-background-color: #fff;--wj-select-line-height: 20px;--wj-select-color: #212121;--wj-select-border-radius: 4px;width:100%;display:block}:host [slot=arrow]{transform:rotate(0);transition:all .2s ease-in}.native-select.default .wrapper{display:block;border-width:var(--wj-select-border-width);border-style:var(--wj-select-border-style);border-color:var(--wj-select-border-color);border-radius:var(--wj-select-border-radius);padding-inline:.5rem;padding-top:.25rem;padding-bottom:.25rem}.native-select.default .input-wrapper{padding:0;min-height:25px;margin-top:-4px}.native-select.default.focused wj-label{opacity:.67;font-size:12px;letter-spacing:normal}.native-select.default wj-label{margin:0;display:block;opacity:1;cursor:text;transition:opacity .2s ease 0s;line-height:var(--wj-select-line-height)}.native-select.default wj-label.fade{opacity:.5;font-size:12px;letter-spacing:normal}.native-select.standard .input-wrapper{border-width:var(--wj-select-border-width);border-style:var(--wj-select-border-style);border-color:var(--wj-select-border-color);border-radius:var(--wj-select-border-radius);width:100%}.wrapper{display:flex;width:100%}.input-wrapper{display:grid;grid-template-columns:1fr auto auto;align-items:center;background-color:var(--wj-select-background-color);min-height:28px;color:var(--wj-select-color);line-height:var(--wj-select-line-height);-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:2px .5rem;font-size:14px;font-weight:400;vertical-align:middle}input{border:medium;height:25px;min-height:25px;padding:0;background:none;box-shadow:none;width:100%;outline:0}::placeholder{opacity:1}:host [active] .input-wrapper{border-radius:var(--wj-select-border-radius) var(--wj-select-border-radius) 0 0}:host [active] [slot=arrow]{transform:rotate(180deg);transition:all .2s ease-in}.option-wrapper{border-width:var(--wj-select-options-border-width);border-style:var(--wj-select-options-border-style);border-color:var(--wj-select-options-border-color);border-radius:0 0 var(--wj-select-border-radius) var(--wj-select-border-radius);margin-top:-1px;background:var(--wj-select-background-color);overflow:auto}:host([multiple]) input{position:absolute;z-index:-1;top:0;left:0;width:0;height:0;opacity:0}:host([multiple]) .chips{display:flex;flex:1;align-items:center;flex-wrap:wrap}:host([disabled]) .input-wrapper{opacity:.5;pointer-events:none;cursor:not-allowed}.counter{padding-inline:.5rem}wj-chip{--wj-chip-margin: 0 .25rem 0 0}wj-button{--wj-padding-top: .25rem;--wj-padding-start: .25rem;--wj-padding-end: .25rem;--wj-padding-bottom: .25rem;--wj-button-margin-inline: 0 .25rem}
|
|
192
|
+
`;
|
|
193
|
+
class N extends u {
|
|
209
194
|
constructor() {
|
|
210
195
|
super();
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
let
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
option.removeAttribute("selected");
|
|
218
|
-
});
|
|
219
|
-
this.popup.removeAttribute("active");
|
|
220
|
-
}
|
|
221
|
-
e.target.selected = !e.target.hasAttribute("selected");
|
|
222
|
-
this.selections(e.target);
|
|
196
|
+
d(this, "className", "Select");
|
|
197
|
+
d(this, "optionChange", (t) => {
|
|
198
|
+
let e = this.getAllOptions();
|
|
199
|
+
this.hasAttribute("multiple") || (e.forEach((o) => {
|
|
200
|
+
o.selected = !1, o.removeAttribute("selected");
|
|
201
|
+
}), this.popup.removeAttribute("active")), t.target.selected = !t.target.hasAttribute("selected"), this.selections(t.target);
|
|
223
202
|
});
|
|
224
|
-
|
|
225
|
-
let
|
|
226
|
-
|
|
227
|
-
option.removeAttribute("selected");
|
|
228
|
-
e.target.parentNode.removeChild(e.target);
|
|
229
|
-
this.selections(null, 0);
|
|
203
|
+
d(this, "removeChip", (t) => {
|
|
204
|
+
let e = t.target.option;
|
|
205
|
+
e.selected = !1, e.removeAttribute("selected"), t.target.parentNode.removeChild(t.target), this.selections(null, 0);
|
|
230
206
|
});
|
|
231
|
-
this._selected = [];
|
|
232
|
-
this.counterEl = null;
|
|
207
|
+
this._selected = [], this.counterEl = null;
|
|
233
208
|
}
|
|
234
|
-
set selected(
|
|
235
|
-
this._selected =
|
|
209
|
+
set selected(t) {
|
|
210
|
+
this._selected = t;
|
|
236
211
|
}
|
|
237
212
|
get selected() {
|
|
238
213
|
return this.getSelected();
|
|
239
214
|
}
|
|
240
|
-
set trigger(
|
|
241
|
-
this.setAttribute("trigger",
|
|
215
|
+
set trigger(t) {
|
|
216
|
+
this.setAttribute("trigger", t);
|
|
242
217
|
}
|
|
243
218
|
get trigger() {
|
|
244
219
|
return this.getAttribute("trigger") || "click";
|
|
245
220
|
}
|
|
246
221
|
static get cssStyleSheet() {
|
|
247
|
-
return
|
|
222
|
+
return R;
|
|
248
223
|
}
|
|
249
224
|
static get observedAttributes() {
|
|
250
225
|
return ["active", "value"];
|
|
@@ -252,97 +227,42 @@ class Select extends WJElement {
|
|
|
252
227
|
setupAttributes() {
|
|
253
228
|
this.isShadowRoot = "open";
|
|
254
229
|
}
|
|
255
|
-
draw(
|
|
256
|
-
let
|
|
230
|
+
draw(t, e, o) {
|
|
231
|
+
let a = document.createDocumentFragment();
|
|
257
232
|
this.classList.add("wj-placement", "wj-" + this.placement || "wj-start");
|
|
258
|
-
let
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
let
|
|
265
|
-
|
|
266
|
-
let
|
|
267
|
-
|
|
268
|
-
let
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
let
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
popup.setAttribute("placement", "bottom-start");
|
|
292
|
-
popup.setAttribute("manual", "");
|
|
293
|
-
popup.setAttribute("size", "");
|
|
294
|
-
if (this.hasAttribute("disabled"))
|
|
295
|
-
popup.setAttribute("disabled", "");
|
|
296
|
-
if (this.variant === "standard") {
|
|
297
|
-
if (this.hasAttribute("label"))
|
|
298
|
-
native.appendChild(label);
|
|
299
|
-
} else {
|
|
300
|
-
wrapper.appendChild(label);
|
|
301
|
-
}
|
|
302
|
-
inputWrapper.appendChild(input);
|
|
303
|
-
if (this.hasAttribute("multiple"))
|
|
304
|
-
inputWrapper.appendChild(chips);
|
|
305
|
-
if (this.hasAttribute("clearable"))
|
|
306
|
-
inputWrapper.appendChild(clear);
|
|
307
|
-
inputWrapper.appendChild(arrow);
|
|
308
|
-
optionsWrapper.appendChild(slot);
|
|
309
|
-
wrapper.appendChild(inputWrapper);
|
|
310
|
-
popup.appendChild(wrapper);
|
|
311
|
-
popup.appendChild(optionsWrapper);
|
|
312
|
-
if (this.trigger === "click")
|
|
313
|
-
popup.setAttribute("manual", "");
|
|
314
|
-
native.appendChild(popup);
|
|
315
|
-
this.native = native;
|
|
316
|
-
this.popup = popup;
|
|
317
|
-
this.labelElement = label;
|
|
318
|
-
this.input = input;
|
|
319
|
-
this.optionsWrapper = optionsWrapper;
|
|
320
|
-
this.chips = chips;
|
|
321
|
-
this.clear = clear;
|
|
322
|
-
fragment.appendChild(native);
|
|
323
|
-
return fragment;
|
|
324
|
-
}
|
|
325
|
-
afterDraw(context, store2, params) {
|
|
326
|
-
this.input.addEventListener("focus", (e) => {
|
|
327
|
-
this.labelElement.classList.add("fade");
|
|
328
|
-
this.native.classList.add("focused");
|
|
329
|
-
});
|
|
330
|
-
this.input.addEventListener("blur", (e) => {
|
|
331
|
-
this.native.classList.remove("focused");
|
|
332
|
-
if (!e.target.value)
|
|
333
|
-
this.labelElement.classList.remove("fade");
|
|
334
|
-
});
|
|
335
|
-
this.addEventListener("wj:option-change", this.optionChange);
|
|
336
|
-
this.clear.addEventListener("wj:button-click", (e) => {
|
|
337
|
-
this.getAllOptions().forEach((option) => {
|
|
338
|
-
option.selected = false;
|
|
339
|
-
option.removeAttribute("selected");
|
|
340
|
-
});
|
|
341
|
-
this.selections();
|
|
342
|
-
e.stopPropagation();
|
|
343
|
-
});
|
|
344
|
-
this.selections();
|
|
345
|
-
this.optionsWrapper.addEventListener("wj:options-load", (e) => {
|
|
233
|
+
let r = document.createElement("div");
|
|
234
|
+
r.setAttribute("part", "native"), r.classList.add("native-select", this.variant || "default");
|
|
235
|
+
let n = document.createElement("div");
|
|
236
|
+
n.classList.add("wrapper"), n.setAttribute("slot", "anchor");
|
|
237
|
+
let p = document.createElement("wj-label");
|
|
238
|
+
p.innerText = this.label || "";
|
|
239
|
+
let c = document.createElement("div");
|
|
240
|
+
c.classList.add("input-wrapper");
|
|
241
|
+
let l = document.createElement("input");
|
|
242
|
+
l.setAttribute("type", "text"), l.setAttribute("part", "input"), l.setAttribute("autocomplete", "off"), l.setAttribute("readonly", ""), l.setAttribute("placeholder", this.placeholder || "");
|
|
243
|
+
let h = document.createElement("wj-icon");
|
|
244
|
+
h.setAttribute("name", "chevron-down"), h.setAttribute("slot", "arrow");
|
|
245
|
+
let g = document.createElement("div");
|
|
246
|
+
g.classList.add("chips"), g.innerText = this.placeholder || "";
|
|
247
|
+
let b = document.createElement("div");
|
|
248
|
+
b.classList.add("option-wrapper"), b.style.setProperty("height", this.maxHeight || "auto");
|
|
249
|
+
let x = document.createElement("slot"), w = document.createElement("wj-button");
|
|
250
|
+
w.setAttribute("variant", "link"), w.setAttribute("part", "clear");
|
|
251
|
+
let f = document.createElement("wj-icon");
|
|
252
|
+
f.setAttribute("name", "x"), w.appendChild(f);
|
|
253
|
+
let m = document.createElement("wj-popup");
|
|
254
|
+
return m.setAttribute("placement", "bottom-start"), m.setAttribute("manual", ""), m.setAttribute("size", ""), this.hasAttribute("disabled") && m.setAttribute("disabled", ""), this.variant === "standard" ? this.hasAttribute("label") && r.appendChild(p) : n.appendChild(p), c.appendChild(l), this.hasAttribute("multiple") && c.appendChild(g), this.hasAttribute("clearable") && c.appendChild(w), c.appendChild(h), b.appendChild(x), n.appendChild(c), m.appendChild(n), m.appendChild(b), this.trigger === "click" && m.setAttribute("manual", ""), r.appendChild(m), this.native = r, this.popup = m, this.labelElement = p, this.input = l, this.optionsWrapper = b, this.chips = g, this.clear = w, a.appendChild(r), a;
|
|
255
|
+
}
|
|
256
|
+
afterDraw(t, e, o) {
|
|
257
|
+
this.input.addEventListener("focus", (a) => {
|
|
258
|
+
this.labelElement.classList.add("fade"), this.native.classList.add("focused");
|
|
259
|
+
}), this.input.addEventListener("blur", (a) => {
|
|
260
|
+
this.native.classList.remove("focused"), a.target.value || this.labelElement.classList.remove("fade");
|
|
261
|
+
}), this.addEventListener("wj:option-change", this.optionChange), this.clear.addEventListener("wj:button-click", (a) => {
|
|
262
|
+
this.getAllOptions().forEach((r) => {
|
|
263
|
+
r.selected = !1, r.removeAttribute("selected");
|
|
264
|
+
}), this.selections(), a.stopPropagation();
|
|
265
|
+
}), this.selections(), this.optionsWrapper.addEventListener("wj:options-load", (a) => {
|
|
346
266
|
this.optionsWrapper.scrollTo(0, 0);
|
|
347
267
|
});
|
|
348
268
|
}
|
|
@@ -352,164 +272,112 @@ class Select extends WJElement {
|
|
|
352
272
|
getSelectedOptions() {
|
|
353
273
|
return this.querySelectorAll("wj-option[selected]");
|
|
354
274
|
}
|
|
355
|
-
getSelected(
|
|
356
|
-
let
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
text: option2.textContent.trim()
|
|
362
|
-
};
|
|
363
|
-
});
|
|
364
|
-
return selectedOptions;
|
|
365
|
-
}
|
|
366
|
-
selectionChanged(option = null, length = 0) {
|
|
367
|
-
if (this.hasAttribute("multiple")) {
|
|
368
|
-
this.value = this.selectedOptions.map((el) => el).reverse();
|
|
369
|
-
if (this.placeholder && length === 0) {
|
|
370
|
-
this.chips.innerHTML = this.placeholder;
|
|
371
|
-
this.input.value = "";
|
|
372
|
-
} else {
|
|
373
|
-
if (this.counterEl instanceof HTMLElement || length > +this.maxOptions) {
|
|
374
|
-
this.counter();
|
|
375
|
-
} else {
|
|
376
|
-
if (option != null)
|
|
377
|
-
this.chips.appendChild(this.getChip(option));
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
} else {
|
|
381
|
-
let value = (option == null ? void 0 : option.textContent.trim()) || "";
|
|
382
|
-
this.value = value;
|
|
383
|
-
this.input.value = value;
|
|
384
|
-
}
|
|
275
|
+
getSelected(t) {
|
|
276
|
+
let e = this.getSelectedOptions();
|
|
277
|
+
return e = Array.isArray(e) ? e : Array.from(e), e = e.map((o) => ({
|
|
278
|
+
value: o.value,
|
|
279
|
+
text: o.textContent.trim()
|
|
280
|
+
})), e;
|
|
385
281
|
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
this.chips.innerHTML = "";
|
|
393
|
-
if (this.selectedOptions.length > 0) {
|
|
394
|
-
this.selectedOptions.forEach((option2, index) => {
|
|
395
|
-
this.selectionChanged(option2, ++index);
|
|
396
|
-
});
|
|
397
|
-
} else {
|
|
398
|
-
this.selectionChanged();
|
|
282
|
+
selectionChanged(t = null, e = 0) {
|
|
283
|
+
if (this.hasAttribute("multiple"))
|
|
284
|
+
this.value = this.selectedOptions.map((o) => o).reverse(), this.placeholder && e === 0 ? (this.chips.innerHTML = this.placeholder, this.input.value = "") : this.counterEl instanceof HTMLElement || e > +this.maxOptions ? this.counter() : t != null && this.chips.appendChild(this.getChip(t));
|
|
285
|
+
else {
|
|
286
|
+
let o = (t == null ? void 0 : t.textContent.trim()) || "";
|
|
287
|
+
this.value = o, this.input.value = o;
|
|
399
288
|
}
|
|
400
289
|
}
|
|
290
|
+
selections(t) {
|
|
291
|
+
let e = this.getSelectedOptions();
|
|
292
|
+
this.selectedOptions = Array.isArray(e) ? e : Array.from(e), this.selectedOptions.length >= +this.maxOptions && (this.counterEl = null), this.chips.innerHTML = "", this.selectedOptions.length > 0 ? this.selectedOptions.forEach((o, a) => {
|
|
293
|
+
this.selectionChanged(o, ++a);
|
|
294
|
+
}) : this.selectionChanged();
|
|
295
|
+
}
|
|
401
296
|
counter() {
|
|
402
297
|
if (this.counterEl && this.value.length === +this.maxOptions) {
|
|
403
|
-
this.counterEl.remove();
|
|
404
|
-
this.counterEl = null;
|
|
298
|
+
this.counterEl.remove(), this.counterEl = null;
|
|
405
299
|
return;
|
|
406
300
|
}
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
getChip(option) {
|
|
415
|
-
let chip = document.createElement("wj-chip");
|
|
416
|
-
chip.setAttribute("removable", "");
|
|
417
|
-
chip.setAttribute("color", "menu");
|
|
418
|
-
chip.addEventListener("wj:chip-remove", this.removeChip);
|
|
419
|
-
chip.option = option;
|
|
420
|
-
let label = document.createElement("wj-label");
|
|
421
|
-
label.innerText = option.textContent.trim();
|
|
422
|
-
chip.appendChild(label);
|
|
423
|
-
return chip;
|
|
301
|
+
this.counterEl || (this.counterEl = document.createElement("span"), this.counterEl.classList.add("counter"), this.chips.appendChild(this.counterEl)), this.counterEl.innerText = `+${this.value.length - +this.maxOptions}`;
|
|
302
|
+
}
|
|
303
|
+
getChip(t) {
|
|
304
|
+
let e = document.createElement("wj-chip");
|
|
305
|
+
e.setAttribute("removable", ""), e.setAttribute("color", "menu"), e.addEventListener("wj:chip-remove", this.removeChip), e.option = t;
|
|
306
|
+
let o = document.createElement("wj-label");
|
|
307
|
+
return o.innerText = t.textContent.trim(), e.appendChild(o), e;
|
|
424
308
|
}
|
|
425
309
|
}
|
|
426
|
-
customElements.get("wj-select") || window.customElements.define("wj-select",
|
|
427
|
-
const
|
|
428
|
-
|
|
310
|
+
customElements.get("wj-select") || window.customElements.define("wj-select", N);
|
|
311
|
+
const z = `/*!
|
|
312
|
+
* direction.scss
|
|
313
|
+
*/:host{--wj-font-size: 10px;--wj-tab-text-transfrom: uppercase;--wj-tab-font-weight: 500;--wj-tab-letter-spacing: .06em;--wj-tab-padding-inline: 1rem;--wj-tab-padding-top: .75rem;--wj-tab-padding-bottom: .75rem;--wj-tab-color-active: rgba(114, 82, 211, 1);--wj-tab-color-hover: rgba(114, 82, 211, .05);display:block;position:relative}:host a{display:block;align-items:center;white-space:nowrap;font-family:var(--wj-font-family-secondary);font-size:var(--wj-font-size);letter-spacing:var(--wj-tab-letter-spacing);text-transform:var(--wj-tab-text-transfrom);font-weight:var(--wj-tab-font-weight);text-decoration:none;padding-inline:var(--wj-tab-padding-inline);padding-top:var(--wj-tab-padding-top);padding-bottom:var(--wj-tab-padding-bottom);color:var(--wj-color)}:host a>svg{inline-size:1.5em;pointer-events:none}:host a:hover{background:var(--wj-tab-color-hover)}:host a:hover:after{display:block}:host a:after{content:" ";display:none;block-size:.15rem;writing-mode:var(--wj-tab-writing-mode);background:var(--wj-tab-color-active);position:absolute;bottom:var(--wj-tab-bottom);left:var(--wj-tab-start);right:var(--wj-tab-end);top:var(--wj-tab-top)}:host([disabled]) a{opacity:.5;cursor:not-allowed;background:inherit}:host([disabled]) a:after{display:none}:host([active]) a:after{display:block}
|
|
314
|
+
`;
|
|
315
|
+
class M extends u {
|
|
429
316
|
constructor() {
|
|
430
317
|
super();
|
|
431
|
-
|
|
432
|
-
this.last =
|
|
318
|
+
d(this, "className", "Tab");
|
|
319
|
+
this.last = !1;
|
|
433
320
|
}
|
|
434
321
|
static get cssStyleSheet() {
|
|
435
|
-
return
|
|
322
|
+
return z;
|
|
436
323
|
}
|
|
437
324
|
setupAttributes() {
|
|
438
325
|
this.isShadowRoot = "open";
|
|
439
326
|
}
|
|
440
|
-
draw(
|
|
441
|
-
let
|
|
442
|
-
|
|
443
|
-
a.setAttribute("href", "#" + this.panel);
|
|
444
|
-
a.innerHTML = this.innerHTML;
|
|
445
|
-
fragment.appendChild(a);
|
|
446
|
-
return fragment;
|
|
327
|
+
draw(t, e, o) {
|
|
328
|
+
let a = document.createDocumentFragment(), r = document.createElement("a");
|
|
329
|
+
return r.setAttribute("href", "#" + this.panel), r.innerHTML = this.innerHTML, a.appendChild(r), a;
|
|
447
330
|
}
|
|
448
331
|
afterDraw() {
|
|
449
|
-
|
|
332
|
+
v.addListener(this, "click", "wj:tab-change");
|
|
450
333
|
}
|
|
451
334
|
}
|
|
452
|
-
customElements.get("wj-tab") || window.customElements.define("wj-tab",
|
|
453
|
-
const
|
|
454
|
-
|
|
335
|
+
customElements.get("wj-tab") || window.customElements.define("wj-tab", M);
|
|
336
|
+
const P = `/*!
|
|
337
|
+
* direction.scss
|
|
338
|
+
*/:host{--wj-tab-top: 0;--wj-tab-start: 0;--wj-tab-end: 0;--wj-tab-bottom: 0}.native-tab-group{display:flex;flex-direction:column;overflow:hidden;position:relative}.native-tab-group>header{display:flex;flex-direction:column}.native-tab-group>header>nav{display:flex}.native-tab-group>section{width:100%}.native-tab-group>section>article{scroll-snap-align:start;overflow-y:auto;overscroll-behavior-y:contain;padding:var(--space-2) var(--space-3)}:host([variant=top]){--wj-tab-top: auto !important;--wj-tab-writing-mode: horizontal-tb}:host([variant=top]) .native-tab-group{flex-direction:column}:host([variant=top]) nav{border-bottom:1px solid rgba(0,0,0,.1)}:host([variant=start]){--wj-tab-start: auto !important;--wj-tab-writing-mode: vertical-rl}:host([variant=start]) .native-tab-group{flex-direction:row}:host([variant=start]) nav{flex-direction:column;border-right:1px solid rgba(0,0,0,.1)}:host([variant=end]){--wj-tab-writing-mode: vertical-rl}:host([variant=end]) .native-tab-group{flex-direction:row-reverse}:host([variant=end]) nav{flex-direction:column;border-left:1px solid rgba(0,0,0,.1)}:host([variant=bottom]){--wj-tab-bottom: auto !important;--wj-tab-writing-mode: horizontal-tb}:host([variant=bottom]) .native-tab-group{flex-direction:column-reverse}:host([variant=bottom]) nav{border-top:1px solid rgba(0,0,0,.1)}
|
|
339
|
+
`;
|
|
340
|
+
class H extends u {
|
|
455
341
|
constructor() {
|
|
456
342
|
super();
|
|
457
|
-
|
|
343
|
+
d(this, "className", "TabGroup");
|
|
458
344
|
}
|
|
459
345
|
static get cssStyleSheet() {
|
|
460
|
-
return
|
|
346
|
+
return P;
|
|
461
347
|
}
|
|
462
348
|
setupAttributes() {
|
|
463
349
|
this.isShadowRoot = "open";
|
|
464
350
|
}
|
|
465
|
-
draw(
|
|
466
|
-
let
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
let section = document.createElement("section");
|
|
473
|
-
let slot = document.createElement("slot");
|
|
474
|
-
let slotNav = document.createElement("slot");
|
|
475
|
-
slotNav.setAttribute("name", "nav");
|
|
476
|
-
header.appendChild(nav);
|
|
477
|
-
nav.appendChild(slotNav);
|
|
478
|
-
section.appendChild(slot);
|
|
479
|
-
native.appendChild(header);
|
|
480
|
-
native.appendChild(section);
|
|
481
|
-
fragment.appendChild(native);
|
|
482
|
-
return fragment;
|
|
351
|
+
draw(t, e, o) {
|
|
352
|
+
let a = document.createDocumentFragment(), r = document.createElement("div");
|
|
353
|
+
r.classList.add("native-tab-group");
|
|
354
|
+
let n = document.createElement("header");
|
|
355
|
+
n.classList.add("scroll-snap-x");
|
|
356
|
+
let p = document.createElement("nav"), c = document.createElement("section"), l = document.createElement("slot"), h = document.createElement("slot");
|
|
357
|
+
return h.setAttribute("name", "nav"), n.appendChild(p), p.appendChild(h), c.appendChild(l), r.appendChild(n), r.appendChild(c), a.appendChild(r), a;
|
|
483
358
|
}
|
|
484
359
|
afterDraw() {
|
|
485
360
|
console.log(this.context.querySelectorAll("[active]"));
|
|
486
|
-
let
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
console.log("TAB CHANGE", e.detail.context.hasAttribute("disabled"));
|
|
492
|
-
if (e.detail.context.hasAttribute("disabled"))
|
|
493
|
-
return false;
|
|
494
|
-
this.setActiveTab(e.detail.context.panel);
|
|
361
|
+
let t = this.getActiveTab(), e = t ? t[0].name : this.getTabAll()[0].panel;
|
|
362
|
+
console.log("NAME:", t, e, this.getTabAll()), this.setActiveTab(e), this.addEventListener("wj:tab-change", (o) => {
|
|
363
|
+
if (console.log("TAB CHANGE", o.detail.context.hasAttribute("disabled")), o.detail.context.hasAttribute("disabled"))
|
|
364
|
+
return !1;
|
|
365
|
+
this.setActiveTab(o.detail.context.panel);
|
|
495
366
|
});
|
|
496
367
|
}
|
|
497
368
|
removeActiveTab() {
|
|
498
|
-
this.getPanelAll().forEach((
|
|
499
|
-
|
|
500
|
-
})
|
|
501
|
-
|
|
502
|
-
el.removeAttribute("active");
|
|
369
|
+
this.getPanelAll().forEach((t) => {
|
|
370
|
+
t.removeAttribute("active");
|
|
371
|
+
}), this.getTabAll().forEach((t) => {
|
|
372
|
+
t.removeAttribute("active");
|
|
503
373
|
});
|
|
504
374
|
}
|
|
505
|
-
setActiveTab(
|
|
506
|
-
this.removeActiveTab();
|
|
507
|
-
this.querySelector(`[panel="${tab}"]`).setAttribute("active", "");
|
|
508
|
-
this.querySelector(`[name="${tab}"]`).setAttribute("active", "");
|
|
375
|
+
setActiveTab(t) {
|
|
376
|
+
this.removeActiveTab(), this.querySelector(`[panel="${t}"]`).setAttribute("active", ""), this.querySelector(`[name="${t}"]`).setAttribute("active", "");
|
|
509
377
|
}
|
|
510
378
|
getActiveTab() {
|
|
511
|
-
let
|
|
512
|
-
return
|
|
379
|
+
let t = Array.from(this.context.querySelectorAll("[active]"));
|
|
380
|
+
return t.length > 0 ? t[0] : null;
|
|
513
381
|
}
|
|
514
382
|
getTabAll() {
|
|
515
383
|
return this.context.querySelector('[name="nav"]').assignedElements();
|
|
@@ -518,96 +386,97 @@ class TabGroup extends WJElement {
|
|
|
518
386
|
return Array.from(this.querySelectorAll("wj-tab-panel"));
|
|
519
387
|
}
|
|
520
388
|
}
|
|
521
|
-
customElements.get("wj-tab-group") || window.customElements.define("wj-tab-group",
|
|
522
|
-
const
|
|
523
|
-
|
|
389
|
+
customElements.get("wj-tab-group") || window.customElements.define("wj-tab-group", H);
|
|
390
|
+
const $ = `/*!
|
|
391
|
+
* direction.scss
|
|
392
|
+
*/:host{display:none;flex-wrap:wrap;align-items:center;padding:1rem}:host([active]){display:block}
|
|
393
|
+
`;
|
|
394
|
+
class B extends u {
|
|
524
395
|
constructor() {
|
|
525
396
|
super();
|
|
526
|
-
|
|
397
|
+
d(this, "className", "TabPanel");
|
|
527
398
|
}
|
|
528
399
|
static get cssStyleSheet() {
|
|
529
|
-
return
|
|
400
|
+
return $;
|
|
530
401
|
}
|
|
531
402
|
setupAttributes() {
|
|
532
403
|
this.isShadowRoot = "open";
|
|
533
404
|
}
|
|
534
|
-
draw(
|
|
535
|
-
let
|
|
536
|
-
|
|
537
|
-
fragment.appendChild(element);
|
|
538
|
-
return fragment;
|
|
405
|
+
draw(t, e, o) {
|
|
406
|
+
let a = document.createDocumentFragment(), r = document.createElement("slot");
|
|
407
|
+
return a.appendChild(r), a;
|
|
539
408
|
}
|
|
540
409
|
}
|
|
541
|
-
customElements.get("wj-tab-panel") || window.customElements.define("wj-tab-panel",
|
|
410
|
+
customElements.get("wj-tab-panel") || window.customElements.define("wj-tab-panel", B);
|
|
542
411
|
export {
|
|
543
|
-
Aside,
|
|
544
|
-
Avatar,
|
|
545
|
-
Badge,
|
|
546
|
-
Breadcrumb,
|
|
547
|
-
Breadcrumbs,
|
|
548
|
-
Button,
|
|
549
|
-
ButtonGroup,
|
|
550
|
-
Card,
|
|
551
|
-
CardContent,
|
|
552
|
-
CardControls,
|
|
553
|
-
CardHeader,
|
|
554
|
-
CardSubtitle,
|
|
555
|
-
CardTitle,
|
|
556
|
-
Checkbox,
|
|
557
|
-
Chip,
|
|
558
|
-
Col,
|
|
559
|
-
ColorPicker,
|
|
560
|
-
Container,
|
|
561
|
-
CopyButton,
|
|
562
|
-
Dialog,
|
|
563
|
-
Divider,
|
|
564
|
-
Dropdown,
|
|
565
|
-
ExampleElement,
|
|
566
|
-
Footer,
|
|
567
|
-
Grid,
|
|
568
|
-
Header,
|
|
569
|
-
Icon,
|
|
570
|
-
IconPicker,
|
|
571
|
-
Img,
|
|
572
|
-
ImgComparer,
|
|
573
|
-
InfiniteScroll,
|
|
574
|
-
Input,
|
|
575
|
-
Item,
|
|
576
|
-
Label,
|
|
577
|
-
List,
|
|
578
|
-
Main,
|
|
579
|
-
Menu,
|
|
580
|
-
MenuButton,
|
|
581
|
-
MenuItem,
|
|
582
|
-
MenuLabel,
|
|
583
|
-
NavMenu,
|
|
584
|
-
Option,
|
|
585
|
-
Options,
|
|
586
|
-
Popup,
|
|
587
|
-
ProgressBar,
|
|
588
|
-
Radio,
|
|
589
|
-
RadioGroup,
|
|
590
|
-
Route,
|
|
591
|
-
RouterLink,
|
|
592
|
-
Routerx,
|
|
593
|
-
Row,
|
|
594
|
-
Select,
|
|
595
|
-
Slider,
|
|
596
|
-
SplitView,
|
|
597
|
-
Tab,
|
|
598
|
-
TabGroup,
|
|
599
|
-
TabPanel,
|
|
600
|
-
Textarea,
|
|
601
|
-
Thumbnail,
|
|
602
|
-
Toast,
|
|
603
|
-
Toggle,
|
|
604
|
-
Toolbar,
|
|
605
|
-
ToolbarAction,
|
|
606
|
-
Tooltip,
|
|
607
|
-
VisuallyHidden,
|
|
608
|
-
WJElement,
|
|
609
|
-
|
|
610
|
-
defaultStoreActions,
|
|
611
|
-
store,
|
|
612
|
-
|
|
412
|
+
X as Aside,
|
|
413
|
+
Z as Avatar,
|
|
414
|
+
et as Badge,
|
|
415
|
+
ot as Breadcrumb,
|
|
416
|
+
it as Breadcrumbs,
|
|
417
|
+
nt as Button,
|
|
418
|
+
ct as ButtonGroup,
|
|
419
|
+
pt as Card,
|
|
420
|
+
ut as CardContent,
|
|
421
|
+
bt as CardControls,
|
|
422
|
+
gt as CardHeader,
|
|
423
|
+
ft as CardSubtitle,
|
|
424
|
+
jt as CardTitle,
|
|
425
|
+
Et as Checkbox,
|
|
426
|
+
Ct as Chip,
|
|
427
|
+
Tt as Col,
|
|
428
|
+
Lt as ColorPicker,
|
|
429
|
+
Dt as Container,
|
|
430
|
+
Nt as CopyButton,
|
|
431
|
+
Mt as Dialog,
|
|
432
|
+
Ht as Divider,
|
|
433
|
+
Bt as Dropdown,
|
|
434
|
+
C as ExampleElement,
|
|
435
|
+
It as Footer,
|
|
436
|
+
Gt as Grid,
|
|
437
|
+
Vt as Header,
|
|
438
|
+
Jt as Icon,
|
|
439
|
+
Kt as IconPicker,
|
|
440
|
+
Xt as Img,
|
|
441
|
+
Zt as ImgComparer,
|
|
442
|
+
ee as InfiniteScroll,
|
|
443
|
+
oe as Input,
|
|
444
|
+
ie as Item,
|
|
445
|
+
ne as Label,
|
|
446
|
+
ce as List,
|
|
447
|
+
pe as Main,
|
|
448
|
+
ue as Menu,
|
|
449
|
+
be as MenuButton,
|
|
450
|
+
ge as MenuItem,
|
|
451
|
+
fe as MenuLabel,
|
|
452
|
+
T as NavMenu,
|
|
453
|
+
L as Option,
|
|
454
|
+
D as Options,
|
|
455
|
+
je as Popup,
|
|
456
|
+
Ee as ProgressBar,
|
|
457
|
+
Ce as Radio,
|
|
458
|
+
Te as RadioGroup,
|
|
459
|
+
Le as Route,
|
|
460
|
+
Ne as RouterLink,
|
|
461
|
+
De as Routerx,
|
|
462
|
+
Me as Row,
|
|
463
|
+
N as Select,
|
|
464
|
+
He as Slider,
|
|
465
|
+
Be as SplitView,
|
|
466
|
+
M as Tab,
|
|
467
|
+
H as TabGroup,
|
|
468
|
+
B as TabPanel,
|
|
469
|
+
Ie as Textarea,
|
|
470
|
+
Ge as Thumbnail,
|
|
471
|
+
Ve as Toast,
|
|
472
|
+
Je as Toggle,
|
|
473
|
+
Ke as Toolbar,
|
|
474
|
+
Xe as ToolbarAction,
|
|
475
|
+
Ze as Tooltip,
|
|
476
|
+
er as VisuallyHidden,
|
|
477
|
+
u as WJElement,
|
|
478
|
+
U as bindRouterLinks,
|
|
479
|
+
V as defaultStoreActions,
|
|
480
|
+
_ as store,
|
|
481
|
+
K as withRouterLinks
|
|
613
482
|
};
|