crmbonus-component-wake 2.0.50 → 2.0.52
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/countdown-timer_4.cjs.entry.js +6 -2
- package/dist/cjs/countdown-timer_4.cjs.entry.js.map +1 -1
- package/dist/cjs/crm-bonus-note.cjs.entry.js +6 -5
- package/dist/cjs/crm-bonus-note.cjs.entry.js.map +1 -1
- package/dist/cjs/crm-giftback-form.cjs.entry.js +9 -7
- package/dist/cjs/crm-giftback-form.cjs.entry.js.map +1 -1
- package/dist/cjs/crmbonus-component-wake.cjs.js +1 -1
- package/dist/cjs/crmbonus.service-3c4ebbdf.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pedido-finalizado.cjs.entry.js +1 -1
- package/dist/cjs/phone-input-mask.cjs.entry.js +1 -1
- package/dist/collection/assets/svg/money-dollars-svgrepo-com.svg +6 -0
- package/dist/collection/components/giftback-form/giftback-form.js +9 -7
- package/dist/collection/components/giftback-form/giftback-form.js.map +1 -1
- package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js +24 -1
- package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js.map +1 -1
- package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js +24 -1
- package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js.map +1 -1
- package/dist/collection/components/note/crm-bonus-note.css +3 -0
- package/dist/collection/components/note/crm-bonus-note.js +4 -4
- package/dist/collection/components/note/crm-bonus-note.js.map +1 -1
- package/dist/collection/components/pedido/pedido.js +1 -1
- package/dist/collection/components/phone/phone-input-mask.js +1 -1
- package/dist/components/crm-bonus-note.js +6 -5
- package/dist/components/crm-bonus-note.js.map +1 -1
- package/dist/components/crm-bonus.js +4 -4
- package/dist/components/crm-giftback-form.js +1 -1
- package/dist/components/{p-b808ff34.js → p-57ec707e.js} +2 -2
- package/dist/components/{p-b808ff34.js.map → p-57ec707e.js.map} +1 -1
- package/dist/components/{p-3cb4afe5.js → p-73e75b43.js} +13 -11
- package/dist/components/p-73e75b43.js.map +1 -0
- package/dist/components/{p-78300478.js → p-9f68d2a1.js} +7 -4
- package/dist/components/p-9f68d2a1.js.map +1 -0
- package/dist/components/p-dd6f6ab7.js.map +1 -1
- package/dist/components/{p-255eed34.js → p-f4244087.js} +5 -2
- package/dist/components/p-f4244087.js.map +1 -0
- package/dist/components/pedido-finalizado.js +1 -1
- package/dist/components/phone-cancel-input.js +1 -1
- package/dist/components/phone-form.js +1 -1
- package/dist/components/phone-input-mask.js +1 -1
- package/dist/components/phone-input.js +1 -1
- package/dist/components/pin-form.js +1 -1
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -1
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
- package/dist/crmbonus-component-wake/{p-d277f2a9.entry.js → p-118fc099.entry.js} +2 -2
- package/dist/crmbonus-component-wake/p-118fc099.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-298d8fff.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-298d8fff.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/{p-4b5f8662.entry.js → p-312caf3f.entry.js} +2 -2
- package/dist/crmbonus-component-wake/p-312caf3f.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-9acd4f81.entry.js +2 -0
- package/dist/crmbonus-component-wake/{p-72448900.entry.js → p-c4cc29a0.entry.js} +2 -2
- package/dist/crmbonus-component-wake/p-dd6f6ab7.js.map +1 -1
- package/dist/env.js.map +1 -1
- package/dist/esm/countdown-timer_4.entry.js +6 -2
- package/dist/esm/countdown-timer_4.entry.js.map +1 -1
- package/dist/esm/crm-bonus-note.entry.js +6 -5
- package/dist/esm/crm-bonus-note.entry.js.map +1 -1
- package/dist/esm/crm-giftback-form.entry.js +9 -7
- package/dist/esm/crm-giftback-form.entry.js.map +1 -1
- package/dist/esm/crmbonus-component-wake.js +1 -1
- package/dist/esm/crmbonus.service-9cba7b49.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pedido-finalizado.entry.js +1 -1
- package/dist/esm/phone-input-mask.entry.js +1 -1
- package/dist/types/components/giftback-form/subcomponents/phone-form/phone-form.d.ts +2 -0
- package/dist/types/components/giftback-form/subcomponents/pin-form/pin-form.d.ts +2 -0
- package/dist/types/components.d.ts +6 -0
- package/package.json +1 -1
- package/dist/components/p-255eed34.js.map +0 -1
- package/dist/components/p-3cb4afe5.js.map +0 -1
- package/dist/components/p-78300478.js.map +0 -1
- package/dist/crmbonus-component-wake/p-0a853764.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-4b5f8662.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-c72a11ba.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-c72a11ba.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-d277f2a9.entry.js.map +0 -1
- /package/dist/crmbonus-component-wake/{p-0a853764.entry.js.map → p-9acd4f81.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-72448900.entry.js.map → p-c4cc29a0.entry.js.map} +0 -0
@@ -7,9 +7,9 @@ import { d as defineCustomElement$7 } from './p-39d680b6.js';
|
|
7
7
|
import { d as defineCustomElement$6 } from './p-e4ac17bf.js';
|
8
8
|
import { d as defineCustomElement$5 } from './p-f579d773.js';
|
9
9
|
import { d as defineCustomElement$4 } from './p-5c3fe5a8.js';
|
10
|
-
import { d as defineCustomElement$3 } from './p-
|
11
|
-
import { d as defineCustomElement$2 } from './p-
|
12
|
-
import { d as defineCustomElement$1 } from './p-
|
10
|
+
import { d as defineCustomElement$3 } from './p-9f68d2a1.js';
|
11
|
+
import { d as defineCustomElement$2 } from './p-57ec707e.js';
|
12
|
+
import { d as defineCustomElement$1 } from './p-f4244087.js';
|
13
13
|
|
14
14
|
const giftbackFormCss = "*{margin:0;padding:0;box-sizing:border-box}:host{--crmfont-sizebodymd:14px;--crmline-heightbodymd:20px;--crmletter-spacingtitle-md:0px}.container-message{font-family:Roboto;font-size:var(--crmfont-sizebodymd);font-weight:400;line-height:var(--crmline-heightbodymd);letter-spacing:var(--crmletter-spacingtitle-md);text-align:left;text-underline-position:from-font;text-decoration-skip-ink:none}.crm-container-form{display:flex;flex-direction:column;justify-content:space-around;height:auto;padding:20px 24px 20px 24px;border:1px solid #CCCC;writing-mode:horizontal-tb;gap:16px;border-top:1px solid #ccc !important;border-bottom:1px solid #ccc !important}.crm-phone-form{display:flex;flex-direction:column;height:100%;gap:16px}.crm-subtitle{font-size:14px;color:var(--crm-btn)}.crm-title{font-weight:700;line-height:20px;color:#262626;font-size:16px}.crm-message-info{color:#619013;font-weight:500;font-size:12px}.crm-message-error{color:#E11D48;font-weight:500;font-size:12px}";
|
15
15
|
const CrmGiftbackFormStyle0 = giftbackFormCss;
|
@@ -105,8 +105,8 @@ const CrmBonus = /*@__PURE__*/ proxyCustomElement(class CrmBonus extends H {
|
|
105
105
|
}
|
106
106
|
else {
|
107
107
|
this.error = _error;
|
108
|
+
this.step = StepFormEnum.STEP_NO_BONUS;
|
108
109
|
}
|
109
|
-
this.step = StepFormEnum.STEP_NO_BONUS;
|
110
110
|
}
|
111
111
|
finally {
|
112
112
|
this.loading = false;
|
@@ -121,7 +121,8 @@ const CrmBonus = /*@__PURE__*/ proxyCustomElement(class CrmBonus extends H {
|
|
121
121
|
this.loading = true;
|
122
122
|
try {
|
123
123
|
await this.crmBonusService.cancel(this.cartId);
|
124
|
-
localStorage.removeItem(this.cartId);
|
124
|
+
// localStorage.removeItem(this.cartId);
|
125
|
+
this.save(0);
|
125
126
|
}
|
126
127
|
catch (error) {
|
127
128
|
this.message = "Não consegui cancelar o bônus, tente novamente!";
|
@@ -141,6 +142,7 @@ const CrmBonus = /*@__PURE__*/ proxyCustomElement(class CrmBonus extends H {
|
|
141
142
|
catch (error) {
|
142
143
|
this.message = "ocorreu um error ao solicitar a aplicação do bonus! tente novamente";
|
143
144
|
this.step = StepFormEnum.STEP_NO_BONUS;
|
145
|
+
localStorage.removeItem(this.cartId);
|
144
146
|
}
|
145
147
|
finally {
|
146
148
|
this.loading = false;
|
@@ -161,11 +163,11 @@ const CrmBonus = /*@__PURE__*/ proxyCustomElement(class CrmBonus extends H {
|
|
161
163
|
});
|
162
164
|
}
|
163
165
|
render() {
|
164
|
-
return (h("div", { key: '
|
165
|
-
h("phone-form", { key: '
|
166
|
-
h("pin-form", { key: '
|
167
|
-
h("giftback-info", { key: '
|
168
|
-
(h("div", { key: '
|
166
|
+
return (h("div", { key: 'afea5248815bfd251530e6bb478f10fb77d66e80', class: "crm-container-form fbits-responsive-carrinho-desconto" }, h("label", { key: 'ca9d612fe43f33d2059a2862498b5e805d095874', class: "crm-title" }, this.config.giftbackTitle), this.step === StepFormEnum.STEP_PHONE &&
|
167
|
+
h("phone-form", { key: '5e9828d6f2b446b6e16ab88bab60457d9a0cd77b', config: this.config, loading: this.loading, handlerSubmit: (phone) => this.handleSendPin(phone) }), this.step === StepFormEnum.STEP_PIN &&
|
168
|
+
h("pin-form", { key: '98036eeba6369fea63c9232b3b19ce168bd81034', config: this.config, phone: this.phone, cancel: () => this.changePhone(), resend: () => this.sendPin(), validate: (data) => this.validateBonus(data), loading: this.loading }, this.sucess && h("p", { key: 'cdf4846773d001e68993254bb3715990cfe07079', class: "crm-message-info" }, this.sucess), this.error && h("p", { key: 'c04aad3cfcd4514b3b3bd8216b24e3387ede62dc', class: "crm-message-error" }, this.error)), this.step === StepFormEnum.STEP_RESERVE &&
|
169
|
+
h("giftback-info", { key: 'b9971e3fd27458523808e5630e81115f3456476f', loading: this.loading, cancel: () => this.handleCancel(), bonus: this.bonus, reserve: (amountRedeemed) => this.reserveApply(amountRedeemed) }), this.step === StepFormEnum.STEP_NO_BONUS &&
|
170
|
+
(h("div", { key: '82dfc1e9589368b4ba1bb06297007da4d9d236f5', class: "container-message" }, instance.t("noGiftback", { storename: this.config.giftbackTitle })))));
|
169
171
|
}
|
170
172
|
static get style() { return CrmGiftbackFormStyle0; }
|
171
173
|
}, [0, "crm-giftback-form", {
|
@@ -235,4 +237,4 @@ defineCustomElement();
|
|
235
237
|
|
236
238
|
export { CrmBonus as C, defineCustomElement as d };
|
237
239
|
|
238
|
-
//# sourceMappingURL=p-
|
240
|
+
//# sourceMappingURL=p-73e75b43.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"p-73e75b43.js","mappings":";;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,i9BAAi9B,CAAC;AAC1+B,8BAAe,eAAe;;MCYjB,QAAQ;;;;;QAGX,oBAAe,GAAoB,eAAe,CAAC,WAAW,EAAE,CAAC;;;;;uBAO7C,KAAK;;;;oBAIH,YAAY,CAAC,UAAU;;sBAG3B,EAAE;qBACH,EAAE;;;IAG3B,MAAM,aAAa,CAAC,KAAa;QAE/B,IAAI,CAAC,OAAO,GAAG,EAAE,CAAA;QACjB,IAAI,CAAC,KAAK,EAAE;YACV,IAAI,CAAC,OAAO,GAAG,sBAAsB,CAAC;YACtC,OAAO;SACR;QAED,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,IAAI,CAAC,OAAO,EAAE,CAAA;KACf;IAED,iBAAiB;QACf,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAA;QACf,IAAI,CAAC,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KACpD;IAEO,qBAAqB;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC7C,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;KACvB;IAEM,MAAM,OAAO;;QAClB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,EAA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,CAAC,IAAI,KAAK,YAAY,CAAC,QAAQ;YACnC,iEACE,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,MAAM,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,EAChC,MAAM,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE,EAC5B,QAAQ,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAC5C,OAAO,EAAE,IAAI,CAAC,OAAO,IAEpB,IAAI,CAAC,MAAM,IAAI,0DAAG,KAAK,EAAC,kBAAkB,IAAE,IAAI,CAAC,MAAM,CAAK,EAC5D,IAAI,CAAC,KAAK,IAAI,0DAAG,KAAK,EAAC,mBAAmB,IAAE,IAAI,CAAC,KAAK,CAAK,CAEnD,EAIX,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,YAAY;YACvC,sEACE,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,MAAM,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,EACjC,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,CAAC,cAAsB,KAAK,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,GACtE,EAKF,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,aAAa;aAEtC,4DAAK,KAAK,EAAC,mBAAmB,IAC3BA,QAAO,CAAC,CAAC,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,CAC9D,CACP,CAGC,EACP;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["i18next"],"sources":["src/components/giftback-form/giftback-form.css?tag=crm-giftback-form","src/components/giftback-form/giftback-form.tsx"],"sourcesContent":["* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\n:host {\n --crmfont-sizebodymd: 14px;\n --crmline-heightbodymd: 20px;\n --crmletter-spacingtitle-md: 0px\n}\n\n.container-message {\n font-family: Roboto;\n font-size: var(--crmfont-sizebodymd);\n font-weight: 400;\n line-height: var(--crmline-heightbodymd);\n letter-spacing: var(--crmletter-spacingtitle-md);\n text-align: left;\n text-underline-position: from-font;\n text-decoration-skip-ink: none;\n}\n\n.crm-container-form {\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n height: auto;\n padding: 20px 24px 20px 24px;\n border: 1px solid #CCCC;\n writing-mode: horizontal-tb;\n gap: 16px;\n border-top: 1px solid #ccc !important;\n border-bottom: 1px solid #ccc !important;\n}\n\n/* .fbits-responsive-carrinho-desconto {\n overflow: hidden;\n border: 1px solid #ccc;\n border-top: 0;\n border-bottom: 0;\n} */\n\n.crm-phone-form {\n display: flex;\n flex-direction: column;\n height: 100%;\n /* justify-content: space-around; */\n gap: 16px;\n}\n\n.crm-subtitle {\n font-size: 14px;\n color: var(--crm-btn);\n}\n\n.crm-title {\n font-weight: 700;\n line-height: 20px;\n color: #262626;\n font-size: 16px;\n}\n\n.crm-message-info {\n color: #619013;\n font-weight: 500;\n font-size: 12px;\n}\n\n.crm-message-error {\n color: #E11D48;\n font-weight: 500;\n font-size: 12px;\n}","import { Component, Prop, State, h } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\nimport { StepFormEnum } from \"../../contants\";\nimport { IPinSent } from '../../dto/pin.sent'\nimport { IBonus, IProccesPinBonusDto, IProduct } from \"../../dto/validate.pin.bonus\";\nimport { IInfoStore, getInfoCustomization } from \"../../helpers/info.config.helper\";\n\nimport i18next from \"../../i18n/i18n\"\n\n@Component({\n tag: 'crm-giftback-form',\n styleUrl: 'giftback-form.css'\n})\nexport class CrmBonus {\n // private phoneInputMask: HTMLPhoneFormElement;\n\n private crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\n @Prop({ attribute: 'storename' }) storeName;\n @Prop() cartId;\n @Prop() products: Array<IProduct>;\n\n @State() value: string;\n @State() loading: boolean = false;\n @State() message: string;\n @State() phone: string;\n @State() pinInfo: IPinSent;\n @State() step: StepFormEnum = StepFormEnum.STEP_PHONE;\n @State() bonus: IBonus;\n\n @State() sucess: string = \"\";\n @State() error: string = \"\";\n @State() config: IInfoStore;\n\n async handleSendPin(phone: string) {\n\n this.message = \"\"\n if (!phone) {\n this.message = \"Informe seu telefone\";\n return;\n }\n\n this.phone = phone;\n\n this.sendPin()\n }\n\n componentWillLoad() {\n this.sucess = \"\";\n this.error = \"\"\n this.config = getInfoCustomization(this.storeName);\n }\n\n private convertStringToNumber(): number {\n const _phone = this.phone.replace(/\\D/g, '');\n return Number(_phone);\n }\n\n public async sendPin() {\n this.loading = true;\n this.message = \"\";\n this.sucess = \"\";\n this.error = \"\"\n\n try {\n\n const _phone = this.convertStringToNumber()\n\n this.pinInfo = await this.crmBonusService.sendPin(_phone, \"\", this.storeName);\n\n this.step = StepFormEnum.STEP_PIN;\n\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n changePhone() {\n this.sucess = \"\";\n this.error = \"\"\n this.step = StepFormEnum.STEP_PHONE;\n }\n\n public async validateBonus(pin: string) {\n\n if (this.sucess) {\n this.step = StepFormEnum.STEP_RESERVE;\n return\n }\n\n this.loading = true;\n this.sucess = \"\";\n this.error = \"\";\n const payload: IProccesPinBonusDto = {\n pin: pin,\n cellphone: this.phone.toString(),\n storeId: this.pinInfo.storeId.toString(),\n userId: this.pinInfo.userId.toString(),\n checkoutId: this.cartId,\n checkoutProducts: this.products,\n name: null,\n storeName: this.storeName\n }\n\n try {\n this.bonus = await this.crmBonusService.validatePinBonus(payload);\n\n this.sucess = \"Código validado com sucesso!\";\n\n } catch (error) {\n const _error: string = error?.response?.data?.message;\n\n if (_error.includes(\"Pin\")) {\n this.error = \"Código inválido!\"\n } else {\n this.error = _error;\n this.step = StepFormEnum.STEP_NO_BONUS;\n }\n \n\n } finally {\n this.loading = false;\n }\n }\n\n public handleCancel() {\n // this.step = StepFormEnum.STEP_PHONE;\n this.cancel()\n }\n\n async cancel() {\n this.message = \"\";\n this.loading = true;\n try {\n await this.crmBonusService.cancel(this.cartId);\n // localStorage.removeItem(this.cartId);\n this.save(0)\n } catch (error) {\n this.message = \"Não consegui cancelar o bônus, tente novamente!\"\n } finally {\n this.loading = false;\n }\n }\n\n public async reserveApply(amount: number) {\n this.loading = true;\n this.message = \"\";\n try {\n await this.reserve(amount);\n\n console.log('[reserva]')\n\n this.save(amount);\n } catch (error) {\n this.message = \"ocorreu um error ao solicitar a aplicação do bonus! tente novamente\"\n\n this.step = StepFormEnum.STEP_NO_BONUS;\n localStorage.removeItem(this.cartId);\n } finally {\n this.loading = false;\n }\n }\n\n save(amount: number) {\n localStorage.setItem(this.cartId, amount.toString());\n }\n\n public async reserve(amount: number) {\n\n await this.crmBonusService.reserve({\n redeemedBonus: amount,\n cartId: this.cartId,\n ticket: this.cartId,\n grossValue: Number(this.bonus.totalValue),\n storeName: this.storeName,\n storeId: this.bonus.storeId.toString(),\n userId: this.bonus.userId\n });\n }\n\n render() {\n return (\n <div class=\"crm-container-form fbits-responsive-carrinho-desconto\" >\n <label class=\"crm-title\">{this.config.giftbackTitle}</label>\n\n {this.step === StepFormEnum.STEP_PHONE &&\n <phone-form\n config={this.config}\n loading={this.loading}\n handlerSubmit={(phone) => this.handleSendPin(phone)}\n />}\n {\n this.step === StepFormEnum.STEP_PIN &&\n <pin-form\n config={this.config}\n phone={this.phone}\n cancel={() => this.changePhone()}\n resend={() => this.sendPin()}\n validate={(data) => this.validateBonus(data)}\n loading={this.loading}\n >\n {this.sucess && <p class=\"crm-message-info\">{this.sucess}</p>}\n {this.error && <p class=\"crm-message-error\">{this.error}</p>}\n\n </pin-form>\n }\n\n {\n this.step === StepFormEnum.STEP_RESERVE &&\n <giftback-info\n loading={this.loading}\n cancel={() => this.handleCancel()}\n bonus={this.bonus}\n reserve={(amountRedeemed: number) => this.reserveApply(amountRedeemed)}\n />\n }\n\n\n {\n this.step === StepFormEnum.STEP_NO_BONUS &&\n (\n <div class=\"container-message\">\n {i18next.t(\"noGiftback\", { storename: this.config.giftbackTitle })}\n </div>\n )\n\n }\n </div>\n )\n }\n}"],"version":3}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { p as proxyCustomElement, H, h, d as Host } from './p-2f266d73.js';
|
2
2
|
import { d as defineCustomElement$3 } from './p-e4ac17bf.js';
|
3
3
|
import { d as defineCustomElement$2 } from './p-5c3fe5a8.js';
|
4
|
-
import { d as defineCustomElement$1 } from './p-
|
4
|
+
import { d as defineCustomElement$1 } from './p-57ec707e.js';
|
5
5
|
|
6
6
|
const giftbackFormCss = "*{margin:0;padding:0;box-sizing:border-box}:host{--crmfont-sizebodymd:14px;--crmline-heightbodymd:20px;--crmletter-spacingtitle-md:0px}.container-message{font-family:Roboto;font-size:var(--crmfont-sizebodymd);font-weight:400;line-height:var(--crmline-heightbodymd);letter-spacing:var(--crmletter-spacingtitle-md);text-align:left;text-underline-position:from-font;text-decoration-skip-ink:none}.crm-container-form{display:flex;flex-direction:column;justify-content:space-around;height:auto;padding:20px 24px 20px 24px;border:1px solid #CCCC;writing-mode:horizontal-tb;gap:16px;border-top:1px solid #ccc !important;border-bottom:1px solid #ccc !important}.crm-phone-form{display:flex;flex-direction:column;height:100%;gap:16px}.crm-subtitle{font-size:14px;color:var(--crm-btn)}.crm-title{font-weight:700;line-height:20px;color:#262626;font-size:16px}.crm-message-info{color:#619013;font-weight:500;font-size:12px}.crm-message-error{color:#E11D48;font-weight:500;font-size:12px}";
|
7
7
|
const PhoneFormStyle0 = giftbackFormCss;
|
@@ -13,19 +13,22 @@ const PhoneForm = /*@__PURE__*/ proxyCustomElement(class PhoneForm extends H {
|
|
13
13
|
this.value = undefined;
|
14
14
|
this.loading = undefined;
|
15
15
|
this.handlerSubmit = undefined;
|
16
|
+
this.config = undefined;
|
16
17
|
}
|
17
18
|
async handlePhone() {
|
18
19
|
const phone = await this.phoneInputMask.getPhone();
|
19
20
|
await this.handlerSubmit(phone);
|
20
21
|
}
|
21
22
|
render() {
|
22
|
-
|
23
|
+
var _a;
|
24
|
+
return (h(Host, { key: 'a1fa8f1b45d663be5a434ac12af569100ad05f99', class: "crm-phone-form" }, h("label", { key: 'b374c22ba75e76f482379a7bfc1d1c202e72d9a9', class: "crm-subtitle" }, "Digite o seu celular para verificar se h\u00E1 desconto dispon\u00EDvel nessa compra"), h("phone-input-mask", { key: 'f0816190a397e74a9afb6fc3fe90ee3b00eab3be', initialValue: this.value, ref: ref => this.phoneInputMask = ref }), h("crm-button", { key: '1102ce8d88adf95fb46e3e1eaaa34830ecaa0be5', txtBtn: ((_a = this.config) === null || _a === void 0 ? void 0 : _a.btnApplyBonusLabel) || "Avançar", loading: this.loading, onClick: () => this.handlePhone() })));
|
23
25
|
}
|
24
26
|
static get style() { return PhoneFormStyle0; }
|
25
27
|
}, [0, "phone-form", {
|
26
28
|
"value": [1],
|
27
29
|
"loading": [4],
|
28
|
-
"handlerSubmit": [16]
|
30
|
+
"handlerSubmit": [16],
|
31
|
+
"config": [16]
|
29
32
|
}]);
|
30
33
|
function defineCustomElement() {
|
31
34
|
if (typeof customElements === "undefined") {
|
@@ -59,4 +62,4 @@ defineCustomElement();
|
|
59
62
|
|
60
63
|
export { PhoneForm as P, defineCustomElement as d };
|
61
64
|
|
62
|
-
//# sourceMappingURL=p-
|
65
|
+
//# sourceMappingURL=p-9f68d2a1.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"p-9f68d2a1.js","mappings":";;;;;AAAA,MAAM,eAAe,GAAG,i9BAAi9B,CAAC;AAC1+B,wBAAe,eAAe;;MCMjB,SAAS;;;;;;;;;IAWlB,MAAM,WAAW;QAEb,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAA;QAElD,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;KACnC;IAGD,MAAM;;QACF,QACI,EAAC,IAAI,qDAAC,KAAK,EAAC,gBAAgB,IACxB,8DAAO,KAAK,EAAC,cAAc,2FAAoF,EAC/G,yEAAkB,YAAY,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,IAAI,IAAI,CAAC,cAAc,GAAG,GAAG,GAAI,EAErF,mEAAY,MAAM,EAAE,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,kBAAkB,KAAI,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,GAAK,CAC5H,EACV;KACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/giftback-form/giftback-form.css?tag=phone-form","src/components/giftback-form/subcomponents/phone-form/phone-form.tsx"],"sourcesContent":["* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\n:host {\n --crmfont-sizebodymd: 14px;\n --crmline-heightbodymd: 20px;\n --crmletter-spacingtitle-md: 0px\n}\n\n.container-message {\n font-family: Roboto;\n font-size: var(--crmfont-sizebodymd);\n font-weight: 400;\n line-height: var(--crmline-heightbodymd);\n letter-spacing: var(--crmletter-spacingtitle-md);\n text-align: left;\n text-underline-position: from-font;\n text-decoration-skip-ink: none;\n}\n\n.crm-container-form {\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n height: auto;\n padding: 20px 24px 20px 24px;\n border: 1px solid #CCCC;\n writing-mode: horizontal-tb;\n gap: 16px;\n border-top: 1px solid #ccc !important;\n border-bottom: 1px solid #ccc !important;\n}\n\n/* .fbits-responsive-carrinho-desconto {\n overflow: hidden;\n border: 1px solid #ccc;\n border-top: 0;\n border-bottom: 0;\n} */\n\n.crm-phone-form {\n display: flex;\n flex-direction: column;\n height: 100%;\n /* justify-content: space-around; */\n gap: 16px;\n}\n\n.crm-subtitle {\n font-size: 14px;\n color: var(--crm-btn);\n}\n\n.crm-title {\n font-weight: 700;\n line-height: 20px;\n color: #262626;\n font-size: 16px;\n}\n\n.crm-message-info {\n color: #619013;\n font-weight: 500;\n font-size: 12px;\n}\n\n.crm-message-error {\n color: #E11D48;\n font-weight: 500;\n font-size: 12px;\n}","import { Component, Host, Prop, h } from \"@stencil/core\";\nimport { IInfoStore } from \"../../../../helpers/info.config.helper\";\n\n@Component({\n tag: 'phone-form',\n styleUrl: '../../giftback-form.css'\n})\nexport class PhoneForm {\n\n private phoneInputMask: HTMLPhoneInputMaskElement;\n\n @Prop() value: string;\n @Prop() loading: boolean;\n @Prop() handlerSubmit: (phone: string) => void;\n\n @Prop() config: IInfoStore;\n\n\n async handlePhone() {\n\n const phone = await this.phoneInputMask.getPhone()\n\n await this.handlerSubmit(phone);\n }\n\n\n render() {\n return (\n <Host class=\"crm-phone-form\">\n <label class=\"crm-subtitle\" >Digite o seu celular para verificar se há desconto disponível nessa compra</label>\n <phone-input-mask initialValue={this.value} ref={ref => this.phoneInputMask = ref} />\n\n <crm-button txtBtn={this.config?.btnApplyBonusLabel || \"Avançar\"} loading={this.loading} onClick={() => this.handlePhone() } />\n </Host>\n )\n }\n}"],"version":3}
|