wj-elements 0.1.12 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/package.json +1 -1
  2. package/dist/dark.css +0 -1
  3. package/dist/light.css +0 -1
  4. package/dist/localize-DVuO3S17.js +0 -43
  5. package/dist/popup.element-CpEjis9f.js +0 -1068
  6. package/dist/router-links-FtZbFUto.js +0 -146
  7. package/dist/styles.css +0 -1
  8. package/dist/wje-accordion-item.js +0 -88
  9. package/dist/wje-accordion.js +0 -79
  10. package/dist/wje-animation.js +0 -121
  11. package/dist/wje-aside.js +0 -55
  12. package/dist/wje-avatar.js +0 -74
  13. package/dist/wje-badge.js +0 -50
  14. package/dist/wje-breadcrumb.js +0 -148
  15. package/dist/wje-breadcrumbs.js +0 -67
  16. package/dist/wje-button-group.js +0 -78
  17. package/dist/wje-button.js +0 -175
  18. package/dist/wje-card-content.js +0 -48
  19. package/dist/wje-card-controls.js +0 -48
  20. package/dist/wje-card-header.js +0 -47
  21. package/dist/wje-card-subtitle.js +0 -55
  22. package/dist/wje-card-title.js +0 -55
  23. package/dist/wje-card.js +0 -50
  24. package/dist/wje-carousel-item.js +0 -33
  25. package/dist/wje-carousel.js +0 -177
  26. package/dist/wje-checkbox.js +0 -104
  27. package/dist/wje-chip.js +0 -32
  28. package/dist/wje-col.js +0 -27
  29. package/dist/wje-color-picker.js +0 -953
  30. package/dist/wje-container.js +0 -57
  31. package/dist/wje-copy-button.js +0 -164
  32. package/dist/wje-dialog.js +0 -86
  33. package/dist/wje-divider.js +0 -53
  34. package/dist/wje-dropdown.js +0 -68
  35. package/dist/wje-element.js +0 -453
  36. package/dist/wje-fetchAndParseCSS.js +0 -40
  37. package/dist/wje-file-upload-item.js +0 -115
  38. package/dist/wje-file-upload.js +0 -297
  39. package/dist/wje-footer.js +0 -56
  40. package/dist/wje-form.js +0 -28
  41. package/dist/wje-format-digital.js +0 -85
  42. package/dist/wje-grid.js +0 -28
  43. package/dist/wje-header.js +0 -58
  44. package/dist/wje-icon-picker.js +0 -221
  45. package/dist/wje-icon.js +0 -119
  46. package/dist/wje-img-comparer.js +0 -111
  47. package/dist/wje-img.js +0 -58
  48. package/dist/wje-infinite-scroll.js +0 -193
  49. package/dist/wje-inline-edit.js +0 -120
  50. package/dist/wje-input-file.js +0 -85
  51. package/dist/wje-input.js +0 -240
  52. package/dist/wje-item.js +0 -45
  53. package/dist/wje-label.js +0 -67
  54. package/dist/wje-list.js +0 -53
  55. package/dist/wje-main.js +0 -56
  56. package/dist/wje-masonry.js +0 -218
  57. package/dist/wje-master.js +0 -196
  58. package/dist/wje-menu-button.js +0 -65
  59. package/dist/wje-menu-item.js +0 -192
  60. package/dist/wje-menu-label.js +0 -57
  61. package/dist/wje-menu.js +0 -74
  62. package/dist/wje-option.js +0 -99
  63. package/dist/wje-options.js +0 -63
  64. package/dist/wje-popup.js +0 -5
  65. package/dist/wje-progress-bar.js +0 -145
  66. package/dist/wje-radio-group.js +0 -101
  67. package/dist/wje-radio.js +0 -46
  68. package/dist/wje-rate.js +0 -260
  69. package/dist/wje-relative-time.js +0 -85
  70. package/dist/wje-reorder-dropzone.js +0 -27
  71. package/dist/wje-reorder-item.js +0 -32
  72. package/dist/wje-reorder.js +0 -132
  73. package/dist/wje-route.js +0 -28
  74. package/dist/wje-router-link.js +0 -64
  75. package/dist/wje-router-outlet.js +0 -127
  76. package/dist/wje-routerx.js +0 -1088
  77. package/dist/wje-row.js +0 -58
  78. package/dist/wje-select.js +0 -240
  79. package/dist/wje-slider.js +0 -177
  80. package/dist/wje-split-view.js +0 -112
  81. package/dist/wje-store.js +0 -192
  82. package/dist/wje-tab-group.js +0 -105
  83. package/dist/wje-tab-panel.js +0 -52
  84. package/dist/wje-tab.js +0 -59
  85. package/dist/wje-textarea.js +0 -116
  86. package/dist/wje-thumbnail.js +0 -64
  87. package/dist/wje-toast.js +0 -76
  88. package/dist/wje-toggle.js +0 -94
  89. package/dist/wje-toolbar-action.js +0 -63
  90. package/dist/wje-toolbar.js +0 -61
  91. package/dist/wje-tooltip.js +0 -105
  92. package/dist/wje-visually-hidden.js +0 -56
