@postnord/pn-marketweb-components 2.0.108 → 2.0.110
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/cjs/{MarketWebLoginManager-11cf6811.js → MarketWebLoginManager-2fe6a1a7.js} +8 -2
- package/cjs/loader.cjs.js +1 -1
- package/cjs/pn-language-selector_9.cjs.entry.js +1 -1
- package/cjs/pn-line-shape.cjs.entry.js +21 -0
- package/cjs/pn-market-web-components.cjs.js +1 -1
- package/cjs/pn-marketweb-siteheader.cjs.entry.js +1 -1
- package/cjs/pn-quote-card.cjs.entry.js +24 -0
- package/cjs/pn-stats-info-data.cjs.entry.js +1 -1
- package/cjs/pn-stats-info.cjs.entry.js +4 -1
- package/collection/collection-manifest.json +2 -0
- package/collection/components/cards/pn-quote-card/pn-line-shape/pn-line-shape.css +39 -0
- package/collection/components/cards/pn-quote-card/pn-line-shape/pn-line-shape.js +18 -0
- package/collection/components/cards/pn-quote-card/pn-quote-card.css +291 -0
- package/collection/components/cards/pn-quote-card/pn-quote-card.js +92 -0
- package/collection/components/cards/pn-quote-card/pn-quote-card.stories.js +83 -0
- package/collection/components/data-visualization/pn-stats-info/pn-stats-info-data/animationHelper.js +1 -1
- package/collection/components/data-visualization/pn-stats-info/pn-stats-info-data/pn-stats-info-data.js +3 -3
- package/collection/components/data-visualization/pn-stats-info/pn-stats-info.js +4 -1
- package/collection/components/data-visualization/pn-stats-info/pn-stats-info.stories.js +8 -0
- package/collection/globals/MarketWebLoginManager.js +8 -2
- package/custom-elements/index.d.ts +12 -0
- package/custom-elements/index.js +52 -6
- package/esm/{MarketWebLoginManager-9b918d7e.js → MarketWebLoginManager-78e62611.js} +8 -2
- package/esm/loader.js +1 -1
- package/esm/pn-language-selector_9.entry.js +1 -1
- package/esm/pn-line-shape.entry.js +17 -0
- package/esm/pn-market-web-components.js +1 -1
- package/esm/pn-marketweb-siteheader.entry.js +1 -1
- package/esm/pn-quote-card.entry.js +20 -0
- package/esm/pn-stats-info-data.entry.js +1 -1
- package/esm/pn-stats-info.entry.js +4 -1
- package/esm-es5/{MarketWebLoginManager-9b918d7e.js → MarketWebLoginManager-78e62611.js} +1 -1
- package/esm-es5/loader.js +1 -1
- package/esm-es5/pn-language-selector_9.entry.js +1 -1
- package/esm-es5/pn-line-shape.entry.js +1 -0
- package/esm-es5/pn-market-web-components.js +1 -1
- package/esm-es5/pn-marketweb-siteheader.entry.js +1 -1
- package/esm-es5/pn-quote-card.entry.js +1 -0
- package/esm-es5/pn-stats-info-data.entry.js +1 -1
- package/esm-es5/pn-stats-info.entry.js +1 -1
- package/package.json +1 -1
- package/pn-market-web-components/{p-a3e34acb.entry.js → p-13443674.entry.js} +1 -1
- package/pn-market-web-components/p-15ae4d8a.system.entry.js +1 -0
- package/pn-market-web-components/p-1610d018.system.entry.js +1 -0
- package/pn-market-web-components/{p-08ea20b0.system.entry.js → p-18380cb2.system.entry.js} +1 -1
- package/pn-market-web-components/{p-492fce97.system.entry.js → p-2ccb9cd9.system.entry.js} +1 -1
- package/pn-market-web-components/p-4e0757d5.entry.js +1 -0
- package/pn-market-web-components/p-5117ac1f.entry.js +1 -0
- package/pn-market-web-components/p-67887512.system.js +1 -1
- package/pn-market-web-components/p-9775aec5.entry.js +1 -0
- package/pn-market-web-components/p-b9e8e73f.system.entry.js +1 -0
- package/pn-market-web-components/{p-2ac42d0a.system.js → p-d864da57.system.js} +1 -1
- package/pn-market-web-components/{p-71276cee.entry.js → p-e57eec87.entry.js} +1 -1
- package/pn-market-web-components/p-e999b220.js +1 -0
- package/pn-market-web-components/{p-177d6054.system.entry.js → p-f9fc1c6d.system.entry.js} +1 -1
- package/pn-market-web-components/p-fd4bb638.entry.js +1 -0
- package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
- package/types/components/cards/pn-quote-card/pn-line-shape/pn-line-shape.d.ts +4 -0
- package/types/components/cards/pn-quote-card/pn-quote-card.d.ts +7 -0
- package/types/components/data-visualization/pn-stats-info/pn-stats-info-data/pn-stats-info-data.d.ts +1 -1
- package/types/components/data-visualization/pn-stats-info/pn-stats-info.d.ts +1 -0
- package/types/components.d.ts +34 -2
- package/umd/pn-marketweb-init.js +1 -1
- package/umd/pn-marketweb-salesforce.js +2 -2
- package/pn-market-web-components/p-1ef2ef71.system.entry.js +0 -1
- package/pn-market-web-components/p-20281c39.entry.js +0 -1
- package/pn-market-web-components/p-910eb3c2.entry.js +0 -1
- package/pn-market-web-components/p-9e8e8cc4.js +0 -1
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
|
|
25
25
|
const s = document.createElement('script');
|
|
26
26
|
s.setAttribute('type', 'module');
|
|
27
|
-
s.setAttribute('src', 'https://cdn.jsdelivr.net/npm/@postnord/pn-marketweb-components@2.0.
|
|
27
|
+
s.setAttribute('src', 'https://cdn.jsdelivr.net/npm/@postnord/pn-marketweb-components@2.0.110/umd/standalone-loader-salesforce.js');
|
|
28
28
|
document.querySelector('head').appendChild(s);
|
|
29
29
|
|
|
30
30
|
const style = document.createElement('link');
|
|
31
31
|
style.setAttribute('rel', 'stylesheet');
|
|
32
|
-
style.setAttribute('href', 'https://cdn.jsdelivr.net/npm/@postnord/pn-marketweb-components@2.0.
|
|
32
|
+
style.setAttribute('href', 'https://cdn.jsdelivr.net/npm/@postnord/pn-marketweb-components@2.0.110/umd/pn-marketweb-wrongrembase.css');
|
|
33
33
|
document.querySelector('head').appendChild(style);
|
|
34
34
|
|
|
35
35
|
window['bindLanguageSelector'] = function () {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["./p-36654f2a.system.js"],(function(t){"use strict";var n,a,e;return{setters:[function(t){n=t.r;a=t.h;e=t.a}],execute:function(){var i=function(t,n,a,e){if(n===void 0){n=0}if(a===void 0){a=100}if(e===void 0){e=1e3}var i=null;var o=function(s){if(!i)i=s;var r=Math.min((s-i)/e,1);t.innerHTML=(Math.round((r*(a-n)+n)*10)/10).toString();if(r<1){window.requestAnimationFrame(o)}};window.requestAnimationFrame(o)};var o=function(t,n,a){t.forEach((function(t){t.target.classList.toggle(n,t.isIntersecting);a(t)}))};var s="pn-stats-info-data{width:50%;}pn-stats-info-data .pn-stats-info-data__container{width:100%;background-color:transparent;color:#F06365;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;padding:2rem}pn-stats-info-data .pn-stats-info-data__container__content{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}pn-stats-info-data .pn-stats-info-data__container__content__data{font-weight:700;font-size:3rem;line-height:110%}@media screen and (min-width: 1200px){pn-stats-info-data .pn-stats-info-data__container__content__data{font-size:6.8rem}}pn-stats-info-data .pn-stats-info-data__container__content__unit{font-weight:700;font-size:3rem;line-height:110%}@media screen and (min-width: 1200px){pn-stats-info-data .pn-stats-info-data__container__content__unit{font-size:6.8rem}}pn-stats-info-data .pn-stats-info-data__container__content__preamble{text-align:center;font-weight:400;font-size:1.4rem;line-height:110%;color:#FFFFFF}";var r=t("pn_stats_info_data",function(){function t(t){var a=this;n(this,t);this.data=0;this.unit=null;this.preamble=null;this.compId=null;this.duration=1e3;this.hasBeenShown=false;this.inViewPortCallback=function(t){if(t.isIntersecting){a.hasBeenShown=true}}}t.prototype.watchStateHandlder=function(t,n){var a=document.getElementById("pn-stats-info-data-".concat(this.compId));if(a.classList.contains("is-inViewport")&&t!==n){i(a,0,this.data,this.duration)}};t.prototype.render=function(){return a(e,null,a("div",{class:"pn-stats-info-data__container"},a("div",{class:"pn-stats-info-data__container__content"},a("div",{class:"pn-stats-info-data__container__content__data",id:"pn-stats-info-data-".concat(this.compId)}),a("div",{class:"pn-stats-info-data__container__content__unit"},this.unit)),a("div",{class:"pn-stats-info-data__container__content__preamble"},this.preamble)))};t.prototype.componentDidRender=function(){var t=this;var n=new IntersectionObserver((function(n){return o(n,"is-inViewport",t.inViewPortCallback)}));var a=document.getElementById("pn-stats-info-data-".concat(this.compId));n.observe(a)};Object.defineProperty(t,"watchers",{get:function(){return{hasBeenShown:["watchStateHandlder"]}},enumerable:false,configurable:true});return t}());r.style=s}}}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as n,a}from"./p-58e8d7d5.js";let i=class{constructor(n){t(this,n),this.data=0,this.unit=null,this.preamble=null,this.compId=null,this.duration=1e3,this.hasBeenShown=!1,this.inViewPortCallback=t=>{t.isIntersecting&&(this.hasBeenShown=!0)}}watchStateHandlder(t,n){const a=document.getElementById(`pn-stats-info-data-${this.compId}`);a.classList.contains("is-inViewport")&&t!==n&&((t,n=0,a=100,i=1e3)=>{let s=null;const e=o=>{s||(s=o);const d=Math.min((o-s)/i,1);t.innerHTML=(Math.round(10*(d*(a-n)+n))/10).toString(),d<1&&window.requestAnimationFrame(e)};window.requestAnimationFrame(e)})(a,0,this.data,this.duration)}render(){return n(a,null,n("div",{class:"pn-stats-info-data__container"},n("div",{class:"pn-stats-info-data__container__content"},n("div",{class:"pn-stats-info-data__container__content__data",id:`pn-stats-info-data-${this.compId}`}),n("div",{class:"pn-stats-info-data__container__content__unit"},this.unit)),n("div",{class:"pn-stats-info-data__container__content__preamble"},this.preamble)))}componentDidRender(){const t=new IntersectionObserver((t=>((t,n,a)=>{t.forEach((t=>{t.target.classList.toggle("is-inViewport",t.isIntersecting),a(t)}))})(t,0,this.inViewPortCallback))),n=document.getElementById(`pn-stats-info-data-${this.compId}`);t.observe(n)}static get watchers(){return{hasBeenShown:["watchStateHandlder"]}}};i.style="pn-stats-info-data{width:50%;}pn-stats-info-data .pn-stats-info-data__container{width:100%;background-color:transparent;color:#F06365;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;padding:2rem}pn-stats-info-data .pn-stats-info-data__container__content{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}pn-stats-info-data .pn-stats-info-data__container__content__data{font-weight:700;font-size:3rem;line-height:110%}@media screen and (min-width: 1200px){pn-stats-info-data .pn-stats-info-data__container__content__data{font-size:6.8rem}}pn-stats-info-data .pn-stats-info-data__container__content__unit{font-weight:700;font-size:3rem;line-height:110%}@media screen and (min-width: 1200px){pn-stats-info-data .pn-stats-info-data__container__content__unit{font-size:6.8rem}}pn-stats-info-data .pn-stats-info-data__container__content__preamble{text-align:center;font-weight:400;font-size:1.4rem;line-height:110%;color:#FFFFFF}";export{i as pn_stats_info_data}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,h as t,a as i}from"./p-58e8d7d5.js";let a=class{constructor(t){n(this,t),this.heading="Heading",this.dataArray='[{ "preamble": "Million parcels", "data": 226, "unit": null, "duration": 1000 }, { "preamble": "weighted parcel delivery quality", "data": 94.5, "unit": "%", "duration": 2500 },{ "preamble": "billion letters and other mail items", "data": 1.5, "unit": "", "duration": 3000 },{ "preamble": "carbon dioxide emissions since 2009", "data": -44, "unit": "%", "duration": 2000 }]',this.backgroundUrl=null,this.myParsedArray=JSON.parse(this.dataArray)}parseMyArrayProp(n){n&&(this.myParsedArray=JSON.parse(n))}render(){return t(i,null,t("div",{class:"pn-stats-info__container"},t("div",{class:"pn-stats-info__container__map",style:{backgroundImage:`url(${this.backgroundUrl})`}}),t("div",{class:"pn-stats-info__container__content",style:{backgroundImage:`url(${this.backgroundUrl})`}},t("h3",{class:"pn-stats-info__container__content__heading"},this.heading),t("div",{class:"pn-stats-info__container__content__data"},this.myParsedArray&&this.myParsedArray.map(((n,i)=>t("pn-stats-info-data",{"comp-id":i,data:n.data,unit:n.unit,preamble:n.preamble,duration:n.duration})))))))}static get watchers(){return{dataArray:["parseMyArrayProp"]}}};a.style=".bleed-container:has(pn-stats-info){padding:0;margin-bottom:3rem;overflow:hidden}.bleed-container:has(pn-stats-info) .container>.mb-5{margin-bottom:0 !important}.bleed-container:has(pn-stats-info) .statsblock{margin-bottom:0 !important}pn-stats-info{width:100%}pn-stats-info .pn-stats-info__container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center;padding-top:2rem}@media screen and (min-width: 768px){pn-stats-info .pn-stats-info__container{padding-top:6rem}}@media screen and (min-width: 1200px){pn-stats-info .pn-stats-info__container{padding-top:8rem}}pn-stats-info .pn-stats-info__container__map{display:none}@media screen and (min-width: 768px){pn-stats-info .pn-stats-info__container__map{display:block;max-width:46rem;width:100%;background-color:#0D234B;background-repeat:no-repeat;background-position:bottom center;background-size:55%}}@media screen and (min-width: 1200px){pn-stats-info .pn-stats-info__container__map{background-size:contain}}pn-stats-info .pn-stats-info__container__content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;padding:1rem;width:100%;background-color:#0D234B;background-repeat:no-repeat;background-position:bottom left;background-size:50%;background-blend-mode:overlay;padding-bottom:2rem}@media screen and (min-width: 768px){pn-stats-info .pn-stats-info__container__content{max-width:540px;background-position:-999px -999px;background-size:0;padding-bottom:4rem;padding-right:4rem}}@media screen and (min-width: 1200px){pn-stats-info .pn-stats-info__container__content{max-width:100%;padding-bottom:6rem;padding-right:6rem}}pn-stats-info .pn-stats-info__container__content__heading{color:#F06365;margin-bottom:2.4rem;-ms-flex-item-align:center;align-self:center;text-align:center;font-size:3rem;line-height:110%}@media screen and (min-width: 1200px){pn-stats-info .pn-stats-info__container__content__heading{font-weight:700;font-size:4.8rem}}pn-stats-info .pn-stats-info__container__content__data{height:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;min-height:20rem}@media screen and (min-width: 1640px){pn-stats-info .pn-stats-info__container__content__data{width:65rem}}";export{a as pn_stats_info}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
class t{constructor(t=null){var i;this.eventTarget=null!==window&&void 0!==window?window:null===document||void 0===document?void 0:document.body,this.endpoint="",this.storagePrefix="pn-user",this.baseUrls={at:"https://atportal.postnord.com/api/unified-login/backend",prod:"https://portal.postnord.com/api/unified-login/backend"},this.events={loginstatechange:"loginstatechange"},this.endpoints={authorizationEndpoint:"/authorization",tokenExchangeEndpoint:"/token",userInfoEndpoint:"/user",logoutEndpoint:"/logout"},this.keys={tokensource:"tokensource",token:"token",accessToken:"accessToken",user:"user",expire:"expire",expireDate:"expiredate"},this.overridetokenValue="overridetokenValue",this.siteUrl=window.location.origin,this.store={get:t=>{const i=window.sessionStorage.getItem(`${this.storagePrefix}-${t}`);if(!i)return i;if(0===i.indexOf("{"))try{return JSON.parse(i)}catch(s){}return-1!==i.indexOf(",")?i.split(","):i},set:(t,i)=>{"object"!=typeof i||void 0!==i.length?window.sessionStorage.setItem(`${this.storagePrefix}-${t}`,i):window.sessionStorage.setItem(`${this.storagePrefix}-${t}`,JSON.stringify(i))},remove:t=>{window.sessionStorage.removeItem(`${this.storagePrefix}-${t}`)}},t&&(this.eventTarget=t.eventTarget?t.eventTarget:this.eventTarget,this.endpoint=t.endpoint?t.endpoint:`${window.location.protocol}//${window.location.host}`,null!==(i=this.storagePrefix)&&void 0!==i||(this.storagePrefix=t.storagePrefix),t.userInfo&&(this.store.set(this.keys.user,t.userInfo),this.registerToken(this.overridetokenValue,"override")))}init(t=!0){t&&(this.checkParameters(),this.checkPNTopbar(),this.checkExpireTime(),this.store.get(this.keys.token)&&!this.store.get(this.keys.user)&&this.fetchUserInfo(),this.loginStateChange())}setSiteUrl(t){t&&(this.siteUrl=t)}isLoggedIn(t=!1){if(t)return t;let i=!(!this.store.get(this.keys.token)||!this.store.get(this.keys.user));return i||this.store.get(this.keys.token)!==this.overridetokenValue||(i=!0),i}registerToken(t="",i="frontend"){t&&t!==this.getToken()&&(this.clearUserData(),this.store.set(this.keys.tokensource,i),this.store.set(this.keys.token,t),this.fetchUserInfo())}invalidateTokenOfType(t="frontend"){this.store.get(this.keys.token)&&this.store.get(this.keys.tokensource)===t&&this.clearUserData()}getLoginUrl(t=""){const i=window.location.href;return t=t||i,`${this.getBaseUrl()}${this.endpoints.authorizationEndpoint}?redirectionUrl=${t}`}getLogoutUrl(t=""){const i=this.siteUrl.lastIndexOf("/")!==this.siteUrl.length-1;return`${t=this.siteUrl+(i?"/":"")+"logout"}?logoutUrl=${this.getBaseUrl()}${this.endpoints.logoutEndpoint}?redirectionUrl=${t}%26authorization=${this.store.get(this.keys.token)}`}getUserInfo(){if(this.isLoggedIn())return this.store.get(this.keys.user)}getEventTarget(){return this.eventTarget}checkExpireTime(){const t=this.store.get(this.keys.expire);t&&new Date>new Date(Math.floor(1e3*parseInt(t,10)))&&(console.info("Login time has expired"),this.clearUserData(),this.loginStateChange())}checkPNTopbar(){!this.isLoggedIn()&&window.pnTopbar&&window.pnTopbar.session_id&&(this.store.set(this.keys.token,window.pnTopbar.session_id),this.fetchUserInfo())}checkParameters(){if(!(null===window||void 0===window?void 0:window.location))return;const t=new URLSearchParams(window.location.search);if(t.get("oneTimeCode")){const i=t.get("oneTimeCode");this.exchangeToken(i).then((()=>{const t=window.location.href,s=-1!==t.indexOf("?oneTimeCode")?"?":"&",e=t.replace(`${s}oneTimeCode=${i}`,"");history.replaceState({},document.querySelector("title").innerText,e)}))}}async fetchUserInfo(){const t=this.store.get(this.keys.token);if(this.store.get(this.keys.token)===this.overridetokenValue)return void console.info("Did not fetch user data since it was set by an override");const i={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:t}},s=await fetch(`${this.getBaseUrl()}${this.endpoints.userInfoEndpoint}`,i),e=await s.json();if(e&&e.idToken)try{const{idToken:t,expiryTime:i,accessToken:s}=e,n=this.parseUserInfo(t);if(!n)return console.error("Userdata is not valid"),void this.clearUserData();this.store.set(this.keys.user,n),this.store.set(this.keys.accessToken,s),this.store.set(this.keys.expire,i),this.store.set(this.keys.expireDate,new Date(Math.floor(1e3*parseInt(i,10)))),this.loginStateChange()}catch(n){console.error("Unable to get user information",n)}else console.error("Unable to get user information. Clearing login state"),this.clearUserData()}clearUserData(){this.store.remove(this.keys.user),this.store.remove(this.keys.tokensource),this.store.remove(this.keys.accessToken),this.store.remove(this.keys.token),this.store.remove(this.keys.expire),this.store.remove(this.keys.expireDate)}getToken(){return this.store.get(this.keys.token)}getAccessToken(){return this.store.get(this.keys.accessToken)}async exchangeToken(t){this.clearUserData();const i=await fetch(`${this.getBaseUrl()}${this.endpoints.tokenExchangeEndpoint}?oneTimeCode=${t}`),{token:s}=await i.json();"string"==typeof s&&s&&this.store.set(this.keys.token,s),this.fetchUserInfo()}loginStateChange(){this.eventTarget&&this.eventTarget.dispatchEvent(new CustomEvent(this.events.loginstatechange,{detail:this.isLoggedIn()}))}getBaseUrl(){return["localhost","integration.","local."].filter((t=>-1!==this.endpoint.indexOf(t))).length>0?this.baseUrls.at:this.baseUrls.prod}parseUserInfo(t){if(!t)return null;var i=t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),s=decodeURIComponent(atob(i).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join(""));return JSON.parse(s)}}export{t as M}
|