@proximus/lavender-header 2.0.0-alpha.143 → 2.0.0-alpha.144
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +32 -32
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -2,7 +2,7 @@ var G = (r) => {
|
|
|
2
2
|
throw TypeError(r);
|
|
3
3
|
};
|
|
4
4
|
var F = (r, e, t) => e.has(r) || G("Cannot " + t);
|
|
5
|
-
var d = (r, e, t) => (F(r, e, "read from private field"), t ? t.call(r) : e.get(r)), h = (r, e, t) => e.has(r) ? G("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), A = (r, e, t, o) => (F(r, e, "write to private field"), o ? o.call(r, t) : e.set(r, t), t),
|
|
5
|
+
var d = (r, e, t) => (F(r, e, "read from private field"), t ? t.call(r) : e.get(r)), h = (r, e, t) => e.has(r) ? G("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), A = (r, e, t, o) => (F(r, e, "write to private field"), o ? o.call(r, t) : e.set(r, t), t), b = (r, e, t) => (F(r, e, "access private method"), t);
|
|
6
6
|
import "@proximus/lavender-button-icon";
|
|
7
7
|
import "@proximus/lavender-cell";
|
|
8
8
|
import { WithExtraAttributes as X, fontsizeValues as zt, PxElement as $t, transferAccessibilityAttributes as At, fontweightValues as St, colorValues as Ct, log as P, checkName as Et, WrappedInteractiveStateController as Tt } from "@proximus/lavender-common";
|
|
@@ -324,7 +324,7 @@ class It extends j {
|
|
|
324
324
|
this.$el.classList.add("wrapper"), A(this, m, new Tt(
|
|
325
325
|
this,
|
|
326
326
|
this.$el,
|
|
327
|
-
() =>
|
|
327
|
+
() => b(this, I, dt).call(this)
|
|
328
328
|
));
|
|
329
329
|
}
|
|
330
330
|
connectedCallback() {
|
|
@@ -361,7 +361,7 @@ class Nt extends HTMLElement {
|
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
363
|
customElements.get("px-mdd-a") || customElements.define("px-mdd-a", Nt);
|
|
364
|
-
const Ht = '#navigation-container{border-bottom:var(--px-size-border-m) solid var(--px-color-border-main-default)}#dropdown-zone--desktop{display:none}#primary-navigation{display:none;margin:0;padding:0}#primary-navigation div,#primary-navigation px-hstack{height:100%}#panel-container{position:absolute;top:0;left:0;right:0;z-index:999}#backdrop-filter{display:none;position:absolute;z-index:998;left:0;width:100vw;height:100%;background:#0000004d;-webkit-backdrop-filter:saturate(180%) blur(15px);backdrop-filter:saturate(180%) blur(15px)}@media screen and (min-width: 64.0625rem){#primary-navigation{display:block}#panel-container{top:auto}#dropdown-zone--desktop{display:flex;justify-content:space-between;align-items:center}#dropdown-zone--desktop ::slotted([slot="target-group"]),#dropdown-zone--desktop ::slotted([slot="user-language"]){margin-bottom:var(--px-spacing-s-laptop)}::slotted([slot="header-actions"]){margin-bottom:var(--px-padding-s-laptop)}}@media screen and (min-width: 90.0625rem){#dropdown-zone--desktop ::slotted([slot="target-group"]),#dropdown-zone--desktop ::slotted([slot="user-language"]){margin-bottom:var(--px-spacing-s-desktop)}::slotted([slot="header-actions"]){margin-bottom:var(--px-padding-s-desktop)}}';
|
|
364
|
+
const Ht = '#navigation-container{border-bottom:var(--px-size-border-m) solid var(--px-color-border-main-default)}#dropdown-zone--desktop{display:none}#primary-navigation{display:none;margin:0;padding:0}#primary-navigation div,#primary-navigation px-hstack{height:100%}#panel-container{position:absolute;top:0;left:0;right:0;z-index:999}#backdrop-filter{display:none;position:absolute;z-index:998;left:0;width:100vw;height:100%;background:#0000004d;-webkit-backdrop-filter:saturate(180%) blur(15px);backdrop-filter:saturate(180%) blur(15px)}::slotted([slot="header-logo"]){--px-size-icon-l: 1.9rem;--px-size-icon-xl: 1.9rem}@media screen and (min-width: 64.0625rem){#primary-navigation{display:block}#panel-container{top:auto}#dropdown-zone--desktop{display:flex;justify-content:space-between;align-items:center}#dropdown-zone--desktop ::slotted([slot="target-group"]),#dropdown-zone--desktop ::slotted([slot="user-language"]){margin-bottom:var(--px-spacing-s-laptop)}::slotted([slot="header-actions"]){margin-bottom:var(--px-padding-s-laptop)}::slotted([slot="header-logo"]){--px-size-icon-l: 3.2rem;--px-size-icon-xl: 3.2rem;margin-left:-.1rem}}@media screen and (min-width: 90.0625rem){#dropdown-zone--desktop ::slotted([slot="target-group"]),#dropdown-zone--desktop ::slotted([slot="user-language"]){margin-bottom:var(--px-spacing-s-desktop)}::slotted([slot="header-actions"]){margin-bottom:var(--px-padding-s-desktop)}}';
|
|
365
365
|
function R(r) {
|
|
366
366
|
var e = typeof r;
|
|
367
367
|
return r != null && (e == "object" || e == "function");
|
|
@@ -421,8 +421,8 @@ function ot(r) {
|
|
|
421
421
|
return t || ne.test(r) ? se(r.slice(2), t ? 2 : 8) : ae.test(r) ? et : +r;
|
|
422
422
|
}
|
|
423
423
|
var de = "Expected a function", le = Math.max, pe = Math.min;
|
|
424
|
-
function
|
|
425
|
-
var o, a, n, s, l,
|
|
424
|
+
function ce(r, e, t) {
|
|
425
|
+
var o, a, n, s, l, c, x = 0, z = !1, u = !1, B = !0;
|
|
426
426
|
if (typeof r != "function")
|
|
427
427
|
throw new TypeError(de);
|
|
428
428
|
e = ot(e) || 0, R(t) && (z = !!t.leading, u = "maxWait" in t, n = u ? le(ot(t.maxWait) || 0, e) : n, B = "trailing" in t ? !!t.trailing : B);
|
|
@@ -434,12 +434,12 @@ function be(r, e, t) {
|
|
|
434
434
|
return x = p, l = setTimeout(L, e), z ? D(p) : s;
|
|
435
435
|
}
|
|
436
436
|
function kt(p) {
|
|
437
|
-
var g = p -
|
|
437
|
+
var g = p - c, $ = p - x, Q = e - g;
|
|
438
438
|
return u ? pe(Q, n - $) : Q;
|
|
439
439
|
}
|
|
440
440
|
function J(p) {
|
|
441
|
-
var g = p -
|
|
442
|
-
return
|
|
441
|
+
var g = p - c, $ = p - x;
|
|
442
|
+
return c === void 0 || g >= e || g < 0 || u && $ >= n;
|
|
443
443
|
}
|
|
444
444
|
function L() {
|
|
445
445
|
var p = _();
|
|
@@ -451,42 +451,42 @@ function be(r, e, t) {
|
|
|
451
451
|
return l = void 0, B && o ? D(p) : (o = a = void 0, s);
|
|
452
452
|
}
|
|
453
453
|
function yt() {
|
|
454
|
-
l !== void 0 && clearTimeout(l), x = 0, o =
|
|
454
|
+
l !== void 0 && clearTimeout(l), x = 0, o = c = a = l = void 0;
|
|
455
455
|
}
|
|
456
456
|
function wt() {
|
|
457
457
|
return l === void 0 ? s : K(_());
|
|
458
458
|
}
|
|
459
459
|
function W() {
|
|
460
460
|
var p = _(), g = J(p);
|
|
461
|
-
if (o = arguments, a = this,
|
|
461
|
+
if (o = arguments, a = this, c = p, g) {
|
|
462
462
|
if (l === void 0)
|
|
463
|
-
return mt(
|
|
463
|
+
return mt(c);
|
|
464
464
|
if (u)
|
|
465
|
-
return clearTimeout(l), l = setTimeout(L, e), D(
|
|
465
|
+
return clearTimeout(l), l = setTimeout(L, e), D(c);
|
|
466
466
|
}
|
|
467
467
|
return l === void 0 && (l = setTimeout(L, e)), s;
|
|
468
468
|
}
|
|
469
469
|
return W.cancel = yt, W.flush = wt, W;
|
|
470
470
|
}
|
|
471
|
-
var
|
|
471
|
+
var be = "Expected a function";
|
|
472
472
|
function he(r, e, t) {
|
|
473
473
|
var o = !0, a = !0;
|
|
474
474
|
if (typeof r != "function")
|
|
475
|
-
throw new TypeError(
|
|
476
|
-
return R(t) && (o = "leading" in t ? !!t.leading : o, a = "trailing" in t ? !!t.trailing : a),
|
|
475
|
+
throw new TypeError(be);
|
|
476
|
+
return R(t) && (o = "leading" in t ? !!t.leading : o, a = "trailing" in t ? !!t.trailing : a), ce(r, e, {
|
|
477
477
|
leading: o,
|
|
478
478
|
maxWait: e,
|
|
479
479
|
trailing: a
|
|
480
480
|
});
|
|
481
481
|
}
|
|
482
|
-
const
|
|
483
|
-
|
|
482
|
+
const ct = new CSSStyleSheet();
|
|
483
|
+
ct.replaceSync(Ht);
|
|
484
484
|
const ue = "Menu";
|
|
485
|
-
var T, i,
|
|
485
|
+
var T, i, bt, U, Y, ht, Z, v, C, E, f;
|
|
486
486
|
class ge extends X {
|
|
487
487
|
constructor() {
|
|
488
488
|
var t;
|
|
489
|
-
super(
|
|
489
|
+
super(ct);
|
|
490
490
|
h(this, i);
|
|
491
491
|
h(this, T);
|
|
492
492
|
this.template = `
|
|
@@ -537,7 +537,7 @@ class ge extends X {
|
|
|
537
537
|
<slot name="main"></slot>
|
|
538
538
|
</div>
|
|
539
539
|
`, A(this, T, () => {
|
|
540
|
-
window.innerWidth >= 1024 && (
|
|
540
|
+
window.innerWidth >= 1024 && (b(this, i, ht).call(this), b(this, i, bt).call(this));
|
|
541
541
|
}), this.shadowRoot.innerHTML = this.template, this.internals = (t = this.attachInternals) == null ? void 0 : t.call(this), this.internals && (this.internals.role = "navigation");
|
|
542
542
|
}
|
|
543
543
|
connectedCallback() {
|
|
@@ -547,21 +547,21 @@ class ge extends X {
|
|
|
547
547
|
);
|
|
548
548
|
o && o.for && (t.target.checked === !1 ? (this.$backdropFilter.style.display = "block", d(this, i, C).forEach((a) => {
|
|
549
549
|
a.checked = !1;
|
|
550
|
-
}), o.checked = !0,
|
|
550
|
+
}), o.checked = !0, b(this, i, U).call(this, t.target.for)) : b(this, i, Z).call(this));
|
|
551
551
|
}), this.addEventListener("section-item-click", (t) => {
|
|
552
552
|
this.$backdropFilter.style.display = "block", d(this, i, C).forEach((o) => {
|
|
553
553
|
o.checked = !1;
|
|
554
554
|
}), this.querySelector(
|
|
555
555
|
`px-header-item[for="${t.detail.for}"]`
|
|
556
|
-
).checked = !0,
|
|
556
|
+
).checked = !0, b(this, i, U).call(this, t.detail.for);
|
|
557
557
|
}), this.addEventListener("back-to-mobile-menu", () => {
|
|
558
558
|
this.$backdropFilter.style.display = "block", d(this, i, C).forEach((t) => {
|
|
559
559
|
t.checked = !1;
|
|
560
|
-
}),
|
|
560
|
+
}), b(this, i, Y).call(this);
|
|
561
561
|
}), this.$burgerMenu.addEventListener("click", () => {
|
|
562
|
-
this.$burgerMenu.setAttribute("aria-expanded", "true"),
|
|
562
|
+
this.$burgerMenu.setAttribute("aria-expanded", "true"), b(this, i, Y).call(this);
|
|
563
563
|
}), this.addEventListener("close-panel", () => {
|
|
564
|
-
|
|
564
|
+
b(this, i, Z).call(this), this.$burgerMenu.setAttribute("aria-expanded", "false");
|
|
565
565
|
}), this.addEventListener(
|
|
566
566
|
"close-panel-from-dialog",
|
|
567
567
|
(t) => {
|
|
@@ -650,7 +650,7 @@ class ge extends X {
|
|
|
650
650
|
t ? this.setAttribute("primary-navigation-aria-label", t) : this.removeAttribute("primary-navigation-aria-label");
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
|
-
T = new WeakMap(), i = new WeakSet(),
|
|
653
|
+
T = new WeakMap(), i = new WeakSet(), bt = function() {
|
|
654
654
|
const t = this.querySelectorAll("px-mdd"), o = d(this, i, E).getBoundingClientRect().bottom;
|
|
655
655
|
t.forEach((a) => {
|
|
656
656
|
a.dialogOffsetTop = `${o}px`;
|
|
@@ -694,10 +694,10 @@ function rt(r, e, t = "bottom-left", o, a = !1) {
|
|
|
694
694
|
var z, u;
|
|
695
695
|
if (!r || !e)
|
|
696
696
|
return;
|
|
697
|
-
const n = r.getBoundingClientRect(), s = ((z = window.visualViewport) == null ? void 0 : z.height) ?? window.innerHeight, l = ((u = window.visualViewport) == null ? void 0 : u.width) ?? window.innerWidth,
|
|
697
|
+
const n = r.getBoundingClientRect(), s = ((z = window.visualViewport) == null ? void 0 : z.height) ?? window.innerHeight, l = ((u = window.visualViewport) == null ? void 0 : u.width) ?? window.innerWidth, c = o.getPropertyValue("--px-padding-s-mobile") || "16px", x = parseInt(
|
|
698
698
|
(o.getPropertyValue("--px-icon-size-xs-desktop") || "24").replace("px", "")
|
|
699
699
|
);
|
|
700
|
-
["top-left", "top-right"].includes(t) ? (e.style.bottom = `calc( ${
|
|
700
|
+
["top-left", "top-right"].includes(t) ? (e.style.bottom = `calc( ${c} + ${s - n.top - window.scrollY}px)`, e.style.top = "auto", t === "top-left" ? e.style.left = l < 768 ? `${c}px` : `${n.left}px` : e.style.right = l < 768 ? `${c}px` : `${l - n.right}px`) : (e.style.top = `${n.bottom + window.scrollY}px`, t === "bottom-left" ? e.style.left = l < 768 ? `${c}px` : `${n.left}px` : e.style.right = l < 768 ? `${c}px` : `${l - n.right - x}px`);
|
|
701
701
|
});
|
|
702
702
|
}
|
|
703
703
|
const ut = new CSSStyleSheet();
|
|
@@ -821,7 +821,7 @@ class fe extends X {
|
|
|
821
821
|
) : this.$popoverElement.style.removeProperty("--px-popover-max-height");
|
|
822
822
|
}
|
|
823
823
|
initPopover() {
|
|
824
|
-
this.$trigger && (this.$trigger.setAttribute("popovertarget", this.popoverId), this.$trigger.setAttribute("aria-controls", this.getAttribute("id")), this.hasAttribute("manual-toggle") || this.$trigger.setAttribute("aria-expanded", "false"), this.$popoverElement.setAttribute("id", this.popoverId), this.$popoverElement.setAttribute("popover", ""), this.$style.innerHTML = this.css,
|
|
824
|
+
this.$trigger && (this.$trigger.setAttribute("popovertarget", this.popoverId), this.$trigger.setAttribute("aria-controls", this.getAttribute("id")), this.hasAttribute("manual-toggle") || this.$trigger.setAttribute("aria-expanded", "false"), this.$popoverElement.setAttribute("id", this.popoverId), this.$popoverElement.setAttribute("popover", ""), this.$style.innerHTML = this.css, b(this, w, gt).call(this), b(this, w, xt).call(this));
|
|
825
825
|
}
|
|
826
826
|
get popoverId() {
|
|
827
827
|
return `${this.getAttribute("id")}-popover`;
|
|
@@ -914,12 +914,12 @@ class me extends HTMLElement {
|
|
|
914
914
|
const o = t.querySelectorAll("px-header-item"), a = t.querySelectorAll("px-action-link"), n = this.shadowRoot.querySelector("px-mdd-section");
|
|
915
915
|
n.innerHTML = `
|
|
916
916
|
${[...o].map((s) => {
|
|
917
|
-
const l = s.getAttribute("for"),
|
|
918
|
-
return l ? `<px-mdd-section-item for="${l}">${s.innerText}</px-mdd-section-item>` :
|
|
917
|
+
const l = s.getAttribute("for"), c = s.getAttribute("href");
|
|
918
|
+
return l ? `<px-mdd-section-item for="${l}">${s.innerText}</px-mdd-section-item>` : c ? `<px-mdd-section-item href="${c}">${s.innerText}</px-mdd-section-item>` : "";
|
|
919
919
|
}).join("")}
|
|
920
920
|
${[...a].filter((s) => !s.hasAttribute("promoted")).map(
|
|
921
921
|
(s) => `<px-mdd-a href="${s.getAttribute("href")}" slot="footer">${s.innerText}</px-mdd-a>`
|
|
922
|
-
).join("")}`,
|
|
922
|
+
).join("")}`, b(this, H, ft).call(this).forEach((s) => {
|
|
923
923
|
s && this.$megaDropDown.appendChild(s);
|
|
924
924
|
});
|
|
925
925
|
}
|