wj-elements 0.0.5 → 0.0.6
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/animation-2266bd6e.js +103 -0
- package/dist/localize-762a9f0f.js +43 -0
- package/dist/wj-animation.js +6 -0
- package/dist/wj-aside.js +8 -10
- package/dist/wj-avatar.js +19 -21
- package/dist/wj-badge.js +16 -16
- package/dist/wj-breadcrumb.js +7 -11
- package/dist/wj-breadcrumbs.js +5 -7
- package/dist/wj-button-group.js +11 -13
- package/dist/wj-button.js +36 -39
- package/dist/wj-card-content.js +11 -13
- package/dist/wj-card-controls.js +6 -8
- package/dist/wj-card-header.js +11 -13
- package/dist/wj-card-subtitle.js +9 -11
- package/dist/wj-card-title.js +7 -9
- package/dist/wj-card.js +13 -15
- package/dist/wj-carousel-item.js +32 -0
- package/dist/wj-carousel.js +178 -0
- package/dist/wj-checkbox.js +11 -11
- package/dist/wj-chip.js +17 -17
- package/dist/wj-col.js +11 -12
- package/dist/wj-color-picker.js +192 -179
- package/dist/wj-container.js +7 -9
- package/dist/wj-copy-button.js +1 -3
- package/dist/wj-dialog.js +20 -22
- package/dist/wj-divider.js +7 -9
- package/dist/wj-dropdown.js +10 -14
- package/dist/wj-element.js +9 -9
- package/dist/wj-file-upload-item.js +63 -0
- package/dist/wj-file-upload.js +221 -0
- package/dist/wj-footer.js +9 -11
- package/dist/wj-form.js +6 -8
- package/dist/wj-format-digital.js +51 -0
- package/dist/wj-grid.js +9 -10
- package/dist/wj-header.js +9 -11
- package/dist/wj-icon-picker.js +78 -58
- package/dist/wj-icon.js +45 -48
- package/dist/wj-img-comparer.js +12 -14
- package/dist/wj-img.js +14 -16
- package/dist/wj-infinite-scroll.js +27 -22
- package/dist/wj-input-file.js +47 -0
- package/dist/wj-input.js +30 -23
- package/dist/wj-item.js +1 -3
- package/dist/wj-label.js +10 -10
- package/dist/wj-list.js +1 -3
- package/dist/wj-main.js +1 -3
- package/dist/wj-masonry.js +71518 -0
- package/dist/wj-master.js +287 -253
- package/dist/wj-menu-button.js +10 -12
- package/dist/wj-menu-item.js +49 -46
- package/dist/wj-menu-label.js +2 -2
- package/dist/wj-menu.js +8 -10
- package/dist/wj-popup.js +89 -88
- package/dist/wj-progress-bar.js +14 -16
- package/dist/wj-radio-group.js +5 -7
- package/dist/wj-radio.js +13 -15
- package/dist/wj-rate.js +127 -0
- package/dist/wj-relative-time.js +50 -0
- package/dist/wj-router-link.js +11 -13
- package/dist/wj-row.js +11 -12
- package/dist/wj-slider.js +6 -6
- package/dist/wj-split-view.js +1 -3
- package/dist/wj-textarea.js +17 -19
- package/dist/wj-thumbnail.js +12 -14
- package/dist/wj-toast.js +1 -1
- package/dist/wj-toggle.js +9 -9
- package/dist/wj-toolbar.js +13 -15
- package/dist/wj-tooltip.js +16 -18
- package/dist/wj-visually-hidden.js +6 -8
- package/package.json +1 -1
- package/dist/style.css +0 -3
package/dist/wj-menu-button.js
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var i = (n, t, e) => t in n ?
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
|
+
var i = (n, t, e) => t in n ? u(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
3
|
var o = (n, t, e) => (i(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
-
import l, { event as
|
|
4
|
+
import l, { event as c } from "./wj-element.js";
|
|
5
5
|
import "./wj-store.js";
|
|
6
|
-
const
|
|
7
|
-
* direction.scss
|
|
8
|
-
*/:host{display:inline-flex}@media (min-width: 768px){:host{display:none}}
|
|
6
|
+
const a = `:host{display:inline-flex}@media (min-width: 768px){:host{display:none}}
|
|
9
7
|
`;
|
|
10
|
-
class
|
|
8
|
+
class m extends l {
|
|
11
9
|
constructor() {
|
|
12
10
|
super();
|
|
13
11
|
o(this, "className", "MenuButton");
|
|
14
12
|
}
|
|
15
13
|
static get cssStyleSheet() {
|
|
16
|
-
return
|
|
14
|
+
return a;
|
|
17
15
|
}
|
|
18
16
|
static get observedAttributes() {
|
|
19
17
|
return [];
|
|
@@ -26,12 +24,12 @@ class a extends l {
|
|
|
26
24
|
return s.appendChild(r), s;
|
|
27
25
|
}
|
|
28
26
|
afterDraw() {
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
c.addListener(this, "click", null, (e) => {
|
|
28
|
+
document.querySelector(`#${this.contentId}`).classList.toggle("open");
|
|
31
29
|
});
|
|
32
30
|
}
|
|
33
31
|
}
|
|
34
|
-
customElements.get("wj-menu-button") || window.customElements.define("wj-menu-button",
|
|
32
|
+
customElements.get("wj-menu-button") || window.customElements.define("wj-menu-button", m);
|
|
35
33
|
export {
|
|
36
|
-
|
|
34
|
+
m as MenuButton
|
|
37
35
|
};
|
package/dist/wj-menu-item.js
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
1
|
+
var g = Object.defineProperty;
|
|
2
|
+
var j = (o, n, e) => n in o ? g(o, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[n] = e;
|
|
3
|
+
var m = (o, n, e) => (j(o, typeof n != "symbol" ? n + "" : n, e), e);
|
|
4
|
+
import x, { WjElementUtils as y, event as l } from "./wj-element.js";
|
|
5
|
+
import { b as k } from "./router-links-e0087f84.js";
|
|
5
6
|
import "./wj-store.js";
|
|
6
|
-
const x =
|
|
7
|
-
* direction.scss
|
|
8
|
-
*/:host{--wj-menu-submenu-offset: 0;--wj-menu-item-padding-top: .5rem;--wj-menu-item-padding-bottom: .5rem;--wj-menu-item-line-height: 1.8rem;--wj-menu-item-safe-triangle-cursor-x: 0;--wj-menu-item-safe-triangle-cursor-y: 0;--wj-menu-item-safe-triangle-submenu-start-x: 0;--wj-menu-item-safe-triangle-submenu-start-y: 0;--wj-menu-item-safe-triangle-submenu-end-x: 0;--wj-menu-item-safe-triangle-submenu-end-y: 0;--wj-menu-item-color-hover: $color-contrast-high;--wj-menu-item-background-hover: $color-contrast-lower;--wj-menu-item-color-active: $color-contrast-high;--wj-menu-item-background-active: $color-contrast-lower;display:block}:host .native-menu-item{position:relative;display:flex;flex-wrap:nowrap;align-items:center;color:var(--wj-color);padding-top:var(--wj-menu-item-padding-top);padding-bottom:var(--wj-menu-item-padding-bottom);transition:var(--wj-transition-fast) fill;-webkit-user-select:none;user-select:none;white-space:nowrap;cursor:pointer;width:100%;line-height:var(--wj-menu-item-line-height)}:host .native-menu-item:hover,:host .native-menu-item:focus{color:var(--wj-menu-item-color-hover);background-color:var(--wj-menu-item-background-hover)}:host .native-menu-item:active{color:var(--wj-menu-item-color-active);background-color:var(--wj-menu-item-background-active)}:host .native-menu-item .label{flex:1 1 auto;display:inline-block;text-overflow:ellipsis;overflow:hidden}:host .native-menu-item .check-icon{flex:0 0 auto;display:var(--wj-menu-item-check-icon-display, flex);align-items:center;justify-content:center;width:1.5rem;visibility:hidden}:host .native-menu-item .check-icon.checked{visibility:visible}:host .native-menu-item .submenu-icon{--wj-icon-size: 14px !important;flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:1.5rem;visibility:hidden}:host .native-menu-item.has-submenu .submenu-icon{visibility:visible}:host .native-menu-item.expanded-submenu{color:var(--wj-menu-item-color-active);background-color:var(--wj-menu-item-background-active)}:host .native-menu-item.expanded-submenu:hover{color:var(--wj-menu-item-color-hover);background-color:var(--wj-menu-item-background-hover)}:host .native-menu-item.expanded-submenu:after{content:"";position:fixed;z-index:calc(var(--wj-z-index-menu) - 1);top:0;right:0;bottom:0;left:0;clip-path:polygon(var(--wj-menu-item-safe-triangle-cursor-x) var(--wj-menu-item-safe-triangle-cursor-y),var(--wj-menu-item-safe-triangle-submenu-start-x) var(--wj-menu-item-safe-triangle-submenu-start-y),var(--wj-menu-item-safe-triangle-submenu-end-x) var(--wj-menu-item-safe-triangle-submenu-end-y))}:host(:focus-visible){outline:none}::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-start:.5rem}:host(.wj-menu-variant-nav) ::slotted([slot=submenu]){--wj-menu-border-width: 0 !important}:host ::slotted([slot=start]){width:1.5rem}:host ::slotted([slot=submenu]){margin-left:var(--wj-menu-submenu-offset)}:host(.wj-menu-variant-context){display:block}:host(.wj-menu-collapse) .label,:host(.wj-menu-collapse) .submenu-icon{display:none!important}:host(.wj-menu-collapse) ::slotted([slot=end]){display:none}
|
|
7
|
+
const A = `:host{--wj-menu-item-color: var(--wj-color);--wj-menu-item-background: transparent;--wj-menu-item-color-hover: var(--wj-color-contrast-8);--wj-menu-item-background-hover: var(--wj-border-color);--wj-menu-item-color-focus: var(--wj-color-contrast-8);--wj-menu-item-background-focus: var(--wj-border-color);--wj-menu-item-color-active: var(--wj-color-contrast-8);--wj-menu-item-background-active: var(--wj-border-color);--wj-menu-item-padding-top: .5rem;--wj-menu-item-padding-bottom: .5rem;--wj-menu-item-line-height: 1.8rem;--wj-menu-item-safe-triangle-cursor-x: 0;--wj-menu-item-safe-triangle-cursor-y: 0;--wj-menu-item-safe-triangle-submenu-start-x: 0;--wj-menu-item-safe-triangle-submenu-start-y: 0;--wj-menu-item-safe-triangle-submenu-end-x: 0;--wj-menu-item-safe-triangle-submenu-end-y: 0;--wj-menu-submenu-offset: 0;--wj-menu-item-icon-visibility: hidden;display:block}:host .native-menu-item{background:var(--wj-menu-item-background);position:relative;display:flex;flex-wrap:nowrap;align-items:center;color:var(--wj-menu-item-color);padding-top:var(--wj-menu-item-padding-top);padding-bottom:var(--wj-menu-item-padding-bottom);transition:var(--wj-transition-fast) fill;-webkit-user-select:none;user-select:none;white-space:nowrap;cursor:pointer;width:100%;line-height:var(--wj-menu-item-line-height)}:host .native-menu-item:hover{color:var(--wj-menu-item-color-hover);background:var(--wj-menu-item-background-hover)}:host .native-menu-item:focus{color:var(--wj-menu-item-color-focus);background:var(--wj-menu-item-background-focus)}:host .native-menu-item:active{color:var(--wj-menu-item-color-active);background:var(--wj-menu-item-background-active)}:host .native-menu-item .label{flex:1 1 auto;display:inline-block;text-overflow:ellipsis;overflow:hidden}:host .native-menu-item .check-icon{flex:0 0 auto;display:var(--wj-menu-item-check-icon-display, flex);align-items:center;justify-content:center;width:1.5rem;visibility:hidden}:host .native-menu-item .check-icon.checked{visibility:visible}:host .native-menu-item.expanded-submenu{color:var(--wj-menu-item-color-active);background:var(--wj-menu-item-background-active)}:host .native-menu-item.expanded-submenu:hover{color:var(--wj-menu-item-color-hover);background:var(--wj-menu-item-background-hover)}:host .native-menu-item.expanded-submenu:after{content:"";position:fixed;z-index:1;top:0;right:0;bottom:0;left:0;clip-path:polygon(var(--wj-menu-item-safe-triangle-cursor-x) var(--wj-menu-item-safe-triangle-cursor-y),var(--wj-menu-item-safe-triangle-submenu-start-x) var(--wj-menu-item-safe-triangle-submenu-start-y),var(--wj-menu-item-safe-triangle-submenu-end-x) var(--wj-menu-item-safe-triangle-submenu-end-y))}.submenu-icon{--wj-icon-size: 14px !important;flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:1.5rem;visibility:var(--wj-menu-item-icon-visibility)}.has-submenu .submenu-icon{--wj-menu-item-icon-visibility: visible}.submenu-icon.collapse{flex:none;right:10px;position:relative}:host(:focus-visible){outline:none}::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-start:.5rem}:host(.wj-menu-variant-nav) ::slotted([slot=submenu]){--wj-menu-border-width: 0 !important;--wj-menu-margin-inline: 2rem 0 !important}:host ::slotted([slot=start]){width:1.5rem}:host(.wj-menu-variant-context){display:block}:host(.active){color:var(--wj-menu-item-color-active);background:var(--wj-menu-item-background-active)}:host(.open){color:var(--wj-menu-item-color-active);background:var(--wj-menu-item-background-active)}
|
|
9
8
|
`;
|
|
10
|
-
class
|
|
9
|
+
class L extends x {
|
|
11
10
|
constructor() {
|
|
12
11
|
super();
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
m(this, "className", "MenuItem");
|
|
13
|
+
m(this, "dispatchMove", (e) => {
|
|
15
14
|
this.style.setProperty("--wj-menu-item-safe-triangle-cursor-x", `${e.clientX}px`), this.style.setProperty("--wj-menu-item-safe-triangle-cursor-y", `${e.clientY}px`);
|
|
16
15
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
m(this, "dispatchReposition", (e) => {
|
|
17
|
+
if (this.submenu.assignedNodes().length === 0)
|
|
18
|
+
return;
|
|
19
|
+
let i = this.submenu.assignedNodes()[0];
|
|
20
|
+
const { left: c, top: s, width: t, height: a } = i.getBoundingClientRect();
|
|
20
21
|
this.style.setProperty("--wj-menu-item-safe-triangle-submenu-start-x", `${c}px`), this.style.setProperty("--wj-menu-item-safe-triangle-submenu-start-y", `${s}px`), this.style.setProperty("--wj-menu-item-safe-triangle-submenu-end-x", `${c}px`), this.style.setProperty("--wj-menu-item-safe-triangle-submenu-end-y", `${s + a}px`);
|
|
21
22
|
});
|
|
22
|
-
this.hasSubmenu = y.hasSlot(this, "submenu"), this._collapsible = !1;
|
|
23
|
+
k(this, { selector: !1 }), this.hasSubmenu = y.hasSlot(this, "submenu"), this._collapsible = !1;
|
|
23
24
|
}
|
|
24
25
|
get placement() {
|
|
25
26
|
let e = this.querySelector("wj-menu");
|
|
@@ -31,71 +32,73 @@ class A extends j {
|
|
|
31
32
|
}
|
|
32
33
|
get variant() {
|
|
33
34
|
let e = this.querySelector("wj-menu");
|
|
34
|
-
return e != null && e.hasAttribute("variant") ? e.getAttribute("variant").toUpperCase() : "CONTEXT";
|
|
35
|
+
return e != null && e.hasAttribute("variant") && !this.collapse ? e.getAttribute("variant").toUpperCase() : "CONTEXT";
|
|
35
36
|
}
|
|
36
37
|
get collapse() {
|
|
37
38
|
var e;
|
|
38
39
|
return (e = this.parentElement) == null ? void 0 : e.hasAttribute("collapse");
|
|
39
40
|
}
|
|
40
41
|
static get cssStyleSheet() {
|
|
41
|
-
return
|
|
42
|
+
return A;
|
|
42
43
|
}
|
|
43
44
|
static get observedAttributes() {
|
|
44
45
|
return [];
|
|
45
46
|
}
|
|
46
47
|
setupAttributes() {
|
|
47
|
-
super.setupAttributes(), this.isShadowRoot = "open";
|
|
48
|
+
super.setupAttributes(), this.isShadowRoot = "open", this.setAttribute("active-class", "open");
|
|
48
49
|
}
|
|
49
|
-
draw(e,
|
|
50
|
+
draw(e, i, c) {
|
|
50
51
|
var w;
|
|
51
52
|
let s = document.createDocumentFragment();
|
|
52
|
-
this.classList.add("wj-menu-variant-" + this.variant.toLowerCase()), (w = this.querySelector("wj-menu")) == null || w.setAttribute("variant", this.variant.toLowerCase())
|
|
53
|
+
this.setAttribute("tabindex", "0"), this.classList.add("wj-menu-variant-" + this.variant.toLowerCase()), (w = this.querySelector("wj-menu")) == null || w.setAttribute("variant", this.variant.toLowerCase());
|
|
53
54
|
let t = document.createElement("div");
|
|
54
|
-
t.setAttribute("
|
|
55
|
+
t.setAttribute("part", "native"), t.setAttribute("id", "anchor"), t.classList.add("native-menu-item");
|
|
55
56
|
let a = document.createElement("span");
|
|
56
57
|
a.classList.add("check-icon"), a.innerHTML = '<wj-icon name="check"></wj-icon>', this.hasAttribute("checked") ? a.classList.add("checked") : a.classList.remove("checked");
|
|
57
|
-
let
|
|
58
|
-
|
|
58
|
+
let h = document.createElement("slot");
|
|
59
|
+
h.name = "start";
|
|
59
60
|
let p = document.createElement("slot");
|
|
60
61
|
p.classList.add("label");
|
|
61
62
|
let b = document.createElement("slot");
|
|
62
63
|
b.name = "end";
|
|
63
64
|
let u = document.createElement("slot");
|
|
64
65
|
u.setAttribute("part", "submenu"), u.name = "submenu";
|
|
65
|
-
let
|
|
66
|
-
|
|
66
|
+
let f = this.collapse ? "collapse" : "expand", d = document.createElement("span");
|
|
67
|
+
d.classList.add("submenu-icon", f), d.innerHTML = this.collapse ? '<wj-icon name="chevron-down"></wj-icon>' : '<wj-icon name="chevron-right"></wj-icon>', this.hasSubmenu ? t.classList.add("has-submenu") : t.classList.remove("has-submenu"), t.appendChild(a), t.appendChild(h), t.appendChild(p), t.appendChild(b), t.appendChild(d);
|
|
67
68
|
let v = !1;
|
|
68
|
-
if (
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
if (
|
|
70
|
+
/*(this.collapse && this.variant === "NAV" && this.hasSubmenu) || */
|
|
71
|
+
this.variant === "CONTEXT" && this.hasSubmenu
|
|
72
|
+
) {
|
|
73
|
+
t.setAttribute("slot", "anchor");
|
|
74
|
+
let r = document.createElement("wj-popup");
|
|
75
|
+
r.setAttribute("anchor", "anchor"), r.setAttribute("placement", this.placement), r.setAttribute("offset", this.offset), r.appendChild(t), r.appendChild(u), this.popup = r, s.appendChild(r), v = !0;
|
|
71
76
|
}
|
|
72
|
-
|
|
73
|
-
let i = document.createElement("wj-tooltip");
|
|
74
|
-
i.setAttribute("content", this.textContent), i.setAttribute("placement", "right"), i.setAttribute("offset", this.offset || "0"), i.appendChild(t), s.appendChild(i);
|
|
75
|
-
} else
|
|
76
|
-
v || s.appendChild(t);
|
|
77
|
-
return (!this.collapse && this.variant === "NAV" || this.variant === "MEGAMENU" && this.hasSubmenu) && s.appendChild(u), s;
|
|
77
|
+
return this.collapse && !this.hasSubmenu ? s.appendChild(this.collapseItem(t)) : v || s.appendChild(t), (!this.collapse && this.variant === "NAV" || this.variant === "MEGAMENU" && this.hasSubmenu) && s.appendChild(u), this.native = t, this.submenu = u, s;
|
|
78
78
|
}
|
|
79
79
|
afterDraw() {
|
|
80
|
-
this.addEventListener("mousemove", this.dispatchMove), this.addEventListener("wj-popup:reposition", this.dispatchReposition),
|
|
81
|
-
this.hasAttribute("manual") || (e.stopPropagation(), this.showSubmenu(), this.focus());
|
|
82
|
-
}),
|
|
83
|
-
e.relatedTarget && this.contains(e.relatedTarget) || this.hideSubmenu();
|
|
84
|
-
}), !this.collapse && this.variant === "NAV" && this.hasSubmenu ?
|
|
85
|
-
let
|
|
86
|
-
|
|
87
|
-
}) :
|
|
88
|
-
console.log("CLICK", this);
|
|
80
|
+
this.addEventListener("mousemove", this.dispatchMove), this.addEventListener("wj-popup:reposition", this.dispatchReposition), l.addListener(this, "mouseover", null, (e) => {
|
|
81
|
+
this.hasAttribute("manual") || this.variant === "NAV" && !this.collapse || (e.stopPropagation(), this.showSubmenu(), this.focus());
|
|
82
|
+
}), l.addListener(this, "focusout", null, (e) => {
|
|
83
|
+
e.relatedTarget && this.contains(e.relatedTarget) || this.variant === "NAV" && !this.collapse || this.hideSubmenu();
|
|
84
|
+
}), !this.collapse && this.variant === "NAV" && this.hasSubmenu ? l.addListener(this, "click", null, (e) => {
|
|
85
|
+
let i = this.submenu.assignedElements({ flatten: !0 })[0];
|
|
86
|
+
i.hasAttribute("active") ? this === e.target && i.removeAttribute("active") : i.setAttribute("active", ""), e.stopPropagation();
|
|
87
|
+
}) : l.addListener(this, "click", null, (e) => {
|
|
89
88
|
});
|
|
90
89
|
}
|
|
90
|
+
collapseItem(e) {
|
|
91
|
+
let i = document.createElement("wj-tooltip");
|
|
92
|
+
return i.setAttribute("content", this.textContent), i.setAttribute("placement", "right"), i.setAttribute("offset", this.offset || "0"), i.appendChild(e), i;
|
|
93
|
+
}
|
|
91
94
|
showSubmenu() {
|
|
92
|
-
this.tabIndex = -1, this.hasSubmenu && (this.popup.setAttribute("active", ""), this.native.classList.add("expanded-submenu"));
|
|
95
|
+
this.tabIndex = -1, this.hasSubmenu && (this.popup.setAttribute("active", ""), this.classList.add("expanded-submenu"), this.native.classList.add("expanded-submenu"));
|
|
93
96
|
}
|
|
94
97
|
hideSubmenu() {
|
|
95
|
-
this.tabIndex = 0, this.hasSubmenu && (this.popup.removeAttribute("active"), this.native.classList.remove("expanded-submenu"));
|
|
98
|
+
this.tabIndex = 0, this.hasSubmenu && (this.popup.removeAttribute("active"), this.classList.remove("expanded-submenu"), this.native.classList.remove("expanded-submenu"));
|
|
96
99
|
}
|
|
97
100
|
}
|
|
98
|
-
customElements.get("wj-menu-item") || window.customElements.define("wj-menu-item",
|
|
101
|
+
customElements.get("wj-menu-item") || window.customElements.define("wj-menu-item", L);
|
|
99
102
|
export {
|
|
100
|
-
|
|
103
|
+
L as MenuItem
|
|
101
104
|
};
|
package/dist/wj-menu-label.js
CHANGED
|
@@ -5,7 +5,7 @@ import i, { WjElementUtils as m } from "./wj-element.js";
|
|
|
5
5
|
import "./wj-store.js";
|
|
6
6
|
const d = `/*!
|
|
7
7
|
* direction.scss
|
|
8
|
-
*/:host{--wj-menu-label-font-size: .75rem;--wj-menu-label-weight: 600;--wj-letter-spacing: .025rem;--wj-menu-label-color:
|
|
8
|
+
*/:host{--wj-menu-label-font-size: .75rem;--wj-menu-label-weight: 600;--wj-letter-spacing: .025rem;--wj-menu-label-color: var(--wj-color-contrast-6);--wj-padding-top: 0;--wj-padding-bottom: 0;--wj-padding-start: 1.5rem;--wj-padding-end: 1.5rem}:host .native-menu-label{font-size:var(--wj-menu-label-font-size);display:inline-block;font-weight:var(--wj-menu-label-weight);letter-spacing:var(--wj-letter-spacing);color:var(--wj-menu-label-color);padding:var(--wj-padding-top) var(--wj-padding-start) var(--wj-padding-bottom) var(--wj-padding-end)}
|
|
9
9
|
`;
|
|
10
10
|
class u extends i {
|
|
11
11
|
constructor() {
|
|
@@ -22,7 +22,7 @@ class u extends i {
|
|
|
22
22
|
setupAttributes() {
|
|
23
23
|
this.isShadowRoot = "open";
|
|
24
24
|
}
|
|
25
|
-
draw(n, c,
|
|
25
|
+
draw(n, c, w) {
|
|
26
26
|
let s = document.createDocumentFragment(), a = document.createElement("slot");
|
|
27
27
|
return a.setAttribute("part", "base"), a.classList.add("native-menu-label"), s.appendChild(a), s;
|
|
28
28
|
}
|
package/dist/wj-menu.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var a = (
|
|
4
|
-
import
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var d = (n, e, t) => e in n ? m(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var a = (n, e, t) => (d(n, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import s from "./wj-element.js";
|
|
5
5
|
import "./wj-store.js";
|
|
6
|
-
const u =
|
|
7
|
-
* direction.scss
|
|
8
|
-
*/:host{--wj-menu-background: #fff;--wj-menu-border-width: 1px;--wj-menu-border-style: solid;--wj-menu-border-color: var(--wj-border-color);--wj-menu-border-radius: 4px;--wj-menu-padding-top: .5rem;--wj-menu-padding-bottom: .5rem;--wj-menu-padding-inline: 0;--wj-menu-z-index: 900;display:none;background:var(--wj-menu-background);position:relative;border-width:var(--wj-menu-border-width);border-style:var(--wj-menu-border-style);border-color:var(--wj-menu-border-color);z-index:var(--wj-menu-z-index);border-radius:var(--wj-menu-border-radius);-webkit-border-radius:var(--wj-menu-border-radius);-moz-border-radius:var(--wj-menu-border-radius);padding-top:var(--wj-menu-padding-top);padding-bottom:var(--wj-menu-padding-bottom);padding-inline:var(--wj-menu-padding-inline);overflow:auto;overscroll-behavior:none}:host .native-menu{display:flex;flex-direction:column;width:100%}:host .native-menu ::slotted(wj-button){margin:0}:host(.wj-menu-collapse){max-width:70px!important}:host([variant=context]){display:block!important;margin-left:var(--wj-menu-submenu-offset)}:host([variant=megamenu]) .native-menu{flex-direction:row;align-items:end;flex-wrap:nowrap}:host([variant=megamenu]) .native-menu .check-icon{display:none}:host([active]){display:flex!important}
|
|
6
|
+
const u = `:host{--wj-menu-background: var(--wj-background);--wj-menu-border-width: 1px;--wj-menu-border-style: solid;--wj-menu-border-color: var(--wj-border-color);--wj-menu-border-radius: 4px;--wj-menu-padding-top: .5rem;--wj-menu-padding-bottom: .5rem;--wj-menu-padding-inline: 0;--wj-menu-margin-top: ;--wj-menu-margin-bottom: 0;--wj-menu-margin-inline: 0;--wj-menu-z-index: 900;display:none;background:var(--wj-menu-background);position:relative;border-width:var(--wj-menu-border-width);border-style:var(--wj-menu-border-style);border-color:var(--wj-menu-border-color);z-index:var(--wj-menu-z-index);border-radius:var(--wj-border-radius-small);padding-top:var(--wj-menu-padding-top);padding-bottom:var(--wj-menu-padding-bottom);padding-inline:var(--wj-menu-padding-inline);margin-top:var(--wj-menu-margin-top);margin-bottom:var(--wj-menu-margin-bottom);margin-inline:var(--wj-menu-margin-inline);overflow:auto;overscroll-behavior:none}:host .native-menu{display:flex;flex-direction:column;width:100%}:host .native-menu ::slotted(wj-button){margin:0}:host(.wj-menu-collapse){max-width:70px!important}:host([variant=context]){display:block!important;margin-left:var(--wj-menu-submenu-offset)}:host([variant=megamenu]) .native-menu{flex-direction:row;align-items:end;flex-wrap:nowrap}:host([variant=megamenu]) .native-menu .check-icon{display:none}:host([active]){display:flex!important}
|
|
9
7
|
`;
|
|
10
|
-
class l extends
|
|
8
|
+
class l extends s {
|
|
11
9
|
constructor() {
|
|
12
10
|
super();
|
|
13
11
|
a(this, "className", "Menu");
|
|
@@ -16,12 +14,12 @@ class l extends m {
|
|
|
16
14
|
return u;
|
|
17
15
|
}
|
|
18
16
|
static get observedAttributes() {
|
|
19
|
-
return ["active"];
|
|
17
|
+
return ["active", "collapse"];
|
|
20
18
|
}
|
|
21
19
|
setupAttributes() {
|
|
22
20
|
this.isShadowRoot = "open";
|
|
23
21
|
}
|
|
24
|
-
draw(
|
|
22
|
+
draw(t, w, c) {
|
|
25
23
|
let o = document.createDocumentFragment();
|
|
26
24
|
this.classList.remove("wj-menu-collapse"), this.hasAttribute("collapse") && this.classList.add("wj-menu-collapse");
|
|
27
25
|
let r = document.createElement("div");
|