@illinois-toolkit/ilw-header-megamenu 0.0.1
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/LICENSE +21 -0
- package/README.md +261 -0
- package/builder/ilw-header-megamenu.json +12 -0
- package/builder/versions/ilw-header-megamenu.1.0-alpha.json +70 -0
- package/dist/MegaMenu.d.ts +27 -0
- package/dist/MegaMenu.d.ts.map +1 -0
- package/dist/MegaMenuSection.d.ts +32 -0
- package/dist/MegaMenuSection.d.ts.map +1 -0
- package/dist/cdn/ilw-header-megamenu.css +1 -0
- package/dist/cdn/ilw-header-megamenu.js +772 -0
- package/dist/ilw-header-megamenu.css +1 -0
- package/dist/ilw-header-megamenu.d.ts +1 -0
- package/dist/ilw-header-megamenu.d.ts.map +1 -0
- package/dist/ilw-header-megamenu.js +248 -0
- package/package.json +49 -0
- package/src/MegaMenu.css +80 -0
- package/src/MegaMenu.styles.css +37 -0
- package/src/MegaMenu.ts +145 -0
- package/src/MegaMenuSection.css +348 -0
- package/src/MegaMenuSection.styles.css +163 -0
- package/src/MegaMenuSection.ts +285 -0
- package/src/ilw-header-megamenu.ts +2 -0
|
@@ -0,0 +1,772 @@
|
|
|
1
|
+
const R = globalThis, z = R.ShadowRoot && (R.ShadyCSS === void 0 || R.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ne = Symbol(), G = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
let de = class {
|
|
3
|
+
constructor(e, t, s) {
|
|
4
|
+
if (this._$cssResult$ = !0, s !== ne) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
5
|
+
this.cssText = e, this.t = t;
|
|
6
|
+
}
|
|
7
|
+
get styleSheet() {
|
|
8
|
+
let e = this.o;
|
|
9
|
+
const t = this.t;
|
|
10
|
+
if (z && e === void 0) {
|
|
11
|
+
const s = t !== void 0 && t.length === 1;
|
|
12
|
+
s && (e = G.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), s && G.set(t, e));
|
|
13
|
+
}
|
|
14
|
+
return e;
|
|
15
|
+
}
|
|
16
|
+
toString() {
|
|
17
|
+
return this.cssText;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const B = (i) => new de(typeof i == "string" ? i : i + "", void 0, ne), ce = (i, e) => {
|
|
21
|
+
if (z) i.adoptedStyleSheets = e.map(((t) => t instanceof CSSStyleSheet ? t : t.styleSheet));
|
|
22
|
+
else for (const t of e) {
|
|
23
|
+
const s = document.createElement("style"), n = R.litNonce;
|
|
24
|
+
n !== void 0 && s.setAttribute("nonce", n), s.textContent = t.cssText, i.appendChild(s);
|
|
25
|
+
}
|
|
26
|
+
}, Z = z ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((e) => {
|
|
27
|
+
let t = "";
|
|
28
|
+
for (const s of e.cssRules) t += s.cssText;
|
|
29
|
+
return B(t);
|
|
30
|
+
})(i) : i;
|
|
31
|
+
const { is: ue, defineProperty: pe, getOwnPropertyDescriptor: me, getOwnPropertyNames: ge, getOwnPropertySymbols: fe, getPrototypeOf: $e } = Object, I = globalThis, J = I.trustedTypes, be = J ? J.emptyScript : "", ve = I.reactiveElementPolyfillSupport, C = (i, e) => i, U = { toAttribute(i, e) {
|
|
32
|
+
switch (e) {
|
|
33
|
+
case Boolean:
|
|
34
|
+
i = i ? be : null;
|
|
35
|
+
break;
|
|
36
|
+
case Object:
|
|
37
|
+
case Array:
|
|
38
|
+
i = i == null ? i : JSON.stringify(i);
|
|
39
|
+
}
|
|
40
|
+
return i;
|
|
41
|
+
}, fromAttribute(i, e) {
|
|
42
|
+
let t = i;
|
|
43
|
+
switch (e) {
|
|
44
|
+
case Boolean:
|
|
45
|
+
t = i !== null;
|
|
46
|
+
break;
|
|
47
|
+
case Number:
|
|
48
|
+
t = i === null ? null : Number(i);
|
|
49
|
+
break;
|
|
50
|
+
case Object:
|
|
51
|
+
case Array:
|
|
52
|
+
try {
|
|
53
|
+
t = JSON.parse(i);
|
|
54
|
+
} catch {
|
|
55
|
+
t = null;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return t;
|
|
59
|
+
} }, j = (i, e) => !ue(i, e), Q = { attribute: !0, type: String, converter: U, reflect: !1, useDefault: !1, hasChanged: j };
|
|
60
|
+
Symbol.metadata ??= Symbol("metadata"), I.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
61
|
+
let _ = class extends HTMLElement {
|
|
62
|
+
static addInitializer(e) {
|
|
63
|
+
this._$Ei(), (this.l ??= []).push(e);
|
|
64
|
+
}
|
|
65
|
+
static get observedAttributes() {
|
|
66
|
+
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
67
|
+
}
|
|
68
|
+
static createProperty(e, t = Q) {
|
|
69
|
+
if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
|
|
70
|
+
const s = Symbol(), n = this.getPropertyDescriptor(e, s, t);
|
|
71
|
+
n !== void 0 && pe(this.prototype, e, n);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
static getPropertyDescriptor(e, t, s) {
|
|
75
|
+
const { get: n, set: r } = me(this.prototype, e) ?? { get() {
|
|
76
|
+
return this[t];
|
|
77
|
+
}, set(o) {
|
|
78
|
+
this[t] = o;
|
|
79
|
+
} };
|
|
80
|
+
return { get: n, set(o) {
|
|
81
|
+
const l = n?.call(this);
|
|
82
|
+
r?.call(this, o), this.requestUpdate(e, l, s);
|
|
83
|
+
}, configurable: !0, enumerable: !0 };
|
|
84
|
+
}
|
|
85
|
+
static getPropertyOptions(e) {
|
|
86
|
+
return this.elementProperties.get(e) ?? Q;
|
|
87
|
+
}
|
|
88
|
+
static _$Ei() {
|
|
89
|
+
if (this.hasOwnProperty(C("elementProperties"))) return;
|
|
90
|
+
const e = $e(this);
|
|
91
|
+
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
92
|
+
}
|
|
93
|
+
static finalize() {
|
|
94
|
+
if (this.hasOwnProperty(C("finalized"))) return;
|
|
95
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(C("properties"))) {
|
|
96
|
+
const t = this.properties, s = [...ge(t), ...fe(t)];
|
|
97
|
+
for (const n of s) this.createProperty(n, t[n]);
|
|
98
|
+
}
|
|
99
|
+
const e = this[Symbol.metadata];
|
|
100
|
+
if (e !== null) {
|
|
101
|
+
const t = litPropertyMetadata.get(e);
|
|
102
|
+
if (t !== void 0) for (const [s, n] of t) this.elementProperties.set(s, n);
|
|
103
|
+
}
|
|
104
|
+
this._$Eh = /* @__PURE__ */ new Map();
|
|
105
|
+
for (const [t, s] of this.elementProperties) {
|
|
106
|
+
const n = this._$Eu(t, s);
|
|
107
|
+
n !== void 0 && this._$Eh.set(n, t);
|
|
108
|
+
}
|
|
109
|
+
this.elementStyles = this.finalizeStyles(this.styles);
|
|
110
|
+
}
|
|
111
|
+
static finalizeStyles(e) {
|
|
112
|
+
const t = [];
|
|
113
|
+
if (Array.isArray(e)) {
|
|
114
|
+
const s = new Set(e.flat(1 / 0).reverse());
|
|
115
|
+
for (const n of s) t.unshift(Z(n));
|
|
116
|
+
} else e !== void 0 && t.push(Z(e));
|
|
117
|
+
return t;
|
|
118
|
+
}
|
|
119
|
+
static _$Eu(e, t) {
|
|
120
|
+
const s = t.attribute;
|
|
121
|
+
return s === !1 ? void 0 : typeof s == "string" ? s : typeof e == "string" ? e.toLowerCase() : void 0;
|
|
122
|
+
}
|
|
123
|
+
constructor() {
|
|
124
|
+
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
125
|
+
}
|
|
126
|
+
_$Ev() {
|
|
127
|
+
this._$ES = new Promise(((e) => this.enableUpdating = e)), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(((e) => e(this)));
|
|
128
|
+
}
|
|
129
|
+
addController(e) {
|
|
130
|
+
(this._$EO ??= /* @__PURE__ */ new Set()).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.();
|
|
131
|
+
}
|
|
132
|
+
removeController(e) {
|
|
133
|
+
this._$EO?.delete(e);
|
|
134
|
+
}
|
|
135
|
+
_$E_() {
|
|
136
|
+
const e = /* @__PURE__ */ new Map(), t = this.constructor.elementProperties;
|
|
137
|
+
for (const s of t.keys()) this.hasOwnProperty(s) && (e.set(s, this[s]), delete this[s]);
|
|
138
|
+
e.size > 0 && (this._$Ep = e);
|
|
139
|
+
}
|
|
140
|
+
createRenderRoot() {
|
|
141
|
+
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
142
|
+
return ce(e, this.constructor.elementStyles), e;
|
|
143
|
+
}
|
|
144
|
+
connectedCallback() {
|
|
145
|
+
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((e) => e.hostConnected?.()));
|
|
146
|
+
}
|
|
147
|
+
enableUpdating(e) {
|
|
148
|
+
}
|
|
149
|
+
disconnectedCallback() {
|
|
150
|
+
this._$EO?.forEach(((e) => e.hostDisconnected?.()));
|
|
151
|
+
}
|
|
152
|
+
attributeChangedCallback(e, t, s) {
|
|
153
|
+
this._$AK(e, s);
|
|
154
|
+
}
|
|
155
|
+
_$ET(e, t) {
|
|
156
|
+
const s = this.constructor.elementProperties.get(e), n = this.constructor._$Eu(e, s);
|
|
157
|
+
if (n !== void 0 && s.reflect === !0) {
|
|
158
|
+
const r = (s.converter?.toAttribute !== void 0 ? s.converter : U).toAttribute(t, s.type);
|
|
159
|
+
this._$Em = e, r == null ? this.removeAttribute(n) : this.setAttribute(n, r), this._$Em = null;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
_$AK(e, t) {
|
|
163
|
+
const s = this.constructor, n = s._$Eh.get(e);
|
|
164
|
+
if (n !== void 0 && this._$Em !== n) {
|
|
165
|
+
const r = s.getPropertyOptions(n), o = typeof r.converter == "function" ? { fromAttribute: r.converter } : r.converter?.fromAttribute !== void 0 ? r.converter : U;
|
|
166
|
+
this._$Em = n;
|
|
167
|
+
const l = o.fromAttribute(t, r.type);
|
|
168
|
+
this[n] = l ?? this._$Ej?.get(n) ?? l, this._$Em = null;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
requestUpdate(e, t, s) {
|
|
172
|
+
if (e !== void 0) {
|
|
173
|
+
const n = this.constructor, r = this[e];
|
|
174
|
+
if (s ??= n.getPropertyOptions(e), !((s.hasChanged ?? j)(r, t) || s.useDefault && s.reflect && r === this._$Ej?.get(e) && !this.hasAttribute(n._$Eu(e, s)))) return;
|
|
175
|
+
this.C(e, t, s);
|
|
176
|
+
}
|
|
177
|
+
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
178
|
+
}
|
|
179
|
+
C(e, t, { useDefault: s, reflect: n, wrapped: r }, o) {
|
|
180
|
+
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, o ?? t ?? this[e]), r !== !0 || o !== void 0) || (this._$AL.has(e) || (this.hasUpdated || s || (t = void 0), this._$AL.set(e, t)), n === !0 && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
|
|
181
|
+
}
|
|
182
|
+
async _$EP() {
|
|
183
|
+
this.isUpdatePending = !0;
|
|
184
|
+
try {
|
|
185
|
+
await this._$ES;
|
|
186
|
+
} catch (t) {
|
|
187
|
+
Promise.reject(t);
|
|
188
|
+
}
|
|
189
|
+
const e = this.scheduleUpdate();
|
|
190
|
+
return e != null && await e, !this.isUpdatePending;
|
|
191
|
+
}
|
|
192
|
+
scheduleUpdate() {
|
|
193
|
+
return this.performUpdate();
|
|
194
|
+
}
|
|
195
|
+
performUpdate() {
|
|
196
|
+
if (!this.isUpdatePending) return;
|
|
197
|
+
if (!this.hasUpdated) {
|
|
198
|
+
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
199
|
+
for (const [n, r] of this._$Ep) this[n] = r;
|
|
200
|
+
this._$Ep = void 0;
|
|
201
|
+
}
|
|
202
|
+
const s = this.constructor.elementProperties;
|
|
203
|
+
if (s.size > 0) for (const [n, r] of s) {
|
|
204
|
+
const { wrapped: o } = r, l = this[n];
|
|
205
|
+
o !== !0 || this._$AL.has(n) || l === void 0 || this.C(n, void 0, r, l);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
let e = !1;
|
|
209
|
+
const t = this._$AL;
|
|
210
|
+
try {
|
|
211
|
+
e = this.shouldUpdate(t), e ? (this.willUpdate(t), this._$EO?.forEach(((s) => s.hostUpdate?.())), this.update(t)) : this._$EM();
|
|
212
|
+
} catch (s) {
|
|
213
|
+
throw e = !1, this._$EM(), s;
|
|
214
|
+
}
|
|
215
|
+
e && this._$AE(t);
|
|
216
|
+
}
|
|
217
|
+
willUpdate(e) {
|
|
218
|
+
}
|
|
219
|
+
_$AE(e) {
|
|
220
|
+
this._$EO?.forEach(((t) => t.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
|
|
221
|
+
}
|
|
222
|
+
_$EM() {
|
|
223
|
+
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
224
|
+
}
|
|
225
|
+
get updateComplete() {
|
|
226
|
+
return this.getUpdateComplete();
|
|
227
|
+
}
|
|
228
|
+
getUpdateComplete() {
|
|
229
|
+
return this._$ES;
|
|
230
|
+
}
|
|
231
|
+
shouldUpdate(e) {
|
|
232
|
+
return !0;
|
|
233
|
+
}
|
|
234
|
+
update(e) {
|
|
235
|
+
this._$Eq &&= this._$Eq.forEach(((t) => this._$ET(t, this[t]))), this._$EM();
|
|
236
|
+
}
|
|
237
|
+
updated(e) {
|
|
238
|
+
}
|
|
239
|
+
firstUpdated(e) {
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
_.elementStyles = [], _.shadowRootOptions = { mode: "open" }, _[C("elementProperties")] = /* @__PURE__ */ new Map(), _[C("finalized")] = /* @__PURE__ */ new Map(), ve?.({ ReactiveElement: _ }), (I.reactiveElementVersions ??= []).push("2.1.1");
|
|
243
|
+
const q = globalThis, L = q.trustedTypes, X = L ? L.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, re = "$lit$", g = `lit$${Math.random().toFixed(9).slice(2)}$`, oe = "?" + g, we = `<${oe}>`, w = document, O = () => w.createComment(""), P = (i) => i === null || typeof i != "object" && typeof i != "function", F = Array.isArray, ye = (i) => F(i) || typeof i?.[Symbol.iterator] == "function", W = `[
|
|
244
|
+
\f\r]`, k = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Y = /-->/g, ee = />/g, b = RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^
|
|
245
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), te = /'/g, ie = /"/g, ae = /^(?:script|style|textarea|title)$/i, _e = (i) => (e, ...t) => ({ _$litType$: i, strings: e, values: t }), S = _e(1), E = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), se = /* @__PURE__ */ new WeakMap(), v = w.createTreeWalker(w, 129);
|
|
246
|
+
function le(i, e) {
|
|
247
|
+
if (!F(i) || !i.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
248
|
+
return X !== void 0 ? X.createHTML(e) : e;
|
|
249
|
+
}
|
|
250
|
+
const Ae = (i, e) => {
|
|
251
|
+
const t = i.length - 1, s = [];
|
|
252
|
+
let n, r = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", o = k;
|
|
253
|
+
for (let l = 0; l < t; l++) {
|
|
254
|
+
const a = i[l];
|
|
255
|
+
let d, c, h = -1, p = 0;
|
|
256
|
+
for (; p < a.length && (o.lastIndex = p, c = o.exec(a), c !== null); ) p = o.lastIndex, o === k ? c[1] === "!--" ? o = Y : c[1] !== void 0 ? o = ee : c[2] !== void 0 ? (ae.test(c[2]) && (n = RegExp("</" + c[2], "g")), o = b) : c[3] !== void 0 && (o = b) : o === b ? c[0] === ">" ? (o = n ?? k, h = -1) : c[1] === void 0 ? h = -2 : (h = o.lastIndex - c[2].length, d = c[1], o = c[3] === void 0 ? b : c[3] === '"' ? ie : te) : o === ie || o === te ? o = b : o === Y || o === ee ? o = k : (o = b, n = void 0);
|
|
257
|
+
const m = o === b && i[l + 1].startsWith("/>") ? " " : "";
|
|
258
|
+
r += o === k ? a + we : h >= 0 ? (s.push(d), a.slice(0, h) + re + a.slice(h) + g + m) : a + g + (h === -2 ? l : m);
|
|
259
|
+
}
|
|
260
|
+
return [le(i, r + (i[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), s];
|
|
261
|
+
};
|
|
262
|
+
class N {
|
|
263
|
+
constructor({ strings: e, _$litType$: t }, s) {
|
|
264
|
+
let n;
|
|
265
|
+
this.parts = [];
|
|
266
|
+
let r = 0, o = 0;
|
|
267
|
+
const l = e.length - 1, a = this.parts, [d, c] = Ae(e, t);
|
|
268
|
+
if (this.el = N.createElement(d, s), v.currentNode = this.el.content, t === 2 || t === 3) {
|
|
269
|
+
const h = this.el.content.firstChild;
|
|
270
|
+
h.replaceWith(...h.childNodes);
|
|
271
|
+
}
|
|
272
|
+
for (; (n = v.nextNode()) !== null && a.length < l; ) {
|
|
273
|
+
if (n.nodeType === 1) {
|
|
274
|
+
if (n.hasAttributes()) for (const h of n.getAttributeNames()) if (h.endsWith(re)) {
|
|
275
|
+
const p = c[o++], m = n.getAttribute(h).split(g), T = /([.?@])?(.*)/.exec(p);
|
|
276
|
+
a.push({ type: 1, index: r, name: T[2], strings: m, ctor: T[1] === "." ? xe : T[1] === "?" ? ke : T[1] === "@" ? Se : D }), n.removeAttribute(h);
|
|
277
|
+
} else h.startsWith(g) && (a.push({ type: 6, index: r }), n.removeAttribute(h));
|
|
278
|
+
if (ae.test(n.tagName)) {
|
|
279
|
+
const h = n.textContent.split(g), p = h.length - 1;
|
|
280
|
+
if (p > 0) {
|
|
281
|
+
n.textContent = L ? L.emptyScript : "";
|
|
282
|
+
for (let m = 0; m < p; m++) n.append(h[m], O()), v.nextNode(), a.push({ type: 2, index: ++r });
|
|
283
|
+
n.append(h[p], O());
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
} else if (n.nodeType === 8) if (n.data === oe) a.push({ type: 2, index: r });
|
|
287
|
+
else {
|
|
288
|
+
let h = -1;
|
|
289
|
+
for (; (h = n.data.indexOf(g, h + 1)) !== -1; ) a.push({ type: 7, index: r }), h += g.length - 1;
|
|
290
|
+
}
|
|
291
|
+
r++;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
static createElement(e, t) {
|
|
295
|
+
const s = w.createElement("template");
|
|
296
|
+
return s.innerHTML = e, s;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
function x(i, e, t = i, s) {
|
|
300
|
+
if (e === E) return e;
|
|
301
|
+
let n = s !== void 0 ? t._$Co?.[s] : t._$Cl;
|
|
302
|
+
const r = P(e) ? void 0 : e._$litDirective$;
|
|
303
|
+
return n?.constructor !== r && (n?._$AO?.(!1), r === void 0 ? n = void 0 : (n = new r(i), n._$AT(i, t, s)), s !== void 0 ? (t._$Co ??= [])[s] = n : t._$Cl = n), n !== void 0 && (e = x(i, n._$AS(i, e.values), n, s)), e;
|
|
304
|
+
}
|
|
305
|
+
class Ee {
|
|
306
|
+
constructor(e, t) {
|
|
307
|
+
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
|
|
308
|
+
}
|
|
309
|
+
get parentNode() {
|
|
310
|
+
return this._$AM.parentNode;
|
|
311
|
+
}
|
|
312
|
+
get _$AU() {
|
|
313
|
+
return this._$AM._$AU;
|
|
314
|
+
}
|
|
315
|
+
u(e) {
|
|
316
|
+
const { el: { content: t }, parts: s } = this._$AD, n = (e?.creationScope ?? w).importNode(t, !0);
|
|
317
|
+
v.currentNode = n;
|
|
318
|
+
let r = v.nextNode(), o = 0, l = 0, a = s[0];
|
|
319
|
+
for (; a !== void 0; ) {
|
|
320
|
+
if (o === a.index) {
|
|
321
|
+
let d;
|
|
322
|
+
a.type === 2 ? d = new M(r, r.nextSibling, this, e) : a.type === 1 ? d = new a.ctor(r, a.name, a.strings, this, e) : a.type === 6 && (d = new Ce(r, this, e)), this._$AV.push(d), a = s[++l];
|
|
323
|
+
}
|
|
324
|
+
o !== a?.index && (r = v.nextNode(), o++);
|
|
325
|
+
}
|
|
326
|
+
return v.currentNode = w, n;
|
|
327
|
+
}
|
|
328
|
+
p(e) {
|
|
329
|
+
let t = 0;
|
|
330
|
+
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(e, s, t), t += s.strings.length - 2) : s._$AI(e[t])), t++;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
class M {
|
|
334
|
+
get _$AU() {
|
|
335
|
+
return this._$AM?._$AU ?? this._$Cv;
|
|
336
|
+
}
|
|
337
|
+
constructor(e, t, s, n) {
|
|
338
|
+
this.type = 2, this._$AH = u, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = s, this.options = n, this._$Cv = n?.isConnected ?? !0;
|
|
339
|
+
}
|
|
340
|
+
get parentNode() {
|
|
341
|
+
let e = this._$AA.parentNode;
|
|
342
|
+
const t = this._$AM;
|
|
343
|
+
return t !== void 0 && e?.nodeType === 11 && (e = t.parentNode), e;
|
|
344
|
+
}
|
|
345
|
+
get startNode() {
|
|
346
|
+
return this._$AA;
|
|
347
|
+
}
|
|
348
|
+
get endNode() {
|
|
349
|
+
return this._$AB;
|
|
350
|
+
}
|
|
351
|
+
_$AI(e, t = this) {
|
|
352
|
+
e = x(this, e, t), P(e) ? e === u || e == null || e === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : e !== this._$AH && e !== E && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : ye(e) ? this.k(e) : this._(e);
|
|
353
|
+
}
|
|
354
|
+
O(e) {
|
|
355
|
+
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
356
|
+
}
|
|
357
|
+
T(e) {
|
|
358
|
+
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
359
|
+
}
|
|
360
|
+
_(e) {
|
|
361
|
+
this._$AH !== u && P(this._$AH) ? this._$AA.nextSibling.data = e : this.T(w.createTextNode(e)), this._$AH = e;
|
|
362
|
+
}
|
|
363
|
+
$(e) {
|
|
364
|
+
const { values: t, _$litType$: s } = e, n = typeof s == "number" ? this._$AC(e) : (s.el === void 0 && (s.el = N.createElement(le(s.h, s.h[0]), this.options)), s);
|
|
365
|
+
if (this._$AH?._$AD === n) this._$AH.p(t);
|
|
366
|
+
else {
|
|
367
|
+
const r = new Ee(n, this), o = r.u(this.options);
|
|
368
|
+
r.p(t), this.T(o), this._$AH = r;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
_$AC(e) {
|
|
372
|
+
let t = se.get(e.strings);
|
|
373
|
+
return t === void 0 && se.set(e.strings, t = new N(e)), t;
|
|
374
|
+
}
|
|
375
|
+
k(e) {
|
|
376
|
+
F(this._$AH) || (this._$AH = [], this._$AR());
|
|
377
|
+
const t = this._$AH;
|
|
378
|
+
let s, n = 0;
|
|
379
|
+
for (const r of e) n === t.length ? t.push(s = new M(this.O(O()), this.O(O()), this, this.options)) : s = t[n], s._$AI(r), n++;
|
|
380
|
+
n < t.length && (this._$AR(s && s._$AB.nextSibling, n), t.length = n);
|
|
381
|
+
}
|
|
382
|
+
_$AR(e = this._$AA.nextSibling, t) {
|
|
383
|
+
for (this._$AP?.(!1, !0, t); e !== this._$AB; ) {
|
|
384
|
+
const s = e.nextSibling;
|
|
385
|
+
e.remove(), e = s;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
setConnected(e) {
|
|
389
|
+
this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
class D {
|
|
393
|
+
get tagName() {
|
|
394
|
+
return this.element.tagName;
|
|
395
|
+
}
|
|
396
|
+
get _$AU() {
|
|
397
|
+
return this._$AM._$AU;
|
|
398
|
+
}
|
|
399
|
+
constructor(e, t, s, n, r) {
|
|
400
|
+
this.type = 1, this._$AH = u, this._$AN = void 0, this.element = e, this.name = t, this._$AM = n, this.options = r, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = u;
|
|
401
|
+
}
|
|
402
|
+
_$AI(e, t = this, s, n) {
|
|
403
|
+
const r = this.strings;
|
|
404
|
+
let o = !1;
|
|
405
|
+
if (r === void 0) e = x(this, e, t, 0), o = !P(e) || e !== this._$AH && e !== E, o && (this._$AH = e);
|
|
406
|
+
else {
|
|
407
|
+
const l = e;
|
|
408
|
+
let a, d;
|
|
409
|
+
for (e = r[0], a = 0; a < r.length - 1; a++) d = x(this, l[s + a], t, a), d === E && (d = this._$AH[a]), o ||= !P(d) || d !== this._$AH[a], d === u ? e = u : e !== u && (e += (d ?? "") + r[a + 1]), this._$AH[a] = d;
|
|
410
|
+
}
|
|
411
|
+
o && !n && this.j(e);
|
|
412
|
+
}
|
|
413
|
+
j(e) {
|
|
414
|
+
e === u ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
class xe extends D {
|
|
418
|
+
constructor() {
|
|
419
|
+
super(...arguments), this.type = 3;
|
|
420
|
+
}
|
|
421
|
+
j(e) {
|
|
422
|
+
this.element[this.name] = e === u ? void 0 : e;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
class ke extends D {
|
|
426
|
+
constructor() {
|
|
427
|
+
super(...arguments), this.type = 4;
|
|
428
|
+
}
|
|
429
|
+
j(e) {
|
|
430
|
+
this.element.toggleAttribute(this.name, !!e && e !== u);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
class Se extends D {
|
|
434
|
+
constructor(e, t, s, n, r) {
|
|
435
|
+
super(e, t, s, n, r), this.type = 5;
|
|
436
|
+
}
|
|
437
|
+
_$AI(e, t = this) {
|
|
438
|
+
if ((e = x(this, e, t, 0) ?? u) === E) return;
|
|
439
|
+
const s = this._$AH, n = e === u && s !== u || e.capture !== s.capture || e.once !== s.once || e.passive !== s.passive, r = e !== u && (s === u || n);
|
|
440
|
+
n && this.element.removeEventListener(this.name, this, s), r && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
441
|
+
}
|
|
442
|
+
handleEvent(e) {
|
|
443
|
+
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
class Ce {
|
|
447
|
+
constructor(e, t, s) {
|
|
448
|
+
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = s;
|
|
449
|
+
}
|
|
450
|
+
get _$AU() {
|
|
451
|
+
return this._$AM._$AU;
|
|
452
|
+
}
|
|
453
|
+
_$AI(e) {
|
|
454
|
+
x(this, e);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
const Oe = q.litHtmlPolyfillSupport;
|
|
458
|
+
Oe?.(N, M), (q.litHtmlVersions ??= []).push("3.3.1");
|
|
459
|
+
const Pe = (i, e, t) => {
|
|
460
|
+
const s = t?.renderBefore ?? e;
|
|
461
|
+
let n = s._$litPart$;
|
|
462
|
+
if (n === void 0) {
|
|
463
|
+
const r = t?.renderBefore ?? null;
|
|
464
|
+
s._$litPart$ = n = new M(e.insertBefore(O(), r), r, void 0, t ?? {});
|
|
465
|
+
}
|
|
466
|
+
return n._$AI(i), n;
|
|
467
|
+
};
|
|
468
|
+
const V = globalThis;
|
|
469
|
+
class A extends _ {
|
|
470
|
+
constructor() {
|
|
471
|
+
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
472
|
+
}
|
|
473
|
+
createRenderRoot() {
|
|
474
|
+
const e = super.createRenderRoot();
|
|
475
|
+
return this.renderOptions.renderBefore ??= e.firstChild, e;
|
|
476
|
+
}
|
|
477
|
+
update(e) {
|
|
478
|
+
const t = this.render();
|
|
479
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Pe(t, this.renderRoot, this.renderOptions);
|
|
480
|
+
}
|
|
481
|
+
connectedCallback() {
|
|
482
|
+
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
483
|
+
}
|
|
484
|
+
disconnectedCallback() {
|
|
485
|
+
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
486
|
+
}
|
|
487
|
+
render() {
|
|
488
|
+
return E;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
A._$litElement$ = !0, A.finalized = !0, V.litElementHydrateSupport?.({ LitElement: A });
|
|
492
|
+
const Ne = V.litElementPolyfillSupport;
|
|
493
|
+
Ne?.({ LitElement: A });
|
|
494
|
+
(V.litElementVersions ??= []).push("4.2.1");
|
|
495
|
+
const Me = "@layer base{:host{--ilw-header-megamenu--link-color: var(--il-blue);--ilw-header-megamenu--link-color--hover: var(--il-altgeld);--ilw-header-megamenu--link-background: transparent;--ilw-header-megamenu--link-background--hover: white;--ilw-header-megamenu--link-background--focus: var(--il-industrial-lighter-4);--ilw-header-megamenu--link-background--sub--focus: var(--il-industrial-lighter-4);--ilw-header-megamenu--link-border-bottom-highlight: 4px solid transparent;--ilw-header-megamenu--link-border-bottom-highlight--hover: 4px solid var(--il-orange);--ilw-header-megamenu--link-border-bottom-highlight--focus: 4px solid var(--il-blue);--ilw-header-megamenu--link-border-left-highlight: none;--ilw-header-megamenu--link-border-left-highlight--focus: none;--ilw-header-megamenu--background: #E8E9EB;--ilw-header-megamenu--flex-direction: row;--ilw-header-megamenu--items--position: absolute;--ilw-header-megamenu--items--border: 1px solid rgb(0, 0, 0, .01);--ilw-header-megamenu--items--box-shadow: 0 0 4px #00000040;--ilw-header-megamenu--items--width: 1270px;--ilw-header-megamenu--items--top: initial;--ilw-header-megamenu--items--left: calc(var(--ilw-margin--side) - 39px);--ilw-header-megamenu--font: 700 16px/22px var(--il-font-sans);--ilw-header-megamenu--grid-template-columns: auto auto;--ilw-header-megamenu-section--grid-template-columns--header: auto 24px;--ilw-header-megamenu-section--anchor--padding: 6px 20px;--ilw-header-megamenu-section--anchor--border: none;--ilw-header-megamenu-section--anchor--text-indent: 0;--ilw-header-megamenu-section--transform: none;--ilw-header-megamenu-section--transform--selected: rotate(180deg)}}div.parent.full{padding-top:6px;margin:0 calc(var(--ilw-margin--side) - 9px)}";
|
|
496
|
+
const he = (i) => (e, t) => {
|
|
497
|
+
t !== void 0 ? t.addInitializer((() => {
|
|
498
|
+
customElements.define(i, e);
|
|
499
|
+
})) : customElements.define(i, e);
|
|
500
|
+
};
|
|
501
|
+
const Te = { attribute: !0, type: String, converter: U, reflect: !1, hasChanged: j }, Re = (i = Te, e, t) => {
|
|
502
|
+
const { kind: s, metadata: n } = t;
|
|
503
|
+
let r = globalThis.litPropertyMetadata.get(n);
|
|
504
|
+
if (r === void 0 && globalThis.litPropertyMetadata.set(n, r = /* @__PURE__ */ new Map()), s === "setter" && ((i = Object.create(i)).wrapped = !0), r.set(t.name, i), s === "accessor") {
|
|
505
|
+
const { name: o } = t;
|
|
506
|
+
return { set(l) {
|
|
507
|
+
const a = e.get.call(this);
|
|
508
|
+
e.set.call(this, l), this.requestUpdate(o, a, i);
|
|
509
|
+
}, init(l) {
|
|
510
|
+
return l !== void 0 && this.C(o, void 0, i, l), l;
|
|
511
|
+
} };
|
|
512
|
+
}
|
|
513
|
+
if (s === "setter") {
|
|
514
|
+
const { name: o } = t;
|
|
515
|
+
return function(l) {
|
|
516
|
+
const a = this[o];
|
|
517
|
+
e.call(this, l), this.requestUpdate(o, a, i);
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
throw Error("Unsupported decorator location: " + s);
|
|
521
|
+
};
|
|
522
|
+
function $(i) {
|
|
523
|
+
return (e, t) => typeof t == "object" ? Re(i, e, t) : ((s, n, r) => {
|
|
524
|
+
const o = n.hasOwnProperty(r);
|
|
525
|
+
return n.constructor.createProperty(r, s), o ? Object.getOwnPropertyDescriptor(n, r) : void 0;
|
|
526
|
+
})(i, e, t);
|
|
527
|
+
}
|
|
528
|
+
var Ue = Object.defineProperty, Le = Object.getOwnPropertyDescriptor, K = (i, e, t, s) => {
|
|
529
|
+
for (var n = s > 1 ? void 0 : s ? Le(e, t) : e, r = i.length - 1, o; r >= 0; r--)
|
|
530
|
+
(o = i[r]) && (n = (s ? o(e, t, n) : o(n)) || n);
|
|
531
|
+
return s && n && Ue(e, t, n), n;
|
|
532
|
+
};
|
|
533
|
+
let H = class extends A {
|
|
534
|
+
constructor() {
|
|
535
|
+
super(), this.compact = !1, this.width = 990, this.addEventListener("keydown", this.handleWindowKeydown.bind(this)), this.handleWindowResize = this.handleWindowResize.bind(this), this.handleWindowClick = this.handleWindowClick.bind(this);
|
|
536
|
+
}
|
|
537
|
+
static get styles() {
|
|
538
|
+
return B(Me);
|
|
539
|
+
}
|
|
540
|
+
connectedCallback() {
|
|
541
|
+
super.connectedCallback(), window.addEventListener("click", this.handleWindowClick.bind(this)), window.addEventListener("resize", this.handleWindowResize), this.handleWindowResize();
|
|
542
|
+
}
|
|
543
|
+
disconnectedCallback() {
|
|
544
|
+
super.disconnectedCallback(), window.removeEventListener("click", this.handleWindowClick.bind(this)), window.removeEventListener("resize", this.handleWindowResize);
|
|
545
|
+
}
|
|
546
|
+
handleWindowClick(i) {
|
|
547
|
+
this.contains(i.target) || this.closeAllExceptOneSections(null);
|
|
548
|
+
}
|
|
549
|
+
handleWindowKeydown(i) {
|
|
550
|
+
i.key === "Escape" && this.closeAllExceptOneSections(null), i.key === "ArrowRight" && (i.preventDefault(), this.closeAllExceptOneSections(null), this.gotoNextSection()), i.key === "ArrowLeft" && (i.preventDefault(), this.closeAllExceptOneSections(null), this.gotoPreviousSection());
|
|
551
|
+
}
|
|
552
|
+
handleNavigationSectionToggleClick(i) {
|
|
553
|
+
this.closeAllExceptOneSections(i.target);
|
|
554
|
+
}
|
|
555
|
+
gotoPreviousSection() {
|
|
556
|
+
let i = null, e = document.activeElement;
|
|
557
|
+
if (e != null) {
|
|
558
|
+
if (e.closest("li") && e.closest("li").previousElementSibling) {
|
|
559
|
+
const t = e.closest("li").previousElementSibling;
|
|
560
|
+
t && t.children.length > 0 && (i = t.children[0]);
|
|
561
|
+
}
|
|
562
|
+
i && i.tagName === "ILW-HEADER-MEGAMENU-SECTION" ? i.setFocus(!0) : i.focus();
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
gotoNextSection() {
|
|
566
|
+
let i = null, e = document.activeElement;
|
|
567
|
+
if (e != null) {
|
|
568
|
+
if (e.closest("li") && e.closest("li").nextElementSibling) {
|
|
569
|
+
const t = e.closest("li").nextElementSibling;
|
|
570
|
+
t && t.children.length > 0 && (i = t.children[0]);
|
|
571
|
+
}
|
|
572
|
+
i && i.tagName === "ILW-HEADER-MEGAMENU-SECTION" ? i.setFocus() : i.focus();
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
handleWindowResize() {
|
|
576
|
+
(this.offsetWidth == 0 ? window.innerWidth : this.offsetWidth) < this.width ? this.compact || this.setCompactTrue() : this.compact && this.setCompactFalse();
|
|
577
|
+
}
|
|
578
|
+
setCompactTrue() {
|
|
579
|
+
this.compact = !0, this.querySelectorAll("ilw-header-megamenu-section").forEach((i) => {
|
|
580
|
+
i.compact = !0;
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
setCompactFalse() {
|
|
584
|
+
this.compact = !1, this.querySelectorAll("ilw-header-megamenu-section").forEach((i) => {
|
|
585
|
+
i.compact = !1;
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
getSections() {
|
|
589
|
+
return this.querySelectorAll("ilw-header-megamenu-section");
|
|
590
|
+
}
|
|
591
|
+
closeAllExceptOneSections(i) {
|
|
592
|
+
this.getSections().forEach((e) => {
|
|
593
|
+
(i == null || i != e) && (e.expanded = !1);
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
render() {
|
|
597
|
+
return S`
|
|
598
|
+
<nav aria-label="Header Menu Navigation" @ilw-header-megamenu-section-expanded=${this.handleNavigationSectionToggleClick}>
|
|
599
|
+
<div class="parent ${this.compact ? "compact" : "full"}"><slot></slot></div>
|
|
600
|
+
</nav>
|
|
601
|
+
`;
|
|
602
|
+
}
|
|
603
|
+
};
|
|
604
|
+
K([
|
|
605
|
+
$({
|
|
606
|
+
type: Boolean,
|
|
607
|
+
reflect: !0
|
|
608
|
+
})
|
|
609
|
+
], H.prototype, "compact", 2);
|
|
610
|
+
K([
|
|
611
|
+
$({
|
|
612
|
+
type: Number
|
|
613
|
+
})
|
|
614
|
+
], H.prototype, "width", 2);
|
|
615
|
+
H = K([
|
|
616
|
+
he("ilw-header-megamenu")
|
|
617
|
+
], H);
|
|
618
|
+
const He = '#items{display:none}#items.expanded{all:initial;box-sizing:border-box;flex-direction:column;border:var(--ilw-header-megamenu--items--border);box-shadow:var(--ilw-header-megamenu--items--box-shadow);width:var(--ilw-header-megamenu--items--width);max-width:100vw + 39px;position:var(--ilw-header-megamenu--items--position);display:grid;left:var(--ilw-header-megamenu--items--left);top:var(--ilw-header-megamenu--items--top);z-index:100;background:#fff}.parent{height:100%}button,.link{all:initial;box-sizing:border-box;display:block;position:relative;padding:var(--ilw-header-megamenu-section--anchor--padding);font:var(--ilw-header-megamenu--font);background:var(--ilw-header-megamenu--link-background);color:var(--ilw-header-megamenu--link-color);fill:var(--ilw-header-megamenu--link-color);border-width:0 0 3px 0;border-style:solid;border-color:transparent;outline:0;cursor:pointer;height:100%;width:100%;border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight)}:is(button,.link) svg{padding:2px;transform:var(--ilw-header-megamenu-section--transform)}:is(button,.link).current{border-color:var(--il-blue)}:is(button,.link):hover{background:var(--ilw-header-megamenu--link-background--hover);border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight--hover);color:var(--ilw-header-megamenu--link-color--hover);fill:var(--ilw-header-megamenu--link-color--hover);text-decoration:underline}:is(button,.link):hover svg{outline:2px dotted var(--il-altgeld)}:is(button,.link):focus{background:var(--ilw-header-megamenu--link-background--focus);border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight--focus);border-left:var(--ilw-header-megamenu--link-border-left-highlight--focus)}button[aria-expanded=true]{text-decoration:underline;color:var(--ilw-header-megamenu--link-color--hover);background:var(--ilw-header-megamenu--link-background--hover)}button[aria-expanded=true]:focus{background:var(--ilw-header-megamenu--link-background--hover);border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight--hover)}button[aria-expanded=true] svg{fill:var(--ilw-header-megamenu--link-color--hover);transform:var(--ilw-header-megamenu-section--transform--selected);background:var(--ilw-header-megamenu--link-background--hover)}button[aria-expanded=true] svg:focus{background:var(--ilw-header-megamenu--link-background--hover)}.header{position:relative;display:grid;grid-template-columns:var(--ilw-header-megamenu-section--grid-template-columns--header);grid-template-areas:"label icon";grid-gap:4px}.header-link.current button{border-color:var(--il-blue)}.header-link{position:relative;display:grid;grid-template-columns:var(--ilw-header-megamenu--grid-template-columns);grid-template-areas:"label icon";align-items:center;height:100%}.header-link.highlighted{background:var(--ilw-header-megamenu--link-background--hover)}.header-link .link{padding:6px 0 6px 20px}.header-link button{padding:6px 20px 6px 8px}.label,.link{box-sizing:border-box;display:block;position:relative;grid-area:label}.icon,.header-link button{align-self:center;align-items:center;justify-content:center;grid-area:icon}.icon{display:flex}.arrow{display:block;height:14px;width:14px}.submenu.parent button:hover .label ::slotted(span[slot="label"]),.submenu.parent button:focus .label ::slotted(span[slot="label"]){text-decoration:underline}.menu.parent .header-link.highlighted button,.menu.parent .header-link.highlighted ::slotted(a[slot="link"]){border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight--focus)!important}.submenu.parent button.arrow-only:hover,.submenu.parent button.arrow-only:focus{border-left:4px solid transparent!important}.menu.parent .compact button.arrow-only:hover,.menu.parent .compact button.arrow-only:focus{border-left:4px solid transparent!important}';
|
|
619
|
+
var Ie = Object.defineProperty, De = Object.getOwnPropertyDescriptor, y = (i, e, t, s) => {
|
|
620
|
+
for (var n = s > 1 ? void 0 : s ? De(e, t) : e, r = i.length - 1, o; r >= 0; r--)
|
|
621
|
+
(o = i[r]) && (n = (s ? o(e, t, n) : o(n)) || n);
|
|
622
|
+
return s && n && Ie(e, t, n), n;
|
|
623
|
+
};
|
|
624
|
+
let f = class extends A {
|
|
625
|
+
constructor() {
|
|
626
|
+
super(), this.current = !1, this.compact = !1, this.right = !1, this.expanded = !1, this.mouseover = !1, this.linked = !1, this.addEventListener("keydown", this.handleWindowKeydown.bind(this));
|
|
627
|
+
}
|
|
628
|
+
static get styles() {
|
|
629
|
+
return B(He);
|
|
630
|
+
}
|
|
631
|
+
connectedCallback() {
|
|
632
|
+
super.connectedCallback();
|
|
633
|
+
}
|
|
634
|
+
handleToggleClick(i) {
|
|
635
|
+
this.expanded = !this.expanded, this.dispatchEvent(new CustomEvent("ilw-header-megamenu-section-expanded", { detail: !this.expanded, bubbles: !0, composed: !0 }));
|
|
636
|
+
}
|
|
637
|
+
handleWindowKeydown(i) {
|
|
638
|
+
i.key === "ArrowDown" ? (i.stopPropagation(), i.preventDefault(), this.moveToNextItem(), this.closeAllExceptOneSections(i.target)) : i.key === "ArrowRight" || i.key === "ArrowLeft" ? this.isOnAnchorInLinked() && i.key === "ArrowRight" ? (i.stopPropagation(), i.preventDefault(), this.expanded = !1, this.setFocus(!0)) : this.isOnButtonInLinked() && i.key === "ArrowLeft" ? (i.stopPropagation(), i.preventDefault(), this.expanded = !1, this.setFocus()) : this.isOnButtonInLinked() && i.key === "ArrowRight" ? this.expanded = !1 : this.isOnAnchorInLinked() && i.key === "ArrowLeft" ? this.expanded = !1 : (this.expanded = !1, this.setFocus()) : i.key === "ArrowUp" ? (i.stopPropagation(), i.preventDefault(), this.moveToPreviousItem(), this.closeAllExceptOneSections(i.target)) : i.key === "Escape" && this.expanded && (i.stopPropagation(), this.setFocus(), this.expanded = !1);
|
|
639
|
+
}
|
|
640
|
+
isEmbedded() {
|
|
641
|
+
return this.parentElement && this.parentElement.closest("ilw-header-megamenu-section") != null;
|
|
642
|
+
}
|
|
643
|
+
isOnAnchorInLinked() {
|
|
644
|
+
return this.linked && document.activeElement && document.activeElement.tagName === "A";
|
|
645
|
+
}
|
|
646
|
+
isOnButtonInLinked() {
|
|
647
|
+
return this.linked && document.activeElement && document.activeElement.tagName === "ILW-HEADER-MEGAMENU-SECTION";
|
|
648
|
+
}
|
|
649
|
+
setFocus(i = !1) {
|
|
650
|
+
let e = null;
|
|
651
|
+
this.linked && !i ? e = this.querySelector("a") : this.shadowRoot && (e = this.shadowRoot.querySelector("a"), e == null && (e = this.shadowRoot.querySelector("button"))), e?.focus();
|
|
652
|
+
}
|
|
653
|
+
moveToNextItem() {
|
|
654
|
+
!this.expanded && !this.isEmbedded() && (this.expanded = !0);
|
|
655
|
+
const i = document.activeElement;
|
|
656
|
+
if (!i) return;
|
|
657
|
+
const e = i.closest("ILW-HEADER-MEGAMENU-SECTION");
|
|
658
|
+
if (!e) return;
|
|
659
|
+
const t = Array.from(e.querySelectorAll("a, button")), s = t.indexOf(i);
|
|
660
|
+
let n = s + 1;
|
|
661
|
+
s === -1 && (n = 0), n >= 0 && n < t.length && t[n].focus();
|
|
662
|
+
}
|
|
663
|
+
moveToPreviousItem() {
|
|
664
|
+
const i = document.activeElement;
|
|
665
|
+
if (!i) return;
|
|
666
|
+
const e = i.closest("ILW-HEADER-MEGAMENU-SECTION");
|
|
667
|
+
if (!e) return;
|
|
668
|
+
const t = Array.from(e.querySelectorAll("a, button")), s = t.indexOf(i);
|
|
669
|
+
let n = s - 1;
|
|
670
|
+
s === -1 && (n = t.length - 1), n >= 0 && n < t.length && t[n].focus();
|
|
671
|
+
}
|
|
672
|
+
renderArrow() {
|
|
673
|
+
return S`<svg class="arrow" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40.4 23.82" aria-hidden="true">
|
|
674
|
+
<path id="chevron" d="m39.34,1.06c-1.41-1.41-3.7-1.41-5.12,0l-14.02,14.02L6.18,1.06C4.76-.35,2.47-.35,1.06,1.06s-1.41,3.7,0,5.12l16.58,16.58c1.41,1.41,3.7,1.41,5.12,0L39.34,6.18c1.41-1.41,1.41-3.7,0-5.12Z"/>
|
|
675
|
+
</svg>`;
|
|
676
|
+
}
|
|
677
|
+
toggleMouseOver() {
|
|
678
|
+
this.mouseover = !this.mouseover;
|
|
679
|
+
}
|
|
680
|
+
handleNavigationSectionToggleClick(i) {
|
|
681
|
+
i.stopPropagation(), this.closeAllExceptOneSections(i.target);
|
|
682
|
+
}
|
|
683
|
+
getSections() {
|
|
684
|
+
return this.querySelectorAll("ilw-header-megamenu-section");
|
|
685
|
+
}
|
|
686
|
+
closeAllExceptOneSections(i) {
|
|
687
|
+
this.getSections().forEach((e) => {
|
|
688
|
+
(i == null || i != e) && (e.expanded = !1);
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
render() {
|
|
692
|
+
const i = this.querySelector('span[slot="action"]');
|
|
693
|
+
let e = null;
|
|
694
|
+
if (i) {
|
|
695
|
+
const o = i.querySelector("p")?.textContent?.trim() || "";
|
|
696
|
+
let l = i.querySelector("a, button");
|
|
697
|
+
o && (e = `action-${o.replace(/\s+/g, "-")}`, i.id = e), l && e && l.setAttribute("aria-labelledby", e);
|
|
698
|
+
}
|
|
699
|
+
document.querySelectorAll("ilw-header-megamenu-section").forEach((o) => {
|
|
700
|
+
const l = o.querySelectorAll("ilw-header-megamenu-section > ul > li"), a = l.length;
|
|
701
|
+
if (a === 5) {
|
|
702
|
+
l.forEach((c, h) => {
|
|
703
|
+
c.style.borderRight = "none";
|
|
704
|
+
});
|
|
705
|
+
return;
|
|
706
|
+
}
|
|
707
|
+
let d = Math.floor(a / 5) * 5;
|
|
708
|
+
d = Math.min(d, 15), l.forEach((c, h) => {
|
|
709
|
+
h + 1 <= d ? c.style.borderRight = "solid 2px var(--il-storm-85, #d5d3d3)" : c.style.borderRight = "none";
|
|
710
|
+
});
|
|
711
|
+
});
|
|
712
|
+
let s = this.parentElement != null && this.parentElement.closest("ilw-header-megamenu-section") != null;
|
|
713
|
+
this.current = this.current || this.getAttribute("aria-current") != null && (this.getAttribute("aria-current") === "page" || this.getAttribute("aria-current") === "true");
|
|
714
|
+
var n = S`
|
|
715
|
+
<div class="header-link ${this.mouseover ? "highlighted" : ""} ${this.compact ? "compact" : ""} ${this.current ? "current" : ""}" @mouseover="${this.toggleMouseOver.bind(this)}" @mouseout="${this.toggleMouseOver.bind(this)}">
|
|
716
|
+
<slot name="link"></slot>
|
|
717
|
+
<button class="arrow-only" @click=${this.handleToggleClick.bind(this)} aria-expanded=${this.expanded ? "true" : "false"} aria-label=${this.querySelector('a[slot="link"]')?.textContent + " submenu"} aria-controls="items">
|
|
718
|
+
${this.renderArrow()}
|
|
719
|
+
</button>
|
|
720
|
+
</div>
|
|
721
|
+
`, r = S`
|
|
722
|
+
<button class="${this.current ? "current" : ""}" @click=${this.handleToggleClick.bind(this)} aria-expanded=${this.expanded ? "true" : "false"} aria-controls="items">
|
|
723
|
+
<div class="header">
|
|
724
|
+
<div class="label"><slot name="label"></slot> </div>
|
|
725
|
+
<div class="icon">${this.renderArrow()}</div>
|
|
726
|
+
</div>
|
|
727
|
+
</button>
|
|
728
|
+
`;
|
|
729
|
+
return S`
|
|
730
|
+
<div class="${s ? "submenu" : "menu"} parent" @ilw-header-megamenu-section-expanded=${this.handleNavigationSectionToggleClick}>
|
|
731
|
+
${this.linked ? n : r}
|
|
732
|
+
<div id="items" class="${this.expanded ? "expanded" : ""} ${this.right ? "right" : ""}">
|
|
733
|
+
<slot></slot>
|
|
734
|
+
</div>
|
|
735
|
+
</div>
|
|
736
|
+
`;
|
|
737
|
+
}
|
|
738
|
+
};
|
|
739
|
+
y([
|
|
740
|
+
$({
|
|
741
|
+
type: Boolean
|
|
742
|
+
})
|
|
743
|
+
], f.prototype, "current", 2);
|
|
744
|
+
y([
|
|
745
|
+
$({
|
|
746
|
+
type: Boolean
|
|
747
|
+
})
|
|
748
|
+
], f.prototype, "compact", 2);
|
|
749
|
+
y([
|
|
750
|
+
$({
|
|
751
|
+
type: Boolean
|
|
752
|
+
})
|
|
753
|
+
], f.prototype, "right", 2);
|
|
754
|
+
y([
|
|
755
|
+
$({
|
|
756
|
+
type: Boolean
|
|
757
|
+
})
|
|
758
|
+
], f.prototype, "expanded", 2);
|
|
759
|
+
y([
|
|
760
|
+
$({
|
|
761
|
+
type: Boolean
|
|
762
|
+
})
|
|
763
|
+
], f.prototype, "mouseover", 2);
|
|
764
|
+
y([
|
|
765
|
+
$({
|
|
766
|
+
reflect: !0,
|
|
767
|
+
type: Boolean
|
|
768
|
+
})
|
|
769
|
+
], f.prototype, "linked", 2);
|
|
770
|
+
f = y([
|
|
771
|
+
he("ilw-header-megamenu-section")
|
|
772
|
+
], f);
|