@swisspost/design-system-components 10.5.0 → 10.7.0
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/README.md +2 -2
- package/dist/cjs/{create-validator-decorator-u-Byhihe.js → create-validator-decorator-D7nAb9KJ.js} +1 -1
- package/dist/cjs/{index-CXnlZiX8.js → index-DWIlRT6N.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{one-of-LGG0uEIi.js → one-of-B8RUgrZk.js} +1 -1
- package/dist/cjs/{package-DdU-rENe.js → package-BtKYhTNj.js} +1 -1
- package/dist/cjs/{pattern-B-csvfNt.js → pattern-B6VoDk_m.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +5 -5
- package/dist/cjs/post-autocomplete.cjs.entry.js +5 -5
- package/dist/cjs/post-avatar.cjs.entry.js +6 -6
- package/dist/cjs/post-back-to-top.cjs.entry.js +5 -5
- package/dist/cjs/post-banner.cjs.entry.js +4 -4
- package/dist/cjs/post-breadcrumb-item.cjs.entry.js +32 -10
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +158 -58
- package/dist/cjs/post-closebutton_14.cjs.entry.js +63 -53
- package/dist/cjs/post-collapsible_2.cjs.entry.js +7 -7
- package/dist/cjs/post-components.cjs.js +2 -2
- package/dist/cjs/post-date-picker.cjs.entry.js +38 -34
- package/dist/cjs/post-footer.cjs.entry.js +8 -8
- package/dist/cjs/post-linkarea.cjs.entry.js +3 -3
- package/dist/cjs/post-listbox-option.cjs.entry.js +4 -4
- package/dist/cjs/post-listbox.cjs.entry.js +3 -3
- package/dist/cjs/post-number-input.cjs.entry.js +4 -4
- package/dist/cjs/post-pagination.cjs.entry.js +5 -5
- package/dist/cjs/post-popover-trigger.cjs.entry.js +6 -6
- package/dist/cjs/post-popover.cjs.entry.js +9 -9
- package/dist/cjs/post-progressbar.cjs.entry.js +4 -4
- package/dist/cjs/post-rating.cjs.entry.js +6 -6
- package/dist/cjs/post-side-navigation-trigger.cjs.entry.js +6 -6
- package/dist/cjs/post-side-navigation.cjs.entry.js +7 -7
- package/dist/cjs/post-stepper-item.cjs.entry.js +3 -3
- package/dist/cjs/post-stepper.cjs.entry.js +7 -7
- package/dist/cjs/post-tab-item.cjs.entry.js +6 -6
- package/dist/cjs/post-tab-panel.cjs.entry.js +6 -6
- package/dist/cjs/post-tabs.cjs.entry.js +8 -8
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +7 -7
- package/dist/cjs/post-tooltip.cjs.entry.js +5 -5
- package/dist/cjs/{required-bJzxBV-V.js → required-bXtlqqaA.js} +1 -1
- package/dist/cjs/{type-CGPnqGY1.js → type-BqLE7Uui.js} +1 -1
- package/dist/cjs/{url-Dxdd6tWj.js → url-CUy3C3sH.js} +1 -1
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.css +1 -1
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +30 -3
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.css +1 -1
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +184 -57
- package/dist/collection/components/post-closebutton/post-closebutton.js +1 -1
- package/dist/collection/components/post-collapsible/post-collapsible.js +1 -1
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +2 -2
- package/dist/collection/components/post-date-picker/native-mask-element.js +1 -1
- package/dist/collection/components/post-date-picker/post-date-picker.js +31 -29
- package/dist/collection/components/post-footer/post-footer.css +1 -1
- package/dist/collection/components/post-footer/post-footer.js +2 -2
- package/dist/collection/components/post-header/post-header.css +1 -1
- package/dist/collection/components/post-header/post-header.js +14 -8
- package/dist/collection/components/post-icon/post-icon.js +1 -1
- package/dist/collection/components/post-linkarea/post-linkarea.js +1 -1
- package/dist/collection/components/post-listbox/post-listbox.js +1 -1
- package/dist/collection/components/post-listbox-option/post-listbox-option.js +2 -2
- package/dist/collection/components/post-logo/post-logo.js +1 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +3 -3
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +1 -1
- package/dist/collection/components/post-menu/post-menu.js +1 -1
- package/dist/collection/components/post-menu-item/post-menu-item.css +1 -1
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +1 -1
- package/dist/collection/components/post-number-input/post-number-input.js +2 -2
- package/dist/collection/components/post-popover/post-popover.js +3 -3
- package/dist/collection/components/post-popover-trigger/post-popover-trigger.js +2 -2
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +26 -22
- package/dist/collection/components/post-progressbar/post-progressbar.js +1 -1
- package/dist/collection/components/post-rating/post-rating.js +1 -1
- package/dist/collection/components/post-side-navigation/post-side-navigation.js +1 -1
- package/dist/collection/components/post-side-navigation-trigger/post-side-navigation-trigger.js +1 -1
- package/dist/collection/components/post-stepper/post-stepper.js +1 -1
- package/dist/collection/components/post-stepper-item/post-stepper-item.js +1 -1
- package/dist/collection/components/post-tab-item/post-tab-item.js +2 -2
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +1 -1
- package/dist/collection/components/post-tabs/post-tabs.css +1 -1
- package/dist/collection/components/post-tabs/post-tabs.js +2 -2
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +1 -1
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +2 -2
- package/dist/collection/utils/floating-ui.js +1 -1
- package/dist/components/package.js +1 -1
- package/dist/components/post-breadcrumb-item.js +1 -1
- package/dist/components/post-breadcrumbs.js +1 -1
- package/dist/components/post-closebutton2.js +1 -1
- package/dist/components/post-collapsible-trigger2.js +1 -1
- package/dist/components/post-collapsible2.js +1 -1
- package/dist/components/post-date-picker.js +1 -1
- package/dist/components/post-footer.js +1 -1
- package/dist/components/post-header.js +1 -1
- package/dist/components/post-icon2.js +1 -1
- package/dist/components/post-linkarea.js +1 -1
- package/dist/components/post-listbox-option.js +1 -1
- package/dist/components/post-listbox.js +1 -1
- package/dist/components/post-logo.js +1 -1
- package/dist/components/post-mainnavigation.js +1 -1
- package/dist/components/post-megadropdown-trigger.js +1 -1
- package/dist/components/post-megadropdown.js +1 -1
- package/dist/components/post-menu-item2.js +1 -1
- package/dist/components/post-menu-trigger2.js +1 -1
- package/dist/components/post-menu2.js +1 -1
- package/dist/components/post-number-input.js +1 -1
- package/dist/components/post-popover-trigger.js +1 -1
- package/dist/components/post-popover.js +1 -1
- package/dist/components/post-popovercontainer2.js +1 -1
- package/dist/components/post-progressbar.js +1 -1
- package/dist/components/post-rating.js +1 -1
- package/dist/components/post-side-navigation-trigger.js +1 -1
- package/dist/components/post-side-navigation.js +1 -1
- package/dist/components/post-stepper-item.js +1 -1
- package/dist/components/post-stepper.js +1 -1
- package/dist/components/post-tab-item.js +1 -1
- package/dist/components/post-tab-panel.js +1 -1
- package/dist/components/post-tabs.js +1 -1
- package/dist/components/post-togglebutton2.js +1 -1
- package/dist/components/post-tooltip-trigger.js +1 -1
- package/dist/components/post-tooltip.js +1 -1
- package/dist/components/react/index.js +1 -1
- package/dist/components/react/{p-CLeWLMJn.js → p-1y1rv5Tw.js} +1 -1
- package/dist/components/react/{p-D3rq_-Qk.js → p-BBv5JYsW.js} +1 -1
- package/dist/components/react/p-BBz9PVf0.js +1 -0
- package/dist/components/react/{p-DasK590W.js → p-BgEY7xhT.js} +1 -1
- package/dist/components/react/{p-DiFAKI9o.js → p-C3J7fIWx.js} +1 -1
- package/dist/components/react/p-C5ibTdH5.js +1 -0
- package/dist/components/react/{p-DD-Sl3Ji.js → p-C8_zqgAP.js} +1 -1
- package/dist/components/react/{p-PYoaz_Xl.js → p-CUKzje9q.js} +1 -1
- package/dist/components/react/{p-C8vlYfD-.js → p-DS46v3ju.js} +1 -1
- package/dist/components/react/{p-CoCua20S.js → p-DTBtJCjk.js} +1 -1
- package/dist/components/react/{p-CuVhOs8F.js → p-XUkUhxaz.js} +1 -1
- package/dist/components/react/p-ialuSSl2.js +1 -0
- package/dist/components/react/post-accordion-item.js +1 -1
- package/dist/components/react/post-accordion.js +1 -1
- package/dist/components/react/post-autocomplete.js +1 -1
- package/dist/components/react/post-avatar.js +1 -1
- package/dist/components/react/post-back-to-top.js +1 -1
- package/dist/components/react/post-banner.js +1 -1
- package/dist/components/react/post-breadcrumb-item.js +1 -1
- package/dist/components/react/post-breadcrumbs.js +1 -1
- package/dist/components/react/post-closebutton.js +1 -1
- package/dist/components/react/post-collapsible-trigger.js +1 -1
- package/dist/components/react/post-collapsible.js +1 -1
- package/dist/components/react/post-date-picker.js +1 -1
- package/dist/components/react/post-footer.js +1 -1
- package/dist/components/react/post-header.js +1 -1
- package/dist/components/react/post-icon.js +1 -1
- package/dist/components/react/post-language-menu-item.js +1 -1
- package/dist/components/react/post-language-menu.js +1 -1
- package/dist/components/react/post-linkarea.js +1 -1
- package/dist/components/react/post-listbox-option.js +1 -1
- package/dist/components/react/post-listbox.js +1 -1
- package/dist/components/react/post-logo.js +1 -1
- package/dist/components/react/post-mainnavigation.js +1 -1
- package/dist/components/react/post-megadropdown-trigger.js +1 -1
- package/dist/components/react/post-megadropdown.js +1 -1
- package/dist/components/react/post-menu-item.js +1 -1
- package/dist/components/react/post-menu-trigger.js +1 -1
- package/dist/components/react/post-menu.js +1 -1
- package/dist/components/react/post-number-input.js +1 -1
- package/dist/components/react/post-pagination.js +1 -1
- package/dist/components/react/post-popover-trigger.js +1 -1
- package/dist/components/react/post-popover.js +1 -1
- package/dist/components/react/post-popovercontainer.js +1 -1
- package/dist/components/react/post-progressbar.js +1 -1
- package/dist/components/react/post-rating.js +1 -1
- package/dist/components/react/post-side-navigation-trigger.js +1 -1
- package/dist/components/react/post-side-navigation.js +1 -1
- package/dist/components/react/post-stepper-item.js +1 -1
- package/dist/components/react/post-stepper.js +1 -1
- package/dist/components/react/post-tab-item.js +1 -1
- package/dist/components/react/post-tab-panel.js +1 -1
- package/dist/components/react/post-tabs.js +1 -1
- package/dist/components/react/post-togglebutton.js +1 -1
- package/dist/components/react/post-tooltip-trigger.js +1 -1
- package/dist/components/react/post-tooltip.js +1 -1
- package/dist/docs.json +57 -12
- package/dist/esm/{create-validator-decorator-CbYxqPSB.js → create-validator-decorator-DFpQtJzK.js} +1 -1
- package/dist/esm/{index-D3NdvMgy.js → index-Bs0zeM5Q.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{one-of-Mx4vYjem.js → one-of-DQCfaZpw.js} +1 -1
- package/dist/esm/{package-Ny5VnydI.js → package-BBz9PVf0.js} +1 -1
- package/dist/esm/{pattern-CqQVrJPN.js → pattern-3lnaFlkk.js} +1 -1
- package/dist/esm/post-accordion_2.entry.js +5 -5
- package/dist/esm/post-autocomplete.entry.js +5 -5
- package/dist/esm/post-avatar.entry.js +6 -6
- package/dist/esm/post-back-to-top.entry.js +5 -5
- package/dist/esm/post-banner.entry.js +4 -4
- package/dist/esm/post-breadcrumb-item.entry.js +32 -10
- package/dist/esm/post-breadcrumbs.entry.js +158 -58
- package/dist/esm/post-closebutton_14.entry.js +63 -53
- package/dist/esm/post-collapsible_2.entry.js +7 -7
- package/dist/esm/post-components.js +3 -3
- package/dist/esm/post-date-picker.entry.js +38 -34
- package/dist/esm/post-footer.entry.js +8 -8
- package/dist/esm/post-linkarea.entry.js +3 -3
- package/dist/esm/post-listbox-option.entry.js +4 -4
- package/dist/esm/post-listbox.entry.js +3 -3
- package/dist/esm/post-number-input.entry.js +4 -4
- package/dist/esm/post-pagination.entry.js +5 -5
- package/dist/esm/post-popover-trigger.entry.js +6 -6
- package/dist/esm/post-popover.entry.js +9 -9
- package/dist/esm/post-progressbar.entry.js +4 -4
- package/dist/esm/post-rating.entry.js +6 -6
- package/dist/esm/post-side-navigation-trigger.entry.js +6 -6
- package/dist/esm/post-side-navigation.entry.js +7 -7
- package/dist/esm/post-stepper-item.entry.js +3 -3
- package/dist/esm/post-stepper.entry.js +7 -7
- package/dist/esm/post-tab-item.entry.js +6 -6
- package/dist/esm/post-tab-panel.entry.js +6 -6
- package/dist/esm/post-tabs.entry.js +8 -8
- package/dist/esm/post-tooltip-trigger.entry.js +7 -7
- package/dist/esm/post-tooltip.entry.js +5 -5
- package/dist/esm/{required-CxvSCYJj.js → required-NuzPg5jZ.js} +1 -1
- package/dist/esm/{type-CYB7_Yi8.js → type-ChnksJ25.js} +1 -1
- package/dist/esm/{url-DOwgyBfp.js → url-BCk3ZU-x.js} +1 -1
- package/dist/post-components/{p-c7a39444.entry.js → p-10e430c3.entry.js} +1 -1
- package/dist/post-components/{p-e463e7ac.entry.js → p-31550a50.entry.js} +1 -1
- package/dist/post-components/{p-2cb843f4.entry.js → p-31a97aae.entry.js} +1 -1
- package/dist/post-components/p-32e1e951.entry.js +1 -0
- package/dist/post-components/{p-b856263a.entry.js → p-43240818.entry.js} +1 -1
- package/dist/post-components/{p-44718c1a.entry.js → p-451ec8ee.entry.js} +1 -1
- package/dist/post-components/{p-2379e498.entry.js → p-4f08b99b.entry.js} +1 -1
- package/dist/post-components/{p-5a44b217.entry.js → p-54432b47.entry.js} +1 -1
- package/dist/post-components/{p-e7f97f6d.entry.js → p-58b66607.entry.js} +1 -1
- package/dist/post-components/{p-1d67c427.entry.js → p-5d7de657.entry.js} +1 -1
- package/dist/post-components/p-61a45246.entry.js +1 -0
- package/dist/post-components/p-63dd9a76.entry.js +1 -0
- package/dist/post-components/{p-665d877f.entry.js → p-63e570c4.entry.js} +1 -1
- package/dist/post-components/{p-ffec1880.entry.js → p-64480e3a.entry.js} +1 -1
- package/dist/post-components/p-6a2f47af.entry.js +1 -0
- package/dist/post-components/p-96d07f2b.entry.js +1 -0
- package/dist/post-components/p-9a1e8b1d.entry.js +1 -0
- package/dist/post-components/p-BBz9PVf0.js +1 -0
- package/dist/post-components/p-Bl-_v3aT.js +1 -0
- package/dist/post-components/p-Bs0zeM5Q.js +2 -0
- package/dist/post-components/{p-sgCfAEQU.js → p-BwhzbRIR.js} +1 -1
- package/dist/post-components/p-D1s6tESz.js +1 -0
- package/dist/post-components/p-DH-eJVHZ.js +1 -0
- package/dist/post-components/p-DeUk3rcv.js +1 -0
- package/dist/post-components/p-Dk-DtPZn.js +1 -0
- package/dist/post-components/p-aa33141b.entry.js +1 -0
- package/dist/post-components/p-aff180f5.entry.js +1 -0
- package/dist/post-components/{p-781efeb8.entry.js → p-bd128657.entry.js} +1 -1
- package/dist/post-components/{p-b6e231a8.entry.js → p-c2de3702.entry.js} +1 -1
- package/dist/post-components/{p-4e2bb082.entry.js → p-d5327dd1.entry.js} +1 -1
- package/dist/post-components/{p-030bfaa1.entry.js → p-e1817744.entry.js} +1 -1
- package/dist/post-components/{p-e8c19f72.entry.js → p-e6a4146b.entry.js} +1 -1
- package/dist/post-components/{p-e8268a8d.entry.js → p-f275b872.entry.js} +1 -1
- package/dist/post-components/{p-894b20dd.entry.js → p-f566768e.entry.js} +1 -1
- package/dist/post-components/{p-2ee255c1.entry.js → p-f6da5e69.entry.js} +1 -1
- package/dist/post-components/{p-a9223467.entry.js → p-f784e149.entry.js} +1 -1
- package/dist/post-components/p-f917527c.entry.js +1 -0
- package/dist/post-components/post-components.css +2 -2
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-breadcrumb-item/post-breadcrumb-item.d.ts +8 -1
- package/dist/types/components/post-breadcrumbs/post-breadcrumbs.d.ts +39 -22
- package/dist/types/components/post-date-picker/post-date-picker.d.ts +2 -1
- package/dist/types/components/post-header/post-header.d.ts +3 -1
- package/dist/types/components.d.ts +18 -7
- package/hydrate/index.js +308 -165
- package/hydrate/index.mjs +308 -165
- package/package.json +28 -20
- package/dist/components/react/p-0nNMdSBr.js +0 -1
- package/dist/components/react/p-Ny5VnydI.js +0 -1
- package/dist/components/react/p-SBBBSmJM.js +0 -1
- package/dist/post-components/p-29e6c2a4.entry.js +0 -1
- package/dist/post-components/p-3a75186d.entry.js +0 -1
- package/dist/post-components/p-65e12f2c.entry.js +0 -1
- package/dist/post-components/p-795eb5ad.entry.js +0 -1
- package/dist/post-components/p-9ad2216e.entry.js +0 -1
- package/dist/post-components/p-BmpkvdQk.js +0 -1
- package/dist/post-components/p-C-FunIfQ.js +0 -1
- package/dist/post-components/p-CCciE4QO.js +0 -1
- package/dist/post-components/p-D3NdvMgy.js +0 -2
- package/dist/post-components/p-Ny5VnydI.js +0 -1
- package/dist/post-components/p-X1vWfzMK.js +0 -1
- package/dist/post-components/p-cGcyMrvx.js +0 -1
- package/dist/post-components/p-cde00944.entry.js +0 -1
- package/dist/post-components/p-cf7493ab.entry.js +0 -1
- package/dist/post-components/p-ecfc494e.entry.js +0 -1
- package/dist/post-components/p-eda4a376.entry.js +0 -1
|
@@ -14,21 +14,40 @@ import { Host, h } from "@stencil/core";
|
|
|
14
14
|
import { throttle } from "throttle-debounce";
|
|
15
15
|
const MAX_VISIBLE_ITEMS = 6;
|
|
16
16
|
const MEASUREMENT_DEBOUNCE_MS = 50;
|
|
17
|
+
/**
|
|
18
|
+
* @slot home - The content of the root (home) breadcrumb item. Can contain an `<a>` element, so consumers can slot their own routing-aware link instead of relying on the `home-url` prop.
|
|
19
|
+
*/
|
|
17
20
|
export class PostBreadcrumbs {
|
|
18
21
|
constructor() {
|
|
19
22
|
this.debounceUpdateCollapsedItems = throttle(MEASUREMENT_DEBOUNCE_MS, this.updateCollapsedItems.bind(this));
|
|
20
23
|
this.resizeObserver = new ResizeObserver(this.debounceUpdateCollapsedItems);
|
|
21
|
-
this.mutationObserver = new MutationObserver(
|
|
24
|
+
this.mutationObserver = new MutationObserver(() => {
|
|
25
|
+
void this.updateAfterMutation();
|
|
26
|
+
});
|
|
22
27
|
this.loaded = false;
|
|
23
|
-
/**
|
|
28
|
+
/** Whether the consumer slotted their own `<a>` into the `home` slot. When true, `home-url` is not required, since the internal fallback link is not rendered. */
|
|
29
|
+
this.hasSlottedHomeAnchor = false;
|
|
30
|
+
/** Whether the slotted home anchor contains a post-icon. */
|
|
31
|
+
this.hasSlottedHomeIcon = false;
|
|
32
|
+
/** The number of breadcrumb items, counted from the start, moved into the overflow menu. */
|
|
24
33
|
this.collapsed = 0;
|
|
34
|
+
/** Whether the home item is collapsed into its own overflow menu. */
|
|
35
|
+
this.homeCollapsed = false;
|
|
36
|
+
/** Whether the last (selected) item wraps onto multiple lines. */
|
|
37
|
+
this.lastItemWraps = false;
|
|
25
38
|
/** The visible breadcrumb navigation. */
|
|
26
39
|
this.nav = null;
|
|
27
40
|
/** An off-screen copy of the breadcrumb navigation used for measurement. */
|
|
28
41
|
this.hiddenNav = null;
|
|
42
|
+
/**
|
|
43
|
+
* Whether `text-home` content is displayed instead of the home icon, enabling segment specific
|
|
44
|
+
* breadcrumbs (like "Private customers" or "About us").
|
|
45
|
+
*/
|
|
46
|
+
this.homeTextOnly = false;
|
|
29
47
|
}
|
|
30
48
|
componentWillLoad() {
|
|
31
49
|
this.id = this.host.id || `b${nanoid(6)}`;
|
|
50
|
+
this.checkSlottedHomeAnchor();
|
|
32
51
|
}
|
|
33
52
|
async componentDidLoad() {
|
|
34
53
|
this.resizeObserver?.observe(document.body);
|
|
@@ -46,69 +65,95 @@ export class PostBreadcrumbs {
|
|
|
46
65
|
this.mutationObserver?.disconnect();
|
|
47
66
|
this.debounceUpdateCollapsedItems.cancel();
|
|
48
67
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
68
|
+
checkSlottedHomeAnchor() {
|
|
69
|
+
const homeSlotElement = Array.from(this.host.children).find(child => child.getAttribute('slot') === 'home');
|
|
70
|
+
this.hasSlottedHomeAnchor = homeSlotElement?.tagName === 'A';
|
|
71
|
+
this.hasSlottedHomeIcon =
|
|
72
|
+
this.hasSlottedHomeAnchor && !!homeSlotElement?.querySelector('post-icon');
|
|
73
|
+
}
|
|
74
|
+
get usesHomeText() {
|
|
75
|
+
return this.hasSlottedHomeAnchor ? !this.hasSlottedHomeIcon : this.homeTextOnly;
|
|
76
|
+
}
|
|
77
|
+
// Degrade order: collapse middle items -> collapse home -> wrap the last item.
|
|
78
|
+
/** Measures the available space and updates all three degrade-stage states. */
|
|
53
79
|
async updateCollapsedItems() {
|
|
54
80
|
if (!this.nav)
|
|
55
81
|
return;
|
|
56
|
-
|
|
82
|
+
const { overflowing, homeOverflows, lastItemWraps } = await this.calculateCollapsedItems();
|
|
83
|
+
this.collapsed = overflowing;
|
|
84
|
+
this.homeCollapsed = homeOverflows;
|
|
85
|
+
this.lastItemWraps = lastItemWraps;
|
|
57
86
|
}
|
|
58
|
-
/**
|
|
59
|
-
* Determines how many items have to be collapsed, either because they do not fit the breadcrumb
|
|
60
|
-
* navigation or because they exceed the maximum number of visible items.
|
|
61
|
-
*/
|
|
62
87
|
async calculateCollapsedItems() {
|
|
63
88
|
const items = this.host.querySelectorAll('post-breadcrumb-item');
|
|
64
|
-
const overflowing = await this.calculateOverflowingItems();
|
|
89
|
+
const { overflowing, homeOverflows, lastItemWraps } = await this.calculateOverflowingItems();
|
|
65
90
|
// Never show more than `MAX_VISIBLE_ITEMS`, even if the nav is wide enough to fit them all.
|
|
66
|
-
return
|
|
91
|
+
return {
|
|
92
|
+
overflowing: Math.max(overflowing, items.length - MAX_VISIBLE_ITEMS),
|
|
93
|
+
homeOverflows,
|
|
94
|
+
lastItemWraps,
|
|
95
|
+
};
|
|
67
96
|
}
|
|
68
|
-
/**
|
|
69
|
-
* Determines how many items overflow the width of the breadcrumb navigation.
|
|
70
|
-
*/
|
|
97
|
+
/** Runs the three degrade stages in order against the off-screen measurement clone. */
|
|
71
98
|
async calculateOverflowingItems() {
|
|
72
|
-
// Fallback to zero if the hidden nav is not available for measurement.
|
|
73
99
|
if (!this.hiddenNav)
|
|
74
|
-
return 0;
|
|
75
|
-
const
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
//
|
|
81
|
-
|
|
100
|
+
return { overflowing: 0, homeOverflows: false, lastItemWraps: false };
|
|
101
|
+
const nav = this.hiddenNav;
|
|
102
|
+
const availableWidth = nav.clientWidth;
|
|
103
|
+
const gap = Number.parseFloat(getComputedStyle(nav.firstElementChild).gap);
|
|
104
|
+
const menuWidth = nav.querySelector('.menu')?.clientWidth ?? 0;
|
|
105
|
+
const homeWidth = nav.querySelector('.home')?.clientWidth ?? 0;
|
|
106
|
+
// Stage 1: collapse middle items, starting closest to home, until the rest fits.
|
|
107
|
+
const middleItems = Array.from(nav.querySelectorAll('post-breadcrumb-item')).slice(0, -1);
|
|
108
|
+
const { overflowing, remainingWidth } = this.collapseMiddleItems(middleItems, gap, menuWidth, availableWidth);
|
|
109
|
+
// Stage 2: home + last item, single-line. Text home can collapse into the menu, while the
|
|
110
|
+
// icon-only home remains visible and lets the last item wrap instead.
|
|
111
|
+
const homeOverflows = this.usesHomeText && remainingWidth > availableWidth;
|
|
112
|
+
// Stage 3: home joins the existing menu when middle items have collapsed. If no middle item
|
|
113
|
+
// collapsed, the menu needs to be added when home moves into it.
|
|
114
|
+
const widthWithHomeCollapsed = remainingWidth - homeWidth + (overflowing === 0 ? menuWidth : 0);
|
|
115
|
+
const lastItemWraps = this.usesHomeText
|
|
116
|
+
? homeOverflows && widthWithHomeCollapsed > availableWidth
|
|
117
|
+
: remainingWidth > availableWidth;
|
|
118
|
+
return { overflowing, homeOverflows, lastItemWraps };
|
|
119
|
+
}
|
|
120
|
+
/** Stage 1: collapses middle items until the rest fits, or none are left. */
|
|
121
|
+
collapseMiddleItems(items, gap, menuWidth, availableWidth) {
|
|
122
|
+
// Start from the assumption that all items fit and that no menu is shown, so subtract the
|
|
123
|
+
// overflow menu's width from the total.
|
|
124
|
+
let width = this.hiddenNav.scrollWidth - menuWidth + gap;
|
|
82
125
|
let overflowing = 0;
|
|
83
|
-
|
|
84
|
-
while (overflowing < items.length && width > this.hiddenNav.clientWidth) {
|
|
126
|
+
while (overflowing < items.length && width > availableWidth) {
|
|
85
127
|
// The overflow menu needs to be displayed as soon as the first item is moved into it, so its
|
|
86
128
|
// width needs to be taken into account when measuring the remaining items.
|
|
87
129
|
if (overflowing === 0)
|
|
88
|
-
width +=
|
|
130
|
+
width += menuWidth;
|
|
89
131
|
width -= items[overflowing++].clientWidth + gap;
|
|
90
132
|
}
|
|
91
|
-
return overflowing;
|
|
133
|
+
return { overflowing, remainingWidth: width };
|
|
92
134
|
}
|
|
93
|
-
/**
|
|
94
|
-
|
|
95
|
-
*/
|
|
96
|
-
updateItems(items, collapsed) {
|
|
135
|
+
/** Applies the degrade states to the `<post-breadcrumb-item>` elements. */
|
|
136
|
+
updateItems(items, collapsed, lastItemWraps) {
|
|
97
137
|
items.forEach((item, index) => {
|
|
138
|
+
const isLast = index === items.length - 1;
|
|
98
139
|
item.setAttribute('variant', index < collapsed ? 'menuitem' : 'listitem');
|
|
99
|
-
item.setAttribute('selected', String(
|
|
100
|
-
item.setAttribute('standalone', String(
|
|
140
|
+
item.setAttribute('selected', String(isLast));
|
|
141
|
+
item.setAttribute('standalone', String(isLast && index === collapsed && lastItemWraps));
|
|
101
142
|
});
|
|
102
143
|
}
|
|
103
|
-
/**
|
|
104
|
-
* Rebuilds the off-screen copy of the breadcrumb navigation.
|
|
105
|
-
*/
|
|
144
|
+
/** Rebuilds the off-screen copy of the breadcrumb navigation. */
|
|
106
145
|
async updateHiddenNav() {
|
|
107
146
|
this.hiddenNav?.remove();
|
|
108
147
|
this.hiddenNav = await this.renderHiddenNav();
|
|
109
148
|
}
|
|
149
|
+
async updateAfterMutation() {
|
|
150
|
+
await this.updateHiddenNav();
|
|
151
|
+
await this.updateCollapsedItems();
|
|
152
|
+
}
|
|
110
153
|
/**
|
|
111
|
-
* Renders an off-screen copy of the
|
|
154
|
+
* Renders an off-screen copy of the nav for measurements. `.home` is rebuilt independently (see
|
|
155
|
+
* `buildMeasurementHomeElement`) rather than cloned, since the live nav may show the home item
|
|
156
|
+
* in the overflow menu instead if it is already collapsed.
|
|
112
157
|
*/
|
|
113
158
|
async renderHiddenNav() {
|
|
114
159
|
const shadowRoot = this.host.shadowRoot;
|
|
@@ -119,12 +164,29 @@ export class PostBreadcrumbs {
|
|
|
119
164
|
// Deep clone the breadcrumb navigation and flatten its slots into the clone.
|
|
120
165
|
this.nav.querySelectorAll('slot').forEach((source, index) => {
|
|
121
166
|
const target = slots[index];
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
167
|
+
const assignedElements = source.assignedElements();
|
|
168
|
+
if (assignedElements.length > 0) {
|
|
169
|
+
// Insert the assigned elements where the slot used to be, then drop the now empty slot.
|
|
170
|
+
assignedElements.forEach(element => {
|
|
171
|
+
target.insertAdjacentElement('beforebegin', element.cloneNode(true));
|
|
172
|
+
});
|
|
173
|
+
target.remove();
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
// Nothing assigned: keep the slot's own fallback content (e.g. the default home link) by
|
|
177
|
+
// unwrap the <slot> in place, move its children to where it was, then remove it.
|
|
178
|
+
const parent = target.parentNode;
|
|
179
|
+
if (parent) {
|
|
180
|
+
Array.from(target.childNodes).forEach(child => parent.insertBefore(child, target));
|
|
181
|
+
target.remove();
|
|
182
|
+
}
|
|
183
|
+
}
|
|
127
184
|
});
|
|
185
|
+
// Always measure the full, uncollapsed home item — see the method doc above. Uses
|
|
186
|
+
// replaceChild rather than replaceWith, since the latter isn't implemented by Stencil's
|
|
187
|
+
// mock-doc DOM used during SSR/hydration.
|
|
188
|
+
const existingHome = clone.querySelector('.home');
|
|
189
|
+
existingHome?.parentNode?.replaceChild(this.buildMeasurementHomeElement(), existingHome);
|
|
128
190
|
clone.classList.remove('loading');
|
|
129
191
|
clone.classList.add('invisible');
|
|
130
192
|
// Show the overflow menu so that we can include the space it takes up in the measurement.
|
|
@@ -133,20 +195,57 @@ export class PostBreadcrumbs {
|
|
|
133
195
|
// Wait for all items to be fully hydrated before measuring.
|
|
134
196
|
const items = clone.querySelectorAll('post-breadcrumb-item');
|
|
135
197
|
await Promise.all(Array.from(items).map(item => componentOnReady(item)));
|
|
136
|
-
//
|
|
137
|
-
this.updateItems(items, 0);
|
|
198
|
+
// Uncollapsed layout, both single-line, for measurement.
|
|
199
|
+
this.updateItems(items, 0, false);
|
|
138
200
|
return clone;
|
|
139
201
|
}
|
|
202
|
+
/** Builds `.home` in its full, uncollapsed form for measurement. Mirrors `renderHomeContent`, but as plain DOM since this runs outside the render cycle. */
|
|
203
|
+
buildMeasurementHomeElement() {
|
|
204
|
+
const home = document.createElement('div');
|
|
205
|
+
home.className = `breadcrumb-item home${this.usesHomeText ? '' : ' icon'}`;
|
|
206
|
+
home.setAttribute('role', 'listitem');
|
|
207
|
+
const slottedAnchor = this.hasSlottedHomeAnchor
|
|
208
|
+
? Array.from(this.host.children).find(child => child.getAttribute('slot') === 'home')
|
|
209
|
+
: null;
|
|
210
|
+
if (slottedAnchor) {
|
|
211
|
+
home.append(slottedAnchor.cloneNode(true));
|
|
212
|
+
return home;
|
|
213
|
+
}
|
|
214
|
+
const anchor = document.createElement('a');
|
|
215
|
+
if (this.homeUrl)
|
|
216
|
+
anchor.href = this.homeUrl;
|
|
217
|
+
const label = document.createElement('span');
|
|
218
|
+
if (!this.usesHomeText)
|
|
219
|
+
label.className = 'visually-hidden';
|
|
220
|
+
label.textContent = this.textHome;
|
|
221
|
+
anchor.append(label);
|
|
222
|
+
if (!this.usesHomeText) {
|
|
223
|
+
const icon = document.createElement('post-icon');
|
|
224
|
+
icon.setAttribute('aria-hidden', 'true');
|
|
225
|
+
icon.setAttribute('name', 'home');
|
|
226
|
+
anchor.append(icon);
|
|
227
|
+
}
|
|
228
|
+
home.append(anchor);
|
|
229
|
+
return home;
|
|
230
|
+
}
|
|
140
231
|
renderMenu() {
|
|
141
232
|
const menuId = `${this.id}-menu`;
|
|
142
|
-
return (h("div", { class: `breadcrumb-item menu ${this.collapsed === 0 ? 'empty' : ''}`, role: "listitem" }, h("post-menu-trigger", { for: menuId }, h("button", null, h("span", { class: "visually-hidden" }, this.textMoreItems), h("span", { "aria-hidden": "true" }, "..."))), h("post-menu", { id: menuId, label: this.textMoreItems, placement: "bottom-start" }, h("slot", { name: "menu" }))));
|
|
233
|
+
return (h("div", { class: `breadcrumb-item menu ${this.collapsed === 0 && !this.homeCollapsed ? 'empty' : ''}`, role: "listitem" }, h("post-menu-trigger", { for: menuId }, h("button", null, h("span", { class: "visually-hidden" }, this.textMoreItems), h("span", { "aria-hidden": "true" }, "..."))), h("post-menu", { id: menuId, label: this.textMoreItems, placement: "bottom-start" }, this.homeCollapsed && this.usesHomeText && (h("post-menu-item", null, this.renderHomeContent())), h("slot", { name: "menu" }))));
|
|
234
|
+
}
|
|
235
|
+
/** Reused by the plain home item and the home menu — a slot can only be assigned once. */
|
|
236
|
+
renderHomeContent() {
|
|
237
|
+
return (h("slot", { name: "home", onSlotchange: () => this.checkSlottedHomeAnchor() }, h("a", { href: this.homeUrl }, h("span", { class: this.usesHomeText ? undefined : 'visually-hidden' }, this.textHome), !this.usesHomeText && h("post-icon", { "aria-hidden": "true", name: "home" }))));
|
|
238
|
+
}
|
|
239
|
+
/** Degrade stage 2: home renders in full, single-line, not yet collapsed. */
|
|
240
|
+
renderHome() {
|
|
241
|
+
return (h("div", { class: `breadcrumb-item home${this.usesHomeText ? '' : ' icon'}`, role: "listitem" }, this.renderHomeContent()));
|
|
143
242
|
}
|
|
144
243
|
render() {
|
|
145
244
|
if (this.loaded) {
|
|
146
245
|
const items = this.host.querySelectorAll('post-breadcrumb-item');
|
|
147
|
-
this.updateItems(items, this.collapsed);
|
|
246
|
+
this.updateItems(items, this.collapsed, this.lastItemWraps);
|
|
148
247
|
}
|
|
149
|
-
return (h(Host, { key: '
|
|
248
|
+
return (h(Host, { key: '8d5f457a7c6a2df0cfaf5c31f3ffc6937de76e57', "data-version": version, class: this.homeCollapsed && this.usesHomeText ? 'home-collapsed' : undefined }, h("nav", { key: 'ce3fd7ad69060dd6968afaad6170e27eee72682f', "aria-label": this.textBreadcrumbs, ref: el => (this.nav = el), class: this.loaded ? '' : 'loading' }, h("div", { key: '1c400c8c1e1b625203876cc9804936782a2202c6', role: "list" }, (!this.homeCollapsed || !this.usesHomeText) && this.renderHome(), this.renderMenu(), h("slot", { key: '5cf6618b487961c0e7d70637f5396d023660ec55' }), h("slot", { key: 'f4fb662d04d9966c76a22444844d692611472b2d', name: "selected" })))));
|
|
150
249
|
}
|
|
151
250
|
static get is() { return "post-breadcrumbs"; }
|
|
152
251
|
static get encapsulation() { return "shadow"; }
|
|
@@ -170,8 +269,8 @@ export class PostBreadcrumbs {
|
|
|
170
269
|
"resolved": "string",
|
|
171
270
|
"references": {}
|
|
172
271
|
},
|
|
173
|
-
"required":
|
|
174
|
-
"optional":
|
|
272
|
+
"required": false,
|
|
273
|
+
"optional": true,
|
|
175
274
|
"docs": {
|
|
176
275
|
"tags": [],
|
|
177
276
|
"text": "The URL for the root (home) breadcrumb item."
|
|
@@ -189,17 +288,37 @@ export class PostBreadcrumbs {
|
|
|
189
288
|
"resolved": "string",
|
|
190
289
|
"references": {}
|
|
191
290
|
},
|
|
192
|
-
"required":
|
|
193
|
-
"optional":
|
|
291
|
+
"required": false,
|
|
292
|
+
"optional": true,
|
|
194
293
|
"docs": {
|
|
195
294
|
"tags": [],
|
|
196
|
-
"text": "
|
|
295
|
+
"text": "The label of the root (home) breadcrumb item. Displayed visibly when `home-text-only` is\n`true`, otherwise used as an accessible label alongside the home icon."
|
|
197
296
|
},
|
|
198
297
|
"getter": false,
|
|
199
298
|
"setter": false,
|
|
200
299
|
"reflect": true,
|
|
201
300
|
"attribute": "text-home"
|
|
202
301
|
},
|
|
302
|
+
"homeTextOnly": {
|
|
303
|
+
"type": "boolean",
|
|
304
|
+
"mutable": false,
|
|
305
|
+
"complexType": {
|
|
306
|
+
"original": "boolean",
|
|
307
|
+
"resolved": "boolean",
|
|
308
|
+
"references": {}
|
|
309
|
+
},
|
|
310
|
+
"required": false,
|
|
311
|
+
"optional": false,
|
|
312
|
+
"docs": {
|
|
313
|
+
"tags": [],
|
|
314
|
+
"text": "Whether `text-home` content is displayed instead of the home icon, enabling segment specific\nbreadcrumbs (like \"Private customers\" or \"About us\")."
|
|
315
|
+
},
|
|
316
|
+
"getter": false,
|
|
317
|
+
"setter": false,
|
|
318
|
+
"reflect": true,
|
|
319
|
+
"attribute": "home-text-only",
|
|
320
|
+
"defaultValue": "false"
|
|
321
|
+
},
|
|
203
322
|
"textBreadcrumbs": {
|
|
204
323
|
"type": "string",
|
|
205
324
|
"mutable": false,
|
|
@@ -244,19 +363,27 @@ export class PostBreadcrumbs {
|
|
|
244
363
|
return {
|
|
245
364
|
"id": {},
|
|
246
365
|
"loaded": {},
|
|
247
|
-
"
|
|
366
|
+
"hasSlottedHomeAnchor": {},
|
|
367
|
+
"hasSlottedHomeIcon": {},
|
|
368
|
+
"collapsed": {},
|
|
369
|
+
"homeCollapsed": {},
|
|
370
|
+
"lastItemWraps": {}
|
|
248
371
|
};
|
|
249
372
|
}
|
|
250
373
|
static get elementRef() { return "host"; }
|
|
251
374
|
}
|
|
252
375
|
__decorate([
|
|
253
|
-
Required(),
|
|
376
|
+
Required({ when: 'hasSlottedHomeAnchor', truthy: false }),
|
|
254
377
|
Url()
|
|
255
378
|
], PostBreadcrumbs.prototype, "homeUrl", void 0);
|
|
256
379
|
__decorate([
|
|
257
|
-
Required(),
|
|
380
|
+
Required({ when: 'hasSlottedHomeAnchor', truthy: false }),
|
|
258
381
|
Type('string')
|
|
259
382
|
], PostBreadcrumbs.prototype, "textHome", void 0);
|
|
383
|
+
__decorate([
|
|
384
|
+
Required(),
|
|
385
|
+
Type('boolean')
|
|
386
|
+
], PostBreadcrumbs.prototype, "homeTextOnly", void 0);
|
|
260
387
|
__decorate([
|
|
261
388
|
Required(),
|
|
262
389
|
Type('string')
|
|
@@ -59,7 +59,7 @@ export class PostClosebutton {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
render() {
|
|
62
|
-
return (h(Host, { key: '
|
|
62
|
+
return (h(Host, { key: 'b8e2214b904f5167fa3753aab947418891236fcf', "data-version": version }, h("button", { key: '224ca42d3be187062ba9717e4a534ff34eeafaf7', type: this.buttonType, class: "btn btn-icon btn-secondary btn-sm", onClick: this.handleClick }, h("post-icon", { key: '5b289691599d6f9a3bb0fa7a28c71eecd1f5aee7', "aria-hidden": "true", name: "closex" }), h("span", { key: 'e22045f15b3dc8b8b228eb4282114e10db68b186', ref: el => (this.visuallyHidden = el), class: "visually-hidden" }, h("slot", { key: 'e492390c995a993ffc8988a1c90a41e59fbe39f5' })))));
|
|
63
63
|
}
|
|
64
64
|
static get is() { return "post-closebutton"; }
|
|
65
65
|
static get encapsulation() { return "shadow"; }
|
|
@@ -66,7 +66,7 @@ export class PostCollapsible {
|
|
|
66
66
|
triggers.forEach(trigger => trigger.update());
|
|
67
67
|
}
|
|
68
68
|
render() {
|
|
69
|
-
return (h(Host, { key: '
|
|
69
|
+
return (h(Host, { key: '243dad696871a08bc07325d4511f5baeb937c194', "data-version": version, tabindex: this.collapsed ? -1 : undefined, style: this.collapsed ? collapsedKeyframe : undefined }, h("slot", { key: '5f4f8a9bb698f6558b114c760e5eeb355ac35b80' })));
|
|
70
70
|
}
|
|
71
71
|
static get is() { return "post-collapsible"; }
|
|
72
72
|
static get encapsulation() { return "shadow"; }
|
|
@@ -59,7 +59,7 @@ export class PostCollapsibleTrigger {
|
|
|
59
59
|
if (!this.trigger || !collapsible)
|
|
60
60
|
return;
|
|
61
61
|
// a nested collapsible may have no id, but aria-controls needs one to reference
|
|
62
|
-
collapsible.id
|
|
62
|
+
collapsible.id ||= `collapsible-${crypto.randomUUID()}`;
|
|
63
63
|
const collapsibleId = collapsible.id;
|
|
64
64
|
// add the controlled collapsible's id to the aria-controls list
|
|
65
65
|
const ariaControls = this.trigger.getAttribute('aria-controls');
|
|
@@ -106,7 +106,7 @@ export class PostCollapsibleTrigger {
|
|
|
106
106
|
this.updateAriaAttributes();
|
|
107
107
|
}
|
|
108
108
|
render() {
|
|
109
|
-
return (h(Host, { key: '
|
|
109
|
+
return (h(Host, { key: '4d28c7068acd2e1b4a5f2272bee3b51ec5d8a216', "data-version": version }, h("slot", { key: '0bcbb780ed6d06ef36b9129b22b4a5dcd5aa7294' })));
|
|
110
110
|
}
|
|
111
111
|
static get is() { return "post-collapsible-trigger"; }
|
|
112
112
|
static get encapsulation() { return "shadow"; }
|
|
@@ -4,7 +4,7 @@ import { HTMLInputMaskElement } from "imask";
|
|
|
4
4
|
// environments (e.g. Next.js pre-rendering) with `HTMLInputElement is not defined`.
|
|
5
5
|
let cachedNativeValueDescriptor;
|
|
6
6
|
function nativeValueDescriptor() {
|
|
7
|
-
cachedNativeValueDescriptor
|
|
7
|
+
cachedNativeValueDescriptor ??= Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
|
|
8
8
|
return cachedNativeValueDescriptor;
|
|
9
9
|
}
|
|
10
10
|
// iMask adapter that bypasses the instance-level `input.value` override (which returns ISO strings)
|
|
@@ -9,7 +9,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
9
9
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10
10
|
};
|
|
11
11
|
import { getNativeValue, NativeInputMaskElement, } from "./native-mask-element";
|
|
12
|
-
import { BUDDHIST_CALENDAR_LOCALES, DateValue, FALLBACK_LANGUAGE_CODE, getLocaleTextDirection, IsoDate, isValidLocale, Required, Type, UNICODE_BIDI, } from "../../utils/index";
|
|
12
|
+
import { BUDDHIST_CALENDAR_LOCALES, DateValue, FALLBACK_LANGUAGE_CODE, getFocusableChildren, getLocaleTextDirection, IsoDate, isValidLocale, Required, Type, UNICODE_BIDI, } from "../../utils/index";
|
|
13
13
|
import { version } from "../../../../package";
|
|
14
14
|
import { Build, h, Host } from "@stencil/core";
|
|
15
15
|
import AirDatepicker from "air-datepicker";
|
|
@@ -90,32 +90,31 @@ export class PostDatePicker {
|
|
|
90
90
|
this.skipFocusOnNextRender = true;
|
|
91
91
|
};
|
|
92
92
|
/**
|
|
93
|
-
*
|
|
93
|
+
* Traps focus inside the calendar popover (not used in inline mode) by always taking over Tab handling,
|
|
94
|
+
* so focus can't escape even while a grid cell is briefly untabbable mid-render.
|
|
94
95
|
*/
|
|
95
96
|
this.handleTab = (e) => {
|
|
96
97
|
if (this.inline || (e.key !== 'Tab' && e.key !== 'Escape'))
|
|
97
98
|
return;
|
|
98
|
-
//
|
|
99
|
+
// Explicitly close the popover on Escape
|
|
99
100
|
if (e.key === 'Escape') {
|
|
101
|
+
this.popoverRef?.hide();
|
|
100
102
|
this.dpInput.focus();
|
|
103
|
+
return;
|
|
101
104
|
}
|
|
105
|
+
const focusable = getFocusableChildren(this.dpContainer);
|
|
106
|
+
if (focusable.length === 0)
|
|
107
|
+
return;
|
|
102
108
|
const active = this.host.shadowRoot.activeElement;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
if (this.currentViewType === 'years') {
|
|
113
|
-
this.prevBtn.focus();
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
this.titleBtn.focus();
|
|
117
|
-
}
|
|
118
|
-
}
|
|
109
|
+
const activeIndex = focusable.indexOf(active);
|
|
110
|
+
// Focus is outside the tracked elements, let the browser handle it
|
|
111
|
+
if (activeIndex === -1)
|
|
112
|
+
return;
|
|
113
|
+
e.preventDefault();
|
|
114
|
+
const nextIndex = e.shiftKey
|
|
115
|
+
? (activeIndex - 1 + focusable.length) % focusable.length
|
|
116
|
+
: (activeIndex + 1) % focusable.length;
|
|
117
|
+
focusable[nextIndex].focus();
|
|
119
118
|
};
|
|
120
119
|
/**
|
|
121
120
|
* Handle keyboard/arrow navigation within the grid
|
|
@@ -288,6 +287,15 @@ export class PostDatePicker {
|
|
|
288
287
|
console.error('hide: popoverRef is null or undefined');
|
|
289
288
|
}
|
|
290
289
|
}
|
|
290
|
+
static { this.FLYOUT_OFFSET = 4; }
|
|
291
|
+
// Cells per row for each view
|
|
292
|
+
static {
|
|
293
|
+
this.COLUMNS_BY_VIEW = {
|
|
294
|
+
days: 7,
|
|
295
|
+
months: 4,
|
|
296
|
+
years: 4,
|
|
297
|
+
};
|
|
298
|
+
}
|
|
291
299
|
/**
|
|
292
300
|
* Get the system locale (e.g.`en`, etc.) from the closest parent with a `lang` attribute,
|
|
293
301
|
* or fallback to a default language code if not found or in server environment.
|
|
@@ -406,7 +414,8 @@ export class PostDatePicker {
|
|
|
406
414
|
if (this.currentViewType === 'days') {
|
|
407
415
|
target = cells.find(cell => Number(cell.dataset.date) === date.getDate() &&
|
|
408
416
|
Number(cell.dataset.month) === date.getMonth() &&
|
|
409
|
-
Number(cell.dataset.year) === date.getFullYear()
|
|
417
|
+
Number(cell.dataset.year) === date.getFullYear() &&
|
|
418
|
+
!cell.classList.contains('-other-month-'));
|
|
410
419
|
if (!target) {
|
|
411
420
|
const firstOfMonth = new Date(this.currentViewYear, this.currentViewMonth, 1);
|
|
412
421
|
target = cells.find(cell => Number(cell.dataset.date) === 1 &&
|
|
@@ -920,11 +929,11 @@ export class PostDatePicker {
|
|
|
920
929
|
}
|
|
921
930
|
}
|
|
922
931
|
render() {
|
|
923
|
-
return (h(Host, { key: '
|
|
932
|
+
return (h(Host, { key: '82e70130d0c36d6a9e2853f888c951003173e604', "data-version": version }, this.inline && (h("div", { key: '381b59d3883702ede832953b3ed21cc4854c47b1', dir: this.textDirection }, h("slot", { key: '1e65fa64a68c17158c8e685eada731577135bca6' }), h("div", { key: '80b5019c11342d96af121f32056914011fe17b48', class: "datepicker-container" }))), !this.inline && (h("div", { key: 'c1df49006815f33d4d300601a3a37b8f1b269acb', dir: this.textDirection }, h("div", { key: '787df4c64b0e2d8866bd299273d511d7d20c864e', class: {
|
|
924
933
|
'calendar-input': !this.range,
|
|
925
934
|
'calendar-input-range': this.range,
|
|
926
935
|
'disabled': this.inputDisabled,
|
|
927
|
-
} }, h("slot", { key: '
|
|
936
|
+
} }, h("slot", { key: '211f54096096e6a3d59d55c59c27d6e131fe9845' }), h("button", { key: 'b78245344a1c4c6424624c29de85a9edb3c2c302', onClick: () => this.show(), "aria-haspopup": "true", "aria-label": this.textToggleCalendar, disabled: this.inputDisabled, ref: e => (this.dpTrigger = e) }, h("post-icon", { key: '9c9e3e309bce3f8464cf91882b39b2aa1277a8ba', name: "calendar" }))), h("post-popovercontainer", { key: '35efc5f0e5582d5e5edf0a945288f2dacf824bf9', placement: "bottom-end", offset: PostDatePicker.FLYOUT_OFFSET, ref: e => (this.popoverRef = e) }, h("div", { key: 'f5a464e97c4bc99be88da2461fa089948bdb16bd', class: "datepicker-container" }))))));
|
|
928
937
|
}
|
|
929
938
|
static get is() { return "post-date-picker"; }
|
|
930
939
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1282,13 +1291,6 @@ export class PostDatePicker {
|
|
|
1282
1291
|
}];
|
|
1283
1292
|
}
|
|
1284
1293
|
}
|
|
1285
|
-
PostDatePicker.FLYOUT_OFFSET = 4;
|
|
1286
|
-
// Cells per row for each view
|
|
1287
|
-
PostDatePicker.COLUMNS_BY_VIEW = {
|
|
1288
|
-
days: 7,
|
|
1289
|
-
months: 4,
|
|
1290
|
-
years: 4,
|
|
1291
|
-
};
|
|
1292
1294
|
__decorate([
|
|
1293
1295
|
DateValue(),
|
|
1294
1296
|
IsoDate()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:host{display:block}footer{--post-footer-container-padding-inline: 16px;--post-footer-container-max-width: 1200px;--post-footer-prefooter-padding-block: 16px;--post-footer-grid-template: auto / auto;--post-footer-grid-padding-block: 32px;--post-footer-column-flex-direction: column;--post-footer-column-align-items: start;--post-footer-column-gap: 0;--post-footer-list-flex-direction: column;--post-footer-list-gap: 8px;--post-footer-list-align-items: start;--post-footer-socialmedia-padding-block: 16px;--post-footer-app-padding-block: var(--post-footer-socialmedia-padding-block);--post-footer-businesssectors-padding-block: var(--post-footer-socialmedia-padding-block);--post-footer-base-padding-block: var(--post-footer-socialmedia-padding-block);--post-footer-base-gap: 8px;--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-prefooter-padding-block: 32px;--post-footer-grid-template: repeat(2, auto) / repeat(2, auto);--post-footer-list-flex-direction: row;--post-footer-list-gap: 16px;--post-footer-list-align-items: center;--post-footer-base-gap: 4px}}@media screen and (min-width: 780px){footer{--post-footer-container-padding-inline: 40px;--post-footer-grid-padding-block: 48px;--post-footer-socialmedia-padding-block: 24px}}@media screen and (min-width: 1024px){footer{--post-footer-grid-template: auto / repeat(4, auto);--post-footer-column-flex-direction: row;--post-footer-column-align-items: center;--post-footer-column-gap: 32px;--post-footer-list-gap: 24px;--post-footer-meta-font-size: 16px}}:is(h3,.h3){margin:0;font-size:var(--post-device-font-size-6);line-height:var(--post-device-line-height-heading);font-weight:var(--post-device-font-weight-extra-black);text-wrap:balance}::slotted(ul){list-style:none;padding:0;margin:0}.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-inline:var(--post-footer-container-padding-inline);max-width:var(--post-footer-container-max-width)}.prefooter{background-color:#fafafa;border-block-start:1px solid #373632;padding-block:var(--post-footer-prefooter-padding-block)}.prefooter .footer-container{padding-block:0}.footer-main{background-color:#fc0;border-block-start:1px solid #373632}.prefooter:not(.d-none)+.footer-main{border-block-start:unset}.footer-grid{display:grid;grid-template:var(--post-footer-grid-template);gap:32px 24px;padding-block:var(--post-footer-grid-padding-block)}.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(div),.footer-app ::slotted(div),.footer-meta ::slotted(div){display:flex !important;flex-direction:var(--post-footer-list-flex-direction) !important;gap:var(--post-footer-list-gap) !important;align-items:var(--post-footer-list-align-items) !important}.footer-socialmedia{padding-block:var(--post-footer-socialmedia-padding-block)}.footer-app{padding-block:var(--post-footer-app-padding-block)}.prefooter ::slotted(div),.footer-businesssectors ::slotted(div){display:flex;flex-wrap:wrap;align-items:center;gap:var(--post-footer-list-gap) !important}.footer-businesssectors{padding-block:var(--post-footer-businesssectors-padding-block)}.footer-base{background-color:#fc0;border-block-start:1px solid #373632;padding-block:var(--post-footer-base-padding-block);gap:var(--post-footer-base-gap)}.footer-meta{font-size:var(--post-footer-meta-font-size)}.footer-copyright{display:flex;flex-wrap:wrap;column-gap:8px;font-size:var(--post-footer-copyright-font-size)}.d-none{display:none}
|
|
1
|
+
:host{display:block}footer{--post-footer-container-padding-inline: 16px;--post-footer-container-max-width: 1200px;--post-footer-prefooter-padding-block: 16px;--post-footer-grid-template: auto / auto;--post-footer-grid-padding-block: 32px;--post-footer-column-flex-direction: column;--post-footer-column-align-items: start;--post-footer-column-gap: 0;--post-footer-list-flex-direction: column;--post-footer-list-gap: 8px;--post-footer-list-align-items: start;--post-footer-socialmedia-padding-block: 16px;--post-footer-app-padding-block: var(--post-footer-socialmedia-padding-block);--post-footer-businesssectors-padding-block: var(--post-footer-socialmedia-padding-block);--post-footer-base-padding-block: var(--post-footer-socialmedia-padding-block);--post-footer-base-gap: 8px;--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-prefooter-padding-block: 32px;--post-footer-grid-template: repeat(2, auto) / repeat(2, auto);--post-footer-list-flex-direction: row;--post-footer-list-gap: 16px;--post-footer-list-align-items: center;--post-footer-base-gap: 4px}}@media screen and (min-width: 780px){footer{--post-footer-container-padding-inline: 40px;--post-footer-grid-padding-block: 48px;--post-footer-socialmedia-padding-block: 24px}}@media screen and (min-width: 1024px){footer{--post-footer-grid-template: auto / repeat(4, auto);--post-footer-column-flex-direction: row;--post-footer-column-align-items: center;--post-footer-column-gap: 32px;--post-footer-list-gap: 24px;--post-footer-meta-font-size: 16px}}:is(h3,.h3){margin:0;font-size:var(--post-device-font-size-6);line-height:var(--post-device-line-height-heading);font-weight:var(--post-device-font-weight-extra-black);text-wrap:balance}::slotted(ul){list-style:none;padding:0;margin:0}.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-inline:var(--post-footer-container-padding-inline);max-width:var(--post-footer-container-max-width)}.prefooter{background-color:#fafafa;border-block-start:1px solid #373632;padding-block:var(--post-footer-prefooter-padding-block)}.prefooter .footer-container{padding-block:0}.footer-main{background-color:#fc0;border-block-start:1px solid #373632}.prefooter:not(.d-none)+.footer-main{border-block-start:unset}.footer-grid{display:grid;grid-template:var(--post-footer-grid-template);gap:32px 24px;padding-block:var(--post-footer-grid-padding-block)}.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(div),.footer-app ::slotted(div),.footer-meta ::slotted(div){display:flex !important;flex-direction:var(--post-footer-list-flex-direction) !important;gap:var(--post-footer-list-gap) !important;align-items:var(--post-footer-list-align-items) !important}.footer-socialmedia{padding-block:var(--post-footer-socialmedia-padding-block)}.footer-app{padding-block:var(--post-footer-app-padding-block)}.prefooter ::slotted(div),.footer-businesssectors ::slotted(div){display:flex;flex-wrap:wrap;align-items:center;gap:var(--post-footer-list-gap) !important}.footer-businesssectors{padding-block:var(--post-footer-businesssectors-padding-block)}.footer-base{background-color:#fc0;border-block-start:1px solid #373632;padding-block-start:var(--post-footer-base-padding-block);padding-block-end:max(var(--post-footer-base-padding-block), env(safe-area-inset-bottom, 0px));gap:var(--post-footer-base-gap)}.footer-meta{font-size:var(--post-footer-meta-font-size)}.footer-copyright{display:flex;flex-wrap:wrap;column-gap:8px;font-size:var(--post-footer-copyright-font-size)}.d-none{display:none}
|
|
@@ -81,10 +81,10 @@ export class PostFooter {
|
|
|
81
81
|
const allGridSlotsEmpty = GRID_SLOTS.every(slotName => !this.slotDisplayed[slotName]);
|
|
82
82
|
const renderMain = !allGridSlotsEmpty || renderSocialmedia || renderApp || renderBusinesssectors;
|
|
83
83
|
const renderBase = renderCopyright || renderMeta;
|
|
84
|
-
return (h(Host, { key: '
|
|
84
|
+
return (h(Host, { key: '08a1ce26926dace6b5b58df118007107c971221e', "data-version": version, "data-color-scheme": "light" }, h("footer", { key: 'bcc5101df4f8e203fdba9075e34b7aa125eb53ce' }, h("h2", { key: 'a8efa01756ea699f5f66346e3cfe05cc56f36264', class: "visually-hidden" }, this.textFooter), h("div", { key: '1b8e30a01c3f0a711f0351b36d396f90511154c4', class: { 'prefooter': true, 'd-none': !renderPrefooter } }, h("div", { key: '2c900ed450bc1dc5ad655d35f5f50b1b5a268fec', class: "footer-container" }, h("slot", { key: '8ab8cef6c639251543c65ed21a1f14adf043029e', onSlotchange: this.handleSlotChange, name: "prefooter" }))), h("div", { key: 'e3f3bedd9725968fbce6e887e22842a7e8e5ffa5', class: { 'footer-main': true, 'd-none': !renderMain } }, h("div", { key: '76cec7363e3771da636a6c0a32afbf16d5c4d405', class: "footer-container" }, h("div", { key: '4e9ea3788103175b48839b6bf815d4c675769c97', class: { 'footer-grid': true, 'd-none': allGridSlotsEmpty } }, this.device === 'mobile' ? this.renderAccordion() : this.renderColumns()), h("div", { key: '64d10c9fb543290e078f7fff098b401926b3bf4b', class: {
|
|
85
85
|
'footer-column': true,
|
|
86
86
|
'd-none': !renderSocialmedia && !renderApp,
|
|
87
|
-
} }, h("div", { key: '
|
|
87
|
+
} }, h("div", { key: '05b566b43e2c4fed2919e3312a718ea392cad0f7', class: { 'footer-socialmedia': true, 'd-none': !renderSocialmedia } }, h("slot", { key: 'a46f739c9d4b6cbf96988f96f89d7cc093797b40', onSlotchange: this.handleSlotChange, name: "socialmedia" })), h("div", { key: 'f28490dfaa982a609ba1eb393339980a358488e5', class: { 'footer-app': true, 'd-none': !renderApp } }, h("slot", { key: '01c10bf12eb2f39a0dbceec320b476041d46c631', onSlotchange: this.handleSlotChange, name: "app" }))), h("div", { key: '609935b6b6ee48176d7e44919726abdaff8e6161', class: { 'footer-businesssectors': true, 'd-none': !renderBusinesssectors } }, h("slot", { key: '9f153ba54a08d48e55644fe58089ed7122c1cfdd', onSlotchange: this.handleSlotChange, name: "businesssectors" })))), h("div", { key: '03fd76b711b9d9f1f912ac7a4199ee2706bd3a9a', class: { 'footer-base': true, 'd-none': !renderBase } }, h("div", { key: '3eb810a55e3193295f8b9291bd824af77a5a2fac', class: "footer-container" }, h("div", { key: '04c38d8d5e483b9f9cc8acca1cc8224e381651f1', class: { 'footer-copyright': true, 'd-none': !renderCopyright } }, h("slot", { key: 'fdd11e63af64161288533c21ea455f3513ac7d87', onSlotchange: this.handleSlotChange, name: "copyright" })), h("div", { key: 'adffa17e5f3b94af32e489d113afd9908e2b7abf', class: { 'footer-meta': true, 'd-none': !renderMeta } }, h("slot", { key: '7ebaf69055332d184b86a58e57db1c214b5f08c6', onSlotchange: this.handleSlotChange, name: "meta" })))))));
|
|
88
88
|
}
|
|
89
89
|
static get is() { return "post-footer"; }
|
|
90
90
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:host{--post-global-header-top: calc( var(--post-global-header-reduced-height) - var(--post-global-header-expanded-height) );--post-header-top: calc(var(--post-header-reduced-height) - var(--post-header-expanded-height));--post-logo-height: calc( var(--post-global-header-expanded-height) - var(--post-header-scroll-top, 0px) );--post-global-controls-top: clamp( /* 0 when header is static, large negative when header shrinks to enable offset */ 1000 * (var(--post-global-header-reduced-height) - var(--post-global-header-expanded-height)), calc( -1 * min(var(--post-header-scroll-top, 0px) / 4, var(--post-global-header-reduced-height)) ), 0px )}@media screen and (min-width: 1024px){:host{--post-header-gap: 8px;--post-global-header-padding-inline-start: 4px;--post-global-header-padding-inline-end: 8px;--post-local-header-padding-inline-start: 12px;--post-local-header-padding-inline-end: 8px}}@media screen and (min-width: 600px)and (max-width: 1023.98px){:host{--post-header-gap: 12px 8px;--post-global-header-padding-inline-start: 4px;--post-global-header-padding-inline-end: 4px;--post-local-header-padding-inline-start: 12px;--post-local-header-padding-inline-end: 4px;--post-local-header-padding-block: 12px;--post-burger-menu-padding-inline: 40px;--post-burger-menu-body-gap: 32px;--post-burger-menu-footer-gap: 24px}}@media screen and (min-width: 600px)and (max-width: 779.98px){:host{--post-burger-menu-padding-inline: 16px}}@media screen and (min-width: 0)and (max-width: 599.98px){:host{--post-header-gap: 12px 8px;--post-global-header-padding-inline-start: 0px;--post-global-header-padding-inline-end: 8px;--post-local-header-padding-inline-start: 8px;--post-local-header-padding-inline-end: 8px;--post-local-header-padding-block: 8px;--post-burger-menu-padding-inline: 16px;--post-burger-menu-body-gap: 24px;--post-burger-menu-footer-gap: 16px}}:host(:not([full-width])),:host([full-width=false]){--post-header-content-max-width: 1440px}:host([data-expanded]),:host([data-menu-extended]){--post-header-top: 0;--post-global-header-top: -0.001px;--post-global-controls-top: 0;--post-global-header-reduced-height: var(--post-global-header-expanded-height)}*,::before,::after{box-sizing:border-box}:host,header,.global-header,.local-header{transition:inset-block-start 150ms cubic-bezier(0.4, 0, 0.2, 1)}.section,.sliding-controls{display:flex;align-items:center;justify-content:space-between;gap:var(--post-header-gap);flex-wrap:wrap}.section{max-width:var(--post-header-content-max-width);margin-inline:auto}:host{display:block;position:sticky;inset-block-start:var(--post-header-top);z-index:1020;box-shadow:var(--post-device-elevation-300)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host{border-bottom:1px solid}}.global-header{z-index:2;position:sticky;inset-block-start:var(--post-global-header-top);background-color:#fc0}.global-header .section{height:var(--post-global-header-expanded-height);padding-inline-start:var(--post-global-header-padding-inline-start);padding-inline-end:var(--post-global-header-padding-inline-end)}.global-header .logo{align-self:flex-end;width:var(--post-global-header-expanded-height);height:var(--post-logo-height);min-height:var(--post-global-header-reduced-height);max-height:100%;margin-inline-end:calc(20px - var(--post-header-gap));margin-inline-start:clamp(var(--post-logo-expanded-offset),var(--post-logo-expanded-offset) + (var(--post-logo-reduced-offset) - var(--post-logo-expanded-offset))*min(var(--post-header-scroll-top, 0px),var(--post-global-header-expanded-height) - var(--post-global-header-reduced-height))/max(1px,var(--post-global-header-expanded-height) - var(--post-global-header-reduced-height)),var(--post-logo-reduced-offset))}.global-header .sliding-controls{flex-grow:1;justify-content:flex-end;position:relative;inset-block-start:var(--post-global-controls-top)}.global-header .audience{margin-inline-end:auto}@media screen and (max-width: 1023.98px){.global-header slot:where([name=audience],[name=global-nav-secondary]){display:none}}.local-header{position:relative;background-color:#fff;min-height:var(--post-local-header-expanded-min-height);display:var(--post-local-header-display, flex);align-items:var(--post-local-header-align-items, center)}.local-header .section{width:100%;padding-inline-start:var(--post-local-header-padding-inline-start);padding-inline-end:var(--post-local-header-padding-inline-end);padding-block:var(--post-local-header-padding-block)}@media screen and (min-width: 1024px){.local-header .section{display:grid;grid-template:var(--post-local-header-grid-template)}}@media screen and (max-width: 1023.98px){.local-header .section{display:flex;align-self:center}}@media screen and (max-width: 1023.98px)and (max-width: 599.98px){.local-header .section{justify-content:end}}.local-header:where(.megadropdown-open)::after,.local-header:has(~.burger-menu.extended)::after{content:"";display:block;position:absolute;inset-inline:0;inset-block-end:0;height:1px;background-color:#e1e0dc}.local-header .local-nav{flex:0 0 auto}@media screen and (max-width: 1023.98px){.local-header slot[name=main-nav]{display:none}}.burger-button{display:inline-flex;position:relative;align-items:center;justify-content:center;max-width:100%;overflow:hidden;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;border-width:var(--post-device-border-width-default);border-style:solid;border-color:rgba(0,0,0,0);border-radius:var(--post-device-border-radius-round);background-color:rgba(0,0,0,0);box-shadow:none;font-family:inherit;font-size:var(--post-device-font-size-6);font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;border:unset;font-weight:unset;display:flex;padding:4px 10px;gap:6px;font-size:1rem;border-color:var(--post-scheme-color-interactive-button-tertiary-enabled-stroke);color:var(--post-scheme-color-interactive-button-tertiary-enabled-fg);background-color:var(--post-scheme-color-interactive-button-tertiary-enabled-bg);display:var(--post-burger-button-display, flex)}.burger-button:not(:disabled):hover{text-decoration:none}.burger-button:disabled{border-style:var(--post-core-border-style-dash);cursor:unset}.burger-button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}.burger-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.burger-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.burger-button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.burger-button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.burger-button{border-width:1px !important;transition:none}.burger-button:is(button){background-color:ButtonFace !important;border-color:ButtonBorder !important}}.burger-button:hover{border-color:var(--post-scheme-color-interactive-button-tertiary-hover-stroke);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg);background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg)}.burger-button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active){box-shadow:var(--post-device-elevation-100);border-color:var(--post-scheme-color-interactive-button-primary-enabled-stroke);color:var(--post-scheme-color-interactive-button-primary-enabled-fg);background-color:var(--post-scheme-color-interactive-button-primary-enabled-bg)}.burger-button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active):hover{border-color:var(--post-scheme-color-interactive-button-primary-hover-stroke);color:var(--post-scheme-color-interactive-button-primary-hover-fg);background-color:var(--post-scheme-color-interactive-button-primary-hover-bg)}@media screen and (min-width: 0)and (max-width: 599.98px){.burger-button{padding:10px}.burger-button>:not(post-icon){position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.burger-button>post-icon{font-size:1.5rem}}@media screen and (min-width: 1024px){.burger-button{display:none}}.burger-menu{z-index:-1;position:absolute;inset-inline:0;inset-block-start:100%;height:calc(min(var(--post-header-scroll-parent-height, 100dvh),100dvh) - var(--post-header-height));overflow:hidden auto;display:flex;flex-direction:column;background-color:#fafafa}.burger-menu.extended.second-level-open{overflow:hidden}.burger-menu:not(.extended){transform:translateY(-100%);display:none}.burger-menu:not(.extended)>*{display:none}.burger-menu .burger-menu-body,.burger-menu .burger-menu-footer{display:flex;flex-direction:column;padding-inline:var(--post-burger-menu-padding-inline)}.burger-menu .burger-menu-body{flex-grow:1;padding-block:24px;gap:var(--post-burger-menu-body-gap)}.burger-menu .burger-menu-footer{background-color:#f0efed;padding-block:16px
|
|
1
|
+
:host{--post-global-header-top: calc( var(--post-global-header-reduced-height) - var(--post-global-header-expanded-height) );--post-header-top: calc(var(--post-header-reduced-height) - var(--post-header-expanded-height));--post-logo-height: calc( var(--post-global-header-expanded-height) - var(--post-header-scroll-top, 0px) );--post-global-controls-top: clamp( /* 0 when header is static, large negative when header shrinks to enable offset */ 1000 * (var(--post-global-header-reduced-height) - var(--post-global-header-expanded-height)), calc( -1 * min(var(--post-header-scroll-top, 0px) / 4, var(--post-global-header-reduced-height)) ), 0px )}@media screen and (min-width: 1024px){:host{--post-header-gap: 8px;--post-global-header-padding-inline-start: 4px;--post-global-header-padding-inline-end: 8px;--post-local-header-padding-inline-start: 12px;--post-local-header-padding-inline-end: 8px}}@media screen and (min-width: 600px)and (max-width: 1023.98px){:host{--post-header-gap: 12px 8px;--post-global-header-padding-inline-start: 4px;--post-global-header-padding-inline-end: 4px;--post-local-header-padding-inline-start: 12px;--post-local-header-padding-inline-end: 4px;--post-local-header-padding-block: 12px;--post-burger-menu-padding-inline: 40px;--post-burger-menu-body-gap: 32px;--post-burger-menu-footer-gap: 24px}}@media screen and (min-width: 600px)and (max-width: 779.98px){:host{--post-burger-menu-padding-inline: 16px}}@media screen and (min-width: 0)and (max-width: 599.98px){:host{--post-header-gap: 12px 8px;--post-global-header-padding-inline-start: 0px;--post-global-header-padding-inline-end: 8px;--post-local-header-padding-inline-start: 8px;--post-local-header-padding-inline-end: 8px;--post-local-header-padding-block: 8px;--post-burger-menu-padding-inline: 16px;--post-burger-menu-body-gap: 24px;--post-burger-menu-footer-gap: 16px}}:host(:not([full-width])),:host([full-width=false]){--post-header-content-max-width: 1440px}:host([data-expanded]),:host([data-menu-extended]){--post-header-top: 0;--post-global-header-top: -0.001px;--post-global-controls-top: 0;--post-global-header-reduced-height: var(--post-global-header-expanded-height)}*,::before,::after{box-sizing:border-box}:host,header,.global-header,.local-header{transition:inset-block-start 150ms cubic-bezier(0.4, 0, 0.2, 1)}.section,.sliding-controls{display:flex;align-items:center;justify-content:space-between;gap:var(--post-header-gap);flex-wrap:wrap}.section{max-width:var(--post-header-content-max-width);margin-inline:auto}:host{display:block;position:sticky;inset-block-start:var(--post-header-top);z-index:1020;box-shadow:var(--post-device-elevation-300)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host{border-bottom:1px solid}}.global-header{z-index:2;position:sticky;inset-block-start:var(--post-global-header-top);background-color:#fc0}.global-header::before{position:absolute;z-index:-1;left:0;bottom:0;width:100%;height:100dvh;content:"";background-color:#fc0}.global-header .section{height:var(--post-global-header-expanded-height);padding-inline-start:var(--post-global-header-padding-inline-start);padding-inline-end:var(--post-global-header-padding-inline-end)}.global-header .logo{align-self:flex-end;width:var(--post-global-header-expanded-height);height:var(--post-logo-height);min-height:var(--post-global-header-reduced-height);max-height:100%;margin-inline-end:calc(20px - var(--post-header-gap));margin-inline-start:clamp(var(--post-logo-expanded-offset),var(--post-logo-expanded-offset) + (var(--post-logo-reduced-offset) - var(--post-logo-expanded-offset))*min(var(--post-header-scroll-top, 0px),var(--post-global-header-expanded-height) - var(--post-global-header-reduced-height))/max(1px,var(--post-global-header-expanded-height) - var(--post-global-header-reduced-height)),var(--post-logo-reduced-offset))}.global-header .sliding-controls{flex-grow:1;justify-content:flex-end;position:relative;inset-block-start:var(--post-global-controls-top)}.global-header .audience{margin-inline-end:auto}@media screen and (max-width: 1023.98px){.global-header slot:where([name=audience],[name=global-nav-secondary]){display:none}}.local-header{position:relative;background-color:#fff;min-height:var(--post-local-header-expanded-min-height);display:var(--post-local-header-display, flex);align-items:var(--post-local-header-align-items, center)}.local-header .section{width:100%;padding-inline-start:var(--post-local-header-padding-inline-start);padding-inline-end:var(--post-local-header-padding-inline-end);padding-block:var(--post-local-header-padding-block)}@media screen and (min-width: 1024px){.local-header .section{display:grid;grid-template:var(--post-local-header-grid-template)}}@media screen and (max-width: 1023.98px){.local-header .section{display:flex;align-self:center}}@media screen and (max-width: 1023.98px)and (max-width: 599.98px){.local-header .section{justify-content:end}}.local-header:where(.megadropdown-open)::after,.local-header:has(~.burger-menu.extended)::after{content:"";display:block;position:absolute;inset-inline:0;inset-block-end:0;height:1px;background-color:#e1e0dc}.local-header .local-nav{flex:0 0 auto}@media screen and (max-width: 1023.98px){.local-header slot[name=main-nav]{display:none}}.burger-button{display:inline-flex;position:relative;align-items:center;justify-content:center;max-width:100%;overflow:hidden;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;border-width:var(--post-device-border-width-default);border-style:solid;border-color:rgba(0,0,0,0);border-radius:var(--post-device-border-radius-round);background-color:rgba(0,0,0,0);box-shadow:none;font-family:inherit;font-size:var(--post-device-font-size-6);font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;border:unset;font-weight:unset;display:flex;padding:4px 10px;gap:6px;font-size:1rem;border-color:var(--post-scheme-color-interactive-button-tertiary-enabled-stroke);color:var(--post-scheme-color-interactive-button-tertiary-enabled-fg);background-color:var(--post-scheme-color-interactive-button-tertiary-enabled-bg);display:var(--post-burger-button-display, flex)}.burger-button:not(:disabled):hover{text-decoration:none}.burger-button:disabled{border-style:var(--post-core-border-style-dash);cursor:unset}.burger-button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}.burger-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.burger-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.burger-button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.burger-button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.burger-button{border-width:1px !important;transition:none}.burger-button:is(button){background-color:ButtonFace !important;border-color:ButtonBorder !important}}.burger-button:hover{border-color:var(--post-scheme-color-interactive-button-tertiary-hover-stroke);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg);background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg)}.burger-button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active){box-shadow:var(--post-device-elevation-100);border-color:var(--post-scheme-color-interactive-button-primary-enabled-stroke);color:var(--post-scheme-color-interactive-button-primary-enabled-fg);background-color:var(--post-scheme-color-interactive-button-primary-enabled-bg)}.burger-button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active):hover{border-color:var(--post-scheme-color-interactive-button-primary-hover-stroke);color:var(--post-scheme-color-interactive-button-primary-hover-fg);background-color:var(--post-scheme-color-interactive-button-primary-hover-bg)}@media screen and (min-width: 0)and (max-width: 599.98px){.burger-button{padding:10px}.burger-button>:not(post-icon){position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.burger-button>post-icon{font-size:1.5rem}}@media screen and (min-width: 1024px){.burger-button{display:none}}.burger-menu{z-index:-1;position:absolute;inset-inline:0;inset-block-start:100%;height:calc(min(var(--post-header-scroll-parent-height, 100dvh),100dvh) - var(--post-header-height));overflow:hidden auto;display:flex;flex-direction:column;background-color:#fafafa}.burger-menu.extended.second-level-open{overflow:hidden}.burger-menu:not(.extended){transform:translateY(-100%);display:none}.burger-menu:not(.extended)>*{display:none}.burger-menu .burger-menu-body,.burger-menu .burger-menu-footer{display:flex;flex-direction:column;padding-inline:var(--post-burger-menu-padding-inline)}.burger-menu .burger-menu-body{flex-grow:1;padding-block:24px;gap:var(--post-burger-menu-body-gap)}.burger-menu .burger-menu-footer{background-color:#f0efed;padding-block-start:16px;padding-block-end:max(24px, env(safe-area-inset-bottom, 0px));gap:var(--post-burger-menu-footer-gap)}.burger-menu .local-nav{min-height:56px;display:flex;align-items:center;justify-content:flex-end;padding-inline:4px}
|