txact-subscribe-button-2
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -1,1 +0,1 @@ | ||
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";n.r(e);const r=document.createElement("template");r.innerHTML='\n <style>\n .subscribe-button {\n width: 367px;\n font-family: Volvo Novum;\n font-size: 18px;\n line-height: 21px;\n text-align: center;\n letter-spacing: 0.03em;\n cursor: pointer;\n height: 70px;\n background: #007bcd;\n border: 1px solid #007bcd;\n stroke: #ffffff;\n padding: 20px 50px;\n fill: #ffffff;\n color: #ffffff;\n }\n \n .subscribe-button:hover {\n background: #008ae6;\n }\n \n .subscribe-button:focus {\n border: 1px solid #007bcd;\n }\n \n .subscribe-button[disabled] {\n opacity: 0.5;\n pointer-events: none;\n }\n \n </style>\n <div>\n <button type="subscribe-button" id=\'subscribe-button\' class="subscribe-button" ></button>\n </div>\n';class i extends HTMLElement{constructor(){super(),this.root=this.attachShadow({mode:"open"}),this.root.appendChild(r.content.cloneNode(!0)),this.subscribeButton=this.root.getElementById("subscribe-button"),this.subscribeButton.addEventListener("click",()=>this.handleClick()),this.subscribeButton.disabled=!0,this._co=""}connectedCallback(){this.subscribeButton.innerText=this.getAttribute("title");let t=`${this.ep}/products/vehicles?market=${this.market}`+`&m=${this.m}}&c=${this.c}&provider=${this.provider}`;fetch(t,{method:"GET",headers:{Accept:"application/vnd.volvocars.api.x.transferresponse.v1+json","Content-Type":"application/vnd.volvocars.api.x.stockcar.v1+json"}}).then(t=>{t.json().then(t=>{this.subscribeButton.disabled=!1,this._co="https://www.google.com"})}).catch(t=>{this.subscribeButton.disabled=!1,this._co="https://www.google.com"})}handleClick(){this._co&&window.location.replace(this._co)}get title(){return this.getAttribute("title")}set title(t){this.setAttribute("title",t),this.subscribeButton.innerText=this.getAttribute("title")}get ep(){return this.getAttribute("ep")}set ep(t){this.setAttribute("ep",t)}get provider(){return this.getAttribute("provider")}set provider(t){this.setAttribute("provider",t)}get m(){return this.getAttribute("m")}set m(t){this.setAttribute("m",t)}get c(){return this.getAttribute("c")}set c(t){this.setAttribute("c",t)}get market(){return this.getAttribute("market")}set market(t){this.setAttribute("market",t)}}customElements.get("txact-subscribe-button")||window.customElements.define("txact-subscribe-button",i)}]); | ||
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";n.r(e);const r=document.createElement("template");r.innerHTML='\n <style>\n .subscribe-button {\n width: 367px;\n font-family: Volvo Novum;\n font-size: 18px;\n line-height: 21px;\n text-align: center;\n letter-spacing: 0.03em;\n cursor: pointer;\n height: 70px;\n background: #007bcd;\n border: 1px solid #007bcd;\n stroke: #ffffff;\n padding: 20px 50px;\n fill: #ffffff;\n color: #ffffff;\n }\n \n .subscribe-button:hover {\n background: #008ae6;\n }\n \n .subscribe-button:focus {\n border: 1px solid #007bcd;\n }\n \n .subscribe-button[disabled] {\n opacity: 0.5;\n pointer-events: none;\n }\n \n </style>\n <div>\n <button type="subscribe-button" id=\'subscribe-button\' class="subscribe-button" >\n <slot></slot>\n </button>\n </div>\n';class o extends HTMLElement{constructor(){super(),this.root=this.attachShadow({mode:"open"}),this.root.appendChild(r.content.cloneNode(!0)),this.subscribeButton=this.root.getElementById("subscribe-button"),this.subscribeButton.addEventListener("click",()=>this.handleClick()),this.subscribeButton.disabled=!0,this._co=""}connectedCallback(){let t=`${this.ep}/products/vehicles?market=${this.market}`+`&m=${this.m}}&c=${this.c}&provider=${this.provider}`;fetch(t,{method:"GET",headers:{Accept:"application/vnd.volvocars.api.x.transferresponse.v1+json","Content-Type":"application/vnd.volvocars.api.x.stockcar.v1+json"}}).then(t=>{t.json().then(t=>{this.subscribeButton.disabled=!1,this._co="https://www.google.com"})}).catch(t=>{this.subscribeButton.disabled=!1,this._co="https://www.google.com"})}handleClick(){this._co&&window.location.replace(this._co)}get ep(){return this.getAttribute("ep")}set ep(t){this.setAttribute("ep",t)}get provider(){return this.getAttribute("provider")}set provider(t){this.setAttribute("provider",t)}get m(){return this.getAttribute("m")}set m(t){this.setAttribute("m",t)}get c(){return this.getAttribute("c")}set c(t){this.setAttribute("c",t)}get market(){return this.getAttribute("market")}set market(t){this.setAttribute("market",t)}}customElements.get("txact-subscribe-button")||window.customElements.define("txact-subscribe-button",o)}]); |
{ | ||
"name": "txact-subscribe-button-2", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/main.js", |
@@ -35,3 +35,5 @@ const subscribeButtonTemplateString = ` | ||
<div> | ||
<button type="subscribe-button" id='subscribe-button' class="subscribe-button" ></button> | ||
<button type="subscribe-button" id='subscribe-button' class="subscribe-button" > | ||
<slot></slot> | ||
</button> | ||
</div> | ||
@@ -67,3 +69,2 @@ `; | ||
connectedCallback() { | ||
this.subscribeButton.innerText = this.getAttribute('title'); | ||
let path=`${this.ep}/products/vehicles?market=${this.market}`+ | ||
@@ -100,11 +101,2 @@ `&m=${this.m}}&c=${this.c}&provider=${this.provider}`; | ||
get title() { | ||
return this.getAttribute('title'); | ||
} | ||
set title(_title) { | ||
this.setAttribute('title', _title); | ||
this.subscribeButton.innerText = this.getAttribute('title'); | ||
} | ||
get ep() { | ||
@@ -111,0 +103,0 @@ return this.getAttribute('ep'); |
import './main'; | ||
// | ||
// | ||
// | ||
// const txactSubscribeButton = document.createElement('txact-subscribe-button'); | ||
@@ -12,3 +10,20 @@ // txactSubscribeButton.title = 'Subscribe'; | ||
// txactSubscribeButton.market='US'; | ||
// txactSubscribeButton.innerText = 'Subscribe'; | ||
// | ||
// document.body.appendChild(txactSubscribeButton); | ||
// | ||
// | ||
// | ||
// const div = document.createElement('div'); | ||
// | ||
// const txactSubscribeButton2 = "<txact-subscribe-button " + | ||
// " ep='http://development-uswest2.ccdp.volvo.care/ccdp/pdp'"+ | ||
// " provider='SF'"+ | ||
// " m='eyJ2IjoiWVY0QTIyUEs2SjEyMDYwMTQiLCJwIjp7Im1ycCI6IjgwMC4wMCJ9LCJkaSI6IjM0MDgwIiwiZGFpIjoiS1NJTkdINkB2b2x2b2NhcnMuY29tIn0='" + | ||
// " c='b698609de732ed0fa6599261a63e2dd51c8468df5ebe33616a0455dd2b450999'"+ | ||
// " market='US'"+ | ||
// ">" + | ||
// "Subscribe 22"+ | ||
// "</txact-subscribe-button>"; | ||
// div.innerHTML = txactSubscribeButton2; | ||
// document.body.appendChild(div); |
import './components/subscribe-button'; | ||
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35152
294