@postnord/pn-marketweb-components 2.0.93 → 2.0.94

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.
@@ -1,96 +1,94 @@
1
- (function() {
1
+ (function () {
2
+ if (document.body.dataset['marketwebComponentsSalesforceInit']) {
3
+ return;
4
+ }
5
+ document.body.dataset['marketwebComponentsSalesforceInit'] = true;
2
6
 
3
- if (document.body.dataset["marketwebComponentsSalesforceInit"]) {
4
- return;
5
- }
6
- document.body.dataset["marketwebComponentsSalesforceInit"] = true;
7
-
8
- const header = document.createElement('pn-marketweb-siteheader');
9
- const footer = document.createElement('pn-marketweb-sitefooter');
10
- let currentLanguage = document.querySelector('html').getAttribute("lang");
11
- if (currentLanguage === "en-US" || currentLanguage === "en_US") {
12
- currentLanguage = "en";
13
- }
7
+ const header = document.createElement('pn-marketweb-siteheader');
8
+ const footer = document.createElement('pn-marketweb-sitefooter');
9
+ let currentLanguage = document.querySelector('html').getAttribute('lang');
10
+ if (currentLanguage === 'en-US' || currentLanguage === 'en_US') {
11
+ currentLanguage = 'en';
12
+ }
14
13
 
15
- [header, footer].forEach((comp) => {
16
- comp.setAttribute('market', 'dk');
17
- comp.setAttribute('language', currentLanguage);
18
- comp.setAttribute('site-domain-in-urls', 'true');
19
- comp.setAttribute('spa-mode', 'true');
20
- const environment = (window.location.href.indexOf('kundeservice.postnord.dk') !== -1 ? "production" : "preproduction")
21
- comp.setAttribute('environment', environment);
22
-
23
- })
24
- document.body.insertBefore(header, document.body.firstElementChild);
25
- document.body.appendChild(footer);
14
+ [header, footer].forEach(comp => {
15
+ comp.setAttribute('market', 'dk');
16
+ comp.setAttribute('language', currentLanguage);
17
+ comp.setAttribute('site-domain-in-urls', 'true');
18
+ comp.setAttribute('spa-mode', 'true');
19
+ const environment = window.location.href.indexOf('kundeservice.postnord.dk') !== -1 ? 'production' : 'preproduction';
20
+ comp.setAttribute('environment', environment);
21
+ });
22
+ document.body.insertBefore(header, document.body.firstElementChild);
23
+ document.body.appendChild(footer);
26
24
 
25
+ const s = document.createElement('script');
26
+ s.setAttribute('type', 'module');
27
+ s.setAttribute('src', 'https://cdn.jsdelivr.net/npm/@postnord/pn-marketweb-components@2.0.94/umd/standalone-loader-salesforce.js');
28
+ document.querySelector('head').appendChild(s);
27
29
 
28
- const s = document.createElement('script');
29
- s.setAttribute("type", "module");
30
- s.setAttribute("src", "https://cdn.jsdelivr.net/npm/@postnord/pn-marketweb-components@2.0.93/umd/standalone-loader-salesforce.js");
31
- document.querySelector("head").appendChild(s);
30
+ const style = document.createElement('link');
31
+ style.setAttribute('rel', 'stylesheet');
32
+ style.setAttribute('href', 'https://cdn.jsdelivr.net/npm/@postnord/pn-marketweb-components@2.0.94/umd/pn-marketweb-wrongrembase.css');
33
+ document.querySelector('head').appendChild(style);
32
34
 
33
- const style = document.createElement('link');
34
- style.setAttribute("rel", "stylesheet");
35
- style.setAttribute("href", "https://cdn.jsdelivr.net/npm/@postnord/pn-marketweb-components@2.0.93/umd/pn-marketweb-wrongrembase.css");
36
- document.querySelector("head").appendChild(style);
37
-
38
- window["bindLanguageSelector"] = function() {
39
- if (window["haslangchange"]) {
40
- return;
41
- }
42
- window.addEventListener('marketweb-languagechange', (e) => {
43
- let lang = e.detail;
44
- if (lang === "en") {
45
- lang = "en_US";
46
- }
47
- const queryParams = new URLSearchParams(window.location.search);
48
- const currentLanguageValue = queryParams.get("language");
35
+ window['bindLanguageSelector'] = function () {
36
+ if (window['haslangchange']) {
37
+ return;
38
+ }
39
+ window.addEventListener('marketweb-languagechange', e => {
40
+ let lang = e.detail;
41
+ if (lang === 'en') {
42
+ lang = 'en_US';
43
+ }
44
+ const queryParams = new URLSearchParams(window.location.search);
45
+ const currentLanguageValue = queryParams.get('language');
49
46
 
50
- if (lang.indexOf("en") !== -1) {
51
- const rootUrl = (window.location.href.indexOf('kundeservice-test.postnord.dk' !== -1) ? "https://www.postnord.dk" : "https://dk-preproduction.postnord.com");
52
- window.location.href = `${rootUrl}/en/help-and-support/private`;
53
- }
54
- // if (currentLanguageValue === lang) {
55
- // return;
56
- // }
57
- // queryParams.set("language", lang);
58
- // let newUrl = window.location.origin + window.location.pathname + '?'+ queryParams.toString();
59
- // if (newUrl.indexOf("/article/") !== -1) {
60
- // if (lang === "en_US" && newUrl.indexOf("-da-") !== -1) {
61
- // newUrl = newUrl.replace("-da-", "-en-");
62
- // }
63
- // if (lang === "da" && newUrl.indexOf("-en-") !== -1) {
64
- // newUrl = newUrl.replace("-en-", "-da-");
65
- // }
66
- // }
67
-
68
- window.location.href = newUrl;
69
- });
70
- window["haslangchange"] = true;
71
- };
72
- document.addEventListener('DOMContentLoaded', () => {
73
- window["bindLanguageSelector"]();
47
+ if (lang.indexOf('en') !== -1) {
48
+ const rootUrl = window.location.href.indexOf('kundeservice-test.postnord.dk' !== -1) ? 'https://www.postnord.dk' : 'https://dk-preproduction.postnord.com';
49
+ window.location.href = `${rootUrl}/en/help-and-support/private`;
74
50
  }
75
- );
76
- window.setTimeout(() => { window["bindLanguageSelector"](); }, 200);
77
- window["renderpncomponent-interval"] = window.setInterval(renderPNComponents,150);
78
- renderPNComponents();
51
+ // if (currentLanguageValue === lang) {
52
+ // return;
53
+ // }
54
+ // queryParams.set("language", lang);
55
+ // let newUrl = window.location.origin + window.location.pathname + '?'+ queryParams.toString();
56
+ // if (newUrl.indexOf("/article/") !== -1) {
57
+ // if (lang === "en_US" && newUrl.indexOf("-da-") !== -1) {
58
+ // newUrl = newUrl.replace("-da-", "-en-");
59
+ // }
60
+ // if (lang === "da" && newUrl.indexOf("-en-") !== -1) {
61
+ // newUrl = newUrl.replace("-en-", "-da-");
62
+ // }
63
+ // }
64
+
65
+ window.location.href = newUrl;
66
+ });
67
+ window['haslangchange'] = true;
68
+ };
69
+ document.addEventListener('DOMContentLoaded', () => {
70
+ window['bindLanguageSelector']();
71
+ });
72
+ window.setTimeout(() => {
73
+ window['bindLanguageSelector']();
74
+ }, 200);
75
+ window['renderpncomponent-interval'] = window.setInterval(renderPNComponents, 150);
76
+ renderPNComponents();
79
77
  })();
80
78
 
81
79
  function renderPNComponents() {
82
- const componentsDivs = [...document.querySelectorAll("[data-component]:not([data-component-rendered])")];
83
- componentsDivs.forEach((componentDiv) => {
84
- const component = document.createElement(componentDiv.getAttribute("data-component"));
85
- [...componentDiv.attributes].map((dataAttribute) => {
86
- if (dataAttribute.name.indexOf("data-component-") === -1) {
87
- return;
88
- }
89
- component.setAttribute(dataAttribute.name.replace('data-component-',''), dataAttribute.value);
90
- });
91
- component.innerHTML = componentDiv.innerHTML;
92
- componentDiv.innerHTML = "";
93
- componentDiv.appendChild(component);
94
- componentDiv.setAttribute("data-component-rendered","");
80
+ const componentsDivs = [...document.querySelectorAll('[data-component]:not([data-component-rendered])')];
81
+ componentsDivs.forEach(componentDiv => {
82
+ const component = document.createElement(componentDiv.getAttribute('data-component'));
83
+ [...componentDiv.attributes].map(dataAttribute => {
84
+ if (dataAttribute.name.indexOf('data-component-') === -1) {
85
+ return;
86
+ }
87
+ component.setAttribute(dataAttribute.name.replace('data-component-', ''), dataAttribute.value);
95
88
  });
96
- }
89
+ component.innerHTML = componentDiv.innerHTML;
90
+ componentDiv.innerHTML = '';
91
+ componentDiv.appendChild(component);
92
+ componentDiv.setAttribute('data-component-rendered', '');
93
+ });
94
+ }
@@ -1 +0,0 @@
1
- import{r as e,h as t,a as n,g as r}from"./p-58e8d7d5.js";let a=class{constructor(t){e(this,t),this.text="some short text describing whatever",this.heading="some heading",this.dataCardColor="coral",this.dataCardAlignment="left"}render(){return t(n,null,t("div",{class:"pn-teaser-card__container"},t("div",{class:"pn-teaser-card__container__image__container"},t("slot",{name:"illustration"})),t("div",{class:"pn-teaser-card__container__content"},t("div",{class:"pn-teaser-card__container__content__text__container"},t("h1",null,this.heading),t("p",null,this.text)),t("div",{class:"pn-teaser-card__container__content__cta"},t("slot",{name:"cta"})))))}get hostElement(){return r(this)}};a.style="pn-teaser-card{width:100%;height:100%;display:-ms-flexbox;display:flex}pn-teaser-card .pn-teaser-card__container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:start;justify-content:flex-start;border-radius:2.4rem}pn-teaser-card .pn-teaser-card__container__image__container{width:100%;position:relative}pn-teaser-card .pn-teaser-card__container__image__container>[slot=illustration]{height:100%}pn-teaser-card .pn-teaser-card__container__image__container>[slot=illustration]>picture>img{width:100%;height:auto;border-top-left-radius:2.4rem;border-top-right-radius:2.4rem;-webkit-clip-path:ellipse(100% 90% at 50% 0%);clip-path:ellipse(100% 90% at 50% 0%);aspect-ratio:16/9}pn-teaser-card .pn-teaser-card__container__content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;-ms-flex:1 1 100%;flex:1 1 100%;gap:32px;padding:2.4rem 2.4rem;padding-top:0}pn-teaser-card .pn-teaser-card__container__content__text__container>h1{font-weight:700;font-size:2.4rem;line-height:2.64rem}pn-teaser-card .pn-teaser-card__container__content__text__container>p{padding-top:1.6rem;font-weight:400;font-size:1.6rem;line-height:2.24rem}pn-teaser-card .pn-teaser-card__container__content__cta>pn-button{-ms-flex-item-align:end;align-self:flex-end;width:100%}pn-teaser-card[data-card-color=coral]>.pn-teaser-card__container{background-color:#FDEFEE}pn-teaser-card[data-card-color=green]>.pn-teaser-card__container{background-color:#DCF6E7}@media screen and (min-width: 1200px){.halfwidth pn-teaser-card .pn-teaser-card__container__content{padding:0 5.6rem 5.6rem}.halfwidth pn-teaser-card .pn-teaser-card__container__content__text__container>h1{font-weight:700;font-size:3.2rem;line-height:3.52rem}.halfwidth pn-teaser-card .pn-teaser-card__container__content__text__container>p{font-weight:400;font-size:2rem;line-height:2.8rem}.halfwidth pn-teaser-card .pn-teaser-card__container__content__cta>pn-button{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}}@media screen and (min-width: 768px){.fullwidth pn-teaser-card{min-height:350px}.fullwidth pn-teaser-card .pn-teaser-card__container{-ms-flex-direction:row;flex-direction:row}.fullwidth pn-teaser-card .pn-teaser-card__container__content{-ms-flex-item-align:center;align-self:center;gap:2.4rem;padding-top:2.4rem}.fullwidth pn-teaser-card .pn-teaser-card__container__image__container>[slot=illustration]>picture>img{height:100%;border-top-left-radius:2.4rem;border-bottom-left-radius:2.4rem;-webkit-clip-path:ellipse(100% 100% at 0% 50%);clip-path:ellipse(100% 100% at 0% 50%);-o-object-fit:cover;object-fit:cover}.fullwidth pn-teaser-card .pn-teaser-card__container__content__cta>pn-button{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}}@media screen and (min-width: 1200px){.fullwidth pn-teaser-card{min-height:450px}.fullwidth pn-teaser-card .pn-teaser-card__container__content{padding:3.6rem}.fullwidth pn-teaser-card .pn-teaser-card__container__content__text__container>h1{font-weight:700;font-size:4.8rem;line-height:5.28rem}.fullwidth pn-teaser-card .pn-teaser-card__container__content__text__container>p{font-size:2rem;line-height:2.8rem}}@media screen and (min-width: 768px){.fullwidth pn-teaser-card[data-card-alignment=right] .pn-teaser-card__container{-ms-flex-direction:row-reverse;flex-direction:row-reverse}.fullwidth pn-teaser-card[data-card-alignment=right] .pn-teaser-card__container__image__container>[slot=illustration]>picture>img{border-bottom-right-radius:2.4rem;-webkit-clip-path:ellipse(100% 100% at 100% 50%);clip-path:ellipse(100% 100% at 100% 50%)}}";export{a as pn_teaser_card}
@@ -1 +0,0 @@
1
- System.register(["./p-36654f2a.system.js"],(function(e){"use strict";var t,n,r,a;return{setters:[function(e){t=e.r;n=e.h;r=e.a;a=e.g}],execute:function(){var i="pn-teaser-card{width:100%;height:100%;display:-ms-flexbox;display:flex}pn-teaser-card .pn-teaser-card__container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:start;justify-content:flex-start;border-radius:2.4rem}pn-teaser-card .pn-teaser-card__container__image__container{width:100%;position:relative}pn-teaser-card .pn-teaser-card__container__image__container>[slot=illustration]{height:100%}pn-teaser-card .pn-teaser-card__container__image__container>[slot=illustration]>picture>img{width:100%;height:auto;border-top-left-radius:2.4rem;border-top-right-radius:2.4rem;-webkit-clip-path:ellipse(100% 90% at 50% 0%);clip-path:ellipse(100% 90% at 50% 0%);aspect-ratio:16/9}pn-teaser-card .pn-teaser-card__container__content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;-ms-flex:1 1 100%;flex:1 1 100%;gap:32px;padding:2.4rem 2.4rem;padding-top:0}pn-teaser-card .pn-teaser-card__container__content__text__container>h1{font-weight:700;font-size:2.4rem;line-height:2.64rem}pn-teaser-card .pn-teaser-card__container__content__text__container>p{padding-top:1.6rem;font-weight:400;font-size:1.6rem;line-height:2.24rem}pn-teaser-card .pn-teaser-card__container__content__cta>pn-button{-ms-flex-item-align:end;align-self:flex-end;width:100%}pn-teaser-card[data-card-color=coral]>.pn-teaser-card__container{background-color:#FDEFEE}pn-teaser-card[data-card-color=green]>.pn-teaser-card__container{background-color:#DCF6E7}@media screen and (min-width: 1200px){.halfwidth pn-teaser-card .pn-teaser-card__container__content{padding:0 5.6rem 5.6rem}.halfwidth pn-teaser-card .pn-teaser-card__container__content__text__container>h1{font-weight:700;font-size:3.2rem;line-height:3.52rem}.halfwidth pn-teaser-card .pn-teaser-card__container__content__text__container>p{font-weight:400;font-size:2rem;line-height:2.8rem}.halfwidth pn-teaser-card .pn-teaser-card__container__content__cta>pn-button{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}}@media screen and (min-width: 768px){.fullwidth pn-teaser-card{min-height:350px}.fullwidth pn-teaser-card .pn-teaser-card__container{-ms-flex-direction:row;flex-direction:row}.fullwidth pn-teaser-card .pn-teaser-card__container__content{-ms-flex-item-align:center;align-self:center;gap:2.4rem;padding-top:2.4rem}.fullwidth pn-teaser-card .pn-teaser-card__container__image__container>[slot=illustration]>picture>img{height:100%;border-top-left-radius:2.4rem;border-bottom-left-radius:2.4rem;-webkit-clip-path:ellipse(100% 100% at 0% 50%);clip-path:ellipse(100% 100% at 0% 50%);-o-object-fit:cover;object-fit:cover}.fullwidth pn-teaser-card .pn-teaser-card__container__content__cta>pn-button{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}}@media screen and (min-width: 1200px){.fullwidth pn-teaser-card{min-height:450px}.fullwidth pn-teaser-card .pn-teaser-card__container__content{padding:3.6rem}.fullwidth pn-teaser-card .pn-teaser-card__container__content__text__container>h1{font-weight:700;font-size:4.8rem;line-height:5.28rem}.fullwidth pn-teaser-card .pn-teaser-card__container__content__text__container>p{font-size:2rem;line-height:2.8rem}}@media screen and (min-width: 768px){.fullwidth pn-teaser-card[data-card-alignment=right] .pn-teaser-card__container{-ms-flex-direction:row-reverse;flex-direction:row-reverse}.fullwidth pn-teaser-card[data-card-alignment=right] .pn-teaser-card__container__image__container>[slot=illustration]>picture>img{border-bottom-right-radius:2.4rem;-webkit-clip-path:ellipse(100% 100% at 100% 50%);clip-path:ellipse(100% 100% at 100% 50%)}}";var c=e("pn_teaser_card",function(){function e(e){t(this,e);this.text="some short text describing whatever";this.heading="some heading";this.dataCardColor="coral";this.dataCardAlignment="left"}e.prototype.render=function(){return n(r,null,n("div",{class:"pn-teaser-card__container"},n("div",{class:"pn-teaser-card__container__image__container"},n("slot",{name:"illustration"})),n("div",{class:"pn-teaser-card__container__content"},n("div",{class:"pn-teaser-card__container__content__text__container"},n("h1",null,this.heading),n("p",null,this.text)),n("div",{class:"pn-teaser-card__container__content__cta"},n("slot",{name:"cta"})))))};Object.defineProperty(e.prototype,"hostElement",{get:function(){return a(this)},enumerable:false,configurable:true});return e}());c.style=i}}}));