@swisspost/design-system-components 10.0.0-next.37 → 10.0.0-next.39
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/index-2b2b85e5.js +96 -0
- package/dist/cjs/index.cjs.js +23 -27
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-8121f093.js → package-29dc73af.js} +1 -1
- package/dist/cjs/placement-b2bb6ec4.js +18 -0
- package/dist/cjs/{post-accordion-beac7c9f.js → post-accordion-c433c493.js} +8 -8
- package/dist/cjs/{post-accordion-item-4846fbee.js → post-accordion-item-8d5a301d.js} +5 -5
- package/dist/cjs/post-accordion-item.cjs.entry.js +3 -7
- package/dist/cjs/post-accordion.cjs.entry.js +3 -3
- package/dist/cjs/{post-avatar-a36991fb.js → post-avatar-421043df.js} +21 -4
- package/dist/cjs/post-avatar.cjs.entry.js +3 -4
- package/dist/cjs/{post-back-to-top-32aa9017.js → post-back-to-top-3cca3803.js} +8 -11
- package/dist/cjs/post-back-to-top.cjs.entry.js +3 -5
- package/dist/cjs/{post-banner-be0e8909.js → post-banner-2e99c9d8.js} +12 -17
- package/dist/cjs/post-banner.cjs.entry.js +3 -8
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +3 -7
- package/dist/cjs/{post-breadcrumbs-6ef82a41.js → post-breadcrumbs-1be50860.js} +13 -7
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +3 -3
- package/dist/cjs/{post-card-control-fe919333.js → post-card-control-0bfdad92.js} +42 -21
- package/dist/cjs/post-card-control.cjs.entry.js +3 -5
- package/dist/cjs/post-closebutton_15.cjs.entry.js +5 -9
- package/dist/cjs/{post-collapsible-trigger-f42be607.js → post-collapsible-trigger-4180b218.js} +5 -8
- package/dist/cjs/post-collapsible_2.cjs.entry.js +3 -8
- package/dist/cjs/post-components.cjs.js +1 -1
- package/dist/cjs/{post-footer-5179aa17.js → post-footer-92adffac.js} +12 -2
- package/dist/cjs/post-footer.cjs.entry.js +3 -2
- package/dist/cjs/{post-linkarea-27125078.js → post-linkarea-26c457b3.js} +1 -1
- package/dist/cjs/post-linkarea.cjs.entry.js +2 -2
- package/dist/cjs/{post-menu-item-d78a9121.js → post-menu-item-d0a53c84.js} +3 -3
- package/dist/cjs/{post-popover-feb1e773.js → post-popover-36cead3d.js} +20 -5
- package/dist/cjs/post-popover.cjs.entry.js +4 -2
- package/dist/cjs/{post-rating-6d153a2c.js → post-rating-f50a9939.js} +29 -8
- package/dist/cjs/post-rating.cjs.entry.js +4 -2
- package/dist/cjs/{post-tab-header-e4532918.js → post-tab-header-f47508da.js} +3 -3
- package/dist/cjs/post-tab-header.cjs.entry.js +3 -4
- package/dist/cjs/{post-tab-panel-40df21ad.js → post-tab-panel-7c51798b.js} +11 -2
- package/dist/cjs/post-tab-panel.cjs.entry.js +4 -2
- package/dist/cjs/{post-tabs-45db2696.js → post-tabs-2debea01.js} +2 -2
- package/dist/cjs/post-tabs.cjs.entry.js +2 -2
- package/dist/cjs/{post-tag-0967bb1e.js → post-tag-ac62c57f.js} +18 -5
- package/dist/cjs/post-tag.cjs.entry.js +4 -2
- package/dist/cjs/{post-togglebutton-42b7d166.js → post-togglebutton-43c46511.js} +85 -88
- package/dist/cjs/{post-tooltip-f833d51d.js → post-tooltip-b7dcfb44.js} +11 -10
- package/dist/cjs/{post-tooltip-trigger-3ceac010.js → post-tooltip-trigger-904061b6.js} +6 -8
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +3 -3
- package/dist/cjs/post-tooltip.cjs.entry.js +4 -3
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/post-accordion/post-accordion.js +7 -7
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +3 -3
- package/dist/collection/components/post-avatar/post-avatar.js +25 -2
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +8 -10
- package/dist/collection/components/post-banner/post-banner.js +13 -18
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +1 -1
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +15 -7
- package/dist/collection/components/post-card-control/post-card-control.js +58 -33
- 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 +4 -5
- package/dist/collection/components/post-footer/post-footer.js +14 -2
- package/dist/collection/components/post-header/post-header.css +1 -1
- package/dist/collection/components/post-header/post-header.js +29 -54
- package/dist/collection/components/post-icon/post-icon.js +17 -37
- package/dist/collection/components/post-language-option/post-language-option.js +13 -13
- package/dist/collection/components/post-language-switch/post-language-switch.js +5 -5
- package/dist/collection/components/post-logo/post-logo.js +2 -2
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +1 -1
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +3 -3
- package/dist/collection/components/post-menu/post-menu.js +13 -2
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +3 -3
- package/dist/collection/components/post-popover/post-popover.js +21 -2
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +26 -4
- package/dist/collection/components/post-rating/post-rating.js +29 -2
- package/dist/collection/components/post-tab-header/post-tab-header.js +5 -10
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +13 -2
- package/dist/collection/components/post-tabs/post-tabs.js +2 -2
- package/dist/collection/components/post-tag/post-tag.js +23 -11
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +1 -12
- package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +12 -12
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +5 -7
- package/dist/collection/types/index.js +2 -0
- package/dist/collection/types/placement.js +14 -0
- package/dist/collection/types/property-types.js +1 -0
- package/dist/collection/utils/is-value-empty.js +4 -0
- package/dist/collection/utils/property-checkers/check-one-of.js +3 -4
- package/dist/collection/utils/property-checkers/check-pattern.js +3 -4
- package/dist/collection/utils/property-checkers/check-type.js +4 -6
- package/dist/collection/utils/property-checkers/check-url.js +5 -5
- package/dist/collection/utils/property-checkers/constants.js +1 -1
- package/dist/collection/utils/property-checkers/empty-or.js +4 -6
- package/dist/collection/utils/property-checkers/index.js +6 -6
- package/dist/collection/utils/property-checkers/required-and.js +14 -0
- package/dist/components/index2.js +60 -19
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +4 -4
- package/dist/components/post-accordion2.js +7 -7
- package/dist/components/post-avatar2.js +24 -4
- package/dist/components/post-back-to-top2.js +9 -12
- package/dist/components/post-banner2.js +12 -18
- package/dist/components/post-breadcrumb-item2.js +2 -2
- package/dist/components/post-breadcrumbs2.js +14 -7
- package/dist/components/post-card-control2.js +41 -16
- package/dist/components/post-closebutton2.js +1 -1
- package/dist/components/post-collapsible-trigger2.js +3 -5
- package/dist/components/post-collapsible2.js +2 -2
- package/dist/components/post-footer2.js +13 -1
- package/dist/components/post-header2.js +31 -33
- package/dist/components/post-icon2.js +9 -25
- package/dist/components/post-language-option2.js +9 -10
- package/dist/components/post-language-switch2.js +4 -6
- package/dist/components/post-logo2.js +2 -2
- package/dist/components/post-mainnavigation2.js +1 -1
- package/dist/components/post-megadropdown-trigger2.js +4 -4
- package/dist/components/post-megadropdown2.js +1 -1
- package/dist/components/post-menu-trigger2.js +3 -3
- package/dist/components/post-menu2.js +12 -2
- package/dist/components/post-popover2.js +20 -3
- package/dist/components/post-popovercontainer2.js +37 -3
- package/dist/components/post-rating2.js +26 -1
- package/dist/components/post-tab-header2.js +2 -2
- package/dist/components/post-tab-panel2.js +12 -1
- package/dist/components/post-tabs2.js +1 -1
- package/dist/components/post-tag2.js +19 -5
- package/dist/components/post-togglebutton2.js +1 -12
- package/dist/components/post-tooltip-trigger2.js +5 -7
- package/dist/components/post-tooltip2.js +11 -11
- package/dist/components/switch-variants.js +3 -0
- package/dist/docs.json +39 -87
- package/dist/esm/index-ffccd040.js +88 -0
- package/dist/esm/index.js +23 -27
- package/dist/esm/loader.js +1 -1
- package/dist/esm/package-8503eaa8.js +3 -0
- package/dist/esm/placement-8d56605d.js +16 -0
- package/dist/esm/{post-accordion-fdcf7205.js → post-accordion-9365faca.js} +8 -8
- package/dist/esm/{post-accordion-item-e11e3804.js → post-accordion-item-2dc8e3b7.js} +5 -5
- package/dist/esm/post-accordion-item.entry.js +3 -7
- package/dist/esm/post-accordion.entry.js +3 -3
- package/dist/esm/{post-avatar-d360c6d2.js → post-avatar-4f73dc4d.js} +21 -4
- package/dist/esm/post-avatar.entry.js +3 -4
- package/dist/esm/{post-back-to-top-85796c8b.js → post-back-to-top-8f759d32.js} +8 -11
- package/dist/esm/post-back-to-top.entry.js +3 -5
- package/dist/esm/{post-banner-a3090f67.js → post-banner-ad979275.js} +12 -17
- package/dist/esm/post-banner.entry.js +3 -8
- package/dist/esm/post-breadcrumb-item_2.entry.js +3 -7
- package/dist/esm/{post-breadcrumbs-15ec5a26.js → post-breadcrumbs-a20336c7.js} +13 -7
- package/dist/esm/post-breadcrumbs.entry.js +3 -3
- package/dist/esm/{post-card-control-6142534e.js → post-card-control-3c77e778.js} +37 -16
- package/dist/esm/post-card-control.entry.js +3 -5
- package/dist/esm/post-closebutton_15.entry.js +5 -9
- package/dist/esm/{post-collapsible-trigger-68306358.js → post-collapsible-trigger-5fd0e193.js} +5 -8
- package/dist/esm/post-collapsible_2.entry.js +3 -8
- package/dist/esm/post-components.js +1 -1
- package/dist/esm/{post-footer-d2a3270e.js → post-footer-3e117b5a.js} +12 -2
- package/dist/esm/post-footer.entry.js +3 -2
- package/dist/esm/{post-linkarea-64998c67.js → post-linkarea-16a14609.js} +1 -1
- package/dist/esm/post-linkarea.entry.js +2 -2
- package/dist/esm/{post-menu-item-95a0a647.js → post-menu-item-b1604fe4.js} +3 -3
- package/dist/esm/{post-popover-c5f81087.js → post-popover-49096648.js} +17 -2
- package/dist/esm/post-popover.entry.js +4 -2
- package/dist/esm/{post-rating-7bfedafb.js → post-rating-405bee8f.js} +23 -2
- package/dist/esm/post-rating.entry.js +4 -2
- package/dist/esm/{post-tab-header-08033da4.js → post-tab-header-b228c217.js} +3 -3
- package/dist/esm/post-tab-header.entry.js +3 -4
- package/dist/esm/{post-tab-panel-be701793.js → post-tab-panel-98110b64.js} +11 -2
- package/dist/esm/post-tab-panel.entry.js +4 -2
- package/dist/esm/{post-tabs-c69e2842.js → post-tabs-44d9313c.js} +2 -2
- package/dist/esm/post-tabs.entry.js +2 -2
- package/dist/esm/{post-tag-ebac7f3e.js → post-tag-99cc9616.js} +18 -5
- package/dist/esm/post-tag.entry.js +4 -2
- package/dist/esm/{post-togglebutton-706e3af0.js → post-togglebutton-ea73e63f.js} +85 -88
- package/dist/esm/{post-tooltip-9a195d47.js → post-tooltip-78cd2988.js} +11 -10
- package/dist/esm/{post-tooltip-trigger-7d6f234b.js → post-tooltip-trigger-bdb21c45.js} +6 -8
- package/dist/esm/post-tooltip-trigger.entry.js +3 -3
- package/dist/esm/post-tooltip.entry.js +4 -3
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/p-09dd5aa4.js +1 -0
- package/dist/post-components/{p-17dc4170.js → p-0f9322e5.js} +2 -2
- package/dist/post-components/{p-de4d4274.js → p-11572299.js} +1 -1
- package/dist/post-components/p-19a83519.entry.js +1 -0
- package/dist/post-components/p-1afb3c43.entry.js +1 -0
- package/dist/post-components/p-214cd032.js +1 -0
- package/dist/post-components/p-21e5b028.js +1 -0
- package/dist/post-components/p-2320305b.js +1 -0
- package/dist/post-components/p-2523f97b.entry.js +1 -0
- package/dist/post-components/p-2bd3a436.js +1 -0
- package/dist/post-components/p-2ce8fbf5.js +1 -0
- package/dist/post-components/p-2f879f4e.entry.js +1 -0
- package/dist/post-components/p-33e26845.entry.js +1 -0
- package/dist/post-components/p-38b1c71e.entry.js +1 -0
- package/dist/post-components/p-38d59732.js +1 -0
- package/dist/post-components/p-3a67f1ff.js +1 -0
- package/dist/post-components/p-41450b6c.entry.js +1 -0
- package/dist/post-components/p-4c23ed05.entry.js +1 -0
- package/dist/post-components/p-57746c40.js +1 -0
- package/dist/post-components/p-59a38c23.js +1 -0
- package/dist/post-components/p-6313d72e.entry.js +1 -0
- package/dist/post-components/p-64e0b0fc.js +1 -0
- package/dist/post-components/p-658a2e34.entry.js +1 -0
- package/dist/post-components/p-746d3cd3.entry.js +1 -0
- package/dist/post-components/p-79a2dad0.entry.js +1 -0
- package/dist/post-components/p-7dd1807c.js +1 -0
- package/dist/post-components/p-817fbeaf.js +1 -0
- package/dist/post-components/p-85950200.js +1 -0
- package/dist/post-components/p-8ebecf22.entry.js +1 -0
- package/dist/post-components/p-8ed1cb53.entry.js +1 -0
- package/dist/post-components/p-91244b25.js +1 -0
- package/dist/post-components/{p-ab566526.js → p-91675004.js} +1 -1
- package/dist/post-components/p-94ebc430.js +1 -0
- package/dist/post-components/p-95727a4f.entry.js +1 -0
- package/dist/post-components/p-a844da3a.entry.js +1 -0
- package/dist/post-components/{p-1a21fd8d.js → p-af900651.js} +1 -1
- package/dist/post-components/p-b176309b.js +1 -0
- package/dist/post-components/p-b373659e.entry.js +1 -0
- package/dist/post-components/p-b500b245.js +1 -0
- package/dist/post-components/p-bf182745.entry.js +1 -0
- package/dist/post-components/p-c9b6f9e7.entry.js +1 -0
- package/dist/post-components/p-cb7d8f67.entry.js +1 -0
- package/dist/post-components/p-e28eb73a.js +1 -0
- package/dist/post-components/post-components.css +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/prebuild.js +26 -0
- package/dist/types/components/post-accordion/post-accordion.d.ts +2 -1
- package/dist/types/components/post-avatar/post-avatar.d.ts +3 -0
- package/dist/types/components/post-back-to-top/post-back-to-top.d.ts +1 -1
- package/dist/types/components/post-banner/post-banner.d.ts +3 -4
- package/dist/types/components/post-breadcrumbs/post-breadcrumbs.d.ts +2 -1
- package/dist/types/components/post-card-control/post-card-control.d.ts +10 -6
- package/dist/types/components/post-footer/post-footer.d.ts +2 -0
- package/dist/types/components/post-header/post-header.d.ts +5 -9
- package/dist/types/components/post-icon/post-icon.d.ts +5 -7
- package/dist/types/components/post-language-option/post-language-option.d.ts +5 -5
- package/dist/types/components/post-logo/post-logo.d.ts +1 -1
- package/dist/types/components/post-menu/post-menu.d.ts +1 -0
- package/dist/types/components/post-popover/post-popover.d.ts +2 -0
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +3 -0
- package/dist/types/components/post-rating/post-rating.d.ts +4 -0
- package/dist/types/components/post-tab-header/post-tab-header.d.ts +1 -1
- package/dist/types/components/post-tab-panel/post-tab-panel.d.ts +1 -0
- package/dist/types/components/post-tabs/post-tabs.d.ts +1 -1
- package/dist/types/components/post-tag/post-tag.d.ts +5 -3
- package/dist/types/components/post-togglebutton/post-togglebutton.d.ts +0 -1
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +3 -3
- package/dist/types/components.d.ts +38 -59
- package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/prebuild.d.ts +1 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types/types/placement.d.ts +1 -0
- package/dist/types/types/property-types.d.ts +1 -0
- package/dist/types/utils/is-value-empty.d.ts +1 -0
- package/dist/types/utils/property-checkers/check-one-of.d.ts +1 -1
- package/dist/types/utils/property-checkers/check-pattern.d.ts +1 -1
- package/dist/types/utils/property-checkers/check-type.d.ts +2 -2
- package/dist/types/utils/property-checkers/check-url.d.ts +1 -1
- package/dist/types/utils/property-checkers/constants.d.ts +1 -1
- package/dist/types/utils/property-checkers/empty-or.d.ts +3 -1
- package/dist/types/utils/property-checkers/index.d.ts +16 -9
- package/dist/types/utils/property-checkers/required-and.d.ts +3 -0
- package/loaders/index2.js +60 -19
- package/loaders/package.js +1 -1
- package/loaders/post-accordion-item2.js +4 -4
- package/loaders/post-accordion.js +7 -7
- package/loaders/post-avatar.js +24 -4
- package/loaders/post-back-to-top.js +9 -12
- package/loaders/post-banner.js +12 -18
- package/loaders/post-breadcrumb-item2.js +2 -2
- package/loaders/post-breadcrumbs.js +14 -7
- package/loaders/post-card-control.js +41 -16
- package/loaders/post-closebutton.js +1 -1
- package/loaders/post-collapsible-trigger2.js +3 -5
- package/loaders/post-collapsible2.js +2 -2
- package/loaders/post-footer.js +13 -1
- package/loaders/post-header.js +31 -33
- package/loaders/post-icon2.js +9 -25
- package/loaders/post-language-option.js +9 -10
- package/loaders/post-language-switch.js +4 -6
- package/loaders/post-logo.js +2 -2
- package/loaders/post-mainnavigation.js +1 -1
- package/loaders/post-megadropdown-trigger.js +4 -4
- package/loaders/post-megadropdown.js +1 -1
- package/loaders/post-menu-trigger2.js +3 -3
- package/loaders/post-menu2.js +12 -2
- package/loaders/post-popover.js +20 -3
- package/loaders/post-popovercontainer.js +1 -1
- package/loaders/post-popovercontainer2.js +37 -3
- package/loaders/post-rating.js +26 -1
- package/loaders/post-tab-header.js +2 -2
- package/loaders/post-tab-panel.js +12 -1
- package/loaders/post-tabs.js +1 -1
- package/loaders/post-tag.js +19 -5
- package/loaders/post-togglebutton.js +1 -12
- package/loaders/post-tooltip-trigger.js +5 -7
- package/loaders/post-tooltip.js +11 -11
- package/loaders/switch-variants.js +3 -0
- package/package.json +19 -9
- package/dist/cjs/check-non-empty-bd99d236.js +0 -15
- package/dist/cjs/check-one-of-75d270b5.js +0 -13
- package/dist/cjs/check-type-cdbf6d29.js +0 -21
- package/dist/cjs/check-url-220a286c.js +0 -19
- package/dist/cjs/constants-238701d3.js +0 -5
- package/dist/cjs/index-23e36ff7.js +0 -37
- package/dist/collection/utils/property-checkers/check-non-empty.js +0 -10
- package/dist/components/check-non-empty.js +0 -13
- package/dist/components/check-one-of.js +0 -11
- package/dist/components/check-type.js +0 -19
- package/dist/components/constants.js +0 -3
- package/dist/esm/check-non-empty-258a56b3.js +0 -13
- package/dist/esm/check-one-of-0bee20f5.js +0 -11
- package/dist/esm/check-type-37d5d307.js +0 -19
- package/dist/esm/check-url-17962bc8.js +0 -17
- package/dist/esm/constants-8d548297.js +0 -3
- package/dist/esm/index-8f8fe5b0.js +0 -32
- package/dist/esm/package-d9237b44.js +0 -3
- package/dist/post-components/p-034715ec.js +0 -1
- package/dist/post-components/p-0717fe4c.js +0 -1
- package/dist/post-components/p-0c03547b.js +0 -1
- package/dist/post-components/p-0de8d05f.js +0 -1
- package/dist/post-components/p-1373a79b.entry.js +0 -1
- package/dist/post-components/p-181c73d5.js +0 -1
- package/dist/post-components/p-1ab3eba4.entry.js +0 -1
- package/dist/post-components/p-2d6c0670.js +0 -1
- package/dist/post-components/p-2dc0a2d0.js +0 -1
- package/dist/post-components/p-35ad2e11.entry.js +0 -1
- package/dist/post-components/p-368c473a.js +0 -1
- package/dist/post-components/p-38f778a7.entry.js +0 -1
- package/dist/post-components/p-39a8df3c.entry.js +0 -1
- package/dist/post-components/p-3c7f6003.js +0 -1
- package/dist/post-components/p-440193f4.js +0 -1
- package/dist/post-components/p-474a41bc.entry.js +0 -1
- package/dist/post-components/p-69bc8eaf.entry.js +0 -1
- package/dist/post-components/p-72310bf0.entry.js +0 -1
- package/dist/post-components/p-7709c14a.js +0 -1
- package/dist/post-components/p-804b61b7.entry.js +0 -1
- package/dist/post-components/p-85fdc2d3.js +0 -1
- package/dist/post-components/p-89247caa.js +0 -1
- package/dist/post-components/p-89dc67c7.entry.js +0 -1
- package/dist/post-components/p-8f7f5200.entry.js +0 -1
- package/dist/post-components/p-964f9581.js +0 -1
- package/dist/post-components/p-a52b2d34.js +0 -1
- package/dist/post-components/p-b648e537.entry.js +0 -1
- package/dist/post-components/p-bc33a6d9.js +0 -1
- package/dist/post-components/p-bcfdbd0b.entry.js +0 -1
- package/dist/post-components/p-beb67979.js +0 -1
- package/dist/post-components/p-c41868b1.js +0 -1
- package/dist/post-components/p-c71700a7.js +0 -1
- package/dist/post-components/p-cb027003.js +0 -1
- package/dist/post-components/p-cc5b1437.js +0 -1
- package/dist/post-components/p-ceda889e.entry.js +0 -1
- package/dist/post-components/p-d45df336.js +0 -1
- package/dist/post-components/p-deb9efcf.entry.js +0 -1
- package/dist/post-components/p-e585c6fe.js +0 -1
- package/dist/post-components/p-e9f1cc46.entry.js +0 -1
- package/dist/post-components/p-ee4e776d.entry.js +0 -1
- package/dist/post-components/p-ee7c3bcc.entry.js +0 -1
- package/dist/post-components/p-f56482fa.entry.js +0 -1
- package/dist/post-components/p-f8c652ce.entry.js +0 -1
- package/dist/types/utils/property-checkers/check-non-empty.d.ts +0 -3
- package/loaders/check-non-empty.js +0 -13
- package/loaders/check-one-of.js +0 -11
- package/loaders/check-type.js +0 -19
- package/loaders/constants.js +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h, Host, } from "@stencil/core";
|
|
2
|
-
import {
|
|
2
|
+
import { checkRequiredAndType, checkEmptyOrType, checkRequiredAndOneOf } from "../../utils/index";
|
|
3
3
|
import { version } from "../../../../package";
|
|
4
4
|
let cardControlIds = 0;
|
|
5
5
|
/**
|
|
@@ -11,10 +11,10 @@ let cardControlIds = 0;
|
|
|
11
11
|
export class PostCardControl {
|
|
12
12
|
/**
|
|
13
13
|
* A public method to reset the controls `checked` and `validity` state.
|
|
14
|
-
* The validity state is set to `
|
|
14
|
+
* The validity state is set to `undefined`, so it's neither valid nor invalid.
|
|
15
15
|
*/
|
|
16
16
|
async reset() {
|
|
17
|
-
this.validity =
|
|
17
|
+
this.validity = undefined;
|
|
18
18
|
this.controlSetChecked(this.initialChecked);
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
@@ -26,10 +26,24 @@ export class PostCardControl {
|
|
|
26
26
|
this.controlSetChecked(false);
|
|
27
27
|
}
|
|
28
28
|
validateControlLabel() {
|
|
29
|
-
|
|
29
|
+
checkRequiredAndType(this, 'label', 'string');
|
|
30
|
+
}
|
|
31
|
+
validateControlDescription() {
|
|
32
|
+
checkEmptyOrType(this, 'description', 'string');
|
|
30
33
|
}
|
|
31
34
|
validateControlType() {
|
|
32
|
-
|
|
35
|
+
checkRequiredAndOneOf(this, 'type', ['checkbox', 'radio']);
|
|
36
|
+
}
|
|
37
|
+
validateControlName() {
|
|
38
|
+
checkEmptyOrType(this, 'name', 'string');
|
|
39
|
+
}
|
|
40
|
+
validateControlValue() {
|
|
41
|
+
if (this.type == 'radio') {
|
|
42
|
+
checkEmptyOrType(this, 'value', 'string');
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
validateControlIcon() {
|
|
46
|
+
checkEmptyOrType(this, 'icon', 'string');
|
|
33
47
|
}
|
|
34
48
|
updateControlChecked(checked = this.checked) {
|
|
35
49
|
this.controlSetChecked(checked);
|
|
@@ -60,14 +74,14 @@ export class PostCardControl {
|
|
|
60
74
|
this.controlId = `PostCardControl_${cardControlIds++}`;
|
|
61
75
|
this.focused = false;
|
|
62
76
|
this.label = undefined;
|
|
63
|
-
this.description =
|
|
77
|
+
this.description = undefined;
|
|
64
78
|
this.type = undefined;
|
|
65
|
-
this.name =
|
|
66
|
-
this.value =
|
|
79
|
+
this.name = undefined;
|
|
80
|
+
this.value = undefined;
|
|
67
81
|
this.checked = false;
|
|
68
82
|
this.disabled = false;
|
|
69
|
-
this.validity =
|
|
70
|
-
this.icon =
|
|
83
|
+
this.validity = undefined;
|
|
84
|
+
this.icon = undefined;
|
|
71
85
|
this.cardClickHandler = this.cardClickHandler.bind(this);
|
|
72
86
|
this.controlClickHandler = this.controlClickHandler.bind(this);
|
|
73
87
|
this.controlChangeHandler = this.controlChangeHandler.bind(this);
|
|
@@ -216,14 +230,14 @@ export class PostCardControl {
|
|
|
216
230
|
this.hasIcon = Boolean(this.host.querySelector('[slot="icon"]') || this.icon);
|
|
217
231
|
}
|
|
218
232
|
render() {
|
|
219
|
-
return (h(Host, { key: '
|
|
233
|
+
return (h(Host, { key: 'ff23ac518f715fc7c2727dd7c2abccd0fdb486da', "data-version": version, onClick: this.cardClickHandler }, h("div", { key: '3519942dfeb694729e4b6c7c7df4b68854ccde81', class: {
|
|
220
234
|
'card-control': true,
|
|
221
235
|
'is-checked': this.checked,
|
|
222
236
|
'is-disabled': this.disabled,
|
|
223
237
|
'is-focused': this.focused,
|
|
224
|
-
'is-valid': this.validity !==
|
|
225
|
-
'is-invalid': this.validity ===
|
|
226
|
-
} }, h("input", { key: '
|
|
238
|
+
'is-valid': this.validity !== undefined && this.validity !== false,
|
|
239
|
+
'is-invalid': this.validity === false,
|
|
240
|
+
} }, h("input", { key: 'f47a58485c7d507565e29c832ca1c3d6b053bc17', ref: el => (this.control = el), id: this.controlId, class: "card-control--input", type: this.type, name: this.name, value: this.value, checked: this.checked, "aria-describedby": `${this.controlId}_content`, "aria-disabled": this.disabled, "aria-invalid": this.validity === false, onClick: this.controlClickHandler, onInput: this.controlChangeHandler, onChange: this.controlChangeHandler, onFocus: this.controlFocusHandler, onBlur: this.controlFocusHandler, onKeyDown: this.controlKeyDownHandler }), h("label", { key: '65e8247d88c2cc6bb2e0be17e7d6fab3502fb364', id: `${this.controlId}_label`, htmlFor: this.controlId, class: "card-control--label" }, this.label, this.description ? (h("div", { class: "card-control--description" }, this.description)) : null), this.hasIcon ? (h("div", { class: "card-control--icon" }, h("slot", { name: "icon" }, this.icon ? h("post-icon", { name: this.icon }) : null))) : null, h("div", { key: 'df538a1f14b49fa7bd6907ef57d045c7303b6d77', id: `${this.controlId}_content`, class: "card-control--content" }, h("slot", { key: '1a79c6a2da57a5b8aef911dc2acd09e553b79489' })))));
|
|
227
241
|
}
|
|
228
242
|
componentDidRender() {
|
|
229
243
|
this.setHostContext();
|
|
@@ -231,7 +245,11 @@ export class PostCardControl {
|
|
|
231
245
|
}
|
|
232
246
|
componentDidLoad() {
|
|
233
247
|
this.validateControlLabel();
|
|
248
|
+
this.validateControlName();
|
|
249
|
+
this.validateControlValue();
|
|
250
|
+
this.validateControlDescription();
|
|
234
251
|
this.validateControlType();
|
|
252
|
+
this.validateControlIcon();
|
|
235
253
|
}
|
|
236
254
|
formAssociatedCallback() {
|
|
237
255
|
this.controlSetChecked(this.checked);
|
|
@@ -286,14 +304,13 @@ export class PostCardControl {
|
|
|
286
304
|
"references": {}
|
|
287
305
|
},
|
|
288
306
|
"required": false,
|
|
289
|
-
"optional":
|
|
307
|
+
"optional": true,
|
|
290
308
|
"docs": {
|
|
291
309
|
"tags": [],
|
|
292
310
|
"text": "Defines the description in the control-label."
|
|
293
311
|
},
|
|
294
312
|
"attribute": "description",
|
|
295
|
-
"reflect": false
|
|
296
|
-
"defaultValue": "null"
|
|
313
|
+
"reflect": false
|
|
297
314
|
},
|
|
298
315
|
"type": {
|
|
299
316
|
"type": "string",
|
|
@@ -321,14 +338,13 @@ export class PostCardControl {
|
|
|
321
338
|
"references": {}
|
|
322
339
|
},
|
|
323
340
|
"required": false,
|
|
324
|
-
"optional":
|
|
341
|
+
"optional": true,
|
|
325
342
|
"docs": {
|
|
326
343
|
"tags": [],
|
|
327
344
|
"text": "Defines the `name` attribute of the control.\n<span className=\"mb-4 banner banner-sm banner-info\">This is a required property, when the control should participate in a native `form`. If not specified, a native `form` will never contain this controls value.</span>\n<span className=\"banner banner-sm banner-info\">This is a required property, when the control is used with type `radio`.</span>"
|
|
328
345
|
},
|
|
329
346
|
"attribute": "name",
|
|
330
|
-
"reflect": false
|
|
331
|
-
"defaultValue": "null"
|
|
347
|
+
"reflect": false
|
|
332
348
|
},
|
|
333
349
|
"value": {
|
|
334
350
|
"type": "string",
|
|
@@ -339,14 +355,13 @@ export class PostCardControl {
|
|
|
339
355
|
"references": {}
|
|
340
356
|
},
|
|
341
357
|
"required": false,
|
|
342
|
-
"optional":
|
|
358
|
+
"optional": true,
|
|
343
359
|
"docs": {
|
|
344
360
|
"tags": [],
|
|
345
361
|
"text": "Defines the `value` attribute of the control. <span className=\"banner banner-sm banner-info\">This is a required property, when the control is used with type `radio`.</span>"
|
|
346
362
|
},
|
|
347
363
|
"attribute": "value",
|
|
348
|
-
"reflect": false
|
|
349
|
-
"defaultValue": "null"
|
|
364
|
+
"reflect": false
|
|
350
365
|
},
|
|
351
366
|
"checked": {
|
|
352
367
|
"type": "boolean",
|
|
@@ -385,22 +400,21 @@ export class PostCardControl {
|
|
|
385
400
|
"defaultValue": "false"
|
|
386
401
|
},
|
|
387
402
|
"validity": {
|
|
388
|
-
"type": "
|
|
403
|
+
"type": "boolean",
|
|
389
404
|
"mutable": true,
|
|
390
405
|
"complexType": {
|
|
391
|
-
"original": "
|
|
392
|
-
"resolved": "
|
|
406
|
+
"original": "boolean",
|
|
407
|
+
"resolved": "boolean",
|
|
393
408
|
"references": {}
|
|
394
409
|
},
|
|
395
410
|
"required": false,
|
|
396
|
-
"optional":
|
|
411
|
+
"optional": true,
|
|
397
412
|
"docs": {
|
|
398
413
|
"tags": [],
|
|
399
414
|
"text": "Defines the validation `validity` of the control.\nTo reset validity to an undefined state, simply remove the attribute from the control."
|
|
400
415
|
},
|
|
401
416
|
"attribute": "validity",
|
|
402
|
-
"reflect": false
|
|
403
|
-
"defaultValue": "null"
|
|
417
|
+
"reflect": false
|
|
404
418
|
},
|
|
405
419
|
"icon": {
|
|
406
420
|
"type": "string",
|
|
@@ -411,14 +425,13 @@ export class PostCardControl {
|
|
|
411
425
|
"references": {}
|
|
412
426
|
},
|
|
413
427
|
"required": false,
|
|
414
|
-
"optional":
|
|
428
|
+
"optional": true,
|
|
415
429
|
"docs": {
|
|
416
430
|
"tags": [],
|
|
417
431
|
"text": "Defines the icon `name` inside the card.\n<span className=\"banner banner-sm banner-info\">If not set the icon will not show up.</span>"
|
|
418
432
|
},
|
|
419
433
|
"attribute": "icon",
|
|
420
|
-
"reflect": false
|
|
421
|
-
"defaultValue": "null"
|
|
434
|
+
"reflect": false
|
|
422
435
|
}
|
|
423
436
|
};
|
|
424
437
|
}
|
|
@@ -475,7 +488,7 @@ export class PostCardControl {
|
|
|
475
488
|
"return": "Promise<void>"
|
|
476
489
|
},
|
|
477
490
|
"docs": {
|
|
478
|
-
"text": "A public method to reset the controls `checked` and `validity` state.\nThe validity state is set to `
|
|
491
|
+
"text": "A public method to reset the controls `checked` and `validity` state.\nThe validity state is set to `undefined`, so it's neither valid nor invalid.",
|
|
479
492
|
"tags": []
|
|
480
493
|
}
|
|
481
494
|
},
|
|
@@ -503,9 +516,21 @@ export class PostCardControl {
|
|
|
503
516
|
return [{
|
|
504
517
|
"propName": "label",
|
|
505
518
|
"methodName": "validateControlLabel"
|
|
519
|
+
}, {
|
|
520
|
+
"propName": "description",
|
|
521
|
+
"methodName": "validateControlDescription"
|
|
506
522
|
}, {
|
|
507
523
|
"propName": "type",
|
|
508
524
|
"methodName": "validateControlType"
|
|
525
|
+
}, {
|
|
526
|
+
"propName": "name",
|
|
527
|
+
"methodName": "validateControlName"
|
|
528
|
+
}, {
|
|
529
|
+
"propName": "value",
|
|
530
|
+
"methodName": "validateControlValue"
|
|
531
|
+
}, {
|
|
532
|
+
"propName": "icon",
|
|
533
|
+
"methodName": "validateControlIcon"
|
|
509
534
|
}, {
|
|
510
535
|
"propName": "checked",
|
|
511
536
|
"methodName": "updateControlChecked"
|
|
@@ -5,7 +5,7 @@ import { version } from "../../../../package";
|
|
|
5
5
|
*/
|
|
6
6
|
export class PostClosebutton {
|
|
7
7
|
render() {
|
|
8
|
-
return (h(Host, { key: '
|
|
8
|
+
return (h(Host, { key: '7b5e179b42eefd1823b2b2ef7ee17c94bd9f0ddd', "data-version": version }, h("button", { key: '471e68d1ddcfe741f5450d002b2daa86cec0f986', class: "btn btn-icon-close", type: "button" }, h("post-icon", { key: '928fa7460988cffa269a29506e68e056f84bcef8', "aria-hidden": "true", name: "closex" }), h("span", { key: 'c1501f4a8b7d8d95be7d02576b10143b9e6b0654', class: "visually-hidden" }, h("slot", { key: 'a9f1ab8db57486d420db0981090ad2ba5183c289' })))));
|
|
9
9
|
}
|
|
10
10
|
static get is() { return "post-closebutton"; }
|
|
11
11
|
static get encapsulation() { return "shadow"; }
|
|
@@ -50,7 +50,7 @@ export class PostCollapsible {
|
|
|
50
50
|
triggers.forEach(trigger => trigger.update());
|
|
51
51
|
}
|
|
52
52
|
render() {
|
|
53
|
-
return (h(Host, { key: '
|
|
53
|
+
return (h(Host, { key: '130edce2062a5f3dac3072f173d021e88dddd7cf', "data-version": version, tabindex: this.collapsed ? -1 : undefined }, h("slot", { key: '54ed1790df52911b821a4de38cd5f33c425f3399' })));
|
|
54
54
|
}
|
|
55
55
|
static get is() { return "post-collapsible"; }
|
|
56
56
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { version } from "../../../../package";
|
|
3
|
-
import {
|
|
3
|
+
import { checkRequiredAndType, eventGuard, getRoot } from "../../utils/index";
|
|
4
4
|
export class PostCollapsibleTrigger {
|
|
5
5
|
constructor() {
|
|
6
6
|
this.observer = new MutationObserver(() => this.setTrigger());
|
|
@@ -10,8 +10,7 @@ export class PostCollapsibleTrigger {
|
|
|
10
10
|
* Set the "aria-controls" and "aria-expanded" attributes on the trigger to match the state of the controlled post-collapsible
|
|
11
11
|
*/
|
|
12
12
|
validateAriaAttributes() {
|
|
13
|
-
|
|
14
|
-
checkType(this, 'for', 'string', 'The post-collapsible-trigger "for" prop should be a id.');
|
|
13
|
+
checkRequiredAndType(this, 'for', 'string');
|
|
15
14
|
}
|
|
16
15
|
/**
|
|
17
16
|
* Initiate a mutation observer that updates the trigger whenever necessary
|
|
@@ -90,7 +89,7 @@ export class PostCollapsibleTrigger {
|
|
|
90
89
|
this.updateAriaAttributes();
|
|
91
90
|
}
|
|
92
91
|
render() {
|
|
93
|
-
return (h(Host, { key: '
|
|
92
|
+
return (h(Host, { key: '8c835c780604b1138262489ca7d3313288e5ee86', "data-version": version }, h("slot", { key: 'ef354c2ca5e699a4e2c8940959f75a69918f388c' })));
|
|
94
93
|
}
|
|
95
94
|
static get is() { return "post-collapsible-trigger"; }
|
|
96
95
|
static get encapsulation() { return "shadow"; }
|
|
@@ -104,7 +103,7 @@ export class PostCollapsibleTrigger {
|
|
|
104
103
|
"resolved": "string",
|
|
105
104
|
"references": {}
|
|
106
105
|
},
|
|
107
|
-
"required":
|
|
106
|
+
"required": true,
|
|
108
107
|
"optional": false,
|
|
109
108
|
"docs": {
|
|
110
109
|
"tags": [],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { version } from "../../../../package";
|
|
3
|
-
import { breakpoint } from "../../utils/index";
|
|
3
|
+
import { checkRequiredAndType, breakpoint } from "../../utils/index";
|
|
4
4
|
/**
|
|
5
5
|
* @slot grid-{1|2|3|4}-title - Slot for the accordion headers (mobile).
|
|
6
6
|
* @slot grid-{1|2|3|4} - Slot for the accordion bodies (mobile) and the grid cells (tablet, desktop).
|
|
@@ -18,6 +18,12 @@ export class PostFooter {
|
|
|
18
18
|
this.label = undefined;
|
|
19
19
|
this.isMobile = breakpoint.get('name') === 'mobile';
|
|
20
20
|
}
|
|
21
|
+
validateLabel() {
|
|
22
|
+
checkRequiredAndType(this, 'label', 'string');
|
|
23
|
+
}
|
|
24
|
+
componentWillLoad() {
|
|
25
|
+
this.validateLabel();
|
|
26
|
+
}
|
|
21
27
|
connectedCallback() {
|
|
22
28
|
window.addEventListener('postBreakpoint:name', this.breakpointChange);
|
|
23
29
|
}
|
|
@@ -31,7 +37,7 @@ export class PostFooter {
|
|
|
31
37
|
return (h("div", { class: "footer-grid" }, h("div", null, h("slot", { name: "grid-1" })), h("div", null, h("slot", { name: "grid-2" })), h("div", null, h("slot", { name: "grid-3" })), h("div", null, h("slot", { name: "grid-4" }))));
|
|
32
38
|
}
|
|
33
39
|
render() {
|
|
34
|
-
return (h(Host, { key: '
|
|
40
|
+
return (h(Host, { key: 'bc281bf0152baa3afd8c84cffabfa30ce1e45078', "data-version": version }, h("footer", { key: '601562fd03a55f5f6c70e562fcdbd71d33806472' }, h("h2", { key: 'e2af67c5474ea7daa0f3a2d4c6e77e474cb826be', class: "visually-hidden" }, this.label), h("div", { key: '516aaf268492edc20f360ffa6e65a6cfd523212a', class: "footer-container" }, this.isMobile ? this.renderAccordion() : this.renderGrid(), h("div", { key: '9d375ab468bc83f8618e8182f9b378eed3f2f871', class: "footer-column" }, h("div", { key: '64bf6a7bbe203e585a21744323bd9e64cee2ef4f', class: "footer-socialmedia" }, h("slot", { key: 'f8c4ab3652fdbfd48db9906ea9b0a45cd9b9f034', name: "socialmedia" })), h("div", { key: '891558211351676a8917657f69c7d51d0e8d147c', class: "footer-app" }, h("slot", { key: 'e94a1a3ab56e7aa61026efa6c011fc507906147d', name: "app" }))), h("div", { key: 'dd1d69c520d0f56882c04294695dd300ed5b77a9', class: "footer-businesssectors" }, h("slot", { key: 'f2b5e4a217263815aac8ea44b30ea05081cfce53', name: "businesssectors" })), h("div", { key: '53d5f33b34c3e4a2b3563f576a16206a63a77673', class: "footer-meta" }, h("slot", { key: 'd18780dd7543d4e50f833550fcd3976d98186e86', name: "meta" })), h("div", { key: '4e057e39bf528a931de27f70d86ee938599274d8', class: "footer-copyright" }, h("slot", { key: '0dd9926c1d7ca418260f973de6eda41726ab54c0', name: "copyright" }))))));
|
|
35
41
|
}
|
|
36
42
|
static get is() { return "post-footer"; }
|
|
37
43
|
static get encapsulation() { return "shadow"; }
|
|
@@ -72,4 +78,10 @@ export class PostFooter {
|
|
|
72
78
|
};
|
|
73
79
|
}
|
|
74
80
|
static get elementRef() { return "host"; }
|
|
81
|
+
static get watchers() {
|
|
82
|
+
return [{
|
|
83
|
+
"propName": "label",
|
|
84
|
+
"methodName": "validateLabel"
|
|
85
|
+
}];
|
|
86
|
+
}
|
|
75
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
*,::before,::after{box-sizing:border-box}:host{z-index:1020;position:relative;--post-global-header-top: calc( (var(--post-global-header-height) - var(--post-global-header-reduced-height)) * -1 );--post-local-header-top: calc( -1 * (var(--post-local-header-height) - var(--post-main-navigation-height)) + var(--post-global-header-reduced-height) );--post-logo-height: calc(var(--post-global-header-height) - var(--post-header-scroll-top, 0px));--post-global-controls-top: calc(min((var(--post-header-scroll-top) / 4), 20px) * -1)}:host:has(.global-sub>*:not(.logo):focus-within),:host:has(.local-sub:focus-within){--post-global-header-top: 0;--post-local-header-top: var(--post-global-header-height);--post-logo-height: var(--post-global-header-height);--post-global-controls-top: 0}:host(:not(:has([slot=title]))) .local-header{padding-block-start:0}:host(:not(:has([slot=title]))) .local-sub{display:none}.d-flex{display:flex}.space-between{justify-content:space-between}.global-header{background-color:#fc0;display:flex;justify-content:space-between;position:sticky;padding-inline:4px;height:var(--post-global-header-height)}@media screen and (max-width: 1023.98px){.global-header{z-index:
|
|
1
|
+
*,::before,::after{box-sizing:border-box}:host{z-index:1020;position:relative;--post-global-header-top: calc( (var(--post-global-header-height) - var(--post-global-header-reduced-height)) * -1 );--post-local-header-top: calc( -1 * (var(--post-local-header-height) - var(--post-main-navigation-height)) + var(--post-global-header-reduced-height) );--post-logo-height: calc(var(--post-global-header-height) - var(--post-header-scroll-top, 0px));--post-global-controls-top: calc(min((var(--post-header-scroll-top) / 4), 20px) * -1)}:host:has(.global-sub>*:not(.logo):focus-within),:host:has(.local-sub:focus-within){--post-global-header-top: 0;--post-local-header-top: var(--post-global-header-height);--post-logo-height: var(--post-global-header-height);--post-global-controls-top: 0}@media screen and (max-width: 1023.98px){:host{position:fixed;inset:0;bottom:auto}}:host(:not(:has([slot=title]))) .local-header{padding-block-start:0}:host(:not(:has([slot=title]))) .local-sub{display:none}.d-flex{display:flex}.space-between{justify-content:space-between}.global-header{background-color:#fc0;display:flex;justify-content:space-between;position:sticky;padding-inline:4px;height:var(--post-global-header-height)}@media screen and (max-width: 1023.98px){.global-header{z-index:4;inset-block-start:0;position:relative}}@media screen and (min-width: 1024px){.global-header{z-index:5;padding-inline-end:12px;inset-block-start:var(--post-global-header-top);transition:inset-block-start .2s ease-in-out}}.global-sub{display:flex;align-items:center;gap:24px}@media screen and (min-width: 1024px){.global-sub:not(:has(.logo)){position:relative;transition:inset-block-start .2s ease-in-out;inset-block-start:var(--post-global-controls-top)}}.align-end{align-items:flex-end}.logo{flex:1 0 auto;height:var(--post-global-header-height);width:var(--post-global-header-height);min-height:var(--post-global-header-reduced-height);align-self:flex-end}@media screen and (min-width: 1024px){.logo{transition:height .2 ease-in-out;height:var(--post-logo-height)}}::slotted(ul){margin-block:0 !important;list-style:none;display:flex;padding-inline-start:0;gap:1rem;flex-shrink:0 !important}.local-header{display:flex;position:sticky;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px;min-height:var(--post-local-header-min-height);background:#fff;transition:box-shadow .2s ease-in-out}.local-header::after{content:"";position:absolute;width:100%;height:1px;background-color:#e1e0dc;inset-block-end:-1px;z-index:1}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.local-header::after{background-color:Highlight}}@media screen and (min-width: 1024px){.local-header{z-index:3;inset-block-start:var(--post-local-header-top);padding-block-start:18px;box-shadow:var(--post-device-elevation-300);transition:box-shadow .2s ease-in-out,inset-block-start .2s ease-in-out}}@media screen and (max-width: 1023.98px){.local-header{z-index:3;position:relative;padding-block:8px;flex-wrap:wrap;gap:12px}.local-header.local-header-mobile-extended::after{inset-block-end:0}.local-header:not(.local-header-mobile-extended){box-shadow:var(--post-device-elevation-300)}}.local-sub{margin-inline-end:8px}@media screen and (max-width: 1023.98px){.local-sub{margin-inline-end:4px}}::slotted(.list-inline){margin:0 !important;z-index:3 !important;position:relative !important}@media screen and (min-width: 1024px){.mobile-toggle{display:none}}.navigation{width:100%}@media screen and (min-width: 1024px){.navigation{inset-block-start:var(--post-global-header-reduced-height)}.navigation::before{display:block;content:"";position:absolute;inset:0;z-index:2;background:#fff}}@media screen and (max-width: 1023.98px){.navigation{position:sticky;z-index:2;inset-inline:0;inset-block-start:var(--post-header-height)}.mobile-menu{background-color:#fafafa}::slotted(post-mainnavigation),.navigation-footer{display:none;flex-direction:column;padding-block:16px 24px;padding-inline:32px}.navigation.extended ::slotted(post-mainnavigation),.navigation.extended .navigation-footer{display:flex}.navigation.extended>div{display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;height:calc(min(var(--post-header-scroll-parent-height, 100dvh),100dvh) - var(--post-header-height))}.navigation.extended.megadropdown-open>div{overflow-y:hidden}.navigation.extended ::slotted(post-mainnavigation){flex-grow:1 !important}::slotted(post-mainnavigation){gap:32px}.navigation-footer{background-color:#f0efed;gap:24px}}@media screen and (max-width: 599.98px){::slotted(post-mainnavigation),.navigation-footer{padding-inline:16px}}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { h, Host, } from "@stencil/core";
|
|
2
2
|
import { throttle } from "throttle-debounce";
|
|
3
3
|
import { version } from "../../../../package";
|
|
4
|
+
import { breakpoint } from "../../utils/breakpoints";
|
|
4
5
|
import { slideDown, slideUp } from "../../animations/slide";
|
|
5
6
|
import { getFocusableChildren } from "../../utils/get-focusable-children";
|
|
6
7
|
import { eventGuard } from "../../utils/event-gua";
|
|
@@ -41,8 +42,15 @@ export class PostHeader {
|
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
constructor() {
|
|
44
|
-
this.throttledResize = throttle(50, () => this.
|
|
45
|
-
this.
|
|
45
|
+
this.throttledResize = throttle(50, () => this.updateLocalHeaderHeight());
|
|
46
|
+
this.breakpointChange = (e) => {
|
|
47
|
+
this.device = e.detail;
|
|
48
|
+
this.switchLanguageSwitchMode();
|
|
49
|
+
if (this.device === 'desktop' && this.mobileMenuExtended) {
|
|
50
|
+
this.closeMobileMenu();
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
this.megadropdownStateHandler = (event) => {
|
|
46
54
|
eventGuard(this.host, event, {
|
|
47
55
|
targetLocalName: 'post-megadropdown',
|
|
48
56
|
delegatorSelector: 'post-header',
|
|
@@ -50,13 +58,12 @@ export class PostHeader {
|
|
|
50
58
|
this.megadropdownOpen = event.detail.isVisible;
|
|
51
59
|
});
|
|
52
60
|
};
|
|
53
|
-
this.device =
|
|
61
|
+
this.device = breakpoint.get('name');
|
|
54
62
|
this.mobileMenuExtended = false;
|
|
55
63
|
this.megadropdownOpen = false;
|
|
56
64
|
this.handleScrollEvent = this.handleScrollEvent.bind(this);
|
|
57
65
|
this.updateScrollParentHeight = this.updateScrollParentHeight.bind(this);
|
|
58
66
|
this.updateLocalHeaderHeight = this.updateLocalHeaderHeight.bind(this);
|
|
59
|
-
this.megedropdownStateHandler = this.megedropdownStateHandler.bind(this);
|
|
60
67
|
this.keyboardHandler = this.keyboardHandler.bind(this);
|
|
61
68
|
this.handleLinkClick = this.handleLinkClick.bind(this);
|
|
62
69
|
}
|
|
@@ -68,9 +75,11 @@ export class PostHeader {
|
|
|
68
75
|
this.scrollParent.addEventListener('scroll', this.handleScrollEvent, {
|
|
69
76
|
passive: true,
|
|
70
77
|
});
|
|
71
|
-
document.addEventListener('postToggleMegadropdown', this.
|
|
78
|
+
document.addEventListener('postToggleMegadropdown', this.megadropdownStateHandler);
|
|
72
79
|
this.host.addEventListener('click', this.handleLinkClick);
|
|
73
|
-
this.
|
|
80
|
+
window.addEventListener('postBreakpoint:name', this.breakpointChange);
|
|
81
|
+
this.switchLanguageSwitchMode();
|
|
82
|
+
this.updateLocalHeaderHeight();
|
|
74
83
|
this.handleScrollParentResize();
|
|
75
84
|
this.lockBody(false, this.mobileMenuExtended, 'mobileMenuExtended');
|
|
76
85
|
}
|
|
@@ -84,10 +93,11 @@ export class PostHeader {
|
|
|
84
93
|
// Clean up possible side effects when post-header is disconnected
|
|
85
94
|
disconnectedCallback() {
|
|
86
95
|
const scrollParent = this.scrollParent;
|
|
96
|
+
window.removeEventListener('postBreakpoint:name', this.breakpointChange);
|
|
87
97
|
window.removeEventListener('resize', this.throttledResize);
|
|
88
98
|
window.removeEventListener('scroll', this.handleScrollEvent);
|
|
89
99
|
scrollParent.removeEventListener('scroll', this.handleScrollEvent);
|
|
90
|
-
document.removeEventListener('postToggleMegadropdown', this.
|
|
100
|
+
document.removeEventListener('postToggleMegadropdown', this.megadropdownStateHandler);
|
|
91
101
|
this.host.removeEventListener('keydown', this.keyboardHandler);
|
|
92
102
|
this.host.removeEventListener('click', this.handleLinkClick);
|
|
93
103
|
if (this.scrollParentResizeObserver) {
|
|
@@ -100,6 +110,14 @@ export class PostHeader {
|
|
|
100
110
|
}
|
|
101
111
|
this.mobileMenuExtended = false;
|
|
102
112
|
}
|
|
113
|
+
async closeMobileMenu() {
|
|
114
|
+
this.mobileMenuAnimation.finish();
|
|
115
|
+
const menuButton = this.getMenuButton();
|
|
116
|
+
if (menuButton) {
|
|
117
|
+
menuButton.toggled = false;
|
|
118
|
+
}
|
|
119
|
+
this.mobileMenuExtended = false;
|
|
120
|
+
}
|
|
103
121
|
/**
|
|
104
122
|
* Toggles the mobile navigation.
|
|
105
123
|
*/
|
|
@@ -138,6 +156,9 @@ export class PostHeader {
|
|
|
138
156
|
this.firstFocusableEl = focusableChildren[0];
|
|
139
157
|
this.lastFocusableEl = focusableChildren[focusableChildren.length - 1];
|
|
140
158
|
}
|
|
159
|
+
getMenuButton() {
|
|
160
|
+
return this.host.querySelector('post-togglebutton');
|
|
161
|
+
}
|
|
141
162
|
keyboardHandler(e) {
|
|
142
163
|
if (e.key === 'Tab' && this.mobileMenuExtended) {
|
|
143
164
|
if (e.shiftKey && document.activeElement === this.firstFocusableEl) {
|
|
@@ -180,28 +201,6 @@ export class PostHeader {
|
|
|
180
201
|
}
|
|
181
202
|
}
|
|
182
203
|
}
|
|
183
|
-
handleResize() {
|
|
184
|
-
const previousDevice = this.device;
|
|
185
|
-
let newDevice;
|
|
186
|
-
const width = window?.innerWidth;
|
|
187
|
-
if (width >= 1024) {
|
|
188
|
-
newDevice = 'desktop';
|
|
189
|
-
}
|
|
190
|
-
else if (width >= 600) {
|
|
191
|
-
newDevice = 'tablet';
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
newDevice = 'mobile';
|
|
195
|
-
}
|
|
196
|
-
// Apply only on change for doing work only when necessary
|
|
197
|
-
if (newDevice !== previousDevice) {
|
|
198
|
-
this.device = newDevice;
|
|
199
|
-
this.postUpdateDevice.emit(this.device);
|
|
200
|
-
window.requestAnimationFrame(() => {
|
|
201
|
-
this.switchLanguageSwitchMode();
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
204
|
handleScrollParentResize() {
|
|
206
205
|
if (this.scrollParent) {
|
|
207
206
|
this.scrollParentResizeObserver = new ResizeObserver(this.updateScrollParentHeight);
|
|
@@ -233,7 +232,7 @@ export class PostHeader {
|
|
|
233
232
|
return (h("div", { class: navigationClasses.join(' '), style: { '--post-header-navigation-current-inset': `${mobileMenuScrollTop}px` } }, h("div", { class: "mobile-menu", ref: el => (this.mobileMenu = el) }, h("slot", { name: "post-mainnavigation" }), (this.device === 'mobile' || this.device === 'tablet') && (h("div", { class: "navigation-footer" }, h("slot", { name: "meta-navigation" }), h("slot", { name: "post-language-switch" }))))));
|
|
234
233
|
}
|
|
235
234
|
render() {
|
|
236
|
-
return (h(Host, { key: '
|
|
235
|
+
return (h(Host, { key: 'f48a0da1abf27c8e9ebaf069f56b12b9705ae8ba', "data-version": version }, h("div", { key: 'f427fe866ae03d01882f983953e316db8ce61b3f', class: "global-header" }, h("div", { key: '1681be355fa453dfe8c7f4e73d74dd52a7dc847c', class: "global-sub" }, h("div", { key: '985ee91b791c24947564ac8af001d7a1b3ef04cc', class: "logo" }, h("slot", { key: 'e961d5ad800836001ba735ab482e05fe722867ee', name: "post-logo" }))), h("div", { key: '353c38aa0dffa907d1dd55c889454ae373ab656b', class: "global-sub" }, this.device === 'desktop' && h("slot", { key: '6c1d0b4b518bd35021cf45eceb764975a1f51248', name: "meta-navigation" }), h("slot", { key: 'b814a775d1f12ec1e49e720733e90718ee0d64d3', name: "global-controls" }), this.device === 'desktop' && h("slot", { key: 'dda35455f620e178e141aca1ea103e62fe8e7fee', name: "post-language-switch" }), h("div", { key: '3c5dfdc7168af7f659b6b9ef62ba01451b257282', onClick: () => this.toggleMobileMenu(), class: "mobile-toggle" }, h("slot", { key: '5b90487f039ac8fe5d8fe7c20ca2851e2c2abc45', name: "post-togglebutton" })))), h("div", { key: '7efcbd5e59afafd9fc3fbbe55961bc694c3eeb88', class: 'local-header ' + (this.mobileMenuExtended ? 'local-header-mobile-extended' : '') }, h("slot", { key: '128925f3547041b2f6890ad9dde7e0c598dbcc22', name: "title" }), h("div", { key: 'eaa2bb08500efd23e1593dee585fe7d743986d5d', class: "local-sub" }, h("slot", { key: 'ddf6eed8f5303976464899c31c7cb8aa378acd37', name: "local-controls" }), h("slot", { key: 'f64f7ba2b47c267c3a52b356a48bd990b4da42d7' })), this.device === 'desktop' && this.renderNavigation()), this.device !== 'desktop' && this.renderNavigation()));
|
|
237
236
|
}
|
|
238
237
|
static get is() { return "post-header"; }
|
|
239
238
|
static get encapsulation() { return "shadow"; }
|
|
@@ -254,30 +253,6 @@ export class PostHeader {
|
|
|
254
253
|
"megadropdownOpen": {}
|
|
255
254
|
};
|
|
256
255
|
}
|
|
257
|
-
static get events() {
|
|
258
|
-
return [{
|
|
259
|
-
"method": "postUpdateDevice",
|
|
260
|
-
"name": "postUpdateDevice",
|
|
261
|
-
"bubbles": true,
|
|
262
|
-
"cancelable": true,
|
|
263
|
-
"composed": true,
|
|
264
|
-
"docs": {
|
|
265
|
-
"tags": [],
|
|
266
|
-
"text": "An event emitted when the device has changed"
|
|
267
|
-
},
|
|
268
|
-
"complexType": {
|
|
269
|
-
"original": "DEVICE_SIZE",
|
|
270
|
-
"resolved": "\"desktop\" | \"mobile\" | \"tablet\"",
|
|
271
|
-
"references": {
|
|
272
|
-
"DEVICE_SIZE": {
|
|
273
|
-
"location": "local",
|
|
274
|
-
"path": "/home/runner/work/design-system/design-system/packages/components/src/components/post-header/post-header.tsx",
|
|
275
|
-
"id": "src/components/post-header/post-header.tsx::DEVICE_SIZE"
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
}];
|
|
280
|
-
}
|
|
281
256
|
static get methods() {
|
|
282
257
|
return {
|
|
283
258
|
"toggleMobileMenu": {
|