@wayke-se/ecom-web 1.5.3 → 1.6.0-beta.2
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/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +2 -2
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{config as kd}from"@wayke-se/ecom";var Uo={name:"@wayke-se/ecom-web",version:"1.
|
|
1
|
+
import{config as kd}from"@wayke-se/ecom";var Uo={name:"@wayke-se/ecom-web",version:"1.6.0-beta.2",description:"Wayke Ecom Web",module:"dist/index.mjs",main:"dist/index.js",types:"dist/index.d.ts",homepage:"https://github.com/wayke-se/wayke-ecom-web",scripts:{start:"node ./esbuild/start.js",clip:"node ./esbuild/clip-ui.js && node ./clip-ui/start.js",build:"npm run clean && node ./esbuild/lib.js && node ./esbuild/cdn.js",clean:"rimraf build && rimraf dist && rimraf dist-cdn",test:"npm run lint && npm run typecheck",typecheck:"tsc -noEmit","typecheck:watch":"tsc -noEmit -watch",lint:"eslint --ext .ts,.js src","lint:fix":"eslint --ext .ts,.js 'src' --fix",stylelint:"stylelint '**/*.scss'",prepare:"husky install"},author:"Wayke",license:"ISC",devDependencies:{"@ourstudio/clip-ui":"^0.0.11","@types/marked":"^4.3.0","@types/node":"^17.0.18","@types/object-path":"^0.11.1","@types/sanitize-html":"^2.6.2","@typescript-eslint/eslint-plugin":"^5.12.0","@typescript-eslint/parser":"^5.12.0",esbuild:"^0.15.10","esbuild-sass-plugin":"2.3.3",eslint:"^8.9.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0",husky:"^8.0.1","npm-dts":"^1.3.11",prettier:"^2.5.1",rimraf:"^5.0.1",stylelint:"^15.2.0","stylelint-config-prettier-scss":"^1.0.0","stylelint-config-standard-scss":"^9.0.0",typescript:"^5.1.3"},dependencies:{"@wayke-se/ecom":"^4.4.1-beta.6",marked:"^4.3.0","object-path":"^0.11.8",redux:"^4.1.2","sanitize-html":"^2.7.0"},files:["dist"]};import{createStore as Vc}from"redux";import{DrivingDistance as Bc,PaymentType as ai}from"@wayke-se/ecom";var tt=(o,i)=>o!==void 0&&i!==void 0?JSON.stringify(o).localeCompare(JSON.stringify(i))===0:o===i;var _e=o=>({costs:o.getCosts(),fees:o.getFees(),interests:o.getInterests(),durationSpec:o.getDurationSpec(),downPaymentSpec:o.getDownPaymentSpec(),residualValueSpec:o.getResidualValueSpec(),totalResidualValue:o.getTotalResidualValue(),publicURL:o.getPublicURL(),shouldUseCreditScoring:o.shouldUseCreditScoring(),financialProductCode:o.getFinancialProductCode(),price:o.getPrice(),creditAmount:o.getCreditAmount(),hasPrivacyPolicy:o.hasPrivacyPolicy(),privacyPolicyUrl:o.getPrivacyPolicyUrl(),moneyLaunderingInformationURL:o.getMoneyLaunderingInformationURL()}),Vo=o=>({status:o.getStatus(),hasPendingSigning:o.hasPendingSigning(),hintCode:o.getHintCode(),signingMessage:o.getSigningMessage(),shouldRenewSigning:o.shouldRenewSigning(),isSigned:o.isSigned(),address:void 0,pendingScoring:o.hasPendingScoring(),isScored:o.isScored(),hasScoringError:o.hasScoringError(),scoringId:o.getScoringId(),recommendation:o.getRecommendation(),decision:o.getDecision(),isAccepted:o.isAccepted()}),Le=o=>({orderVehicle:o.getOrderVehicle(),accessories:o.getAccessories(),requiresDealerSelection:o.requiresDealerSelection(),dealerSites:o.getDealerSites(),paymentOptions:o.getPaymentOptions().map(e=>({...e,loanDetails:e.loanDetails?_e(e.loanDetails):void 0})),deliveryOptions:o.getDeliveryOptions(),insuranceOption:o.getInsuranceOption(),orderConditions:o.getOrderConditions(),orderReturnConditions:o.getOrderReturnConditions(),conditionsPdfUri:o.getConditionsPdfUri(),contactInformation:o.getContactInformation(),allowsTradeIn:o.allowsTradeIn(),isUnavailable:o.isUnavailable(),isPaymentRequired:o.isPaymentRequired()}),Go=o=>({vehicle:o.getVehicle()});var st="RESET",qo=o=>i=>i({type:st,id:o}),ot="SET_ORDER",Oe=(o,i)=>e=>e({type:ot,order:o,vehicle:i}),it="SET_ID",Wo=o=>i=>i({type:it,id:o}),nt="SET_CONTACT_EMAIL_AND_PHONE",Yo=o=>i=>i({type:nt,value:o}),at="SET_SOCIAL_ID_AND_ADDRESS",Ko=(o,i,e)=>t=>t({type:at,socialId:o,address:i,lastStage:e}),rt="SET_HOME_DELIVERY",jo=(o,i)=>e=>e({type:rt,homeDelivery:o,lastStage:i}),ct="SET_DEALER",Qo=(o,i)=>e=>e({type:ct,dealer:o,lastStage:i}),lt="INIT_TRADE_IN",zo=o=>i=>i({type:lt,lastStage:o}),dt="SET_TRADE_IN",Se=(o,i,e)=>t=>t({type:dt,lastStage:o,tradeIn:i,tradeInVehicle:e}),mt="SET_FINANCIAL",Jo=(o,i)=>e=>e({type:mt,paymentType:o,lastStage:i}),pt="SET_PAYMENT_LOOKUP_RESPONSE",Xo=o=>i=>i({type:pt,paymentLookupResponse:_e(o)}),ut="SET_DRIVING_DISTANCE",Zo=o=>i=>i({type:ut,drivingDistance:o}),ht="COMPLETE_STAGE",z=o=>i=>i({type:ht,lastStage:o}),kt="SET_OR_REMOVE_INSURANCE",le=o=>i=>i({type:kt,insurance:o}),yt="SET_OR_REMOVE_INSURANCE_ADDONS",ei=(o,i)=>e=>e({type:yt,insurance:o,insuranceAddons:i}),vt="SET_OR_REMOVE_FREE_INSURANCE",ti=o=>i=>i({type:vt,freeInsurance:o}),Et="SET_OR_REMOVE_ACCESSORY",si=o=>i=>i({type:Et,accessory:o}),It="GO_TO",R=(o,i,e)=>t=>t({type:It,view:o,index:i,subStage:e}),ft="SET_STAGES",oi=o=>i=>i({type:ft,stages:o}),gt="SET_CREATED_ORDER_ID",ii=(o,i)=>e=>e({type:gt,id:o,payment:i}),_t="SET_CREDIT_ASSESSMENT_RESPONSE",de=(o,i)=>e=>e({type:_t,caseId:o,creditAssessmentResponse:i}),St="SET_STATE",ni=o=>i=>i({type:St,state:o});var Fc={};var ri={view:"preview",stage:1,subStage:1},ci={id:"",topNavigation:{...ri},navigation:{...ri},customer:{email:"",phone:"",givenName:"",surname:"",socialId:""},homeDelivery:!1,accessories:[],drivingDistance:Bc.Between0And1000,...Fc},ie=(o,i)=>i?{view:"summary",stage:1,subStage:1}:{view:"main",stage:o+1,subStage:1},ne=(o,i)=>i.view==="main"?o.stage<i.stage?i:v.topNavigation:{...o,stage:o.stage+1},wt=o=>o&&o?.length===1&&o?.[0].type===ai.Cash?ai.Cash:void 0,v,Nt,Uc=(o=ci,i)=>{let e,t;switch(v={...o},i.type){case st:return{...ci,id:i.id};case ft:return{...v,stages:i.stages};case it:return{...v,id:i.id};case ot:return{...o,order:i.order,paymentType:wt(i.order?.paymentOptions),vehicle:{...i.order.orderVehicle,...i.vehicle||{}}};case nt:let s={...v,customer:{...o.customer,email:i.value.email,phone:i.value.phone},navigation:{view:"main",stage:o.navigation.stage,subStage:2}};return delete s.wantTradeIn,delete s.tradeIn,delete s.tradeInVehicle,s.paymentType=wt(o.order?.paymentOptions),delete s.paymentLookupResponse,delete s.insurance,delete s.insuranceAddOns,delete s.freeInsurance,delete s.dealer,s.accessories=[],s;case at:return e=ie(v.navigation.stage,i.lastStage),t=ne(v.topNavigation,e),v={...o,navigation:e,topNavigation:t,address:i.address,customer:{...o.customer,socialId:i.socialId}},v;case ct:return e=ie(o.navigation.stage,i.lastStage),t={...e},v={...o,navigation:e,topNavigation:t,dealer:i.dealer},delete v.wantTradeIn,delete v.tradeIn,delete v.tradeInVehicle,v.paymentType=wt(o.order?.paymentOptions),delete v.paymentLookupResponse,delete v.insurance,delete v.insuranceAddOns,delete v.freeInsurance,v.accessories=[],v;case rt:return e=ie(o.navigation.stage,i.lastStage),t=ne(v.topNavigation,e),v={...o,navigation:e,topNavigation:t,homeDelivery:i.homeDelivery},v;case lt:return e={view:"main",stage:o.navigation.stage,subStage:1},t=ne(v.topNavigation,e),v={...o,navigation:e,wantTradeIn:!0,topNavigation:t,tradeIn:o.tradeIn||{registrationNumber:"",mileage:"",description:""}},v;case dt:return e=ie(o.navigation.stage,i.lastStage),t=ne(v.topNavigation,e),v={...o,navigation:e,topNavigation:t,wantTradeIn:!!i.tradeIn,tradeIn:i.tradeIn,tradeInVehicle:i.tradeInVehicle},v;case mt:return e=ie(o.navigation.stage,i.lastStage),t=ne(v.topNavigation,e),{...v,navigation:e,topNavigation:t,paymentType:i.paymentType};case pt:return{...v,paymentLookupResponse:i.paymentLookupResponse};case ut:return{...v,drivingDistance:i.drivingDistance};case ht:return e=ie(o.navigation.stage,i.lastStage),t=ne(v.topNavigation,e),v={...o,navigation:e,topNavigation:t},v;case yt:return v.insurance=i.insurance,v.insuranceAddOns={insurance:i.insurance.name,addOns:i.insuranceAddons},v;case kt:return tt(v.insurance,i.insurance)?v.insurance=void 0:v.insurance=i.insurance,v.insuranceAddOns?.insurance&&(v.insuranceAddOns=void 0),v;case vt:return tt(v.freeInsurance,i.freeInsurance)?v.freeInsurance=void 0:v.freeInsurance=i.freeInsurance,v;case Et:return Nt=v.accessories.findIndex(n=>n.id===i.accessory.id),v.accessories=[...v.accessories],Nt>-1?v.accessories.splice(Nt,1):v.accessories.push(i.accessory),{...v,accessories:[...v.accessories]};case It:return{...o,navigation:{view:i.view,stage:i.index||1,subStage:i.subStage||1}};case gt:return i.payment?e={view:"main",stage:o.navigation.stage,subStage:2}:e=ie(o.navigation.stage,!0),t=ne(v.topNavigation,e),v={...o,navigation:e,topNavigation:t,createdOrderId:i.id,payment:i.payment},v;case _t:return{...v,caseId:i.caseId,creditAssessmentResponse:i.creditAssessmentResponse};case St:return{...i.state};default:return o}},li=Uc;var di=()=>Vc(li);var Me=(o,i)=>{if(!i)return o;let e=new URL(o);return`${i}${e.pathname}`};var Gc=o=>o.toString().replace(/\s/g,""),qc=(o,i)=>{if(!i)return o;let e=Math.pow(10,i);return(Math.round(o*e)/e).toFixed(i)},k=(o,i)=>{if(o===void 0)return"???";let e=qc(o,i?.decimals!==void 0?i.decimals:0);return`${i?.prefix?`${i.prefix}`:""}${Gc(e).replace(/\B(?=(\d{3})+(?!\d))/g," ")}${i?.postfix?` ${i.postfix}`:""}`},Wc=(o,i)=>{let e=o.split(" "),t=i.split(" ").map(s=>s.toLowerCase());return e.filter(s=>!t.includes(s.toLowerCase())).join(" ")},me=o=>{if(!!o)return Wc(o.shortDescription||"",o.title||"")};var Yc=({vehicle:o,order:i,meta:e,cdnMedia:t})=>{let s=o?.imageUrls,n=o?.title,a=k(o?.price||NaN),l=i?.contactInformation?.name;return`
|
|
2
2
|
<div class="waykeecom-product-card">
|
|
3
3
|
${s?.length?`
|
|
4
4
|
<div class="waykeecom-product-card__media">
|
|
@@ -888,7 +888,7 @@ import{config as kd}from"@wayke-se/ecom";var Uo={name:"@wayke-se/ecom-web",versi
|
|
|
888
888
|
<p class="waykeecom-content__p"><span class="waykeecom-text waykeecom-text--font-medium">Privatl\xE5n (ej bol\xE5n och CSN)</span></p>
|
|
889
889
|
<p class="waykeecom-content__p">Total skuld, t.ex. blancol\xE5n och sms-l\xE5n</p>
|
|
890
890
|
</div>
|
|
891
|
-
`,onChange:p=>this.onChange(p),onBlur:p=>this.onBlur(p),onClickInformation:()=>{d("MAIN","FINANCIAL_LOAN_DEBT_SPECIFICATION_PRIVATE_LOAN_INFORMATION_TOGGLE","FINANCIAL")}}),this.contexts.performApplicationButton=new Ee(this.node.querySelector(`#${As}`),{title:"Genomf\xF6r l\xE5neans\xF6kan",id:la,disabled:!(this.state.validation.maritalStatus&&this.state.validation.income&&this.state.validation.employment&&this.state.validation.householdChildren&&this.state.validation.housingCost),onClick:()=>{this.view=2,this.render()}}),new Ie(this.node.querySelector(`#${ea}`),{text:`Genom att klicka p\xE5 \u201DGenomf\xF6r l\xE5neans\xF6kan\u201D godk\xE4nner jag att ${c?.name} g\xF6r en kreditupplysning p\xE5 mig baserat p\xE5 informationen ovan och jag bekr\xE4ftar att jag l\xE4st <a href="
|
|
891
|
+
`,onChange:p=>this.onChange(p),onBlur:p=>this.onBlur(p),onClickInformation:()=>{d("MAIN","FINANCIAL_LOAN_DEBT_SPECIFICATION_PRIVATE_LOAN_INFORMATION_TOGGLE","FINANCIAL")}}),this.contexts.performApplicationButton=new Ee(this.node.querySelector(`#${As}`),{title:"Genomf\xF6r l\xE5neans\xF6kan",id:la,disabled:!(this.state.validation.maritalStatus&&this.state.validation.income&&this.state.validation.employment&&this.state.validation.householdChildren&&this.state.validation.housingCost),onClick:()=>{this.view=2,this.render()}}),new Ie(this.node.querySelector(`#${ea}`),{text:`Genom att klicka p\xE5 \u201DGenomf\xF6r l\xE5neans\xF6kan\u201D godk\xE4nner jag att ${c?.name} g\xF6r en kreditupplysning p\xE5 mig baserat p\xE5 informationen ovan och jag bekr\xE4ftar att jag l\xE4st <a href="${c?.loanDetails?.privacyPolicyUrl}" title="" target="_blank" rel="noopener noreferrer" class="waykeecom-link">${c?.name} dataskyddspolicy</a>.`}),new he(this.node.querySelector(`#${ta}`),{text:"Dina uppgifter lagras och sparas s\xE4kert."}),new Ye(this.node.querySelector(`#${sa}`),{id:"accordion-why-description",title:`
|
|
892
892
|
<div class="waykeecom-hstack waykeecom-hstack--align-center waykeecom-hstack--spacing-1">
|
|
893
893
|
<div class="waykeecom-hstack__item waykeecom-hstack__item--no-shrink" aria-hidden="true">
|
|
894
894
|
<div class="waykeecom-icon-backdrop waykeecom-icon-backdrop--info-alt">
|
|
@@ -905,7 +905,7 @@ import{config as kd}from"@wayke-se/ecom";var Uo={name:"@wayke-se/ecom-web",versi
|
|
|
905
905
|
<div class="waykeecom-hstack__item">Varf\xF6r m\xE5ste jag svara p\xE5 allt detta?</div>
|
|
906
906
|
</div>`,description:`<div class="waykeecom-content">
|
|
907
907
|
<p class="waykeecom-content__p">${c?.name} m\xE5ste ta in uppgifterna av kunden f\xF6r att uppfylla best\xE4mmelser i Konsumentkreditlagen (2010:1846) och Lag (2017:630) om \xE5tg\xE4rder mot penningtv\xE4tt och finansiering av terrorism.</p>
|
|
908
|
-
<p class="waykeecom-content__p"><a href="${c?.loanDetails?.
|
|
908
|
+
<p class="waykeecom-content__p"><a href="${c?.loanDetails?.moneyLaunderingInformationURL}" title="" target="_blank" rel="noopener norefferer" class="waykeecom-link">L\xE4s mer om detta h\xE4r</a></p>
|
|
909
909
|
</div>`,onClick:()=>{d("MAIN","FINANCIAL_LOAN_KYC_INFORMATION_TOGGLE","FINANCIAL")}}),(e||this.caseError||this.bankidError)&&this.node.querySelector(`#${As}`)?.scrollIntoView()}}},da=Cs;var Ds=class extends r{constructor(e,t){super(e);this.props=t,this.render()}update(e){this.props=e,this.node.querySelector(".waykeecom-pie-chart__chart-data")?.setAttribute("stroke-dasharray",`calc(${this.props.percentage} * 31.4 / 100) 31.4`)}render(){let{percentage:e}=this.props;this.node.innerHTML=`
|
|
910
910
|
<div class="waykeecom-pie-chart">
|
|
911
911
|
<svg height="20" width="20" viewBox="0 0 20 20" class="waykeecom-pie-chart__chart">
|