@swisspost/design-system-components 10.0.0-next.69 → 10.0.0-next.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/breakpoints-B0Olgvgc.js +206 -0
- package/dist/cjs/component-on-ready-CifOTqw1.js +24 -0
- package/dist/cjs/{focusable-ZqET_zrB.js → focusable-COT2uiEV.js} +25 -4
- package/dist/cjs/{index-DPdHkdGf.js → index-CCteMCnR.js} +13 -13
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/nanoid-CmjyF1Cm.js +20 -0
- package/dist/cjs/{package-CzSn3NmD.js → package-CscM89A7.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +7 -7
- package/dist/cjs/post-autocomplete.cjs.entry.js +3 -3
- package/dist/cjs/post-avatar.cjs.entry.js +6 -24
- package/dist/cjs/post-back-to-top.cjs.entry.js +3 -3
- package/dist/cjs/post-banner.cjs.entry.js +3 -3
- package/dist/cjs/post-breadcrumb-item.cjs.entry.js +30 -33
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +82 -80
- package/dist/cjs/post-closebutton_14.cjs.entry.js +36 -33
- package/dist/cjs/post-collapsible_2.cjs.entry.js +5 -5
- package/dist/cjs/post-components.cjs.js +2 -2
- package/dist/cjs/post-date-picker.cjs.entry.js +31 -23
- package/dist/cjs/post-footer.cjs.entry.js +6 -6
- 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 +4 -4
- package/dist/cjs/post-login-widget.cjs.entry.js +36 -3
- package/dist/cjs/post-number-input.cjs.entry.js +6 -6
- package/dist/cjs/post-pagination.cjs.entry.js +5 -5
- package/dist/cjs/post-popover-trigger.cjs.entry.js +5 -5
- package/dist/cjs/post-popover.cjs.entry.js +4 -4
- package/dist/cjs/post-rating.cjs.entry.js +4 -4
- package/dist/cjs/post-stepper-item.cjs.entry.js +3 -3
- package/dist/cjs/post-stepper.cjs.entry.js +4 -4
- 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 +7 -27
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +16 -12
- package/dist/cjs/post-tooltip.cjs.entry.js +4 -4
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +3 -4
- package/dist/collection/components/post-avatar/avatar-utils.js +2 -2
- package/dist/collection/components/post-avatar/post-avatar.js +3 -40
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.css +1 -1
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +79 -39
- package/dist/collection/components/post-breadcrumb-item/variants.js +1 -0
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.css +1 -1
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +84 -83
- 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 +1 -1
- package/dist/collection/components/post-date-picker/post-date-picker.css +1 -1
- package/dist/collection/components/post-date-picker/post-date-picker.js +2 -2
- package/dist/collection/components/post-footer/post-footer.css +1 -1
- package/dist/collection/components/post-footer/post-footer.js +2 -1
- package/dist/collection/components/post-header/post-header.js +4 -4
- package/dist/collection/components/post-icon/post-icon.js +3 -2
- package/dist/collection/components/post-language-menu/post-language-menu.js +2 -3
- 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-login-widget/post-login-widget.css +1 -0
- package/dist/collection/components/post-login-widget/post-login-widget.js +106 -4
- 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 +1 -1
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +1 -1
- package/dist/collection/components/post-menu/post-menu.js +5 -2
- 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-pagination/post-pagination.js +1 -2
- package/dist/collection/components/post-popover/post-popover.js +1 -1
- package/dist/collection/components/post-popover-trigger/post-popover-trigger.js +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +5 -6
- package/dist/collection/components/post-rating/post-rating.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 -3
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +2 -3
- 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 +15 -9
- package/dist/collection/hydrate-stub/index.stub.js +5 -0
- package/dist/collection/test-setup.js +7 -0
- package/dist/collection/utils/index.js +2 -0
- package/dist/collection/utils/locales.js +9 -2
- package/dist/collection/utils/nanoid.js +16 -0
- package/dist/collection/utils/property-decorators/array-of.js +22 -0
- package/dist/collection/utils/property-decorators/create-validator-decorator.js +187 -0
- package/dist/collection/utils/property-decorators/date.js +21 -0
- package/dist/collection/utils/property-decorators/index.js +9 -0
- package/dist/collection/utils/property-decorators/iso-date.js +21 -0
- package/dist/collection/utils/property-decorators/one-of.js +22 -0
- package/dist/collection/utils/property-decorators/pattern.js +22 -0
- package/dist/collection/utils/property-decorators/required.js +24 -0
- package/dist/collection/utils/property-decorators/type.js +25 -0
- package/dist/collection/utils/property-decorators/url.js +29 -0
- package/dist/components/breakpoints.js +1 -0
- package/dist/components/component-on-ready.js +1 -0
- package/dist/components/focusable.js +1 -1
- package/dist/components/index2.js +1 -1
- package/dist/components/nanoid.js +1 -0
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +1 -1
- package/dist/components/post-accordion2.js +1 -1
- package/dist/components/post-autocomplete.js +1 -1
- package/dist/components/post-avatar.js +1 -1
- package/dist/components/post-avatar2.js +1 -0
- package/dist/components/post-back-to-top.js +1 -1
- package/dist/components/post-banner.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-language-menu-item.js +1 -1
- package/dist/components/post-language-menu.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-login-widget.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-pagination.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-rating.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-8LXe8Zt_.js +1 -0
- package/dist/components/react/p-BC0-M_SK.js +1 -0
- package/dist/components/react/p-BQ3HlJPr.js +1 -0
- package/dist/components/react/p-BrY4VWTQ.js +1 -0
- package/dist/components/react/p-C7s9oglQ.js +1 -0
- package/dist/components/react/{p-Bj33xnuq.js → p-CTgZ8DGr.js} +1 -1
- package/dist/components/react/{p-DwJ5SwpN.js → p-CVtlwDsT.js} +1 -1
- package/dist/components/react/p-CaLwTf3T.js +1 -0
- package/dist/components/react/p-ClJyTIVM.js +1 -0
- package/dist/components/react/{p-B2BDAeHI.js → p-DGr-hfLq.js} +1 -1
- package/dist/components/react/{p-BYfHrHCb.js → p-DJxdj9pa.js} +1 -1
- package/dist/components/react/p-DKDEtjQe.js +1 -0
- package/dist/components/react/p-DPKR_4uI.js +1 -0
- package/dist/components/react/p-DcEDGaFs.js +1 -0
- package/dist/components/react/{p-DRtzK3cr.js → p-DipfA69b.js} +1 -1
- package/dist/components/react/{p-BbOp03Tv.js → p-DwZxAC2u.js} +1 -1
- package/dist/components/react/p-lpWRZjJp.js +1 -0
- package/dist/components/react/p-x3kxyWSZ.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-login-widget.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-rating.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 +210 -69
- package/dist/esm/breakpoints-BQ3HlJPr.js +202 -0
- package/dist/esm/component-on-ready-lpWRZjJp.js +22 -0
- package/dist/esm/{focusable-BD_WT2MO.js → focusable-C7afHKmo.js} +25 -5
- package/dist/esm/{index-DmAi35UF.js → index-DmBWUef5.js} +13 -13
- package/dist/esm/loader.js +3 -3
- package/dist/esm/nanoid-8LXe8Zt_.js +18 -0
- package/dist/esm/package-x3kxyWSZ.js +3 -0
- package/dist/esm/post-accordion_2.entry.js +6 -6
- package/dist/esm/post-autocomplete.entry.js +3 -3
- package/dist/esm/post-avatar.entry.js +6 -24
- package/dist/esm/post-back-to-top.entry.js +3 -3
- package/dist/esm/post-banner.entry.js +3 -3
- package/dist/esm/post-breadcrumb-item.entry.js +31 -34
- package/dist/esm/post-breadcrumbs.entry.js +82 -80
- package/dist/esm/post-closebutton_14.entry.js +31 -28
- package/dist/esm/post-collapsible_2.entry.js +5 -5
- package/dist/esm/post-components.js +3 -3
- package/dist/esm/post-date-picker.entry.js +15 -7
- package/dist/esm/post-footer.entry.js +5 -5
- 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 +4 -4
- package/dist/esm/post-login-widget.entry.js +36 -3
- package/dist/esm/post-number-input.entry.js +5 -5
- package/dist/esm/post-pagination.entry.js +4 -4
- package/dist/esm/post-popover-trigger.entry.js +5 -5
- package/dist/esm/post-popover.entry.js +4 -4
- package/dist/esm/post-rating.entry.js +4 -4
- package/dist/esm/post-stepper-item.entry.js +3 -3
- package/dist/esm/post-stepper.entry.js +4 -4
- package/dist/esm/post-tab-item.entry.js +5 -5
- package/dist/esm/post-tab-panel.entry.js +5 -5
- package/dist/esm/post-tabs.entry.js +6 -26
- package/dist/esm/post-tooltip-trigger.entry.js +16 -12
- package/dist/esm/post-tooltip.entry.js +4 -4
- package/dist/post-components/p-08a0e8e9.entry.js +1 -0
- package/dist/post-components/{p-9fab1847.entry.js → p-1583817b.entry.js} +1 -1
- package/dist/post-components/{p-6644e626.entry.js → p-203d9abd.entry.js} +1 -1
- package/dist/post-components/{p-5ade4255.entry.js → p-2c68af27.entry.js} +1 -1
- package/dist/post-components/{p-f88a161a.entry.js → p-39143e19.entry.js} +1 -1
- package/dist/post-components/p-46dd9e7e.entry.js +1 -0
- package/dist/post-components/{p-c95fcb40.entry.js → p-4b445a35.entry.js} +1 -1
- package/dist/post-components/p-53a8cce5.entry.js +1 -0
- package/dist/post-components/p-72bff1fc.entry.js +1 -0
- package/dist/post-components/{p-8b68164f.entry.js → p-75045028.entry.js} +1 -1
- package/dist/post-components/p-768b4516.entry.js +1 -0
- package/dist/post-components/{p-95df4d4e.entry.js → p-7e072450.entry.js} +1 -1
- package/dist/post-components/{p-0992cba9.entry.js → p-83cb6424.entry.js} +1 -1
- package/dist/post-components/p-8LXe8Zt_.js +1 -0
- package/dist/post-components/{p-d57462a3.entry.js → p-94f4da57.entry.js} +1 -1
- package/dist/post-components/{p-0c249c71.entry.js → p-9dace750.entry.js} +1 -1
- package/dist/post-components/{p-220d0eab.entry.js → p-9ea7e46f.entry.js} +1 -1
- package/dist/post-components/p-BQ3HlJPr.js +1 -0
- package/dist/post-components/p-BrY4VWTQ.js +1 -0
- package/dist/post-components/p-DmBWUef5.js +2 -0
- package/dist/post-components/{p-52f85cba.entry.js → p-a0ac814c.entry.js} +1 -1
- package/dist/post-components/p-a0d12ca8.entry.js +1 -0
- package/dist/post-components/{p-5664d5b5.entry.js → p-bab0f27f.entry.js} +1 -1
- package/dist/post-components/p-cb039d66.entry.js +1 -0
- package/dist/post-components/p-e8cda4e1.entry.js +1 -0
- package/dist/post-components/{p-500a3fc7.entry.js → p-e8e50d5c.entry.js} +1 -1
- package/dist/post-components/p-eb64ec1d.entry.js +1 -0
- package/dist/post-components/p-f0746a9e.entry.js +1 -0
- package/dist/post-components/p-f5e33714.entry.js +1 -0
- package/dist/post-components/{p-cca0cf23.entry.js → p-f93ce33d.entry.js} +1 -1
- package/dist/post-components/{p-272de102.entry.js → p-fd0446b2.entry.js} +1 -1
- package/dist/post-components/p-lpWRZjJp.js +1 -0
- package/dist/post-components/p-x3kxyWSZ.js +1 -0
- package/dist/post-components/post-components.css +1 -1
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-avatar/avatar-utils.d.ts +1 -1
- package/dist/types/components/post-avatar/post-avatar.d.ts +0 -8
- package/dist/types/components/post-breadcrumb-item/post-breadcrumb-item.d.ts +14 -11
- package/dist/types/components/post-breadcrumb-item/variants.d.ts +2 -0
- package/dist/types/components/post-breadcrumbs/post-breadcrumbs.d.ts +23 -25
- package/dist/types/components/post-footer/post-footer.d.ts +1 -0
- package/dist/types/components/post-login-widget/post-login-widget.d.ts +21 -2
- package/dist/types/components/post-menu/post-menu.d.ts +1 -1
- package/dist/types/components/post-popover/post-popover.d.ts +1 -1
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +1 -1
- package/dist/types/components/post-tooltip-trigger/post-tooltip-trigger.d.ts +1 -0
- package/dist/types/components.d.ts +68 -24
- package/dist/types/modules.d.ts +2 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/nanoid.d.ts +8 -0
- package/dist/types/utils/property-decorators/array-of.d.ts +9 -0
- package/dist/types/utils/property-decorators/create-validator-decorator.d.ts +43 -0
- package/dist/types/utils/property-decorators/date.d.ts +6 -0
- package/dist/types/utils/property-decorators/index.d.ts +9 -0
- package/dist/types/utils/property-decorators/iso-date.d.ts +6 -0
- package/dist/types/utils/property-decorators/one-of.d.ts +8 -0
- package/dist/types/utils/property-decorators/pattern.d.ts +8 -0
- package/dist/types/utils/property-decorators/required.d.ts +8 -0
- package/dist/types/utils/property-decorators/type.d.ts +9 -0
- package/dist/types/utils/property-decorators/url.d.ts +6 -0
- package/hydrate/index.js +419 -114735
- package/hydrate/index.mjs +419 -114735
- package/hydrate/index.stub.js +5 -0
- package/package.json +28 -18
- package/dist/cjs/index-YBj3gUJp.js +0 -114540
- package/dist/cjs/index.browser-BVb9l9T_.js +0 -16
- package/dist/components/index.browser.js +0 -1
- package/dist/components/index3.js +0 -6
- package/dist/components/post-breadcrumb-item2.js +0 -1
- package/dist/components/react/p-B4l5EAoq.js +0 -1
- package/dist/components/react/p-B4tq6hiA.js +0 -1
- package/dist/components/react/p-CJcRbvrI.js +0 -6
- package/dist/components/react/p-CfQqdIV2.js +0 -1
- package/dist/components/react/p-D1KBbwmi.js +0 -1
- package/dist/components/react/p-DAIxJysJ.js +0 -1
- package/dist/components/react/p-De_QjSNJ.js +0 -1
- package/dist/components/react/p-HNUXY1z7.js +0 -1
- package/dist/components/react/p-PuHMz_9_.js +0 -1
- package/dist/components/react/p-UY924tHr.js +0 -1
- package/dist/components/react/p-nA1BKco0.js +0 -1
- package/dist/esm/index-CJcRbvrI.js +0 -114535
- package/dist/esm/index.browser-nA1BKco0.js +0 -14
- package/dist/esm/package-B4l5EAoq.js +0 -3
- package/dist/post-components/p-1e28d279.entry.js +0 -1
- package/dist/post-components/p-30e5bc99.entry.js +0 -1
- package/dist/post-components/p-694e76be.entry.js +0 -1
- package/dist/post-components/p-906b669b.entry.js +0 -1
- package/dist/post-components/p-92e4a7f7.entry.js +0 -1
- package/dist/post-components/p-B4l5EAoq.js +0 -1
- package/dist/post-components/p-CJcRbvrI.js +0 -6
- package/dist/post-components/p-DmAi35UF.js +0 -2
- package/dist/post-components/p-PuHMz_9_.js +0 -1
- package/dist/post-components/p-c70cad6e.entry.js +0 -1
- package/dist/post-components/p-cd6684e1.entry.js +0 -1
- package/dist/post-components/p-d99bdef2.entry.js +0 -1
- package/dist/post-components/p-dfe811cc.entry.js +0 -1
- package/dist/post-components/p-f14ca918.entry.js +0 -1
- package/dist/post-components/p-fc2882a8.entry.js +0 -1
- package/dist/post-components/p-nA1BKco0.js +0 -1
- package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/types/language-tags.d.ts +0 -1
- /package/dist/types/{language-tags.js → test-setup.d.ts} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var _package = require('./package-
|
|
3
|
+
var index = require('./index-CCteMCnR.js');
|
|
4
|
+
var _package = require('./package-CscM89A7.js');
|
|
5
5
|
var index$1 = require('./index-qCzRmwgB.js');
|
|
6
|
-
require('./
|
|
6
|
+
require('./breakpoints-B0Olgvgc.js');
|
|
7
7
|
|
|
8
8
|
// https://docs.gravatar.com/api/avatars/images/
|
|
9
9
|
const GRAVATAR_DEFAULT = '404';
|
|
@@ -35,7 +35,7 @@ const PostAvatar = class {
|
|
|
35
35
|
this.imageUrl = '';
|
|
36
36
|
this.imageAlt = '';
|
|
37
37
|
this.initials = '';
|
|
38
|
-
// To handle email
|
|
38
|
+
// To handle email updates and reset the storage item
|
|
39
39
|
this.storageKey = '';
|
|
40
40
|
}
|
|
41
41
|
validateFirstname() {
|
|
@@ -44,10 +44,6 @@ const PostAvatar = class {
|
|
|
44
44
|
validateLastname() {
|
|
45
45
|
index$1.checkEmptyOrType(this, 'lastname', 'string');
|
|
46
46
|
}
|
|
47
|
-
updateUserid() {
|
|
48
|
-
this.validateUserId();
|
|
49
|
-
this.getAvatarImage();
|
|
50
|
-
}
|
|
51
47
|
updateEmail() {
|
|
52
48
|
this.validateEmail();
|
|
53
49
|
this.getAvatarImage();
|
|
@@ -55,9 +51,6 @@ const PostAvatar = class {
|
|
|
55
51
|
validateDescription() {
|
|
56
52
|
index$1.checkEmptyOrType(this, 'description', 'string');
|
|
57
53
|
}
|
|
58
|
-
validateUserId() {
|
|
59
|
-
index$1.checkEmptyOrType(this, 'userid', 'string');
|
|
60
|
-
}
|
|
61
54
|
validateEmail() {
|
|
62
55
|
if (this.email)
|
|
63
56
|
index$1.checkEmptyOrPattern(this, 'email', emailPattern);
|
|
@@ -67,10 +60,7 @@ const PostAvatar = class {
|
|
|
67
60
|
this.slottedImage = this.host.querySelector('img');
|
|
68
61
|
const imageUrl = this.slottedImage?.getAttribute('src');
|
|
69
62
|
if (!imageUrl) {
|
|
70
|
-
if (this.
|
|
71
|
-
imageLoaded = await this.getImageByProp(this.userid, this.fetchImageByUserId.bind(this));
|
|
72
|
-
}
|
|
73
|
-
if (!imageLoaded && this.email?.match(emailPattern)) {
|
|
63
|
+
if (this.email?.match(emailPattern)) {
|
|
74
64
|
imageLoaded = await this.getImageByProp(this.email, this.fetchImageByEmail.bind(this));
|
|
75
65
|
}
|
|
76
66
|
if (!imageLoaded) {
|
|
@@ -109,9 +99,6 @@ const PostAvatar = class {
|
|
|
109
99
|
return true;
|
|
110
100
|
}
|
|
111
101
|
}
|
|
112
|
-
async fetchImageByUserId() {
|
|
113
|
-
return await fetch(PostAvatar.INTERNAL_USERID_IMAGE_SRC.replace('{userid}', encodeURIComponent(this.userid)));
|
|
114
|
-
}
|
|
115
102
|
async fetchImageByEmail() {
|
|
116
103
|
const email = await cryptify(this.email);
|
|
117
104
|
const imageUrl = GRAVATAR_BASE_URL.replace('{email}', email);
|
|
@@ -156,7 +143,6 @@ const PostAvatar = class {
|
|
|
156
143
|
this.validateFirstname();
|
|
157
144
|
this.validateLastname();
|
|
158
145
|
this.validateDescription();
|
|
159
|
-
this.validateUserId();
|
|
160
146
|
this.validateEmail();
|
|
161
147
|
}
|
|
162
148
|
render() {
|
|
@@ -166,7 +152,7 @@ const PostAvatar = class {
|
|
|
166
152
|
.join('')
|
|
167
153
|
.trim();
|
|
168
154
|
const fullname = names.join(' ');
|
|
169
|
-
return (index.h(index.Host, { key: '
|
|
155
|
+
return (index.h(index.Host, { key: 'f0617cd81944692e525750d5c61a1d4ea7991b55', "data-version": _package.version }, index.h("span", { key: 'ab0280fe0445ed8c97fc5bbf7d1c510cefa42621', class: this.avatarType === 'slotted' ? '' : 'd-none' }, index.h("slot", { key: '03737f45e5cd54f3999bbf3a9c326dd747c7ed36', onSlotchange: this.slotChanged.bind(this) })), this.avatarType === 'image' && index.h("img", { key: '0f4290d3b3586c68b3b33ceb44e46ba863d39f74', src: this.imageUrl, alt: this.imageAlt }), this.avatarType === 'initials' && (index.h("span", { key: 'e38459c13ed79df9905a69218cac303ed3fc8ff9', class: "initials" }, initials, index.h("span", { key: '6c47fba8605290d9cc7795c2bdbc72004f963c89' }, this.description ?? fullname)))));
|
|
170
156
|
}
|
|
171
157
|
get host() { return index.getElement(this); }
|
|
172
158
|
static get watchers() { return {
|
|
@@ -176,9 +162,6 @@ const PostAvatar = class {
|
|
|
176
162
|
"lastname": [{
|
|
177
163
|
"validateLastname": 0
|
|
178
164
|
}],
|
|
179
|
-
"userid": [{
|
|
180
|
-
"updateUserid": 0
|
|
181
|
-
}],
|
|
182
165
|
"email": [{
|
|
183
166
|
"updateEmail": 0
|
|
184
167
|
}],
|
|
@@ -187,7 +170,6 @@ const PostAvatar = class {
|
|
|
187
170
|
}]
|
|
188
171
|
}; }
|
|
189
172
|
};
|
|
190
|
-
PostAvatar.INTERNAL_USERID_IMAGE_SRC = 'https://web.post.ch/UserProfileImage/{userid}.png';
|
|
191
173
|
PostAvatar.style = postAvatarCss();
|
|
192
174
|
|
|
193
175
|
exports.post_avatar = PostAvatar;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-CCteMCnR.js');
|
|
4
4
|
var fadeSlide = require('./fade-slide-dPhQa-I1.js');
|
|
5
|
-
var _package = require('./package-
|
|
5
|
+
var _package = require('./package-CscM89A7.js');
|
|
6
6
|
var index$1 = require('./index-qCzRmwgB.js');
|
|
7
|
-
require('./
|
|
7
|
+
require('./breakpoints-B0Olgvgc.js');
|
|
8
8
|
require('./utils-s05L2ulk.js');
|
|
9
9
|
|
|
10
10
|
const postBackToTopCss = () => `:host{opacity:0;--post-floating-button-position-top:var(--post-device-position-4);--post-back-to-top-position-top:calc( var(--post-header-height) + var(--post-floating-button-position-top) );--post-back-to-top-elevation:var(--post-device-elevation-300);position:fixed;z-index:1019;inset-block-start:var(--post-back-to-top-position-top);inset-inline-end:var(--post-device-position-1)}:host .back-to-top{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button;box-shadow:var(--post-back-to-top-elevation);cursor:pointer;border-radius:var(--post-device-border-radius-round);width:var(--post-device-sizing-interactive-button-height-2);height:var(--post-device-sizing-interactive-button-height-2);border:var(--post-device-border-width-default) solid var(--post-scheme-color-interactive-button-secondary-enabled-stroke);color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);background-color:var(--post-scheme-color-interactive-button-secondary-enabled-bg);display:flex;align-items:center;justify-content:center}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .back-to-top{background-color:ButtonFace !important}:host .back-to-top:hover{background-color:Highlight !important}}:host .back-to-top{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}:host .back-to-top: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){:host .back-to-top:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){:host .back-to-top: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){:host .back-to-top:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}:host .back-to-top:hover{border-color:var(--post-scheme-color-interactive-button-secondary-hover-stroke);color:var(--post-scheme-color-interactive-button-secondary-hover-fg);background-color:var(--post-scheme-color-interactive-button-secondary-hover-bg)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .back-to-top:hover{color:HighlightText !important}}:host .back-to-top post-icon{height:var(--post-device-sizing-interactive-button-icon-3);width:var(--post-device-sizing-interactive-button-icon-3)}:host .visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}`;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var _package = require('./package-
|
|
3
|
+
var index = require('./index-CCteMCnR.js');
|
|
4
|
+
var _package = require('./package-CscM89A7.js');
|
|
5
5
|
var fade = require('./fade-CPQhl1fP.js');
|
|
6
6
|
var index$1 = require('./index-qCzRmwgB.js');
|
|
7
|
-
require('./
|
|
7
|
+
require('./breakpoints-B0Olgvgc.js');
|
|
8
8
|
var eventFrom = require('./event-from-CwMw19f8.js');
|
|
9
9
|
require('./utils-s05L2ulk.js');
|
|
10
10
|
|
|
@@ -1,53 +1,50 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var _package = require('./package-CzSn3NmD.js');
|
|
3
|
+
var index = require('./index-CCteMCnR.js');
|
|
5
4
|
var index$1 = require('./index-qCzRmwgB.js');
|
|
6
|
-
require('./
|
|
5
|
+
require('./breakpoints-B0Olgvgc.js');
|
|
6
|
+
var _package = require('./package-CscM89A7.js');
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const VARIANTS = ['listitem', 'menuitem'];
|
|
9
|
+
|
|
10
|
+
const postBreadcrumbItemCss = () => `a{-webkit-text-decoration:var(--post-core-text-decoration-underline);text-decoration:var(--post-core-text-decoration-underline);border-radius:var(--post-device-border-radius-focus);color:var(--post-current-fg)}a:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1)}a{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}a: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){a:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){a: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){a: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){a,a:focus{color:LinkText !important}a:hover{text-decoration-thickness:2px}a:visited{color:VisitedText}}:host(:not([variant=menuitem])){display:flex;align-items:center;gap:var(--post-device-spacing-gap-inline-5)}:host(:not([variant=menuitem])) :is(button,a){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-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;display:flex;align-self:start;font:inherit;padding:unset;border:unset;color:var(--post-scheme-color-interactive-primary-enabled-fg1);border-radius:var(--post-device-border-radius-focus);text-decoration:var(--post-core-text-decoration-none)}:host(:not([variant=menuitem])) :is(button,a):hover{text-decoration:none}:host(:not([variant=menuitem])) :is(button,a):disabled{border-style:var(--post-core-border-style-dash)}:host(:not([variant=menuitem])) :is(button,a){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}:host(:not([variant=menuitem])) :is(button,a):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){:host(:not([variant=menuitem])) :is(button,a):is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){:host(:not([variant=menuitem])) :is(button,a):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){:host(:not([variant=menuitem])) :is(button,a):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){:host(:not([variant=menuitem])) :is(button,a):is(a){color:LinkText;border:unset}:host(:not([variant=menuitem])) :is(button,a):is(button){background-color:ButtonFace !important;border:1px solid ButtonBorder !important}:host(:not([variant=menuitem])) :is(button,a):not(:disabled,.disabled):is(button):hover{background-color:Highlight !important}:host(:not([variant=menuitem])) :is(button,a):not(:disabled,.disabled):is(button):hover>post-icon{color:HighlightText !important}}:host(:not([variant=menuitem])) :is(button,a):hover{color:var(--post-scheme-color-interactive-primary-hover-fg1);text-decoration:var(--post-core-text-decoration-underline)}:host(:not([variant=menuitem]))::before{mask-image:var(--post-icon-chevronright);background-color:currentColor;content:"";display:flex;height:16px;width:16px;margin-block:var(--post-device-spacing-padding-35);margin-inline:var(--post-core-dimension-4);flex-shrink:0}:root,:host{--post-icon-chevronright:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxkZWZzPjxzeW1ib2wgaWQ9ImktY2hldnJvbnJpZ2h0Ij48c3ltYm9sIGlkPSJzMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTUuMzggMTRjLS4xOSAwLS4zOC0uMDctLjUzLS4yMmEuNzU0Ljc1NCAwIDAgMSAwLTEuMDZMOS41NyA4IDQuODUgMy4yOGMtLjI5LS4yOS0uMjktLjc3IDAtMS4wNnMuNzctLjI5IDEuMDYgMEwxMS42OSA4bC01Ljc4IDUuNzhjLS4xNS4xNS0uMzQuMjItLjUzLjIyIi8+PC9zeW1ib2w+PHN5bWJvbCBpZD0iczI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik04LjA3IDIwLjcyYy0uMjIgMC0uNDUtLjA4LS42Mi0uMjZhLjg4Ljg4IDAgMCAxIDAtMS4yNGw3LjI2LTcuMjZMNy40NSA0LjdhLjg4Ljg4IDAgMCAxIDAtMS4yNGMuMzQtLjM0LjktLjM0IDEuMjQgMGw4LjUgOC41LTguNDkgOC40OWMtLjE3LjE3LS40LjI2LS42Mi4yNloiLz48L3N5bWJvbD48c3ltYm9sIGlkPSJzMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0iTTEwLjc2IDI3LjVjLS4yNiAwLS41MS0uMS0uNzEtLjI5YS45OTYuOTk2IDAgMCAxIDAtMS40MWw5Ljc5LTkuNzktOS43OS05LjgxYS45OTYuOTk2IDAgMSAxIDEuNDEtMS40MUwyMi42NyAxNiAxMS40NiAyNy4yMWMtLjIuMi0uNDUuMjktLjcxLjI5WiIvPjwvc3ltYm9sPjxzeW1ib2wgaWQ9InM0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMTMuNSAzNC4yMmExLjEyMyAxLjEyMyAwIDAgMS0uOC0xLjkybDEyLjMzLTEyLjMzTDEyLjcgNy42M2MtLjQ0LS40NC0uNDQtMS4xNSAwLTEuNTlzMS4xNS0uNDQgMS41OSAwbDEzLjkzIDEzLjkzTDE0LjMgMzMuODljLS4yMi4yMi0uNTEuMzMtLjguMzMiLz48L3N5bWJvbD48c3ltYm9sIGlkPSJzNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCI+PHBhdGggZD0iTTE2LjE0IDQxYy0uMzIgMC0uNjQtLjEyLS44OC0uMzdhMS4yNSAxLjI1IDAgMCAxIDAtMS43N2wxNC44Ny0xNC44N0wxNS4yNSA5LjExYy0uNDktLjQ5LS40OS0xLjI4IDAtMS43N3MxLjI4LS40OSAxLjc3IDBsMTYuNjQgMTYuNjQtMTYuNjMgMTYuNjNjLS4yNC4yNC0uNTYuMzctLjg4LjM3WiIvPjwvc3ltYm9sPjxzeW1ib2wgaWQ9InM2NCIgdmlld0JveD0iMCAwIDY0IDY0Ij48cGF0aCBkPSJNMjEuNTEgNTQuNGExLjM3NiAxLjM3NiAwIDAgMS0uOTctMi4zNWwyMC4wMy0yMC4wMy0yMC4wNC0yMC4wM2MtLjU0LS41NC0uNTQtMS40MSAwLTEuOTVzMS40MS0uNTQgMS45NSAwbDIxLjk4IDIxLjk5TDIyLjQ5IDU0Yy0uMjcuMjctLjYyLjQtLjk3LjRaIi8+PC9zeW1ib2w+PHVzZSBzdHlsZT0iZGlzcGxheTogdmFyKC0tczE2LCBub25lKSIgaHJlZj0iI3MxNiIvPjx1c2Ugc3R5bGU9ImRpc3BsYXk6IHZhcigtLXMyNCwgbm9uZSkiIGhyZWY9IiNzMjQiLz48dXNlIHN0eWxlPSJkaXNwbGF5OiB2YXIoLS1zMzIsIG5vbmUpIiBocmVmPSIjczMyIi8+PHVzZSBzdHlsZT0iZGlzcGxheTogdmFyKC0tczQwLCBub25lKSIgaHJlZj0iI3M0MCIvPjx1c2Ugc3R5bGU9ImRpc3BsYXk6IHZhcigtLXM0OCwgbm9uZSkiIGhyZWY9IiNzNDgiLz48dXNlIHN0eWxlPSJkaXNwbGF5OiB2YXIoLS1zNjQsIG5vbmUpIiBocmVmPSIjczY0Ii8+PC9zeW1ib2w+PC9kZWZzPjxzdHlsZT5AbWVkaWEgKG1heC13aWR0aDogMjMuOThweCkge2d7LS1zMTY6YmxvY2s7fX1AbWVkaWEgKG1pbi13aWR0aDogMjRweCkgYW5kIChtYXgtd2lkdGg6IDMxLjk4cHgpIHtney0tczI0OmJsb2NrO319QG1lZGlhIChtaW4td2lkdGg6IDMycHgpIGFuZCAobWF4LXdpZHRoOiAzOS45OHB4KSB7Z3stLXMzMjpibG9jazt9fUBtZWRpYSAobWluLXdpZHRoOiA0MHB4KSBhbmQgKG1heC13aWR0aDogNDcuOThweCkge2d7LS1zNDA6YmxvY2s7fX1AbWVkaWEgKG1pbi13aWR0aDogNDhweCkgYW5kIChtYXgtd2lkdGg6IDYzLjk4cHgpIHtney0tczQ4OmJsb2NrO319QG1lZGlhIChtaW4td2lkdGg6IDY0cHgpIHtney0tczY0OmJsb2NrO319PC9zdHlsZT48Zz48dXNlIGhyZWY9IiNpLWNoZXZyb25yaWdodCIvPjwvZz48L3N2Zz4=")}:host :is(a,span){margin-block:var(--post-device-spacing-padding-block-6)}:host([selected]:not([selected=false])){display:flex;align-items:center;gap:var(--post-device-spacing-gap-inline-5)}:host([selected]:not([selected=false])) :is(button,a){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-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;display:flex;align-self:start;font:inherit;padding:unset;border:unset;color:var(--post-scheme-color-interactive-primary-enabled-fg1);border-radius:var(--post-device-border-radius-focus);text-decoration:var(--post-core-text-decoration-none)}:host([selected]:not([selected=false])) :is(button,a):hover{text-decoration:none}:host([selected]:not([selected=false])) :is(button,a):disabled{border-style:var(--post-core-border-style-dash)}:host([selected]:not([selected=false])) :is(button,a){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}:host([selected]:not([selected=false])) :is(button,a):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){:host([selected]:not([selected=false])) :is(button,a):is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){:host([selected]:not([selected=false])) :is(button,a):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){:host([selected]:not([selected=false])) :is(button,a):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){:host([selected]:not([selected=false])) :is(button,a):is(a){color:LinkText;border:unset}:host([selected]:not([selected=false])) :is(button,a):is(button){background-color:ButtonFace !important;border:1px solid ButtonBorder !important}:host([selected]:not([selected=false])) :is(button,a):not(:disabled,.disabled):is(button):hover{background-color:Highlight !important}:host([selected]:not([selected=false])) :is(button,a):not(:disabled,.disabled):is(button):hover>post-icon{color:HighlightText !important}}:host([selected]:not([selected=false])) :is(button,a):hover{color:var(--post-scheme-color-interactive-primary-hover-fg1);text-decoration:var(--post-core-text-decoration-underline)}:host([selected]:not([selected=false]))::before{mask-image:var(--post-icon-chevronright);background-color:currentColor;content:"";display:flex;height:16px;width:16px;margin-block:var(--post-device-spacing-padding-35);margin-inline:var(--post-core-dimension-4);flex-shrink:0}:root,:host{--post-icon-chevronright:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxkZWZzPjxzeW1ib2wgaWQ9ImktY2hldnJvbnJpZ2h0Ij48c3ltYm9sIGlkPSJzMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTUuMzggMTRjLS4xOSAwLS4zOC0uMDctLjUzLS4yMmEuNzU0Ljc1NCAwIDAgMSAwLTEuMDZMOS41NyA4IDQuODUgMy4yOGMtLjI5LS4yOS0uMjktLjc3IDAtMS4wNnMuNzctLjI5IDEuMDYgMEwxMS42OSA4bC01Ljc4IDUuNzhjLS4xNS4xNS0uMzQuMjItLjUzLjIyIi8+PC9zeW1ib2w+PHN5bWJvbCBpZD0iczI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik04LjA3IDIwLjcyYy0uMjIgMC0uNDUtLjA4LS42Mi0uMjZhLjg4Ljg4IDAgMCAxIDAtMS4yNGw3LjI2LTcuMjZMNy40NSA0LjdhLjg4Ljg4IDAgMCAxIDAtMS4yNGMuMzQtLjM0LjktLjM0IDEuMjQgMGw4LjUgOC41LTguNDkgOC40OWMtLjE3LjE3LS40LjI2LS42Mi4yNloiLz48L3N5bWJvbD48c3ltYm9sIGlkPSJzMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0iTTEwLjc2IDI3LjVjLS4yNiAwLS41MS0uMS0uNzEtLjI5YS45OTYuOTk2IDAgMCAxIDAtMS40MWw5Ljc5LTkuNzktOS43OS05LjgxYS45OTYuOTk2IDAgMSAxIDEuNDEtMS40MUwyMi42NyAxNiAxMS40NiAyNy4yMWMtLjIuMi0uNDUuMjktLjcxLjI5WiIvPjwvc3ltYm9sPjxzeW1ib2wgaWQ9InM0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMTMuNSAzNC4yMmExLjEyMyAxLjEyMyAwIDAgMS0uOC0xLjkybDEyLjMzLTEyLjMzTDEyLjcgNy42M2MtLjQ0LS40NC0uNDQtMS4xNSAwLTEuNTlzMS4xNS0uNDQgMS41OSAwbDEzLjkzIDEzLjkzTDE0LjMgMzMuODljLS4yMi4yMi0uNTEuMzMtLjguMzMiLz48L3N5bWJvbD48c3ltYm9sIGlkPSJzNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCI+PHBhdGggZD0iTTE2LjE0IDQxYy0uMzIgMC0uNjQtLjEyLS44OC0uMzdhMS4yNSAxLjI1IDAgMCAxIDAtMS43N2wxNC44Ny0xNC44N0wxNS4yNSA5LjExYy0uNDktLjQ5LS40OS0xLjI4IDAtMS43N3MxLjI4LS40OSAxLjc3IDBsMTYuNjQgMTYuNjQtMTYuNjMgMTYuNjNjLS4yNC4yNC0uNTYuMzctLjg4LjM3WiIvPjwvc3ltYm9sPjxzeW1ib2wgaWQ9InM2NCIgdmlld0JveD0iMCAwIDY0IDY0Ij48cGF0aCBkPSJNMjEuNTEgNTQuNGExLjM3NiAxLjM3NiAwIDAgMS0uOTctMi4zNWwyMC4wMy0yMC4wMy0yMC4wNC0yMC4wM2MtLjU0LS41NC0uNTQtMS40MSAwLTEuOTVzMS40MS0uNTQgMS45NSAwbDIxLjk4IDIxLjk5TDIyLjQ5IDU0Yy0uMjcuMjctLjYyLjQtLjk3LjRaIi8+PC9zeW1ib2w+PHVzZSBzdHlsZT0iZGlzcGxheTogdmFyKC0tczE2LCBub25lKSIgaHJlZj0iI3MxNiIvPjx1c2Ugc3R5bGU9ImRpc3BsYXk6IHZhcigtLXMyNCwgbm9uZSkiIGhyZWY9IiNzMjQiLz48dXNlIHN0eWxlPSJkaXNwbGF5OiB2YXIoLS1zMzIsIG5vbmUpIiBocmVmPSIjczMyIi8+PHVzZSBzdHlsZT0iZGlzcGxheTogdmFyKC0tczQwLCBub25lKSIgaHJlZj0iI3M0MCIvPjx1c2Ugc3R5bGU9ImRpc3BsYXk6IHZhcigtLXM0OCwgbm9uZSkiIGhyZWY9IiNzNDgiLz48dXNlIHN0eWxlPSJkaXNwbGF5OiB2YXIoLS1zNjQsIG5vbmUpIiBocmVmPSIjczY0Ii8+PC9zeW1ib2w+PC9kZWZzPjxzdHlsZT5AbWVkaWEgKG1heC13aWR0aDogMjMuOThweCkge2d7LS1zMTY6YmxvY2s7fX1AbWVkaWEgKG1pbi13aWR0aDogMjRweCkgYW5kIChtYXgtd2lkdGg6IDMxLjk4cHgpIHtney0tczI0OmJsb2NrO319QG1lZGlhIChtaW4td2lkdGg6IDMycHgpIGFuZCAobWF4LXdpZHRoOiAzOS45OHB4KSB7Z3stLXMzMjpibG9jazt9fUBtZWRpYSAobWluLXdpZHRoOiA0MHB4KSBhbmQgKG1heC13aWR0aDogNDcuOThweCkge2d7LS1zNDA6YmxvY2s7fX1AbWVkaWEgKG1pbi13aWR0aDogNDhweCkgYW5kIChtYXgtd2lkdGg6IDYzLjk4cHgpIHtney0tczQ4OmJsb2NrO319QG1lZGlhIChtaW4td2lkdGg6IDY0cHgpIHtney0tczY0OmJsb2NrO319PC9zdHlsZT48Zz48dXNlIGhyZWY9IiNpLWNoZXZyb25yaWdodCIvPjwvZz48L3N2Zz4=")}:host([selected]:not([selected=false])) :is(a,span){color:var(--post-scheme-color-interactive-primary-selected-fg1);font-weight:var(--post-device-font-weight-bold);text-decoration:var(--post-core-text-decoration-none)}:host([selected]:not([selected=false]):not([data-measuring])){align-items:start}:host([selected]:not([selected=false]):not([data-measuring])) :is(a,span){white-space:normal;overflow-wrap:anywhere}`;
|
|
9
11
|
|
|
10
12
|
const PostBreadcrumbItem = class {
|
|
11
13
|
constructor(hostRef) {
|
|
12
14
|
index.registerInstance(this, hostRef);
|
|
15
|
+
/**
|
|
16
|
+
* Controls how the item is rendered, either as a standard list item or within an overflow menu.
|
|
17
|
+
*/
|
|
18
|
+
this.variant = 'listitem';
|
|
19
|
+
/**
|
|
20
|
+
* Indicates that the item represents the current page, applying appropriate styling.
|
|
21
|
+
*/
|
|
22
|
+
this.selected = false;
|
|
13
23
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
this.validUrl = this.constructUrl(this.url);
|
|
17
|
-
}
|
|
18
|
-
catch {
|
|
19
|
-
this.validUrl = undefined;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
// Helper to construct a valid URL string or return undefined
|
|
23
|
-
constructUrl(value) {
|
|
24
|
-
const hasBaseURL = /^https?:\/\//.test(String(this.url));
|
|
25
|
-
if (typeof value === 'string') {
|
|
26
|
-
this.fullUrl = hasBaseURL ? value : `${globalThis.location.origin}${value}`;
|
|
27
|
-
index$1.checkEmptyOrUrl(this, 'fullUrl');
|
|
28
|
-
return this.fullUrl;
|
|
29
|
-
}
|
|
30
|
-
return undefined;
|
|
24
|
+
validateURL() {
|
|
25
|
+
index$1.checkEmptyOrUrl(this, 'url');
|
|
31
26
|
}
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
validateVariant() {
|
|
28
|
+
index$1.checkEmptyOrOneOf(this, 'variant', VARIANTS);
|
|
34
29
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const linkElement = this.host.shadowRoot?.querySelector('a');
|
|
38
|
-
if (linkElement) {
|
|
39
|
-
event.preventDefault();
|
|
40
|
-
linkElement.click();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
30
|
+
validateSelected() {
|
|
31
|
+
index$1.checkRequiredAndType(this, 'selected', 'boolean');
|
|
43
32
|
}
|
|
44
33
|
render() {
|
|
45
|
-
|
|
34
|
+
const href = this.url instanceof URL ? this.url.href : this.url;
|
|
35
|
+
const content = href ? (index.h("a", { href: href, "aria-current": this.selected ? 'page' : undefined, "aria-label": this.label, "aria-description": this.description }, index.h("slot", null))) : (index.h("span", null, index.h("slot", null)));
|
|
36
|
+
return this.variant === 'listitem' || this.selected ? (index.h(index.Host, { "data-version": _package.version, role: "listitem", slot: this.selected ? 'selected' : undefined }, content)) : (index.h(index.Host, { "data-version": _package.version }, index.h("post-menu-item", null, content)));
|
|
46
37
|
}
|
|
47
38
|
get host() { return index.getElement(this); }
|
|
48
39
|
static get watchers() { return {
|
|
49
40
|
"url": [{
|
|
50
|
-
"
|
|
41
|
+
"validateURL": 0
|
|
42
|
+
}],
|
|
43
|
+
"variant": [{
|
|
44
|
+
"validateVariant": 0
|
|
45
|
+
}],
|
|
46
|
+
"selected": [{
|
|
47
|
+
"validateSelected": 0
|
|
51
48
|
}]
|
|
52
49
|
}; }
|
|
53
50
|
};
|
|
@@ -1,33 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var
|
|
3
|
+
var index = require('./index-CCteMCnR.js');
|
|
4
|
+
var breakpoints = require('./breakpoints-B0Olgvgc.js');
|
|
5
|
+
var _package = require('./package-CscM89A7.js');
|
|
5
6
|
var index$1 = require('./index-qCzRmwgB.js');
|
|
6
|
-
require('./
|
|
7
|
-
var
|
|
7
|
+
var componentOnReady = require('./component-on-ready-CifOTqw1.js');
|
|
8
|
+
var nanoid = require('./nanoid-CmjyF1Cm.js');
|
|
8
9
|
|
|
9
|
-
const postBreadcrumbsCss = () => `:host{
|
|
10
|
+
const postBreadcrumbsCss = () => `:host{position:relative}nav{max-width:100%}nav.invisible{visibility:hidden;overflow:hidden;position:absolute;inset:0}[role=list]{display:flex;align-items:start;gap:var(--post-device-spacing-gap-inline-4)}.breadcrumb-item{display:flex;align-items:center;gap:var(--post-device-spacing-gap-inline-5)}.breadcrumb-item :is(button,a){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-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;display:flex;align-self:start;font:inherit;padding:unset;border:unset;color:var(--post-scheme-color-interactive-primary-enabled-fg1);border-radius:var(--post-device-border-radius-focus);text-decoration:var(--post-core-text-decoration-none)}.breadcrumb-item :is(button,a):hover{text-decoration:none}.breadcrumb-item :is(button,a):disabled{border-style:var(--post-core-border-style-dash)}.breadcrumb-item :is(button,a){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}.breadcrumb-item :is(button,a):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){.breadcrumb-item :is(button,a):is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.breadcrumb-item :is(button,a):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){.breadcrumb-item :is(button,a):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){.breadcrumb-item :is(button,a):is(a){color:LinkText;border:unset}.breadcrumb-item :is(button,a):is(button){background-color:ButtonFace !important;border:1px solid ButtonBorder !important}.breadcrumb-item :is(button,a):not(:disabled,.disabled):is(button):hover{background-color:Highlight !important}.breadcrumb-item :is(button,a):not(:disabled,.disabled):is(button):hover>post-icon{color:HighlightText !important}}.breadcrumb-item :is(button,a):hover{color:var(--post-scheme-color-interactive-primary-hover-fg1);text-decoration:var(--post-core-text-decoration-underline)}.breadcrumb-item::before{mask-image:var(--post-icon-chevronright);background-color:currentColor;content:"";display:flex;height:16px;width:16px;margin-block:var(--post-device-spacing-padding-35);margin-inline:var(--post-core-dimension-4);flex-shrink:0}:root,:host{--post-icon-chevronright:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxkZWZzPjxzeW1ib2wgaWQ9ImktY2hldnJvbnJpZ2h0Ij48c3ltYm9sIGlkPSJzMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTUuMzggMTRjLS4xOSAwLS4zOC0uMDctLjUzLS4yMmEuNzU0Ljc1NCAwIDAgMSAwLTEuMDZMOS41NyA4IDQuODUgMy4yOGMtLjI5LS4yOS0uMjktLjc3IDAtMS4wNnMuNzctLjI5IDEuMDYgMEwxMS42OSA4bC01Ljc4IDUuNzhjLS4xNS4xNS0uMzQuMjItLjUzLjIyIi8+PC9zeW1ib2w+PHN5bWJvbCBpZD0iczI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik04LjA3IDIwLjcyYy0uMjIgMC0uNDUtLjA4LS42Mi0uMjZhLjg4Ljg4IDAgMCAxIDAtMS4yNGw3LjI2LTcuMjZMNy40NSA0LjdhLjg4Ljg4IDAgMCAxIDAtMS4yNGMuMzQtLjM0LjktLjM0IDEuMjQgMGw4LjUgOC41LTguNDkgOC40OWMtLjE3LjE3LS40LjI2LS42Mi4yNloiLz48L3N5bWJvbD48c3ltYm9sIGlkPSJzMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0iTTEwLjc2IDI3LjVjLS4yNiAwLS41MS0uMS0uNzEtLjI5YS45OTYuOTk2IDAgMCAxIDAtMS40MWw5Ljc5LTkuNzktOS43OS05LjgxYS45OTYuOTk2IDAgMSAxIDEuNDEtMS40MUwyMi42NyAxNiAxMS40NiAyNy4yMWMtLjIuMi0uNDUuMjktLjcxLjI5WiIvPjwvc3ltYm9sPjxzeW1ib2wgaWQ9InM0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMTMuNSAzNC4yMmExLjEyMyAxLjEyMyAwIDAgMS0uOC0xLjkybDEyLjMzLTEyLjMzTDEyLjcgNy42M2MtLjQ0LS40NC0uNDQtMS4xNSAwLTEuNTlzMS4xNS0uNDQgMS41OSAwbDEzLjkzIDEzLjkzTDE0LjMgMzMuODljLS4yMi4yMi0uNTEuMzMtLjguMzMiLz48L3N5bWJvbD48c3ltYm9sIGlkPSJzNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCI+PHBhdGggZD0iTTE2LjE0IDQxYy0uMzIgMC0uNjQtLjEyLS44OC0uMzdhMS4yNSAxLjI1IDAgMCAxIDAtMS43N2wxNC44Ny0xNC44N0wxNS4yNSA5LjExYy0uNDktLjQ5LS40OS0xLjI4IDAtMS43N3MxLjI4LS40OSAxLjc3IDBsMTYuNjQgMTYuNjQtMTYuNjMgMTYuNjNjLS4yNC4yNC0uNTYuMzctLjg4LjM3WiIvPjwvc3ltYm9sPjxzeW1ib2wgaWQ9InM2NCIgdmlld0JveD0iMCAwIDY0IDY0Ij48cGF0aCBkPSJNMjEuNTEgNTQuNGExLjM3NiAxLjM3NiAwIDAgMS0uOTctMi4zNWwyMC4wMy0yMC4wMy0yMC4wNC0yMC4wM2MtLjU0LS41NC0uNTQtMS40MSAwLTEuOTVzMS40MS0uNTQgMS45NSAwbDIxLjk4IDIxLjk5TDIyLjQ5IDU0Yy0uMjcuMjctLjYyLjQtLjk3LjRaIi8+PC9zeW1ib2w+PHVzZSBzdHlsZT0iZGlzcGxheTogdmFyKC0tczE2LCBub25lKSIgaHJlZj0iI3MxNiIvPjx1c2Ugc3R5bGU9ImRpc3BsYXk6IHZhcigtLXMyNCwgbm9uZSkiIGhyZWY9IiNzMjQiLz48dXNlIHN0eWxlPSJkaXNwbGF5OiB2YXIoLS1zMzIsIG5vbmUpIiBocmVmPSIjczMyIi8+PHVzZSBzdHlsZT0iZGlzcGxheTogdmFyKC0tczQwLCBub25lKSIgaHJlZj0iI3M0MCIvPjx1c2Ugc3R5bGU9ImRpc3BsYXk6IHZhcigtLXM0OCwgbm9uZSkiIGhyZWY9IiNzNDgiLz48dXNlIHN0eWxlPSJkaXNwbGF5OiB2YXIoLS1zNjQsIG5vbmUpIiBocmVmPSIjczY0Ii8+PC9zeW1ib2w+PC9kZWZzPjxzdHlsZT5AbWVkaWEgKG1heC13aWR0aDogMjMuOThweCkge2d7LS1zMTY6YmxvY2s7fX1AbWVkaWEgKG1pbi13aWR0aDogMjRweCkgYW5kIChtYXgtd2lkdGg6IDMxLjk4cHgpIHtney0tczI0OmJsb2NrO319QG1lZGlhIChtaW4td2lkdGg6IDMycHgpIGFuZCAobWF4LXdpZHRoOiAzOS45OHB4KSB7Z3stLXMzMjpibG9jazt9fUBtZWRpYSAobWluLXdpZHRoOiA0MHB4KSBhbmQgKG1heC13aWR0aDogNDcuOThweCkge2d7LS1zNDA6YmxvY2s7fX1AbWVkaWEgKG1pbi13aWR0aDogNDhweCkgYW5kIChtYXgtd2lkdGg6IDYzLjk4cHgpIHtney0tczQ4OmJsb2NrO319QG1lZGlhIChtaW4td2lkdGg6IDY0cHgpIHtney0tczY0OmJsb2NrO319PC9zdHlsZT48Zz48dXNlIGhyZWY9IiNpLWNoZXZyb25yaWdodCIvPjwvZz48L3N2Zz4=")}.home::before{content:unset}.home post-icon{font-size:var(--post-core-dimension-24)}@media screen and (min-width: 0)and (max-width: 599.98px){.home post-icon{font-size:20px}}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}`;
|
|
10
11
|
|
|
11
12
|
const PostBreadcrumbs = class {
|
|
12
13
|
constructor(hostRef) {
|
|
13
14
|
index.registerInstance(this, hostRef);
|
|
14
|
-
this.
|
|
15
|
-
// Waits for breadcrumbs navigation reference to be available
|
|
16
|
-
this.waitForBreadcrumbsRef = debounce.debounce(() => {
|
|
17
|
-
if (this.breadcrumbsNavRef?.clientWidth > 0) {
|
|
18
|
-
this.checkConcatenation();
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
this.waitForBreadcrumbsRef();
|
|
22
|
-
}
|
|
23
|
-
}, 50);
|
|
24
|
-
// Handles resizing to check concatenation
|
|
25
|
-
this.handleResize = () => {
|
|
26
|
-
if (window.innerWidth === this.lastWindowWidth)
|
|
27
|
-
return;
|
|
28
|
-
this.lastWindowWidth = window.innerWidth;
|
|
29
|
-
this.checkConcatenation();
|
|
30
|
-
};
|
|
15
|
+
this.shouldRenderMenu = false;
|
|
31
16
|
}
|
|
32
17
|
validateHomeUrl() {
|
|
33
18
|
index$1.checkRequiredAndUrl(this, 'homeUrl');
|
|
@@ -41,75 +26,92 @@ const PostBreadcrumbs = class {
|
|
|
41
26
|
validateTextMoreItems() {
|
|
42
27
|
index$1.checkRequiredAndType(this, 'textMoreItems', 'string');
|
|
43
28
|
}
|
|
29
|
+
componentWillLoad() {
|
|
30
|
+
this.id = this.host.id || `b${nanoid.nanoid(6)}`;
|
|
31
|
+
}
|
|
44
32
|
componentDidLoad() {
|
|
45
33
|
this.validateHomeUrl();
|
|
46
34
|
this.validateTextHome();
|
|
47
35
|
this.validateTextBreadcrumbs();
|
|
48
36
|
this.validateTextMoreItems();
|
|
49
|
-
|
|
50
|
-
this.
|
|
37
|
+
this.createMutationObserver();
|
|
38
|
+
this.createResizeObserver();
|
|
39
|
+
}
|
|
40
|
+
disconnectedCallback() {
|
|
41
|
+
this.mutationObserver?.disconnect();
|
|
42
|
+
this.resizeObserver?.disconnect();
|
|
43
|
+
}
|
|
44
|
+
createMutationObserver() {
|
|
45
|
+
this.mutationObserver = new MutationObserver(this.duplicateNavElement.bind(this));
|
|
46
|
+
this.mutationObserver.observe(this.host, {
|
|
47
|
+
childList: true,
|
|
48
|
+
characterData: true,
|
|
49
|
+
subtree: true,
|
|
50
|
+
});
|
|
51
|
+
this.duplicateNavElement();
|
|
52
|
+
}
|
|
53
|
+
createResizeObserver() {
|
|
54
|
+
this.resizeObserver = new ResizeObserver(breakpoints.throttle(50, this.checkOverflow.bind(this)));
|
|
55
|
+
this.resizeObserver.observe(document.body);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* To measure overflow, we duplicate the entire breadcrumb so an inline version is always available.
|
|
59
|
+
*/
|
|
60
|
+
duplicateNavElement() {
|
|
61
|
+
const shadowRoot = this.host.shadowRoot;
|
|
62
|
+
const nav = shadowRoot?.querySelector('nav');
|
|
63
|
+
if (!shadowRoot || !nav)
|
|
64
|
+
return;
|
|
65
|
+
this.prepareBreadcrumbItemsForClone();
|
|
66
|
+
const clone = nav.cloneNode(true);
|
|
67
|
+
clone.classList.add('invisible');
|
|
68
|
+
shadowRoot.querySelector('nav.invisible')?.remove();
|
|
69
|
+
shadowRoot.append(clone);
|
|
51
70
|
requestAnimationFrame(() => {
|
|
52
|
-
this.
|
|
71
|
+
this.duplicateSlottedElements(clone, 'slot:not([name])');
|
|
72
|
+
this.duplicateSlottedElements(clone, 'slot[name="selected"]');
|
|
73
|
+
this.checkOverflow();
|
|
53
74
|
});
|
|
54
75
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
updateBreadcrumbItems() {
|
|
60
|
-
this.breadcrumbItems = Array.from(this.host.querySelectorAll('post-breadcrumb-item')).map(item => ({
|
|
61
|
-
text: item.textContent || '',
|
|
62
|
-
url: item.getAttribute('url') ?? undefined,
|
|
63
|
-
description: item.getAttribute('description') ?? undefined,
|
|
64
|
-
label: item.getAttribute('label') ?? undefined,
|
|
65
|
-
}));
|
|
66
|
-
this.lastItem = this.breadcrumbItems.at(-1);
|
|
67
|
-
}
|
|
68
|
-
// Determines parent width for concatenation logic
|
|
69
|
-
getParentWidth() {
|
|
70
|
-
let parent = this.host.parentNode;
|
|
71
|
-
while (parent && !(parent instanceof HTMLElement)) {
|
|
72
|
-
parent = parent.parentNode;
|
|
73
|
-
}
|
|
74
|
-
return parent instanceof HTMLElement ? parent.clientWidth : window.innerWidth;
|
|
75
|
-
}
|
|
76
|
-
checkConcatenation() {
|
|
77
|
-
if (!this.breadcrumbsNavRef)
|
|
76
|
+
duplicateSlottedElements(clone, slotSelector) {
|
|
77
|
+
const originalSlot = this.host.shadowRoot?.querySelector(slotSelector);
|
|
78
|
+
const clonedSlot = clone.querySelector(slotSelector);
|
|
79
|
+
if (!originalSlot || !clonedSlot)
|
|
78
80
|
return;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
81
|
+
originalSlot.assignedElements().forEach(element => {
|
|
82
|
+
const cloned = element.cloneNode(true);
|
|
83
|
+
cloned.dataset.measuring = 'true';
|
|
84
|
+
clonedSlot.before(cloned);
|
|
85
|
+
});
|
|
86
|
+
clonedSlot.remove();
|
|
87
|
+
}
|
|
88
|
+
checkOverflow() {
|
|
89
|
+
const hiddenNav = this.host.shadowRoot?.querySelector('nav.invisible');
|
|
90
|
+
if (!hiddenNav)
|
|
91
|
+
return;
|
|
92
|
+
const breadcrumbItems = Array.from(hiddenNav.querySelectorAll('post-breadcrumb-item'));
|
|
93
|
+
Promise.all(breadcrumbItems.map(item => componentOnReady.componentOnReady(item))).then(() => {
|
|
94
|
+
this.shouldRenderMenu = hiddenNav.scrollWidth > hiddenNav.clientWidth;
|
|
95
|
+
this.updateBreadcrumbItemProps();
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
prepareBreadcrumbItemsForClone() {
|
|
99
|
+
this.shouldRenderMenu = false;
|
|
100
|
+
this.updateBreadcrumbItemProps();
|
|
101
|
+
}
|
|
102
|
+
updateBreadcrumbItemProps() {
|
|
103
|
+
const breadcrumbItems = this.host.querySelectorAll('post-breadcrumb-item');
|
|
104
|
+
breadcrumbItems.forEach((item, index) => {
|
|
105
|
+
item.setAttribute('variant', this.shouldRenderMenu ? 'menuitem' : 'listitem');
|
|
106
|
+
item.setAttribute('selected', String(index === breadcrumbItems.length - 1));
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
renderMenu() {
|
|
110
|
+
const menuId = `${this.id}-menu`;
|
|
111
|
+
return (index.h("div", { role: "listitem" }, index.h("div", { class: "breadcrumb-item" }, index.h("post-menu-trigger", { for: menuId }, index.h("button", null, index.h("span", { class: "visually-hidden" }, this.textMoreItems), index.h("span", { "aria-hidden": "true" }, "...")))), index.h("post-menu", { id: menuId, label: this.textMoreItems, placement: "bottom-start" }, index.h("slot", null))));
|
|
98
112
|
}
|
|
99
113
|
render() {
|
|
100
|
-
|
|
101
|
-
return (index.h(index.Host, { key: '4c0030c6896fa3bbbb26a26668a3b2cf96a110a9', "data-version": _package.version }, index.h("nav", { key: '80834fa5581243a5cd081626ba743a29a2498502', "aria-label": this.textBreadcrumbs, class: "breadcrumbs-nav", ref: el => (this.breadcrumbsNavRef = el) }, index.h("ol", { key: '925aff0f9f19ef04e339ead446f5e4d4449b73ec', class: "no-list breadcrumbs-list" }, index.h("li", { key: '6dd10b7af11f6a63c27dc018dc49cdc8e85f7dcd' }, index.h("a", { key: '3c6db30d34a5f4d176b6127bc0ccb8fe733846af', href: this.homeUrl, class: "breadcrumb-link" }, index.h("span", { key: '9a78ed7042859125d32374885c0ce7426e2ff114', class: "visually-hidden" }, this.textHome), index.h("post-icon", { key: '096eaf22ab0f381de0b4a93a65972718101b2d4e', name: "home", class: "home-icon" }))), this.isConcatenated ? (index.h("li", { class: "menu-trigger-wrapper" }, index.h("post-icon", { name: "chevronright", class: "breadcrumb-item-icon" }), index.h("div", { class: "actual-menu" }, index.h("post-menu-trigger", { for: "breadcrumb-menu", tabIndex: 0, onKeyDown: e => {
|
|
102
|
-
if (e.key === 'Enter' || e.key === ' ') {
|
|
103
|
-
e.preventDefault();
|
|
104
|
-
this.handleBreadcrumbItemClick();
|
|
105
|
-
}
|
|
106
|
-
} }, index.h("button", { class: "btn", tabIndex: -1 }, "...")), index.h("post-menu", { id: "breadcrumb-menu", label: this.textMoreItems }, visibleItems.map(item => (index.h("post-menu-item", { key: item.url || item.text, class: "breadcrumb-item", onKeyDown: e => {
|
|
107
|
-
if (e.key === 'Enter' || e.key === ' ') {
|
|
108
|
-
const linkElement = e.currentTarget.querySelector('a');
|
|
109
|
-
linkElement?.click();
|
|
110
|
-
e.preventDefault();
|
|
111
|
-
}
|
|
112
|
-
} }, item.url ? (index.h("a", { href: item.url, "aria-label": item.label, "aria-description": item.description }, item.text)) : (index.h("span", null, item.text))))))))) : (visibleItems.map(item => (index.h("li", null, index.h("post-breadcrumb-item", { url: item.url, label: item.label, description: item.description, key: item.url || item.text }, item.text))))), this.lastItem && (index.h("li", { key: '57d4678e05401a248e31559eef7562a1608c0d58', "aria-current": "page" }, index.h("post-breadcrumb-item", { key: 'b1be2e79473288d0755a65a0819eb2a2301a89f2', url: this.lastItem.url, label: this.lastItem.label, description: this.lastItem.description, tabindex: -1 }, this.lastItem.text)))), index.h("div", { key: '9eaa408234c3497176bfc116ab02f8280ff1cce7', class: "hidden-items" }, index.h("a", { key: 'c19fab9c610fe33b0fb980e24fe6395ee4bed8c6', href: this.homeUrl, class: "hidden-breadcrumb-item" }, index.h("span", { key: '9d42d66632535330307f87fdad5ba6e983b4448a', class: "visually-hidden" }, this.textHome), index.h("post-icon", { key: 'b7cc4122d01930d5736f6eb929a46bcd32c547e4', name: "home", class: "home-icon" })), this.breadcrumbItems.map(item => (index.h("post-breadcrumb-item", { url: item.url, key: `hidden-${item.url || item.text}`, label: item.label, description: item.description, class: "hidden-breadcrumb-item" }, item.text)))))));
|
|
114
|
+
return (index.h(index.Host, { key: '85cb104032c0caed5ab2fb442be0a6d7eac5b67a', "data-version": _package.version }, index.h("nav", { key: 'be4b2b8c6333ef3bf3440de0ce61958d1a07952b', "aria-label": this.textBreadcrumbs }, index.h("div", { key: '28531f638065e6db5cbf7e29d87086933fb47235', role: "list" }, index.h("div", { key: '4a71e5b143e271e26f032e8d4ed329aee949bf32', class: "breadcrumb-item home", role: "listitem" }, index.h("a", { key: '3e58ac2d4bbbc2e56a7acd28119b235edadc8fa0', href: this.homeUrl }, index.h("span", { key: '1a31a9963898005b218177d78adbb7813728b0ce', class: "visually-hidden" }, this.textHome), index.h("post-icon", { key: '668a636881fbea1a7129b9108cc234c257e0fffb', "aria-hidden": "true", name: "home" }))), this.shouldRenderMenu ? this.renderMenu() : index.h("slot", null), index.h("slot", { key: '0c8bad3de95f0ca51dfd8a15c4cb6e79e2499b1b', name: "selected" })))));
|
|
113
115
|
}
|
|
114
116
|
get host() { return index.getElement(this); }
|
|
115
117
|
static get watchers() { return {
|