@swisspost/design-system-components 10.0.0-next.59 → 10.0.0-next.60

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.
Files changed (152) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/{package-DzZ0YUie.js → package-ENij-plM.js} +1 -1
  3. package/dist/cjs/post-accordion_2.cjs.entry.js +1 -1
  4. package/dist/cjs/post-avatar.cjs.entry.js +1 -1
  5. package/dist/cjs/post-back-to-top.cjs.entry.js +1 -1
  6. package/dist/cjs/post-banner.cjs.entry.js +2 -2
  7. package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +1 -1
  8. package/dist/cjs/post-breadcrumbs.cjs.entry.js +1 -1
  9. package/dist/cjs/post-card-control.cjs.entry.js +1 -1
  10. package/dist/cjs/post-closebutton_13.cjs.entry.js +30 -6
  11. package/dist/cjs/post-collapsible_2.cjs.entry.js +3 -3
  12. package/dist/cjs/post-components.cjs.js +1 -1
  13. package/dist/cjs/post-footer.cjs.entry.js +1 -1
  14. package/dist/cjs/post-linkarea.cjs.entry.js +1 -1
  15. package/dist/cjs/post-pagination.cjs.entry.js +1 -1
  16. package/dist/cjs/post-popover-trigger.cjs.entry.js +1 -1
  17. package/dist/cjs/post-popover.cjs.entry.js +1 -1
  18. package/dist/cjs/post-rating.cjs.entry.js +1 -1
  19. package/dist/cjs/post-stepper-item.cjs.entry.js +1 -1
  20. package/dist/cjs/post-stepper.cjs.entry.js +1 -1
  21. package/dist/cjs/post-tab-item.cjs.entry.js +1 -1
  22. package/dist/cjs/post-tab-panel.cjs.entry.js +1 -1
  23. package/dist/cjs/post-tabs.cjs.entry.js +1 -1
  24. package/dist/cjs/post-tooltip-trigger.cjs.entry.js +1 -1
  25. package/dist/cjs/post-tooltip.cjs.entry.js +1 -1
  26. package/dist/collection/components/post-banner/post-banner.css +1 -1
  27. package/dist/collection/components/post-closebutton/post-closebutton.css +1 -1
  28. package/dist/collection/components/post-closebutton/post-closebutton.js +83 -7
  29. package/dist/collection/components/post-closebutton/types.js +3 -0
  30. package/dist/collection/components/post-collapsible/post-collapsible.js +2 -2
  31. package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
  32. package/dist/collection/components/post-megadropdown/post-megadropdown.js +1 -1
  33. package/dist/components/package.js +1 -1
  34. package/dist/components/post-banner.js +1 -1
  35. package/dist/components/post-closebutton2.js +1 -1
  36. package/dist/components/post-collapsible2.js +1 -1
  37. package/dist/components/post-megadropdown.js +1 -1
  38. package/dist/components/react/p-B7eGY_zG.js +1 -0
  39. package/dist/components/react/{p-CpHa76t0.js → p-BM5T_AgG.js} +1 -1
  40. package/dist/components/react/{p-IlUuXTk7.js → p-BNkE0s86.js} +1 -1
  41. package/dist/components/react/{p-CBPQwhIE.js → p-BX_nFrcn.js} +1 -1
  42. package/dist/components/react/p-BexjFgWq.js +1 -0
  43. package/dist/components/react/{p-CoS8dKpi.js → p-BhcKbsKY.js} +1 -1
  44. package/dist/components/react/p-BzBcOfzl.js +1 -0
  45. package/dist/components/react/{p-B7Pfex_I.js → p-CILij1jX.js} +1 -1
  46. package/dist/components/react/{p-Boi6UOyj.js → p-CwmHQ2Kf.js} +1 -1
  47. package/dist/components/react/{p-CS0PEJyh.js → p-D-kVF35b.js} +1 -1
  48. package/dist/components/react/{p-Bo4Ni2Xq.js → p-Djm_fenS.js} +1 -1
  49. package/dist/components/react/{p-C6KbCbAw.js → p-aSO__sH6.js} +1 -1
  50. package/dist/components/react/{p-Bj1Y_nVo.js → p-mA_8jS9w.js} +1 -1
  51. package/dist/components/react/post-accordion-item.js +1 -1
  52. package/dist/components/react/post-accordion.js +1 -1
  53. package/dist/components/react/post-avatar.js +1 -1
  54. package/dist/components/react/post-back-to-top.js +1 -1
  55. package/dist/components/react/post-banner.js +1 -1
  56. package/dist/components/react/post-breadcrumb-item.js +1 -1
  57. package/dist/components/react/post-breadcrumbs.js +1 -1
  58. package/dist/components/react/post-card-control.js +1 -1
  59. package/dist/components/react/post-closebutton.js +1 -1
  60. package/dist/components/react/post-collapsible-trigger.js +1 -1
  61. package/dist/components/react/post-collapsible.js +1 -1
  62. package/dist/components/react/post-footer.js +1 -1
  63. package/dist/components/react/post-header.js +1 -1
  64. package/dist/components/react/post-icon.js +1 -1
  65. package/dist/components/react/post-language-menu-item.js +1 -1
  66. package/dist/components/react/post-language-menu.js +1 -1
  67. package/dist/components/react/post-linkarea.js +1 -1
  68. package/dist/components/react/post-logo.js +1 -1
  69. package/dist/components/react/post-mainnavigation.js +1 -1
  70. package/dist/components/react/post-megadropdown-trigger.js +1 -1
  71. package/dist/components/react/post-megadropdown.js +1 -1
  72. package/dist/components/react/post-menu-item.js +1 -1
  73. package/dist/components/react/post-menu-trigger.js +1 -1
  74. package/dist/components/react/post-menu.js +1 -1
  75. package/dist/components/react/post-pagination.js +1 -1
  76. package/dist/components/react/post-popover-trigger.js +1 -1
  77. package/dist/components/react/post-popover.js +1 -1
  78. package/dist/components/react/post-popovercontainer.js +1 -1
  79. package/dist/components/react/post-rating.js +1 -1
  80. package/dist/components/react/post-stepper-item.js +1 -1
  81. package/dist/components/react/post-stepper.js +1 -1
  82. package/dist/components/react/post-tab-item.js +1 -1
  83. package/dist/components/react/post-tab-panel.js +1 -1
  84. package/dist/components/react/post-tabs.js +1 -1
  85. package/dist/components/react/post-togglebutton.js +1 -1
  86. package/dist/components/react/post-tooltip-trigger.js +1 -1
  87. package/dist/components/react/post-tooltip.js +1 -1
  88. package/dist/docs.json +98 -6
  89. package/dist/esm/loader.js +1 -1
  90. package/dist/esm/package-BzBcOfzl.js +3 -0
  91. package/dist/esm/post-accordion_2.entry.js +1 -1
  92. package/dist/esm/post-avatar.entry.js +1 -1
  93. package/dist/esm/post-back-to-top.entry.js +1 -1
  94. package/dist/esm/post-banner.entry.js +2 -2
  95. package/dist/esm/post-breadcrumb-item_2.entry.js +1 -1
  96. package/dist/esm/post-breadcrumbs.entry.js +1 -1
  97. package/dist/esm/post-card-control.entry.js +1 -1
  98. package/dist/esm/post-closebutton_13.entry.js +31 -7
  99. package/dist/esm/post-collapsible_2.entry.js +3 -3
  100. package/dist/esm/post-components.js +1 -1
  101. package/dist/esm/post-footer.entry.js +1 -1
  102. package/dist/esm/post-linkarea.entry.js +1 -1
  103. package/dist/esm/post-pagination.entry.js +1 -1
  104. package/dist/esm/post-popover-trigger.entry.js +1 -1
  105. package/dist/esm/post-popover.entry.js +1 -1
  106. package/dist/esm/post-rating.entry.js +1 -1
  107. package/dist/esm/post-stepper-item.entry.js +1 -1
  108. package/dist/esm/post-stepper.entry.js +1 -1
  109. package/dist/esm/post-tab-item.entry.js +1 -1
  110. package/dist/esm/post-tab-panel.entry.js +1 -1
  111. package/dist/esm/post-tabs.entry.js +1 -1
  112. package/dist/esm/post-tooltip-trigger.entry.js +1 -1
  113. package/dist/esm/post-tooltip.entry.js +1 -1
  114. package/dist/post-components/p-10c6b9f8.entry.js +1 -0
  115. package/dist/post-components/{p-3b6dcc38.entry.js → p-14c79a22.entry.js} +1 -1
  116. package/dist/post-components/{p-b0c36658.entry.js → p-2fdef7e4.entry.js} +1 -1
  117. package/dist/post-components/{p-0a76c979.entry.js → p-3964cd4a.entry.js} +1 -1
  118. package/dist/post-components/{p-92d66a15.entry.js → p-412c8217.entry.js} +1 -1
  119. package/dist/post-components/{p-da7c950f.entry.js → p-42fbf08e.entry.js} +1 -1
  120. package/dist/post-components/{p-7aad9f68.entry.js → p-5bc68b21.entry.js} +1 -1
  121. package/dist/post-components/{p-c90f26f6.entry.js → p-9bd9914b.entry.js} +1 -1
  122. package/dist/post-components/p-BzBcOfzl.js +1 -0
  123. package/dist/post-components/{p-76f197fd.entry.js → p-a0b438d5.entry.js} +1 -1
  124. package/dist/post-components/p-c6ed2b41.entry.js +1 -0
  125. package/dist/post-components/{p-f62429f0.entry.js → p-cac2f377.entry.js} +1 -1
  126. package/dist/post-components/{p-8d73b352.entry.js → p-d5996fe6.entry.js} +1 -1
  127. package/dist/post-components/{p-8760ec7c.entry.js → p-d90885ef.entry.js} +1 -1
  128. package/dist/post-components/{p-47d4a8eb.entry.js → p-df1a61e6.entry.js} +1 -1
  129. package/dist/post-components/{p-b54fe9b1.entry.js → p-e2a9c561.entry.js} +1 -1
  130. package/dist/post-components/{p-15abb76f.entry.js → p-e972c1ff.entry.js} +1 -1
  131. package/dist/post-components/{p-69d8b42f.entry.js → p-ecd9e81a.entry.js} +1 -1
  132. package/dist/post-components/{p-dbbd1f97.entry.js → p-ed634845.entry.js} +1 -1
  133. package/dist/post-components/{p-6bf3a582.entry.js → p-edb3d745.entry.js} +1 -1
  134. package/dist/post-components/{p-18808faa.entry.js → p-f6dc1ae3.entry.js} +1 -1
  135. package/dist/post-components/{p-8e935fb5.entry.js → p-fa268248.entry.js} +1 -1
  136. package/dist/post-components/{p-6e4b9414.entry.js → p-fd6e39db.entry.js} +1 -1
  137. package/dist/post-components/post-components.esm.js +1 -1
  138. package/dist/types/components/post-closebutton/post-closebutton.d.ts +12 -2
  139. package/dist/types/components/post-closebutton/types.d.ts +6 -0
  140. package/dist/types/components.d.ts +34 -14
  141. package/hydrate/index.js +37 -11
  142. package/hydrate/index.mjs +37 -11
  143. package/package.json +4 -4
  144. package/dist/collection/components/post-closebutton/button-types.js +0 -1
  145. package/dist/components/react/p-BIsI9uKb.js +0 -1
  146. package/dist/components/react/p-BedNtdrk.js +0 -1
  147. package/dist/components/react/p-DzmpoNOx.js +0 -1
  148. package/dist/esm/package-DzmpoNOx.js +0 -3
  149. package/dist/post-components/p-535cd139.entry.js +0 -1
  150. package/dist/post-components/p-92d166c6.entry.js +0 -1
  151. package/dist/post-components/p-DzmpoNOx.js +0 -1
  152. package/dist/types/components/post-closebutton/button-types.d.ts +0 -2
