@proximus/lavender-header 1.4.1 → 1.4.2-beta.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/dist/Header.d.ts +2 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +41 -41
- package/package.json +1 -1
package/dist/Header.d.ts
CHANGED
|
@@ -2,14 +2,12 @@ import { WithExtraAttributes } from '@proximus/lavender-common';
|
|
|
2
2
|
import '@proximus/lavender-layout';
|
|
3
3
|
import '@proximus/lavender-container';
|
|
4
4
|
import '@proximus/lavender-button';
|
|
5
|
-
import '@proximus/lavender-button-icon';
|
|
6
5
|
import '@proximus/lavender-section';
|
|
7
|
-
import '
|
|
6
|
+
import './HeaderItem';
|
|
7
|
+
import './Link.ts';
|
|
8
8
|
import type { Dropdown } from '@proximus/lavender-dropdown';
|
|
9
9
|
import type { Stack } from '@proximus/lavender-layout';
|
|
10
10
|
import type { ButtonIcon } from '@proximus/lavender-button-icon';
|
|
11
|
-
import './HeaderItem';
|
|
12
|
-
import './Link.ts';
|
|
13
11
|
export declare class Header extends WithExtraAttributes {
|
|
14
12
|
#private;
|
|
15
13
|
internals: ElementInternals;
|
package/dist/index.d.ts
CHANGED
package/dist/index.es.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
var K = (o) => {
|
|
2
2
|
throw TypeError(o);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var d = (o, t, e) => (
|
|
6
|
-
import
|
|
4
|
+
var H = (o, t, e) => t.has(o) || K("Cannot " + e);
|
|
5
|
+
var d = (o, t, e) => (H(o, t, "read from private field"), e ? e.call(o) : t.get(o)), h = (o, t, e) => t.has(o) ? K("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(o) : t.set(o, e), A = (o, t, e, r) => (H(o, t, "write to private field"), r ? r.call(o, e) : t.set(o, e), e), b = (o, t, e) => (H(o, t, "access private method"), e);
|
|
6
|
+
import "@proximus/lavender-button-icon";
|
|
7
|
+
import "@proximus/lavender-cell";
|
|
8
|
+
import { WithExtraAttributes as Y, fontsizeValues as mt, PxElement as kt, transferAccessibilityAttributes as yt, fontweightValues as zt, colorValues as wt, checkName as $t } from "@proximus/lavender-common";
|
|
7
9
|
import "@proximus/lavender-layout";
|
|
8
10
|
import "@proximus/lavender-container";
|
|
9
11
|
import "@proximus/lavender-button";
|
|
10
|
-
import "@proximus/lavender-button-icon";
|
|
11
12
|
import "@proximus/lavender-section";
|
|
12
|
-
import "@proximus/lavender-cell";
|
|
13
13
|
const At = ":host{display:block}:host *{box-sizing:border-box}button,a{display:block;font-family:var(--px-font-family);font-size:var(--px-text-size-label-m-mobile);line-height:var(--px-font-line-height-l);color:var(--px-color-text-neutral-default);text-align:center;cursor:pointer;padding:2em 0;height:100%}button:after,a:after{content:attr(data-label);display:block;height:0;width:auto;visibility:hidden;overflow:hidden;-webkit-user-select:none;user-select:none;pointer-events:none;font-weight:var(--px-font-weight-title)}button:focus-visible,a:focus-visible{outline-offset:var(--px-focus-offset-mobile);outline:var(--px-focus-outline-mobile) solid var(--px-color-border-focus-outline-default)}button:hover,a:hover{font-weight:var(--px-font-weight-title);color:var(--px-color-background-container-primary-default);padding-block:calc(2em - 2px)}button{margin:0;border:0;border-bottom:2px solid rgba(0,0,0,0);outline:0;background:inherit}button[aria-expanded=true]{font-weight:var(--px-font-weight-title);color:var(--px-color-background-container-primary-default);border-bottom-color:var(--px-color-background-container-primary-default)}a{text-decoration:none}@media only screen and (min-width: 48em){button,a{font-size:var(--px-text-size-label-m-tablet)}button:focus-visible,a:focus-visible{outline-offset:var(--px-focus-offset-tablet);outline-width:var(--px-focus-outline-tablet)}}@media only screen and (min-width: 64.0625em){button,a{font-size:var(--px-text-size-label-m-laptop)}button:focus-visible,a:focus-visible{outline-offset:var(--px-focus-offset-laptop);outline-width:var(--px-focus-outline-laptop)}}@media only screen and (min-width: 90.0625em){button,a{font-size:var(--px-text-size-label-m-desktop)}button:focus-visible,a:focus-visible{outline-offset:var(--px-focus-offset-desktop);outline-width:var(--px-focus-outline-desktop)}}", et = new CSSStyleSheet();
|
|
14
14
|
et.replaceSync(At);
|
|
15
|
-
class St extends
|
|
15
|
+
class St extends Y {
|
|
16
16
|
constructor() {
|
|
17
17
|
var t;
|
|
18
18
|
super(), this.template = () => `${this.getAttribute("href") ? `<a href="${this.getAttribute("href")}" data-label="${this.textContent}">
|
|
@@ -77,10 +77,10 @@ const Lt = [...mt, "link-m", "link-s"], Mt = [
|
|
|
77
77
|
"btn-secondary",
|
|
78
78
|
"btn-tertiary",
|
|
79
79
|
"icon-link"
|
|
80
|
-
], Rt = ["", "default", "alternative"],
|
|
80
|
+
], Rt = ["", "default", "alternative"], N = class N extends kt {
|
|
81
81
|
constructor() {
|
|
82
82
|
super(ot, rt, at), this.template = () => '<slot name="before"></slot><slot></slot><slot name="after"></slot>';
|
|
83
|
-
const t = document.createElement(
|
|
83
|
+
const t = document.createElement(N.nativeName);
|
|
84
84
|
t.innerHTML = this.template(), this.shadowRoot.appendChild(t);
|
|
85
85
|
}
|
|
86
86
|
static get observedAttributes() {
|
|
@@ -106,7 +106,7 @@ const Lt = [...mt, "link-m", "link-s"], Mt = [
|
|
|
106
106
|
];
|
|
107
107
|
}
|
|
108
108
|
connectedCallback() {
|
|
109
|
-
|
|
109
|
+
this.$before && this.$before.localName === "px-icon" && this.configureBeforeAfterIcon(this.$before), this.$after && this.$after.localName === "px-icon" && this.configureBeforeAfterIcon(this.$after), yt(this, this.$el, !1);
|
|
110
110
|
}
|
|
111
111
|
attributeChangedCallback(t, e, r) {
|
|
112
112
|
if (e !== r)
|
|
@@ -297,9 +297,9 @@ const Lt = [...mt, "link-m", "link-s"], Mt = [
|
|
|
297
297
|
t ? this.setAttribute("title", t) : this.removeAttribute("title");
|
|
298
298
|
}
|
|
299
299
|
};
|
|
300
|
-
|
|
301
|
-
let
|
|
302
|
-
customElements.get("px-a") || customElements.define("px-a",
|
|
300
|
+
N.nativeName = "a";
|
|
301
|
+
let F = N;
|
|
302
|
+
customElements.get("px-a") || customElements.define("px-a", F);
|
|
303
303
|
class qt extends HTMLElement {
|
|
304
304
|
constructor() {
|
|
305
305
|
super(), this.template = `<px-a font-weight="title" font-size="body-l" color="brand" variant="no-style">
|
|
@@ -317,7 +317,7 @@ function R(o) {
|
|
|
317
317
|
var t = typeof o;
|
|
318
318
|
return o != null && (t == "object" || t == "function");
|
|
319
319
|
}
|
|
320
|
-
var jt = typeof global == "object" && global && global.Object === Object && global, Ot = typeof self == "object" && self && self.Object === Object && self, it = jt || Ot || Function("return this")(),
|
|
320
|
+
var jt = typeof global == "object" && global && global.Object === Object && global, Ot = typeof self == "object" && self && self.Object === Object && self, it = jt || Ot || Function("return this")(), _ = function() {
|
|
321
321
|
return it.Date.now();
|
|
322
322
|
}, It = /\s/;
|
|
323
323
|
function Pt(o) {
|
|
@@ -373,16 +373,16 @@ function V(o) {
|
|
|
373
373
|
}
|
|
374
374
|
var re = "Expected a function", ae = Math.max, ie = Math.min;
|
|
375
375
|
function ne(o, t, e) {
|
|
376
|
-
var r, n, s, i, l, c, g = 0, w = !1, u = !1,
|
|
376
|
+
var r, n, s, i, l, c, g = 0, w = !1, u = !1, I = !0;
|
|
377
377
|
if (typeof o != "function")
|
|
378
378
|
throw new TypeError(re);
|
|
379
|
-
t = V(t) || 0, R(e) && (w = !!e.leading, u = "maxWait" in e, s = u ? ae(V(e.maxWait) || 0, t) : s,
|
|
380
|
-
function
|
|
379
|
+
t = V(t) || 0, R(e) && (w = !!e.leading, u = "maxWait" in e, s = u ? ae(V(e.maxWait) || 0, t) : s, I = "trailing" in e ? !!e.trailing : I);
|
|
380
|
+
function P(p) {
|
|
381
381
|
var x = r, $ = n;
|
|
382
382
|
return r = n = void 0, g = p, i = o.apply($, x), i;
|
|
383
383
|
}
|
|
384
384
|
function xt(p) {
|
|
385
|
-
return g = p, l = setTimeout(L, t), w ?
|
|
385
|
+
return g = p, l = setTimeout(L, t), w ? P(p) : i;
|
|
386
386
|
}
|
|
387
387
|
function gt(p) {
|
|
388
388
|
var x = p - c, $ = p - g, J = t - x;
|
|
@@ -393,31 +393,31 @@ function ne(o, t, e) {
|
|
|
393
393
|
return c === void 0 || x >= t || x < 0 || u && $ >= s;
|
|
394
394
|
}
|
|
395
395
|
function L() {
|
|
396
|
-
var p =
|
|
396
|
+
var p = _();
|
|
397
397
|
if (Z(p))
|
|
398
398
|
return X(p);
|
|
399
399
|
l = setTimeout(L, gt(p));
|
|
400
400
|
}
|
|
401
401
|
function X(p) {
|
|
402
|
-
return l = void 0,
|
|
402
|
+
return l = void 0, I && r ? P(p) : (r = n = void 0, i);
|
|
403
403
|
}
|
|
404
404
|
function vt() {
|
|
405
405
|
l !== void 0 && clearTimeout(l), g = 0, r = c = n = l = void 0;
|
|
406
406
|
}
|
|
407
407
|
function ft() {
|
|
408
|
-
return l === void 0 ? i : X(
|
|
408
|
+
return l === void 0 ? i : X(_());
|
|
409
409
|
}
|
|
410
|
-
function
|
|
411
|
-
var p =
|
|
410
|
+
function B() {
|
|
411
|
+
var p = _(), x = Z(p);
|
|
412
412
|
if (r = arguments, n = this, c = p, x) {
|
|
413
413
|
if (l === void 0)
|
|
414
414
|
return xt(c);
|
|
415
415
|
if (u)
|
|
416
|
-
return clearTimeout(l), l = setTimeout(L, t),
|
|
416
|
+
return clearTimeout(l), l = setTimeout(L, t), P(c);
|
|
417
417
|
}
|
|
418
418
|
return l === void 0 && (l = setTimeout(L, t)), i;
|
|
419
419
|
}
|
|
420
|
-
return
|
|
420
|
+
return B.cancel = vt, B.flush = ft, B;
|
|
421
421
|
}
|
|
422
422
|
var se = "Expected a function";
|
|
423
423
|
function de(o, t, e) {
|
|
@@ -433,8 +433,8 @@ function de(o, t, e) {
|
|
|
433
433
|
const st = new CSSStyleSheet();
|
|
434
434
|
st.replaceSync(Nt);
|
|
435
435
|
const le = "Menu";
|
|
436
|
-
var T, a, dt,
|
|
437
|
-
class pe extends
|
|
436
|
+
var T, a, dt, W, D, lt, U, v, E, C, f;
|
|
437
|
+
class pe extends Y {
|
|
438
438
|
constructor() {
|
|
439
439
|
var e;
|
|
440
440
|
super(st);
|
|
@@ -490,21 +490,21 @@ class pe extends U {
|
|
|
490
490
|
);
|
|
491
491
|
r && r.for && (e.target.checked === !1 ? (this.$backdropFilter.style.display = "block", d(this, a, E).forEach((n) => {
|
|
492
492
|
n.checked = !1;
|
|
493
|
-
}), r.checked = !0, b(this, a,
|
|
493
|
+
}), r.checked = !0, b(this, a, W).call(this, e.target.for)) : b(this, a, U).call(this));
|
|
494
494
|
}), this.addEventListener("section-item-click", (e) => {
|
|
495
495
|
this.$backdropFilter.style.display = "block", d(this, a, E).forEach((r) => {
|
|
496
496
|
r.checked = !1;
|
|
497
497
|
}), this.querySelector(
|
|
498
498
|
`px-header-item[for="${e.detail.for}"]`
|
|
499
|
-
).checked = !0, b(this, a,
|
|
499
|
+
).checked = !0, b(this, a, W).call(this, e.detail.for);
|
|
500
500
|
}), this.addEventListener("back-to-mobile-menu", () => {
|
|
501
501
|
this.$backdropFilter.style.display = "block", d(this, a, E).forEach((e) => {
|
|
502
502
|
e.checked = !1;
|
|
503
|
-
}), b(this, a,
|
|
503
|
+
}), b(this, a, D).call(this);
|
|
504
504
|
}), this.shadowRoot.addEventListener("click", (e) => {
|
|
505
|
-
e.target.closest("px-button-icon") && (this.$burgerMenu.setAttribute("aria-expanded", "true"), b(this, a,
|
|
505
|
+
e.target.closest("px-button-icon") && (this.$burgerMenu.setAttribute("aria-expanded", "true"), b(this, a, D).call(this));
|
|
506
506
|
}), this.addEventListener("close-panel", () => {
|
|
507
|
-
b(this, a,
|
|
507
|
+
b(this, a, U).call(this), this.$burgerMenu.setAttribute("aria-expanded", "false");
|
|
508
508
|
}), this.addEventListener(
|
|
509
509
|
"close-panel-from-dialog",
|
|
510
510
|
(e) => {
|
|
@@ -598,17 +598,17 @@ T = new WeakMap(), a = new WeakSet(), dt = function() {
|
|
|
598
598
|
e.forEach((n) => {
|
|
599
599
|
n.dialogOffsetTop = `${r}px`;
|
|
600
600
|
});
|
|
601
|
-
},
|
|
601
|
+
}, W = function(e) {
|
|
602
602
|
d(this, a, v).$megaDropDown.hidden = !0, d(this, a, f).forEach((r) => {
|
|
603
603
|
r.name === e && r.hidden && (r.dialogOffsetTop = `${d(this, a, C).getBoundingClientRect().bottom}px`, r.hidden = !r.hidden, this.querySelector(`px-header-item[for="${e}"]`).checked = !r.hidden, document.body.style.overflow = r.hidden ? "auto" : "hidden"), r.name !== e && !r.hidden && (r.hidden = !0);
|
|
604
604
|
});
|
|
605
|
-
},
|
|
605
|
+
}, D = function() {
|
|
606
606
|
this.$backdropFilter.style.display = "none", d(this, a, f).forEach((e) => {
|
|
607
607
|
e.hidden || (e.hidden = !0);
|
|
608
608
|
}), d(this, a, v).$megaDropDown.dialogOffsetTop = `${d(this, a, C).getBoundingClientRect().bottom}px`, d(this, a, v).$megaDropDown.hidden = !1, document.body.style.overflow = "hidden";
|
|
609
609
|
}, lt = function() {
|
|
610
610
|
d(this, a, v) && (d(this, a, v).$megaDropDown.hidden = !0, this.$burgerMenu.setAttribute("aria-expanded", "false"), document.body.style.overflow = "auto", this.$backdropFilter.style.display = "none");
|
|
611
|
-
},
|
|
611
|
+
}, U = function() {
|
|
612
612
|
this.$backdropFilter.style.display = "none", d(this, a, v).$megaDropDown.hidden = !0, d(this, a, E).forEach((e) => {
|
|
613
613
|
e.checked = !1;
|
|
614
614
|
}), d(this, a, f).forEach((e) => {
|
|
@@ -645,7 +645,7 @@ const pt = new CSSStyleSheet();
|
|
|
645
645
|
pt.replaceSync(ce);
|
|
646
646
|
const M = "bottom-left";
|
|
647
647
|
var z, ct, m, k, y, bt;
|
|
648
|
-
class he extends
|
|
648
|
+
class he extends Y {
|
|
649
649
|
constructor() {
|
|
650
650
|
super(pt);
|
|
651
651
|
h(this, z);
|
|
@@ -800,12 +800,12 @@ ht.replaceSync(`
|
|
|
800
800
|
}
|
|
801
801
|
}
|
|
802
802
|
`);
|
|
803
|
-
var
|
|
803
|
+
var j, O, ut;
|
|
804
804
|
class ue extends HTMLElement {
|
|
805
805
|
constructor() {
|
|
806
806
|
super();
|
|
807
|
-
h(this,
|
|
808
|
-
h(this,
|
|
807
|
+
h(this, O);
|
|
808
|
+
h(this, j, `<px-mdd
|
|
809
809
|
name="__lavender_mobile_menu"
|
|
810
810
|
hidden--tablet
|
|
811
811
|
hidden--laptop
|
|
@@ -814,7 +814,7 @@ class ue extends HTMLElement {
|
|
|
814
814
|
<span slot="title"><slot name="title"></slot></span>
|
|
815
815
|
<px-mdd-section title-hidden></px-mdd-section>
|
|
816
816
|
</px-mdd>`);
|
|
817
|
-
this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = d(this,
|
|
817
|
+
this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = d(this, j), this.shadowRoot.adoptedStyleSheets = [ht];
|
|
818
818
|
}
|
|
819
819
|
connectedCallback() {
|
|
820
820
|
this.setAttribute("slot", "header-panels");
|
|
@@ -831,7 +831,7 @@ class ue extends HTMLElement {
|
|
|
831
831
|
}).join("")}
|
|
832
832
|
${[...n].filter((i) => !i.hasAttribute("promoted")).map(
|
|
833
833
|
(i) => `<px-mdd-a href="${i.getAttribute("href")}" slot="footer">${i.innerText}</px-mdd-a>`
|
|
834
|
-
).join("")}`, b(this,
|
|
834
|
+
).join("")}`, b(this, O, ut).call(this).forEach((i) => {
|
|
835
835
|
i && this.$megaDropDown.appendChild(i);
|
|
836
836
|
});
|
|
837
837
|
}
|
|
@@ -839,7 +839,7 @@ class ue extends HTMLElement {
|
|
|
839
839
|
return this.shadowRoot.querySelector("px-mdd");
|
|
840
840
|
}
|
|
841
841
|
}
|
|
842
|
-
|
|
842
|
+
j = new WeakMap(), O = new WeakSet(), ut = function() {
|
|
843
843
|
const e = this.closest("px-header"), r = e.querySelector(
|
|
844
844
|
'px-dropdown[slot="target-group"]'
|
|
845
845
|
), n = e.querySelector(
|