crmbonus-component-wake 1.0.29 → 1.0.31
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/cjs/app-modal_4.cjs.entry.js +4 -4
- package/dist/cjs/crm-bonus.cjs.entry.js +3 -3
- package/dist/cjs/crm-bonus.cjs.entry.js.map +1 -1
- package/dist/cjs/giftback-finish_3.cjs.entry.js +3 -3
- package/dist/cjs/loading-spinner.cjs.entry.js +1 -1
- package/dist/cjs/pedido-finalizado.cjs.entry.js +1 -1
- package/dist/cjs/phone-input-mask.cjs.entry.js +2 -2
- package/dist/cjs/phone-input-mask.cjs.entry.js.map +1 -1
- package/dist/collection/components/crm-bonus/crm-bonus.css +7 -10
- package/dist/collection/components/crm-bonus/crm-bonus.js +2 -2
- package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -1
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +1 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js +1 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js +1 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js +1 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js +1 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js +1 -1
- package/dist/collection/components/loading-spinner/loading-spinner.js +1 -1
- package/dist/collection/components/modal/app-modal.js +1 -1
- package/dist/collection/components/pedido/pedido.js +1 -1
- package/dist/collection/components/phone/phone-input-mask.css +7 -3
- package/dist/collection/components/phone/phone-input-mask.js +1 -1
- package/dist/components/app-modal.js +1 -1
- package/dist/components/crm-bonus-form.js +1 -1
- package/dist/components/crm-bonus.js +12 -12
- package/dist/components/crm-bonus.js.map +1 -1
- package/dist/components/giftback-finish.js +1 -1
- package/dist/components/giftback-pin.js +1 -1
- package/dist/components/giftback-progress.js +1 -1
- package/dist/components/loading-spinner.js +1 -1
- package/dist/components/{p-f6396f4c.js → p-09bc92e2.js} +2 -2
- package/dist/components/{p-f6396f4c.js.map → p-09bc92e2.js.map} +1 -1
- package/dist/components/{p-3e80a758.js → p-13b9e80b.js} +3 -3
- package/dist/components/{p-3e80a758.js.map → p-13b9e80b.js.map} +1 -1
- package/dist/components/{p-9a106722.js → p-19a2f475.js} +4 -4
- package/dist/components/{p-9a106722.js.map → p-19a2f475.js.map} +1 -1
- package/dist/components/{p-b4c3e6bf.js → p-2e9efe46.js} +6 -6
- package/dist/components/{p-b4c3e6bf.js.map → p-2e9efe46.js.map} +1 -1
- package/dist/components/{p-2667d525.js → p-5753850f.js} +2 -2
- package/dist/components/{p-2667d525.js.map → p-5753850f.js.map} +1 -1
- package/dist/components/{p-0c79c309.js → p-7aff1ad5.js} +3 -3
- package/dist/components/p-7aff1ad5.js.map +1 -0
- package/dist/components/{p-c5913818.js → p-bad9f0ec.js} +3 -3
- package/dist/components/{p-c5913818.js.map → p-bad9f0ec.js.map} +1 -1
- package/dist/components/{p-b49d0f97.js → p-d67754e0.js} +4 -4
- package/dist/components/{p-b49d0f97.js.map → p-d67754e0.js.map} +1 -1
- package/dist/components/{p-03918b34.js → p-db0aa2d4.js} +2 -2
- package/dist/components/{p-03918b34.js.map → p-db0aa2d4.js.map} +1 -1
- package/dist/components/pedido-finalizado.js +1 -1
- package/dist/components/phone-cancel-input.js +1 -1
- package/dist/components/phone-input-mask.js +1 -1
- package/dist/components/phone-input.js +1 -1
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -1
- package/dist/crmbonus-component-wake/{p-ef75ecd5.entry.js → p-3024dc0b.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-9209d95a.entry.js → p-36107050.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-a603a26e.entry.js → p-3f336c1d.entry.js} +2 -2
- package/dist/crmbonus-component-wake/p-6aa00d0b.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-6aa00d0b.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/{p-e9c2ed46.entry.js → p-8a5448aa.entry.js} +2 -2
- package/dist/crmbonus-component-wake/p-9399d79f.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-9399d79f.entry.js.map +1 -0
- package/dist/esm/app-modal_4.entry.js +4 -4
- package/dist/esm/crm-bonus.entry.js +3 -3
- package/dist/esm/crm-bonus.entry.js.map +1 -1
- package/dist/esm/giftback-finish_3.entry.js +3 -3
- package/dist/esm/loading-spinner.entry.js +1 -1
- package/dist/esm/pedido-finalizado.entry.js +1 -1
- package/dist/esm/phone-input-mask.entry.js +2 -2
- package/dist/esm/phone-input-mask.entry.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/p-0c79c309.js.map +0 -1
- package/dist/crmbonus-component-wake/p-63791d65.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-63791d65.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-b31d29c2.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-b31d29c2.entry.js.map +0 -1
- /package/dist/crmbonus-component-wake/{p-ef75ecd5.entry.js.map → p-3024dc0b.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-9209d95a.entry.js.map → p-36107050.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-a603a26e.entry.js.map → p-3f336c1d.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-e9c2ed46.entry.js.map → p-8a5448aa.entry.js.map} +0 -0
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as e,h as i}from"./p-72510682.js";const
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as e,h as i}from"./p-72510682.js";const a="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBVcGxvYWRlZCB0bzogU1ZHIFJlcG8sIHd3dy5zdmdyZXBvLmNvbSwgR2VuZXJhdG9yOiBTVkcgUmVwbyBNaXhlciBUb29scyAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiANCgkgdmlld0JveD0iMCAwIDUwIDUwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxjaXJjbGUgc3R5bGU9ImZpbGw6IzI1QUU4ODsiIGN4PSIyNSIgY3k9IjI1IiByPSIyNSIvPg0KPHBvbHlsaW5lIHN0eWxlPSJmaWxsOm5vbmU7c3Ryb2tlOiNGRkZGRkY7c3Ryb2tlLXdpZHRoOjI7c3Ryb2tlLWxpbmVjYXA6cm91bmQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEwOyIgcG9pbnRzPSINCgkzOCwxNSAyMiwzMyAxMiwyNSAiLz4NCjwvc3ZnPg==";const t=".message-finish{align-content:center;text-align:center}.message-finish p{color:#777676;font-size:xx-large;font-family:sans-serif}";const n=t;const c=class{constructor(i){e(this,i)}render(){return i("div",{key:"b2db01665e3e19659c35a8c912742352bca4a1ae",class:"message-finish"},i("img",{key:"0cb6d72a9bb696cf16ee38255cb2d5d6170e5ff1",src:a,width:80}),i("p",{key:"489dd5b09d20ff2140be375c1e234d5bf9671622"},"Legal! O Bônus será aplicado na sua compra."))}};c.style=n;const s=":host{display:block;font-family:Arial, sans-serif}.form-container-pin{display:flex;flex-direction:column;align-items:center}.pin-container{display:flex;gap:10px;margin:26px 0}input{width:58px;height:40px;font-size:18px;text-align:center;border:1px solid #ccc;border-radius:5px}button{padding:10px 20px;background-color:#ddd;border:none;border-radius:5px;cursor:pointer}button:hover{background-color:#bbb}.success{color:green;margin-top:10px}.button{top:50%;background-color:#6c6c7e;color:#fff;border:none;border-radius:10px;padding:15px;min-height:30px;min-width:120px;font-size:20px;cursor:pointer}.button-cancel{top:50%;background-color:#ffffff;color:#1e1c1c;border:1px solid gray;border-radius:10px;padding:10px;min-height:30px;min-width:120px;font-size:19px;cursor:pointer}.footer-button{display:flex;justify-content:space-between;width:100%}";const o=s;const d=class{constructor(i){e(this,i);this.sent=undefined;this.validate=undefined;this.cancel=undefined;this.pin=["","","",""];this.isVerified=false;this.loading=false}handleInput(e,i){const a=e.target;const t=a.value.slice(0,1);this.pin[i]=t;if(t&&i<this.pin.length-1){const e=a.nextElementSibling;e===null||e===void 0?void 0:e.focus()}this.pin=[...this.pin]}validatePin(){console.log("this.pin",this.pin);this.validate(this.pin.join(""))}verifyPin(){const e=this.pin.join("");if(e==="9999"){this.isVerified=true}}render(){return i("div",{key:"73bbb31f65a9ad70d9749139036f367c5f983be7",class:"form-container-pin"},i("div",{key:"30a4e1cb8cbec97af32e4535237ddd45b073d47c"},i("p",{key:"4c5946125ee6cfd8ed00a845df15a65074c482e4"},"Insira o PIN de 4 dígitos enviado por SMS."),i("div",{key:"4d6b00888b126dc0cd786bd0c5bc20ed0a5ad354",class:"pin-container"},this.pin.map(((e,a)=>i("input",{type:"text",maxLength:1,value:this.pin[a],onInput:e=>this.handleInput(e,a)}))))),i("div",{key:"759369b39be6716fad568f51107db83d2f39f8c3",class:"footer-button"},i("button",{key:"4b3e1f2cd4649e4d70ac42eb6eb41c001a159ca8",class:"button-cancel",disabled:this.loading,onClick:()=>this.cancel()},"Cancelar"),i("button",{key:"4872ba1598b806babaff1041ab08a86b3d1e92ef",class:`button ${this.loading?"disabled":""} `,disabled:this.loading,onClick:()=>this.validatePin()},!this.loading?"Enviar":i("loading-spinner",{size:"15px",color:"#fff"}))))}};d.style=o;const r=":host{display:flex;font-family:Arial, sans-serif;border-radius:10px;padding:16px;max-width:100%;flex-direction:column}.giftback-container{display:flex;flex-direction:column}.giftback-container p{font-size:medium}h3{margin:0 0 10px;font-size:18px}p{margin:5px 0;font-size:14px;align-self:start}.validity{font-size:12px;color:#888}.progress-container{display:flex;align-items:center;margin:10px 0}progress-container span{font-size:12px;color:#666}input[type='range']{flex:1;margin:0 10px;appearance:none;background-color:#ccc;height:6px;border-radius:3px;outline:none;cursor:pointer}input[type='range']::-webkit-slider-thumb{appearance:none;width:14px;height:14px;border-radius:50%;background-color:#555;cursor:pointer}.remaining{font-weight:bold;font-size:14px;color:#333}.button{top:50%;background-color:#6c6c7e;color:#fff;border:none;border-radius:10px;padding:10px;min-height:30px;min-width:120px;font-size:19px;cursor:pointer}.button-cancel{top:50%;background-color:#ffffff;color:#1e1c1c;border:1px solid gray;border-radius:10px;padding:10px;min-height:30px;min-width:120px;font-size:19px;cursor:pointer}.disabled{opacity:0.6;cursor:not-allowed}.footer-button-giftback{display:flex;justify-content:space-between;margin-top:14px}";const b=r;const l=class{constructor(i){e(this,i);this.usedValue=0;this.loading=false;this.bonus={totalBonus:0,cartId:"",minimumPurchase:0,bonusBalance:0,calculatedValue:0,firstValidityDate:""};this.reserve=undefined;this.cancel=undefined}componentWillLoad(){this.usedValue=parseFloat(this.bonus.bonusBalance.toString())}handleSliderChange(e){const i=e.target;this.usedValue=parseFloat(i.value)}async handleReserve(e){this.reserve(e)}render(){const e=this.bonus.minimumPurchase-this.bonus.totalValue;return i("div",{key:"a5e02f60ab5e081341582ea0b1cfaa05583a22c2",class:"giftback-container"},i("p",{key:"12eddb011e6a6beda91a1bc937fcacdb891b12a5"},"Você possui até ",i("strong",{key:"eb6018fe44106dd2a9928d4efe77dbd17180e3d3"},"R$ ",this.bonus.totalBonus.toFixed(2))," de Giftback nessa compra!"),i("p",{key:"065028af79e33d565c82bd55ea2245e3562617e8",class:"validity"},"Válido até: ",new Date(this.bonus.firstValidityDate).toLocaleDateString("pt-Br")),i("p",{key:"1ed8896f6301c2c70fb7232190a2c68bc82e5f07"},"Você está utilizando ",i("strong",{key:"e2019caa7c7697f73021416632ca884097e21abe"},"R$ ",this.usedValue.toFixed(2))," nessa compra"),i("div",{key:"b0257ef4d99c4009f23a4d9fae52b42d2ef41209",class:"progress-container"},i("span",{key:"bb0d1abe791dfcab30e87fea8eb025a9f3787be0"},"R$ 0"),i("input",{key:"a4220c65f24d68b56ccf522a46c0bd3d007c9ed6",disabled:true,type:"range",min:"0",step:"0.01",max:this.bonus.totalBonus,value:this.usedValue,onInput:e=>this.handleSliderChange(e)}),i("span",{key:"c216b57ffdd2a3613f05db327aad395f1f2e1285"},"R$ ",this.bonus.totalBonus.toFixed(2))),i("p",{key:"7a5dc6a68801da2c09a33f3cdb6cf82e521be581",class:"remaining"},"Faltam ",i("strong",{key:"9c20b260d4a95887844aa038e0f74180fff5c1eb"},"R$ ",e>0?e.toFixed(2):Number(0).toFixed(2))," para utilizar o valor total do Giftback."),i("div",{key:"d99639afcac1ea180ad414ca923391f99f3d5296",class:"footer-button-giftback"},i("button",{key:"4c1bdd2ea2ecd5037d1c29b6af31c3163fffe84a",class:"button-cancel",disabled:this.loading,onClick:()=>this.cancel()},"Cancelar"),i("button",{key:"77fc073d28272334d51ab7073e34654509c0ac26",class:`button ${this.loading?"disabled":""} `,disabled:this.loading,onClick:()=>this.handleReserve(this.usedValue)},!this.loading?"Aplicar":i("loading-spinner",{size:"10px",color:"#fff"}))))}};l.style=b;export{c as giftback_finish,d as giftback_pin,l as giftback_progress};
|
2
|
+
//# sourceMappingURL=p-8a5448aa.entry.js.map
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{r as o,h as e}from"./p-72510682.js";const t=":host{width:100%}.inline-text-field-container{display:flex;flex-direction:column}@supports (top: max(0%)){.mdc-text-field--outlined{padding-right:max(16px, var(--mdc-shape-small, 4px))}}@supports (top: max(0%)){.mdc-text-field--outlined{padding-left:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}.mdc-text-field--outlined{height:55px;overflow:visible}.phone{display:block;width:100%;height:24px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:0px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);-webkit-transition:border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s}.mdc-text-field{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:0;border-bottom-left-radius:0;display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity, transform, color}";const i=t;const s=class{constructor(e){o(this,e);this.phone="";this.initialValue=undefined;this.disabled=undefined}componentWillLoad(){this.phone=this.initialValue}formatPhone(o){const e=o.replace(/\D/g,"");const t=e.match(/^(\d{0,2})(\d{0,5})(\d{0,4})$/);if(!t)return o;const i=t[1]?`(${t[1]}`:"";const s=t[2]?`) ${t[2]}`:"";const r=t[3]?`-${t[3]}`:"";return`${i}${s}${r}`}handleInput(o){const e=o.target;this.phone=this.formatPhone(e.value)}async getPhone(){return this.phone}render(){return e("input",{key:"623357066b9052b9d3a5a853f03058639653d3e0",disabled:this.disabled,id:"phone",type:"tel",class:"phone",value:this.phone,onInput:o=>this.handleInput(o),placeholder:"(12) 94567-8910"})}};s.style=i;export{s as phone_input_mask};
|
2
|
+
//# sourceMappingURL=p-9399d79f.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["phoneInputMaskCss","PhoneInputMaskStyle0","PhoneInputMask","componentWillLoad","this","phone","initialValue","formatPhone","value","cleaned","replace","match","part1","part2","part3","handleInput","event","input","target","getPhone","render","h","key","disabled","id","type","class","onInput","placeholder"],"sources":["src/components/phone/phone-input-mask.css?tag=phone-input-mask&encapsulation=shadow","src/components/phone/phone-input-mask.tsx"],"sourcesContent":[":host {\n width: 100%;\n}\n\n.inline-text-field-container {\n display: flex;\n flex-direction: column;\n}\n\n@supports (top: max(0%)) {\n .mdc-text-field--outlined {\n padding-right: max(16px, var(--mdc-shape-small, 4px));\n }\n}\n\n@supports (top: max(0%)) {\n .mdc-text-field--outlined {\n padding-left: max(16px, calc(var(--mdc-shape-small, 4px) + 4px));\n }\n}\n\n.mdc-text-field--outlined {\n height: 55px;\n overflow: visible;\n}\n\n.phone {\n display: block;\n width: 100%;\n height: 24px;\n padding: 6px 12px;\n font-size: 14px;\n line-height: 1.42857143;\n color: #555;\n background-color: #fff;\n background-image: none;\n border: 1px solid #ccc;\n border-radius: 0px;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);\n -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;\n -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;\n transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;\n}\n\n.mdc-text-field {\n border-top-left-radius: 4px;\n border-top-left-radius: var(--mdc-shape-small, 4px);\n border-top-right-radius: 4px;\n border-top-right-radius: var(--mdc-shape-small, 4px);\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n display: inline-flex;\n align-items: baseline;\n padding: 0 16px;\n position: relative;\n box-sizing: border-box;\n overflow: hidden;\n will-change: opacity, transform, color;\n}","import { Component, h, Method, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'phone-input-mask',\n styleUrl: 'phone-input-mask.css',\n shadow: true,\n})\nexport class PhoneInputMask {\n @State() phone: string = '';\n @Prop() initialValue: string;\n @Prop() disabled: boolean;\n\n componentWillLoad() {\n this.phone = this.initialValue; \n }\n\n private formatPhone(value: string): string {\n const cleaned = value.replace(/\\D/g, ''); // Remove tudo que não for número\n const match = cleaned.match(/^(\\d{0,2})(\\d{0,5})(\\d{0,4})$/);\n if (!match) return value;\n\n const part1 = match[1] ? `(${match[1]}` : '';\n const part2 = match[2] ? `) ${match[2]}` : '';\n const part3 = match[3] ? `-${match[3]}` : '';\n\n return `${part1}${part2}${part3}`;\n }\n\n private handleInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.phone = this.formatPhone(input.value);\n }\n\n @Method()\n public async getPhone() {\n return this.phone;\n }\n\n render() {\n return (\n <input\n disabled={this.disabled}\n id=\"phone\"\n type=\"tel\"\n class=\"phone\"\n value={this.phone}\n onInput={(event) => this.handleInput(event)}\n placeholder=\"(12) 94567-8910\"\n />\n );\n }\n}\n"],"mappings":"2CAAA,MAAMA,EAAoB,kvCAC1B,MAAAC,EAAeD,E,MCMFE,EAAc,M,oCACE,G,oDAIzB,iBAAAC,GACIC,KAAKC,MAAQD,KAAKE,Y,CAGd,WAAAC,CAAYC,GAChB,MAAMC,EAAUD,EAAME,QAAQ,MAAO,IACrC,MAAMC,EAAQF,EAAQE,MAAM,iCAC5B,IAAKA,EAAO,OAAOH,EAEnB,MAAMI,EAAQD,EAAM,GAAK,IAAIA,EAAM,KAAO,GAC1C,MAAME,EAAQF,EAAM,GAAK,KAAKA,EAAM,KAAO,GAC3C,MAAMG,EAAQH,EAAM,GAAK,IAAIA,EAAM,KAAO,GAE1C,MAAO,GAAGC,IAAQC,IAAQC,G,CAGtB,WAAAC,CAAYC,GAChB,MAAMC,EAAQD,EAAME,OACpBd,KAAKC,MAAQD,KAAKG,YAAYU,EAAMT,M,CAIjC,cAAMW,GACT,OAAOf,KAAKC,K,CAGhB,MAAAe,GACI,OACIC,EAAA,SAAAC,IAAA,2CACIC,SAAUnB,KAAKmB,SACfC,GAAG,QACHC,KAAK,MACLC,MAAM,QACNlB,MAAOJ,KAAKC,MACZsB,QAAUX,GAAUZ,KAAKW,YAAYC,GACrCY,YAAY,mB","ignoreList":[]}
|
@@ -16,7 +16,7 @@ const AppModal = class {
|
|
16
16
|
this.modalClosed.emit();
|
17
17
|
}
|
18
18
|
render() {
|
19
|
-
return (h("div", { key: '
|
19
|
+
return (h("div", { key: 'bfca82abe376ae6a2128f9930477efefd580e127', class: `modal-backdrop ${this.isOpen ? 'visible' : ''}` }, h("div", { key: '18d4b5dc82c30ac4d68fc803a538df4925035a48', class: "modal" }, h("div", { key: '65fd1a61314f39d68225ae05db4b463f1c2f1c23', class: "modal-header" }, h("h3", { key: '936cb2d5c1d0b6b06f64ceff1875b24e7cdb9a9c' }, this.modalTitle), h("button", { key: '06945aa82f350dd02a712da527dffd2a148fcc32', class: "close-button", onClick: () => this.closeModal() }, "\u00D7")), h("div", { key: '9ee81e14f8dfe84eb0e0ceaee403d6389ebbbc35', class: "modal-body" }, h("slot", { key: '0b1d305653505e35ae39ea7ffc6bdfc74dc97e59' })))));
|
20
20
|
}
|
21
21
|
};
|
22
22
|
AppModal.style = AppModalStyle0;
|
@@ -103,7 +103,7 @@ const CrmBonusForm = class {
|
|
103
103
|
this.cancel();
|
104
104
|
}
|
105
105
|
render() {
|
106
|
-
return (h(Host, { key: '
|
106
|
+
return (h(Host, { key: '47aae084607a882caa95c0ea06582a604143db5f' }, this.step === StepFormEnum.STEP_PIN && h("giftback-pin", { key: '1a92fc7bb7bc7f56001da7418e30ea7e7eca41ea', cancel: () => this.handleCancel(), sent: this.sent, validate: (data) => this.validateBonus(data), loading: this.loading }), this.step === StepFormEnum.STEP_RESERVE && h("giftback-progress", { key: 'c358d67060b5f82a52edd5237c6518e24270341c', loading: this.loading, cancel: () => this.handleCancel(), bonus: this.bonus, reserve: (amountRedeemed) => this.reserveApply(amountRedeemed) }), this.step === StepFormEnum.STEP_APPLY && h("giftback-finish", { key: 'fa904cc9de693b9e723e4c86104e63209b159779' }), h("p", { key: 'e1797f9e91013e386c5f8b151e4c692e5d8cd3f3', class: "message-error" }, this.message)));
|
107
107
|
}
|
108
108
|
};
|
109
109
|
CrmBonusForm.style = CrmBonusFormStyle0;
|
@@ -120,7 +120,7 @@ const PhoneCancelInput = class {
|
|
120
120
|
await this.sendPin(phone);
|
121
121
|
}
|
122
122
|
render() {
|
123
|
-
return (h("div", { key: '
|
123
|
+
return (h("div", { key: 'e4190bd5e37d38631bf7a3a60dcb851d36d26ad8', class: "form-container" }, h("phone-input-mask", { key: '5c189523ffe6e67304363411c2afeac03c212a1c', initialValue: "Valor aplicado R$ 100", ref: ref => this.phoneInputMask = ref, disabled: true }), h("button", { key: 'b563f7345e86637372e81eb8968affa35d9ce179', class: `btn btn-success btnCrm ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, !this.loading ? "Cancelar" : h("loading-spinner", { size: "20px", color: "#fff" }))));
|
124
124
|
}
|
125
125
|
};
|
126
126
|
|
@@ -136,7 +136,7 @@ const PhoneInput = class {
|
|
136
136
|
await this.sendPin(phone);
|
137
137
|
}
|
138
138
|
render() {
|
139
|
-
return (h("div", { key: '
|
139
|
+
return (h("div", { key: 'e2731761e6c8c1f596a1030d64a9fa26d00ac4b8', class: "form-container" }, h("phone-input-mask", { key: 'b8a30be9c709dd493aab34faf8acfe25ceea050b', initialValue: this.value, ref: ref => this.phoneInputMask = ref }), h("button", { key: '9f73fb884b4f8c31f31da644a20d560622cfd984', class: `btn btn-success btnCrm ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, !this.loading ? "validar" : h("loading-spinner", { size: "20px", color: "#fff" }))));
|
140
140
|
}
|
141
141
|
};
|
142
142
|
|
@@ -2,7 +2,7 @@ import { r as registerInstance, h } from './index-9f7bde48.js';
|
|
2
2
|
import { C as CrmBonusService } from './crmbonus.service-053a9e38.js';
|
3
3
|
import { S as StepFormEnum } from './index-2bfaba2b.js';
|
4
4
|
|
5
|
-
const crmBonusCss = ".container-button{
|
5
|
+
const crmBonusCss = ".container-button{cursor:pointer;padding:10px;}.section-crm{border:1px solid #dbd4d4;text-align:-webkit-center;margin-bottom:20px}.section-cart-crm p{padding:0;margin:0 0 0 10px}.button{top:50%;background-color:#6c6c7e;color:#fff;border:none;padding:15px;min-height:30px;min-width:120px;font-size:20px;cursor:pointer;margin-left:10px;height:70px}.form-container{width:97%;display:flex;justify-content:space-around}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:0px}.form-container .btnCrm{background:#00162e;border-color:#00162e;width:30%;color:#fff}";
|
6
6
|
const CrmBonusStyle0 = crmBonusCss;
|
7
7
|
|
8
8
|
const CrmBonus = class {
|
@@ -70,8 +70,8 @@ const CrmBonus = class {
|
|
70
70
|
localStorage.setItem('@BYCODERS', this.cartId);
|
71
71
|
}
|
72
72
|
render() {
|
73
|
-
return (h("div", { key: '881de45f9b1d135bcf29f0bb64acba9dd6db2625', class: "section-cart-crm" }, h("div", { key: '
|
74
|
-
: h("phone-input", { value: this.customer.phone, sendPin: (phone) => { this.sendPin(phone); }, loading: this.loading })), h("app-modal", { key: '
|
73
|
+
return (h("div", { key: '881de45f9b1d135bcf29f0bb64acba9dd6db2625', class: "section-cart-crm" }, h("p", { key: '220974c8e1b717514a83a739e912aa7f08589506', class: "text-left fbits-responsive-carrinho-desconto-texto" }, "Giftback"), h("div", { key: '7a33ec85d3a3acbc5b1f7c35967bd07ec4fc883a', class: "container-button" }, this.canCancel ? h("phone-cancel-input", { value: this.customer.phone, sendPin: () => { }, loading: this.loading })
|
74
|
+
: h("phone-input", { value: this.customer.phone, sendPin: (phone) => { this.sendPin(phone); }, loading: this.loading })), h("app-modal", { key: '98c78ae810b68e0396dce2928c2116d2e4d20fa8', isOpen: this.showModal, modalTitle: `Giftback`, onModalClosed: () => (this.showModal = false) }, h("crm-bonus-form", { key: '2a22c6a17a4646f7631943fb6017f53372814724', saveStore: () => this.save(), ref: ref => this.crmBonusRef = ref, sent: this.sent, phone: this.phone, cancel: () => this.handleCloseModal(), storeName: this.storeName, products: this.buildProducts(), cartId: this.cartId, customer: this.customer }))));
|
75
75
|
}
|
76
76
|
static get assetsDirs() { return ["assets"]; }
|
77
77
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"crm-bonus.entry.js","mappings":";;;;AAAA,MAAM,WAAW,GAAG,
|
1
|
+
{"file":"crm-bonus.entry.js","mappings":";;;;AAAA,MAAM,WAAW,GAAG,k4BAAk4B,CAAC;AACv5B,uBAAe,WAAW;;MCWb,QAAQ;;;QAEX,oBAAe,GAAoB,IAAI,eAAe,EAAE,CAAC;yBAInC,KAAK;;;;;;wBAOJ;YAC7B,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,EAAE;YACR,KAAK,EAAE,EAAE;SACV;uBAE2B,KAAK;;;yBAGH,KAAK;;;IAGnC,MAAM,iBAAiB;QACrB,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;KACzB;IAED,MAAM,UAAU;QACd,IAAI;YACF,IAAI,IAAI,CAAC,MAAM,EAAE;gBACf,IAAI,CAAC,QAAQ,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;gBACpF,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;aACpC;SACF;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;SAC7B;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;KACnD;IAEM,MAAM,OAAO,CAAC,KAAa;;QAChC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAElB,IAAI;YACF,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YACxC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;YAC5B,IAAI,CAAC,IAAI,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;YAC3E,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;YACtD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;SACvB;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,OAAO,GAAG,MAAA,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,0CAAE,IAAI,0CAAE,OAAO,CAAA;SAC9C;gBAAS;YACR,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;SACrB;KACF;IAED,aAAa;QACX,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,KAAK,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,iBAAiB,EAAE,GAAG,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,CAAA;KAC3K;IAED,gBAAgB;QACd,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;KACxB;IAED,IAAI;QACF,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;KAC/C;IAED,MAAM;QACJ,QACE,4DAAK,KAAK,EAAC,kBAAkB,IAC3B,0DAAG,KAAK,EAAC,oDAAoD,eAAa,EAC1E,4DAAK,KAAK,EAAC,kBAAkB,IAGzB,IAAI,CAAC,SAAS,GAAG,0BAAoB,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,SAAU,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,GAAI;cAC7G,mBAAa,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,GAAI,CAG/G,EACN,kEACE,MAAM,EAAE,IAAI,CAAC,SAAS,EACtB,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,OAAO,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,IAE7C,uEAAgB,SAAS,EAAE,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,IAAI,CAAC,WAAW,GAAG,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC,gBAAgB,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,GAAI,CAC9P,CACR,EACP;KACF;;;;;;;","names":[],"sources":["src/components/crm-bonus/crm-bonus.css?tag=crm-bonus&encapsulation=shadow","src/components/crm-bonus/crm-bonus.tsx"],"sourcesContent":["/* :host {\n display: block;\n} */\n\n.container-button {\n /* max-width: 100%; */\n cursor: pointer;\n padding: 10px;\n /* display: flex; */\n}\n\n/* padding: 0 15px 15px;\nborder: 1px solid #ddd;\nmargin-bottom: 20px; */\n\n.section-crm {\n border: 1px solid #dbd4d4;\n /* min-height: 50px; */\n text-align: -webkit-center;\n margin-bottom: 20px;\n}\n\n.section-cart-crm p {\n padding: 0;\n margin: 0 0 0 10px;\n}\n\n.button {\n top: 50%;\n background-color: #6c6c7e;\n color: #fff;\n border: none;\n /* border-radius: 10px; */\n padding: 15px;\n min-height: 30px;\n min-width: 120px;\n font-size: 20px;\n cursor: pointer;\n margin-left: 10px;\n height: 70px;\n}\n\n.form-container {\n width: 97%;\n display: flex;\n justify-content: space-around;\n}\n\n\n.btn {\n display: inline-block;\n padding: 6px 12px;\n margin-bottom: 0;\n font-size: 14px;\n font-weight: 400;\n line-height: 1.42857143;\n text-align: center;\n white-space: nowrap;\n vertical-align: middle;\n -ms-touch-action: manipulation;\n touch-action: manipulation;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n background-image: none;\n border: 1px solid transparent;\n border-radius: 0px;\n}\n\n.form-container .btnCrm {\n background: #00162e;\n border-color: #00162e;\n width: 30%;\n color: #fff;\n}","import { Component, Prop, State, h } from '@stencil/core';\nimport { IProduct, IProductWake, ICustomer } from '../../dto/validate.pin.bonus';\nimport { CrmBonusService } from '../../services/crmbonus.service';\nimport { IPinSent } from '../../components';\nimport { StepFormEnum } from '../../contants';\n\n@Component({\n tag: 'crm-bonus',\n styleUrl: 'crm-bonus.css',\n shadow: true,\n assetsDirs: ['assets']\n})\nexport class CrmBonus {\n\n private crmBonusService: CrmBonusService = new CrmBonusService();\n\n private crmBonusRef: HTMLCrmBonusFormElement;\n\n @State() showModal: boolean = false;\n @Prop({ attribute: 'userid' }) userId: number;\n @Prop({ attribute: 'storename' }) storeName;\n @Prop({ attribute: 'products' }) productsInString: string;\n @Prop({ attribute: 'cartid' }) cartId;\n\n @State() products: Array<IProductWake>;\n @State() customer: ICustomer = {\n birthDate: \"\",\n document: \"\",\n name: \"\",\n phone: \"\"\n };\n\n @State() loading: boolean = false;\n @State() message: string;\n @State() phone: number;\n @State() canCancel: boolean = false;\n @State() sent: IPinSent;\n\n async componentWillLoad() {\n await this.handleLoad();\n }\n\n async handleLoad() {\n try {\n if (this.userId) {\n this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);\n console.log('user', this.customer);\n }\n } catch (error) {\n console.log('info customer')\n }\n this.products = JSON.parse(this.productsInString);\n }\n\n public async sendPin(phone: string) {\n this.loading = true;\n this.message = \"\";\n\n try {\n const _phone = phone.replace(/\\D/g, '');\n this.phone = Number(_phone);\n this.sent = await this.crmBonusService.sendPin(this.phone, this.storeName);;\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);\n this.showModal = true;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n buildProducts(): IProduct[] {\n return this.products.map(product => ({ sku: product.SKU, value: (product.PrecoPor * product.Quantidade), variantId: product.ProdutoVarianteId, qtd: product.Quantidade }))\n }\n\n handleCloseModal() {\n this.showModal = false;\n }\n\n save() {\n localStorage.setItem('@BYCODERS', this.cartId)\n }\n\n render() {\n return (\n <div class=\"section-cart-crm\">\n <p class=\"text-left fbits-responsive-carrinho-desconto-texto\">Giftback</p>\n <div class=\"container-button\">\n {/* <img src={logo} onClick={() => (this.showModal = true)} /> */}\n {\n this.canCancel ? <phone-cancel-input value={this.customer.phone} sendPin={() => { }} loading={this.loading} /> \n : <phone-input value={this.customer.phone} sendPin={(phone) => { this.sendPin(phone) }} loading={this.loading} />\n }\n \n </div>\n <app-modal\n isOpen={this.showModal}\n modalTitle={`Giftback`}\n onModalClosed={() => (this.showModal = false)}\n >\n <crm-bonus-form saveStore={() => this.save()} ref={ref => this.crmBonusRef = ref} sent={this.sent} phone={this.phone} cancel={() => this.handleCloseModal()} storeName={this.storeName} products={this.buildProducts()} cartId={this.cartId} customer={this.customer} />\n </app-modal>\n </div>\n )\n }\n}\n"],"version":3}
|
@@ -10,7 +10,7 @@ const GiftbackFinish = class {
|
|
10
10
|
registerInstance(this, hostRef);
|
11
11
|
}
|
12
12
|
render() {
|
13
|
-
return (h("div", { key: '
|
13
|
+
return (h("div", { key: 'b2db01665e3e19659c35a8c912742352bca4a1ae', class: "message-finish" }, h("img", { key: '0cb6d72a9bb696cf16ee38255cb2d5d6170e5ff1', src: successSvgrepoComSvg, width: 80 }), h("p", { key: '489dd5b09d20ff2140be375c1e234d5bf9671622' }, "Legal! O B\u00F4nus ser\u00E1 aplicado na sua compra.")));
|
14
14
|
}
|
15
15
|
};
|
16
16
|
GiftbackFinish.style = GiftbackFinishStyle0;
|
@@ -50,7 +50,7 @@ const GiftbackPin = class {
|
|
50
50
|
}
|
51
51
|
}
|
52
52
|
render() {
|
53
|
-
return (h("div", { key: '
|
53
|
+
return (h("div", { key: '73bbb31f65a9ad70d9749139036f367c5f983be7', class: "form-container-pin" }, h("div", { key: '30a4e1cb8cbec97af32e4535237ddd45b073d47c' }, h("p", { key: '4c5946125ee6cfd8ed00a845df15a65074c482e4' }, "Insira o PIN de 4 d\u00EDgitos enviado por SMS."), h("div", { key: '4d6b00888b126dc0cd786bd0c5bc20ed0a5ad354', class: "pin-container" }, this.pin.map((_, index) => (h("input", { type: "text", maxLength: 1, value: this.pin[index], onInput: (event) => this.handleInput(event, index) }))))), h("div", { key: '759369b39be6716fad568f51107db83d2f39f8c3', class: "footer-button" }, h("button", { key: '4b3e1f2cd4649e4d70ac42eb6eb41c001a159ca8', class: "button-cancel", disabled: this.loading, onClick: () => this.cancel() }, "Cancelar"), h("button", { key: '4872ba1598b806babaff1041ab08a86b3d1e92ef', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePin() }, !this.loading ? "Enviar" : h("loading-spinner", { size: "15px", color: "#fff" })))));
|
54
54
|
}
|
55
55
|
};
|
56
56
|
GiftbackPin.style = GiftbackPinStyle0;
|
@@ -86,7 +86,7 @@ const GiftbackProgress = class {
|
|
86
86
|
}
|
87
87
|
render() {
|
88
88
|
const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;
|
89
|
-
return (h("div", { key: '
|
89
|
+
return (h("div", { key: 'a5e02f60ab5e081341582ea0b1cfaa05583a22c2', class: "giftback-container" }, h("p", { key: '12eddb011e6a6beda91a1bc937fcacdb891b12a5' }, "Voc\u00EA possui at\u00E9 ", h("strong", { key: 'eb6018fe44106dd2a9928d4efe77dbd17180e3d3' }, "R$ ", this.bonus.totalBonus.toFixed(2)), " de Giftback nessa compra!"), h("p", { key: '065028af79e33d565c82bd55ea2245e3562617e8', class: "validity" }, "V\u00E1lido at\u00E9: ", new Date(this.bonus.firstValidityDate).toLocaleDateString('pt-Br')), h("p", { key: '1ed8896f6301c2c70fb7232190a2c68bc82e5f07' }, "Voc\u00EA est\u00E1 utilizando ", h("strong", { key: 'e2019caa7c7697f73021416632ca884097e21abe' }, "R$ ", this.usedValue.toFixed(2)), " nessa compra"), h("div", { key: 'b0257ef4d99c4009f23a4d9fae52b42d2ef41209', class: "progress-container" }, h("span", { key: 'bb0d1abe791dfcab30e87fea8eb025a9f3787be0' }, "R$ 0"), h("input", { key: 'a4220c65f24d68b56ccf522a46c0bd3d007c9ed6', disabled: true, type: "range", min: "0", step: "0.01", max: this.bonus.totalBonus, value: this.usedValue, onInput: (event) => this.handleSliderChange(event) }), h("span", { key: 'c216b57ffdd2a3613f05db327aad395f1f2e1285' }, "R$ ", this.bonus.totalBonus.toFixed(2))), h("p", { key: '7a5dc6a68801da2c09a33f3cdb6cf82e521be581', class: "remaining" }, "Faltam ", h("strong", { key: '9c20b260d4a95887844aa038e0f74180fff5c1eb' }, "R$ ", remainingGiftback > 0 ? remainingGiftback.toFixed(2) : Number(0).toFixed(2)), " para utilizar o valor total do Giftback."), h("div", { key: 'd99639afcac1ea180ad414ca923391f99f3d5296', class: "footer-button-giftback" }, h("button", { key: '4c1bdd2ea2ecd5037d1c29b6af31c3163fffe84a', class: "button-cancel", disabled: this.loading, onClick: () => this.cancel() }, "Cancelar"), h("button", { key: '77fc073d28272334d51ab7073e34654509c0ac26', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.handleReserve(this.usedValue) }, !this.loading ? "Aplicar" : h("loading-spinner", { size: "10px", color: "#fff" })))));
|
90
90
|
}
|
91
91
|
};
|
92
92
|
GiftbackProgress.style = GiftbackProgressStyle0;
|
@@ -10,7 +10,7 @@ const LoadingSpinner = class {
|
|
10
10
|
this.color = '#0078d7';
|
11
11
|
}
|
12
12
|
render() {
|
13
|
-
return (h("div", { key: '
|
13
|
+
return (h("div", { key: 'd6dba36c8a62aba0fb4274d541d007977e662bd6', class: "spinner", style: { width: this.size, height: this.size, borderColor: `${this.color} transparent transparent transparent` } }));
|
14
14
|
}
|
15
15
|
};
|
16
16
|
LoadingSpinner.style = LoadingSpinnerStyle0;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, h } from './index-9f7bde48.js';
|
2
2
|
|
3
|
-
const phoneInputMaskCss = ".inline-text-field-container{display:flex;flex-direction:column}@supports (top: max(0%)){.mdc-text-field--outlined{padding-right:max(16px, var(--mdc-shape-small, 4px))}}@supports (top: max(0%)){.mdc-text-field--outlined{padding-left:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}.mdc-text-field--outlined{height:55px;overflow:visible}.phone{display:block;width:
|
3
|
+
const phoneInputMaskCss = ":host{width:100%}.inline-text-field-container{display:flex;flex-direction:column}@supports (top: max(0%)){.mdc-text-field--outlined{padding-right:max(16px, var(--mdc-shape-small, 4px))}}@supports (top: max(0%)){.mdc-text-field--outlined{padding-left:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}.mdc-text-field--outlined{height:55px;overflow:visible}.phone{display:block;width:100%;height:24px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:0px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);-webkit-transition:border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s}.mdc-text-field{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:0;border-bottom-left-radius:0;display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity, transform, color}";
|
4
4
|
const PhoneInputMaskStyle0 = phoneInputMaskCss;
|
5
5
|
|
6
6
|
const PhoneInputMask = class {
|
@@ -31,7 +31,7 @@ const PhoneInputMask = class {
|
|
31
31
|
return this.phone;
|
32
32
|
}
|
33
33
|
render() {
|
34
|
-
return (h("input", { key: '
|
34
|
+
return (h("input", { key: '623357066b9052b9d3a5a853f03058639653d3e0', disabled: this.disabled, id: "phone", type: "tel", class: "phone", value: this.phone, onInput: (event) => this.handleInput(event), placeholder: "(12) 94567-8910" }));
|
35
35
|
}
|
36
36
|
};
|
37
37
|
PhoneInputMask.style = PhoneInputMaskStyle0;
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"phone-input-mask.entry.js","mappings":";;AAAA,MAAM,iBAAiB,GAAG
|
1
|
+
{"file":"phone-input-mask.entry.js","mappings":";;AAAA,MAAM,iBAAiB,GAAG,ivCAAivC,CAAC;AAC5wC,6BAAe,iBAAiB;;MCMnB,cAAc;;;qBACE,EAAE;;;;IAI3B,iBAAiB;QACb,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC;KAClC;IAEO,WAAW,CAAC,KAAa;QAC7B,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACzC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;QAC7D,IAAI,CAAC,KAAK;YAAE,OAAO,KAAK,CAAC;QAEzB,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC;QAC7C,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC;QAC9C,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC;QAE7C,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,EAAE,CAAC;KACrC;IAEO,WAAW,CAAC,KAAY;QAC5B,MAAM,KAAK,GAAG,KAAK,CAAC,MAA0B,CAAC;QAC/C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KAC9C;IAGM,MAAM,QAAQ;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC;KACrB;IAED,MAAM;QACF,QACI,8DACI,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,EAAE,EAAC,OAAO,EACV,IAAI,EAAC,KAAK,EACV,KAAK,EAAC,OAAO,EACb,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,EAC3C,WAAW,EAAC,iBAAiB,GAC/B,EACJ;KACL;;;;;;","names":[],"sources":["src/components/phone/phone-input-mask.css?tag=phone-input-mask&encapsulation=shadow","src/components/phone/phone-input-mask.tsx"],"sourcesContent":[":host {\n width: 100%;\n}\n\n.inline-text-field-container {\n display: flex;\n flex-direction: column;\n}\n\n@supports (top: max(0%)) {\n .mdc-text-field--outlined {\n padding-right: max(16px, var(--mdc-shape-small, 4px));\n }\n}\n\n@supports (top: max(0%)) {\n .mdc-text-field--outlined {\n padding-left: max(16px, calc(var(--mdc-shape-small, 4px) + 4px));\n }\n}\n\n.mdc-text-field--outlined {\n height: 55px;\n overflow: visible;\n}\n\n.phone {\n display: block;\n width: 100%;\n height: 24px;\n padding: 6px 12px;\n font-size: 14px;\n line-height: 1.42857143;\n color: #555;\n background-color: #fff;\n background-image: none;\n border: 1px solid #ccc;\n border-radius: 0px;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);\n -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;\n -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;\n transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;\n}\n\n.mdc-text-field {\n border-top-left-radius: 4px;\n border-top-left-radius: var(--mdc-shape-small, 4px);\n border-top-right-radius: 4px;\n border-top-right-radius: var(--mdc-shape-small, 4px);\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n display: inline-flex;\n align-items: baseline;\n padding: 0 16px;\n position: relative;\n box-sizing: border-box;\n overflow: hidden;\n will-change: opacity, transform, color;\n}","import { Component, h, Method, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'phone-input-mask',\n styleUrl: 'phone-input-mask.css',\n shadow: true,\n})\nexport class PhoneInputMask {\n @State() phone: string = '';\n @Prop() initialValue: string;\n @Prop() disabled: boolean;\n\n componentWillLoad() {\n this.phone = this.initialValue; \n }\n\n private formatPhone(value: string): string {\n const cleaned = value.replace(/\\D/g, ''); // Remove tudo que não for número\n const match = cleaned.match(/^(\\d{0,2})(\\d{0,5})(\\d{0,4})$/);\n if (!match) return value;\n\n const part1 = match[1] ? `(${match[1]}` : '';\n const part2 = match[2] ? `) ${match[2]}` : '';\n const part3 = match[3] ? `-${match[3]}` : '';\n\n return `${part1}${part2}${part3}`;\n }\n\n private handleInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.phone = this.formatPhone(input.value);\n }\n\n @Method()\n public async getPhone() {\n return this.phone;\n }\n\n render() {\n return (\n <input\n disabled={this.disabled}\n id=\"phone\"\n type=\"tel\"\n class=\"phone\"\n value={this.phone}\n onInput={(event) => this.handleInput(event)}\n placeholder=\"(12) 94567-8910\"\n />\n );\n }\n}\n"],"version":3}
|
package/package.json
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"p-0c79c309.js","mappings":";;AAAA,MAAM,iBAAiB,GAAG,+tCAA+tC,CAAC;AAC1vC,6BAAe,iBAAiB;;MCMnB,cAAc;;;;;qBACE,EAAE;;;;IAI3B,iBAAiB;QACb,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC;KAClC;IAEO,WAAW,CAAC,KAAa;QAC7B,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACzC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;QAC7D,IAAI,CAAC,KAAK;YAAE,OAAO,KAAK,CAAC;QAEzB,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC;QAC7C,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC;QAC9C,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC;QAE7C,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,EAAE,CAAC;KACrC;IAEO,WAAW,CAAC,KAAY;QAC5B,MAAM,KAAK,GAAG,KAAK,CAAC,MAA0B,CAAC;QAC/C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KAC9C;IAGM,MAAM,QAAQ;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC;KACrB;IAED,MAAM;QACF,QACI,8DACI,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,EAAE,EAAC,OAAO,EACV,IAAI,EAAC,KAAK,EACV,KAAK,EAAC,OAAO,EACb,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,EAC3C,WAAW,EAAC,iBAAiB,GAC/B,EACJ;KACL;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/phone/phone-input-mask.css?tag=phone-input-mask&encapsulation=shadow","src/components/phone/phone-input-mask.tsx"],"sourcesContent":[".inline-text-field-container {\n display: flex;\n flex-direction: column;\n}\n\n@supports (top: max(0%)) {\n .mdc-text-field--outlined {\n padding-right: max(16px, var(--mdc-shape-small, 4px));\n }\n}\n\n@supports (top: max(0%)) {\n .mdc-text-field--outlined {\n padding-left: max(16px, calc(var(--mdc-shape-small, 4px) + 4px));\n }\n}\n\n.mdc-text-field--outlined {\n height: 55px;\n overflow: visible;\n}\n\n.phone {\n display: block;\n width: 84%;\n height: 34px;\n padding: 6px 12px;\n font-size: 14px;\n line-height: 1.42857143;\n color: #555;\n background-color: #fff;\n background-image: none;\n border: 1px solid #ccc;\n border-radius: 4px;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);\n -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;\n -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;\n transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;\n}\n\n.mdc-text-field {\n border-top-left-radius: 4px;\n border-top-left-radius: var(--mdc-shape-small, 4px);\n border-top-right-radius: 4px;\n border-top-right-radius: var(--mdc-shape-small, 4px);\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n display: inline-flex;\n align-items: baseline;\n padding: 0 16px;\n position: relative;\n box-sizing: border-box;\n overflow: hidden;\n will-change: opacity, transform, color;\n}","import { Component, h, Method, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'phone-input-mask',\n styleUrl: 'phone-input-mask.css',\n shadow: true,\n})\nexport class PhoneInputMask {\n @State() phone: string = '';\n @Prop() initialValue: string;\n @Prop() disabled: boolean;\n\n componentWillLoad() {\n this.phone = this.initialValue; \n }\n\n private formatPhone(value: string): string {\n const cleaned = value.replace(/\\D/g, ''); // Remove tudo que não for número\n const match = cleaned.match(/^(\\d{0,2})(\\d{0,5})(\\d{0,4})$/);\n if (!match) return value;\n\n const part1 = match[1] ? `(${match[1]}` : '';\n const part2 = match[2] ? `) ${match[2]}` : '';\n const part3 = match[3] ? `-${match[3]}` : '';\n\n return `${part1}${part2}${part3}`;\n }\n\n private handleInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.phone = this.formatPhone(input.value);\n }\n\n @Method()\n public async getPhone() {\n return this.phone;\n }\n\n render() {\n return (\n <input\n disabled={this.disabled}\n id=\"phone\"\n type=\"tel\"\n class=\"phone\"\n value={this.phone}\n onInput={(event) => this.handleInput(event)}\n placeholder=\"(12) 94567-8910\"\n />\n );\n }\n}\n"],"version":3}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import{r as e,h as o}from"./p-72510682.js";const t=".inline-text-field-container{display:flex;flex-direction:column}@supports (top: max(0%)){.mdc-text-field--outlined{padding-right:max(16px, var(--mdc-shape-small, 4px))}}@supports (top: max(0%)){.mdc-text-field--outlined{padding-left:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}.mdc-text-field--outlined{height:55px;overflow:visible}.phone{display:block;width:84%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);-webkit-transition:border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s}.mdc-text-field{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:0;border-bottom-left-radius:0;display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity, transform, color}";const i=t;const s=class{constructor(o){e(this,o);this.phone="";this.initialValue=undefined;this.disabled=undefined}componentWillLoad(){this.phone=this.initialValue}formatPhone(e){const o=e.replace(/\D/g,"");const t=o.match(/^(\d{0,2})(\d{0,5})(\d{0,4})$/);if(!t)return e;const i=t[1]?`(${t[1]}`:"";const s=t[2]?`) ${t[2]}`:"";const r=t[3]?`-${t[3]}`:"";return`${i}${s}${r}`}handleInput(e){const o=e.target;this.phone=this.formatPhone(o.value)}async getPhone(){return this.phone}render(){return o("input",{key:"67f707c85624ebb9ae25f11021df00db1cf237ce",disabled:this.disabled,id:"phone",type:"tel",class:"phone",value:this.phone,onInput:e=>this.handleInput(e),placeholder:"(12) 94567-8910"})}};s.style=i;export{s as phone_input_mask};
|
2
|
-
//# sourceMappingURL=p-63791d65.entry.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["phoneInputMaskCss","PhoneInputMaskStyle0","PhoneInputMask","componentWillLoad","this","phone","initialValue","formatPhone","value","cleaned","replace","match","part1","part2","part3","handleInput","event","input","target","getPhone","render","h","key","disabled","id","type","class","onInput","placeholder"],"sources":["src/components/phone/phone-input-mask.css?tag=phone-input-mask&encapsulation=shadow","src/components/phone/phone-input-mask.tsx"],"sourcesContent":[".inline-text-field-container {\n display: flex;\n flex-direction: column;\n}\n\n@supports (top: max(0%)) {\n .mdc-text-field--outlined {\n padding-right: max(16px, var(--mdc-shape-small, 4px));\n }\n}\n\n@supports (top: max(0%)) {\n .mdc-text-field--outlined {\n padding-left: max(16px, calc(var(--mdc-shape-small, 4px) + 4px));\n }\n}\n\n.mdc-text-field--outlined {\n height: 55px;\n overflow: visible;\n}\n\n.phone {\n display: block;\n width: 84%;\n height: 34px;\n padding: 6px 12px;\n font-size: 14px;\n line-height: 1.42857143;\n color: #555;\n background-color: #fff;\n background-image: none;\n border: 1px solid #ccc;\n border-radius: 4px;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);\n -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;\n -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;\n transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;\n}\n\n.mdc-text-field {\n border-top-left-radius: 4px;\n border-top-left-radius: var(--mdc-shape-small, 4px);\n border-top-right-radius: 4px;\n border-top-right-radius: var(--mdc-shape-small, 4px);\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n display: inline-flex;\n align-items: baseline;\n padding: 0 16px;\n position: relative;\n box-sizing: border-box;\n overflow: hidden;\n will-change: opacity, transform, color;\n}","import { Component, h, Method, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'phone-input-mask',\n styleUrl: 'phone-input-mask.css',\n shadow: true,\n})\nexport class PhoneInputMask {\n @State() phone: string = '';\n @Prop() initialValue: string;\n @Prop() disabled: boolean;\n\n componentWillLoad() {\n this.phone = this.initialValue; \n }\n\n private formatPhone(value: string): string {\n const cleaned = value.replace(/\\D/g, ''); // Remove tudo que não for número\n const match = cleaned.match(/^(\\d{0,2})(\\d{0,5})(\\d{0,4})$/);\n if (!match) return value;\n\n const part1 = match[1] ? `(${match[1]}` : '';\n const part2 = match[2] ? `) ${match[2]}` : '';\n const part3 = match[3] ? `-${match[3]}` : '';\n\n return `${part1}${part2}${part3}`;\n }\n\n private handleInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.phone = this.formatPhone(input.value);\n }\n\n @Method()\n public async getPhone() {\n return this.phone;\n }\n\n render() {\n return (\n <input\n disabled={this.disabled}\n id=\"phone\"\n type=\"tel\"\n class=\"phone\"\n value={this.phone}\n onInput={(event) => this.handleInput(event)}\n placeholder=\"(12) 94567-8910\"\n />\n );\n }\n}\n"],"mappings":"2CAAA,MAAMA,EAAoB,guCAC1B,MAAAC,EAAeD,E,MCMFE,EAAc,M,oCACE,G,oDAIzB,iBAAAC,GACIC,KAAKC,MAAQD,KAAKE,Y,CAGd,WAAAC,CAAYC,GAChB,MAAMC,EAAUD,EAAME,QAAQ,MAAO,IACrC,MAAMC,EAAQF,EAAQE,MAAM,iCAC5B,IAAKA,EAAO,OAAOH,EAEnB,MAAMI,EAAQD,EAAM,GAAK,IAAIA,EAAM,KAAO,GAC1C,MAAME,EAAQF,EAAM,GAAK,KAAKA,EAAM,KAAO,GAC3C,MAAMG,EAAQH,EAAM,GAAK,IAAIA,EAAM,KAAO,GAE1C,MAAO,GAAGC,IAAQC,IAAQC,G,CAGtB,WAAAC,CAAYC,GAChB,MAAMC,EAAQD,EAAME,OACpBd,KAAKC,MAAQD,KAAKG,YAAYU,EAAMT,M,CAIjC,cAAMW,GACT,OAAOf,KAAKC,K,CAGhB,MAAAe,GACI,OACIC,EAAA,SAAAC,IAAA,2CACIC,SAAUnB,KAAKmB,SACfC,GAAG,QACHC,KAAK,MACLC,MAAM,QACNlB,MAAOJ,KAAKC,MACZsB,QAAUX,GAAUZ,KAAKW,YAAYC,GACrCY,YAAY,mB","ignoreList":[]}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import{r as t,h as e}from"./p-72510682.js";import{C as i}from"./p-374de9ae.js";import{S as s}from"./p-8e6cdd1e.js";const n=".container-button{max-width:100%;cursor:pointer;padding:10px;display:flex}.section-crm{border:1px solid #dbd4d4;text-align:-webkit-center;margin-bottom:20px}.section-cart-crm{text-align:-webkit-center;margin-bottom:20px}.button{top:50%;background-color:#6c6c7e;color:#fff;border:none;padding:15px;min-height:30px;min-width:120px;font-size:20px;cursor:pointer;margin-left:10px;height:70px}.form-container{width:100%;display:flex;justify-content:center;justify-content:space-around}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.form-container .btnCrm{background:#00162e;border-color:#00162e;width:30%;color:#fff}";const o=n;const a=class{constructor(e){t(this,e);this.crmBonusService=new i;this.showModal=false;this.userId=undefined;this.storeName=undefined;this.productsInString=undefined;this.cartId=undefined;this.products=undefined;this.customer={birthDate:"",document:"",name:"",phone:""};this.loading=false;this.message=undefined;this.phone=undefined;this.canCancel=false;this.sent=undefined}async componentWillLoad(){await this.handleLoad()}async handleLoad(){try{if(this.userId){this.customer=await this.crmBonusService.getCustomer(this.userId,this.storeName);console.log("user",this.customer)}}catch(t){console.log("info customer")}this.products=JSON.parse(this.productsInString)}async sendPin(t){var e,i;this.loading=true;this.message="";try{const e=t.replace(/\D/g,"");this.phone=Number(e);this.sent=await this.crmBonusService.sendPin(this.phone,this.storeName);await this.crmBonusRef.setStep(s.STEP_PIN);this.showModal=true}catch(t){this.message=(i=(e=t===null||t===void 0?void 0:t.response)===null||e===void 0?void 0:e.data)===null||i===void 0?void 0:i.message}finally{this.loading=false}}buildProducts(){return this.products.map((t=>({sku:t.SKU,value:t.PrecoPor*t.Quantidade,variantId:t.ProdutoVarianteId,qtd:t.Quantidade})))}handleCloseModal(){this.showModal=false}save(){localStorage.setItem("@BYCODERS",this.cartId)}render(){return e("div",{key:"881de45f9b1d135bcf29f0bb64acba9dd6db2625",class:"section-cart-crm"},e("div",{key:"7cc8a215a2c1bf5a9fbaeeb04c1c8743feabb209",class:"container-button"},this.canCancel?e("phone-cancel-input",{value:this.customer.phone,sendPin:()=>{},loading:this.loading}):e("phone-input",{value:this.customer.phone,sendPin:t=>{this.sendPin(t)},loading:this.loading})),e("app-modal",{key:"3306e64dbc19f4c8ddc9610c0167034423c103ba",isOpen:this.showModal,modalTitle:`Giftback`,onModalClosed:()=>this.showModal=false},e("crm-bonus-form",{key:"26c41f2ba814ce5460c1f3723917e5a1c7ea734d",saveStore:()=>this.save(),ref:t=>this.crmBonusRef=t,sent:this.sent,phone:this.phone,cancel:()=>this.handleCloseModal(),storeName:this.storeName,products:this.buildProducts(),cartId:this.cartId,customer:this.customer})))}static get assetsDirs(){return["assets"]}};a.style=o;export{a as crm_bonus};
|
2
|
-
//# sourceMappingURL=p-b31d29c2.entry.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["crmBonusCss","CrmBonusStyle0","CrmBonus","this","crmBonusService","CrmBonusService","birthDate","document","name","phone","componentWillLoad","handleLoad","userId","customer","getCustomer","storeName","console","log","error","products","JSON","parse","productsInString","sendPin","loading","message","_phone","replace","Number","sent","crmBonusRef","setStep","StepFormEnum","STEP_PIN","showModal","_b","_a","response","data","buildProducts","map","product","sku","SKU","value","PrecoPor","Quantidade","variantId","ProdutoVarianteId","qtd","handleCloseModal","save","localStorage","setItem","cartId","render","h","key","class","canCancel","isOpen","modalTitle","onModalClosed","saveStore","ref","cancel"],"sources":["src/components/crm-bonus/crm-bonus.css?tag=crm-bonus&encapsulation=shadow","src/components/crm-bonus/crm-bonus.tsx"],"sourcesContent":["/* :host {\n display: block;\n} */\n\n.container-button {\n max-width: 100%;\n cursor: pointer;\n padding: 10px;\n display: flex;\n}\n\n/* padding: 0 15px 15px;\nborder: 1px solid #ddd;\nmargin-bottom: 20px; */\n\n.section-crm {\n border: 1px solid #dbd4d4;\n /* min-height: 50px; */\n text-align: -webkit-center;\n margin-bottom: 20px;\n}\n\n.section-cart-crm {\n /* border: 1px solid #dbd4d4; */\n /* min-height: 50px; */\n text-align: -webkit-center;\n margin-bottom: 20px;\n}\n\n.button {\n top: 50%;\n background-color: #6c6c7e;\n color: #fff;\n border: none;\n /* border-radius: 10px; */\n padding: 15px;\n min-height: 30px;\n min-width: 120px;\n font-size: 20px;\n cursor: pointer;\n margin-left: 10px;\n height: 70px;\n}\n\n.form-container {\n width: 100%;\n display: flex;\n justify-content: center;\n justify-content: space-around;\n}\n\n\n.btn {\n display: inline-block;\n padding: 6px 12px;\n margin-bottom: 0;\n font-size: 14px;\n font-weight: 400;\n line-height: 1.42857143;\n text-align: center;\n white-space: nowrap;\n vertical-align: middle;\n -ms-touch-action: manipulation;\n touch-action: manipulation;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n background-image: none;\n border: 1px solid transparent;\n border-radius: 4px;\n}\n\n.form-container .btnCrm {\n background: #00162e;\n border-color: #00162e;\n width: 30%;\n color: #fff;\n}","import { Component, Prop, State, h } from '@stencil/core';\nimport { IProduct, IProductWake, ICustomer } from '../../dto/validate.pin.bonus';\nimport { CrmBonusService } from '../../services/crmbonus.service';\nimport { IPinSent } from '../../components';\nimport { StepFormEnum } from '../../contants';\n\n@Component({\n tag: 'crm-bonus',\n styleUrl: 'crm-bonus.css',\n shadow: true,\n assetsDirs: ['assets']\n})\nexport class CrmBonus {\n\n private crmBonusService: CrmBonusService = new CrmBonusService();\n\n private crmBonusRef: HTMLCrmBonusFormElement;\n\n @State() showModal: boolean = false;\n @Prop({ attribute: 'userid' }) userId: number;\n @Prop({ attribute: 'storename' }) storeName;\n @Prop({ attribute: 'products' }) productsInString: string;\n @Prop({ attribute: 'cartid' }) cartId;\n\n @State() products: Array<IProductWake>;\n @State() customer: ICustomer = {\n birthDate: \"\",\n document: \"\",\n name: \"\",\n phone: \"\"\n };\n\n @State() loading: boolean = false;\n @State() message: string;\n @State() phone: number;\n @State() canCancel: boolean = false;\n @State() sent: IPinSent;\n\n async componentWillLoad() {\n await this.handleLoad();\n }\n\n async handleLoad() {\n try {\n if (this.userId) {\n this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);\n console.log('user', this.customer);\n }\n } catch (error) {\n console.log('info customer')\n }\n this.products = JSON.parse(this.productsInString);\n }\n\n public async sendPin(phone: string) {\n this.loading = true;\n this.message = \"\";\n\n try {\n const _phone = phone.replace(/\\D/g, '');\n this.phone = Number(_phone);\n this.sent = await this.crmBonusService.sendPin(this.phone, this.storeName);;\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);\n this.showModal = true;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n buildProducts(): IProduct[] {\n return this.products.map(product => ({ sku: product.SKU, value: (product.PrecoPor * product.Quantidade), variantId: product.ProdutoVarianteId, qtd: product.Quantidade }))\n }\n\n handleCloseModal() {\n this.showModal = false;\n }\n\n save() {\n localStorage.setItem('@BYCODERS', this.cartId)\n }\n\n render() {\n return (\n <div class=\"section-cart-crm\">\n <div class=\"container-button\">\n {/* <img src={logo} onClick={() => (this.showModal = true)} /> */}\n {\n this.canCancel ? <phone-cancel-input value={this.customer.phone} sendPin={() => { }} loading={this.loading} /> \n : <phone-input value={this.customer.phone} sendPin={(phone) => { this.sendPin(phone) }} loading={this.loading} />\n }\n \n </div>\n <app-modal\n isOpen={this.showModal}\n modalTitle={`Giftback`}\n onModalClosed={() => (this.showModal = false)}\n >\n <crm-bonus-form saveStore={() => this.save()} ref={ref => this.crmBonusRef = ref} sent={this.sent} phone={this.phone} cancel={() => this.handleCloseModal()} storeName={this.storeName} products={this.buildProducts()} cartId={this.cartId} customer={this.customer} />\n </app-modal>\n </div>\n )\n }\n}\n"],"mappings":"mHAAA,MAAMA,EAAc,q8BACpB,MAAAC,EAAeD,E,MCWFE,EAAQ,M,yBAEXC,KAAAC,gBAAmC,IAAIC,E,eAIjB,M,2IAOC,CAC7BC,UAAW,GACXC,SAAU,GACVC,KAAM,GACNC,MAAO,I,aAGmB,M,2DAGE,M,oBAG9B,uBAAMC,SACEP,KAAKQ,Y,CAGb,gBAAMA,GACJ,IACE,GAAIR,KAAKS,OAAQ,CACfT,KAAKU,eAAiBV,KAAKC,gBAAgBU,YAAYX,KAAKS,OAAQT,KAAKY,WACzEC,QAAQC,IAAI,OAAQd,KAAKU,S,EAE3B,MAAOK,GACPF,QAAQC,IAAI,gB,CAEdd,KAAKgB,SAAWC,KAAKC,MAAMlB,KAAKmB,iB,CAG3B,aAAMC,CAAQd,G,QACnBN,KAAKqB,QAAU,KACfrB,KAAKsB,QAAU,GAEf,IACE,MAAMC,EAASjB,EAAMkB,QAAQ,MAAO,IACpCxB,KAAKM,MAAQmB,OAAOF,GACpBvB,KAAK0B,WAAa1B,KAAKC,gBAAgBmB,QAAQpB,KAAKM,MAAON,KAAKY,iBAC1DZ,KAAK2B,YAAYC,QAAQC,EAAaC,UAC5C9B,KAAK+B,UAAY,I,CACjB,MAAOhB,GACPf,KAAKsB,SAAUU,GAAAC,EAAAlB,IAAK,MAALA,SAAK,SAALA,EAAOmB,YAAQ,MAAAD,SAAA,SAAAA,EAAEE,QAAI,MAAAH,SAAA,SAAAA,EAAEV,O,SAEtCtB,KAAKqB,QAAU,K,EAInB,aAAAe,GACE,OAAOpC,KAAKgB,SAASqB,KAAIC,IAAO,CAAOC,IAAKD,EAAQE,IAAKC,MAAQH,EAAQI,SAAWJ,EAAQK,WAAaC,UAAWN,EAAQO,kBAAmBC,IAAKR,EAAQK,c,CAG9J,gBAAAI,GACE/C,KAAK+B,UAAY,K,CAGnB,IAAAiB,GACEC,aAAaC,QAAQ,YAAalD,KAAKmD,O,CAGzC,MAAAC,GACE,OACEC,EAAA,OAAAC,IAAA,2CAAKC,MAAM,oBACTF,EAAA,OAAAC,IAAA,2CAAKC,MAAM,oBAGPvD,KAAKwD,UAAYH,EAAA,sBAAoBZ,MAAOzC,KAAKU,SAASJ,MAAOc,QAAS,OAAYC,QAASrB,KAAKqB,UAClGgC,EAAA,eAAaZ,MAAOzC,KAAKU,SAASJ,MAAOc,QAAUd,IAAYN,KAAKoB,QAAQd,EAAM,EAAIe,QAASrB,KAAKqB,WAI1GgC,EAAA,aAAAC,IAAA,2CACEG,OAAQzD,KAAK+B,UACb2B,WAAY,WACZC,cAAe,IAAO3D,KAAK+B,UAAY,OAEvCsB,EAAA,kBAAAC,IAAA,2CAAgBM,UAAW,IAAM5D,KAAKgD,OAAQa,IAAKA,GAAO7D,KAAK2B,YAAckC,EAAKnC,KAAM1B,KAAK0B,KAAMpB,MAAON,KAAKM,MAAOwD,OAAQ,IAAM9D,KAAK+C,mBAAoBnC,UAAWZ,KAAKY,UAAWI,SAAUhB,KAAKoC,gBAAiBe,OAAQnD,KAAKmD,OAAQzC,SAAUV,KAAKU,Y","ignoreList":[]}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|