@swisspost/design-system-components 10.5.0 → 10.6.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-Cy5yN6u9.js} +1 -1
- package/dist/cjs/{index-CXnlZiX8.js → index-B3PXzvDk.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{one-of-LGG0uEIi.js → one-of-CRFrfihj.js} +1 -1
- package/dist/cjs/{package-DdU-rENe.js → package-pKyFPwiA.js} +1 -1
- package/dist/cjs/{pattern-B-csvfNt.js → pattern-D329DFcf.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 +49 -45
- 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 +17 -15
- package/dist/cjs/post-footer.cjs.entry.js +7 -7
- 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-DhAEd0c7.js} +1 -1
- package/dist/cjs/{type-CGPnqGY1.js → type-2Ma9dvHs.js} +1 -1
- package/dist/cjs/{url-Dxdd6tWj.js → url-DePscsTj.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 +11 -9
- package/dist/collection/components/post-footer/post-footer.js +2 -2
- package/dist/collection/components/post-header/post-header.js +2 -2
- 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.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-CoCua20S.js → p-3RU9XwVO.js} +1 -1
- package/dist/components/react/p-B1TcktiB.js +1 -0
- package/dist/components/react/p-BN2dfUQ0.js +1 -0
- package/dist/components/react/{p-CuVhOs8F.js → p-BPUhha1U.js} +1 -1
- package/dist/components/react/{p-PYoaz_Xl.js → p-Bnb_TyDh.js} +1 -1
- package/dist/components/react/{p-CLeWLMJn.js → p-CcDLIogT.js} +1 -1
- package/dist/components/react/{p-DD-Sl3Ji.js → p-CdggfEzz.js} +1 -1
- package/dist/components/react/{p-DasK590W.js → p-CzsG0uCA.js} +1 -1
- package/dist/components/react/{p-C8vlYfD-.js → p-DffT6evQ.js} +1 -1
- package/dist/components/react/p-T8T3po4z.js +1 -0
- package/dist/components/react/{p-DiFAKI9o.js → p-WXzzOdnl.js} +1 -1
- package/dist/components/react/{p-D3rq_-Qk.js → p-m1-sOx5T.js} +1 -1
- 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-C2XlYkNB.js} +1 -1
- package/dist/esm/{index-D3NdvMgy.js → index-BjziJWh2.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{one-of-Mx4vYjem.js → one-of-Do1iao-k.js} +1 -1
- package/dist/esm/{package-Ny5VnydI.js → package-T8T3po4z.js} +1 -1
- package/dist/esm/{pattern-CqQVrJPN.js → pattern-BZDucOTq.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 +49 -45
- 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 +17 -15
- package/dist/esm/post-footer.entry.js +7 -7
- 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-B0X7uy13.js} +1 -1
- package/dist/esm/{type-CYB7_Yi8.js → type-CF1dOg6D.js} +1 -1
- package/dist/esm/{url-DOwgyBfp.js → url-BL7d6iWZ.js} +1 -1
- package/dist/post-components/{p-4e2bb082.entry.js → p-0e922531.entry.js} +1 -1
- package/dist/post-components/{p-e8c19f72.entry.js → p-1ec27142.entry.js} +1 -1
- package/dist/post-components/{p-ffec1880.entry.js → p-2005eb98.entry.js} +1 -1
- package/dist/post-components/{p-894b20dd.entry.js → p-2cff5b3a.entry.js} +1 -1
- package/dist/post-components/p-53bd2128.entry.js +1 -0
- package/dist/post-components/{p-2379e498.entry.js → p-59b30e90.entry.js} +1 -1
- package/dist/post-components/{p-a9223467.entry.js → p-60550edb.entry.js} +1 -1
- package/dist/post-components/p-655ded00.entry.js +1 -0
- package/dist/post-components/{p-030bfaa1.entry.js → p-76cc3c9a.entry.js} +1 -1
- package/dist/post-components/{p-44718c1a.entry.js → p-8012cc3b.entry.js} +1 -1
- package/dist/post-components/{p-1d67c427.entry.js → p-819c93de.entry.js} +1 -1
- package/dist/post-components/p-840acd3c.entry.js +1 -0
- package/dist/post-components/{p-781efeb8.entry.js → p-87b1034f.entry.js} +1 -1
- package/dist/post-components/{p-e8268a8d.entry.js → p-88f754e9.entry.js} +1 -1
- package/dist/post-components/p-9S_5_Zh8.js +1 -0
- package/dist/post-components/p-BYfu3J2D.js +1 -0
- package/dist/post-components/p-BjziJWh2.js +2 -0
- package/dist/post-components/p-BoYe-VVx.js +1 -0
- package/dist/post-components/p-CbbADNiv.js +1 -0
- package/dist/post-components/{p-sgCfAEQU.js → p-DgnQe03V.js} +1 -1
- package/dist/post-components/p-DlKbBdcP.js +1 -0
- package/dist/post-components/p-T8T3po4z.js +1 -0
- package/dist/post-components/{p-2cb843f4.entry.js → p-a32d3050.entry.js} +1 -1
- package/dist/post-components/p-b4229624.entry.js +1 -0
- package/dist/post-components/{p-2ee255c1.entry.js → p-b9faa76b.entry.js} +1 -1
- package/dist/post-components/{p-b856263a.entry.js → p-ba1b4ba0.entry.js} +1 -1
- package/dist/post-components/p-c0ae13b7.entry.js +1 -0
- package/dist/post-components/p-c9dcdebb.entry.js +1 -0
- package/dist/post-components/{p-5a44b217.entry.js → p-ccf8020b.entry.js} +1 -1
- package/dist/post-components/p-cd68d3a2.entry.js +1 -0
- package/dist/post-components/p-cdc7b8d3.entry.js +1 -0
- package/dist/post-components/{p-e7f97f6d.entry.js → p-d7c9a969.entry.js} +1 -1
- package/dist/post-components/{p-9ad2216e.entry.js → p-db11f781.entry.js} +1 -1
- package/dist/post-components/p-dc285087.entry.js +1 -0
- package/dist/post-components/{p-b6e231a8.entry.js → p-de6f1816.entry.js} +1 -1
- package/dist/post-components/p-dec8bd99.entry.js +1 -0
- package/dist/post-components/{p-665d877f.entry.js → p-f9a8ee94.entry.js} +1 -1
- 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.d.ts +18 -7
- package/hydrate/index.js +274 -137
- package/hydrate/index.mjs +274 -137
- 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-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-c7a39444.entry.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-e463e7ac.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)
|
|
@@ -288,6 +288,15 @@ export class PostDatePicker {
|
|
|
288
288
|
console.error('hide: popoverRef is null or undefined');
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
|
+
static { this.FLYOUT_OFFSET = 4; }
|
|
292
|
+
// Cells per row for each view
|
|
293
|
+
static {
|
|
294
|
+
this.COLUMNS_BY_VIEW = {
|
|
295
|
+
days: 7,
|
|
296
|
+
months: 4,
|
|
297
|
+
years: 4,
|
|
298
|
+
};
|
|
299
|
+
}
|
|
291
300
|
/**
|
|
292
301
|
* Get the system locale (e.g.`en`, etc.) from the closest parent with a `lang` attribute,
|
|
293
302
|
* or fallback to a default language code if not found or in server environment.
|
|
@@ -920,11 +929,11 @@ export class PostDatePicker {
|
|
|
920
929
|
}
|
|
921
930
|
}
|
|
922
931
|
render() {
|
|
923
|
-
return (h(Host, { key: '
|
|
932
|
+
return (h(Host, { key: 'aa624e30312b6e9af82ab3ae508b7527ebb99bdc', "data-version": version }, this.inline && (h("div", { key: '3643fb239e920945cb1438bb510047b19a6fc826', dir: this.textDirection }, h("slot", { key: '08113b74ebe5d1faede4dc4412858408870ccb3b' }), h("div", { key: 'b8cec572edeae4ef2b4d0bb582a8d4085e4815e9', class: "datepicker-container" }))), !this.inline && (h("div", { key: 'a3ab6ca2fded0644a3cb3a513100b309882a67b7', dir: this.textDirection }, h("div", { key: 'd1e3ec263fe3cbcfa7c78de9997be403e8dd8a1f', 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: '5b747326d65bd4efa46cd7b6c0b20510ba1b894c' }), h("button", { key: '9b053c841863418e063b29fd1344dff8803bff00', onClick: () => this.show(), "aria-haspopup": "true", "aria-label": this.textToggleCalendar, disabled: this.inputDisabled, ref: e => (this.dpTrigger = e) }, h("post-icon", { key: 'badf30f287ca4776bedbd2323d03c1e7352e9a41', name: "calendar" }))), h("post-popovercontainer", { key: 'f5ccb7e7eb04e8f2251e87b8cc53bf0f613f174b', placement: "bottom-end", offset: PostDatePicker.FLYOUT_OFFSET, ref: e => (this.popoverRef = e) }, h("div", { key: '9054611105846624392ec79737d997a386a21ae2', 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()
|
|
@@ -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"; }
|
|
@@ -319,10 +319,10 @@ export class PostHeader {
|
|
|
319
319
|
render() {
|
|
320
320
|
const onDesktop = Build.isServer || this.device === 'desktop';
|
|
321
321
|
const onTabletAndMobile = Build.isServer || this.device !== 'desktop';
|
|
322
|
-
return (h(Host, { key: '
|
|
322
|
+
return (h(Host, { key: 'd288ef2e58942c2cbc5da673076548c97eef04ed', "data-version": version, "data-color-scheme": "light", "data-burger-menu": this.hasBurgerMenu, "data-menu-extended": this.burgerMenuExtended }, h("header", { key: '5357f3edf382dec9b552fdfe9fb51d0878de697c' }, h("div", { key: 'bafa11390b33056e5a3d1a8a2922fd3a43a25020', class: "global-header" }, h("div", { key: '2d54e8d2931864880ff7a28aea64625e775ce327', class: "section" }, h("div", { key: 'b3a87bbf3b87213e22043d58a7298d0cff530cdf', class: "logo" }, h("slot", { key: '9d559b9231dc23841e277d3f4633cdeba2da12b2', name: "post-logo" })), h("div", { key: '64ebd463868ce8b417023651e745e33331feb908', class: "sliding-controls" }, onDesktop && (h("div", { key: 'b4e7d7231a0d8bebe620d41cb655c3686449b19f', class: "audience" }, h("slot", { key: '0781a76b1853a842dc74ec2a2a649f7de487e148', name: "audience" }))), h("slot", { key: '25f1d5b34a5aa950014214f810f3acca95dbbe80', name: "global-nav-primary" }), (onDesktop || !this.hasMainNav) && [
|
|
323
323
|
h("slot", { key: "global-nav-secondary", name: "global-nav-secondary" }),
|
|
324
324
|
h("slot", { key: "language-menu", name: "language-menu" }),
|
|
325
|
-
], h("slot", { key: '
|
|
325
|
+
], h("slot", { key: 'd7121e5e9ddf825f96a3a82e65ff135c61891adb', name: "post-login" }), onTabletAndMobile && this.hasMainNav && (h("post-togglebutton", { key: 'dd0bcf9cfd96d4ffa44fc549d518d7b39d287156', class: "burger-button", ref: el => (this.burgerMenuButton = el), onClick: () => this.toggleBurgerMenu() }, h("span", { key: '23004cb12733a7081f828d33327cc26adafe3888' }, this.textMenu), h("post-icon", { key: '7fb36892eadfcce0a85d964c411aeafc3fbbde1b', "aria-hidden": "true", name: "burger", "data-showwhen": "untoggled" }), h("post-icon", { key: 'a41292205573c03f25d225d4f4296f75ffe6c7ce', "aria-hidden": "true", name: "closex", "data-showwhen": "toggled" })))))), h("div", { key: '7d6d1424881bb5277210c86b194dfb9e5dcb7c59', ref: el => (this.localHeader = el), class: { 'local-header': true, 'megadropdown-open': this.megadropdownOpen } }, h("div", { key: '724a8d3f79112875ba343470f9d0b753ce5d4861', class: "section" }, h("slot", { key: '688aafdec4e4d5565f3d0a9d9bd9bb7bc78152be', name: "side-nav" }), h("slot", { key: '12590bfb4bfcc8c565f008a8e3d75b5951eb73bc', name: "title" }), this.hasTitle && h("slot", { key: 'd862de0f3aaba5ea22a26c387ea7e93dc0c5e79c', name: "local-nav" }), onDesktop && h("slot", { key: '1a25ec6694bc8b2c06e21449dc566f36595afbb5', name: "main-nav" }), onDesktop && !this.hasTitle && h("slot", { key: '987c26ee73fb19049fdd19de79b537b71e2771de', name: "local-nav" }))), this.hasBurgerMenu && this.renderBurgerMenu())));
|
|
326
326
|
}
|
|
327
327
|
static get is() { return "post-header"; }
|
|
328
328
|
static get encapsulation() { return "shadow"; }
|
|
@@ -102,7 +102,7 @@ export class PostIcon {
|
|
|
102
102
|
}).filter(([_key, value]) => value !== null));
|
|
103
103
|
}
|
|
104
104
|
render() {
|
|
105
|
-
return (h(Host, { key: '
|
|
105
|
+
return (h(Host, { key: '405ccfde4206c14f044575d0b23998d93a03ffb6', "data-version": version }, h("span", { key: 'ad70ccf63add4b881ef6096ae460e13fba09f508', style: this.getStyles() })));
|
|
106
106
|
}
|
|
107
107
|
static get is() { return "post-icon"; }
|
|
108
108
|
static get encapsulation() { return "shadow"; }
|
|
@@ -60,7 +60,7 @@ export class PostLinkarea {
|
|
|
60
60
|
}));
|
|
61
61
|
}
|
|
62
62
|
render() {
|
|
63
|
-
return (h(Host, { key: '
|
|
63
|
+
return (h(Host, { key: 'a187468c97584b393efb0f73966716947243fe1f', "data-version": version, onClick: (e) => this.dispatchClick(e) }, h("slot", { key: 'a374c748871f36acf8ceda423c121645e97a6ce1' })));
|
|
64
64
|
}
|
|
65
65
|
static get is() { return "post-linkarea"; }
|
|
66
66
|
static get encapsulation() { return "shadow"; }
|
|
@@ -129,7 +129,7 @@ export class PostListbox {
|
|
|
129
129
|
this.updateSelection(event.detail);
|
|
130
130
|
}
|
|
131
131
|
render() {
|
|
132
|
-
return (h(Host, { key: '
|
|
132
|
+
return (h(Host, { key: 'a59296af752a3f88bcd70663d0ce12f61718e92f', "data-version": version, role: "listbox" }, h("post-popovercontainer", { key: '665dd563705515022edc79a4d98e9ac43b80c525', placement: "bottom-start", ref: el => (this.popoverContainer = el) }, h("slot", { key: 'd8a37fd905dfaca07286913a0c680e61744d65e1', name: "blank-slate" }), h("slot", { key: '22e367ae36329d0586e1a275692983cf0c004df4' }))));
|
|
133
133
|
}
|
|
134
134
|
static get is() { return "post-listbox"; }
|
|
135
135
|
static get encapsulation() { return "shadow"; }
|
|
@@ -9,9 +9,9 @@ export class PostListboxOption {
|
|
|
9
9
|
this.highlighted = false;
|
|
10
10
|
}
|
|
11
11
|
render() {
|
|
12
|
-
return (h(Host, { key: '
|
|
12
|
+
return (h(Host, { key: '38481f1a4721d50530bbd96a80ebc89933c8311c', "data-version": version, role: "option", "aria-selected": `${this.selected}`, "data-active": this.highlighted ? 'true' : null,
|
|
13
13
|
/* Prevent focus change from triggering onblur event in post-autocomplete */
|
|
14
|
-
onPointerDown: (e) => e.preventDefault(), onClick: () => this.postOptionSelected.emit(this.value), id: `post-listbox-option-${this.optionId}` }, h("span", { key: '
|
|
14
|
+
onPointerDown: (e) => e.preventDefault(), onClick: () => this.postOptionSelected.emit(this.value), id: `post-listbox-option-${this.optionId}` }, h("span", { key: '25403d2e68f44f68d5c3f2097c5aab57f90176cf', class: "option-content" }, this.value, h("span", { key: '0caf89cfb81695f33637facd07dcf628fa6024a8', class: "option-description" }, h("slot", { key: '857ed6d15014fb8d32f7074c9f1622d540f8ed13' }))), this.selected && h("post-icon", { key: '3b300532591be12424a84cebd082b8c0c3ca6935', "aria-hidden": "true", name: "checkmark" })));
|
|
15
15
|
}
|
|
16
16
|
static get is() { return "post-listbox-option"; }
|
|
17
17
|
static get encapsulation() { return "shadow"; }
|
|
@@ -26,7 +26,7 @@ export class PostLogo {
|
|
|
26
26
|
render() {
|
|
27
27
|
const logoLink = this.url && (typeof this.url === 'string' ? this.url : this.url.href);
|
|
28
28
|
const LogoTag = logoLink ? 'a' : 'span';
|
|
29
|
-
return (h(Host, { key: '
|
|
29
|
+
return (h(Host, { key: '1f69b0ddc0ecf2fde47423cd7824fcbe76e4a529', "data-version": version }, h(LogoTag, { key: '096736bd50a6dd43e02a104e7e81897cb286db60', class: `logo ${logoLink ? 'logo-link' : ''}`, ...(logoLink ? { href: logoLink } : {}) }, h("span", { key: 'bc49b9591424f02744f771eb1079911f02ceca33', class: "description" }, h("slot", { key: 'ea905eac805e2a9940bfe50aa222bef738d15d27', onSlotchange: () => this.checkDescription() })), h("svg", { key: '482d94c38347017269dabd0ab3d15f4ede14f187', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 72 72", "aria-hidden": "true" }, h("g", { key: 'fcd3dc56e8a0e448abe65b557639a8bea8ca580f', id: "Logo" }, h("rect", { key: '11ed7bad596ee07301f1c1101ddded089ef2bf99', fill: "#ffcc00", x: "0", y: "0", width: "72", height: "72" }), h("polygon", { key: '6ab9d28c8492c746a2620cff62dbd92a59a00aff', fill: "#ff0000", points: "34,32.3 34,19 19.7,19 19.7,29.1 10,29.1 10,42.9 19.7,42.9 19.7,53 34,53 34,39.7 30.6,39.7 30.6,49.8 23.1,49.8 23.1,39.7 13.4,39.7 13.4,32.3 23.1,32.3 23.1,22.2 30.6,22.2 30.6,32.3" }), h("path", { key: '8b96cee7ee8ad1ec3c22aaf7928f7a711c05c828', d: "M53.56234,31.10526c0,2.41272-1.99154,4.29475-4.51723,4.29475H45.2v-8.3h3.84511C51.66802,27.1,53.56234,28.78889,53.56234,31.10526z M50.69666,19H36v34h9.2V42.9h5.49666c6.75131,0,11.9971-5.15137,11.9971-11.8057C62.69376,24.39136,57.35099,19,50.69666,19z" }))))));
|
|
30
30
|
}
|
|
31
31
|
static get is() { return "post-logo"; }
|
|
32
32
|
static get encapsulation() { return "shadow"; }
|
|
@@ -129,7 +129,7 @@ export class PostMainnavigation {
|
|
|
129
129
|
}, NAVBAR_DISABLE_DURATION);
|
|
130
130
|
}
|
|
131
131
|
render() {
|
|
132
|
-
return (h(Host, { key: '
|
|
132
|
+
return (h(Host, { key: 'cf7b2328a41b41ca28956120b8042590655e7bb2', version: version, class: this.canScroll ? 'scrollable' : '' }, h("div", { key: 'a25c55cf7b11a11ce86fb134dd57dbdad3d30301', "aria-hidden": "true", class: { 'scroll-control scroll-left': true, 'd-none': !this.canScrollLeft }, onMouseDown: e => this.handleScrollButtonClick(e, 'left') }, h("post-icon", { key: '013778591637d5ee0ac2cd2bf3f23c677ba2a13f', "aria-hidden": "true", name: "chevronleft" })), h("nav", { key: 'a007b7be57429580de35865e5eff0c54378d0a8e', ref: el => (this.navbar = el), "aria-label": this.textMain }, h("slot", { key: 'bc8e1db18430ee43b5963539fbaa65e1fb1b0c55' })), h("div", { key: 'cdb413fedc9a90c712db0fe5d6ab760a426ff632', "aria-hidden": "true", class: { 'scroll-control scroll-right': true, 'd-none': !this.canScrollRight }, onMouseDown: e => this.handleScrollButtonClick(e, 'right') }, h("post-icon", { key: 'b2df569a79881b3a044556ba9c0f2e2b0646e78b', "aria-hidden": "true", name: "chevronright" }))));
|
|
133
133
|
}
|
|
134
134
|
static get is() { return "post-mainnavigation"; }
|
|
135
135
|
static get encapsulation() { return "shadow"; }
|