@@ -1 +1 @@
1
- import{P as o,d as s}from"./p-Bj1Y_nVo.js";const p=o,r=s;export{p as PostAccordion,r as defineCustomElement}
1
+ import{P as o,d as s}from"./p-mA_8jS9w.js";const m=o,p=s;export{m as PostAccordion,p as defineCustomElement}
@@ -1 +1 @@
1
- import{p as t,H as i,h as e,a,t as s}from"./index.js";import{v as r}from"./p-DzmpoNOx.js";import{c as o,f as n,i as d}from"./p-D6ZeuFSR.js";const c=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;var h;!function(t){t.Slotted="slotted",t.Image="image",t.Initials="initials",t[t.Null=null]="Null"}(h||(h={}));const l=t(class t extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.avatarType=null,this.imageUrl="",this.imageAlt="",this.initials="",this.storageKey=""}validateFirstname(){o(this,"firstname","string")}validateLastname(){n(this,"lastname","string")}updateUserid(){this.validateUserId(),this.getAvatarImage()}updateEmail(){this.validateEmail(),this.getAvatarImage()}validateDescription(){n(this,"description","string")}validateUserId(){n(this,"userid","string")}validateEmail(){this.email&&d(this,"email",c)}async getAvatarImage(){let t=!1;this.slottedImage=this.host.querySelector("img");const i=this.slottedImage?.getAttribute("src");i?await this.getImageByProp(i,this.fetchSlottedImage.bind(this))?this.slottedImage.style.display="block":(this.slottedImage.style.display="none",this.avatarType=h.Initials):(this.userid&&(t=await this.getImageByProp(this.userid,this.fetchImageByUserId.bind(this))),!t&&this.email?.match(c)&&(t=await this.getImageByProp(this.email,this.fetchImageByEmail.bind(this))),t||(this.avatarType=h.Initials))}async getImageByProp(t,i){if(!t)return!1;let e;try{e=await i(t)}catch(t){return console.info("Loading avatar image failed.",t),!1}return!!e?.ok&&(this.imageUrl=e.url,this.imageAlt=`${this.firstname} ${this.lastname} avatar`,this.avatarType=h.Image,!0)}async fetchImageByUserId(){return await fetch(t.INTERNAL_USERID_IMAGE_SRC.replace("{userid}",encodeURIComponent(this.userid)))}async fetchImageByEmail(){const t=await async function(t){return await crypto.subtle.digest("SHA-256",(new TextEncoder).encode(t)).then((t=>Array.from(new Uint8Array(t)).map((t=>t.toString(16).padStart(2,"0"))).join("")))}(this.email),i="https://www.gravatar.com/avatar/{email}?s=80&d=404&r=g".replace("{email}",t);return await fetch(i)}async fetchSlottedImage(t){return await fetch(t,{method:"HEAD"})}slotChanged(){const t=this.host.shadowRoot.querySelector("slot");(t?.assignedNodes({flatten:!0})||[]).forEach((t=>{t.nodeType===Node.ELEMENT_NODE&&"IMG"===t.tagName&&this.observeImageSrcChanges(t)})),this.getAvatarImage()}observeImageSrcChanges(t){this.slottedImageObserver&&this.slottedImageObserver.disconnect(),this.slottedImageObserver=new MutationObserver((t=>{t.forEach((t=>{"attributes"===t.type&&"src"===t.attributeName&&this.getAvatarImage()}))})),this.slottedImageObserver.observe(t,{attributes:!0,attributeFilter:["src"]})}connectedCallback(){this.avatarType=h.Initials,this.getAvatarImage()}componentDidLoad(){this.validateFirstname(),this.validateLastname(),this.validateDescription(),this.validateUserId(),this.validateEmail()}render(){const t=[this.firstname,this.lastname].filter((t=>t)).map((t=>t.trim())),i=t.map((t=>t.charAt(0))).join("").trim(),s=t.join(" ");return e(a,{key:"620b361e23a70143903abd7bf10bcd804f959042","data-version":r},e("span",{key:"cc3752d89187f0c08dedf2952676de1aaaa59a8a",class:"slotted"===this.avatarType?"":"d-none"},e("slot",{key:"dbba7fc0522b177f6ad467f0e22dad9065582ce7",onSlotchange:this.slotChanged.bind(this)})),"image"===this.avatarType&&e("img",{key:"375eeeab749e09bc21d215aa80cf45309a15620e",src:this.imageUrl,alt:this.imageAlt}),"initials"===this.avatarType&&e("span",{key:"620d25537ef0f606933e9c7deb915a87fbc4b95c",class:"initials"},i,e("span",{key:"03dc6aacddc2af35c114fc6815550e0ec461937d"},this.description??s)))}get host(){return this}static get watchers(){return{firstname:[{validateFirstname:0}],lastname:[{validateLastname:0}],userid:[{updateUserid:0}],email:[{updateEmail:0}],description:[{validateDescription:0}]}}static get style(){return':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;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;font-weight:400}.initials span{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}'}},[257,"post-avatar",{firstname:[513],lastname:[1],userid:[1],email:[1],description:[1],slottedImage:[32],avatarType:[32],imageUrl:[32],imageAlt:[32],initials:[32],storageKey:[32]},void 0,{firstname:[{validateFirstname:0}],lastname:[{validateLastname:0}],userid:[{updateUserid:0}],email:[{updateEmail:0}],description:[{validateDescription:0}]}]);function p(){"undefined"!=typeof customElements&&["post-avatar"].forEach((t=>{"post-avatar"===t&&(customElements.get(s(t))||customElements.define(s(t),l))}))}l.INTERNAL_USERID_IMAGE_SRC="https://web.post.ch/UserProfileImage/{userid}.png",p();const m=l,v=p;export{m as PostAvatar,v as defineCustomElement}
1
+ import{p as t,H as i,h as e,a,t as s}from"./index.js";import{v as r}from"./p-BzBcOfzl.js";import{c as o,f as n,i as d}from"./p-D6ZeuFSR.js";const c=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;var h;!function(t){t.Slotted="slotted",t.Image="image",t.Initials="initials",t[t.Null=null]="Null"}(h||(h={}));const l=t(class t extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.avatarType=null,this.imageUrl="",this.imageAlt="",this.initials="",this.storageKey=""}validateFirstname(){o(this,"firstname","string")}validateLastname(){n(this,"lastname","string")}updateUserid(){this.validateUserId(),this.getAvatarImage()}updateEmail(){this.validateEmail(),this.getAvatarImage()}validateDescription(){n(this,"description","string")}validateUserId(){n(this,"userid","string")}validateEmail(){this.email&&d(this,"email",c)}async getAvatarImage(){let t=!1;this.slottedImage=this.host.querySelector("img");const i=this.slottedImage?.getAttribute("src");i?await this.getImageByProp(i,this.fetchSlottedImage.bind(this))?this.slottedImage.style.display="block":(this.slottedImage.style.display="none",this.avatarType=h.Initials):(this.userid&&(t=await this.getImageByProp(this.userid,this.fetchImageByUserId.bind(this))),!t&&this.email?.match(c)&&(t=await this.getImageByProp(this.email,this.fetchImageByEmail.bind(this))),t||(this.avatarType=h.Initials))}async getImageByProp(t,i){if(!t)return!1;let e;try{e=await i(t)}catch(t){return console.info("Loading avatar image failed.",t),!1}return!!e?.ok&&(this.imageUrl=e.url,this.imageAlt=`${this.firstname} ${this.lastname} avatar`,this.avatarType=h.Image,!0)}async fetchImageByUserId(){return await fetch(t.INTERNAL_USERID_IMAGE_SRC.replace("{userid}",encodeURIComponent(this.userid)))}async fetchImageByEmail(){const t=await async function(t){return await crypto.subtle.digest("SHA-256",(new TextEncoder).encode(t)).then((t=>Array.from(new Uint8Array(t)).map((t=>t.toString(16).padStart(2,"0"))).join("")))}(this.email),i="https://www.gravatar.com/avatar/{email}?s=80&d=404&r=g".replace("{email}",t);return await fetch(i)}async fetchSlottedImage(t){return await fetch(t,{method:"HEAD"})}slotChanged(){const t=this.host.shadowRoot.querySelector("slot");(t?.assignedNodes({flatten:!0})||[]).forEach((t=>{t.nodeType===Node.ELEMENT_NODE&&"IMG"===t.tagName&&this.observeImageSrcChanges(t)})),this.getAvatarImage()}observeImageSrcChanges(t){this.slottedImageObserver&&this.slottedImageObserver.disconnect(),this.slottedImageObserver=new MutationObserver((t=>{t.forEach((t=>{"attributes"===t.type&&"src"===t.attributeName&&this.getAvatarImage()}))})),this.slottedImageObserver.observe(t,{attributes:!0,attributeFilter:["src"]})}connectedCallback(){this.avatarType=h.Initials,this.getAvatarImage()}componentDidLoad(){this.validateFirstname(),this.validateLastname(),this.validateDescription(),this.validateUserId(),this.validateEmail()}render(){const t=[this.firstname,this.lastname].filter((t=>t)).map((t=>t.trim())),i=t.map((t=>t.charAt(0))).join("").trim(),s=t.join(" ");return e(a,{key:"620b361e23a70143903abd7bf10bcd804f959042","data-version":r},e("span",{key:"cc3752d89187f0c08dedf2952676de1aaaa59a8a",class:"slotted"===this.avatarType?"":"d-none"},e("slot",{key:"dbba7fc0522b177f6ad467f0e22dad9065582ce7",onSlotchange:this.slotChanged.bind(this)})),"image"===this.avatarType&&e("img",{key:"375eeeab749e09bc21d215aa80cf45309a15620e",src:this.imageUrl,alt:this.imageAlt}),"initials"===this.avatarType&&e("span",{key:"620d25537ef0f606933e9c7deb915a87fbc4b95c",class:"initials"},i,e("span",{key:"03dc6aacddc2af35c114fc6815550e0ec461937d"},this.description??s)))}get host(){return this}static get watchers(){return{firstname:[{validateFirstname:0}],lastname:[{validateLastname:0}],userid:[{updateUserid:0}],email:[{updateEmail:0}],description:[{validateDescription:0}]}}static get style(){return':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;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;font-weight:400}.initials span{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}'}},[257,"post-avatar",{firstname:[513],lastname:[1],userid:[1],email:[1],description:[1],slottedImage:[32],avatarType:[32],imageUrl:[32],imageAlt:[32],initials:[32],storageKey:[32]},void 0,{firstname:[{validateFirstname:0}],lastname:[{validateLastname:0}],userid:[{updateUserid:0}],email:[{updateEmail:0}],description:[{validateDescription:0}]}]);function p(){"undefined"!=typeof customElements&&["post-avatar"].forEach((t=>{"post-avatar"===t&&(customElements.get(s(t))||customElements.define(s(t),l))}))}l.INTERNAL_USERID_IMAGE_SRC="https://web.post.ch/UserProfileImage/{userid}.png",p();const m=l,v=p;export{m as PostAvatar,v as defineCustomElement}
@@ -1 +1 @@
1
- import{t,p as o,H as e,h as i,a as s}from"./index.js";import{f as a}from"./p-BVCjnh6Q.js";import{v as r}from"./p-DzmpoNOx.js";import{c}from"./p-D6ZeuFSR.js";import{d as n}from"./p-B7Pfex_I.js";const p=o(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.belowFold=!1,this.handleScroll=()=>{this.belowFold=this.isBelowFold()}}isBelowFold(){return window.scrollY>window.innerHeight}validateTextBackToTop(){c(this,"textBackToTop","string")}watchBelowFold(t){a(this.host,t?"in":"out",{translate:this.translateY,fill:"forwards"})}scrollToTop(){window.scrollTo({top:0,behavior:"smooth"})}getSecondPixelValue(t){for(const o of t){const t=o.match(/\b\d+px\b/g);if(t&&t.length>1)return t[1]}}animateButton(){const t=window.getComputedStyle(this.host).getPropertyValue("top"),o=this.host.shadowRoot.querySelector("button"),e=getComputedStyle(o).getPropertyValue("--post-back-to-top-elevation").split(","),i=this.getSecondPixelValue(e);this.translateY=-1-parseFloat(t.replace("px",""))-parseFloat(i.replace("px","")),this.belowFold&&a(this.host,"in",{translate:this.translateY,fill:"forwards"}),this.belowFold||(this.host.style.transform=`translateY(${this.translateY})`)}componentWillLoad(){this.belowFold=this.isBelowFold()}componentDidLoad(){window.addEventListener("scroll",this.handleScroll,!1),this.animateButton(),this.validateTextBackToTop()}disconnectedCallback(){window.removeEventListener("scroll",this.handleScroll)}render(){return i(s,{key:"a6a5afe41d76c9b2b703f4a78e63849a1437680f","data-version":r},i("button",{key:"ad10b46cf4d07d1efffae6feef7431ba8a11c59e",class:"back-to-top","aria-hidden":this.belowFold?"false":"true",tabindex:this.belowFold?"0":"-1",onClick:this.scrollToTop},i("post-icon",{key:"e95c5710939aa968df42f3acec2d56b2eaaa238e","aria-hidden":"true",name:"arrowup"}),i("span",{key:"f854524e0b76f71ef1edfed5a13d57985ac98ea5",class:"visually-hidden"},this.textBackToTop)))}get host(){return this}static get watchers(){return{textBackToTop:[{validateTextBackToTop:0}],belowFold:[{watchBelowFold:0}]}}static get style(){return":host{opacity:0;--post-floating-button-position-top:var(--post-device-position-4);--post-back-to-top-position-top:calc( var(--post-header-height) + var(--post-floating-button-position-top) );--post-back-to-top-elevation:var(--post-device-elevation-300);position:fixed;inset-block-start:var(--post-back-to-top-position-top);inset-inline-end:var(--post-device-position-1)}:host .back-to-top{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button;box-shadow:var(--post-back-to-top-elevation);cursor:pointer;border-radius:var(--post-device-border-radius-round);width:var(--post-device-sizing-interactive-button-height-2);height:var(--post-device-sizing-interactive-button-height-2);border:var(--post-device-border-width-default) solid var(--post-scheme-color-interactive-button-secondary-enabled-stroke);color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);background-color:var(--post-scheme-color-interactive-button-secondary-enabled-bg);display:flex;align-items:center;justify-content:center}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .back-to-top{background-color:ButtonFace !important}:host .back-to-top:hover{background-color:Highlight !important}}:host .back-to-top{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}:host .back-to-top:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .back-to-top:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){:host .back-to-top:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .back-to-top:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}:host .back-to-top:hover{border-color:var(--post-scheme-color-interactive-button-secondary-hover-stroke);color:var(--post-scheme-color-interactive-button-secondary-hover-fg);background-color:var(--post-scheme-color-interactive-button-secondary-hover-bg)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .back-to-top:hover{color:HighlightText !important}}:host .back-to-top post-icon{height:var(--post-device-sizing-interactive-button-icon-3);width:var(--post-device-sizing-interactive-button-icon-3)}:host .visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}"}},[1,"post-back-to-top",{textBackToTop:[513,"text-back-to-top"],belowFold:[32]},void 0,{textBackToTop:[{validateTextBackToTop:0}],belowFold:[{watchBelowFold:0}]}]);function l(){"undefined"!=typeof customElements&&["post-back-to-top","post-icon"].forEach((o=>{switch(o){case"post-back-to-top":customElements.get(t(o))||customElements.define(t(o),p);break;case"post-icon":customElements.get(t(o))||n()}}))}l();const d=p,h=l;export{d as PostBackToTop,h as defineCustomElement}
1
+ import{t,p as o,H as e,h as i,a as s}from"./index.js";import{f as a}from"./p-BVCjnh6Q.js";import{v as c}from"./p-BzBcOfzl.js";import{c as r}from"./p-D6ZeuFSR.js";import{d as n}from"./p-CILij1jX.js";const l=o(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.belowFold=!1,this.handleScroll=()=>{this.belowFold=this.isBelowFold()}}isBelowFold(){return window.scrollY>window.innerHeight}validateTextBackToTop(){r(this,"textBackToTop","string")}watchBelowFold(t){a(this.host,t?"in":"out",{translate:this.translateY,fill:"forwards"})}scrollToTop(){window.scrollTo({top:0,behavior:"smooth"})}getSecondPixelValue(t){for(const o of t){const t=o.match(/\b\d+px\b/g);if(t&&t.length>1)return t[1]}}animateButton(){const t=window.getComputedStyle(this.host).getPropertyValue("top"),o=this.host.shadowRoot.querySelector("button"),e=getComputedStyle(o).getPropertyValue("--post-back-to-top-elevation").split(","),i=this.getSecondPixelValue(e);this.translateY=-1-parseFloat(t.replace("px",""))-parseFloat(i.replace("px","")),this.belowFold&&a(this.host,"in",{translate:this.translateY,fill:"forwards"}),this.belowFold||(this.host.style.transform=`translateY(${this.translateY})`)}componentWillLoad(){this.belowFold=this.isBelowFold()}componentDidLoad(){window.addEventListener("scroll",this.handleScroll,!1),this.animateButton(),this.validateTextBackToTop()}disconnectedCallback(){window.removeEventListener("scroll",this.handleScroll)}render(){return i(s,{key:"a6a5afe41d76c9b2b703f4a78e63849a1437680f","data-version":c},i("button",{key:"ad10b46cf4d07d1efffae6feef7431ba8a11c59e",class:"back-to-top","aria-hidden":this.belowFold?"false":"true",tabindex:this.belowFold?"0":"-1",onClick:this.scrollToTop},i("post-icon",{key:"e95c5710939aa968df42f3acec2d56b2eaaa238e","aria-hidden":"true",name:"arrowup"}),i("span",{key:"f854524e0b76f71ef1edfed5a13d57985ac98ea5",class:"visually-hidden"},this.textBackToTop)))}get host(){return this}static get watchers(){return{textBackToTop:[{validateTextBackToTop:0}],belowFold:[{watchBelowFold:0}]}}static get style(){return":host{opacity:0;--post-floating-button-position-top:var(--post-device-position-4);--post-back-to-top-position-top:calc( var(--post-header-height) + var(--post-floating-button-position-top) );--post-back-to-top-elevation:var(--post-device-elevation-300);position:fixed;inset-block-start:var(--post-back-to-top-position-top);inset-inline-end:var(--post-device-position-1)}:host .back-to-top{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button;box-shadow:var(--post-back-to-top-elevation);cursor:pointer;border-radius:var(--post-device-border-radius-round);width:var(--post-device-sizing-interactive-button-height-2);height:var(--post-device-sizing-interactive-button-height-2);border:var(--post-device-border-width-default) solid var(--post-scheme-color-interactive-button-secondary-enabled-stroke);color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);background-color:var(--post-scheme-color-interactive-button-secondary-enabled-bg);display:flex;align-items:center;justify-content:center}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .back-to-top{background-color:ButtonFace !important}:host .back-to-top:hover{background-color:Highlight !important}}:host .back-to-top{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}:host .back-to-top:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .back-to-top:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){:host .back-to-top:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .back-to-top:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}:host .back-to-top:hover{border-color:var(--post-scheme-color-interactive-button-secondary-hover-stroke);color:var(--post-scheme-color-interactive-button-secondary-hover-fg);background-color:var(--post-scheme-color-interactive-button-secondary-hover-bg)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .back-to-top:hover{color:HighlightText !important}}:host .back-to-top post-icon{height:var(--post-device-sizing-interactive-button-icon-3);width:var(--post-device-sizing-interactive-button-icon-3)}:host .visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}"}},[1,"post-back-to-top",{textBackToTop:[513,"text-back-to-top"],belowFold:[32]},void 0,{textBackToTop:[{validateTextBackToTop:0}],belowFold:[{watchBelowFold:0}]}]);function p(){"undefined"!=typeof customElements&&["post-back-to-top","post-icon"].forEach((o=>{switch(o){case"post-back-to-top":customElements.get(t(o))||customElements.define(t(o),l);break;case"post-icon":customElements.get(t(o))||n()}}))}p();const d=l,h=p;export{d as PostBackToTop,h as defineCustomElement}