crmbonus-component-wake 0.0.26 → 1.0.27
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-globals-3a1e7e63.js +7 -0
- package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
- package/dist/cjs/app-modal_4.cjs.entry.js +152 -0
- package/dist/cjs/app-modal_4.cjs.entry.js.map +1 -0
- package/dist/cjs/crm-bonus.cjs.entry.js +86 -0
- package/dist/cjs/crm-bonus.cjs.entry.js.map +1 -0
- package/dist/cjs/crmbonus-component-wake.cjs.js +27 -0
- package/dist/cjs/crmbonus-component-wake.cjs.js.map +1 -0
- package/dist/cjs/crmbonus.service-8412ddbf.js +3798 -0
- package/dist/cjs/crmbonus.service-8412ddbf.js.map +1 -0
- package/dist/cjs/giftback-finish_3.cjs.entry.js +102 -0
- package/dist/cjs/giftback-finish_3.cjs.entry.js.map +1 -0
- package/dist/cjs/index-296f70bf.js +11 -0
- package/dist/cjs/index-296f70bf.js.map +1 -0
- package/dist/cjs/index-52d8a075.js +1248 -0
- package/dist/cjs/index-52d8a075.js.map +1 -0
- package/dist/cjs/index.cjs.js +11 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +17 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/loading-spinner.cjs.entry.js +24 -0
- package/dist/cjs/loading-spinner.cjs.entry.js.map +1 -0
- package/dist/cjs/pedido-finalizado.cjs.entry.js +36 -0
- package/dist/cjs/pedido-finalizado.cjs.entry.js.map +1 -0
- package/dist/cjs/phone-input-mask.cjs.entry.js +45 -0
- package/dist/cjs/phone-input-mask.cjs.entry.js.map +1 -0
- package/dist/collection/collection-manifest.json +22 -0
- package/dist/collection/components/crm-bonus/assets/logo.svg +18 -0
- package/dist/collection/components/crm-bonus/assets/success-svgrepo-com.svg +8 -0
- package/dist/collection/components/crm-bonus/assets/svg/logo.svg +18 -0
- package/dist/collection/components/crm-bonus/assets/svg/success-svgrepo-com.svg +8 -0
- package/dist/collection/components/crm-bonus/crm-bonus.css +50 -0
- package/dist/collection/components/crm-bonus/crm-bonus.js +170 -0
- package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.css +19 -0
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +311 -0
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.css +10 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js +20 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.css +74 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js +127 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css +109 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js +127 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js +75 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js +75 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js.map +1 -0
- package/dist/collection/components/loading-spinner/loading-spinner.css +17 -0
- package/dist/collection/components/loading-spinner/loading-spinner.js +63 -0
- package/dist/collection/components/loading-spinner/loading-spinner.js.map +1 -0
- package/dist/collection/components/modal/app-modal.css +45 -0
- package/dist/collection/components/modal/app-modal.js +83 -0
- package/dist/collection/components/modal/app-modal.js.map +1 -0
- package/dist/collection/components/pedido/pedido.js +83 -0
- package/dist/collection/components/pedido/pedido.js.map +1 -0
- package/dist/collection/components/phone/phone-input-mask.css +47 -0
- package/dist/collection/components/phone/phone-input-mask.js +108 -0
- package/dist/collection/components/phone/phone-input-mask.js.map +1 -0
- package/dist/collection/contants/index.js +8 -0
- package/dist/collection/contants/index.js.map +1 -0
- package/dist/collection/contants/mocks.js +28 -0
- package/dist/collection/contants/mocks.js.map +1 -0
- package/dist/collection/dto/pin.sent.js +2 -0
- package/dist/collection/dto/pin.sent.js.map +1 -0
- package/dist/collection/dto/update.order.dto.js +2 -0
- package/dist/collection/dto/update.order.dto.js.map +1 -0
- package/dist/collection/dto/validate.pin.bonus.js +2 -0
- package/dist/collection/dto/validate.pin.bonus.js.map +1 -0
- package/dist/collection/index.js +11 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/services/crmbonus.service.js +42 -0
- package/dist/collection/services/crmbonus.service.js.map +1 -0
- package/dist/collection/utils/utils.js +4 -0
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/components/app-modal.js +8 -0
- package/dist/components/app-modal.js.map +1 -0
- package/dist/components/crm-bonus-form.js +8 -0
- package/dist/components/crm-bonus-form.js.map +1 -0
- package/dist/components/crm-bonus.js +167 -0
- package/dist/components/crm-bonus.js.map +1 -0
- package/dist/components/giftback-finish.js +8 -0
- package/dist/components/giftback-finish.js.map +1 -0
- package/dist/components/giftback-pin.js +8 -0
- package/dist/components/giftback-pin.js.map +1 -0
- package/dist/components/giftback-progress.js +8 -0
- package/dist/components/giftback-progress.js.map +1 -0
- package/dist/components/index.js +9 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/loading-spinner.js +8 -0
- package/dist/components/loading-spinner.js.map +1 -0
- package/dist/components/p-03918b34.js +39 -0
- package/dist/components/p-03918b34.js.map +1 -0
- package/dist/components/p-2667d525.js +36 -0
- package/dist/components/p-2667d525.js.map +1 -0
- package/dist/components/p-28ba6192.js +52 -0
- package/dist/components/p-28ba6192.js.map +1 -0
- package/dist/{crmbonus-component-wake/crmbonus.service-5208f883.js → components/p-374de9ae.js} +91 -166
- package/dist/components/p-374de9ae.js.map +1 -0
- package/dist/{crmbonus-component-wake/giftback-pin.entry.js → components/p-3e80a758.js} +39 -9
- package/dist/components/p-3e80a758.js.map +1 -0
- package/dist/components/p-675deed3.js +62 -0
- package/dist/components/p-675deed3.js.map +1 -0
- package/dist/components/p-b4c3e6bf.js +156 -0
- package/dist/components/p-b4c3e6bf.js.map +1 -0
- package/dist/components/p-c5913818.js +69 -0
- package/dist/components/p-c5913818.js.map +1 -0
- package/dist/components/p-ed6bc79c.js +52 -0
- package/dist/components/p-ed6bc79c.js.map +1 -0
- package/dist/components/p-f6396f4c.js +43 -0
- package/dist/components/p-f6396f4c.js.map +1 -0
- package/dist/components/p-faf7103e.js +1064 -0
- package/dist/components/p-faf7103e.js.map +1 -0
- package/dist/components/pedido-finalizado.js +54 -0
- package/dist/components/pedido-finalizado.js.map +1 -0
- package/dist/components/phone-cancel-input.d.ts +11 -0
- package/dist/components/phone-cancel-input.js +8 -0
- package/dist/components/phone-cancel-input.js.map +1 -0
- package/dist/components/phone-input-mask.js +8 -0
- package/dist/components/phone-input-mask.js.map +1 -0
- package/dist/components/phone-input.js +8 -0
- package/dist/components/phone-input.js.map +1 -0
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -48
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
- package/dist/crmbonus-component-wake/index.esm.js +1 -16
- package/dist/crmbonus-component-wake/index.esm.js.map +1 -1
- package/dist/crmbonus-component-wake/p-075bd04d.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-075bd04d.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-241a5303.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-241a5303.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-374de9ae.js +2 -0
- package/dist/crmbonus-component-wake/p-374de9ae.js.map +1 -0
- package/dist/crmbonus-component-wake/p-72510682.js +3 -0
- package/dist/crmbonus-component-wake/p-72510682.js.map +1 -0
- package/dist/crmbonus-component-wake/p-86d04322.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-86d04322.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-8e6cdd1e.js +2 -0
- package/dist/crmbonus-component-wake/p-8e6cdd1e.js.map +1 -0
- package/dist/crmbonus-component-wake/p-a603a26e.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-a603a26e.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-e1255160.js +2 -0
- package/dist/crmbonus-component-wake/p-e1255160.js.map +1 -0
- package/dist/crmbonus-component-wake/p-e9c2ed46.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-e9c2ed46.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-ef75ecd5.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-ef75ecd5.entry.js.map +1 -0
- package/dist/env.js +5 -0
- package/dist/env.js.map +1 -0
- package/dist/esm/app-modal_4.entry.js +145 -0
- package/dist/esm/app-modal_4.entry.js.map +1 -0
- package/dist/esm/crm-bonus.entry.js +82 -0
- package/dist/esm/crm-bonus.entry.js.map +1 -0
- package/dist/esm/crmbonus-component-wake.js +22 -0
- package/dist/esm/crmbonus-component-wake.js.map +1 -0
- package/dist/esm/crmbonus.service-053a9e38.js +3796 -0
- package/dist/esm/crmbonus.service-053a9e38.js.map +1 -0
- package/dist/esm/giftback-finish_3.entry.js +96 -0
- package/dist/esm/giftback-finish_3.entry.js.map +1 -0
- package/dist/esm/index-2bfaba2b.js +11 -0
- package/dist/esm/index-2bfaba2b.js.map +1 -0
- package/dist/esm/index-9f7bde48.js +1220 -0
- package/dist/esm/index-9f7bde48.js.map +1 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +13 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/loading-spinner.entry.js +4 -3
- package/dist/esm/loading-spinner.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/pedido-finalizado.entry.js +3 -3
- package/dist/esm/pedido-finalizado.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/phone-input-mask.entry.js +5 -3
- package/dist/esm/phone-input-mask.entry.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/crm-bonus/crm-bonus.d.ts +9 -0
- package/dist/types/components/crm-bonus-form/crm-bonus-form.d.ts +8 -4
- package/dist/types/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.d.ts +1 -1
- package/dist/types/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.d.ts +8 -0
- package/dist/types/components/phone/phone-input-mask.d.ts +1 -0
- package/dist/types/components.d.ts +32 -0
- package/package.json +1 -1
- package/dist/crmbonus-component-wake/app-modal.entry.js +0 -23
- package/dist/crmbonus-component-wake/app-modal.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/crm-bonus-form.entry.js +0 -109
- package/dist/crmbonus-component-wake/crm-bonus-form.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/crm-bonus.entry.js +0 -50
- package/dist/crmbonus-component-wake/crm-bonus.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/crmbonus.service-5208f883.js.map +0 -1
- package/dist/crmbonus-component-wake/giftback-finish.entry.js +0 -19
- package/dist/crmbonus-component-wake/giftback-finish.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/giftback-pin.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/giftback-progress.entry.js +0 -40
- package/dist/crmbonus-component-wake/giftback-progress.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/index-f557ce7c.js +0 -3039
- package/dist/crmbonus-component-wake/index-f557ce7c.js.map +0 -1
- package/dist/crmbonus-component-wake/loading-spinner.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/pedido-finalizado.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/phone-input-mask.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/phone-input.entry.js +0 -21
- package/dist/crmbonus-component-wake/phone-input.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js +0 -334
- package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js.map +0 -1
- /package/dist/{crmbonus-component-wake → esm}/app-globals-0f993ce5.js +0 -0
- /package/dist/{crmbonus-component-wake → esm}/app-globals-0f993ce5.js.map +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"crm-bonus-form.js","sourceRoot":"","sources":["../../../../src/components/crm-bonus-form/crm-bonus-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,MAAM,OAAO,YAAY;;QAEb,oBAAe,GAAoB,IAAI,eAAe,EAAE,CAAC;;;;wBAKnC;YAC1B,KAAK,EAAE,EAAE;YACT,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,EAAE;SACX;;;;;;uBAS2B,KAAK;oBAET,YAAY,CAAC,YAAY;;;;IAOjD,KAAK,CAAC,OAAO,CAAC,IAAkB;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IACpB,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,GAAW;;QAClC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,MAAM,OAAO,GAAwB;YACjC,GAAG,EAAE,GAAG;YACR,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;YAChC,OAAO,EAAE,IAAI,CAAC,IAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Host, Method, Prop, State, h } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\nimport { IBonus, ICustomer, IProccesPinBonusDto, IProduct } from \"../../dto/validate.pin.bonus\";\nimport { StepFormEnum } from \"../../contants\";\nimport { IPinSent } from '../../dto/pin.sent';\n\n@Component({\n tag: 'crm-bonus-form',\n styleUrl: 'crm-bonus-form.css',\n shadow: true\n})\nexport class CrmBonusForm {\n\n private crmBonusService: CrmBonusService = new CrmBonusService();\n\n @Prop({ attribute: 'storename' }) storeName;\n @Prop() cartId;\n @Prop() products: Array<IProduct>;\n @Prop() customer: ICustomer = {\n phone: \"\",\n birthDate: \"\",\n document: \"\",\n name: \"\"\n };\n @Prop() sent: IPinSent;\n @Prop() stepNext: StepFormEnum;\n @Prop() phone: number;\n\n @Prop() saveStore: () => void;\n\n @Prop() cancel: () => void;\n\n @State() loading: boolean = false;\n\n @State() step: number = StepFormEnum.STEP_RESERVE;\n\n @State() message: string;\n\n @State() bonus: IBonus;\n\n @Method()\n async setStep(step: StepFormEnum) {\n this.step = step\n }\n\n public async validateBonus(pin: string) {\n this.loading = true;\n this.message = \"\";\n const payload: IProccesPinBonusDto = {\n pin: pin,\n cellphone: this.phone.toString(),\n loja_id: this.sent.storeId,\n user_id: this.sent.userId,\n cartId: this.cartId,\n products: this.products\n }\n\n try {\n this.bonus = await this.crmBonusService.validatePinBonus(payload, this.storeName);\n\n console.log('[this.bonus]', this.bonus);\n this.step = StepFormEnum.STEP_RESERVE;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false;\n }\n console.log('payload', payload)\n }\n\n public async reserveApply(amount: number) {\n this.loading = true;\n this.message = \"\";\n try {\n await this.reserve(amount);\n\n this.step = StepFormEnum.STEP_APPLY;\n\n this.saveStore()\n } catch (error) {\n this.message = \"ocorreu um error ao solicitar a aplicação do bonus! tente novamente\"\n } finally {\n this.loading = false;\n }\n }\n\n public async reserve(amount: number) {\n await this.crmBonusService.reserve({\n redeemed_bonus: amount,\n cart_id: this.cartId,\n ticket: this.cartId,\n gross_value: this.bonus.totalValue,\n }, this.storeName);\n }\n\n public handleCancel() {\n this.step = StepFormEnum.STEP_PHONE;\n this.cancel()\n }\n\n render() {\n return (\n <Host>\n {/* {this.step === StepFormEnum.STEP_PHONE && <phone-input value={this.customer.phone} sendPin={(phone) => this.sendPin(phone)} loading={this.loading} />} */}\n {this.step === StepFormEnum.STEP_PIN && <giftback-pin cancel={() => this.handleCancel()} sent={this.sent} validate={(data) => this.validateBonus(data)} loading={this.loading} />}\n\n {this.step === StepFormEnum.STEP_RESERVE && <giftback-progress loading={this.loading} cancel={() => this.handleCancel()} bonus={this.bonus} reserve={(amountRedeemed: number) => this.reserveApply(amountRedeemed)} />}\n {this.step === StepFormEnum.STEP_APPLY && <giftback-finish />}\n <p class=\"message-error\">{this.message}</p>\n </Host>\n )\n }\n}"]}
|
package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
import { h } from "@stencil/core";
|
2
|
+
import success from "../../../crm-bonus/assets/svg/success-svgrepo-com.svg";
|
3
|
+
export class GiftbackFinish {
|
4
|
+
render() {
|
5
|
+
return (h("div", { key: '4fd9a7731194fbe8e9dbe0e2fc9d4241f0baf733', class: "message-finish" }, h("img", { key: 'ba423d92f1672f14be34334fd0495f38f1f70f4a', src: success, width: 80 }), h("p", { key: '75d6b9648c1357ced70ad43cb94091da73224179' }, "Legal! O B\u00F4nus ser\u00E1 aplicado na sua compra.")));
|
6
|
+
}
|
7
|
+
static get is() { return "giftback-finish"; }
|
8
|
+
static get encapsulation() { return "shadow"; }
|
9
|
+
static get originalStyleUrls() {
|
10
|
+
return {
|
11
|
+
"$": ["giftback-finish.css"]
|
12
|
+
};
|
13
|
+
}
|
14
|
+
static get styleUrls() {
|
15
|
+
return {
|
16
|
+
"$": ["giftback-finish.css"]
|
17
|
+
};
|
18
|
+
}
|
19
|
+
}
|
20
|
+
//# sourceMappingURL=giftback-finish.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"giftback-finish.js","sourceRoot":"","sources":["../../../../../../src/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,OAAO,MAAM,uDAAuD,CAAA;AAO3E,MAAM,OAAO,cAAc;IACvB,MAAM;QACF,OAAO,CACH,4DAAK,KAAK,EAAC,gBAAgB;YACvB,4DAAK,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,GAAI;YAChC,oHAAkD,CAChD,CACT,CAAA;IACL,CAAC;;;;;;;;;CACJ","sourcesContent":["import { Component, h } from \"@stencil/core\";\nimport success from '../../../crm-bonus/assets/svg/success-svgrepo-com.svg'\n\n@Component({\n tag: 'giftback-finish',\n styleUrl: 'giftback-finish.css',\n shadow: true\n})\nexport class GiftbackFinish {\n render() {\n return (\n <div class=\"message-finish\">\n <img src={success} width={80} />\n <p>Legal! O Bônus será aplicado na sua compra.</p>\n </div>\n )\n }\n}"]}
|
@@ -0,0 +1,74 @@
|
|
1
|
+
:host {
|
2
|
+
display: block;
|
3
|
+
font-family: Arial, sans-serif;
|
4
|
+
}
|
5
|
+
|
6
|
+
.form-container-pin {
|
7
|
+
display: flex;
|
8
|
+
flex-direction: column;
|
9
|
+
align-items: center;
|
10
|
+
}
|
11
|
+
|
12
|
+
.pin-container {
|
13
|
+
display: flex;
|
14
|
+
gap: 10px;
|
15
|
+
margin: 26px 0;
|
16
|
+
}
|
17
|
+
|
18
|
+
input {
|
19
|
+
width: 58px;
|
20
|
+
height: 40px;
|
21
|
+
font-size: 18px;
|
22
|
+
text-align: center;
|
23
|
+
border: 1px solid #ccc;
|
24
|
+
border-radius: 5px;
|
25
|
+
}
|
26
|
+
|
27
|
+
button {
|
28
|
+
padding: 10px 20px;
|
29
|
+
background-color: #ddd;
|
30
|
+
border: none;
|
31
|
+
border-radius: 5px;
|
32
|
+
cursor: pointer;
|
33
|
+
}
|
34
|
+
|
35
|
+
button:hover {
|
36
|
+
background-color: #bbb;
|
37
|
+
}
|
38
|
+
|
39
|
+
.success {
|
40
|
+
color: green;
|
41
|
+
margin-top: 10px;
|
42
|
+
}
|
43
|
+
|
44
|
+
.button {
|
45
|
+
top: 50%;
|
46
|
+
background-color: #6c6c7e;
|
47
|
+
color: #fff;
|
48
|
+
border: none;
|
49
|
+
border-radius: 10px;
|
50
|
+
padding: 15px;
|
51
|
+
min-height: 30px;
|
52
|
+
min-width: 120px;
|
53
|
+
font-size: 20px;
|
54
|
+
cursor: pointer;
|
55
|
+
}
|
56
|
+
|
57
|
+
.button-cancel {
|
58
|
+
top: 50%;
|
59
|
+
background-color: #ffffff;
|
60
|
+
color: #1e1c1c;
|
61
|
+
border: 1px solid gray;
|
62
|
+
border-radius: 10px;
|
63
|
+
padding: 10px;
|
64
|
+
min-height: 30px;
|
65
|
+
min-width: 120px;
|
66
|
+
font-size: 19px;
|
67
|
+
cursor: pointer;
|
68
|
+
}
|
69
|
+
|
70
|
+
.footer-button {
|
71
|
+
display: flex;
|
72
|
+
justify-content: space-between;
|
73
|
+
width: 100%;
|
74
|
+
}
|
@@ -0,0 +1,127 @@
|
|
1
|
+
import { h } from "@stencil/core";
|
2
|
+
export class GiftbackPin {
|
3
|
+
constructor() {
|
4
|
+
this.sent = undefined;
|
5
|
+
this.validate = undefined;
|
6
|
+
this.cancel = undefined;
|
7
|
+
this.pin = ['', '', '', ''];
|
8
|
+
this.isVerified = false;
|
9
|
+
this.loading = false;
|
10
|
+
}
|
11
|
+
handleInput(event, index) {
|
12
|
+
const input = event.target;
|
13
|
+
const value = input.value.slice(0, 1); // Limitar a um único dígito
|
14
|
+
this.pin[index] = value;
|
15
|
+
// Focar no próximo campo, se possível
|
16
|
+
if (value && index < this.pin.length - 1) {
|
17
|
+
const nextInput = input.nextElementSibling;
|
18
|
+
nextInput === null || nextInput === void 0 ? void 0 : nextInput.focus();
|
19
|
+
}
|
20
|
+
this.pin = [...this.pin];
|
21
|
+
}
|
22
|
+
validatePin() {
|
23
|
+
console.log('this.pin', this.pin);
|
24
|
+
this.validate(this.pin.join(""));
|
25
|
+
}
|
26
|
+
verifyPin() {
|
27
|
+
const pinCode = this.pin.join('');
|
28
|
+
if (pinCode === '9999') {
|
29
|
+
this.isVerified = true;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
render() {
|
33
|
+
return (h("div", { key: 'eb95118bcc7de8cf50c3ffa97656e5635a9b72de', class: "form-container-pin" }, h("div", { key: 'cc149d68ccf12e688fe477079c15931ce0ea6536' }, h("p", { key: 'fbcbb77d526981fca9129e2a1acbc55eba5c9d33' }, "Insira o PIN de 4 d\u00EDgitos enviado por SMS."), h("div", { key: 'ac9887bbc7ef732fd95c890b459b8962652c6fef', 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: 'ca835c16a8aa1177c80cc37f43faaa2f1a7af025', class: "footer-button" }, h("button", { key: '6eabe644de6085a1780bec151503c09aa123e459', class: "button-cancel", disabled: this.loading, onClick: () => this.cancel() }, "Cancelar"), h("button", { key: '2b6dd05d209e86ce5dc0d1113b38b16d541e107f', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePin() }, !this.loading ? "Enviar" : h("loading-spinner", { size: "15px", color: "#fff" })))));
|
34
|
+
}
|
35
|
+
static get is() { return "giftback-pin"; }
|
36
|
+
static get encapsulation() { return "shadow"; }
|
37
|
+
static get originalStyleUrls() {
|
38
|
+
return {
|
39
|
+
"$": ["giftback-pin.css"]
|
40
|
+
};
|
41
|
+
}
|
42
|
+
static get styleUrls() {
|
43
|
+
return {
|
44
|
+
"$": ["giftback-pin.css"]
|
45
|
+
};
|
46
|
+
}
|
47
|
+
static get properties() {
|
48
|
+
return {
|
49
|
+
"sent": {
|
50
|
+
"type": "unknown",
|
51
|
+
"mutable": false,
|
52
|
+
"complexType": {
|
53
|
+
"original": "IPinSent",
|
54
|
+
"resolved": "IPinSent",
|
55
|
+
"references": {
|
56
|
+
"IPinSent": {
|
57
|
+
"location": "import",
|
58
|
+
"path": "../../../../dto/pin.sent",
|
59
|
+
"id": "src/dto/pin.sent.ts::IPinSent"
|
60
|
+
}
|
61
|
+
}
|
62
|
+
},
|
63
|
+
"required": false,
|
64
|
+
"optional": false,
|
65
|
+
"docs": {
|
66
|
+
"tags": [],
|
67
|
+
"text": ""
|
68
|
+
}
|
69
|
+
},
|
70
|
+
"validate": {
|
71
|
+
"type": "unknown",
|
72
|
+
"mutable": false,
|
73
|
+
"complexType": {
|
74
|
+
"original": "(pin: string) => void",
|
75
|
+
"resolved": "(pin: string) => void",
|
76
|
+
"references": {}
|
77
|
+
},
|
78
|
+
"required": false,
|
79
|
+
"optional": false,
|
80
|
+
"docs": {
|
81
|
+
"tags": [],
|
82
|
+
"text": ""
|
83
|
+
}
|
84
|
+
},
|
85
|
+
"cancel": {
|
86
|
+
"type": "unknown",
|
87
|
+
"mutable": false,
|
88
|
+
"complexType": {
|
89
|
+
"original": "() => void",
|
90
|
+
"resolved": "() => void",
|
91
|
+
"references": {}
|
92
|
+
},
|
93
|
+
"required": false,
|
94
|
+
"optional": false,
|
95
|
+
"docs": {
|
96
|
+
"tags": [],
|
97
|
+
"text": ""
|
98
|
+
}
|
99
|
+
},
|
100
|
+
"loading": {
|
101
|
+
"type": "boolean",
|
102
|
+
"mutable": false,
|
103
|
+
"complexType": {
|
104
|
+
"original": "boolean",
|
105
|
+
"resolved": "boolean",
|
106
|
+
"references": {}
|
107
|
+
},
|
108
|
+
"required": false,
|
109
|
+
"optional": false,
|
110
|
+
"docs": {
|
111
|
+
"tags": [],
|
112
|
+
"text": ""
|
113
|
+
},
|
114
|
+
"attribute": "loading",
|
115
|
+
"reflect": false,
|
116
|
+
"defaultValue": "false"
|
117
|
+
}
|
118
|
+
};
|
119
|
+
}
|
120
|
+
static get states() {
|
121
|
+
return {
|
122
|
+
"pin": {},
|
123
|
+
"isVerified": {}
|
124
|
+
};
|
125
|
+
}
|
126
|
+
}
|
127
|
+
//# sourceMappingURL=giftback-pin.js.map
|
package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"giftback-pin.js","sourceRoot":"","sources":["../../../../../../src/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAQ1D,MAAM,OAAO,WAAW;;;;;mBAMK,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;0BACV,KAAK;uBAET,KAAK;;IAEhC,WAAW,CAAC,KAAY,EAAE,KAAa;QACnC,MAAM,KAAK,GAAG,KAAK,CAAC,MAA0B,CAAC;QAC/C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,4BAA4B;QACnE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;QAExB,sCAAsC;QACtC,IAAI,KAAK,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvC,MAAM,SAAS,GAAG,KAAK,CAAC,kBAAsC,CAAC;YAC/D,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,EAAE,CAAC;QACvB,CAAC;QAED,IAAI,CAAC,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,G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AAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,uBAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAEtE,CACP,CAGJ,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Prop, State } from '@stencil/core';\nimport { IPinSent } from '../../../../dto/pin.sent';\n\n@Component({\n tag: 'giftback-pin',\n styleUrl: 'giftback-pin.css',\n shadow: true,\n})\nexport class GiftbackPin {\n\n @Prop() sent: IPinSent;\n @Prop() validate: (pin: string) => void;\n @Prop() cancel: () => void;\n\n @State() pin: string[] = ['', '', '', ''];\n @State() isVerified: boolean = false;\n\n @Prop() loading: boolean = false;\n\n handleInput(event: Event, index: number) {\n const input = event.target as HTMLInputElement;\n const value = input.value.slice(0, 1); // Limitar a um único dígito\n this.pin[index] = value;\n\n // Focar no próximo campo, se possível\n if (value && index < this.pin.length - 1) {\n const nextInput = input.nextElementSibling as HTMLInputElement;\n nextInput?.focus();\n }\n\n this.pin = [...this.pin];\n }\n\n validatePin() {\n console.log('this.pin', this.pin);\n this.validate(this.pin.join(\"\"))\n }\n\n verifyPin() {\n const pinCode = this.pin.join('');\n if (pinCode === '9999') {\n this.isVerified = true;\n }\n }\n\n render() {\n return (\n <div class=\"form-container-pin\">\n <div >\n <p>Insira o PIN de 4 dígitos enviado por SMS.</p>\n <div class=\"pin-container\">\n {this.pin.map((_, index) => (\n <input\n type=\"text\"\n maxLength={1}\n value={this.pin[index]}\n onInput={(event) => this.handleInput(event, index)}\n />\n ))}\n </div>\n </div>\n\n <div class=\"footer-button\">\n <button class=\"button-cancel\" disabled={this.loading} onClick={() => this.cancel()}>\n Cancelar\n </button>\n <button class={`button ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePin()}>\n {\n !this.loading ? \"Enviar\" : <loading-spinner size=\"15px\" color=\"#fff\" />\n }\n </button>\n </div>\n {/* <button onClick={() => this.verifyPin()}>Enviar</button>\n {this.isVerified && <p class=\"success\">Código verificado com sucesso!</p>} */}\n </div>\n );\n }\n}\n"]}
|
@@ -0,0 +1,109 @@
|
|
1
|
+
:host {
|
2
|
+
display: flex;
|
3
|
+
font-family: Arial, sans-serif;
|
4
|
+
/* background-color: #f8f4eb; */
|
5
|
+
border-radius: 10px;
|
6
|
+
padding: 16px;
|
7
|
+
/* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
|
8
|
+
max-width: 100%;
|
9
|
+
flex-direction: column;
|
10
|
+
}
|
11
|
+
|
12
|
+
.giftback-container {
|
13
|
+
display: flex;
|
14
|
+
flex-direction: column;
|
15
|
+
}
|
16
|
+
|
17
|
+
.giftback-container p {
|
18
|
+
font-size: medium;
|
19
|
+
}
|
20
|
+
|
21
|
+
h3 {
|
22
|
+
margin: 0 0 10px;
|
23
|
+
font-size: 18px;
|
24
|
+
}
|
25
|
+
|
26
|
+
p {
|
27
|
+
margin: 5px 0;
|
28
|
+
font-size: 14px;
|
29
|
+
align-self: start;
|
30
|
+
}
|
31
|
+
|
32
|
+
.validity {
|
33
|
+
font-size: 12px;
|
34
|
+
color: #888;
|
35
|
+
}
|
36
|
+
|
37
|
+
.progress-container {
|
38
|
+
display: flex;
|
39
|
+
align-items: center;
|
40
|
+
margin: 10px 0;
|
41
|
+
}
|
42
|
+
|
43
|
+
progress-container span {
|
44
|
+
font-size: 12px;
|
45
|
+
color: #666;
|
46
|
+
}
|
47
|
+
|
48
|
+
input[type='range'] {
|
49
|
+
flex: 1;
|
50
|
+
margin: 0 10px;
|
51
|
+
appearance: none;
|
52
|
+
background-color: #ccc;
|
53
|
+
height: 6px;
|
54
|
+
border-radius: 3px;
|
55
|
+
outline: none;
|
56
|
+
cursor: pointer;
|
57
|
+
}
|
58
|
+
|
59
|
+
input[type='range']::-webkit-slider-thumb {
|
60
|
+
appearance: none;
|
61
|
+
width: 14px;
|
62
|
+
height: 14px;
|
63
|
+
border-radius: 50%;
|
64
|
+
background-color: #555;
|
65
|
+
cursor: pointer;
|
66
|
+
}
|
67
|
+
|
68
|
+
.remaining {
|
69
|
+
font-weight: bold;
|
70
|
+
font-size: 14px;
|
71
|
+
color: #333;
|
72
|
+
}
|
73
|
+
|
74
|
+
.button {
|
75
|
+
top: 50%;
|
76
|
+
background-color: #6c6c7e;
|
77
|
+
color: #fff;
|
78
|
+
border: none;
|
79
|
+
border-radius: 10px;
|
80
|
+
padding: 10px;
|
81
|
+
min-height: 30px;
|
82
|
+
min-width: 120px;
|
83
|
+
font-size: 19px;
|
84
|
+
cursor: pointer;
|
85
|
+
}
|
86
|
+
|
87
|
+
.button-cancel {
|
88
|
+
top: 50%;
|
89
|
+
background-color: #ffffff;
|
90
|
+
color: #1e1c1c;
|
91
|
+
border: 1px solid gray;
|
92
|
+
border-radius: 10px;
|
93
|
+
padding: 10px;
|
94
|
+
min-height: 30px;
|
95
|
+
min-width: 120px;
|
96
|
+
font-size: 19px;
|
97
|
+
cursor: pointer;
|
98
|
+
}
|
99
|
+
|
100
|
+
.disabled {
|
101
|
+
opacity: 0.6;
|
102
|
+
cursor: not-allowed;
|
103
|
+
}
|
104
|
+
|
105
|
+
.footer-button-giftback {
|
106
|
+
display: flex;
|
107
|
+
justify-content: space-between;
|
108
|
+
margin-top: 14px;
|
109
|
+
}
|
@@ -0,0 +1,127 @@
|
|
1
|
+
import { h } from "@stencil/core";
|
2
|
+
export class GiftbackProgress {
|
3
|
+
constructor() {
|
4
|
+
this.usedValue = 0;
|
5
|
+
this.loading = false;
|
6
|
+
this.bonus = {
|
7
|
+
totalBonus: 0,
|
8
|
+
cartId: "",
|
9
|
+
minimumPurchase: 0,
|
10
|
+
bonusBalance: 0,
|
11
|
+
calculatedValue: 0,
|
12
|
+
firstValidityDate: ""
|
13
|
+
};
|
14
|
+
this.reserve = undefined;
|
15
|
+
this.cancel = undefined;
|
16
|
+
}
|
17
|
+
componentWillLoad() {
|
18
|
+
this.usedValue = parseFloat(this.bonus.bonusBalance.toString());
|
19
|
+
}
|
20
|
+
handleSliderChange(event) {
|
21
|
+
const input = event.target;
|
22
|
+
this.usedValue = parseFloat(input.value);
|
23
|
+
}
|
24
|
+
async handleReserve(value) {
|
25
|
+
this.reserve(value);
|
26
|
+
}
|
27
|
+
render() {
|
28
|
+
const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;
|
29
|
+
return (h("div", { key: 'e6f36ce0f31f70d5402cf89f20b54b7d4f4de7f6', class: "giftback-container" }, h("p", { key: '6075406b5eaefb21357161f6980bf6a0e709b98c' }, "Voc\u00EA possui at\u00E9 ", h("strong", { key: 'f80192384fe4b189469fb7ee16de266270a8e30c' }, "R$ ", this.bonus.totalBonus.toFixed(2)), " de Giftback nessa compra!"), h("p", { key: '453c0a71fe2f8cb2ebf9a6e6b8b55397ee3a9d5b', class: "validity" }, "V\u00E1lido at\u00E9: ", new Date(this.bonus.firstValidityDate).toLocaleDateString('pt-Br')), h("p", { key: 'ae7d8bbdb67801ff3b336ce9bcafb381a52c41e1' }, "Voc\u00EA est\u00E1 utilizando ", h("strong", { key: '7aa9370121720872deddd9596edbf841ccb4119b' }, "R$ ", this.usedValue.toFixed(2)), " nessa compra"), h("div", { key: '010aac89dd4192cc992d342fc334f6719620663e', class: "progress-container" }, h("span", { key: 'b2d0ee511ef6e32cdefeadcb0d740682c6da5124' }, "R$ 0"), h("input", { key: '3b659919ff940fa353c819fbc395c5fd15ad386b', disabled: true, type: "range", min: "0", step: "0.01", max: this.bonus.totalBonus, value: this.usedValue, onInput: (event) => this.handleSliderChange(event) }), h("span", { key: '60e99bf9891b4172f68f8abfbcdf18175a0cc6b0' }, "R$ ", this.bonus.totalBonus.toFixed(2))), h("p", { key: '07d1bd092cf438bb2e6b1ca0838d4215e73c4ef0', class: "remaining" }, "Faltam ", h("strong", { key: '180966167d48f8ea247ea785a4d35d37c6b5944b' }, "R$ ", remainingGiftback > 0 ? remainingGiftback.toFixed(2) : Number(0).toFixed(2)), " para utilizar o valor total do Giftback."), h("div", { key: '277aed85f840f66a517fa23849dadacddda43f5a', class: "footer-button-giftback" }, h("button", { key: '30c0779c496b54b86e0c4025528aa1e348f69c1c', class: "button-cancel", disabled: this.loading, onClick: () => this.cancel() }, "Cancelar"), h("button", { key: 'ec7e9d6982c5910b8c6fc9fef7310072a07d00c1', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.handleReserve(this.usedValue) }, !this.loading ? "Aplicar" : h("loading-spinner", { size: "10px", color: "#fff" })))));
|
30
|
+
}
|
31
|
+
static get is() { return "giftback-progress"; }
|
32
|
+
static get encapsulation() { return "shadow"; }
|
33
|
+
static get originalStyleUrls() {
|
34
|
+
return {
|
35
|
+
"$": ["giftback-progress.css"]
|
36
|
+
};
|
37
|
+
}
|
38
|
+
static get styleUrls() {
|
39
|
+
return {
|
40
|
+
"$": ["giftback-progress.css"]
|
41
|
+
};
|
42
|
+
}
|
43
|
+
static get properties() {
|
44
|
+
return {
|
45
|
+
"loading": {
|
46
|
+
"type": "boolean",
|
47
|
+
"mutable": false,
|
48
|
+
"complexType": {
|
49
|
+
"original": "boolean",
|
50
|
+
"resolved": "boolean",
|
51
|
+
"references": {}
|
52
|
+
},
|
53
|
+
"required": false,
|
54
|
+
"optional": false,
|
55
|
+
"docs": {
|
56
|
+
"tags": [],
|
57
|
+
"text": ""
|
58
|
+
},
|
59
|
+
"attribute": "loading",
|
60
|
+
"reflect": false,
|
61
|
+
"defaultValue": "false"
|
62
|
+
},
|
63
|
+
"bonus": {
|
64
|
+
"type": "unknown",
|
65
|
+
"mutable": false,
|
66
|
+
"complexType": {
|
67
|
+
"original": "Partial<IBonus>",
|
68
|
+
"resolved": "{ hasBonus?: boolean; bonusBalance?: number; totalBonus?: number; minimumPurchase?: number; bonusIds?: string; firstValidityDate?: string; history?: [{ validityStart: string; validityEnd: string; value: number; }, { validityStart: string; validityEnd: string; value: number; }]; storeId?: number; userId?: number; cartId?: string; calculatedValue?: number; totalValue?: number; }",
|
69
|
+
"references": {
|
70
|
+
"Partial": {
|
71
|
+
"location": "global",
|
72
|
+
"id": "global::Partial"
|
73
|
+
},
|
74
|
+
"IBonus": {
|
75
|
+
"location": "import",
|
76
|
+
"path": "../../../../dto/validate.pin.bonus",
|
77
|
+
"id": "src/dto/validate.pin.bonus.ts::IBonus"
|
78
|
+
}
|
79
|
+
}
|
80
|
+
},
|
81
|
+
"required": false,
|
82
|
+
"optional": false,
|
83
|
+
"docs": {
|
84
|
+
"tags": [],
|
85
|
+
"text": ""
|
86
|
+
},
|
87
|
+
"defaultValue": "{\n totalBonus: 0,\n cartId: \"\",\n minimumPurchase: 0,\n bonusBalance: 0,\n calculatedValue: 0,\n firstValidityDate: \"\"\n }"
|
88
|
+
},
|
89
|
+
"reserve": {
|
90
|
+
"type": "unknown",
|
91
|
+
"mutable": false,
|
92
|
+
"complexType": {
|
93
|
+
"original": "(amountRedeemed: number) => void",
|
94
|
+
"resolved": "(amountRedeemed: number) => void",
|
95
|
+
"references": {}
|
96
|
+
},
|
97
|
+
"required": false,
|
98
|
+
"optional": false,
|
99
|
+
"docs": {
|
100
|
+
"tags": [],
|
101
|
+
"text": ""
|
102
|
+
}
|
103
|
+
},
|
104
|
+
"cancel": {
|
105
|
+
"type": "unknown",
|
106
|
+
"mutable": false,
|
107
|
+
"complexType": {
|
108
|
+
"original": "() => void",
|
109
|
+
"resolved": "() => void",
|
110
|
+
"references": {}
|
111
|
+
},
|
112
|
+
"required": false,
|
113
|
+
"optional": false,
|
114
|
+
"docs": {
|
115
|
+
"tags": [],
|
116
|
+
"text": ""
|
117
|
+
}
|
118
|
+
}
|
119
|
+
};
|
120
|
+
}
|
121
|
+
static get states() {
|
122
|
+
return {
|
123
|
+
"usedValue": {}
|
124
|
+
};
|
125
|
+
}
|
126
|
+
}
|
127
|
+
//# sourceMappingURL=giftback-progress.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"giftback-progress.js","sourceRoot":"","sources":["../../../../../../src/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAQ1D,MAAM,OAAO,gBAAgB;;yBACI,CAAC;uBAEH,KAAK;qBAEC;YAC7B,UAAU,EAAE,CAAC;YACb,MAAM,EAAE,EAAE;YACV,eAAe,EAAE,CAAC;YAClB,YAAY,EAAE,CAAC;YACf,eAAe,EAAE,CAAC;YAClB,iBAAiB,EAAE,EAAE;SACxB;;;;IAKD,iBAAiB;QACb,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,kBAAkB,CAAC,KAAY;QAC3B,MAAM,KAAK,GAAG,KAAK,CAAC,MAA0B,CAAC;QAC/C,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,KAAa;QAC7B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAED,MAAM;QACF,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC;QAE7E,OAAO,CACH,4DAAK,KAAK,EAAC,oBAAoB;YAC3B;;gBACoB;;oBAAY,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAU;6CACtE;YACJ,0DAAG,KAAK,EAAC,UAAU;;gBAAc,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAK;YAExG;;gBAAwB;;oBAAY,IAAI,CAAC,SAAS,C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, State, Prop } from '@stencil/core';\nimport { IBonus } from '../../../../dto/validate.pin.bonus';\n\n@Component({\n tag: 'giftback-progress',\n styleUrl: 'giftback-progress.css',\n shadow: true,\n})\nexport class GiftbackProgress {\n @State() usedValue: number = 0;\n\n @Prop() loading: boolean = false;\n\n @Prop() bonus: Partial<IBonus> = {\n totalBonus: 0,\n cartId: \"\",\n minimumPurchase: 0,\n bonusBalance: 0,\n calculatedValue: 0,\n firstValidityDate: \"\"\n };\n\n @Prop() reserve: (amountRedeemed: number) => void;\n @Prop() cancel: () => void;\n\n componentWillLoad() {\n this.usedValue = parseFloat(this.bonus.bonusBalance.toString());\n }\n\n handleSliderChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.usedValue = parseFloat(input.value);\n }\n\n async handleReserve(value: number) {\n this.reserve(value);\n }\n\n render() {\n const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;\n\n return (\n <div class=\"giftback-container\">\n <p>\n Você possui até <strong>R$ {this.bonus.totalBonus.toFixed(2)}</strong> de Giftback nessa compra!\n </p>\n <p class=\"validity\">Válido até: {new Date(this.bonus.firstValidityDate).toLocaleDateString('pt-Br')}</p>\n\n <p>Você está utilizando <strong>R$ {this.usedValue.toFixed(2)}</strong> nessa compra</p>\n\n <div class=\"progress-container\">\n <span>R$ 0</span>\n <input\n disabled\n type=\"range\"\n min=\"0\"\n step=\"0.01\"\n max={this.bonus.totalBonus}\n value={this.usedValue}\n onInput={(event) => this.handleSliderChange(event)}\n />\n <span>R$ {this.bonus.totalBonus.toFixed(2)}</span>\n </div>\n\n <p class=\"remaining\">\n Faltam <strong>R$ {remainingGiftback > 0 ? remainingGiftback.toFixed(2) : Number(0).toFixed(2)}</strong> para utilizar o valor total do Giftback.\n </p>\n\n <div class=\"footer-button-giftback\">\n\n <button class=\"button-cancel\" disabled={this.loading} onClick={() => this.cancel()} >\n Cancelar\n </button>\n\n <button class={`button ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.handleReserve(this.usedValue)}>\n {\n !this.loading ? \"Aplicar\" : <loading-spinner size=\"10px\" color=\"#fff\" />\n }\n </button>\n </div>\n </div>\n );\n }\n}\n"]}
|
@@ -0,0 +1,75 @@
|
|
1
|
+
import { h } from "@stencil/core";
|
2
|
+
export class PhoneInput {
|
3
|
+
constructor() {
|
4
|
+
this.sendPin = undefined;
|
5
|
+
this.loading = undefined;
|
6
|
+
this.value = undefined;
|
7
|
+
}
|
8
|
+
async validatePhone() {
|
9
|
+
const phone = await this.phoneInputMask.getPhone();
|
10
|
+
await this.sendPin(phone);
|
11
|
+
}
|
12
|
+
render() {
|
13
|
+
return (h("div", { key: 'f24f14d158d9565b17aa024837d4e62e6b64c7a3', class: "form-container" }, h("phone-input-mask", { key: '88bf98c7f35b4a4211354a826fa16c922838d228', initialValue: this.value, ref: ref => this.phoneInputMask = ref }), h("button", { key: '34fe30a30fd755b3b710c9b00f6d511eeef70013', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, !this.loading ? "validar" : h("loading-spinner", { size: "25px", color: "#fff" }))));
|
14
|
+
}
|
15
|
+
static get is() { return "phone-input"; }
|
16
|
+
static get properties() {
|
17
|
+
return {
|
18
|
+
"sendPin": {
|
19
|
+
"type": "unknown",
|
20
|
+
"mutable": false,
|
21
|
+
"complexType": {
|
22
|
+
"original": "Function",
|
23
|
+
"resolved": "Function",
|
24
|
+
"references": {
|
25
|
+
"Function": {
|
26
|
+
"location": "global",
|
27
|
+
"id": "global::Function"
|
28
|
+
}
|
29
|
+
}
|
30
|
+
},
|
31
|
+
"required": false,
|
32
|
+
"optional": false,
|
33
|
+
"docs": {
|
34
|
+
"tags": [],
|
35
|
+
"text": ""
|
36
|
+
}
|
37
|
+
},
|
38
|
+
"loading": {
|
39
|
+
"type": "boolean",
|
40
|
+
"mutable": false,
|
41
|
+
"complexType": {
|
42
|
+
"original": "boolean",
|
43
|
+
"resolved": "boolean",
|
44
|
+
"references": {}
|
45
|
+
},
|
46
|
+
"required": false,
|
47
|
+
"optional": false,
|
48
|
+
"docs": {
|
49
|
+
"tags": [],
|
50
|
+
"text": ""
|
51
|
+
},
|
52
|
+
"attribute": "loading",
|
53
|
+
"reflect": false
|
54
|
+
},
|
55
|
+
"value": {
|
56
|
+
"type": "string",
|
57
|
+
"mutable": false,
|
58
|
+
"complexType": {
|
59
|
+
"original": "string",
|
60
|
+
"resolved": "string",
|
61
|
+
"references": {}
|
62
|
+
},
|
63
|
+
"required": false,
|
64
|
+
"optional": false,
|
65
|
+
"docs": {
|
66
|
+
"tags": [],
|
67
|
+
"text": ""
|
68
|
+
},
|
69
|
+
"attribute": "value",
|
70
|
+
"reflect": false
|
71
|
+
}
|
72
|
+
};
|
73
|
+
}
|
74
|
+
}
|
75
|
+
//# sourceMappingURL=phone.input.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"phone.input.js","sourceRoot":"","sources":["../../../../../../src/components/crm-bonus-form/subcomponents/phone/phone.input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAKnD,MAAM,OAAO,UAAU;;;;;;IAQnB,KAAK,CAAC,aAAa;QACf,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;QACnD,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM;QACF,OAAO,CACH,4DAAK,KAAK,EAAC,gBAAgB;YACvB,yEAAkB,YAAY,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,GAAG,GAAG,GAAI;YACrF,+DAAQ,KAAK,EAAE,UAAU,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,IAE/G,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,uBAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAEvE,CACP,CACT,CAAA;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'phone-input'\n})\nexport class PhoneInput {\n\n private phoneInputMask: HTMLPhoneInputMaskElement;\n\n @Prop() sendPin: Function;\n @Prop() loading: boolean;\n @Prop() value: string;\n\n async validatePhone() {\n const phone = await this.phoneInputMask.getPhone();\n await this.sendPin(phone);\n }\n\n render() {\n return (\n <div class=\"form-container\">\n <phone-input-mask initialValue={this.value} ref={ref => this.phoneInputMask = ref} />\n <button class={`button ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePhone()}>\n {\n !this.loading ? \"validar\" : <loading-spinner size=\"25px\" color=\"#fff\" />\n }\n </button>\n </div>\n )\n }\n}"]}
|