@swisspost/design-system-components 9.0.0-next.8 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index-e1f32cce.js +16 -36
- package/dist/cjs/index.cjs.js +23 -44
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-a2b895fc.js → package-3ed88bb9.js} +1 -1
- package/dist/cjs/{post-accordion-3ce01432.js → post-accordion-9ef382e8.js} +2 -2
- package/dist/cjs/post-accordion-item-5f685bee.js +52 -0
- package/dist/cjs/post-accordion-item.cjs.entry.js +2 -2
- package/dist/cjs/post-accordion.cjs.entry.js +2 -2
- package/dist/cjs/post-alert-88adc668.js +99 -0
- package/dist/cjs/{post-banner.cjs.entry.js → post-alert.cjs.entry.js} +3 -3
- package/dist/cjs/post-card-control-c6e5c427.js +272 -0
- package/dist/cjs/post-card-control.cjs.entry.js +2 -2
- package/dist/cjs/{post-collapsible-trigger-8ca4d85b.js → post-collapsible-trigger-1764e6dc.js} +12 -7
- package/dist/cjs/post-collapsible_2.cjs.entry.js +2 -3
- package/dist/cjs/post-components.cjs.js +1 -1
- package/dist/cjs/post-icon-f735da00.js +139 -0
- package/dist/cjs/{post-language-option.cjs.entry.js → post-icon.cjs.entry.js} +4 -3
- package/dist/cjs/post-logo-2cd8ae98.js +39 -0
- package/dist/cjs/{post-breadcrumb-item.cjs.entry.js → post-logo.cjs.entry.js} +3 -3
- package/dist/cjs/post-popover-36c854a4.js +131 -0
- package/dist/cjs/post-popover.cjs.entry.js +2 -3
- package/dist/cjs/{post-megadropdown-trigger-7376d867.js → post-popovercontainer-cb4793c1.js} +142 -545
- package/dist/cjs/post-popovercontainer.cjs.entry.js +11 -0
- package/dist/cjs/post-rating-d5073d8d.js +88 -0
- package/dist/cjs/post-rating.cjs.entry.js +2 -2
- package/dist/cjs/post-tab-header-b756d9b1.js +32 -0
- package/dist/cjs/post-tab-header.cjs.entry.js +2 -2
- package/dist/cjs/{post-tab-panel-34aed8e6.js → post-tab-panel-97b79ecd.js} +2 -2
- package/dist/cjs/post-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/{post-tabs-dd2da5d2.js → post-tabs-834497f2.js} +8 -6
- package/dist/cjs/post-tabs.cjs.entry.js +2 -2
- package/dist/cjs/post-tag-c70fb945.js +47 -0
- package/dist/cjs/post-tag.cjs.entry.js +2 -2
- package/dist/cjs/post-tooltip-20ebe011.js +69 -0
- package/dist/cjs/{post-tooltip-3e0c1509.js → post-tooltip-trigger-6f4c9748.js} +506 -556
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +12 -0
- package/dist/cjs/post-tooltip.cjs.entry.js +2 -6
- package/dist/collection/collection-manifest.json +3 -17
- package/dist/collection/components/post-accordion/post-accordion.css +1 -1
- package/dist/collection/components/post-accordion/post-accordion.js +2 -2
- package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +8 -19
- package/dist/collection/components/post-alert/alert-types.js +1 -0
- package/dist/collection/components/post-alert/post-alert.css +35 -0
- package/dist/collection/components/{post-banner/post-banner.js → post-alert/post-alert.js} +68 -39
- package/dist/collection/components/post-card-control/post-card-control.css +30 -2
- package/dist/collection/components/post-card-control/post-card-control.js +8 -8
- package/dist/collection/components/post-collapsible/post-collapsible.js +2 -4
- package/dist/collection/components/post-icon/post-icon.css +1 -1
- package/dist/collection/components/post-icon/post-icon.js +52 -13
- package/dist/collection/components/post-logo/post-logo.js +1 -1
- package/dist/collection/components/post-popover/post-popover.css +30 -2
- package/dist/collection/components/post-popover/post-popover.js +10 -6
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +31 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +180 -52
- package/dist/collection/components/post-rating/post-rating.css +29 -1
- package/dist/collection/components/post-rating/post-rating.js +1 -1
- package/dist/collection/components/post-tab-header/post-tab-header.css +29 -1
- package/dist/collection/components/post-tab-header/post-tab-header.js +1 -1
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +1 -1
- package/dist/collection/components/post-tabs/post-tabs.css +1 -1
- package/dist/collection/components/post-tabs/post-tabs.js +6 -4
- package/dist/collection/components/post-tag/post-tag.css +29 -1
- package/dist/collection/components/post-tag/post-tag.js +2 -2
- package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +60 -213
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.css +1 -0
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +230 -0
- package/dist/collection/index.js +2 -16
- package/dist/components/index.js +2 -16
- package/dist/components/index2.js +1 -1
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +10 -27
- package/dist/components/post-accordion2.js +1 -1
- package/dist/components/{post-menu.d.ts → post-alert.d.ts} +4 -4
- package/dist/components/post-alert.js +6 -0
- package/dist/components/post-alert2.js +136 -0
- package/dist/components/post-card-control2.js +3 -3
- package/dist/components/post-collapsible-trigger2.js +8 -1
- package/dist/components/post-collapsible2.js +3 -5
- package/dist/components/post-icon2.js +54 -15
- package/dist/components/post-logo2.js +2 -2
- package/dist/components/post-popover2.js +35 -8
- package/dist/components/post-popovercontainer2.js +136 -41
- package/dist/components/post-rating2.js +2 -2
- package/dist/components/post-tab-header2.js +2 -2
- package/dist/components/post-tab-panel2.js +1 -1
- package/dist/components/post-tabs2.js +7 -5
- package/dist/components/post-tag2.js +2 -2
- package/dist/components/{post-banner.d.ts → post-tooltip-trigger.d.ts} +4 -4
- package/dist/components/post-tooltip-trigger.js +6 -0
- package/dist/components/post-tooltip-trigger2.js +4968 -0
- package/dist/components/post-tooltip2.js +32 -4962
- package/dist/docs.json +290 -1288
- package/dist/esm/{index-f8a00dc0.js → index-69587a51.js} +1 -1
- package/dist/esm/index-e1b64755.js +16 -36
- package/dist/esm/index.js +19 -26
- package/dist/esm/loader.js +1 -1
- package/dist/esm/package-983f957d.js +3 -0
- package/dist/esm/{post-accordion-19e88941.js → post-accordion-ad570427.js} +2 -2
- package/dist/esm/post-accordion-item-4db0aa2a.js +50 -0
- package/dist/esm/post-accordion-item.entry.js +3 -3
- package/dist/esm/post-accordion.entry.js +2 -2
- package/dist/esm/post-alert-1e9fbdfa.js +97 -0
- package/dist/esm/{post-banner.entry.js → post-alert.entry.js} +3 -3
- package/dist/esm/post-card-control-ccb189a8.js +270 -0
- package/dist/esm/post-card-control.entry.js +2 -2
- package/dist/esm/{post-collapsible-trigger-1d939eb6.js → post-collapsible-trigger-45fe328a.js} +12 -7
- package/dist/esm/post-collapsible_2.entry.js +3 -4
- package/dist/esm/post-components.js +1 -1
- package/dist/esm/post-icon-3fc4dd7d.js +137 -0
- package/dist/esm/post-icon.entry.js +8 -0
- package/dist/esm/post-logo-e6cdea13.js +37 -0
- package/dist/esm/post-logo.entry.js +7 -0
- package/dist/esm/post-popover-afdf4906.js +129 -0
- package/dist/esm/post-popover.entry.js +2 -3
- package/dist/esm/{post-megadropdown-trigger-210b4ab3.js → post-popovercontainer-b19b7606.js} +144 -538
- package/dist/esm/post-popovercontainer.entry.js +3 -0
- package/dist/esm/post-rating-f60024fa.js +86 -0
- package/dist/esm/post-rating.entry.js +2 -2
- package/dist/esm/post-tab-header-333e15d5.js +30 -0
- package/dist/esm/post-tab-header.entry.js +2 -2
- package/dist/esm/{post-tab-panel-afce8d40.js → post-tab-panel-0ddb05a2.js} +2 -2
- package/dist/esm/post-tab-panel.entry.js +2 -2
- package/dist/esm/{post-tabs-fbb42496.js → post-tabs-ab7853cf.js} +8 -6
- package/dist/esm/post-tabs.entry.js +2 -2
- package/dist/esm/post-tag-4a7d14b9.js +45 -0
- package/dist/esm/post-tag.entry.js +2 -2
- package/dist/esm/post-tooltip-c03cd719.js +67 -0
- package/dist/esm/{post-tooltip-7101ed24.js → post-tooltip-trigger-1fefc8ad.js} +506 -556
- package/dist/esm/post-tooltip-trigger.entry.js +4 -0
- package/dist/esm/post-tooltip.entry.js +2 -6
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/p-0a45da5e.entry.js +1 -0
- package/dist/post-components/p-12e82863.entry.js +1 -0
- package/dist/post-components/p-1386b77d.js +1 -0
- package/dist/post-components/p-1528b798.js +1 -0
- package/dist/post-components/p-18dc1299.entry.js +1 -0
- package/dist/post-components/p-1a8f6c84.entry.js +1 -0
- package/dist/post-components/p-256453ca.js +1 -0
- package/dist/post-components/p-3272ebad.js +1 -0
- package/dist/post-components/p-3596035e.js +1 -0
- package/dist/post-components/p-3668f4fa.entry.js +1 -0
- package/dist/post-components/p-375845d4.js +1 -0
- package/dist/post-components/p-381de59d.entry.js +1 -0
- package/dist/post-components/p-4e68c514.js +1 -0
- package/dist/post-components/p-4eb5d9a1.entry.js +1 -0
- package/dist/post-components/p-61a7d216.js +1 -0
- package/dist/post-components/{p-0338f9da.js → p-788e64fb.js} +1 -1
- package/dist/post-components/p-7d5b41d1.js +1 -0
- package/dist/post-components/p-82ea24e7.js +1 -0
- package/dist/post-components/p-85c4d04f.js +1 -0
- package/dist/post-components/p-85c6d001.entry.js +1 -0
- package/dist/post-components/p-8e555dda.js +15 -0
- package/dist/post-components/p-962a6f36.entry.js +1 -0
- package/dist/post-components/p-a76c71bc.js +1 -0
- package/dist/post-components/p-a7e8fd41.entry.js +1 -0
- package/dist/post-components/p-ac216bd0.entry.js +1 -0
- package/dist/post-components/p-b17ecbee.entry.js +1 -0
- package/dist/post-components/p-bb4227ad.entry.js +1 -0
- package/dist/post-components/p-bc294d0b.js +1 -0
- package/dist/post-components/p-d0b3c5d3.entry.js +1 -0
- package/dist/post-components/p-d4e148d8.entry.js +1 -0
- package/dist/post-components/p-d9809281.js +1 -0
- package/dist/post-components/p-eb1e7a49.js +1 -0
- package/dist/post-components/p-f35291d5.entry.js +1 -0
- package/dist/post-components/p-fc3bfe08.js +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-accordion/post-accordion.d.ts +1 -1
- package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +1 -5
- package/dist/types/components/post-alert/alert-types.d.ts +2 -0
- package/dist/types/components/post-alert/post-alert.d.ts +54 -0
- package/dist/types/components/post-card-control/post-card-control.d.ts +7 -7
- package/dist/types/components/post-icon/post-icon.d.ts +1 -1
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +31 -13
- package/dist/types/components/post-tag/post-tag.d.ts +1 -1
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +20 -34
- package/dist/types/components/post-tooltip-trigger/post-tooltip-trigger.d.ts +47 -0
- package/dist/types/components.d.ts +124 -490
- package/dist/types/index.d.ts +2 -16
- package/loaders/index.d.ts +4 -32
- package/loaders/index.js +4 -18
- package/loaders/index2.js +1 -1
- package/loaders/package.js +1 -1
- package/loaders/post-accordion-item.js +11 -28
- package/loaders/post-accordion.js +1 -1
- package/loaders/{post-menu.d.ts → post-alert.d.ts} +4 -4
- package/loaders/post-alert.js +139 -0
- package/loaders/post-card-control.js +3 -3
- package/loaders/post-collapsible-trigger2.js +8 -1
- package/loaders/post-collapsible2.js +3 -5
- package/loaders/post-icon2.js +54 -15
- package/loaders/post-logo.js +2 -2
- package/loaders/post-popover.js +35 -8
- package/loaders/post-popovercontainer2.js +136 -41
- package/loaders/post-rating.js +2 -2
- package/loaders/post-tab-header.js +2 -2
- package/loaders/post-tab-panel.js +1 -1
- package/loaders/post-tabs.js +7 -5
- package/loaders/post-tag.js +2 -2
- package/loaders/{post-avatar.d.ts → post-tooltip-trigger.d.ts} +4 -4
- package/loaders/post-tooltip-trigger.js +4971 -0
- package/loaders/post-tooltip.js +32 -4962
- package/package.json +5 -7
- package/dist/cjs/attribute-observer-10f08c04.js +0 -27
- package/dist/cjs/get-root-7a3498ef.js +0 -11
- package/dist/cjs/post-accordion-item-81601b1e.js +0 -62
- package/dist/cjs/post-avatar-b1c97f51.js +0 -148
- package/dist/cjs/post-avatar.cjs.entry.js +0 -13
- package/dist/cjs/post-back-to-top-0ce98569.js +0 -98
- package/dist/cjs/post-back-to-top.cjs.entry.js +0 -14
- package/dist/cjs/post-banner-8611eab5.js +0 -90
- package/dist/cjs/post-breadcrumb-item-2075462a.js +0 -49
- package/dist/cjs/post-card-control-acd30573.js +0 -272
- package/dist/cjs/post-closebutton_10.cjs.entry.js +0 -25
- package/dist/cjs/post-language-option-cf32d0ed.js +0 -68
- package/dist/cjs/post-menu-a3b7b63b.js +0 -176
- package/dist/cjs/post-menu-item-28ab1a72.js +0 -20
- package/dist/cjs/post-menu-item.cjs.entry.js +0 -11
- package/dist/cjs/post-menu-trigger-821839f5.js +0 -75
- package/dist/cjs/post-menu-trigger.cjs.entry.js +0 -13
- package/dist/cjs/post-menu.cjs.entry.js +0 -11
- package/dist/cjs/post-popover-c4f50134.js +0 -104
- package/dist/cjs/post-rating-3a87ca46.js +0 -88
- package/dist/cjs/post-tab-header-5fdb05a1.js +0 -32
- package/dist/cjs/post-tag-59232922.js +0 -47
- package/dist/cjs/post-togglebutton-59c6357b.js +0 -28
- package/dist/cjs/post-togglebutton.cjs.entry.js +0 -11
- package/dist/collection/animations/slide.js +0 -23
- package/dist/collection/components/post-avatar/post-avatar.css +0 -3
- package/dist/collection/components/post-avatar/post-avatar.js +0 -237
- package/dist/collection/components/post-back-to-top/post-back-to-top.css +0 -1
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +0 -107
- package/dist/collection/components/post-banner/banner-types.js +0 -1
- package/dist/collection/components/post-banner/post-banner.css +0 -3
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.css +0 -1
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +0 -83
- package/dist/collection/components/post-closebutton/post-closebutton.js +0 -12
- package/dist/collection/components/post-header/post-header.css +0 -1
- package/dist/collection/components/post-header/post-header.js +0 -103
- package/dist/collection/components/post-language-option/post-language-option.css +0 -3
- package/dist/collection/components/post-language-option/post-language-option.js +0 -191
- package/dist/collection/components/post-list/post-list.css +0 -3
- package/dist/collection/components/post-list/post-list.js +0 -87
- package/dist/collection/components/post-list-item/post-list-item.css +0 -1
- package/dist/collection/components/post-list-item/post-list-item.js +0 -25
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +0 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +0 -61
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +0 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +0 -137
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +0 -1
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +0 -48
- package/dist/collection/components/post-menu/post-menu.css +0 -3
- package/dist/collection/components/post-menu/post-menu.js +0 -278
- package/dist/collection/components/post-menu-item/post-menu-item.css +0 -1
- package/dist/collection/components/post-menu-item/post-menu-item.js +0 -20
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.css +0 -1
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +0 -104
- package/dist/collection/components/post-togglebutton/post-togglebutton.css +0 -1
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +0 -56
- package/dist/collection/utils/is-focusable.js +0 -26
- package/dist/components/attribute-observer.js +0 -25
- package/dist/components/get-root.js +0 -9
- package/dist/components/post-avatar.d.ts +0 -11
- package/dist/components/post-avatar.js +0 -6
- package/dist/components/post-avatar2.js +0 -173
- package/dist/components/post-back-to-top.d.ts +0 -11
- package/dist/components/post-back-to-top.js +0 -6
- package/dist/components/post-back-to-top2.js +0 -123
- package/dist/components/post-banner.js +0 -6
- package/dist/components/post-banner2.js +0 -125
- package/dist/components/post-breadcrumb-item.d.ts +0 -11
- package/dist/components/post-breadcrumb-item.js +0 -6
- package/dist/components/post-breadcrumb-item2.js +0 -72
- package/dist/components/post-closebutton.d.ts +0 -11
- package/dist/components/post-closebutton.js +0 -6
- package/dist/components/post-closebutton2.js +0 -34
- package/dist/components/post-header.d.ts +0 -11
- package/dist/components/post-header.js +0 -6
- package/dist/components/post-header2.js +0 -235
- package/dist/components/post-language-option.d.ts +0 -11
- package/dist/components/post-language-option.js +0 -6
- package/dist/components/post-language-option2.js +0 -92
- package/dist/components/post-list-item.d.ts +0 -11
- package/dist/components/post-list-item.js +0 -6
- package/dist/components/post-list-item2.js +0 -35
- package/dist/components/post-list.d.ts +0 -11
- package/dist/components/post-list.js +0 -6
- package/dist/components/post-list2.js +0 -53
- package/dist/components/post-mainnavigation.d.ts +0 -11
- package/dist/components/post-mainnavigation.js +0 -6
- package/dist/components/post-mainnavigation2.js +0 -48
- package/dist/components/post-megadropdown-trigger.d.ts +0 -11
- package/dist/components/post-megadropdown-trigger.js +0 -6
- package/dist/components/post-megadropdown-trigger2.js +0 -39
- package/dist/components/post-megadropdown.d.ts +0 -11
- package/dist/components/post-megadropdown.js +0 -6
- package/dist/components/post-megadropdown2.js +0 -67
- package/dist/components/post-menu-item.d.ts +0 -11
- package/dist/components/post-menu-item.js +0 -6
- package/dist/components/post-menu-item2.js +0 -33
- package/dist/components/post-menu-trigger.d.ts +0 -11
- package/dist/components/post-menu-trigger.js +0 -6
- package/dist/components/post-menu-trigger2.js +0 -92
- package/dist/components/post-menu.js +0 -6
- package/dist/components/post-menu2.js +0 -201
- package/dist/components/post-togglebutton.d.ts +0 -11
- package/dist/components/post-togglebutton.js +0 -6
- package/dist/components/post-togglebutton2.js +0 -43
- package/dist/esm/attribute-observer-37fa950a.js +0 -25
- package/dist/esm/get-root-7af2e0d1.js +0 -9
- package/dist/esm/package-9cafe148.js +0 -3
- package/dist/esm/post-accordion-item-33bbe4de.js +0 -60
- package/dist/esm/post-avatar-d15a9f9e.js +0 -146
- package/dist/esm/post-avatar.entry.js +0 -5
- package/dist/esm/post-back-to-top-bcf46150.js +0 -96
- package/dist/esm/post-back-to-top.entry.js +0 -6
- package/dist/esm/post-banner-bf5e6a18.js +0 -88
- package/dist/esm/post-breadcrumb-item-e3b41f74.js +0 -47
- package/dist/esm/post-breadcrumb-item.entry.js +0 -7
- package/dist/esm/post-card-control-f0788f6f.js +0 -270
- package/dist/esm/post-closebutton_10.entry.js +0 -8
- package/dist/esm/post-language-option-1436370d.js +0 -66
- package/dist/esm/post-language-option.entry.js +0 -7
- package/dist/esm/post-menu-e853e28b.js +0 -174
- package/dist/esm/post-menu-item-86d4c7ab.js +0 -18
- package/dist/esm/post-menu-item.entry.js +0 -3
- package/dist/esm/post-menu-trigger-80c2bdf4.js +0 -73
- package/dist/esm/post-menu-trigger.entry.js +0 -5
- package/dist/esm/post-menu.entry.js +0 -3
- package/dist/esm/post-popover-7195d05a.js +0 -102
- package/dist/esm/post-rating-8baf86fe.js +0 -86
- package/dist/esm/post-tab-header-a1d1d9d0.js +0 -30
- package/dist/esm/post-tag-d67b6a19.js +0 -45
- package/dist/esm/post-togglebutton-c3fb912d.js +0 -26
- package/dist/esm/post-togglebutton.entry.js +0 -3
- package/dist/post-components/p-00fa0152.js +0 -1
- package/dist/post-components/p-1667387e.entry.js +0 -1
- package/dist/post-components/p-19551c18.entry.js +0 -1
- package/dist/post-components/p-1b627f80.js +0 -1
- package/dist/post-components/p-24673919.js +0 -1
- package/dist/post-components/p-266b734f.entry.js +0 -1
- package/dist/post-components/p-282115c4.js +0 -1
- package/dist/post-components/p-2d0ffc1e.entry.js +0 -1
- package/dist/post-components/p-45018d7e.entry.js +0 -1
- package/dist/post-components/p-485dafcf.js +0 -1
- package/dist/post-components/p-4a647a78.js +0 -1
- package/dist/post-components/p-4abfa65b.js +0 -1
- package/dist/post-components/p-517f2b1f.entry.js +0 -1
- package/dist/post-components/p-55224ee7.entry.js +0 -1
- package/dist/post-components/p-558a9849.js +0 -1
- package/dist/post-components/p-59b31557.js +0 -1
- package/dist/post-components/p-5d1db85c.entry.js +0 -1
- package/dist/post-components/p-61e79941.js +0 -1
- package/dist/post-components/p-679978de.entry.js +0 -1
- package/dist/post-components/p-6a842b96.entry.js +0 -1
- package/dist/post-components/p-6adeaa6c.js +0 -1
- package/dist/post-components/p-6cea23cd.js +0 -15
- package/dist/post-components/p-71f03424.js +0 -1
- package/dist/post-components/p-8c2568c1.entry.js +0 -1
- package/dist/post-components/p-8fd3a3cb.entry.js +0 -1
- package/dist/post-components/p-939f2ba7.js +0 -1
- package/dist/post-components/p-a4c39296.entry.js +0 -1
- package/dist/post-components/p-af5d3b89.entry.js +0 -1
- package/dist/post-components/p-b4423249.entry.js +0 -1
- package/dist/post-components/p-c31a7d65.entry.js +0 -1
- package/dist/post-components/p-c544bb82.js +0 -1
- package/dist/post-components/p-ccb6dfa1.js +0 -1
- package/dist/post-components/p-d0b8820a.js +0 -1
- package/dist/post-components/p-d36adfb5.js +0 -1
- package/dist/post-components/p-da6a8268.entry.js +0 -1
- package/dist/post-components/p-ece14d88.js +0 -1
- package/dist/post-components/p-f0f8427e.js +0 -1
- package/dist/post-components/p-f2e1b4d8.js +0 -1
- package/dist/post-components/p-f627744e.js +0 -1
- package/dist/post-components/p-f7b6b96a.entry.js +0 -1
- package/dist/post-components/p-f812e93d.entry.js +0 -1
- package/dist/post-components/p-f8d41c32.js +0 -1
- package/dist/post-components/p-fc91cbc2.js +0 -1
- package/dist/post-components/p-fe516cdf.entry.js +0 -1
- package/dist/post-components/p-fe7467fb.entry.js +0 -1
- package/dist/types/animations/slide.d.ts +0 -2
- package/dist/types/components/post-avatar/post-avatar.d.ts +0 -51
- package/dist/types/components/post-back-to-top/post-back-to-top.d.ts +0 -19
- package/dist/types/components/post-banner/banner-types.d.ts +0 -2
- package/dist/types/components/post-banner/post-banner.d.ts +0 -49
- package/dist/types/components/post-breadcrumb-item/post-breadcrumb-item.d.ts +0 -15
- package/dist/types/components/post-closebutton/post-closebutton.d.ts +0 -7
- package/dist/types/components/post-header/post-header.d.ts +0 -16
- package/dist/types/components/post-language-option/post-language-option.d.ts +0 -40
- package/dist/types/components/post-list/post-list.d.ts +0 -24
- package/dist/types/components/post-list-item/post-list-item.d.ts +0 -8
- package/dist/types/components/post-mainnavigation/post-mainnavigation.d.ts +0 -10
- package/dist/types/components/post-megadropdown/post-megadropdown.d.ts +0 -23
- package/dist/types/components/post-megadropdown-trigger/post-megadropdown-trigger.d.ts +0 -10
- package/dist/types/components/post-menu/post-menu.d.ts +0 -47
- package/dist/types/components/post-menu-item/post-menu-item.d.ts +0 -4
- package/dist/types/components/post-menu-trigger/post-menu-trigger.d.ts +0 -27
- package/dist/types/components/post-togglebutton/post-togglebutton.d.ts +0 -13
- package/dist/types/utils/is-focusable.d.ts +0 -1
- package/loaders/attribute-observer.js +0 -25
- package/loaders/get-root.js +0 -9
- package/loaders/post-avatar.js +0 -176
- package/loaders/post-back-to-top.d.ts +0 -11
- package/loaders/post-back-to-top.js +0 -126
- package/loaders/post-banner.d.ts +0 -11
- package/loaders/post-banner.js +0 -128
- package/loaders/post-breadcrumb-item.d.ts +0 -11
- package/loaders/post-breadcrumb-item.js +0 -75
- package/loaders/post-closebutton.d.ts +0 -11
- package/loaders/post-closebutton.js +0 -37
- package/loaders/post-header.d.ts +0 -11
- package/loaders/post-header.js +0 -238
- package/loaders/post-language-option.d.ts +0 -11
- package/loaders/post-language-option.js +0 -95
- package/loaders/post-list-item.d.ts +0 -11
- package/loaders/post-list-item.js +0 -38
- package/loaders/post-list.d.ts +0 -11
- package/loaders/post-list.js +0 -56
- package/loaders/post-mainnavigation.d.ts +0 -11
- package/loaders/post-mainnavigation.js +0 -51
- package/loaders/post-megadropdown-trigger.d.ts +0 -11
- package/loaders/post-megadropdown-trigger.js +0 -42
- package/loaders/post-megadropdown.d.ts +0 -11
- package/loaders/post-megadropdown.js +0 -70
- package/loaders/post-menu-item.d.ts +0 -11
- package/loaders/post-menu-item.js +0 -36
- package/loaders/post-menu-trigger.d.ts +0 -11
- package/loaders/post-menu-trigger.js +0 -95
- package/loaders/post-menu.js +0 -204
- package/loaders/post-togglebutton.d.ts +0 -11
- package/loaders/post-togglebutton.js +0 -46
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swisspost/design-system-components",
|
|
3
|
-
"version": "9.0.0
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"description": "A collection of web components built with Stencil JS for the Swiss Post Design System.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
@@ -26,8 +26,7 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@floating-ui/dom": "1.6.8",
|
|
28
28
|
"@oddbird/popover-polyfill": "0.3.7",
|
|
29
|
-
"@swisspost/design-system-styles": "9.0.0
|
|
30
|
-
"@swisspost/design-system-icons": "9.0.0-next.8",
|
|
29
|
+
"@swisspost/design-system-styles": "9.0.0",
|
|
31
30
|
"ally.js": "1.4.1",
|
|
32
31
|
"long-press-event": "2.5.0"
|
|
33
32
|
},
|
|
@@ -51,8 +50,7 @@
|
|
|
51
50
|
"eslint-plugin-react": "7.35.0",
|
|
52
51
|
"rimraf": "6.0.1",
|
|
53
52
|
"rollup-plugin-postcss": "4.0.2",
|
|
54
|
-
"sass": "1.
|
|
55
|
-
"throttle-debounce": "5.0.2",
|
|
53
|
+
"sass": "1.77.8",
|
|
56
54
|
"ts-jest": "29.2.4",
|
|
57
55
|
"typescript": "5.5.4"
|
|
58
56
|
},
|
|
@@ -72,8 +70,8 @@
|
|
|
72
70
|
"test": "pnpm run unit",
|
|
73
71
|
"unit": "stencil test --spec",
|
|
74
72
|
"unit:watch": "stencil test --spec --watchAll --silent",
|
|
75
|
-
"e2e": "cypress run
|
|
76
|
-
"e2e:ci": "xvfb-run -a cypress run
|
|
73
|
+
"e2e": "cypress run",
|
|
74
|
+
"e2e:ci": "xvfb-run -a cypress run",
|
|
77
75
|
"e2e:watch": "cypress open",
|
|
78
76
|
"generate": "stencil generate",
|
|
79
77
|
"lint": "eslint src/**/*{.ts,.tsx}"
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const getAttributeObserver = (attribute, handler) => {
|
|
4
|
-
/**
|
|
5
|
-
* Handle attribute changes and childList changes from the observer
|
|
6
|
-
* @param {MutationRecord[]} mutationList
|
|
7
|
-
*/
|
|
8
|
-
const observerHandler = (mutationList) => {
|
|
9
|
-
mutationList.forEach(mutation => {
|
|
10
|
-
if (mutation.type === 'attributes' && mutation.attributeName === attribute) {
|
|
11
|
-
handler(mutation.target);
|
|
12
|
-
}
|
|
13
|
-
if (mutation.type === 'childList') {
|
|
14
|
-
mutation.addedNodes.forEach(node => {
|
|
15
|
-
if (node.nodeType === Node.ELEMENT_NODE &&
|
|
16
|
-
node.hasAttribute(attribute)) {
|
|
17
|
-
handler(node);
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
// Initialize a mutation observer for patching accessibility features
|
|
24
|
-
return new MutationObserver(observerHandler);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
exports.getAttributeObserver = getAttributeObserver;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function getRoot(element) {
|
|
4
|
-
const root = element.getRootNode();
|
|
5
|
-
if (root instanceof Document || root instanceof ShadowRoot) {
|
|
6
|
-
return root;
|
|
7
|
-
}
|
|
8
|
-
throw new Error('Attempting to access root node before the element is attached to the document or shadow tree.');
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
exports.getRoot = getRoot;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const index = require('./index-e1f32cce.js');
|
|
4
|
-
const _package = require('./package-a2b895fc.js');
|
|
5
|
-
const headingLevels = require('./heading-levels-608d432e.js');
|
|
6
|
-
const index$1 = require('./index-824d2b71.js');
|
|
7
|
-
|
|
8
|
-
const postAccordionItemCss = ":host::after{display:block;content:\"\";margin-top:calc(var(--post-device-border-width-default)*-1);border-bottom:var(--post-device-border-width-default) var(--post-core-border-style-solid) var(--post-scheme-color-interactive-primary-enabled-stroke)}:host:has(.accordion-button:hover)::after{border-color:var(--post-scheme-color-interactive-primary-hover-stroke)}.accordion-header{color:var(--post-scheme-color-interactive-primary-enabled-fg1);font-size:var(--post-device-font-size-5);margin:0;line-height:var(--post-device-line-height-heading);font-weight:var(--post-device-font-weight-black)}.accordion-button{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button;display:flex;position:relative;width:100%;align-items:center;text-align:start;gap:var(--post-device-spacing-gap-7);padding:calc(var(--post-device-spacing-padding-19) + var(--post-device-border-width-default)) calc(var(--post-device-spacing-padding-5) + var(--post-device-border-width-default));transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;cursor:pointer}.accordion-button::before{display:block;position:absolute;content:\"\";inset:0;bottom:auto;border-top:var(--post-accordion-button-border-top)}.accordion-button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}.accordion-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:var(--post-device-border-radius-focus)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.accordion-button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:var(--post-device-border-radius-focus)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.accordion-button slot::slotted(span[slot=header]){flex-grow:1}.accordion-button post-icon{flex:none;width:var(--post-core-dimension-24);aspect-ratio:1;transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}.accordion-button.collapsed{padding-block-start:calc(var(--post-device-spacing-padding-19) + var(--post-device-border-width-default));padding-block-end:calc(var(--post-device-spacing-padding-19) + var(--post-device-border-width-default))}.accordion-button.collapsed post-icon{transform:rotate(-180deg)}.accordion-button:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1)}.accordion-button>::slotted(.text-truncate){display:block}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button:hover:not(:disabled),.accordion-button:focus-visible:not(:disabled){outline:var(--post-device-border-width-default) solid Highlight}.accordion-button:disabled{opacity:1 !important}}.accordion-body{padding-block-start:var(--post-device-spacing-padding-15);padding-block-end:calc(var(--post-device-spacing-padding-block-25) + var(--post-device-border-width-default));padding-inline:var(--post-device-spacing-padding-5)}.logo-container{display:none;width:var(--post-device-sizing-logo-1);aspect-ratio:1}.logo-container.has-image{display:block}.logo-container slot::slotted(img){display:block;width:100%;height:100%;object-fit:cover}.accordion-button>::slotted(:first-child),.accordion-body>::slotted(:first-child){margin-block-start:0 !important}.accordion-button>::slotted(:last-child),.accordion-body>::slotted(:last-child){margin-block-end:0 !important}";
|
|
9
|
-
const PostAccordionItemStyle0 = postAccordionItemCss;
|
|
10
|
-
|
|
11
|
-
const PostAccordionItem = class {
|
|
12
|
-
constructor(hostRef) {
|
|
13
|
-
index.registerInstance(this, hostRef);
|
|
14
|
-
this.id = undefined;
|
|
15
|
-
this.slottedLogo = undefined;
|
|
16
|
-
this.collapsed = false;
|
|
17
|
-
this.headingLevel = undefined;
|
|
18
|
-
}
|
|
19
|
-
validateHeadingLevel(newValue = this.headingLevel) {
|
|
20
|
-
index$1.checkEmptyOrOneOf(newValue, headingLevels.HEADING_LEVELS, 'The `heading-level` property of the `post-accordion-item` must be a number between 1 and 6.');
|
|
21
|
-
}
|
|
22
|
-
componentWillLoad() {
|
|
23
|
-
this.id = this.host.id || `a${crypto.randomUUID()}`;
|
|
24
|
-
}
|
|
25
|
-
componentDidLoad() {
|
|
26
|
-
this.validateHeadingLevel();
|
|
27
|
-
}
|
|
28
|
-
// capture to make sure the "collapsed" property is updated before the event is consumed
|
|
29
|
-
onCollapseToggle(event) {
|
|
30
|
-
if (event.target === this.host &&
|
|
31
|
-
event.target.localName === 'post-accordion-item') {
|
|
32
|
-
this.collapsed = !event.detail;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Triggers the collapse programmatically.
|
|
37
|
-
*/
|
|
38
|
-
async toggle(force) {
|
|
39
|
-
return this.collapsible.toggle(force);
|
|
40
|
-
}
|
|
41
|
-
onSlotLogoChange() {
|
|
42
|
-
this.slottedLogo = this.host.querySelector('img[slot="logo"]');
|
|
43
|
-
}
|
|
44
|
-
componentWillRender() {
|
|
45
|
-
this.slottedLogo = this.host.querySelector('img[slot="logo"]');
|
|
46
|
-
}
|
|
47
|
-
render() {
|
|
48
|
-
var _a;
|
|
49
|
-
const HeadingTag = `h${(_a = this.headingLevel) !== null && _a !== void 0 ? _a : 2}`;
|
|
50
|
-
return (index.h(index.Host, { key: 'c125939ea36a2d8d98f645ff2e22863cfe799a73', id: this.id, "data-version": _package.version }, index.h("div", { key: '2d8ac2807d839745562b72e2db650886a7f04d8d', part: "accordion-item", class: "accordion-item" }, index.h("post-collapsible-trigger", { key: '4b2743a143c21bbff7cc3be3f8f9833b97327605', for: `${this.id}--collapse` }, index.h(HeadingTag, { key: 'c2073d092cb021ac7825184c0634f3f903f119ae', class: "accordion-header", id: `${this.id}--header` }, index.h("button", { key: '663915c767685ac0f57dd04071e3d525312f4fa7', type: "button", class: `accordion-button${this.collapsed ? ' collapsed' : ''}` }, index.h("span", { key: 'bbd07f382cdb69334fc8540fc48db81865caa4b2', class: {
|
|
51
|
-
'logo-container': true,
|
|
52
|
-
'has-image': !!this.slottedLogo,
|
|
53
|
-
} }, index.h("slot", { key: '9d1e97d3c93a7ef406a743a2a877660f3de9747e', name: "logo", onSlotchange: this.onSlotLogoChange.bind(this) })), index.h("slot", { key: 'ffdaac001188bc920bc43145604b0208427fbe59', name: "header" }), index.h("post-icon", { key: '6cba37b29b734819a698a0043d8d4924fd496309', name: "2051" })))), index.h("post-collapsible", { key: '915f7e9063066ca1adf684157832d70a961c20e0', id: `${this.id}--collapse`, collapsed: this.collapsed, ref: el => (this.collapsible = el) }, index.h("div", { key: 'e1d38f9f25a93dcf5aa3bbb94b8baed46b337616', class: "accordion-body" }, index.h("slot", { key: 'fbfb6764e6a8d3dfda7b87fe0a61d62d90d59b7e' }))))));
|
|
54
|
-
}
|
|
55
|
-
get host() { return index.getElement(this); }
|
|
56
|
-
static get watchers() { return {
|
|
57
|
-
"headingLevel": ["validateHeadingLevel"]
|
|
58
|
-
}; }
|
|
59
|
-
};
|
|
60
|
-
PostAccordionItem.style = PostAccordionItemStyle0;
|
|
61
|
-
|
|
62
|
-
exports.PostAccordionItem = PostAccordionItem;
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const index = require('./index-e1f32cce.js');
|
|
4
|
-
const _package = require('./package-a2b895fc.js');
|
|
5
|
-
const checkNonEmpty = require('./check-non-empty-eeaa8f77.js');
|
|
6
|
-
|
|
7
|
-
const postAvatarCss = "/*!\n * Copyright 2021 by Swiss Post, Information Technology\n */:host{--post-avatar-bg:var(--post-scheme-color-interactive-primary-enabled-bg2);--post-avatar-fg:var(--post-scheme-color-interactive-primary-enabled-fg3);display:inline-flex;position:relative;width:var(--post-device-sizing-interactive-icon-size3);height:var(--post-device-sizing-interactive-icon-size3);background-color:var(--post-scheme-color-interactive-primary-enabled-stroke3);border:var(--post-device-border-width-default) solid var(--post-scheme-color-interactive-primary-enabled-stroke3);border-radius:var(--post-device-border-radius-round);font-size:var(--post-device-font-size-8);vertical-align:top;line-height:1}:host::after{display:block;content:\"\";position:absolute;inset:0;z-index:1;border-radius:inherit}*,*::before,*::after{box-sizing:border-box}slot,img,::slotted(img){display:block;width:100%;height:100%}img,::slotted(img){border-radius:var(--post-device-border-radius-round)}::slotted(:not(img)){display:none !important}.initials{display:flex;justify-content:center;align-items:center;position:relative;z-index:2;width:100%;height:100%;background-color:var(--post-avatar-bg);border-radius:var(--post-device-border-radius-round);color:var(--post-avatar-fg);text-transform:uppercase}.initials span{width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.initials span:not(caption){position:absolute !important}";
|
|
8
|
-
const PostAvatarStyle0 = postAvatarCss;
|
|
9
|
-
|
|
10
|
-
// https://docs.gravatar.com/api/avatars/images/
|
|
11
|
-
const GRAVATAR_DEFAULT = '404';
|
|
12
|
-
const GRAVATAR_RATING = 'g';
|
|
13
|
-
const GRAVATAR_SIZE = 80;
|
|
14
|
-
const GRAVATAR_BASE_URL = `https://www.gravatar.com/avatar/{email}?s=${GRAVATAR_SIZE}&d=${GRAVATAR_DEFAULT}&r=${GRAVATAR_RATING}`;
|
|
15
|
-
var AvatarType;
|
|
16
|
-
(function (AvatarType) {
|
|
17
|
-
AvatarType["Slotted"] = "slotted";
|
|
18
|
-
AvatarType["Image"] = "image";
|
|
19
|
-
AvatarType["Initials"] = "initials";
|
|
20
|
-
AvatarType[AvatarType["Null"] = null] = "Null";
|
|
21
|
-
})(AvatarType || (AvatarType = {}));
|
|
22
|
-
const PostAvatar = class {
|
|
23
|
-
constructor(hostRef) {
|
|
24
|
-
index.registerInstance(this, hostRef);
|
|
25
|
-
this.firstname = undefined;
|
|
26
|
-
this.lastname = undefined;
|
|
27
|
-
this.userid = undefined;
|
|
28
|
-
this.email = undefined;
|
|
29
|
-
this.slottedImage = undefined;
|
|
30
|
-
this.avatarType = null;
|
|
31
|
-
this.imageUrl = '';
|
|
32
|
-
this.imageAlt = '';
|
|
33
|
-
this.initials = '';
|
|
34
|
-
}
|
|
35
|
-
validateFirstname() {
|
|
36
|
-
checkNonEmpty.checkNonEmpty(this.firstname, 'The `firstname` property of the `post-avatar` is required!');
|
|
37
|
-
}
|
|
38
|
-
async getAvatar() {
|
|
39
|
-
if (this.slottedImage !== null) {
|
|
40
|
-
this.avatarType = AvatarType.Slotted;
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
let imageLoaded = false;
|
|
44
|
-
if (!imageLoaded && this.userid)
|
|
45
|
-
imageLoaded = await this.getImageByProp(this.userid, this.fetchImageByUserId.bind(this));
|
|
46
|
-
if (!imageLoaded && this.email)
|
|
47
|
-
imageLoaded = await this.getImageByProp(this.email, this.fetchImageByEmail.bind(this));
|
|
48
|
-
if (!imageLoaded)
|
|
49
|
-
this.getAvatarByInitials();
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
async getImageByProp(prop, fetchImage) {
|
|
53
|
-
var _a;
|
|
54
|
-
if (!prop)
|
|
55
|
-
return false;
|
|
56
|
-
const imageResponse = (_a = (await this.getStorageItem(prop))) !== null && _a !== void 0 ? _a : { ok: false, url: '' };
|
|
57
|
-
if (!imageResponse.ok) {
|
|
58
|
-
try {
|
|
59
|
-
const r = await fetchImage();
|
|
60
|
-
imageResponse.ok = r.ok;
|
|
61
|
-
imageResponse.url = r.url;
|
|
62
|
-
this.imageUrl = imageResponse.url;
|
|
63
|
-
this.imageAlt = `${this.firstname} ${this.lastname} avatar`;
|
|
64
|
-
this.avatarType = AvatarType.Image;
|
|
65
|
-
this.setStorageItem(this.userid, JSON.stringify(imageResponse));
|
|
66
|
-
}
|
|
67
|
-
catch (error) {
|
|
68
|
-
this.removeStorageItem(prop);
|
|
69
|
-
console.info(`Loading avatar by type "${AvatarType.Image}" failed.`);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return imageResponse.ok;
|
|
73
|
-
}
|
|
74
|
-
async fetchImageByUserId() {
|
|
75
|
-
return await fetch(PostAvatar.INTERNAL_USERID_IMAGE_SRC.replace('{userid}', encodeURIComponent(this.userid)));
|
|
76
|
-
}
|
|
77
|
-
async fetchImageByEmail() {
|
|
78
|
-
const email = await this.cryptify(this.email);
|
|
79
|
-
const imageUrl = GRAVATAR_BASE_URL.replace('{email}', email);
|
|
80
|
-
return await fetch(imageUrl);
|
|
81
|
-
}
|
|
82
|
-
getAvatarByInitials() {
|
|
83
|
-
this.initials = this.getInitials();
|
|
84
|
-
this.avatarType = AvatarType.Initials;
|
|
85
|
-
}
|
|
86
|
-
getNames() {
|
|
87
|
-
return [this.firstname, this.lastname].filter(n => n);
|
|
88
|
-
}
|
|
89
|
-
getInitials() {
|
|
90
|
-
return this.getNames()
|
|
91
|
-
.map(n => n.charAt(0))
|
|
92
|
-
.join('')
|
|
93
|
-
.trim();
|
|
94
|
-
}
|
|
95
|
-
async getStorageItem(keyToken) {
|
|
96
|
-
var _a;
|
|
97
|
-
const key = await this.cryptify(keyToken);
|
|
98
|
-
const value = (_a = window === null || window === void 0 ? void 0 : window.sessionStorage) === null || _a === void 0 ? void 0 : _a.getItem(key);
|
|
99
|
-
return value ? JSON.parse(value) : null;
|
|
100
|
-
}
|
|
101
|
-
async setStorageItem(keyToken, value) {
|
|
102
|
-
var _a;
|
|
103
|
-
const key = await this.cryptify(keyToken);
|
|
104
|
-
(_a = window === null || window === void 0 ? void 0 : window.sessionStorage) === null || _a === void 0 ? void 0 : _a.setItem(key, value);
|
|
105
|
-
}
|
|
106
|
-
async removeStorageItem(keyToken) {
|
|
107
|
-
var _a;
|
|
108
|
-
const key = await this.cryptify(keyToken);
|
|
109
|
-
(_a = window === null || window === void 0 ? void 0 : window.sessionStorage) === null || _a === void 0 ? void 0 : _a.removeItem(key);
|
|
110
|
-
}
|
|
111
|
-
async cryptify(key) {
|
|
112
|
-
return await crypto.subtle.digest('SHA-256', new TextEncoder().encode(key)).then(buffer => {
|
|
113
|
-
return Array.from(new Uint8Array(buffer))
|
|
114
|
-
.map(bytes => bytes.toString(16).padStart(2, '0'))
|
|
115
|
-
.join('');
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
onSlotDefaultChange() {
|
|
119
|
-
this.slottedImage = this.host.querySelector('img');
|
|
120
|
-
this.getAvatar();
|
|
121
|
-
}
|
|
122
|
-
componentWillRender() {
|
|
123
|
-
this.slottedImage = this.host.querySelector('img');
|
|
124
|
-
this.getAvatar();
|
|
125
|
-
}
|
|
126
|
-
componentDidLoad() {
|
|
127
|
-
this.validateFirstname();
|
|
128
|
-
}
|
|
129
|
-
render() {
|
|
130
|
-
const initials = this.getNames().reduce((acc, n, i) => {
|
|
131
|
-
if (i > 0)
|
|
132
|
-
acc.push(index.h("span", null, " "));
|
|
133
|
-
acc.push(n.charAt(0));
|
|
134
|
-
acc.push(index.h("span", null, n.slice(1)));
|
|
135
|
-
// eslint-disable-next-line @stencil-community/render-returns-host
|
|
136
|
-
return acc;
|
|
137
|
-
}, []);
|
|
138
|
-
return (index.h(index.Host, { "data-version": _package.version }, index.h("slot", { onSlotchange: this.onSlotDefaultChange.bind(this) }, this.avatarType === 'image' && index.h("img", { src: this.imageUrl, alt: this.imageAlt }), this.avatarType === 'initials' && index.h("div", { class: "initials" }, initials))));
|
|
139
|
-
}
|
|
140
|
-
get host() { return index.getElement(this); }
|
|
141
|
-
static get watchers() { return {
|
|
142
|
-
"firstname": ["validateFirstname"]
|
|
143
|
-
}; }
|
|
144
|
-
};
|
|
145
|
-
PostAvatar.INTERNAL_USERID_IMAGE_SRC = 'https://web.post.ch/UserProfileImage/{userid}.png';
|
|
146
|
-
PostAvatar.style = PostAvatarStyle0;
|
|
147
|
-
|
|
148
|
-
exports.PostAvatar = PostAvatar;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const postAvatar = require('./post-avatar-b1c97f51.js');
|
|
6
|
-
require('./index-e1f32cce.js');
|
|
7
|
-
require('./package-a2b895fc.js');
|
|
8
|
-
require('./check-non-empty-eeaa8f77.js');
|
|
9
|
-
require('./constants-238701d3.js');
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
exports.post_avatar = postAvatar.PostAvatar;
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const index = require('./index-e1f32cce.js');
|
|
4
|
-
const _package = require('./package-a2b895fc.js');
|
|
5
|
-
const checkType = require('./check-type-64af82a9.js');
|
|
6
|
-
const checkNonEmpty = require('./check-non-empty-eeaa8f77.js');
|
|
7
|
-
|
|
8
|
-
const easing = 'ease';
|
|
9
|
-
const duration = 500;
|
|
10
|
-
const fill = 'forwards';
|
|
11
|
-
const slideUp = (el, translateSize = '8rem') => {
|
|
12
|
-
return el.animate([
|
|
13
|
-
{ transform: `translateY(-${translateSize})` }, // Starting position (no translation)
|
|
14
|
-
{ transform: 'translateY(0)' }, // End position
|
|
15
|
-
], {
|
|
16
|
-
duration: duration,
|
|
17
|
-
easing,
|
|
18
|
-
fill,
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
const slideDown = (el, translateSize = '8rem') => {
|
|
22
|
-
return el.animate([
|
|
23
|
-
{ transform: 'translateY(0)' }, // Starting position (no translation)
|
|
24
|
-
{ transform: `translateY(-${translateSize})` }, // End position
|
|
25
|
-
], {
|
|
26
|
-
duration: duration,
|
|
27
|
-
easing,
|
|
28
|
-
fill,
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const postBackToTopCss = ":host{--post-floating-button-translate-y:var(--post-core-dimension-112);position:fixed;top:var(--post-device-position-1);right:var(--post-device-position-1)}:host .back-to-top{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button;box-shadow:.5px 3px 4px rgba(0,0,0,.1),2px 4px 10px 4px rgba(0,0,0,.12);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}: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)}: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}";
|
|
33
|
-
const PostBackToTopStyle0 = postBackToTopCss;
|
|
34
|
-
|
|
35
|
-
const PostBackToTop = class {
|
|
36
|
-
constructor(hostRef) {
|
|
37
|
-
index.registerInstance(this, hostRef);
|
|
38
|
-
this.handleScroll = () => {
|
|
39
|
-
this.belowFold = this.isBelowFold();
|
|
40
|
-
};
|
|
41
|
-
this.label = undefined;
|
|
42
|
-
this.belowFold = false;
|
|
43
|
-
}
|
|
44
|
-
isBelowFold() {
|
|
45
|
-
return window.scrollY > window.innerHeight;
|
|
46
|
-
}
|
|
47
|
-
// Watch for changes in belowFold
|
|
48
|
-
watchBelowFold(newValue) {
|
|
49
|
-
if (newValue) {
|
|
50
|
-
slideUp(this.el, this.translateY);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
slideDown(this.el, this.translateY);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
scrollToTop() {
|
|
57
|
-
window.scrollTo({
|
|
58
|
-
top: 0,
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
// Validate the label
|
|
62
|
-
validateLabel() {
|
|
63
|
-
checkType.checkType(this.label, 'string', 'The label property of the Back to Top component is required for accessibility purposes. Please ensure it is set.');
|
|
64
|
-
checkNonEmpty.checkNonEmpty(this.label, 'The label property of the Back to Top component must not be empty. Please provide a proper text for the label');
|
|
65
|
-
}
|
|
66
|
-
// Set the initial state
|
|
67
|
-
componentWillLoad() {
|
|
68
|
-
this.belowFold = this.isBelowFold();
|
|
69
|
-
}
|
|
70
|
-
componentDidLoad() {
|
|
71
|
-
window.addEventListener('scroll', this.handleScroll, false);
|
|
72
|
-
this.translateY = window
|
|
73
|
-
.getComputedStyle(this.el)
|
|
74
|
-
.getPropertyValue('--post-floating-button-translate-y');
|
|
75
|
-
if (!this.belowFold) {
|
|
76
|
-
this.el.style.transform = `translateY(-${this.translateY})`;
|
|
77
|
-
}
|
|
78
|
-
// Initial load
|
|
79
|
-
if (this.belowFold) {
|
|
80
|
-
slideUp(this.el, this.translateY);
|
|
81
|
-
}
|
|
82
|
-
this.validateLabel();
|
|
83
|
-
}
|
|
84
|
-
disconnectedCallback() {
|
|
85
|
-
window.removeEventListener('scroll', this.handleScroll);
|
|
86
|
-
}
|
|
87
|
-
render() {
|
|
88
|
-
return (index.h(index.Host, { key: '24d2bc9d7cc6a9cc2ffc7fb47196282993c49f02', "data-version": _package.version }, index.h("button", { key: '4ab2b8f8c812f202ec18461581541ef7f0134b63', class: "back-to-top", "aria-hidden": this.belowFold ? 'false' : 'true', tabindex: this.belowFold ? '0' : '-1', onClick: this.scrollToTop }, index.h("post-icon", { key: 'eb1ed42514d1187121625f9108e35dea86812ae4', "aria-hidden": "true", name: "3026" }), index.h("span", { key: '9215f4777c859b8225580a10bf2df48ab68f4eb1', class: "visually-hidden" }, this.label))));
|
|
89
|
-
}
|
|
90
|
-
get el() { return index.getElement(this); }
|
|
91
|
-
static get watchers() { return {
|
|
92
|
-
"belowFold": ["watchBelowFold"],
|
|
93
|
-
"label": ["validateLabel"]
|
|
94
|
-
}; }
|
|
95
|
-
};
|
|
96
|
-
PostBackToTop.style = PostBackToTopStyle0;
|
|
97
|
-
|
|
98
|
-
exports.PostBackToTop = PostBackToTop;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const postBackToTop = require('./post-back-to-top-0ce98569.js');
|
|
6
|
-
require('./index-e1f32cce.js');
|
|
7
|
-
require('./package-a2b895fc.js');
|
|
8
|
-
require('./check-type-64af82a9.js');
|
|
9
|
-
require('./check-non-empty-eeaa8f77.js');
|
|
10
|
-
require('./constants-238701d3.js');
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
exports.post_back_to_top = postBackToTop.PostBackToTop;
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const index = require('./index-e1f32cce.js');
|
|
4
|
-
const _package = require('./package-a2b895fc.js');
|
|
5
|
-
const fade = require('./fade-35a3633a.js');
|
|
6
|
-
const index$1 = require('./index-824d2b71.js');
|
|
7
|
-
const checkType = require('./check-type-64af82a9.js');
|
|
8
|
-
const checkNonEmpty = require('./check-non-empty-eeaa8f77.js');
|
|
9
|
-
|
|
10
|
-
const BANNER_TYPES = ['neutral', 'success', 'warning', 'danger', 'info'];
|
|
11
|
-
|
|
12
|
-
const postBannerCss = ".banner,.alert{min-height:calc(var(--post-device-sizing-notification-icon-2) + (2 * var(--post-device-spacing-padding-10)));box-sizing:border-box;box-shadow:var(--post-device-elevation-100);border-radius:var(--post-device-border-radius-2);padding:var(--post-device-spacing-padding-10) var(--post-device-spacing-padding-10);padding-inline-start:calc(var(--post-device-spacing-padding-10) + var(--post-device-sizing-notification-icon-2) + var(--post-device-spacing-gap-inline-6));font-weight:400;border-style:var(--post-core-border-style-solid);border-width:var(--post-device-border-width-default);position:relative;color:var(--post-scheme-color-surface-default-fg);background-color:var(--post-scheme-color-signal-neutral);border-color:var(--post-scheme-color-signal-neutral-dark);color-scheme:var(--post-core-bg-scheme-light)}.banner:not(.no-icon)::before,.alert:not(.no-icon)::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M31.986 15.73c-.503.16-1.03.27-1.586.27a5.24 5.24 0 0 1-4.43-2.448c-.73.382-1.547.62-2.427.62a5.257 5.257 0 0 1-5.257-5.258c0-.88.237-1.698.62-2.427a5.24 5.24 0 0 1-2.449-4.43c0-.714.145-1.393.403-2.014C16.574.028 16.29 0 16 0 7.163 0 0 7.163 0 16s7.163 16 16 16 16-7.163 16-16c0-.091-.012-.18-.014-.27M16 30.667c-8.087 0-14.667-6.58-14.667-14.667 0-7.806 6.13-14.207 13.828-14.643a6.54 6.54 0 0 0 2.116 5.56 6.3 6.3 0 0 0-.325 1.997 6.6 6.6 0 0 0 6.59 6.59c.677 0 1.346-.108 1.998-.324a6.54 6.54 0 0 0 5.067 2.15C29.933 24.796 23.639 30.667 16 30.667M11.352 14.17a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 1 1 1.334 1.334 1.336 1.336 0 0 1-1.334-1.334m13.981 8.496a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 0 1 2.667 0c0 .735-.598 1.333-1.333 1.333a1.335 1.335 0 0 1-1.334-1.333m-7.276-1.829a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.667a.667.667 0 1 1 .002-1.335.667.667 0 0 1-.002 1.335m7.772-6a2 2 0 1 0-4 0 2 2 0 0 0 4 0m-2 .666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M11.505 5.505a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M28.93 18.548a13.2 13.2 0 0 1-4.335 7.357.663.663 0 0 1-.94-.073.666.666 0 0 1 .073-.94 11.84 11.84 0 0 0 3.894-6.61.668.668 0 0 1 1.307.266m-6.668 8.212a.667.667 0 0 1-.295.896c-.837.423-1.722.757-2.63.99a.665.665 0 1 1-.33-1.292 11.7 11.7 0 0 0 2.359-.888.67.67 0 0 1 .896.294M4 15.921a.666.666 0 1 1-1.333 0 13.13 13.13 0 0 1 4.597-9.984.666.666 0 1 1 .867 1.013A11.8 11.8 0 0 0 4 15.92'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M31.986 15.73c-.503.16-1.03.27-1.586.27a5.24 5.24 0 0 1-4.43-2.448c-.73.382-1.547.62-2.427.62a5.257 5.257 0 0 1-5.257-5.258c0-.88.237-1.698.62-2.427a5.24 5.24 0 0 1-2.449-4.43c0-.714.145-1.393.403-2.014C16.574.028 16.29 0 16 0 7.163 0 0 7.163 0 16s7.163 16 16 16 16-7.163 16-16c0-.091-.012-.18-.014-.27M16 30.667c-8.087 0-14.667-6.58-14.667-14.667 0-7.806 6.13-14.207 13.828-14.643a6.54 6.54 0 0 0 2.116 5.56 6.3 6.3 0 0 0-.325 1.997 6.6 6.6 0 0 0 6.59 6.59c.677 0 1.346-.108 1.998-.324a6.54 6.54 0 0 0 5.067 2.15C29.933 24.796 23.639 30.667 16 30.667M11.352 14.17a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 1 1 1.334 1.334 1.336 1.336 0 0 1-1.334-1.334m13.981 8.496a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 0 1 2.667 0c0 .735-.598 1.333-1.333 1.333a1.335 1.335 0 0 1-1.334-1.333m-7.276-1.829a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.667a.667.667 0 1 1 .002-1.335.667.667 0 0 1-.002 1.335m7.772-6a2 2 0 1 0-4 0 2 2 0 0 0 4 0m-2 .666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M11.505 5.505a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M28.93 18.548a13.2 13.2 0 0 1-4.335 7.357.663.663 0 0 1-.94-.073.666.666 0 0 1 .073-.94 11.84 11.84 0 0 0 3.894-6.61.668.668 0 0 1 1.307.266m-6.668 8.212a.667.667 0 0 1-.295.896c-.837.423-1.722.757-2.63.99a.665.665 0 1 1-.33-1.292 11.7 11.7 0 0 0 2.359-.888.67.67 0 0 1 .896.294M4 15.921a.666.666 0 1 1-1.333 0 13.13 13.13 0 0 1 4.597-9.984.666.666 0 1 1 .867 1.013A11.8 11.8 0 0 0 4 15.92'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;color:var(--post-scheme-color-signal-neutral-dark)}.banner:has(>post-icon)::before,.alert:has(>post-icon)::before{content:none}.banner>post-icon,.alert>post-icon{background-color:var(--post-scheme-color-signal-neutral);color:var(--post-scheme-color-signal-neutral-dark)}.banner::before,.alert::before{content:\"\";display:block}.banner::before,.banner>post-icon,.alert::before,.alert>post-icon{position:absolute;height:var(--post-device-sizing-notification-icon-2);width:var(--post-device-sizing-notification-icon-2);left:var(--post-device-spacing-padding-10);top:var(--post-device-spacing-padding-10)}.banner.no-icon,.alert.no-icon{min-height:calc(2 * var(--post-device-spacing-padding-10) + close.$close-size);padding-inline-start:var(--post-device-spacing-padding-10)}.banner.no-icon::before,.alert.no-icon::before{content:unset}.banner.no-icon>post-icon,.alert.no-icon>post-icon{display:none}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.banner,.alert{filter:none !important;border:2px solid CanvasText}}.banner:not(.banner-action):not(.alert-action),.alert:not(.banner-action):not(.alert-action){display:flex;flex-direction:column;justify-content:center;gap:.25rem}.banner:not(.banner-action):not(.alert-action) a,.alert:not(.banner-action):not(.alert-action) a{font-weight:400}.banner:not(.banner-action):not(.alert-action) hr,.alert:not(.banner-action):not(.alert-action) hr{margin-block:.5rem .75rem !important}.banner:not(.banner-action):not(.alert-action)>*,.alert:not(.banner-action):not(.alert-action)>*{margin:0}.banner-container{border:unset;background-color:rgba(0,0,0,0)}.banner-dismissible,.alert-dismissible{pointer-events:auto;position:relative}.banner-dismissible:not(.banner-action):not(.alert-action),.alert-dismissible:not(.banner-action):not(.alert-action){padding-inline-end:calc(var(--post-device-spacing-padding-10) + var(--post-device-spacing-gap-inline-6) + 1.5rem)}.banner-dismissible>.btn-close,.alert-dismissible>.btn-close{position:absolute;inset-block-start:1rem;inset-inline-end:var(--post-device-spacing-padding-10)}.banner-buttons,.alert-buttons{display:flex;align-items:center;justify-content:flex-start;flex-direction:row-reverse;margin-block-start:var(--post-device-spacing-padding-block-10);gap:var(--post-device-spacing-gap-1)}@media (max-width: 779.98px){.banner-buttons,.alert-buttons{flex-direction:column}}.banner-action>.banner-content,.banner-action>.alert-content,.alert-action>.banner-content,.alert-action>.alert-content{display:flex;flex-direction:column;justify-content:center;gap:.25rem}.banner-action>.banner-content a,.banner-action>.alert-content a,.alert-action>.banner-content a,.alert-action>.alert-content a{font-weight:400}.banner-action>.banner-content hr,.banner-action>.alert-content hr,.alert-action>.banner-content hr,.alert-action>.alert-content hr{margin-block:.5rem .75rem !important}.banner-action>.banner-content>*,.banner-action>.alert-content>*,.alert-action>.banner-content>*,.alert-action>.alert-content>*{margin:0}@media (max-width: 779.98px){.banner-action,.alert-action{flex-direction:column;align-items:stretch}.banner-action>.banner-content,.banner-action>.alert-content,.alert-action>.banner-content,.alert-action>.alert-content{padding-inline-start:var(--post-device-spacing-gap-inline-6)var(--post-device-sizing-notification-icon-2);padding-inline-end:var(--post-device-spacing-gap-inline-6)1.5rem}.banner-action.no-icon>.banner-content,.banner-action.no-icon>.alert-content,.alert-action.no-icon>.banner-content,.alert-action.no-icon>.alert-content{padding-inline-start:0}.banner-action>.banner-buttons,.banner-action>.alert-buttons,.alert-action>.banner-buttons,.alert-action>.alert-buttons{display:flex}.banner-action>.banner-buttons>.btn,.banner-action>.banner-buttons>::slotted(.btn),.banner-action>.alert-buttons>.btn,.banner-action>.alert-buttons>::slotted(.btn),.alert-action>.banner-buttons>.btn,.alert-action>.banner-buttons>::slotted(.btn),.alert-action>.alert-buttons>.btn,.alert-action>.alert-buttons>::slotted(.btn){flex:1 0 0;width:100%}.banner-action>.banner-buttons>.btn:first-child,.banner-action>.banner-buttons>::slotted(.btn:first-child),.banner-action>.alert-buttons>.btn:first-child,.banner-action>.alert-buttons>::slotted(.btn:first-child),.alert-action>.banner-buttons>.btn:first-child,.alert-action>.banner-buttons>::slotted(.btn:first-child),.alert-action>.alert-buttons>.btn:first-child,.alert-action>.alert-buttons>::slotted(.btn:first-child){margin-inline-start:0}}.banner-neutral,.alert-neutral{background-color:var(--post-scheme-color-signal-neutral);border-color:var(--post-scheme-color-signal-neutral-dark);color-scheme:var(--post-core-bg-scheme-light)}.banner-neutral:not(.no-icon)::before,.alert-neutral:not(.no-icon)::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M31.986 15.73c-.503.16-1.03.27-1.586.27a5.24 5.24 0 0 1-4.43-2.448c-.73.382-1.547.62-2.427.62a5.257 5.257 0 0 1-5.257-5.258c0-.88.237-1.698.62-2.427a5.24 5.24 0 0 1-2.449-4.43c0-.714.145-1.393.403-2.014C16.574.028 16.29 0 16 0 7.163 0 0 7.163 0 16s7.163 16 16 16 16-7.163 16-16c0-.091-.012-.18-.014-.27M16 30.667c-8.087 0-14.667-6.58-14.667-14.667 0-7.806 6.13-14.207 13.828-14.643a6.54 6.54 0 0 0 2.116 5.56 6.3 6.3 0 0 0-.325 1.997 6.6 6.6 0 0 0 6.59 6.59c.677 0 1.346-.108 1.998-.324a6.54 6.54 0 0 0 5.067 2.15C29.933 24.796 23.639 30.667 16 30.667M11.352 14.17a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 1 1 1.334 1.334 1.336 1.336 0 0 1-1.334-1.334m13.981 8.496a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 0 1 2.667 0c0 .735-.598 1.333-1.333 1.333a1.335 1.335 0 0 1-1.334-1.333m-7.276-1.829a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.667a.667.667 0 1 1 .002-1.335.667.667 0 0 1-.002 1.335m7.772-6a2 2 0 1 0-4 0 2 2 0 0 0 4 0m-2 .666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M11.505 5.505a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M28.93 18.548a13.2 13.2 0 0 1-4.335 7.357.663.663 0 0 1-.94-.073.666.666 0 0 1 .073-.94 11.84 11.84 0 0 0 3.894-6.61.668.668 0 0 1 1.307.266m-6.668 8.212a.667.667 0 0 1-.295.896c-.837.423-1.722.757-2.63.99a.665.665 0 1 1-.33-1.292 11.7 11.7 0 0 0 2.359-.888.67.67 0 0 1 .896.294M4 15.921a.666.666 0 1 1-1.333 0 13.13 13.13 0 0 1 4.597-9.984.666.666 0 1 1 .867 1.013A11.8 11.8 0 0 0 4 15.92'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M31.986 15.73c-.503.16-1.03.27-1.586.27a5.24 5.24 0 0 1-4.43-2.448c-.73.382-1.547.62-2.427.62a5.257 5.257 0 0 1-5.257-5.258c0-.88.237-1.698.62-2.427a5.24 5.24 0 0 1-2.449-4.43c0-.714.145-1.393.403-2.014C16.574.028 16.29 0 16 0 7.163 0 0 7.163 0 16s7.163 16 16 16 16-7.163 16-16c0-.091-.012-.18-.014-.27M16 30.667c-8.087 0-14.667-6.58-14.667-14.667 0-7.806 6.13-14.207 13.828-14.643a6.54 6.54 0 0 0 2.116 5.56 6.3 6.3 0 0 0-.325 1.997 6.6 6.6 0 0 0 6.59 6.59c.677 0 1.346-.108 1.998-.324a6.54 6.54 0 0 0 5.067 2.15C29.933 24.796 23.639 30.667 16 30.667M11.352 14.17a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 1 1 1.334 1.334 1.336 1.336 0 0 1-1.334-1.334m13.981 8.496a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 0 1 2.667 0c0 .735-.598 1.333-1.333 1.333a1.335 1.335 0 0 1-1.334-1.333m-7.276-1.829a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.667a.667.667 0 1 1 .002-1.335.667.667 0 0 1-.002 1.335m7.772-6a2 2 0 1 0-4 0 2 2 0 0 0 4 0m-2 .666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M11.505 5.505a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M28.93 18.548a13.2 13.2 0 0 1-4.335 7.357.663.663 0 0 1-.94-.073.666.666 0 0 1 .073-.94 11.84 11.84 0 0 0 3.894-6.61.668.668 0 0 1 1.307.266m-6.668 8.212a.667.667 0 0 1-.295.896c-.837.423-1.722.757-2.63.99a.665.665 0 1 1-.33-1.292 11.7 11.7 0 0 0 2.359-.888.67.67 0 0 1 .896.294M4 15.921a.666.666 0 1 1-1.333 0 13.13 13.13 0 0 1 4.597-9.984.666.666 0 1 1 .867 1.013A11.8 11.8 0 0 0 4 15.92'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;color:var(--post-scheme-color-signal-neutral-dark)}.banner-neutral:has(>post-icon)::before,.alert-neutral:has(>post-icon)::before{content:none}.banner-neutral>post-icon,.alert-neutral>post-icon{background-color:var(--post-scheme-color-signal-neutral);color:var(--post-scheme-color-signal-neutral-dark)}.banner-success,.alert-success{background-color:var(--post-scheme-color-interactive-notification-success-bg);border-color:var(--post-scheme-color-interactive-notification-success-stroke);color-scheme:var(--post-core-bg-scheme-light)}.banner-success:not(.no-icon)::before,.alert-success:not(.no-icon)::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12.667 24.533-7.6-7.6 1.867-1.867 5.733 5.733 12.4-12.4 1.867 1.867z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12.667 24.533-7.6-7.6 1.867-1.867 5.733 5.733 12.4-12.4 1.867 1.867z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;color:var(--post-scheme-color-interactive-notification-success-icon)}.banner-success:has(>post-icon)::before,.alert-success:has(>post-icon)::before{content:none}.banner-success>post-icon,.alert-success>post-icon{background-color:var(--post-scheme-color-interactive-notification-success-bg);color:var(--post-scheme-color-interactive-notification-success-icon)}.banner-warning,.alert-warning{background-color:var(--post-scheme-color-interactive-notification-warning-bg);border-color:var(--post-scheme-color-interactive-notification-warning-stroke);color-scheme:var(--post-core-bg-scheme-light)}.banner-warning:not(.no-icon)::before,.alert-warning:not(.no-icon)::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.67 4h2.67v18.67h-2.67zm0 21.33h2.67V28h-2.67z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.67 4h2.67v18.67h-2.67zm0 21.33h2.67V28h-2.67z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;color:var(--post-scheme-color-interactive-notification-warning-icon)}.banner-warning:has(>post-icon)::before,.alert-warning:has(>post-icon)::before{content:none}.banner-warning>post-icon,.alert-warning>post-icon{background-color:var(--post-scheme-color-interactive-notification-warning-bg);color:var(--post-scheme-color-interactive-notification-warning-icon)}.banner-error,.alert-error{background-color:var(--post-scheme-color-interactive-notification-error-bg);border-color:var(--post-scheme-color-interactive-notification-error-stroke);color-scheme:var(--post-core-bg-scheme-light)}.banner-error:not(.no-icon)::before,.alert-error:not(.no-icon)::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.67 4h2.67v18.67h-2.67zm0 21.33h2.67V28h-2.67z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.67 4h2.67v18.67h-2.67zm0 21.33h2.67V28h-2.67z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;color:var(--post-scheme-color-interactive-notification-error-icon)}.banner-error:has(>post-icon)::before,.alert-error:has(>post-icon)::before{content:none}.banner-error>post-icon,.alert-error>post-icon{background-color:var(--post-scheme-color-interactive-notification-error-bg);color:var(--post-scheme-color-interactive-notification-error-icon)}.banner-info,.alert-info{background-color:var(--post-scheme-color-interactive-notification-info-bg);border-color:var(--post-scheme-color-interactive-notification-info-stroke);color-scheme:var(--post-core-bg-scheme-light)}.banner-info:not(.no-icon)::before,.alert-info:not(.no-icon)::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17.33 25.33v-16h-4.67V12h2v13.33h-2V28h6.67v-2.67zM14.67 4h2.67v2.67h-2.67z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17.33 25.33v-16h-4.67V12h2v13.33h-2V28h6.67v-2.67zM14.67 4h2.67v2.67h-2.67z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;color:var(--post-scheme-color-interactive-notification-info-icon)}.banner-info:has(>post-icon)::before,.alert-info:has(>post-icon)::before{content:none}.banner-info>post-icon,.alert-info>post-icon{background-color:var(--post-scheme-color-interactive-notification-info-bg);color:var(--post-scheme-color-interactive-notification-info-icon)}.banner-danger,.alert-danger{background-color:var(--post-scheme-color-interactive-notification-error-bg);border-color:var(--post-scheme-color-interactive-notification-error-stroke);color-scheme:var(--post-core-bg-scheme-light)}.banner-danger:not(.no-icon)::before,.alert-danger:not(.no-icon)::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.67 4h2.67v18.67h-2.67zm0 21.33h2.67V28h-2.67z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.67 4h2.67v18.67h-2.67zm0 21.33h2.67V28h-2.67z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;color:var(--post-scheme-color-interactive-notification-error-icon)}.banner-danger:has(>post-icon)::before,.alert-danger:has(>post-icon)::before{content:none}.banner-danger>post-icon,.alert-danger>post-icon{background-color:var(--post-scheme-color-interactive-notification-error-bg);color:var(--post-scheme-color-interactive-notification-error-icon)}.btn-close{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button;border-radius:var(--post-device-border-radius-round);color:#000;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;cursor:pointer}.btn-close{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}.btn-close:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:4px}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:4px}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.btn-close::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m16.267 16.667 6.667-6.533-.933-1.067-6.667 6.667-6.667-6.667-.933 1.067 6.667 6.533-6.667 6.667 1.067.933 6.533-6.667 6.667 6.667.933-1.067z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m16.267 16.667 6.667-6.533-.933-1.067-6.667 6.667-6.667-6.667-.933 1.067 6.667 6.533-6.667 6.667 1.067.933 6.533-6.667 6.667 6.667.933-1.067z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;content:\"\";display:block;height:1.5rem;width:1.5rem}.btn-close:focus,.btn-close:not(:disabled):hover,.pretend-hover.btn-close{color:#000}.btn-close:disabled{color:var(--post-gray-40)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close{color:CanvasText;forced-color-adjust:none}.btn-close:focus,.btn-close:not(:disabled):hover,.pretend-hover.btn-close{color:Highlight}}.btn-close-white{color:#e6e6e6}.btn-close-white:focus,.btn-close-white:not(:disabled):hover,.btn-close-white.pretend-hover{color:#fff}.btn-close-white:disabled{color:#999}/*!\n * Copyright 2021 by Swiss Post, Information Technology\n */:host{display:block}:host ::slotted(*){margin:0 !important}.visually-hidden{width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.visually-hidden:not(caption){position:absolute !important}";
|
|
13
|
-
const PostBannerStyle0 = postBannerCss;
|
|
14
|
-
|
|
15
|
-
const PostBanner = class {
|
|
16
|
-
constructor(hostRef) {
|
|
17
|
-
index.registerInstance(this, hostRef);
|
|
18
|
-
this.postDismissed = index.createEvent(this, "postDismissed", 7);
|
|
19
|
-
this.bannerId = crypto.randomUUID();
|
|
20
|
-
this.classes = undefined;
|
|
21
|
-
this.hasActions = undefined;
|
|
22
|
-
this.hasHeading = undefined;
|
|
23
|
-
this.onDismissButtonClick = () => this.dismiss();
|
|
24
|
-
this.dismissible = false;
|
|
25
|
-
this.dismissLabel = undefined;
|
|
26
|
-
this.icon = undefined;
|
|
27
|
-
this.type = 'neutral';
|
|
28
|
-
}
|
|
29
|
-
validateDismissible(isDismissible = this.dismissible) {
|
|
30
|
-
checkType.checkType(isDismissible, 'boolean', 'The post-banner "dismissible" prop should be a boolean.');
|
|
31
|
-
setTimeout(() => this.validateDismissLabel());
|
|
32
|
-
}
|
|
33
|
-
validateDismissLabel(dismissLabel = this.dismissLabel) {
|
|
34
|
-
if (this.dismissible) {
|
|
35
|
-
checkNonEmpty.checkNonEmpty(dismissLabel, 'Dismissible post-banner\'s require a "dismiss-label" prop.');
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
validateIcon(icon = this.icon) {
|
|
39
|
-
index$1.checkEmptyOrPattern(icon, /\d{4}|none/, 'The post-banner "icon" prop should be a 4-digits string.');
|
|
40
|
-
}
|
|
41
|
-
validateType(type = this.type) {
|
|
42
|
-
index$1.checkEmptyOrOneOf(type, BANNER_TYPES, `The post-banner requires a type form: ${BANNER_TYPES.join(', ')}`);
|
|
43
|
-
}
|
|
44
|
-
componentDidLoad() {
|
|
45
|
-
this.validateDismissible();
|
|
46
|
-
this.validateIcon();
|
|
47
|
-
this.validateType();
|
|
48
|
-
}
|
|
49
|
-
componentWillRender() {
|
|
50
|
-
this.hasHeading = this.host.querySelectorAll('[slot=heading]').length > 0;
|
|
51
|
-
this.hasActions = this.host.querySelectorAll('[slot=actions]').length > 0;
|
|
52
|
-
this.classes = `banner ${this.type ? 'banner-' + this.type : ''}`;
|
|
53
|
-
if (this.dismissible)
|
|
54
|
-
this.classes += ' banner-dismissible';
|
|
55
|
-
if (this.hasActions)
|
|
56
|
-
this.classes += ' banner-action';
|
|
57
|
-
if (this.icon === 'none')
|
|
58
|
-
this.classes += ' no-icon';
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Triggers banner dismissal programmatically (same as clicking on the close button (×)).
|
|
62
|
-
*/
|
|
63
|
-
async dismiss() {
|
|
64
|
-
const dismissal = fade.fadeOut(this.host);
|
|
65
|
-
await dismissal.finished;
|
|
66
|
-
this.host.remove();
|
|
67
|
-
this.postDismissed.emit();
|
|
68
|
-
}
|
|
69
|
-
render() {
|
|
70
|
-
const defaultBannerContent = [
|
|
71
|
-
this.hasHeading && (index.h("div", { key: `${this.bannerId}-heading`, class: "banner-heading" }, index.h("slot", { key: '7c03020bf287d48d71b31a7ae1d973ec0094d0f8', name: "heading" }))),
|
|
72
|
-
index.h("slot", { key: `${this.bannerId}-message` }),
|
|
73
|
-
];
|
|
74
|
-
const actionBannerContent = [
|
|
75
|
-
index.h("div", { key: `${this.bannerId}-content`, class: "banner-content" }, defaultBannerContent),
|
|
76
|
-
index.h("div", { key: `${this.bannerId}-buttons`, class: "banner-buttons" }, index.h("slot", { key: 'e7a4fca1de6d984560ab46c87c9406e567b482f9', name: "actions" })),
|
|
77
|
-
];
|
|
78
|
-
return (index.h(index.Host, { key: '58fcfe2258e5d5426c713864af729b046c9ed678', "data-version": _package.version }, index.h("div", { key: '0c54f8b1ece142fd9cd3d071cf36fde2dc5e1d08', role: "alert", class: this.classes, part: this.classes }, this.dismissible && (index.h("button", { key: '8e1c32b63a39605ad15c550f4cd55ebb5630e4fe', class: "btn-close", onClick: this.onDismissButtonClick }, index.h("span", { key: 'cea941fe2637f3cabb5889875ca12d6f9818e636', class: "visually-hidden" }, this.dismissLabel))), this.icon && this.icon !== 'none' && (index.h("post-icon", { key: `${this.bannerId}-icon`, name: this.icon })), this.hasActions ? actionBannerContent : defaultBannerContent)));
|
|
79
|
-
}
|
|
80
|
-
get host() { return index.getElement(this); }
|
|
81
|
-
static get watchers() { return {
|
|
82
|
-
"dismissible": ["validateDismissible"],
|
|
83
|
-
"dismissLabel": ["validateDismissLabel"],
|
|
84
|
-
"icon": ["validateIcon"],
|
|
85
|
-
"type": ["validateType"]
|
|
86
|
-
}; }
|
|
87
|
-
};
|
|
88
|
-
PostBanner.style = PostBannerStyle0;
|
|
89
|
-
|
|
90
|
-
exports.PostBanner = PostBanner;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const index = require('./index-e1f32cce.js');
|
|
4
|
-
const _package = require('./package-a2b895fc.js');
|
|
5
|
-
const index$1 = require('./index-824d2b71.js');
|
|
6
|
-
|
|
7
|
-
const postBreadcrumbItemCss = ":host{display:inline-block}:host{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: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:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){:host: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:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.breadcrumb-item{display:inline-flex;align-items:center;justify-content:center;padding-block:var(--post-device-spacing-padding-block-7);gap:var(--post-device-spacing-gap-inline-5);color:var(--post-scheme-color-interactive-primary-enabled-fg1);text-decoration:var(--post-core-text-decoration-none)}.breadcrumb-item post-icon{height:var(--post-core-dimension-24);width:var(--post-core-dimension-24)}.breadcrumb-item:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1);text-decoration:var(--post-core-text-decoration-underline)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.breadcrumb-item,.breadcrumb-item:focus,.breadcrumb-item:hover{color:LinkText !important}.breadcrumb-item:visited{color:VisitedText !important}}";
|
|
8
|
-
const PostBreadcrumbItemStyle0 = postBreadcrumbItemCss;
|
|
9
|
-
|
|
10
|
-
const PostBreadcrumbItem = class {
|
|
11
|
-
constructor(hostRef) {
|
|
12
|
-
index.registerInstance(this, hostRef);
|
|
13
|
-
this.url = undefined;
|
|
14
|
-
}
|
|
15
|
-
validateUrl() {
|
|
16
|
-
try {
|
|
17
|
-
this.validUrl = this.constructUrl(this.url);
|
|
18
|
-
}
|
|
19
|
-
catch (error) {
|
|
20
|
-
this.validUrl = undefined;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
// Helper to construct a valid URL string or return undefined
|
|
24
|
-
constructUrl(value) {
|
|
25
|
-
const hasBaseURL = /^https?:\/\//.test(String(this.url));
|
|
26
|
-
if (typeof value === 'string') {
|
|
27
|
-
const urlString = hasBaseURL
|
|
28
|
-
? value
|
|
29
|
-
: `${window.location.origin}${value}`;
|
|
30
|
-
index$1.checkEmptyOrUrl(urlString, 'The "url" property of the post-breadcrumb-item is invalid');
|
|
31
|
-
return urlString;
|
|
32
|
-
}
|
|
33
|
-
return undefined;
|
|
34
|
-
}
|
|
35
|
-
connectedCallback() {
|
|
36
|
-
this.validateUrl();
|
|
37
|
-
}
|
|
38
|
-
render() {
|
|
39
|
-
const BreadcrumbTag = this.validUrl ? 'a' : 'span';
|
|
40
|
-
return (index.h(index.Host, { key: '0a161b7e3890549ea0a7645be6a4a1a407d81011', "data-version": _package.version }, index.h(BreadcrumbTag, Object.assign({ key: '5844d3d93b00ba0f9062dc9b3d8c91e6b7ac9e97', class: "breadcrumb-item" }, (this.validUrl ? { href: this.validUrl } : {})), index.h("post-icon", { key: '852b13f76a650c9952e5edc6266141d13eab6afa', name: "2111", class: "breadcrumb-item-icon" }), index.h("slot", { key: 'd4fbec6b09662b59aefd763be8323746c0b2bcd9' }))));
|
|
41
|
-
}
|
|
42
|
-
get host() { return index.getElement(this); }
|
|
43
|
-
static get watchers() { return {
|
|
44
|
-
"url": ["validateUrl"]
|
|
45
|
-
}; }
|
|
46
|
-
};
|
|
47
|
-
PostBreadcrumbItem.style = PostBreadcrumbItemStyle0;
|
|
48
|
-
|
|
49
|
-
exports.PostBreadcrumbItem = PostBreadcrumbItem;
|