@@ -1,65 +0,0 @@
1
- var l = Object.defineProperty;
2
- var i = (n, t, e) => t in n ? l(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
- var o = (n, t, e) => (i(n, typeof t != "symbol" ? t + "" : t, e), e);
4
- import u, { event as c } from "./wje-element.js";
5
- const d = ":host{display:inline-flex}@media (min-width: 768px){:host{display:none}}";
6
- class r extends u {
7
- /**
8
- * Creates an instance of MenuButton.
9
- *
10
- * @constructor
11
- */
12
- constructor() {
13
- super();
14
- o(this, "className", "MenuButton");
15
- }
16
- /**
17
- * Returns the CSS styles for the component.
18
- *
19
- * @static
20
- * @returns {CSSStyleSheet}
21
- */
22
- static get cssStyleSheet() {
23
- return d;
24
- }
25
- /**
26
- * Returns the list of attributes to observe for changes.
27
- *
28
- * @static
29
- * @returns {Array<string>}
30
- */
31
- static get observedAttributes() {
32
- return [];
33
- }
34
- /**
35
- * Sets up the attributes for the component.
36
- */
37
- setupAttributes() {
38
- this.isShadowRoot = "open";
39
- }
40
- /**
41
- * Draws the component.
42
- *
43
- * @param {Object} context - The context for drawing.
44
- * @param {Object} store - The store for drawing.
45
- * @param {Object} params - The parameters for drawing.
46
- * @returns {DocumentFragment}
47
- */
48
- draw(e, m, p) {
49
- let s = document.createDocumentFragment(), a = document.createElement("slot");
50
- return s.appendChild(a), s;
51
- }
52
- /**
53
- * Refreshes the component after drawing.
54
- * Adds a click event listener that toggles the "open" class on the content element.
55
- */
56
- afterDraw() {
57
- c.addListener(this, "click", null, (e) => {
58
- document.querySelector(`#${this.contentId}`).classList.toggle("open");
59
- });
60
- }
61
- }
62
- r.define("wje-menu-button", r);
63
- export {
64
- r as default
65
- };
@@ -1,192 +0,0 @@
1
- var x = Object.defineProperty;
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-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;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;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 {
8
- /**
9
- * Constructor for MenuItem class.
10
- * @constructor
11
- */
12
- constructor() {
13
- super();
14
- c(this, "className", "MenuItem");
15
- /**
16
- * Dispatches a mousemove event.
17
- */
18
- c(this, "dispatchMove", (e) => {
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
- });
21
- /**
22
- * Dispatches a reposition event.
23
- */
24
- c(this, "dispatchReposition", (e) => {
25
- if (this.submenu.assignedNodes().length === 0)
26
- return;
27
- let i = this.submenu.assignedNodes()[0];
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
- });
31
- E(this, { selector: !1 }), this.hasSubmenu = L.hasSlot(this, "submenu"), this._collapsible = !1;
32
- }
33
- /**
34
- * Getter for placement attribute.
35
- * @returns {string} The placement attribute of the menu or "right-start" if it doesn't exist.
36
- */
37
- get placement() {
38
- let e = this.querySelector("wje-menu");
39
- return e != null && e.hasAttribute("placement") ? e.getAttribute("placement") : "right-start";
40
- }
41
- /**
42
- * Getter for offset attribute.
43
- * @returns {string} The offset attribute of the menu or "0" if it doesn't exist.
44
- */
45
- get offset() {
46
- let e = this.querySelector("wje-menu");
47
- return e != null && e.hasAttribute("offset") ? e.getAttribute("offset") : "0";
48
- }
49
- /**
50
- * Getter for variant attribute.
51
- * @returns {string} The variant attribute of the menu or "CONTEXT" if it doesn't exist.
52
- */
53
- get variant() {
54
- let e = this.querySelector("wje-menu");
55
- return e != null && e.hasAttribute("variant") && !this.collapse ? e.getAttribute("variant").toUpperCase() : "CONTEXT";
56
- }
57
- /**
58
- * Getter for collapse attribute.
59
- * @returns {boolean} True if the closest parent has the collapse attribute, false otherwise.
60
- */
61
- get collapse() {
62
- return !!this.closest("[collapse]");
63
- }
64
- /**
65
- * Getter for cssStyleSheet.
66
- * @returns {string} The styles imported from styles.css.
67
- */
68
- static get cssStyleSheet() {
69
- return S;
70
- }
71
- /**
72
- * Getter for observedAttributes.
73
- * @returns {Array} An empty array as no attributes are being observed.
74
- */
75
- static get observedAttributes() {
76
- return [];
77
- }
78
- /**
79
- * Sets up the attributes for the MenuItem element.
80
- */
81
- setupAttributes() {
82
- super.setupAttributes(), this.isShadowRoot = "open", this.setAttribute("active-class", "open");
83
- }
84
- /**
85
- * Removes the active attribute from the menu before drawing the MenuItem.
86
- */
87
- beforeDraw(e, i, m) {
88
- var s;
89
- (s = this.querySelector("wje-menu")) == null || s.removeAttribute("active");
90
- }
91
- /**
92
- * Draws the MenuItem element.
93
- *
94
- * @param {Object} context - The context for drawing.
95
- * @param {Object} store - The store for drawing.
96
- * @param {Object} params - The parameters for drawing.
97
- * @returns {DocumentFragment} The fragment to be appended to the MenuItem.
98
- */
99
- draw(e, i, m) {
100
- var f, w, g;
101
- let s = document.createDocumentFragment();
102
- this.setAttribute("tabindex", "0"), this.classList.forEach((n) => {
103
- n.startsWith("wje-menu-variant-") && this.classList.remove(n);
104
- }), this.classList.remove("collapse"), this.classList.add("wje-menu-variant-" + this.variant.toLowerCase()), this.collapse ? (w = this.parentElement) != null && w.hasAttribute("collapse") && this.classList.add("collapse") : (f = this.querySelector("wje-menu")) == null || f.setAttribute("variant", this.variant.toLowerCase());
105
- let t = document.createElement("div");
106
- t.setAttribute("part", "native"), t.setAttribute("id", "anchor"), t.classList.add("native-menu-item");
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
- let d = document.createElement("slot");
110
- d.name = "start";
111
- let p = document.createElement("slot");
112
- p.classList.add("label");
113
- let b = document.createElement("slot");
114
- b.name = "end";
115
- let u = document.createElement("slot");
116
- u.setAttribute("part", "submenu"), u.name = "submenu";
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
- let v = !1;
120
- if (
121
- /*(this.collapse && this.variant === "NAV" && this.hasSubmenu) || */
122
- this.variant === "CONTEXT" && this.hasSubmenu
123
- ) {
124
- t.setAttribute("slot", "anchor");
125
- let n = document.createElement("wje-popup");
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
- }
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;
129
- }
130
- /**
131
- * Adds event listeners after drawing the MenuItem.
132
- */
133
- afterDraw() {
134
- this.addEventListener("mousemove", this.dispatchMove), this.addEventListener("wje-popup:reposition", this.dispatchReposition), l.addListener(this, "mouseover", null, (e) => {
135
- if (this.collapse || this.variant === "CONTEXT" && this.hasSubmenu) {
136
- if (this.hasAttribute("manual") || this.variant === "NAV" && this.collapse)
137
- return;
138
- this.submenuActivated(e), e.stopPropagation(), this.showSubmenu(), this.focus();
139
- }
140
- }), l.addListener(this, "focusout", null, (e) => {
141
- if (this.collapse || this.variant === "CONTEXT" && this.hasSubmenu) {
142
- if (e.relatedTarget && this.contains(e.relatedTarget) || this.variant === "NAV" && !this.collapse)
143
- return;
144
- this.submenuActivated(e), this.hideSubmenu();
145
- }
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
- }));
150
- });
151
- }
152
- /**
153
- * Creates a tooltip for the MenuItem when it is collapsed.
154
- * @param {HTMLElement} native - The native MenuItem element.
155
- * @returns {HTMLElement} The tooltip element.
156
- */
157
- collapseItem(e) {
158
- let i = document.createElement("wje-tooltip");
159
- return i.setAttribute("content", this.textContent), i.setAttribute("placement", "right"), i.setAttribute("offset", this.offset || "0"), i.appendChild(e), i;
160
- }
161
- /**
162
- * Shows the submenu of the MenuItem.
163
- */
164
- showSubmenu() {
165
- this.tabIndex = -1, this.hasSubmenu && (this.popup.setAttribute("active", ""), this.classList.add("expanded-submenu"), this.native.classList.add("expanded-submenu"));
166
- }
167
- /**
168
- * Hides the submenu of the MenuItem.
169
- */
170
- hideSubmenu() {
171
- this.tabIndex = 0, this.hasSubmenu && (this.popup.removeAttribute("active"), this.classList.remove("expanded-submenu"), this.native.classList.remove("expanded-submenu"));
172
- }
173
- /**
174
- * Activates or deactivates the submenu of the MenuItem.
175
- */
176
- submenuActivated(e) {
177
- if (this.hasSubmenu) {
178
- let i = this.submenu.assignedElements({ flatten: !0 })[0];
179
- i.hasAttribute("active") ? this === e.target && i.removeAttribute("active") : i.setAttribute("active", "");
180
- }
181
- }
182
- /**
183
- * Clears the innerHTML of the context before disconnecting the MenuItem.
184
- */
185
- beforeDisconnect() {
186
- this.context.innerHTML = "";
187
- }
188
- }
189
- j.define("wje-menu-item", j);
190
- export {
191
- j as default
192
- };
@@ -1,57 +0,0 @@
1
- var o = Object.defineProperty;
2
- var i = (t, e, a) => e in t ? o(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
3
- var s = (t, e, a) => (i(t, typeof e != "symbol" ? e + "" : e, a), a);
4
- import d, { WjElementUtils as m } from "./wje-element.js";
5
- const u = ":host{--wje-letter-spacing: .025rem;--wje-menu-label-color: var(--wje-color-contrast-6);--wje-padding-top: 0;--wje-padding-bottom: 0;--wje-padding-start: 1.5rem;--wje-padding-end: 1.5rem}.native-menu-label{font-size:var(--wje-menu-label-font-size);display:inline-block;font-weight:var(--wje-menu-label-weight);letter-spacing:var(--wje-letter-spacing);color:var(--wje-menu-label-color);padding:var(--wje-padding-top) var(--wje-padding-start) var(--wje-padding-bottom) var(--wje-padding-end)}";
6
- class l extends d {
7
- /**
8
- * Creates an instance of MenuLabel.
9
- *
10
- * @constructor
11
- */
12
- constructor() {
13
- super();
14
- s(this, "className", "MenuLabel");
15
- this.hasSubmenu = m.hasSlot(this, "submenu");
16
- }
17
- /**
18
- * Returns the CSS styles for the component.
19
- *
20
- * @static
21
- * @returns {CSSStyleSheet}
22
- */
23
- static get cssStyleSheet() {
24
- return u;
25
- }
26
- /**
27
- * Returns the list of attributes to observe for changes.
28
- *
29
- * @static
30
- * @returns {Array<string>}
31
- */
32
- static get observedAttributes() {
33
- return [];
34
- }
35
- /**
36
- * Sets up the attributes for the component.
37
- */
38
- setupAttributes() {
39
- this.isShadowRoot = "open";
40
- }
41
- /**
42
- * Draws the component.
43
- *
44
- * @param {Object} context - The context for drawing.
45
- * @param {Object} store - The store for drawing.
46
- * @param {Object} params - The parameters for drawing.
47
- * @returns {DocumentFragment}
48
- */
49
- draw(a, c, p) {
50
- let r = document.createDocumentFragment(), n = document.createElement("slot");
51
- return n.setAttribute("part", "native"), n.classList.add("native-menu-label"), r.appendChild(n), r;
52
- }
53
- }
54
- l.define("wje-menu-label", l);
55
- export {
56
- l as default
57
- };
package/dist/wje-menu.js DELETED
@@ -1,74 +0,0 @@
1
- var m = Object.defineProperty;
2
- var d = (n, t, e) => t in n ? m(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
- import l from "./wje-element.js";
5
- const u = ":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
- class i extends l {
7
- /**
8
- * Creates an instance of Menu.
9
- *
10
- * @constructor
11
- */
12
- constructor() {
13
- super();
14
- o(this, "className", "Menu");
15
- }
16
- /**
17
- * Returns the CSS styles for the component.
18
- *
19
- * @static
20
- * @returns {CSSStyleSheet}
21
- */
22
- static get cssStyleSheet() {
23
- return u;
24
- }
25
- /**
26
- * Returns the list of attributes to observe for changes.
27
- *
28
- * @static
29
- * @returns {Array<string>}
30
- */
31
- static get observedAttributes() {
32
- return ["active", "collapse"];
33
- }
34
- /**
35
- * Sets up the attributes for the component.
36
- */
37
- setupAttributes() {
38
- this.isShadowRoot = "open";
39
- }
40
- /**
41
- * Draws the component.
42
- *
43
- * @param {Object} context - The context for drawing.
44
- * @param {Object} store - The store for drawing.
45
- * @param {Object} params - The parameters for drawing.
46
- * @returns {DocumentFragment}
47
- */
48
- draw(e, c, p) {
49
- let r = document.createDocumentFragment();
50
- this.classList.remove("wje-menu-collapse"), this.hasAttribute("collapse") && this.classList.add("wje-menu-collapse");
51
- let a = document.createElement("div");
52
- a.setAttribute("part", "native"), a.classList.add("native-menu");
53
- let s = document.createElement("slot");
54
- return a.appendChild(s), r.appendChild(a), r;
55
- }
56
- /**
57
- * Refreshes the component after drawing.
58
- */
59
- afterDraw() {
60
- Array.from(this.children).forEach((e) => {
61
- e.tagName.includes("-") && e.refresh();
62
- });
63
- }
64
- /**
65
- * Cleans up the component before disconnecting.
66
- */
67
- beforeDisconnect() {
68
- this.context.innerHTML = "";
69
- }
70
- }
71
- i.define("wje-menu", i);
72
- export {
73
- i as default
74
- };
@@ -1,99 +0,0 @@
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{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);
97
- export {
98
- d as default
99
- };
@@ -1,63 +0,0 @@
1
- var p = Object.defineProperty;
2
- var c = (o, e, t) => e in o ? p(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
- var a = (o, e, t) => (c(o, typeof e != "symbol" ? e + "" : e, t), t);
4
- import d, { event as u } from "./wje-element.js";
5
- import h from "./wje-option.js";
6
- class r extends d {
7
- /**
8
- * Creates an instance of Options.
9
- *
10
- * @constructor
11
- */
12
- constructor() {
13
- super();
14
- a(this, "depandencies", {
15
- "wje-option": h
16
- });
17
- a(this, "className", "Options");
18
- }
19
- /**
20
- * Returns the list of attributes to observe for changes.
21
- *
22
- * @static
23
- * @returns {Array<string>}
24
- */
25
- static get observedAttributes() {
26
- return [];
27
- }
28
- /**
29
- * Sets up the attributes for the component.
30
- */
31
- setupAttributes() {
32
- this.isShadowRoot = "open";
33
- }
34
- /**
35
- * Prepares the component before drawing.
36
- * Fetches the pages and creates the options elements.
37
- */
38
- async beforeDraw() {
39
- this.response = await this.getPages();
40
- let t = document.createDocumentFragment();
41
- this.response.forEach((s, i) => {
42
- let n = document.createElement("wje-option");
43
- n.setAttribute("value", s[this.itemValue] || s.value), n.innerText = s[this.itemText] || s.text, t.appendChild(n);
44
- }), this.parentElement.appendChild(t), u.dispatchCustomEvent(this, "wje-options:load", {});
45
- }
46
- /**
47
- * Fetches the pages from the provided URL.
48
- *
49
- * @param {number} page - The page number to fetch.
50
- * @returns {Promise<Object>} The fetched data.
51
- * @throws Will throw an error if the response is not ok.
52
- */
53
- async getPages(t) {
54
- const s = await fetch(this.url);
55
- if (!s.ok)
56
- throw new Error(`An error occurred: ${s.status}`);
57
- return await s.json();
58
- }
59
- }
60
- r.define("wje-options", r);
61
- export {
62
- r as default
63
- };
package/dist/wje-popup.js DELETED
@@ -1,5 +0,0 @@
1
- import { P as p } from "./popup.element-CpEjis9f.js";
2
- p.define("wje-popup", p);
3
- export {
4
- p as default
5
- };