@swisspost/design-system-components 10.0.0-next.47 → 10.0.0-next.48
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/cjs/{event-from-AKK8RQrn.js → event-from-C6kpQwhw.js} +2 -2
- package/dist/cjs/index-CpDyH7Ww.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-wsZ6ig4j.js → package-CZyXYkIN.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +4 -4
- package/dist/cjs/post-avatar.cjs.entry.js +91 -54
- package/dist/cjs/post-back-to-top.cjs.entry.js +1 -1
- package/dist/cjs/post-banner.cjs.entry.js +3 -3
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +1 -1
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +1 -1
- package/dist/cjs/post-card-control.cjs.entry.js +1 -1
- package/dist/cjs/post-closebutton_15.cjs.entry.js +4 -5
- package/dist/cjs/post-collapsible_2.cjs.entry.js +2 -2
- package/dist/cjs/post-components.cjs.js +1 -1
- package/dist/cjs/post-footer.cjs.entry.js +1 -1
- package/dist/cjs/post-linkarea.cjs.entry.js +1 -1
- package/dist/cjs/post-popover.cjs.entry.js +1 -1
- package/dist/cjs/post-rating.cjs.entry.js +1 -1
- package/dist/cjs/post-tab-header.cjs.entry.js +1 -1
- package/dist/cjs/post-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/post-tabs.cjs.entry.js +2 -2
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +1 -1
- package/dist/cjs/post-tooltip.cjs.entry.js +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +5 -5
- package/dist/collection/components/post-avatar/avatar-utils.js +16 -0
- package/dist/collection/components/post-avatar/post-avatar.js +90 -57
- package/dist/collection/components/post-banner/post-banner.js +2 -2
- package/dist/collection/components/post-closebutton/post-closebutton.js +1 -19
- package/dist/collection/components/post-menu/post-menu.js +4 -1
- package/dist/collection/components/post-tabs/post-tabs.js +3 -3
- package/dist/collection/utils/event-from.js +2 -2
- package/dist/{esm/event-from-8U5GFtQP.js → components/event-from.js} +2 -2
- package/dist/components/get-root.js +15 -0
- package/dist/components/index.d.ts +73 -0
- package/dist/components/index.js +36 -2315
- package/dist/components/package.js +3 -0
- package/dist/components/post-accordion-item.js +1 -1
- package/dist/components/post-accordion-item2.js +113 -0
- package/dist/components/post-accordion.js +1 -1
- package/dist/components/post-accordion2.js +138 -0
- package/dist/components/post-avatar.js +99 -62
- package/dist/components/post-back-to-top.js +6 -7
- package/dist/components/post-banner.js +10 -11
- package/dist/components/post-breadcrumb-item.js +1 -1
- package/dist/components/post-breadcrumb-item2.js +79 -0
- package/dist/components/post-breadcrumbs.js +13 -14
- package/dist/components/post-card-control.js +8 -9
- package/dist/components/post-closebutton.js +5 -7
- package/dist/components/post-collapsible-trigger.js +1 -1
- package/dist/components/post-collapsible-trigger2.js +135 -0
- package/dist/components/post-collapsible.js +1 -1
- package/dist/components/post-collapsible2.js +110 -0
- package/dist/components/post-footer.js +10 -11
- package/dist/components/post-header.js +6 -7
- package/dist/components/post-icon.js +1 -1
- package/dist/components/post-icon2.js +153 -0
- package/dist/components/post-language-option.js +8 -9
- package/dist/components/post-language-switch.js +12 -13
- package/dist/components/post-linkarea.js +3 -4
- package/dist/components/post-list-item.js +3 -4
- package/dist/components/post-list.js +4 -5
- package/dist/components/post-logo.js +5 -6
- package/dist/components/post-mainnavigation.js +4 -5
- package/dist/components/post-megadropdown-trigger.js +6 -7
- package/dist/components/post-megadropdown.js +7 -8
- package/dist/components/post-menu-item.js +1 -1
- package/dist/components/post-menu-item2.js +30 -0
- package/dist/components/post-menu-trigger.js +1 -1
- package/dist/components/post-menu-trigger2.js +110 -0
- package/dist/components/post-menu.js +1 -1
- package/dist/components/post-menu2.js +222 -0
- package/dist/components/post-popover.js +6 -7
- package/dist/components/post-popovercontainer.js +1 -1
- package/dist/components/post-popovercontainer2.js +3018 -0
- package/dist/components/post-rating.js +8 -9
- package/dist/components/post-tab-header.js +6 -7
- package/dist/components/post-tab-panel.js +6 -7
- package/dist/components/post-tabs.js +7 -8
- package/dist/components/post-togglebutton.js +3 -4
- package/dist/components/post-tooltip-trigger.js +6 -7
- package/dist/components/post-tooltip.js +6 -7
- package/dist/components/react/index.d.ts +33 -0
- package/dist/components/react/index.js +2315 -0
- package/dist/components/react/p-0Ltezq5O.js +3 -0
- package/dist/components/{p-i0-mizzM.js → react/p-38PqL5iD.js} +1 -1
- package/dist/components/react/p-BLchVpF6.js +14 -0
- package/dist/components/react/p-C35MCWIp.js +35 -0
- package/dist/components/{p-336Lbkey.js → react/p-CGsAj6ij.js} +1 -1
- package/dist/components/react/p-CJ80BZ06.js +178 -0
- package/dist/{esm/index-BWC0gtGU.js → components/react/p-CV7fm1rW.js} +1 -1
- package/dist/components/react/p-C_2k3G1c.js +264 -0
- package/dist/components/{p-DP5pj8mq.js → react/p-Ce7jgYmK.js} +1 -1
- package/dist/components/{p-BSvy4uym.js → react/p-CiYSngKM.js} +7 -7
- package/dist/components/{p-Cxrx7SXz.js → react/p-Da5wbVP8.js} +1 -1
- package/dist/components/{p-DVGX_JCp.js → react/p-Dq9F2i7n.js} +2 -2
- package/dist/components/{p-DEi5TIMq.js → react/p-DzYquz3e.js} +2 -2
- package/dist/components/{p-pHxypsHK.js → react/p-JHuJA2Lv.js} +4 -4
- package/dist/components/react/p-SbIC4aZX.js +11 -0
- package/dist/components/{p-C0H2ohSv.js → react/p-Tg0GNTZM.js} +2 -2
- package/dist/components/{p-8U5GFtQP.js → react/p-kraHE1r3.js} +2 -2
- package/dist/components/{p-BM8mtEfS.js → react/p-q8Fvf8A0.js} +1 -1
- package/dist/components/react/p-r4txK0AC.js +3 -0
- package/dist/components/react/post-accordion-item.d.ts +11 -0
- package/dist/components/react/post-accordion-item.js +6 -0
- package/dist/components/react/post-accordion.d.ts +11 -0
- package/dist/components/react/post-accordion.js +6 -0
- package/dist/components/react/post-avatar.d.ts +11 -0
- package/dist/components/react/post-avatar.js +226 -0
- package/dist/components/react/post-back-to-top.d.ts +11 -0
- package/dist/components/react/post-back-to-top.js +145 -0
- package/dist/components/react/post-banner.d.ts +11 -0
- package/dist/components/react/post-banner.js +99 -0
- package/dist/components/react/post-breadcrumb-item.d.ts +11 -0
- package/dist/components/react/post-breadcrumb-item.js +6 -0
- package/dist/components/react/post-breadcrumbs.d.ts +11 -0
- package/dist/components/react/post-breadcrumbs.js +187 -0
- package/dist/components/react/post-card-control.d.ts +11 -0
- package/dist/components/react/post-card-control.js +327 -0
- package/dist/components/react/post-closebutton.d.ts +11 -0
- package/dist/components/react/post-closebutton.js +50 -0
- package/dist/components/react/post-collapsible-trigger.d.ts +11 -0
- package/dist/components/react/post-collapsible-trigger.js +6 -0
- package/dist/components/react/post-collapsible.d.ts +11 -0
- package/dist/components/react/post-collapsible.js +6 -0
- package/dist/components/react/post-footer.d.ts +11 -0
- package/dist/components/react/post-footer.js +117 -0
- package/dist/components/react/post-header.d.ts +11 -0
- package/dist/components/react/post-header.js +333 -0
- package/dist/components/react/post-icon.d.ts +11 -0
- package/dist/components/react/post-icon.js +6 -0
- package/dist/components/react/post-language-option.d.ts +11 -0
- package/dist/components/react/post-language-option.js +101 -0
- package/dist/components/react/post-language-switch.d.ts +11 -0
- package/dist/components/react/post-language-switch.js +159 -0
- package/dist/components/react/post-linkarea.d.ts +11 -0
- package/dist/components/react/post-linkarea.js +46 -0
- package/dist/components/react/post-list-item.d.ts +11 -0
- package/dist/components/react/post-list-item.js +39 -0
- package/dist/components/react/post-list.d.ts +11 -0
- package/dist/components/react/post-list.js +62 -0
- package/dist/components/react/post-logo.d.ts +11 -0
- package/dist/components/react/post-logo.js +59 -0
- package/dist/components/react/post-mainnavigation.d.ts +11 -0
- package/dist/components/react/post-mainnavigation.js +181 -0
- package/dist/components/react/post-megadropdown-trigger.d.ts +11 -0
- package/dist/components/react/post-megadropdown-trigger.js +137 -0
- package/dist/components/react/post-megadropdown.d.ts +11 -0
- package/dist/components/react/post-megadropdown.js +197 -0
- package/dist/components/react/post-menu-item.d.ts +11 -0
- package/dist/components/react/post-menu-item.js +6 -0
- package/dist/components/react/post-menu-trigger.d.ts +11 -0
- package/dist/components/react/post-menu-trigger.js +6 -0
- package/dist/components/react/post-menu.d.ts +11 -0
- package/dist/components/react/post-menu.js +6 -0
- package/dist/components/react/post-popover.d.ts +11 -0
- package/dist/components/react/post-popover.js +189 -0
- package/dist/components/react/post-popovercontainer.d.ts +11 -0
- package/dist/components/react/post-popovercontainer.js +6 -0
- package/dist/components/react/post-rating.d.ts +11 -0
- package/dist/components/react/post-rating.js +153 -0
- package/dist/components/react/post-tab-header.d.ts +11 -0
- package/dist/components/react/post-tab-header.js +53 -0
- package/dist/components/react/post-tab-panel.d.ts +11 -0
- package/dist/components/react/post-tab-panel.js +55 -0
- package/dist/components/react/post-tabs.d.ts +11 -0
- package/dist/components/react/post-tabs.js +197 -0
- package/dist/components/react/post-togglebutton.d.ts +11 -0
- package/dist/components/react/post-togglebutton.js +57 -0
- package/dist/components/react/post-tooltip-trigger.d.ts +11 -0
- package/dist/components/react/post-tooltip-trigger.js +5223 -0
- package/dist/components/react/post-tooltip.d.ts +11 -0
- package/dist/components/react/post-tooltip.js +115 -0
- package/dist/components/switch-variants.js +3 -0
- package/dist/docs.json +20 -30
- package/dist/esm/event-from-kraHE1r3.js +105 -0
- package/dist/esm/index-C8a0ddDa.js +4 -4
- package/dist/esm/index-VmK3ABCB.js +88 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/package-0Ltezq5O.js +3 -0
- package/dist/esm/post-accordion_2.entry.js +5 -5
- package/dist/esm/post-avatar.entry.js +92 -55
- package/dist/esm/post-back-to-top.entry.js +2 -2
- package/dist/esm/post-banner.entry.js +4 -4
- package/dist/esm/post-breadcrumb-item_2.entry.js +2 -2
- package/dist/esm/post-breadcrumbs.entry.js +2 -2
- package/dist/esm/post-card-control.entry.js +2 -2
- package/dist/esm/post-closebutton_15.entry.js +6 -7
- package/dist/esm/post-collapsible_2.entry.js +3 -3
- package/dist/esm/post-components.js +1 -1
- package/dist/esm/post-footer.entry.js +2 -2
- package/dist/esm/post-linkarea.entry.js +1 -1
- package/dist/esm/post-popover.entry.js +2 -2
- package/dist/esm/post-rating.entry.js +2 -2
- package/dist/esm/post-tab-header.entry.js +2 -2
- package/dist/esm/post-tab-panel.entry.js +2 -2
- package/dist/esm/post-tabs.entry.js +2 -2
- package/dist/esm/post-tooltip-trigger.entry.js +2 -2
- package/dist/esm/post-tooltip.entry.js +2 -2
- package/dist/loader/cdn.js +1 -0
- package/dist/loader/index.cjs.js +1 -0
- package/{loader → dist/loader}/index.d.ts +1 -1
- package/dist/loader/index.es2017.js +1 -0
- package/{loader → dist/loader}/index.js +1 -1
- package/dist/post-components/p-0Ltezq5O.js +1 -0
- package/dist/post-components/{p-bbe02ba3.entry.js → p-16772417.entry.js} +1 -1
- package/dist/post-components/{p-45007aac.entry.js → p-38d3d441.entry.js} +1 -1
- package/dist/post-components/{p-f67b616a.entry.js → p-3c71f590.entry.js} +1 -1
- package/dist/post-components/{p-a2fa5ce4.entry.js → p-40f21542.entry.js} +1 -1
- package/dist/post-components/{p-031f7489.entry.js → p-4243cdd1.entry.js} +1 -1
- package/dist/post-components/p-4c18cb8c.entry.js +1 -0
- package/dist/post-components/{p-c1cf39cb.entry.js → p-51dc7647.entry.js} +1 -1
- package/dist/post-components/{p-e9802b56.entry.js → p-6777e505.entry.js} +1 -1
- package/dist/post-components/{p-2f698af4.entry.js → p-6add880f.entry.js} +1 -1
- package/dist/post-components/{p-2ca196d6.entry.js → p-8363fedb.entry.js} +1 -1
- package/dist/post-components/p-83998038.entry.js +1 -0
- package/dist/post-components/{p-d0d92071.entry.js → p-85bb1b5e.entry.js} +1 -1
- package/dist/post-components/{p-3adbdda7.entry.js → p-8f4d8685.entry.js} +1 -1
- package/dist/post-components/{p-1e6a068a.entry.js → p-95ad536d.entry.js} +1 -1
- package/dist/post-components/{p-9428231b.entry.js → p-9d806e89.entry.js} +1 -1
- package/dist/post-components/{p-BWC0gtGU.js → p-VmK3ABCB.js} +1 -1
- package/dist/post-components/{p-57703aee.entry.js → p-aad86320.entry.js} +1 -1
- package/dist/post-components/p-c3e38acf.entry.js +1 -0
- package/dist/post-components/{p-ab8017bb.entry.js → p-d61bb2ff.entry.js} +1 -1
- package/dist/post-components/p-kraHE1r3.js +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +3 -3
- package/dist/types/components/post-avatar/avatar-utils.d.ts +3 -0
- package/dist/types/components/post-avatar/post-avatar.d.ts +13 -10
- package/dist/types/components/post-closebutton/post-closebutton.d.ts +0 -6
- package/dist/types/components/post-menu/post-menu.d.ts +3 -0
- package/dist/types/components/post-tabs/post-tabs.d.ts +2 -2
- package/dist/types/components.d.ts +0 -19
- package/dist/types/utils/component-on-ready.d.ts +2 -2
- package/hydrate/index.js +110 -70
- package/hydrate/index.mjs +110 -70
- package/package.json +19 -9
- package/dist/components/p-Z01QMrov.js +0 -3
- package/dist/esm/package-Z01QMrov.js +0 -3
- package/dist/post-components/p-7b8ab026.entry.js +0 -1
- package/dist/post-components/p-8U5GFtQP.js +0 -1
- package/dist/post-components/p-Z01QMrov.js +0 -1
- package/dist/post-components/p-ac73ab00.entry.js +0 -1
- package/dist/post-components/p-e96239c4.entry.js +0 -1
- package/loader/cdn.js +0 -1
- package/loader/index.cjs.js +0 -1
- package/loader/index.es2017.js +0 -1
- /package/dist/components/{p-CJ80BZ06.js → breakpoints.js} +0 -0
- /package/dist/components/{p-SbIC4aZX.js → fade.js} +0 -0
- /package/dist/components/{p-C35MCWIp.js → get-focusable-children.js} +0 -0
- /package/dist/components/{p-r4txK0AC.js → heading-levels.js} +0 -0
- /package/dist/components/{p-BLchVpF6.js → index.browser.js} +0 -0
- /package/dist/components/{p-CV7fm1rW.js → index2.js} +0 -0
- /package/dist/components/{p-C_2k3G1c.js → long-press-event.js} +0 -0
- /package/dist/components/{p-CBFgkSgY.js → react/p-CBFgkSgY.js} +0 -0
- /package/dist/components/{p-DjIHLduJ.js → react/p-DjIHLduJ.js} +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
|
+
import { v as version } from './p-0Ltezq5O.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './p-Da5wbVP8.js';
|
|
4
|
+
|
|
5
|
+
const postClosebuttonCss = ".btn-icon-close{padding:0;border:unset;min-height:unset;min-width:unset;width:var(--post-device-sizing-notification-1);height:var(--post-device-sizing-notification-1);border-radius:var(--post-device-border-radius-round);background-color:var(--post-scheme-color-interactive-button-tertiary-enabled-bg);color:var(--post-scheme-color-interactive-button-tertiary-enabled-fg)}.btn-icon-close>post-icon{min-width:var(--post-device-sizing-interactive-icon-size4);width:var(--post-device-sizing-interactive-icon-size4);height:var(--post-device-sizing-interactive-icon-size4)}.btn-icon-close:not(:disabled):hover,.btn-icon-close.pretend-hover{cursor:pointer;background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-icon-close:not(:disabled):hover,.btn-icon-close.pretend-hover{color:HighlightText !important}}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}";
|
|
6
|
+
|
|
7
|
+
const PostClosebutton$1 = /*@__PURE__*/ proxyCustomElement(class PostClosebutton extends H {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
this.__attachShadow();
|
|
12
|
+
}
|
|
13
|
+
componentDidLoad() {
|
|
14
|
+
this.checkHiddenLabel();
|
|
15
|
+
}
|
|
16
|
+
checkHiddenLabel(slot = this.host.shadowRoot.querySelector('.visually-hidden slot')) {
|
|
17
|
+
if (slot.assignedNodes().length === 0) {
|
|
18
|
+
console.error(`The \`${this.host.localName}\` component requires content for accessibility.`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
return (h(Host, { key: 'a8db3ecbefea609234c4c8c29dbf085637592c2c', "data-version": version }, h("button", { key: '58cef7f32f6ec89d46a1ea57b5497089a96aebf3', class: "btn btn-icon-close", type: "button" }, h("post-icon", { key: '023a67437b69bb9966d08b027cc5f10d68baac40', "aria-hidden": "true", name: "closex" }), h("span", { key: 'b1a21810b6179ddd8d66b426a3149966c1972f59', class: "visually-hidden" }, h("slot", { key: '2a2417bedbcb57c75993722d3267342c7df7381d', onSlotchange: () => this.checkHiddenLabel() })))));
|
|
23
|
+
}
|
|
24
|
+
get host() { return this; }
|
|
25
|
+
static get style() { return postClosebuttonCss; }
|
|
26
|
+
}, [1, "post-closebutton"]);
|
|
27
|
+
function defineCustomElement$1() {
|
|
28
|
+
if (typeof customElements === "undefined") {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const components = ["post-closebutton", "post-icon"];
|
|
32
|
+
components.forEach(tagName => { switch (tagName) {
|
|
33
|
+
case "post-closebutton":
|
|
34
|
+
if (!customElements.get(tagName)) {
|
|
35
|
+
customElements.define(tagName, PostClosebutton$1);
|
|
36
|
+
}
|
|
37
|
+
break;
|
|
38
|
+
case "post-icon":
|
|
39
|
+
if (!customElements.get(tagName)) {
|
|
40
|
+
defineCustomElement$2();
|
|
41
|
+
}
|
|
42
|
+
break;
|
|
43
|
+
} });
|
|
44
|
+
}
|
|
45
|
+
defineCustomElement$1();
|
|
46
|
+
|
|
47
|
+
const PostClosebutton = PostClosebutton$1;
|
|
48
|
+
const defineCustomElement = defineCustomElement$1;
|
|
49
|
+
|
|
50
|
+
export { PostClosebutton, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../../types/components";
|
|
2
|
+
|
|
3
|
+
interface PostCollapsibleTrigger extends Components.PostCollapsibleTrigger, HTMLElement {}
|
|
4
|
+
export const PostCollapsibleTrigger: {
|
|
5
|
+
prototype: PostCollapsibleTrigger;
|
|
6
|
+
new (): PostCollapsibleTrigger;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../../types/components";
|
|
2
|
+
|
|
3
|
+
interface PostCollapsible extends Components.PostCollapsible, HTMLElement {}
|
|
4
|
+
export const PostCollapsible: {
|
|
5
|
+
prototype: PostCollapsible;
|
|
6
|
+
new (): PostCollapsible;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../../types/components";
|
|
2
|
+
|
|
3
|
+
interface PostFooter extends Components.PostFooter, HTMLElement {}
|
|
4
|
+
export const PostFooter: {
|
|
5
|
+
prototype: PostFooter;
|
|
6
|
+
new (): PostFooter;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
|
+
import { v as version } from './p-0Ltezq5O.js';
|
|
3
|
+
import { c as checkRequiredAndType } from './p-CV7fm1rW.js';
|
|
4
|
+
import { b as breakpoint } from './p-CJ80BZ06.js';
|
|
5
|
+
import { d as defineCustomElement$6 } from './p-Dq9F2i7n.js';
|
|
6
|
+
import { d as defineCustomElement$5 } from './p-CiYSngKM.js';
|
|
7
|
+
import { d as defineCustomElement$4 } from './p-q8Fvf8A0.js';
|
|
8
|
+
import { d as defineCustomElement$3 } from './p-Tg0GNTZM.js';
|
|
9
|
+
import { d as defineCustomElement$2 } from './p-Da5wbVP8.js';
|
|
10
|
+
|
|
11
|
+
const postFooterCss = ":host{display:block}footer{background-color:#fc0;--post-footer-container-padding-block:32px;--post-footer-container-padding-inline:16px;--post-footer-container-max-width:1200px;--post-footer-grid-template:auto / auto;--post-footer-grid-row-gap:0;--post-footer-grid-column-gap:0;--post-footer-grid-margin-block-end:24px;--post-footer-grid-padding-block-end:0;--post-footer-column-flex-direction:column;--post-footer-column-align-items:start;--post-footer-column-gap:0;--post-footer-post-list-flex-direction:column;--post-footer-post-list-gap:8px;--post-footer-post-list-align-items:start;--post-footer-socialmedia-margin-block-end:var(--post-footer-grid-margin-block-end);--post-footer-app-margin-block-end:var(--post-footer-grid-margin-block-end);--post-footer-businesssectors-margin-block-end:var(--post-footer-grid-margin-block-end);--post-footer-meta-margin-block-end:16px;--post-footer-meta-font-size:inherit;--post-footer-copyright-font-size:var(--post-footer-meta-font-size)}@media screen and (min-width: 600px){footer{--post-footer-container-padding-block:40px;--post-footer-grid-template:repeat(2, auto) / repeat(2, auto);--post-footer-grid-row-gap:32px;--post-footer-grid-column-gap:16px;--post-footer-grid-margin-block-end:32px;--post-footer-grid-padding-block-end:32px;--post-footer-post-list-flex-direction:row;--post-footer-post-list-gap:16px;--post-footer-post-list-align-items:center;--post-footer-meta-margin-block-end:8px}}@media screen and (min-width: 780px){footer{--post-footer-container-padding-inline:40px}}@media screen and (min-width: 1024px){footer{--post-footer-container-padding-block:56px;--post-footer-grid-template:auto / repeat(4, auto);--post-footer-grid-row-gap:0;--post-footer-grid-column-gap:24px;--post-footer-grid-margin-block-end:40px;--post-footer-column-flex-direction:row;--post-footer-column-align-items:center;--post-footer-column-gap:32px;--post-footer-post-list-gap:24px;--post-footer-businesssectors-margin-block-end:24px;--post-footer-meta-font-size:16px}}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.footer-container{box-sizing:content-box;margin:0 auto;padding:var(--post-footer-container-padding-block) var(--post-footer-container-padding-inline);max-width:var(--post-footer-container-max-width)}.footer-grid{display:grid;grid-template:var(--post-footer-grid-template);row-gap:var(--post-footer-grid-row-gap);column-gap:var(--post-footer-grid-column-gap);margin-block-end:var(--post-footer-grid-margin-block-end);padding-block-end:var(--post-footer-grid-padding-block-end)}.footer-grid ::part(button),.footer-grid ::part(body){padding-inline:0}.footer-column{display:flex;flex-direction:var(--post-footer-column-flex-direction);flex-wrap:wrap;justify-content:space-between;align-items:var(--post-footer-column-align-items);column-gap:var(--post-footer-column-gap)}.footer-socialmedia ::slotted(post-list),.footer-app ::slotted(post-list),.footer-businesssectors ::slotted(post-list),.footer-meta ::slotted(post-list){display:flex !important;flex-direction:var(--post-footer-post-list-flex-direction) !important;gap:var(--post-footer-post-list-gap) !important;align-items:var(--post-footer-post-list-align-items) !important}.footer-socialmedia{margin-block-end:var(--post-footer-socialmedia-margin-block-end)}.footer-app{margin-block-end:var(--post-footer-app-margin-block-end)}.footer-businesssectors{margin-block-end:var(--post-footer-businesssectors-margin-block-end)}.footer-meta{margin-block-end:var(--post-footer-meta-margin-block-end);font-size:var(--post-footer-meta-font-size)}.footer-copyright{display:flex;flex-wrap:wrap;column-gap:.5rem;font-size:var(--post-footer-copyright-font-size)}.d-none{display:none}post-accordion-item.d-none+post-accordion-item{--post-accordion-button-border-top-width:unset}post-accordion-item:not(.d-none)~post-accordion-item,post-accordion-item:not(post-accordion-item:not(.d-none)~*):not(:has(~post-accordion-item:not(.d-none))){--post-accordion-button-border-top-width:0}";
|
|
12
|
+
|
|
13
|
+
const GRID_SLOTS = ['grid-1', 'grid-2', 'grid-3', 'grid-4'];
|
|
14
|
+
const PostFooter$1 = /*@__PURE__*/ proxyCustomElement(class PostFooter extends H {
|
|
15
|
+
validateLabel() {
|
|
16
|
+
checkRequiredAndType(this, 'label', 'string');
|
|
17
|
+
}
|
|
18
|
+
constructor() {
|
|
19
|
+
super();
|
|
20
|
+
this.__registerHost();
|
|
21
|
+
this.__attachShadow();
|
|
22
|
+
this.device = breakpoint.get('device');
|
|
23
|
+
this.gridSlotDisplayed = {};
|
|
24
|
+
this.breakpointChange = (e) => {
|
|
25
|
+
this.device = e.detail;
|
|
26
|
+
};
|
|
27
|
+
this.handleGridSlotChange = (...devices) => (e) => {
|
|
28
|
+
if (devices.includes(this.device) && e.target instanceof HTMLSlotElement) {
|
|
29
|
+
this.updateGridSlotDisplay(e.target.name, e.target.assignedElements().length > 0);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
this.handleGridSlotChange = this.handleGridSlotChange.bind(this);
|
|
33
|
+
}
|
|
34
|
+
connectedCallback() {
|
|
35
|
+
window.addEventListener('postBreakpoint:device', this.breakpointChange);
|
|
36
|
+
}
|
|
37
|
+
componentWillLoad() {
|
|
38
|
+
this.validateLabel();
|
|
39
|
+
// initialize grid visibility by checking the content of each slot
|
|
40
|
+
GRID_SLOTS.forEach(slotName => {
|
|
41
|
+
const assignedElements = this.host.querySelectorAll(`[slot="${slotName}"]`);
|
|
42
|
+
this.updateGridSlotDisplay(slotName, assignedElements.length > 0);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
disconnectedCallback() {
|
|
46
|
+
window.removeEventListener('postBreakpoint:device', this.breakpointChange);
|
|
47
|
+
}
|
|
48
|
+
updateGridSlotDisplay(slotName, hasContent) {
|
|
49
|
+
if (this.gridSlotDisplayed[slotName] !== hasContent) {
|
|
50
|
+
this.gridSlotDisplayed = { ...this.gridSlotDisplayed, [slotName]: hasContent };
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
renderAccordion() {
|
|
54
|
+
return (h("post-accordion", { headingLevel: 3, multiple: true }, GRID_SLOTS.map(slotName => (h("post-accordion-item", { class: { 'd-none': !this.gridSlotDisplayed[slotName] }, collapsed: true }, h("span", { slot: "header" }, h("slot", { name: slotName + '-title' })), h("slot", { onSlotchange: this.handleGridSlotChange('mobile'), name: slotName }))))));
|
|
55
|
+
}
|
|
56
|
+
renderColumns() {
|
|
57
|
+
return GRID_SLOTS.map(slotName => (h("div", { class: { 'd-none': !this.gridSlotDisplayed[slotName] } }, h("slot", { onSlotchange: this.handleGridSlotChange('tablet', 'desktop'), name: slotName }))));
|
|
58
|
+
}
|
|
59
|
+
render() {
|
|
60
|
+
return (h(Host, { key: 'a3e6828ef746ddffe046e357608a8de4a7e65aef', "data-version": version, "data-color-scheme": "light" }, h("footer", { key: 'fc1ca33cdb64bff7afcfac3aab217b9d5b6bda32' }, h("h2", { key: 'b78636fa1ce5d94311b42afaac23a77a1617873f', class: "visually-hidden" }, this.label), h("div", { key: '1562367473f54eecaa82ed3b39b17bb99fb206fa', class: "footer-container" }, h("div", { key: 'e5ef28a7fbc14ae04fc24781f90cd75e8648a61e', class: "footer-grid" }, this.device === 'mobile' ? this.renderAccordion() : this.renderColumns()), h("div", { key: 'a1648b7d59cb4b0342cb847783888a2c9aeb7973', class: "footer-column" }, h("div", { key: '000eb64db6bcb7403297809b004a57eece8c76ed', class: "footer-socialmedia" }, h("slot", { key: '0effe00b425975fe88aeb796efccc09ae05f7dde', name: "socialmedia" })), h("div", { key: 'a469169fcd3a5c58d9c651d7a3fe09bb709e1f91', class: "footer-app" }, h("slot", { key: '32c7fa2fbaf8498fdf10425c28a487bca6708c07', name: "app" }))), h("div", { key: 'da56f002b12eedcd4e0b69cb113eb0fe5a8c20a7', class: "footer-businesssectors" }, h("slot", { key: 'b83cf880c13c3fa5b4fc45ab88f174570ce60e04', name: "businesssectors" })), h("div", { key: '6ae55420c729a42730d610c1dd24cc5e9c87fdbb', class: "footer-meta" }, h("slot", { key: '85991571ab8525f2d86d100f5eba0ff937030d90', name: "meta" })), h("div", { key: 'a66a5ba0858e7c2064706f071c989ddf3095f3f3', class: "footer-copyright" }, h("slot", { key: 'b42f156e0fc9027e846691bd8c7ff04b93091e7e', name: "copyright" }))))));
|
|
61
|
+
}
|
|
62
|
+
get host() { return this; }
|
|
63
|
+
static get watchers() { return {
|
|
64
|
+
"label": ["validateLabel"]
|
|
65
|
+
}; }
|
|
66
|
+
static get style() { return postFooterCss; }
|
|
67
|
+
}, [1, "post-footer", {
|
|
68
|
+
"label": [1],
|
|
69
|
+
"device": [32],
|
|
70
|
+
"gridSlotDisplayed": [32]
|
|
71
|
+
}, undefined, {
|
|
72
|
+
"label": ["validateLabel"]
|
|
73
|
+
}]);
|
|
74
|
+
function defineCustomElement$1() {
|
|
75
|
+
if (typeof customElements === "undefined") {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const components = ["post-footer", "post-accordion", "post-accordion-item", "post-collapsible", "post-collapsible-trigger", "post-icon"];
|
|
79
|
+
components.forEach(tagName => { switch (tagName) {
|
|
80
|
+
case "post-footer":
|
|
81
|
+
if (!customElements.get(tagName)) {
|
|
82
|
+
customElements.define(tagName, PostFooter$1);
|
|
83
|
+
}
|
|
84
|
+
break;
|
|
85
|
+
case "post-accordion":
|
|
86
|
+
if (!customElements.get(tagName)) {
|
|
87
|
+
defineCustomElement$6();
|
|
88
|
+
}
|
|
89
|
+
break;
|
|
90
|
+
case "post-accordion-item":
|
|
91
|
+
if (!customElements.get(tagName)) {
|
|
92
|
+
defineCustomElement$5();
|
|
93
|
+
}
|
|
94
|
+
break;
|
|
95
|
+
case "post-collapsible":
|
|
96
|
+
if (!customElements.get(tagName)) {
|
|
97
|
+
defineCustomElement$4();
|
|
98
|
+
}
|
|
99
|
+
break;
|
|
100
|
+
case "post-collapsible-trigger":
|
|
101
|
+
if (!customElements.get(tagName)) {
|
|
102
|
+
defineCustomElement$3();
|
|
103
|
+
}
|
|
104
|
+
break;
|
|
105
|
+
case "post-icon":
|
|
106
|
+
if (!customElements.get(tagName)) {
|
|
107
|
+
defineCustomElement$2();
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
} });
|
|
111
|
+
}
|
|
112
|
+
defineCustomElement$1();
|
|
113
|
+
|
|
114
|
+
const PostFooter = PostFooter$1;
|
|
115
|
+
const defineCustomElement = defineCustomElement$1;
|
|
116
|
+
|
|
117
|
+
export { PostFooter, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../../types/components";
|
|
2
|
+
|
|
3
|
+
interface PostHeader extends Components.PostHeader, HTMLElement {}
|
|
4
|
+
export const PostHeader: {
|
|
5
|
+
prototype: PostHeader;
|
|
6
|
+
new (): PostHeader;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
|
+
import { t as throttle, b as breakpoint } from './p-CJ80BZ06.js';
|
|
3
|
+
import { v as version } from './p-0Ltezq5O.js';
|
|
4
|
+
import { g as getFocusableChildren } from './p-C35MCWIp.js';
|
|
5
|
+
import { E as EventFrom } from './p-kraHE1r3.js';
|
|
6
|
+
|
|
7
|
+
const easing = 'ease';
|
|
8
|
+
const duration = 500;
|
|
9
|
+
const fill = 'forwards';
|
|
10
|
+
function slideUp(el, translateSize = '-100%') {
|
|
11
|
+
return el.animate([
|
|
12
|
+
{ transform: 'translateY(0)' }, // Starting position (no translation)
|
|
13
|
+
{ transform: `translateY(${translateSize})` }, // End position
|
|
14
|
+
], {
|
|
15
|
+
duration: duration,
|
|
16
|
+
easing,
|
|
17
|
+
fill,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function slideDown(el, translateSize = '-100%') {
|
|
21
|
+
return el.animate([
|
|
22
|
+
{ transform: `translateY(${translateSize})` }, // Starting position (no translation)
|
|
23
|
+
{ transform: 'translateY(0)' }, // End position
|
|
24
|
+
], {
|
|
25
|
+
duration: duration,
|
|
26
|
+
easing,
|
|
27
|
+
fill,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const postHeaderCss = "*,::before,::after{box-sizing:border-box}:host{z-index:1020;position:relative;--post-logo-height:calc(var(--post-global-header-expanded-height) - var(--post-header-scroll-top, 0px));--post-global-header-top:calc( var(--post-global-header-reduced-height) - var(--post-global-header-expanded-height) );--post-local-header-top:calc( var(--post-global-header-reduced-height) + var(--post-local-header-reduced-height) - var(--post-local-header-expanded-height) );--post-global-controls-top:clamp( 1000 * var(--post-global-header-top), calc(-1 * min(var(--post-header-scroll-top, 0px) / 4, var(--post-global-header-reduced-height))), 0px )}@media screen and (min-width: 1024px){:host:has(.global-sub>*:not(.logo):focus-within),:host:has(.local-sub:focus-within){--post-global-header-top:0;--post-local-header-top:var(--post-global-header-expanded-height);--post-logo-height:var(--post-global-header-expanded-height);--post-global-controls-top:0}}:host(:not(:has([slot=title]))) .local-header{padding-block-start:0}:host(:not(:has([slot=title]))) .local-sub{display:none}.d-flex{display:flex}.space-between{justify-content:space-between}.global-header{background-color:#fc0;display:flex;justify-content:space-between;position:sticky;padding-inline:4px;height:var(--post-global-header-expanded-height)}@media screen and (max-width: 1023.98px){.global-header{z-index:4;inset-block-start:0}}@media screen and (min-width: 1024px){.global-header{z-index:5;padding-inline-end:8px;inset-block-start:var(--post-global-header-top);transition:inset-block-start .2s ease-in-out}}.global-sub{display:flex;align-items:center;gap:24px}@media screen and (min-width: 1024px){.global-sub:not(:has(.logo)){position:relative;transition:inset-block-start .2s ease-in-out;inset-block-start:var(--post-global-controls-top)}.global-sub:not(:last-child):not(:first-child){flex-grow:1}}.align-end{align-items:flex-end}.logo{flex:1 0 auto;height:var(--post-global-header-expanded-height);width:var(--post-global-header-expanded-height);min-height:var(--post-global-header-reduced-height);align-self:flex-end}@media screen and (min-width: 1024px){.logo{transition:height .2 ease-in-out;height:var(--post-logo-height)}}::slotted(ul){margin-block:0 !important;list-style:none;display:flex;padding-inline-start:0;gap:1rem;flex-shrink:0 !important}.local-header{display:flex;position:sticky;inset-block-start:var(--post-local-header-top);flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px;min-height:var(--post-local-header-expanded-min-height);background:#fff;transition:box-shadow .2s ease-in-out}.local-header::after{content:\"\";position:absolute;width:100%;height:1px;background-color:#e1e0dc;inset-block-end:-1px;z-index:1}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.local-header::after{background-color:Highlight}}@media screen and (min-width: 1024px){.local-header{z-index:3;padding-block-start:18px;box-shadow:var(--post-device-elevation-300);transition:box-shadow .2s ease-in-out,inset-block-start .2s ease-in-out}}@media screen and (max-width: 1023.98px){.local-header{z-index:3;padding-block:8px;flex-wrap:wrap;gap:12px}.local-header.local-header-mobile-extended::after{inset-block-end:0}.local-header:not(.local-header-mobile-extended){box-shadow:var(--post-device-elevation-300)}}.local-header.no-navigation{padding-block:0}.local-header.no-navigation .navigation{display:none}.local-sub{margin-inline-end:16px}@media screen and (max-width: 1023.98px){.local-sub{margin-inline-end:4px}}::slotted(.list-inline){margin:0 !important;z-index:3 !important;position:relative !important}@media screen and (min-width: 1024px){.mobile-toggle{display:none}}.navigation{width:100%}@media screen and (min-width: 1024px){.navigation{inset-block-start:var(--post-global-header-reduced-height)}.navigation::before{display:block;content:\"\";position:absolute;inset:0;z-index:2;background:#fff}}@media screen and (max-width: 1023.98px){.navigation{position:sticky;z-index:2;inset-inline:0;inset-block-start:var(--post-header-height)}.mobile-menu{background-color:#fafafa}::slotted(post-mainnavigation),.navigation-footer{padding-block:16px 24px;padding-inline:40px}::slotted(post-mainnavigation),.navigation-footer,.navigation-target-group{display:none;flex-direction:column}.navigation.extended ::slotted(post-mainnavigation),.navigation.extended .navigation-footer,.navigation.extended .navigation-target-group{display:flex}::slotted(post-mainnavigation){padding-block:24px}.navigation.extended>div{display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;height:calc(min(var(--post-header-scroll-parent-height, 100dvh),100dvh) - var(--post-header-height))}.navigation.extended.megadropdown-open>div{overflow-y:hidden}.navigation.extended ::slotted(post-mainnavigation){flex-grow:1 !important}.navigation-footer{background-color:#f0efed;gap:24px}.navigation-footer ::slotted(post-language-switch){margin-top:16px}}@media screen and (max-width: 1023.98px)and (max-width: 599.98px){.navigation-footer{gap:16px}}@media screen and (max-width: 599.98px){::slotted(post-mainnavigation),.navigation-footer{padding-inline:16px}}";
|
|
32
|
+
|
|
33
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
34
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
35
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
36
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
37
|
+
else
|
|
38
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
39
|
+
if (d = decorators[i])
|
|
40
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
41
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
42
|
+
};
|
|
43
|
+
const PostHeader$1 = /*@__PURE__*/ proxyCustomElement(class PostHeader extends H {
|
|
44
|
+
get hasMobileMenu() {
|
|
45
|
+
return this.device !== 'desktop' && this.hasNavigation;
|
|
46
|
+
}
|
|
47
|
+
get scrollParent() {
|
|
48
|
+
const frozenScrollParent = document.querySelector('[data-post-scroll-locked]');
|
|
49
|
+
if (frozenScrollParent)
|
|
50
|
+
return frozenScrollParent;
|
|
51
|
+
let element = this.host.parentElement;
|
|
52
|
+
while (element) {
|
|
53
|
+
const overflow = getComputedStyle(element).overflowY;
|
|
54
|
+
if (['auto', 'scroll'].includes(overflow)) {
|
|
55
|
+
return element;
|
|
56
|
+
}
|
|
57
|
+
element = element.parentElement;
|
|
58
|
+
}
|
|
59
|
+
return document.body;
|
|
60
|
+
}
|
|
61
|
+
lockBody(newValue, _oldValue, propName) {
|
|
62
|
+
const scrollParent = this.scrollParent;
|
|
63
|
+
const mobileMenuExtended = propName === 'mobileMenuExtended' ? newValue : this.mobileMenuExtended;
|
|
64
|
+
if (this.device !== 'desktop' && mobileMenuExtended) {
|
|
65
|
+
scrollParent.setAttribute('data-post-scroll-locked', '');
|
|
66
|
+
this.host.addEventListener('keydown', this.keyboardHandler);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
scrollParent.removeAttribute('data-post-scroll-locked');
|
|
70
|
+
this.host.removeEventListener('keydown', this.keyboardHandler);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
constructor() {
|
|
74
|
+
super();
|
|
75
|
+
this.__registerHost();
|
|
76
|
+
this.__attachShadow();
|
|
77
|
+
this.throttledResize = throttle(50, () => this.updateLocalHeaderHeight());
|
|
78
|
+
this.device = breakpoint.get('device');
|
|
79
|
+
this.hasNavigation = false;
|
|
80
|
+
this.mobileMenuExtended = false;
|
|
81
|
+
this.megadropdownOpen = false;
|
|
82
|
+
this.breakpointChange = (e) => {
|
|
83
|
+
this.device = e.detail;
|
|
84
|
+
this.switchLanguageSwitchMode();
|
|
85
|
+
if (this.device === 'desktop' && this.mobileMenuExtended) {
|
|
86
|
+
this.closeMobileMenu();
|
|
87
|
+
}
|
|
88
|
+
if (this.device !== 'desktop') {
|
|
89
|
+
Array.from(this.host.querySelectorAll('post-megadropdown')).forEach(dropdown => {
|
|
90
|
+
dropdown.hide(false, true);
|
|
91
|
+
});
|
|
92
|
+
this.megadropdownOpen = false;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
this.megadropdownStateHandler = (event) => {
|
|
96
|
+
this.megadropdownOpen = event.detail.isVisible;
|
|
97
|
+
};
|
|
98
|
+
this.handleScrollEvent = this.handleScrollEvent.bind(this);
|
|
99
|
+
this.updateScrollParentHeight = this.updateScrollParentHeight.bind(this);
|
|
100
|
+
this.updateLocalHeaderHeight = this.updateLocalHeaderHeight.bind(this);
|
|
101
|
+
this.keyboardHandler = this.keyboardHandler.bind(this);
|
|
102
|
+
this.handleLinkClick = this.handleLinkClick.bind(this);
|
|
103
|
+
}
|
|
104
|
+
connectedCallback() {
|
|
105
|
+
window.addEventListener('resize', this.throttledResize, { passive: true });
|
|
106
|
+
window.addEventListener('scroll', this.handleScrollEvent, {
|
|
107
|
+
passive: true,
|
|
108
|
+
});
|
|
109
|
+
this.scrollParent.addEventListener('scroll', this.handleScrollEvent, {
|
|
110
|
+
passive: true,
|
|
111
|
+
});
|
|
112
|
+
document.addEventListener('postToggleMegadropdown', this.megadropdownStateHandler);
|
|
113
|
+
this.host.addEventListener('click', this.handleLinkClick);
|
|
114
|
+
window.addEventListener('postBreakpoint:device', this.breakpointChange);
|
|
115
|
+
this.checkNavigationExistence();
|
|
116
|
+
this.switchLanguageSwitchMode();
|
|
117
|
+
this.handleScrollParentResize();
|
|
118
|
+
this.lockBody(false, this.mobileMenuExtended, 'mobileMenuExtended');
|
|
119
|
+
}
|
|
120
|
+
componentWillRender() {
|
|
121
|
+
this.handleScrollEvent();
|
|
122
|
+
}
|
|
123
|
+
componentDidRender() {
|
|
124
|
+
this.getFocusableElements();
|
|
125
|
+
this.handleLocalHeaderResize();
|
|
126
|
+
}
|
|
127
|
+
componentDidLoad() {
|
|
128
|
+
this.updateLocalHeaderHeight();
|
|
129
|
+
}
|
|
130
|
+
// Clean up possible side effects when post-header is disconnected
|
|
131
|
+
disconnectedCallback() {
|
|
132
|
+
const scrollParent = this.scrollParent;
|
|
133
|
+
window.removeEventListener('postBreakpoint:device', this.breakpointChange);
|
|
134
|
+
window.removeEventListener('resize', this.throttledResize);
|
|
135
|
+
window.removeEventListener('scroll', this.handleScrollEvent);
|
|
136
|
+
scrollParent.removeEventListener('scroll', this.handleScrollEvent);
|
|
137
|
+
document.removeEventListener('postToggleMegadropdown', this.megadropdownStateHandler);
|
|
138
|
+
this.host.removeEventListener('keydown', this.keyboardHandler);
|
|
139
|
+
this.host.removeEventListener('click', this.handleLinkClick);
|
|
140
|
+
if (this.scrollParentResizeObserver) {
|
|
141
|
+
this.scrollParentResizeObserver.disconnect();
|
|
142
|
+
this.scrollParentResizeObserver = null;
|
|
143
|
+
}
|
|
144
|
+
if (this.localHeaderResizeObserver) {
|
|
145
|
+
this.localHeaderResizeObserver.disconnect();
|
|
146
|
+
this.localHeaderResizeObserver = null;
|
|
147
|
+
}
|
|
148
|
+
this.mobileMenuExtended = false;
|
|
149
|
+
}
|
|
150
|
+
checkNavigationExistence() {
|
|
151
|
+
this.hasNavigation = this.host.querySelectorAll('post-mainnavigation').length > 0;
|
|
152
|
+
}
|
|
153
|
+
async closeMobileMenu() {
|
|
154
|
+
this.mobileMenuAnimation.finish();
|
|
155
|
+
const menuButton = this.getMenuButton();
|
|
156
|
+
if (menuButton) {
|
|
157
|
+
menuButton.toggled = false;
|
|
158
|
+
}
|
|
159
|
+
this.mobileMenuExtended = false;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Toggles the mobile navigation.
|
|
163
|
+
*/
|
|
164
|
+
async toggleMobileMenu(force) {
|
|
165
|
+
if (this.device === 'desktop')
|
|
166
|
+
return;
|
|
167
|
+
this.mobileMenuAnimation = this.mobileMenuExtended
|
|
168
|
+
? slideUp(this.mobileMenu)
|
|
169
|
+
: slideDown(this.mobileMenu);
|
|
170
|
+
// Update the state of the toggle button
|
|
171
|
+
const menuButton = this.host.querySelector('post-togglebutton');
|
|
172
|
+
menuButton.toggled = force ?? !this.mobileMenuExtended;
|
|
173
|
+
if (this.mobileMenuExtended) {
|
|
174
|
+
// Wait for the close animation to finish before hiding megadropdowns
|
|
175
|
+
await this.mobileMenuAnimation.finished;
|
|
176
|
+
this.mobileMenuExtended = force ?? !this.mobileMenuExtended;
|
|
177
|
+
if (this.mobileMenuExtended === false) {
|
|
178
|
+
this.closeAllMegadropdowns();
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
this.mobileMenuExtended = force ?? !this.mobileMenuExtended;
|
|
183
|
+
// If opening, close any open megadropdowns immediately
|
|
184
|
+
if (this.megadropdownOpen) {
|
|
185
|
+
this.closeAllMegadropdowns();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// Get all the focusable elements in the post-header mobile menu
|
|
190
|
+
getFocusableElements() {
|
|
191
|
+
// Get elements in the correct order (different as the DOM order)
|
|
192
|
+
const focusableEls = [
|
|
193
|
+
...Array.from(this.host.querySelectorAll('.list-inline:not([slot="meta-navigation"]) > li')),
|
|
194
|
+
...Array.from(this.host.querySelectorAll('nav > post-list > div > post-list-item, post-megadropdown-trigger')),
|
|
195
|
+
...Array.from(this.host.querySelectorAll('.list-inline[slot="meta-navigation"] > li, post-language-option')),
|
|
196
|
+
];
|
|
197
|
+
// Add the main toggle menu button to the list of focusable children
|
|
198
|
+
const focusableChildren = [
|
|
199
|
+
this.host.querySelector('post-togglebutton'),
|
|
200
|
+
...focusableEls.flatMap(el => Array.from(getFocusableChildren(el))),
|
|
201
|
+
];
|
|
202
|
+
this.firstFocusableEl = focusableChildren[0];
|
|
203
|
+
this.lastFocusableEl = focusableChildren[focusableChildren.length - 1];
|
|
204
|
+
}
|
|
205
|
+
getMenuButton() {
|
|
206
|
+
return this.host.querySelector('post-togglebutton');
|
|
207
|
+
}
|
|
208
|
+
keyboardHandler(e) {
|
|
209
|
+
if (e.key === 'Tab' && this.mobileMenuExtended) {
|
|
210
|
+
if (e.shiftKey && document.activeElement === this.firstFocusableEl) {
|
|
211
|
+
// If back tab (Tab + Shift) and first element is focused, focus goes to the last element of the megadropdown
|
|
212
|
+
e.preventDefault();
|
|
213
|
+
this.lastFocusableEl.focus();
|
|
214
|
+
}
|
|
215
|
+
else if (!e.shiftKey && document.activeElement === this.lastFocusableEl) {
|
|
216
|
+
// If Tab and last element is focused, focus goes back to the first element of the megadropdown
|
|
217
|
+
e.preventDefault();
|
|
218
|
+
this.firstFocusableEl.focus();
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
closeAllMegadropdowns() {
|
|
223
|
+
Array.from(this.host.querySelectorAll('post-megadropdown')).forEach(dropdown => {
|
|
224
|
+
dropdown.hide(false, true);
|
|
225
|
+
});
|
|
226
|
+
this.megadropdownOpen = false;
|
|
227
|
+
}
|
|
228
|
+
handleScrollEvent() {
|
|
229
|
+
const scrollTop = this.scrollParent === document.body ? window.scrollY : this.scrollParent.scrollTop;
|
|
230
|
+
document.documentElement.style.setProperty('--post-header-scroll-top', `${scrollTop}px`);
|
|
231
|
+
}
|
|
232
|
+
updateLocalHeaderHeight() {
|
|
233
|
+
const localHeaderElement = this.host.shadowRoot.querySelector('.local-header');
|
|
234
|
+
if (localHeaderElement) {
|
|
235
|
+
document.documentElement.style.setProperty('--post-local-header-expanded-height', `${localHeaderElement.clientHeight}px`);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
updateScrollParentHeight() {
|
|
239
|
+
this.host.style.setProperty('--post-header-scroll-parent-height', `${this.scrollParent.clientHeight}px`);
|
|
240
|
+
}
|
|
241
|
+
handleLinkClick(event) {
|
|
242
|
+
const target = event.target;
|
|
243
|
+
const isLinkInMainNav = target.closest('post-mainnavigation a');
|
|
244
|
+
const isLinkInMegadropdown = target.closest('post-megadropdown a');
|
|
245
|
+
if (!isLinkInMainNav && !isLinkInMegadropdown) {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
if (this.mobileMenuExtended && (isLinkInMainNav || isLinkInMegadropdown)) {
|
|
249
|
+
this.toggleMobileMenu(false);
|
|
250
|
+
}
|
|
251
|
+
if (this.device === 'desktop' && isLinkInMegadropdown) {
|
|
252
|
+
const megadropdownLink = target.closest('post-megadropdown a');
|
|
253
|
+
if (megadropdownLink) {
|
|
254
|
+
target.closest('post-megadropdown').hide(true);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
handleScrollParentResize() {
|
|
259
|
+
if (this.scrollParent) {
|
|
260
|
+
this.scrollParentResizeObserver = new ResizeObserver(this.updateScrollParentHeight);
|
|
261
|
+
this.scrollParentResizeObserver.observe(this.scrollParent);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
handleLocalHeaderResize() {
|
|
265
|
+
const localHeader = this.host.shadowRoot.querySelector('.local-header');
|
|
266
|
+
if (localHeader && !this.localHeaderResizeObserver) {
|
|
267
|
+
this.localHeaderResizeObserver = new ResizeObserver(this.updateLocalHeaderHeight);
|
|
268
|
+
this.localHeaderResizeObserver.observe(localHeader);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
switchLanguageSwitchMode() {
|
|
272
|
+
const variant = this.hasMobileMenu ? 'list' : 'menu';
|
|
273
|
+
Array.from(this.host.querySelectorAll('post-language-switch')).forEach(languageSwitch => {
|
|
274
|
+
languageSwitch?.setAttribute('variant', variant);
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
renderNavigation() {
|
|
278
|
+
const navigationClasses = ['navigation'];
|
|
279
|
+
const mobileMenuScrollTop = this.mobileMenu?.scrollTop ?? 0;
|
|
280
|
+
if (this.mobileMenuExtended) {
|
|
281
|
+
navigationClasses.push('extended');
|
|
282
|
+
}
|
|
283
|
+
if (this.megadropdownOpen) {
|
|
284
|
+
navigationClasses.push('megadropdown-open');
|
|
285
|
+
}
|
|
286
|
+
return (h("div", { class: navigationClasses.join(' '), style: { '--post-header-navigation-current-inset': `${mobileMenuScrollTop}px` } }, h("div", { class: "mobile-menu", ref: el => (this.mobileMenu = el) }, h("div", { class: "navigation-target-group" }, (this.device === 'mobile' || this.device === 'tablet') && (h("slot", { name: "target-group" }))), h("slot", { name: "post-mainnavigation", onSlotchange: () => this.checkNavigationExistence() }), (this.device === 'mobile' || this.device === 'tablet') && (h("div", { class: "navigation-footer" }, h("slot", { name: "meta-navigation" }), h("slot", { name: "post-language-switch" }))))));
|
|
287
|
+
}
|
|
288
|
+
render() {
|
|
289
|
+
const localHeaderClasses = ['local-header'];
|
|
290
|
+
if (this.mobileMenuExtended)
|
|
291
|
+
localHeaderClasses.push('local-header-mobile-extended');
|
|
292
|
+
if (!this.hasNavigation)
|
|
293
|
+
localHeaderClasses.push('no-navigation');
|
|
294
|
+
return (h(Host, { key: 'ec2be7f6699d0b6be65c7ec05ccfaf11fe38551f', "data-version": version, "data-color-scheme": "light" }, h("div", { key: 'defa2d956e848f0270e1c36404bb0e32e6112ab2', class: "global-header" }, h("div", { key: 'b1db492439d45566140d8698310d68707d44f178', class: "global-sub" }, h("div", { key: 'a238bbbe5999e4ff858b9f7223eb3a82ae517dc3', class: "logo" }, h("slot", { key: '7b6a922842eaf01fdddad88079c5c4e27d9caf9d', name: "post-logo" }))), h("div", { key: '70b7e4f0a0e7dcd8458238f85d5cadfad5c8030d', class: "global-sub" }, this.device === 'desktop' && h("slot", { key: '9abe132d957d37848205cd5b045ed9d8e9040da4', name: "target-group" })), h("div", { key: '6666cb7b19cd3654020291cff4b3f7821f190416', class: "global-sub" }, !this.hasMobileMenu && (h("slot", { key: '446f14ba4b014b35b60dbf643ab1baace4cd1cd7', name: "meta-navigation" })), h("slot", { key: '6cdb4006e56ccdeb076cbe486a437ca56e4b259a', name: "global-controls" }), !this.hasMobileMenu && h("slot", { key: '6be456ce09dee5653c36e2320fa89345139232a4', name: "post-language-switch" }), this.hasNavigation && (h("div", { key: '28f87889a93aae2e78978cbd02e18dca58a486ef', onClick: () => this.toggleMobileMenu(), class: "mobile-toggle" }, h("slot", { key: '157b154a30cdaf4c17434c2a6c7a796ad945780c', name: "post-togglebutton" }))))), h("div", { key: 'ddf249e9b055659325cc9717f03ccd9345556e15', class: localHeaderClasses.join(' ') }, h("slot", { key: '858312b4c4ef74c76588f9cd0b49acfda39f6daf', name: "title" }), h("div", { key: '73db57db8df18d9106cb124cf95b0c2551ceda23', class: "local-sub" }, h("slot", { key: 'e36a9e8572878fe11ae326503b0cbcc4d03ddd3e', name: "local-controls" }), h("slot", { key: '354e22a83276f8fa8c79127c8cdcfbf0f12dbf91' })), this.device === 'desktop' && this.renderNavigation()), this.device !== 'desktop' && this.renderNavigation()));
|
|
295
|
+
}
|
|
296
|
+
get host() { return this; }
|
|
297
|
+
static get watchers() { return {
|
|
298
|
+
"device": ["lockBody"],
|
|
299
|
+
"mobileMenuExtended": ["lockBody"]
|
|
300
|
+
}; }
|
|
301
|
+
static get style() { return postHeaderCss; }
|
|
302
|
+
}, [1, "post-header", {
|
|
303
|
+
"device": [32],
|
|
304
|
+
"hasNavigation": [32],
|
|
305
|
+
"mobileMenuExtended": [32],
|
|
306
|
+
"megadropdownOpen": [32],
|
|
307
|
+
"toggleMobileMenu": [64]
|
|
308
|
+
}, undefined, {
|
|
309
|
+
"device": ["lockBody"],
|
|
310
|
+
"mobileMenuExtended": ["lockBody"]
|
|
311
|
+
}]);
|
|
312
|
+
__decorate([
|
|
313
|
+
EventFrom('post-megadropdown')
|
|
314
|
+
], PostHeader$1.prototype, "megadropdownStateHandler", void 0);
|
|
315
|
+
function defineCustomElement$1() {
|
|
316
|
+
if (typeof customElements === "undefined") {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
const components = ["post-header"];
|
|
320
|
+
components.forEach(tagName => { switch (tagName) {
|
|
321
|
+
case "post-header":
|
|
322
|
+
if (!customElements.get(tagName)) {
|
|
323
|
+
customElements.define(tagName, PostHeader$1);
|
|
324
|
+
}
|
|
325
|
+
break;
|
|
326
|
+
} });
|
|
327
|
+
}
|
|
328
|
+
defineCustomElement$1();
|
|
329
|
+
|
|
330
|
+
const PostHeader = PostHeader$1;
|
|
331
|
+
const defineCustomElement = defineCustomElement$1;
|
|
332
|
+
|
|
333
|
+
export { PostHeader, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../../types/components";
|
|
2
|
+
|
|
3
|
+
interface PostIcon extends Components.PostIcon, HTMLElement {}
|
|
4
|
+
export const PostIcon: {
|
|
5
|
+
prototype: PostIcon;
|
|
6
|
+
new (): PostIcon;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../../types/components";
|
|
2
|
+
|
|
3
|
+
interface PostLanguageOption extends Components.PostLanguageOption, HTMLElement {}
|
|
4
|
+
export const PostLanguageOption: {
|
|
5
|
+
prototype: PostLanguageOption;
|
|
6
|
+
new (): PostLanguageOption;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|