wj-elements 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/dark.css +1 -1
  2. package/dist/light.css +1 -1
  3. package/dist/{localize-7fxVJArK.js → localize-DVuO3S17.js} +1 -1
  4. package/dist/{popup.element-BXak-Fgc.js → popup.element-Dj9j__Dh.js} +329 -350
  5. package/dist/styles.css +1 -1
  6. package/dist/wje-accordion-item.js +88 -0
  7. package/dist/wje-accordion.js +79 -0
  8. package/dist/wje-animation.js +10 -11
  9. package/dist/wje-avatar.js +31 -29
  10. package/dist/wje-badge.js +7 -7
  11. package/dist/wje-breadcrumb.js +11 -11
  12. package/dist/wje-button.js +22 -29
  13. package/dist/wje-carousel.js +8 -9
  14. package/dist/wje-checkbox.js +81 -23
  15. package/dist/wje-dialog.js +53 -25
  16. package/dist/wje-dropdown.js +36 -23
  17. package/dist/wje-element.js +100 -89
  18. package/dist/wje-file-upload-item.js +3 -4
  19. package/dist/wje-file-upload.js +40 -43
  20. package/dist/wje-format-digital.js +1 -1
  21. package/dist/wje-icon-picker.js +1 -1
  22. package/dist/wje-icon.js +115 -3
  23. package/dist/wje-img-comparer.js +1 -2
  24. package/dist/wje-infinite-scroll.js +71 -41
  25. package/dist/wje-inline-edit.js +1 -2
  26. package/dist/wje-input-file.js +26 -18
  27. package/dist/wje-input.js +1 -1
  28. package/dist/wje-master.js +323 -168
  29. package/dist/wje-menu-item.js +33 -31
  30. package/dist/wje-menu.js +7 -7
  31. package/dist/wje-option.js +97 -3
  32. package/dist/wje-options.js +1 -1
  33. package/dist/wje-popup.js +1 -1
  34. package/dist/wje-progress-bar.js +5 -5
  35. package/dist/wje-radio-group.js +1 -1
  36. package/dist/wje-radio.js +1 -1
  37. package/dist/wje-relative-time.js +4 -13
  38. package/dist/wje-select.js +9 -10
  39. package/dist/wje-slider.js +40 -79
  40. package/dist/wje-tab.js +9 -9
  41. package/dist/wje-toast.js +16 -16
  42. package/dist/wje-toggle.js +39 -15
  43. package/dist/wje-tooltip.js +47 -23
  44. package/package.json +2 -1
  45. package/dist/custom-elements.json +0 -12216
  46. package/dist/icon.element-DOiXP3pi.js +0 -115
  47. package/dist/option.element-CpeafIM-.js +0 -98
  48. package/dist/styles-4vJ2wdTZ.js +0 -4
  49. package/dist/web-types.json +0 -2756
@@ -1,34 +1,34 @@
1
1
  var x = Object.defineProperty;
