@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
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
declare enum AvatarType {
|
|
2
|
-
Slotted = "slotted",
|
|
3
|
-
Image = "image",
|
|
4
|
-
Initials = "initials",
|
|
5
|
-
Null
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* @slot default - Slot for inserting a custom image as avatar.
|
|
9
|
-
*/
|
|
10
|
-
export declare class PostAvatar {
|
|
11
|
-
private static INTERNAL_USERID_IMAGE_SRC;
|
|
12
|
-
host: HTMLPostAvatarElement;
|
|
13
|
-
/**
|
|
14
|
-
* Defines the users firstname.
|
|
15
|
-
*/
|
|
16
|
-
readonly firstname: string;
|
|
17
|
-
/**
|
|
18
|
-
* Defines the users lastname.
|
|
19
|
-
*/
|
|
20
|
-
readonly lastname?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Defines the company internal userId.<div className="mb-1 banner banner-warning banner-sm">Can only be used on post.ch domains!</div>
|
|
23
|
-
*/
|
|
24
|
-
readonly userid?: string;
|
|
25
|
-
/**
|
|
26
|
-
* Defines the users email address associated with a gravatar profile picture.
|
|
27
|
-
*/
|
|
28
|
-
readonly email?: string;
|
|
29
|
-
slottedImage: HTMLImageElement;
|
|
30
|
-
avatarType: AvatarType;
|
|
31
|
-
imageUrl: string;
|
|
32
|
-
imageAlt: string;
|
|
33
|
-
initials: string;
|
|
34
|
-
validateFirstname(): void;
|
|
35
|
-
private getAvatar;
|
|
36
|
-
private getImageByProp;
|
|
37
|
-
private fetchImageByUserId;
|
|
38
|
-
private fetchImageByEmail;
|
|
39
|
-
private getAvatarByInitials;
|
|
40
|
-
private getNames;
|
|
41
|
-
private getInitials;
|
|
42
|
-
private getStorageItem;
|
|
43
|
-
private setStorageItem;
|
|
44
|
-
private removeStorageItem;
|
|
45
|
-
private cryptify;
|
|
46
|
-
private onSlotDefaultChange;
|
|
47
|
-
componentWillRender(): void;
|
|
48
|
-
componentDidLoad(): void;
|
|
49
|
-
render(): any;
|
|
50
|
-
}
|
|
51
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export declare class PostBackToTop {
|
|
2
|
-
el: HTMLPostBackToTopElement;
|
|
3
|
-
/**
|
|
4
|
-
* The label of the back-to-top button, intended solely for accessibility purposes.
|
|
5
|
-
* This label is always hidden from view.
|
|
6
|
-
**/
|
|
7
|
-
label: string;
|
|
8
|
-
belowFold: boolean;
|
|
9
|
-
private translateY;
|
|
10
|
-
isBelowFold(): boolean;
|
|
11
|
-
handleScroll: () => void;
|
|
12
|
-
watchBelowFold(newValue: boolean): void;
|
|
13
|
-
scrollToTop(): void;
|
|
14
|
-
validateLabel(): void;
|
|
15
|
-
componentWillLoad(): void;
|
|
16
|
-
componentDidLoad(): void;
|
|
17
|
-
disconnectedCallback(): void;
|
|
18
|
-
render(): any;
|
|
19
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
-
import { BannerType } from './banner-types';
|
|
3
|
-
/**
|
|
4
|
-
* @slot heading - Slot for placing custom content within the banner's heading.
|
|
5
|
-
* @slot actions - Slot for placing custom actions (buttons, links, etc.) within the banner.
|
|
6
|
-
* @slot default - Slot for placing the main content/message of the banner.
|
|
7
|
-
*/
|
|
8
|
-
export declare class PostBanner {
|
|
9
|
-
host: HTMLPostBannerElement;
|
|
10
|
-
bannerId: `${string}-${string}-${string}-${string}-${string}`;
|
|
11
|
-
classes: string;
|
|
12
|
-
hasActions: boolean;
|
|
13
|
-
hasHeading: boolean;
|
|
14
|
-
onDismissButtonClick: () => Promise<void>;
|
|
15
|
-
/**
|
|
16
|
-
* If `true`, a close button (×) is displayed and the banner can be dismissed by the user.
|
|
17
|
-
*/
|
|
18
|
-
readonly dismissible: boolean;
|
|
19
|
-
validateDismissible(isDismissible?: boolean): void;
|
|
20
|
-
/**
|
|
21
|
-
* The label to use for the close button of a dismissible banner.
|
|
22
|
-
*/
|
|
23
|
-
readonly dismissLabel: string;
|
|
24
|
-
validateDismissLabel(dismissLabel?: string): void;
|
|
25
|
-
/**
|
|
26
|
-
* The icon to display in the banner. By default, the icon depends on the banner type.
|
|
27
|
-
*
|
|
28
|
-
* If `none`, no icon is displayed.
|
|
29
|
-
*/
|
|
30
|
-
readonly icon: string;
|
|
31
|
-
validateIcon(icon?: string): void;
|
|
32
|
-
/**
|
|
33
|
-
* The type of the banner.
|
|
34
|
-
*/
|
|
35
|
-
readonly type: BannerType;
|
|
36
|
-
validateType(type?: "neutral" | "success" | "warning" | "danger" | "info"): void;
|
|
37
|
-
/**
|
|
38
|
-
* An event emitted when the banner element is dismissed, after the transition.
|
|
39
|
-
* It has no payload and only relevant for dismissible banners.
|
|
40
|
-
*/
|
|
41
|
-
postDismissed: EventEmitter<void>;
|
|
42
|
-
componentDidLoad(): void;
|
|
43
|
-
componentWillRender(): void;
|
|
44
|
-
/**
|
|
45
|
-
* Triggers banner dismissal programmatically (same as clicking on the close button (×)).
|
|
46
|
-
*/
|
|
47
|
-
dismiss(): Promise<void>;
|
|
48
|
-
render(): any;
|
|
49
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @slot default - Slot for placing the text inside the breadcrumb item.
|
|
3
|
-
*/
|
|
4
|
-
export declare class PostBreadcrumbItem {
|
|
5
|
-
host: HTMLPostBreadcrumbItemElement;
|
|
6
|
-
/**
|
|
7
|
-
* The optional URL to which the breadcrumb item will link.
|
|
8
|
-
*/
|
|
9
|
-
url?: string | URL;
|
|
10
|
-
private validUrl?;
|
|
11
|
-
validateUrl(): void;
|
|
12
|
-
private constructUrl;
|
|
13
|
-
connectedCallback(): void;
|
|
14
|
-
render(): any;
|
|
15
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare class PostHeader {
|
|
2
|
-
host: HTMLPostHeaderElement;
|
|
3
|
-
device: 'mobile' | 'tablet' | 'desktop';
|
|
4
|
-
mobileMenuExtended: boolean;
|
|
5
|
-
private scrollParent;
|
|
6
|
-
private throttledScroll;
|
|
7
|
-
private throttledResize;
|
|
8
|
-
componentWillRender(): void;
|
|
9
|
-
handlePostMainNavigationClosed(): void;
|
|
10
|
-
private handleScrollEvent;
|
|
11
|
-
private getScrollParent;
|
|
12
|
-
private isScrollable;
|
|
13
|
-
private handleResize;
|
|
14
|
-
private handleMobileMenuToggle;
|
|
15
|
-
render(): any;
|
|
16
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
-
/**
|
|
3
|
-
* @slot default - Slot for placing the content inside the anchor or button.
|
|
4
|
-
*/
|
|
5
|
-
export declare class PostLanguageOption {
|
|
6
|
-
host: HTMLPostLanguageOptionElement;
|
|
7
|
-
/**
|
|
8
|
-
* The ISO 639 language code, formatted according to [RFC 5646 (also known as BCP 47)](https://datatracker.ietf.org/doc/html/rfc5646). For example, "de".
|
|
9
|
-
*/
|
|
10
|
-
code: string;
|
|
11
|
-
validateCode(value?: string): void;
|
|
12
|
-
/**
|
|
13
|
-
* If set to `true`, the language option is considered the current language for the page.
|
|
14
|
-
*/
|
|
15
|
-
active: boolean;
|
|
16
|
-
validateActiveProp(value?: boolean): void;
|
|
17
|
-
/**
|
|
18
|
-
* The full name of the language. For example, "Deutsch".
|
|
19
|
-
*/
|
|
20
|
-
name: string;
|
|
21
|
-
validateName(value?: string): void;
|
|
22
|
-
/**
|
|
23
|
-
* The URL used for the href attribute of the internal anchor.
|
|
24
|
-
* This field is optional; if not provided, a button will be used internally instead of an anchor.
|
|
25
|
-
*/
|
|
26
|
-
url: string;
|
|
27
|
-
validateUrl(value?: string): void;
|
|
28
|
-
componentDidLoad(): void;
|
|
29
|
-
/**
|
|
30
|
-
* An event emitted when the language option is clicked. The payload is the ISO 639 code of the language.
|
|
31
|
-
*/
|
|
32
|
-
postChange: EventEmitter<string>;
|
|
33
|
-
/**
|
|
34
|
-
* Selects the language option programmatically.
|
|
35
|
-
*/
|
|
36
|
-
select(): Promise<void>;
|
|
37
|
-
private emitChange;
|
|
38
|
-
private isNameRequired;
|
|
39
|
-
render(): any;
|
|
40
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @slot default - Slot for placing the list title.
|
|
3
|
-
* @slot post-list-item - Slot for placing post-list-item components.
|
|
4
|
-
*/
|
|
5
|
-
export declare class PostList {
|
|
6
|
-
host: HTMLPostListElement;
|
|
7
|
-
/**
|
|
8
|
-
* The unique title of the list that is also referenced in the labelledby
|
|
9
|
-
*/
|
|
10
|
-
titleId: string;
|
|
11
|
-
/**
|
|
12
|
-
* If `true`, the list title will be hidden. Otherwise, it will be displayed.`
|
|
13
|
-
*/
|
|
14
|
-
readonly titleHidden: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* The list can become horizontal by setting `horizontal="true"` or just `horizontal`
|
|
17
|
-
*/
|
|
18
|
-
readonly horizontal: boolean;
|
|
19
|
-
private titleEl;
|
|
20
|
-
componentWillLoad(): void;
|
|
21
|
-
componentDidLoad(): void;
|
|
22
|
-
private checkTitle;
|
|
23
|
-
render(): any;
|
|
24
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
-
export declare class PostMainnavigation {
|
|
3
|
-
/**
|
|
4
|
-
* Gets emitted when a user closes the main navigation on mobile
|
|
5
|
-
*/
|
|
6
|
-
postToggle: EventEmitter;
|
|
7
|
-
handleMegadropdownToggled(event: any): void;
|
|
8
|
-
private handleBackButtonClick;
|
|
9
|
-
render(): any;
|
|
10
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export declare class PostMegadropdown {
|
|
2
|
-
private popoverRef;
|
|
3
|
-
/**
|
|
4
|
-
* Show megadropdown
|
|
5
|
-
* @param element HTMLElement
|
|
6
|
-
* @returns boolean
|
|
7
|
-
*/
|
|
8
|
-
show(element: HTMLElement): Promise<void>;
|
|
9
|
-
/**
|
|
10
|
-
* Hide megadropdown
|
|
11
|
-
* @returns boolean
|
|
12
|
-
*/
|
|
13
|
-
hide(): Promise<void>;
|
|
14
|
-
/**
|
|
15
|
-
* Toggle megadropdown
|
|
16
|
-
* @param element HTMLElement
|
|
17
|
-
* @param force boolean
|
|
18
|
-
* @returns boolean
|
|
19
|
-
*/
|
|
20
|
-
toggle(element: HTMLElement, force?: boolean): Promise<boolean>;
|
|
21
|
-
private handleBackButtonClick;
|
|
22
|
-
render(): any;
|
|
23
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
-
import { Placement } from '@floating-ui/dom';
|
|
3
|
-
export declare class PostMenu {
|
|
4
|
-
private popoverRef;
|
|
5
|
-
private lastFocusedElement;
|
|
6
|
-
private readonly KEYCODES;
|
|
7
|
-
host: HTMLPostMenuElement;
|
|
8
|
-
/**
|
|
9
|
-
* Defines the placement of the tooltip according to the floating-ui options available at https://floating-ui.com/docs/computePosition#placement.
|
|
10
|
-
* Tooltips are automatically flipped to the opposite side if there is not enough available space and are shifted
|
|
11
|
-
* towards the viewport if they would overlap edge boundaries.
|
|
12
|
-
*/
|
|
13
|
-
readonly placement?: Placement;
|
|
14
|
-
/**
|
|
15
|
-
* Holds the current visibility state of the menu.
|
|
16
|
-
* This state is internally managed to track whether the menu is open (`true`) or closed (`false`),
|
|
17
|
-
* and updates automatically when the menu is toggled.
|
|
18
|
-
*/
|
|
19
|
-
isVisible: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Emits when the menu is shown or hidden.
|
|
22
|
-
* The event payload is a boolean: `true` when the menu was opened, `false` when it was closed.
|
|
23
|
-
**/
|
|
24
|
-
toggleMenu: EventEmitter<boolean>;
|
|
25
|
-
connectedCallback(): void;
|
|
26
|
-
disconnectedCallback(): void;
|
|
27
|
-
componentDidLoad(): void;
|
|
28
|
-
/**
|
|
29
|
-
* Toggles the menu visibility based on its current state.
|
|
30
|
-
*/
|
|
31
|
-
toggle(target: HTMLElement): Promise<void>;
|
|
32
|
-
/**
|
|
33
|
-
* Displays the popover menu, focusing the first menu item.
|
|
34
|
-
*
|
|
35
|
-
* @param target - The HTML element relative to which the popover menu should be displayed.
|
|
36
|
-
*/
|
|
37
|
-
show(target: HTMLElement): Promise<void>;
|
|
38
|
-
/**
|
|
39
|
-
* Hides the popover menu and restores focus to the previously focused element.
|
|
40
|
-
*/
|
|
41
|
-
hide(): Promise<void>;
|
|
42
|
-
private handleKeyDown;
|
|
43
|
-
private handleClick;
|
|
44
|
-
private controlKeyDownHandler;
|
|
45
|
-
private getSlottedItems;
|
|
46
|
-
render(): any;
|
|
47
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export declare class PostMenuTrigger {
|
|
2
|
-
/**
|
|
3
|
-
* ID of the menu element that this trigger is linked to. Used to open and close the specified menu.
|
|
4
|
-
*/
|
|
5
|
-
for: string;
|
|
6
|
-
host: HTMLPostMenuTriggerElement;
|
|
7
|
-
/**
|
|
8
|
-
* Manages the accessibility attribute `aria-expanded` to indicate whether the associated menu is expanded or collapsed.
|
|
9
|
-
*/
|
|
10
|
-
ariaExpanded: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Reference to the slotted button within the trigger, if present.
|
|
13
|
-
* Used to manage click and key events for menu control.
|
|
14
|
-
*/
|
|
15
|
-
private slottedButton;
|
|
16
|
-
private root?;
|
|
17
|
-
/**
|
|
18
|
-
* Watch for changes to the `for` property to validate its type and ensure it is a string.
|
|
19
|
-
* @param forValue - The new value of the `for` property.
|
|
20
|
-
*/
|
|
21
|
-
validateControlFor(forValue?: string): void;
|
|
22
|
-
private get menu();
|
|
23
|
-
private handleToggle;
|
|
24
|
-
private handleKeyDown;
|
|
25
|
-
componentDidLoad(): void;
|
|
26
|
-
render(): any;
|
|
27
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @slot toggled - Slot for content displayed when the button is in the "on" state.
|
|
3
|
-
* @slot untoggled - Slot for content displayed when the button is in the "off" state.
|
|
4
|
-
*/
|
|
5
|
-
export declare class PostTogglebutton {
|
|
6
|
-
/**
|
|
7
|
-
* If `true`, the button is in the "on" state, otherwise it is in the "off" state.
|
|
8
|
-
*/
|
|
9
|
-
toggled: boolean;
|
|
10
|
-
private handleClick;
|
|
11
|
-
private handleKeydown;
|
|
12
|
-
render(): any;
|
|
13
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isFocusable: (element: Element) => boolean;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const getAttributeObserver = (attribute, handler) => {
|
|
2
|
-
/**
|
|
3
|
-
* Handle attribute changes and childList changes from the observer
|
|
4
|
-
* @param {MutationRecord[]} mutationList
|
|
5
|
-
*/
|
|
6
|
-
const observerHandler = (mutationList) => {
|
|
7
|
-
mutationList.forEach(mutation => {
|
|
8
|
-
if (mutation.type === 'attributes' && mutation.attributeName === attribute) {
|
|
9
|
-
handler(mutation.target);
|
|
10
|
-
}
|
|
11
|
-
if (mutation.type === 'childList') {
|
|
12
|
-
mutation.addedNodes.forEach(node => {
|
|
13
|
-
if (node.nodeType === Node.ELEMENT_NODE &&
|
|
14
|
-
node.hasAttribute(attribute)) {
|
|
15
|
-
handler(node);
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
// Initialize a mutation observer for patching accessibility features
|
|
22
|
-
return new MutationObserver(observerHandler);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export { getAttributeObserver as g };
|
package/loaders/get-root.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
function getRoot(element) {
|
|
2
|
-
const root = element.getRootNode();
|
|
3
|
-
if (root instanceof Document || root instanceof ShadowRoot) {
|
|
4
|
-
return root;
|
|
5
|
-
}
|
|
6
|
-
throw new Error('Attempting to access root node before the element is attached to the document or shadow tree.');
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export { getRoot as g };
|
package/loaders/post-avatar.js
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { v as version } from './package.js';
|
|
3
|
-
import { c as checkNonEmpty } from './check-non-empty.js';
|
|
4
|
-
|
|
5
|
-
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}";
|
|
6
|
-
const PostAvatarStyle0 = postAvatarCss;
|
|
7
|
-
|
|
8
|
-
// https://docs.gravatar.com/api/avatars/images/
|
|
9
|
-
const GRAVATAR_DEFAULT = '404';
|
|
10
|
-
const GRAVATAR_RATING = 'g';
|
|
11
|
-
const GRAVATAR_SIZE = 80;
|
|
12
|
-
const GRAVATAR_BASE_URL = `https://www.gravatar.com/avatar/{email}?s=${GRAVATAR_SIZE}&d=${GRAVATAR_DEFAULT}&r=${GRAVATAR_RATING}`;
|
|
13
|
-
var AvatarType;
|
|
14
|
-
(function (AvatarType) {
|
|
15
|
-
AvatarType["Slotted"] = "slotted";
|
|
16
|
-
AvatarType["Image"] = "image";
|
|
17
|
-
AvatarType["Initials"] = "initials";
|
|
18
|
-
AvatarType[AvatarType["Null"] = null] = "Null";
|
|
19
|
-
})(AvatarType || (AvatarType = {}));
|
|
20
|
-
const PostAvatar$1 = /*@__PURE__*/ proxyCustomElement(class PostAvatar extends HTMLElement {
|
|
21
|
-
constructor() {
|
|
22
|
-
super();
|
|
23
|
-
this.__registerHost();
|
|
24
|
-
this.__attachShadow();
|
|
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(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(h("span", null, " "));
|
|
133
|
-
acc.push(n.charAt(0));
|
|
134
|
-
acc.push(h("span", null, n.slice(1)));
|
|
135
|
-
// eslint-disable-next-line @stencil-community/render-returns-host
|
|
136
|
-
return acc;
|
|
137
|
-
}, []);
|
|
138
|
-
return (h(Host, { "data-version": version }, h("slot", { onSlotchange: this.onSlotDefaultChange.bind(this) }, this.avatarType === 'image' && h("img", { src: this.imageUrl, alt: this.imageAlt }), this.avatarType === 'initials' && h("div", { class: "initials" }, initials))));
|
|
139
|
-
}
|
|
140
|
-
get host() { return this; }
|
|
141
|
-
static get watchers() { return {
|
|
142
|
-
"firstname": ["validateFirstname"]
|
|
143
|
-
}; }
|
|
144
|
-
static get style() { return PostAvatarStyle0; }
|
|
145
|
-
}, [1, "post-avatar", {
|
|
146
|
-
"firstname": [1],
|
|
147
|
-
"lastname": [1],
|
|
148
|
-
"userid": [1],
|
|
149
|
-
"email": [1],
|
|
150
|
-
"slottedImage": [32],
|
|
151
|
-
"avatarType": [32],
|
|
152
|
-
"imageUrl": [32],
|
|
153
|
-
"imageAlt": [32],
|
|
154
|
-
"initials": [32]
|
|
155
|
-
}, undefined, {
|
|
156
|
-
"firstname": ["validateFirstname"]
|
|
157
|
-
}]);
|
|
158
|
-
PostAvatar$1.INTERNAL_USERID_IMAGE_SRC = 'https://web.post.ch/UserProfileImage/{userid}.png';
|
|
159
|
-
function defineCustomElement$1() {
|
|
160
|
-
if (typeof customElements === "undefined") {
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
const components = ["post-avatar"];
|
|
164
|
-
components.forEach(tagName => { switch (tagName) {
|
|
165
|
-
case "post-avatar":
|
|
166
|
-
if (!customElements.get(tagName)) {
|
|
167
|
-
customElements.define(tagName, PostAvatar$1);
|
|
168
|
-
}
|
|
169
|
-
break;
|
|
170
|
-
} });
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
const PostAvatar = PostAvatar$1;
|
|
174
|
-
const defineCustomElement = defineCustomElement$1;
|
|
175
|
-
|
|
176
|
-
export { PostAvatar, defineCustomElement };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Components, JSX } from "../dist/types/components";
|
|
2
|
-
|
|
3
|
-
interface PostBackToTop extends Components.PostBackToTop, HTMLElement {}
|
|
4
|
-
export const PostBackToTop: {
|
|
5
|
-
prototype: PostBackToTop;
|
|
6
|
-
new (): PostBackToTop;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Used to define this component and all nested components recursively.
|
|
10
|
-
*/
|
|
11
|
-
export const defineCustomElement: () => void;
|