2
- var A = (r, a, e) => a in r ? x(r, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[a] = e;
3
- var m = (r, a, e) => (A(r, typeof a != "symbol" ? a + "" : a, e), e);
4
- import k, { WjElementUtils as S, event as h } from "./wje-element.js";
5
- import { b as L } from "./router-links-FtZbFUto.js";
6
- const E = ':host{--wje-menu-item-color: var(--wje-color);--wje-menu-item-background: transparent;--wje-menu-item-color-hover: var(--wje-color-contrast-8);--wje-menu-item-background-hover: var(--wje-border-color);--wje-menu-item-color-focus: var(--wje-color-contrast-8);--wje-menu-item-background-focus: var(--wje-border-color);--wje-menu-item-color-active: var(--wje-color-contrast-8);--wje-menu-item-background-active: var(--wje-border-color);--wje-menu-item-padding-top: .5rem;--wje-menu-item-padding-bottom: .5rem;--wje-menu-item-line-height: 1.8rem;--wje-menu-item-safe-triangle-cursor-x: 0;--wje-menu-item-safe-triangle-cursor-y: 0;--wje-menu-item-safe-triangle-submenu-start-x: 0;--wje-menu-item-safe-triangle-submenu-start-y: 0;--wje-menu-item-safe-triangle-submenu-end-x: 0;--wje-menu-item-safe-triangle-submenu-end-y: 0;--wje-menu-submenu-offset: 0;--wje-menu-item-icon-visibility: hidden;display:block}:host .native-menu-item{background:var(--wje-menu-item-background);position:relative;display:flex;flex-wrap:nowrap;align-items:center;justify-content:center;color:var(--wje-menu-item-color);padding-top:var(--wje-menu-item-padding-top);padding-bottom:var(--wje-menu-item-padding-bottom);transition:var(--wje-transition-fast) fill;-webkit-user-select:none;user-select:none;white-space:nowrap;cursor:pointer;width:100%}:host .native-menu-item:hover{color:var(--wje-menu-item-color-hover);background:var(--wje-menu-item-background-hover)}:host .native-menu-item:focus{color:var(--wje-menu-item-color-focus);background:var(--wje-menu-item-background-focus)}:host .native-menu-item:active{color:var(--wje-menu-item-color-active);background:var(--wje-menu-item-background-active)}:host .native-menu-item .label{flex:1 1 auto;display:inline-block;text-overflow:ellipsis;overflow:hidden;line-height:normal}:host .native-menu-item .check-icon{flex:0 0 auto;display:var(--wje-menu-item-check-icon-display, flex);align-items:center;justify-content:center;width:var(--wje-menu-check-icon-width, 1.5rem);visibility:hidden}:host .native-menu-item .check-icon.checked{visibility:visible}:host .native-menu-item.expanded-submenu{color:var(--wje-menu-item-color-active);background:var(--wje-menu-item-background-active)}:host .native-menu-item.expanded-submenu:hover{color:var(--wje-menu-item-color-hover);background:var(--wje-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;//background: yellow;clip-path:polygon(var(--wje-menu-item-safe-triangle-cursor-x) var(--wje-menu-item-safe-triangle-cursor-y),var(--wje-menu-item-safe-triangle-submenu-start-x) var(--wje-menu-item-safe-triangle-submenu-start-y),var(--wje-menu-item-safe-triangle-submenu-end-x) var(--wje-menu-item-safe-triangle-submenu-end-y))}:host(.collapse) ::slotted([slot="start"]){margin:0;width:auto;display:contents}:host(.collapse) ::slotted([slot="end"]){display:none}:host(.collapse) .label,:host(.collapse) .check-icon,:host(.collapse) .submenu-icon{display:none}.submenu-icon{--wje-icon-size: 14px !important;flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:1.5rem;visibility:var(--wje-menu-item-icon-visibility)}.has-submenu .submenu-icon{--wje-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(.wje-menu-variant-nav) ::slotted([slot="submenu"]){--wje-menu-border-width: 0 !important;--wje-menu-margin-inline: 2rem 0 !important}:host ::slotted([slot="start"]){width:1.5rem}:host(.wje-menu-variant-context){display:block}:host(.active){color:var(--wje-menu-item-color-active);background:var(--wje-menu-item-background-active)}:host(.open){color:var(--wje-menu-item-color-active);background:var(--wje-menu-item-background-active)}';
7
- class j extends k {
2
+ var A = (o, a, e) => a in o ? x(o, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[a] = e;
3
+ var c = (o, a, e) => (A(o, typeof a != "symbol" ? a + "" : a, e), e);
4
+ import k, { WjElementUtils as L, event as l } from "./wje-element.js";
5
+ import { b as E } from "./router-links-FtZbFUto.js";
6
+ const S = ':host{--wje-menu-item-color: var(--wje-color);--wje-menu-item-background: transparent;--wje-menu-item-color-hover: var(--wje-color-contrast-8);--wje-menu-item-background-hover: var(--wje-border-color);--wje-menu-item-color-focus: var(--wje-color-contrast-8);--wje-menu-item-background-focus: var(--wje-border-color);--wje-menu-item-color-active: var(--wje-color-contrast-8);--wje-menu-item-background-active: var(--wje-border-color);--wje-menu-item-padding-top: .5rem;--wje-menu-item-padding-bottom: .5rem;--wje-menu-item-line-height: 1.8rem;--wje-menu-item-safe-triangle-cursor-x: 0;--wje-menu-item-safe-triangle-cursor-y: 0;--wje-menu-item-safe-triangle-submenu-start-x: 0;--wje-menu-item-safe-triangle-submenu-start-y: 0;--wje-menu-item-safe-triangle-submenu-end-x: 0;--wje-menu-item-safe-triangle-submenu-end-y: 0;--wje-menu-submenu-offset: 0;--wje-menu-item-icon-visibility: hidden;display:block}:host .native-menu-item{background:var(--wje-menu-item-background);position:relative;display:flex;flex-wrap:nowrap;align-items:center;justify-content:center;color:var(--wje-menu-item-color);padding-top:var(--wje-menu-item-padding-top);padding-bottom:var(--wje-menu-item-padding-bottom);transition:var(--wje-transition-fast) fill;-webkit-user-select:none;user-select:none;white-space:nowrap;cursor:pointer;width:100%}:host .native-menu-item:hover{color:var(--wje-menu-item-color-hover);background:var(--wje-menu-item-background-hover)}:host .native-menu-item:focus{color:var(--wje-menu-item-color-focus);background:var(--wje-menu-item-background-focus)}:host .native-menu-item:active{color:var(--wje-menu-item-color-active);background:var(--wje-menu-item-background-active)}:host .native-menu-item .label{flex:1 1 auto;display:inline-block;text-overflow:ellipsis;overflow:hidden;line-height:normal}:host .native-menu-item .check-icon{flex:0 0 auto;display:var(--wje-menu-item-check-icon-display, flex);align-items:center;justify-content:center;width:var(--wje-menu-check-icon-width, 1.5rem);visibility:hidden}:host .native-menu-item .check-icon.checked{visibility:visible}:host .native-menu-item.expanded-submenu{color:var(--wje-menu-item-color-active);background:var(--wje-menu-item-background-active)}:host .native-menu-item.expanded-submenu:hover{color:var(--wje-menu-item-color-hover);background:var(--wje-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;//background: yellow;clip-path:polygon(var(--wje-menu-item-safe-triangle-cursor-x) var(--wje-menu-item-safe-triangle-cursor-y),var(--wje-menu-item-safe-triangle-submenu-start-x) var(--wje-menu-item-safe-triangle-submenu-start-y),var(--wje-menu-item-safe-triangle-submenu-end-x) var(--wje-menu-item-safe-triangle-submenu-end-y))}:host(.collapse) ::slotted([slot="start"]){margin:0;width:auto;display:contents}:host(.collapse) ::slotted([slot="end"]){display:none}:host(.collapse) .label,:host(.collapse) .check-icon,:host(.collapse) .submenu-icon{display:none}.submenu-icon{--wje-icon-size: 14px !important;flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:1.5rem;visibility:var(--wje-menu-item-icon-visibility)}.has-submenu .submenu-icon{--wje-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(.wje-menu-variant-nav) ::slotted([slot="submenu"]){--wje-menu-border-width: 0 !important;--wje-menu-margin-inline: 2rem 0 !important}:host ::slotted([slot="start"]){width:1.5rem}:host(.wje-menu-variant-context){display:block}:host(.active){color:var(--wje-menu-item-color-active);background:var(--wje-menu-item-background-active)}:host(.open){color:var(--wje-menu-item-color-active);background:var(--wje-menu-item-background-active)}';
7
+ class g extends k {
8
8
  /**
9
9
  * Constructor for MenuItem class.
10
10
  * @constructor
11
11
  */
12
12
  constructor() {
13
13
  super();
14
- m(this, "className", "MenuItem");
14
+ c(this, "className", "MenuItem");
15
15
  /**
16
16
  * Dispatches a mousemove event.
17
17
  */
18
- m(this, "dispatchMove", (e) => {
18
+ c(this, "dispatchMove", (e) => {
19
19
  this.style.setProperty("--wje-menu-item-safe-triangle-cursor-x", `${e.clientX}px`), this.style.setProperty("--wje-menu-item-safe-triangle-cursor-y", `${e.clientY}px`);
20
20
  });
21
21
  /**
22
22
  * Dispatches a reposition event.
23
23
  */
24
- m(this, "dispatchReposition", (e) => {
24
+ c(this, "dispatchReposition", (e) => {
25
25
  if (this.submenu.assignedNodes().length === 0)
26
26
  return;
27
27
  let i = this.submenu.assignedNodes()[0];
28
- const { left: l, top: s, width: t, height: o } = i.getBoundingClientRect();
29
- this.style.setProperty("--wje-menu-item-safe-triangle-submenu-start-x", `${l}px`), this.style.setProperty("--wje-menu-item-safe-triangle-submenu-start-y", `${s}px`), this.style.setProperty("--wje-menu-item-safe-triangle-submenu-end-x", `${l}px`), this.style.setProperty("--wje-menu-item-safe-triangle-submenu-end-y", `${s + o}px`);
28
+ const { left: m, top: s, width: t, height: r } = i.getBoundingClientRect();
29
+ this.style.setProperty("--wje-menu-item-safe-triangle-submenu-start-x", `${m}px`), this.style.setProperty("--wje-menu-item-safe-triangle-submenu-start-y", `${s}px`), this.style.setProperty("--wje-menu-item-safe-triangle-submenu-end-x", `${m}px`), this.style.setProperty("--wje-menu-item-safe-triangle-submenu-end-y", `${s + r}px`);
30
30
  });
31
- L(this, { selector: !1 }), this.hasSubmenu = S.hasSlot(this, "submenu"), this._collapsible = !1;
31
+ E(this, { selector: !1 }), this.hasSubmenu = L.hasSlot(this, "submenu"), this._collapsible = !1;
32
32
  }
33
33
  /**
34
34
  * Getter for placement attribute.
@@ -66,7 +66,7 @@ class j extends k {
66
66
  * @returns {string} The styles imported from styles.css.
67
67
  */
68
68
  static get cssStyleSheet() {
69
- return E;
69
+ return S;
70
70
  }
71
71
  /**
72
72
  * Getter for observedAttributes.
@@ -84,7 +84,7 @@ class j extends k {
84
84
  /**
85
85
  * Removes the active attribute from the menu before drawing the MenuItem.
86
86
  */
87
- beforeDraw(e, i, l) {
87
+ beforeDraw(e, i, m) {
88
88
  var s;
89
89
  (s = this.querySelector("wje-menu")) == null || s.removeAttribute("active");
90
90
  }
@@ -96,16 +96,16 @@ class j extends k {
96
96
  * @param {Object} params - The parameters for drawing.
97
97
  * @returns {DocumentFragment} The fragment to be appended to the MenuItem.
98
98
  */
99
- draw(e, i, l) {
100
- var w, f, g;
99
+ draw(e, i, m) {
100
+ var w, f, j;
101
101
  let s = document.createDocumentFragment();
102
- this.setAttribute("tabindex", "0"), console.log("DRAW", this.variant, this.collapse), this.classList.forEach((n) => {
102
+ this.setAttribute("tabindex", "0"), this.classList.forEach((n) => {
103
103
  n.startsWith("wje-menu-variant-") && this.classList.remove(n);
104
104
  }), this.classList.remove("collapse"), this.classList.add("wje-menu-variant-" + this.variant.toLowerCase()), this.collapse ? (f = this.parentElement) != null && f.hasAttribute("collapse") && this.classList.add("collapse") : (w = this.querySelector("wje-menu")) == null || w.setAttribute("variant", this.variant.toLowerCase());
105
105
  let t = document.createElement("div");
106
106
  t.setAttribute("part", "native"), t.setAttribute("id", "anchor"), t.classList.add("native-menu-item");
107
- let o = document.createElement("span");
108
- o.classList.add("check-icon"), o.innerHTML = '<wje-icon name="check"></wje-icon>', this.hasAttribute("checked") ? o.classList.add("checked") : o.classList.remove("checked");
107
+ let r = document.createElement("span");
108
+ r.classList.add("check-icon"), r.innerHTML = '<wje-icon name="check"></wje-icon>', this.hasAttribute("checked") ? r.classList.add("checked") : r.classList.remove("checked");
109
109
  let d = document.createElement("slot");
110
110
  d.name = "start";
111
111
  let p = document.createElement("slot");
@@ -114,8 +114,8 @@ class j extends k {
114
114
  b.name = "end";
115
115
  let u = document.createElement("slot");
116
116
  u.setAttribute("part", "submenu"), u.name = "submenu";
117
- let y = this.collapse ? "collapse" : "expand", c = document.createElement("span");
118
- c.classList.add("submenu-icon", y), c.innerHTML = this.collapse ? '<wje-icon name="chevron-down"></wje-icon>' : '<wje-icon name="chevron-right"></wje-icon>', this.hasSubmenu ? t.classList.add("has-submenu") : t.classList.remove("has-submenu"), t.appendChild(o), t.appendChild(d), t.appendChild(p), t.appendChild(b), t.appendChild(c);
117
+ let y = this.collapse ? "collapse" : "expand", h = document.createElement("span");
118
+ h.classList.add("submenu-icon", y), h.innerHTML = this.collapse ? '<wje-icon name="chevron-down"></wje-icon>' : '<wje-icon name="chevron-right"></wje-icon>', this.hasSubmenu ? t.classList.add("has-submenu") : t.classList.remove("has-submenu"), t.appendChild(r), t.appendChild(d), t.appendChild(p), t.appendChild(b), t.appendChild(h);
119
119
  let v = !1;
120
120
  if (
121
121
  /*(this.collapse && this.variant === "NAV" && this.hasSubmenu) || */
@@ -125,26 +125,28 @@ class j extends k {
125
125
  let n = document.createElement("wje-popup");
126
126
  n.setAttribute("anchor", "anchor"), n.setAttribute("placement", this.placement), n.setAttribute("offset", this.offset), n.appendChild(t), n.appendChild(u), this.popup = n, s.appendChild(n), v = !0;
127
127
  }
128
- return (g = this.parentElement) != null && g.hasAttribute("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;
128
+ return (j = this.parentElement) != null && j.hasAttribute("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;
129
129
  }
130
130
  /**
131
131
  * Adds event listeners after drawing the MenuItem.
132
132
  */
133
133
  afterDraw() {
134
- this.addEventListener("mousemove", this.dispatchMove), this.addEventListener("wje-popup:reposition", this.dispatchReposition), h.addListener(this, "mouseover", null, (e) => {
134
+ this.addEventListener("mousemove", this.dispatchMove), this.addEventListener("wje-popup:reposition", this.dispatchReposition), l.addListener(this, "mouseover", null, (e) => {
135
135
  if (this.collapse || this.variant === "CONTEXT" && this.hasSubmenu) {
136
136
  if (this.hasAttribute("manual") || this.variant === "NAV" && this.collapse)
137
137
  return;
138
138
  this.submenuActivated(e), e.stopPropagation(), this.showSubmenu(), this.focus();
139
139
  }
140
- }), h.addListener(this, "focusout", null, (e) => {
140
+ }), l.addListener(this, "focusout", null, (e) => {
141
141
  if (this.collapse || this.variant === "CONTEXT" && this.hasSubmenu) {
142
- if (console.log("SOM TU:"), e.relatedTarget && this.contains(e.relatedTarget) || this.variant === "NAV" && !this.collapse)
142
+ if (e.relatedTarget && this.contains(e.relatedTarget) || this.variant === "NAV" && !this.collapse)
143
143
  return;
144
144
  this.submenuActivated(e), this.hideSubmenu();
145
145
  }
146
- }), h.addListener(this, "click", null, (e) => {
147
- !this.collapse && this.variant === "NAV" && this.hasSubmenu && (this.submenuActivated(e), this.hideSubmenu(), e.stopPropagation());
146
+ }), l.addListener(this, "click", null, (e) => {
147
+ !this.collapse && this.variant === "NAV" && this.hasSubmenu ? (this.submenuActivated(e), this.hideSubmenu(), e.stopPropagation()) : (l.dispatchCustomEvent(this, "wje-menu-item:click"), l.dispatchCustomEvent(this, this.dialog, {
148
+ bubbles: !0
149
+ }));
148
150
  });
149
151
  }
150
152
  /**
@@ -160,13 +162,13 @@ class j extends k {
160
162
  * Shows the submenu of the MenuItem.
161
163
  */
162
164
  showSubmenu() {
163
- console.log("SHOW SUBMENU", this.hasSubmenu), this.tabIndex = -1, this.hasSubmenu && (this.popup.setAttribute("active", ""), this.classList.add("expanded-submenu"), this.native.classList.add("expanded-submenu"));
165
+ this.tabIndex = -1, this.hasSubmenu && (this.popup.setAttribute("active", ""), this.classList.add("expanded-submenu"), this.native.classList.add("expanded-submenu"));
164
166
  }
165
167
  /**
166
168
  * Hides the submenu of the MenuItem.
167
169
  */
168
170
  hideSubmenu() {
169
- console.log("HIDE SUBMENU", this), this.tabIndex = 0, this.hasSubmenu && (this.popup.removeAttribute("active"), this.classList.remove("expanded-submenu"), this.native.classList.remove("expanded-submenu"));
171
+ this.tabIndex = 0, this.hasSubmenu && (this.popup.removeAttribute("active"), this.classList.remove("expanded-submenu"), this.native.classList.remove("expanded-submenu"));
170
172
  }
171
173
  /**
172
174
  * Activates or deactivates the submenu of the MenuItem.
@@ -184,7 +186,7 @@ class j extends k {
184
186
  this.context.innerHTML = "";
185
187
  }
186
188
  }
187
- j.define("wje-menu-item", j);
189
+ g.define("wje-menu-item", g);
188
190
  export {
189
- j as default
191
+ g as default
190
192
  };
package/dist/wje-menu.js CHANGED
@@ -1,8 +1,8 @@
1
- var d = Object.defineProperty;
2
- var s = (n, e, t) => e in n ? d(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var o = (n, e, t) => (s(n, typeof e != "symbol" ? e + "" : e, t), t);
1
+ var s = Object.defineProperty;
2
+ var d = (n, t, e) => t in n ? s(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
+ var o = (n, t, e) => (d(n, typeof t != "symbol" ? t + "" : t, e), e);
4
4
  import l from "./wje-element.js";
5
- const u = ":host{--wje-menu-background: var(--wje-background);--wje-menu-border-width: 1px;--wje-menu-border-style: solid;--wje-menu-border-color: var(--wje-border-color);--wje-menu-border-radius: var(--wje-border-radius-small);--wje-menu-padding-top: .5rem;--wje-menu-padding-bottom: .5rem;--wje-menu-padding-inline: 0;--wje-menu-margin-top: ;--wje-menu-margin-bottom: 0;--wje-menu-margin-inline: 0;--wje-menu-collapse-width: 65px;display:none;background:var(--wje-menu-background);position:relative;border-width:var(--wje-menu-border-width);border-style:var(--wje-menu-border-style);border-color:var(--wje-menu-border-color);z-index:var(--wje-menu-z-index, 8);border-radius:var(--wje-menu-border-radius);padding-top:var(--wje-menu-padding-top);padding-bottom:var(--wje-menu-padding-bottom);padding-inline:var(--wje-menu-padding-inline);margin-top:var(--wje-menu-margin-top);margin-bottom:var(--wje-menu-margin-bottom);margin-inline:var(--wje-menu-margin-inline);overflow:auto;overscroll-behavior:none}:host .native-menu{display:flex;flex-direction:column;width:100%}:host .native-menu ::slotted(wje-button){margin:0}:host(.wje-menu-collapse){width:var(--wje-menu-collapse-width)}:host([variant=context]){display:block!important;margin-left:var(--wje-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}";
5
+ const u = ":root{--wje-menu-background: var(--wje-background);--wje-menu-border-width: 1px;--wje-menu-border-style: solid;--wje-menu-border-color: var(--wje-border-color);--wje-menu-border-radius: var(--wje-border-radius-small);--wje-menu-padding-top: .5rem;--wje-menu-padding-bottom: .5rem;--wje-menu-padding-inline: 0;--wje-menu-margin-top: ;--wje-menu-margin-bottom: 0;--wje-menu-margin-inline: 0;--wje-menu-collapse-width: 65px}:host{display:none;background:var(--wje-menu-background);position:relative;border-width:var(--wje-menu-border-width);border-style:var(--wje-menu-border-style);border-color:var(--wje-menu-border-color);z-index:var(--wje-menu-z-index, 8);border-radius:var(--wje-menu-border-radius);padding-top:var(--wje-menu-padding-top);padding-bottom:var(--wje-menu-padding-bottom);padding-inline:var(--wje-menu-padding-inline);margin-top:var(--wje-menu-margin-top);margin-bottom:var(--wje-menu-margin-bottom);margin-inline:var(--wje-menu-margin-inline);overflow:auto;overscroll-behavior:none}:host .native-menu{display:flex;flex-direction:column;width:100%}:host .native-menu ::slotted(wje-button){margin:0}:host(.wje-menu-collapse){width:var(--wje-menu-collapse-width)}:host([variant=context]){display:block!important;margin-left:var(--wje-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
6
  class i extends l {
7
7
  /**
8
8
  * Creates an instance of Menu.
@@ -45,7 +45,7 @@ class i extends l {
45
45
  * @param {Object} params - The parameters for drawing.
46
46
  * @returns {DocumentFragment}
47
47
  */
48
- draw(t, c, w) {
48
+ draw(e, c, w) {
49
49
  let a = document.createDocumentFragment();
50
50
  this.classList.remove("wje-menu-collapse"), this.hasAttribute("collapse") && this.classList.add("wje-menu-collapse");
51
51
  let r = document.createElement("div");
@@ -57,8 +57,8 @@ class i extends l {
57
57
  * Refreshes the component after drawing.
58
58
  */
59
59
  afterDraw() {
60
- Array.from(this.children).forEach((t) => {
61
- t.refresh();
60
+ Array.from(this.children).forEach((e) => {
61
+ e.tagName.includes("-") && e.refresh();
62
62
  });
63
63
  }
64
64
  /**
@@ -1,5 +1,99 @@
1
- import { O as o } from "./option.element-CpeafIM-.js";
2
- o.define("wje-option", o);
1
+ var p = Object.defineProperty;
2
+ var m = (n, t, e) => t in n ? p(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
+ var o = (n, t, e) => (m(n, typeof t != "symbol" ? t + "" : t, e), e);
4
+ import u, { event as h } from "./wje-element.js";
5
+ import g from "./wje-icon.js";
6
+ const b = ':host{--wje-option-padding-top: .5rem;--wje-option-padding-bottom: .5rem;--wje-option-highlighted: var(--wje-color-contrast-3);display:block}:host wje-icon{visibility:hidden;margin-inline:.5rem}:host([selected]) wje-icon{visibility:visible}.native-option{display:flex;align-items:center;padding-top:var(--wje-option-padding-top);padding-bottom:var(--wje-option-padding-bottom)}.native-option:hover{background-color:var(--wje-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}';
7
+ class d extends u {
8
+ /**
9
+ * Creates an instance of Option.
10
+ *
11
+ * @constructor
12
+ */
13
+ constructor() {
14
+ super();
15
+ /**
16
+ * Dependencies of the Option component.
17
+ */
18
+ o(this, "depandencies", {
19
+ "wje-icon": g
20
+ });
21
+ o(this, "className", "Option");
22
+ }
23
+ /**
24
+ * Sets the selected attribute of the option.
25
+ *
26
+ * @param {boolean} value - The value to set.
27
+ */
28
+ set selected(e) {
29
+ return e ? this.setAttribute("selected", "") : this.removeAttribute("selected");
30
+ }
31
+ /**
32
+ * Sets the value attribute of the option.
33
+ *
34
+ * @param {string} value - The value to set.
35
+ */
36
+ set value(e) {
37
+ this.setAttribute("value", e);
38
+ }
39
+ /**
40
+ * Sets the text content of the option.
41
+ *
42
+ * @param {string} value - The text to set.
43
+ */
44
+ set text(e) {
45
+ this.innerText = e;
46
+ }
47
+ /**
48
+ * Returns the CSS styles for the component.
49
+ *
50
+ * @static
51
+ * @returns {CSSStyleSheet}
52
+ */
53
+ static get cssStyleSheet() {
54
+ return b;
55
+ }
56
+ /**
57
+ * Returns the list of attributes to observe for changes.
58
+ *
59
+ * @static
60
+ * @returns {Array<string>}
61
+ */
62
+ static get observedAttributes() {
63
+ return [];
64
+ }
65
+ /**
66
+ * Sets up the attributes for the component.
67
+ */
68
+ setupAttributes() {
69
+ this.isShadowRoot = "open";
70
+ }
71
+ /**
72
+ * Draws the component.
73
+ *
74
+ * @param {Object} context - The context for drawing.
75
+ * @param {Object} store - The store for drawing.
76
+ * @param {Object} params - The parameters for drawing.
77
+ * @returns {DocumentFragment}
78
+ */
79
+ draw(e, v, w) {
80
+ let s = document.createDocumentFragment(), i = document.createElement("div");
81
+ i.classList.add("native-option"), i.setAttribute("part", "native");
82
+ let a = document.createElement("wje-icon");
83
+ a.setAttribute("name", "check");
84
+ let r = document.createElement("slot");
85
+ r.setAttribute("name", "start");
86
+ let c = document.createElement("slot"), l = document.createElement("slot");
87
+ return l.setAttribute("name", "end"), i.appendChild(a), i.appendChild(r), i.appendChild(c), i.appendChild(l), s.appendChild(i), s;
88
+ }
89
+ /**
90
+ * Adds event listeners after the component is drawn.
91
+ */
92
+ afterDraw() {
93
+ h.addListener(this, "click", "wje:option-change");
94
+ }
95
+ }
96
+ d.define("wje-option", d);
3
97
  export {
4
- o as default
98
+ d as default
5
99
  };
@@ -2,7 +2,7 @@ var p = Object.defineProperty;
2
2
  var c = (o, e, t) => e in o ? p(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
3
  var a = (o, e, t) => (c(o, typeof e != "symbol" ? e + "" : e, t), t);
4
4
  import d, { event as u } from "./wje-element.js";
5
- import { O as h } from "./option.element-CpeafIM-.js";
5
+ import h from "./wje-option.js";
6
6
  class r extends d {
7
7
  /**
8
8
  * Creates an instance of Options.
package/dist/wje-popup.js CHANGED
@@ -1,4 +1,4 @@
1
- import { P as p } from "./popup.element-BXak-Fgc.js";
1
+ import { P as p } from "./popup.element-Dj9j__Dh.js";
2
2
  p.define("wje-popup", p);
3
3
  export {
4
4
  p as default
@@ -2,7 +2,7 @@ var A = Object.defineProperty;
2
2
  var j = (i, o, e) => o in i ? A(i, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[o] = e;
3
3
  var g = (i, o, e) => (j(i, typeof o != "symbol" ? o + "" : o, e), e);
4
4
  import k from "./wje-element.js";
5
- const f = ':host(.wje-color-primary) #bar{--wje-progress-bar-color: var(--wje-color-primary)}:host(.wje-color-complete) #bar{--wje-progress-bar-color: var(--wje-color-complete)}:host(.wje-color-success) #bar{--wje-progress-bar-color: var(--wje-color-success)}:host(.wje-color-warning) #bar{--wje-progress-bar-color: var(--wje-color-warning)}:host(.wje-color-danger) #bar{--wje-progress-bar-color: var(--wje-color-danger)}:host(.wje-color-dark) #bar{--wje-progress-bar-color: var(--wje-color-contrast-0)}:host(.wje-color-light) #bar{--wje-progress-bar-color: var(--wje-color-contrast-11)}:host{--wje-progress-bar-color: var(--wje-color-contrast-6);--wje-progress-bar-text-size: .75rem;--wje-progress-bar-text-color: var(--wje-color)}:host .progress{position:relative;display:flex;align-items:center}:host .slot-wrapper{display:flex;position:absolute;top:0;align-items:center;width:100%;height:100%;justify-content:center}:host #bar{stroke:var(--wje-progress-bar-color)}:host text{transform:rotate(90deg);transform-origin:center;text-anchor:middle;dominant-baseline:middle;font-size:var(--wje-progress-bar-text-size);fill:var(--wje-progress-bar-text-color)}:host(.wje-color) #bar{stroke:var(--wje-progress-bar-color)}::slotted([slot="start"]){margin-inline:0 1rem}::slotted([slot="end"]){margin-inline:1rem 0}';
5
+ const f = ':host(.wje-color-primary) #bar{--wje-progress-bar-color: var(--wje-color-primary)}:host(.wje-color-complete) #bar{--wje-progress-bar-color: var(--wje-color-complete)}:host(.wje-color-success) #bar{--wje-progress-bar-color: var(--wje-color-success)}:host(.wje-color-warning) #bar{--wje-progress-bar-color: var(--wje-color-warning)}:host(.wje-color-danger) #bar{--wje-progress-bar-color: var(--wje-color-danger)}:host(.wje-color-dark) #bar{--wje-progress-bar-color: var(--wje-color-contrast-0)}:host(.wje-color-light) #bar{--wje-progress-bar-color: var(--wje-color-contrast-11)}:host{--wje-progress-bar-color: var(--wje-color-contrast-6);--wje-progress-bar-text-size: .75rem;--wje-progress-bar-text-color: var(--wje-color);--wje-progress-bar-stroke: var(--wje-color-contrast-3);stroke:var(--wje-progress-bar-stroke)}:host .progress{position:relative;display:flex;align-items:center}:host .slot-wrapper{display:flex;position:absolute;top:0;align-items:center;width:100%;height:100%;justify-content:center}:host #bar{stroke:var(--wje-progress-bar-color)}:host text{transform:rotate(90deg);transform-origin:center;text-anchor:middle;dominant-baseline:middle;font-size:var(--wje-progress-bar-text-size);fill:var(--wje-progress-bar-text-color);stroke:var(--wje-progress-bar-text-color)}:host(.wje-color) #bar{stroke:var(--wje-progress-bar-color)}::slotted([slot="start"]){margin-inline:0 1rem}::slotted([slot="end"]){margin-inline:1rem 0}';
6
6
  class w extends k {
7
7
  /**
8
8
  * Creates an instance of ProgressBar.
@@ -100,10 +100,10 @@ class w extends k {
100
100
  a.classList.add("progress");
101
101
  let m = document.createElement("slot"), d = document.createElement("div");
102
102
  d.classList.add("slot-wrapper");
103
- let b = document.createElement("slot");
104
- b.setAttribute("name", "start");
105
103
  let p = document.createElement("slot");
106
- p.setAttribute("name", "end");
104
+ p.setAttribute("name", "start");
105
+ let b = document.createElement("slot");
106
+ b.setAttribute("name", "end");
107
107
  let s = document.createElementNS("http://www.w3.org/2000/svg", "svg"), r, t;
108
108
  if ((this == null ? void 0 : this.type) === "circle") {
109
109
  s.setAttribute("width", this.diameter), s.setAttribute("height", this.diameter), s.setAttribute("viewBox", `0 0 ${this.diameter} ${this.diameter}`), s.setAttribute("style", "transform: rotate(-90deg)"), r = document.createElementNS("http://www.w3.org/2000/svg", "circle"), r.setAttribute("r", this.radius), r.setAttribute("cx", c), r.setAttribute("cy", c), r.setAttribute("fill", "transparent"), t = document.createElementNS("http://www.w3.org/2000/svg", "circle"), t.setAttribute("r", this.radius), t.setAttribute("cx", c), t.setAttribute("cy", c), t.setAttribute("fill", "transparent"), t.setAttribute("stroke-dasharray", "0"), t.setAttribute("stroke-dashoffset", "0");
@@ -111,7 +111,7 @@ class w extends k {
111
111
  n.setAttribute("x", "50%"), n.setAttribute("y", "50%"), n.innerHTML = this.progress + "%", s.appendChild(n);
112
112
  } else
113
113
  s.setAttribute("width", "100%"), s.setAttribute("height", this.stroke), s.setAttribute("preserveAspectRatio", "none"), r = document.createElementNS("http://www.w3.org/2000/svg", "line"), r.setAttribute("x1", 0), r.setAttribute("y1", this.stroke / 2), r.setAttribute("x2", "100%"), r.setAttribute("y2", this.stroke / 2), t = document.createElementNS("http://www.w3.org/2000/svg", "line"), t.setAttribute("x1", 0), t.setAttribute("y1", this.stroke / 2), t.setAttribute("x2", this.progress + "%"), t.setAttribute("y2", this.stroke / 2);
114
- return r.setAttribute("stroke", "#e0e0e0"), r.setAttribute("stroke-linecap", this.linecap), r.setAttribute("stroke-width", this.stroke + "px"), t.setAttribute("stroke-linecap", this.linecap), t.setAttribute("stroke-width", this.stroke + "px"), t.setAttribute("id", "bar"), s.appendChild(r), s.appendChild(t), d.appendChild(m), a.appendChild(b), a.appendChild(d), a.appendChild(s), a.appendChild(p), u.appendChild(a), this.background = r, this.bar = t, u;
114
+ return r.setAttribute("stroke-linecap", this.linecap), r.setAttribute("stroke-width", this.stroke + "px"), t.setAttribute("stroke-linecap", this.linecap), t.setAttribute("stroke-width", this.stroke + "px"), t.setAttribute("id", "bar"), s.appendChild(r), s.appendChild(t), d.appendChild(m), a.appendChild(p), a.appendChild(d), a.appendChild(s), a.appendChild(b), u.appendChild(a), this.background = r, this.bar = t, u;
115
115
  }
116
116
  /**
117
117
  * Adds event listeners after the component is drawn.
@@ -57,7 +57,7 @@ class l extends h {
57
57
  * Handles the selection of radio buttons.
58
58
  */
59
59
  afterDraw() {
60
- this.value && this.setRadioToChekced(this.getRadioByValue(this.value)), this.addEventListener("wje:radio:input", (e) => {
60
+ this.value && this.setRadioToChekced(this.getRadioByValue(this.value)), this.addEventListener("wje-radio:input", (e) => {
61
61
  this.removeCheck(), this.setRadioToChekced(e.detail.context);
62
62
  });
63
63
  }
package/dist/wje-radio.js CHANGED
@@ -34,7 +34,7 @@ class c extends p {
34
34
  return o.htmlFor = "radio", o.innerHTML = "<slot></slot>", r.appendChild(this.input), r.appendChild(o), d.appendChild(r), d;
35
35
  }
36
36
  afterDraw() {
37
- this.hasAttribute("disabled") || (n.addListener(this, "click", "wje:radio:change"), n.addListener(this, "click", "wje:radio:input"));
37
+ this.hasAttribute("disabled") || (n.addListener(this, "click", "wje-radio:change"), n.addListener(this, "click", "wje-radio:input"));
38
38
  }
39
39
  disconnectedCallback() {
40
40
  n.removeElement(this);
@@ -2,7 +2,7 @@ var h = Object.defineProperty;
2
2
  var v = (n, i, e) => i in n ? h(n, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[i] = e;
3
3
  var d = (n, i, e) => (v(n, typeof i != "symbol" ? i + "" : i, e), e);
4
4
  import f from "./wje-element.js";
5
- import { L as S } from "./localize-7fxVJArK.js";
5
+ import { L as p } from "./localize-DVuO3S17.js";
6
6
  class l extends f {
7
7
  /**
8
8
  * Creates an instance of RelativeTime.
@@ -12,7 +12,7 @@ class l extends f {
12
12
  constructor() {
13
13
  super();
14
14
  d(this, "className", "RelativeTime");
15
- this.localizer = new S(this);
15
+ this.localizer = new p(this);
16
16
  }
17
17
  /**
18
18
  * Gets the ISO date of the relative time component.
@@ -23,15 +23,6 @@ class l extends f {
23
23
  let e = /* @__PURE__ */ new Date(), t = this.getAttribute("date");
24
24
  return this.hasAttribute("date") && (this.isISODate(t) ? t = t : t = +t * 1e3, e = new Date(t)), e.toISOString();
25
25
  }
26
- /**
27
- * Returns the CSS styles for the component.
28
- *
29
- * @static
30
- * @returns {CSSStyleSheet}
31
- */
32
- static get cssStyleSheet() {
33
- return styles;
34
- }
35
26
  /**
36
27
  * Returns the list of attributes to observe for changes.
37
28
  *
@@ -75,8 +66,8 @@ class l extends f {
75
66
  86400 * 30,
76
67
  86400 * 365,
77
68
  1 / 0
78
- ], c = ["second", "minute", "hour", "day", "week", "month", "year"], s = o.findIndex((g) => g > Math.abs(a)), m = s ? o[s - 1] : 1;
79
- return this.localizer.relativeTime(Math.floor(a / m), c[s], { numeric: "auto" });
69
+ ], m = ["second", "minute", "hour", "day", "week", "month", "year"], s = o.findIndex((g) => g > Math.abs(a)), c = s ? o[s - 1] : 1;
70
+ return this.localizer.relativeTime(Math.floor(a / c), m[s], { numeric: "auto" });
80
71
  }
81
72
  /**
82
73
  * Checks if the given string is an ISO date.
@@ -4,11 +4,10 @@ var u = (n, a, e) => (A(n, typeof a != "symbol" ? a + "" : a, e), e);
4
4
  import E from "./wje-element.js";
5
5
  import x from "./wje-button.js";
6
6
  import "./wje-popup.js";
7
- import "./wje-icon.js";
8
- import y from "./wje-label.js";
9
- import C from "./wje-chip.js";
10
- import { P as L } from "./popup.element-BXak-Fgc.js";
11
- import { I as O } from "./icon.element-DOiXP3pi.js";
7
+ import y from "./wje-icon.js";
8
+ import C from "./wje-label.js";
9
+ import L from "./wje-chip.js";
10
+ import { P as O } from "./popup.element-Dj9j__Dh.js";
12
11
  const k = ":host{--wje-select-border-width: 1px;--wje-select-border-style: solid;--wje-select-border-color: var(--wje-border-color);--wje-select-options-border-width: 1px;--wje-select-options-border-style: var(--wje-border-style);--wje-select-options-border-color: var(--wje-border-color);--wje-select-background: var(--wje-background);--wje-select-line-height: 20px;--wje-select-color: var(--wje-color);--wje-select-border-radius: var(--wje-border-radius-medium);width:100%;display:block}:host [slot=arrow]{transform:rotate(0);transition:all .2s ease-in}.native-select.default .wrapper{display:block;border-width:var(--wje-select-border-width);border-style:var(--wje-select-border-style);border-color:var(--wje-select-border-color);border-radius:var(--wje-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 wje-label{opacity:.67;font-size:12px;letter-spacing:normal}.native-select.default wje-label{margin:0;display:block;opacity:1;cursor:text;transition:opacity .2s ease 0s;line-height:var(--wje-select-line-height)}.native-select.default wje-label.fade{opacity:.5;font-size:12px;letter-spacing:normal}.native-select.standard .wrapper{border-width:var(--wje-select-border-width);border-style:var(--wje-select-border-style);border-color:var(--wje-select-border-color);border-radius:var(--wje-select-border-radius)}.native-select.standard .input-wrapper{background:transparent;width:100%}.wrapper{display:flex;width:100%}.input-wrapper{display:grid;grid-template-columns:1fr auto auto;align-items:center;background-color:var(--wje-select-background);min-height:28px;color:var(--wje-select-color);line-height:var(--wje-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] .wrapper{border-radius:var(--wje-select-border-radius) var(--wje-select-border-radius) 0 0}:host [active] [slot=arrow]{transform:rotate(180deg);transition:all .2s ease-in}.option-wrapper{border-width:var(--wje-select-options-border-width);border-style:var(--wje-select-options-border-style);border-color:var(--wje-select-options-border-color);border-radius:0 0 var(--wje-select-border-radius) var(--wje-select-border-radius);margin-top:-1px;background:var(--wje-select-background);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}wje-chip{--wje-chip-margin: 0 .25rem 0 0}wje-button{--wje-padding-top: .25rem;--wje-padding-start: .25rem;--wje-padding-end: .25rem;--wje-padding-bottom: .25rem;--wje-button-margin-inline: 0 .25rem}";
13
12
  class v extends E {
14
13
  /**
@@ -20,10 +19,10 @@ class v extends E {
20
19
  super();
21
20
  u(this, "depandencies", {
22
21
  "wje-button": x,
23
- "wje-popup": L,
24
- "wje-icon": O,
25
- "wje-label": y,
26
- "wje-chip": C
22
+ "wje-popup": O,
23
+ "wje-icon": y,
24
+ "wje-label": C,
25
+ "wje-chip": L
27
26
  });
28
27
  u(this, "className", "Select");
29
28
  /**
@@ -150,7 +149,7 @@ class v extends E {
150
149
  this.labelElement.classList.add("fade"), this.native.classList.add("focused");
151
150
  }), this.input.addEventListener("blur", (i) => {
152
151
  this.native.classList.remove("focused"), i.target.value || this.labelElement.classList.remove("fade");
153
- }), this.addEventListener("wje:option-change", this.optionChange), this.clear.addEventListener("wje:button-click", (i) => {
152
+ }), this.addEventListener("wje:option-change", this.optionChange), this.clear.addEventListener("wje-button:click", (i) => {
154
153
  this.getAllOptions().forEach((s) => {
155
154
  s.selected = !1, s.removeAttribute("selected");
156
155
  }), this.selections(), i.stopPropagation();