crmbonus-component-wake 2.0.92 → 2.0.93
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_5.cjs.entry.js +6 -5
- package/dist/cjs/countdown-timer_5.cjs.entry.js.map +1 -1
- package/dist/cjs/crmbonus-component-wake.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.css +4 -1
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js +3 -3
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js.map +1 -1
- package/dist/collection/components/tooltip/crm-tooltip.css +17 -2
- package/dist/collection/components/tooltip/tooltip.js +19 -1
- package/dist/collection/components/tooltip/tooltip.js.map +1 -1
- package/dist/components/crm-bonus.js +3 -3
- package/dist/components/crm-giftback-form.js +1 -1
- package/dist/components/crm-tooltip.js +1 -1
- package/dist/components/giftback-info.js +1 -1
- package/dist/components/{p-ce42bbb1.js → p-03183a03.js} +5 -5
- package/dist/components/p-03183a03.js.map +1 -0
- package/dist/components/{p-f4657c51.js → p-284d8322.js} +6 -4
- package/dist/components/p-284d8322.js.map +1 -0
- package/dist/components/{p-a2764b53.js → p-645bae5b.js} +3 -3
- package/dist/components/{p-a2764b53.js.map → p-645bae5b.js.map} +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-7dd955cf.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-7dd955cf.entry.js.map +1 -0
- package/dist/esm/countdown-timer_5.entry.js +6 -5
- package/dist/esm/countdown-timer_5.entry.js.map +1 -1
- package/dist/esm/crmbonus-component-wake.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/tooltip/tooltip.d.ts +1 -0
- package/dist/types/components.d.ts +2 -0
- package/package.json +1 -1
- package/dist/components/p-ce42bbb1.js.map +0 -1
- package/dist/components/p-f4657c51.js.map +0 -1
- package/dist/crmbonus-component-wake/p-9aa3e0a3.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-9aa3e0a3.entry.js.map +0 -1
@@ -34,16 +34,17 @@ const CountdownTimer = class {
|
|
34
34
|
|
35
35
|
const infoCircleSvgrepoComSvg = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPg0KPHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik0xMiAxNy43NUMxMi40MTQyIDE3Ljc1IDEyLjc1IDE3LjQxNDIgMTIuNzUgMTdWMTFDMTIuNzUgMTAuNTg1OCAxMi40MTQyIDEwLjI1IDEyIDEwLjI1QzExLjU4NTggMTAuMjUgMTEuMjUgMTAuNTg1OCAxMS4yNSAxMVYxN0MxMS4yNSAxNy40MTQyIDExLjU4NTggMTcuNzUgMTIgMTcuNzVaIiBmaWxsPSIjMUMyNzRDIi8+DQo8cGF0aCBkPSJNMTIgN0MxMi41NTIzIDcgMTMgNy40NDc3MiAxMyA4QzEzIDguNTUyMjggMTIuNTUyMyA5IDEyIDlDMTEuNDQ3NyA5IDExIDguNTUyMjggMTEgOEMxMSA3LjQ0NzcyIDExLjQ0NzcgNyAxMiA3WiIgZmlsbD0iIzFDMjc0QyIvPg0KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xLjI1IDEyQzEuMjUgNi4wNjI5NCA2LjA2Mjk0IDEuMjUgMTIgMS4yNUMxNy45MzcxIDEuMjUgMjIuNzUgNi4wNjI5NCAyMi43NSAxMkMyMi43NSAxNy45MzcxIDE3LjkzNzEgMjIuNzUgMTIgMjIuNzVDNi4wNjI5NCAyMi43NSAxLjI1IDE3LjkzNzEgMS4yNSAxMlpNMTIgMi43NUM2Ljg5MTM3IDIuNzUgMi43NSA2Ljg5MTM3IDIuNzUgMTJDMi43NSAxNy4xMDg2IDYuODkxMzcgMjEuMjUgMTIgMjEuMjVDMTcuMTA4NiAyMS4yNSAyMS4yNSAxNy4xMDg2IDIxLjI1IDEyQzIxLjI1IDYuODkxMzcgMTcuMTA4NiAyLjc1IDEyIDIuNzVaIiBmaWxsPSIjMUMyNzRDIi8+DQo8L3N2Zz4=';
|
36
36
|
|
37
|
-
const crmTooltipCss = ".crm-tooltip-container {\n display: flex;\n\n & img {\n width: 16px;\n
|
37
|
+
const crmTooltipCss = ".crm-tooltip-container {\n display: flex;\n\n & img {\n width: 16px;\n margin-left: 3px;\n position: relative;\n }\n}\n\n.crm-tooltip {\n position: relative;\n display: inline-block;\n}\n\n.crm-tooltip .tooltiptext {\n visibility: hidden;\n background-color: black;\n color: #fff;\n text-align: center;\n padding: 8px 12px;\n border-radius: 0px;\n position: absolute;\n z-index: 1;\n min-width: 271px;\n top: 100%;\n left: 50%;\n margin-left: -238px;\n}\n\n@media (max-width: 410px) {\n .crm-tooltip .tooltiptext {\n margin-left: -14px;\n }\n\n .crm-tooltip #crm-role-description {\n margin-left: -151px;\n }\n}\n\n@media (max-width: 250px) {\n .crm-tooltip .tooltiptext {\n margin-left: -201px;\n }\n}\n\n.crm-tooltip:hover .tooltiptext {\n visibility: visible;\n}";
|
38
38
|
const CrmTooltipStyle0 = crmTooltipCss;
|
39
39
|
|
40
40
|
const Tooltip = class {
|
41
41
|
constructor(hostRef) {
|
42
42
|
index.registerInstance(this, hostRef);
|
43
43
|
this.text = undefined;
|
44
|
+
this.identity = undefined;
|
44
45
|
}
|
45
46
|
render() {
|
46
|
-
return (index.h("div", { key: '
|
47
|
+
return (index.h("div", { key: '8d7de09a39f9f3412c5ee51e884a9900f65ad261', class: "crm-tooltip-container crm-tooltip" }, index.h("img", { key: '7605616f8135d1009a4c8f6a272cedfd66f10b88', src: infoCircleSvgrepoComSvg }), index.h("span", { key: '5b7b384d39f5c6b4d733ad129bd99ba8670bde8e', id: this.identity, class: "tooltiptext" }, this.text)));
|
47
48
|
}
|
48
49
|
};
|
49
50
|
Tooltip.style = CrmTooltipStyle0;
|
@@ -114,11 +115,11 @@ const GiftbackInfo = class {
|
|
114
115
|
const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;
|
115
116
|
const translateDescription = i18n.instance.t("giftDescription", { amount: `${this.bonus.totalBonus.toFixed(2).replace(".", ",")}`, custom_name: "Giftback" });
|
116
117
|
const limit = utils.defineLimit(remainingGiftback);
|
117
|
-
return (index.h("div", { key: '
|
118
|
+
return (index.h("div", { key: 'c1176784d8fe227f26ea11facef2897619b5e1a4', class: "giftback-container" }, index.h("div", { key: 'f17f2ab172829eea4b2b239a119c05bb418a9ab7', class: "container-description" }, index.h("p", { key: '9764f9d185761cbd6458c922d56e5cea11a69bdd', innerHTML: translateDescription }), index.h("crm-tooltip", { key: '7429e9509544335bc21886c785fe47d3855c240a', identity: "crm-role-description", text: i18n.instance.t("labelUseGiftback", { minimumPurchase: this.bonus.minimumPurchase, expírationDate: utils.formatDateToBr(this.bonus.firstValidityDate) }) })), index.h("div", { key: 'd6b3a9c9745510e50b1ad2c1a58c4b8998f825a6', class: "slider-wrapper" }, index.h("div", { key: 'be44d7c3709865d80f93e54f1ac4e58a026d6d0b', class: "slider-value", style: {
|
118
119
|
left: `calc(${this.sliderPosition}% - 20px)`, // Ajuste para centralizar o texto
|
119
|
-
} }, "R$ ", this.usedValue.toFixed(2).replace(".", ",")), index.h("input", { key: '
|
120
|
+
} }, "R$ ", this.usedValue.toFixed(2).replace(".", ",")), index.h("input", { key: '49c16e5ff1dffcb431f449993dd134cae5129451', id: "position_value_id", disabled: true, type: "range", min: "0", max: this.bonus.totalBonus, value: this.usedValue, class: "slider", step: "0.01", onInput: (event) => this.handleSliderChange(event), style: {
|
120
121
|
background: `linear-gradient(to right, #6D6D5F ${this.sliderPosition}%, #ddd ${this.sliderPosition}%)`,
|
121
|
-
} })), limit.isComplete && (index.h("p", { key: '
|
122
|
+
} })), limit.isComplete && (index.h("p", { key: 'cf1969a181b2723ee801b4ea767bcef601761b58' }, i18n.instance.t("maxAmount"))), !limit.isComplete && (index.h("div", { key: 'f4d9cfcf895ac76fc7fe4bd84a8eeb0598b2c5a8', class: "container-description" }, index.h("p", { key: 'fa2074e6e43c96d4fbe1be21744c283dc79c9fb2' }, "Adicione ", index.h("strong", { key: 'f3f1ba8d8fb1522c8a3c633887c38113d16c9421' }, "R$ ", remainingGiftback < 0 ? "0,00" : remainingGiftback.toFixed(2).replace(".", ",")), " ao carrinho para atingir o valor m\u00E1ximo! ", index.h("crm-tooltip", { key: '5688ae6e5d56896828c85abc2d1e686716b30b99', identity: "crm-max-description", text: i18n.instance.t("labelamountPartial") })))), index.h("div", { key: '933b5d3dfe851a1ec25da562c68294528252b3ff', class: "options" }, index.h("div", { key: 'ce0c0ff87f36cea8bdec040dfff336a20bfca767', class: "options-option" }, index.h("input", { key: '780e9d3fc0b3e30c774255a8a22190a9a31c6f94', type: "radio", name: "giftbackOption", value: "use", checked: this.selectedOption === 'use', onChange: () => this.handleOptionChange('use') }), index.h("p", { key: 'accc8fefb955ce25f1b1d58c83e26732c9a9e63a' }, "Usar o meu Giftback")), index.h("div", { key: '9bff7c08c9ad32fbec92af3a7a2d15675f04b903', class: "options-option" }, index.h("input", { key: 'd27fc0ad93f0f9202ee180ab65910bddf836e1f5', type: "radio", name: "giftbackOption", value: "dontUse", checked: this.selectedOption === 'dontUse', onChange: () => this.handleOptionChange('dontUse') }), index.h("p", { key: '89bb7edfd129907ebf8dd8514ff2ec6d800d65e0' }, "N\u00E3o usar o meu Giftback"))), index.h("div", { key: '1ee7b71ffc3aef9bde5cd48be793c74c42855d8f', class: "info-box" }, "O Giftback ser\u00E1 aplicado na pr\u00F3xima etapa.")));
|
122
123
|
}
|
123
124
|
static get watchers() { return {
|
124
125
|
"bonus": ["changedBonus"]
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"countdown-timer.crm-tooltip.giftback-info.phone-form.pin-form.entry.cjs.js","mappings":";;;;;;;;;MAMa,cAAc;;;;uBAII,EAAE;;IAG7B,iBAAiB;QACb,IAAI,CAAC,UAAU,GAAG,WAAW,CAAC;YAC1B,IAAI,IAAI,CAAC,OAAO,GAAG,CAAC,EAAE;gBAClB,IAAI,CAAC,OAAO,EAAE,CAAC;aAClB;iBAAM;gBACH,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBAE/B,IAAI,CAAC,QAAQ,EAAE,CAAA;aAClB;SACJ,EAAE,IAAI,CAAC,CAAC;KACZ;IAED,oBAAoB;QAChB,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;KAClC;IAED,MAAM;QACF,QACIA,sEAAQ,IAAI,CAAC,OAAO,MAAU,EAChC;KACL;;;ACjCL,MAAM,uBAAuB,GAAG,wvCAAwvC;;ACAxxC,MAAM,aAAa,GAAG,+mBAA+mB,CAAC;AACtoB,yBAAe,aAAa;;MCOf,OAAO;;;;;IAIhB,MAAM;QACF,QACIA,kEAAK,KAAK,EAAC,mCAAmC,IAC1CA,kEAAK,GAAG,EAAEC,uBAAI,GAAI,EAClBD,mEAAM,KAAK,EAAC,aAAa,IAAE,IAAI,CAAC,IAAI,CAAQ,CAC1C,EACR;KACL;;;;ACnBL,MAAM,eAAe,GAAG,k7DAAk7D,CAAC;AAC38D,2BAAe,eAAe;;MCUjB,YAAY;;;yBACQ,CAAC;8BACI,MAAM;uBAEb,KAAK;qBACC;YAC7B,UAAU,EAAE,GAAG;YACf,MAAM,EAAE,EAAE;YACV,eAAe,EAAE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,OAAK,MACnBR,mBACI,IAAI,EAAC,MAAM,EACX,SAAS,EAAE,CAAC,EACZ,KAAK,EAAE,IAAI,CAAC,GAAG,CAACQ,OAAK,CAAC,EACtB,OAAO,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,WAAW,CAAC,KAAK,EAAEA,OAAK,CAAC,GACpD,CACL,CAAC,CACA,EAENR,oEAAa,EAEbA,gEAAG,KAAK,EAAC,iBAAiB,0BAElB,CAAC,IAAI,CAAC,SAAS,IAAIA,uFAAoBA,8EAAiB,QAAQ,EAAE,MAAM,IAAI,CAAC,aAAa,EAAE,GAAI,MAAS,EAGzG,IAAI,CAAC,SAAS,KACVA,oEACIA,gEAAG,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,eAAc,EACnDA,gEAAG,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,EAAE,yBAAmB,CAChD,CACT,CAEL,EACJA,yEAAY,MAAM,EAAE,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,kBAAkB,KAAI,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,GAAI,CAC/H,EACT;KACL;;;;;;;;;;","names":["h","info","USED_KEY","i18next","defineLimit","formatDateToBr","giftbackFormCss","Host","index"],"sources":["src/components/countdown-timer/countdown-timer.tsx","src/assets/svg/info-circle-svgrepo-com.svg","src/components/tooltip/crm-tooltip.css?tag=crm-tooltip","src/components/tooltip/tooltip.tsx","src/components/giftback-form/subcomponents/giftback-info/giftback-info.css?tag=giftback-info","src/components/giftback-form/subcomponents/giftback-info/giftback-info.tsx","src/components/giftback-form/giftback-form.css?tag=phone-form","src/components/giftback-form/subcomponents/phone-form/phone-form.tsx","src/components/giftback-form/subcomponents/pin-form/pin-form.css?tag=pin-form&encapsulation=shadow","src/components/giftback-form/giftback-form.css?tag=pin-form&encapsulation=shadow","src/components/giftback-form/subcomponents/pin-form/pin-form.tsx"],"sourcesContent":["import { Component, h, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'countdown-timer',\n shadow: true,\n})\nexport class CountdownTimer {\n\n @Prop() downtime: () => void;\n\n @State() counter: number = 30;\n private intervalId: NodeJS.Timer;\n\n componentWillLoad() {\n this.intervalId = setInterval(() => {\n if (this.counter > 0) {\n this.counter--;\n } else {\n clearInterval(this.intervalId);\n\n this.downtime()\n }\n }, 1000); // Intervalo de 1 segundo\n }\n\n disconnectedCallback() {\n clearInterval(this.intervalId);\n }\n\n render() {\n return (\n <label>{this.counter}s</label>\n );\n }\n}\n","<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->\r\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path d=\"M12 17.75C12.4142 17.75 12.75 17.4142 12.75 17V11C12.75 10.5858 12.4142 10.25 12 10.25C11.5858 10.25 11.25 10.5858 11.25 11V17C11.25 17.4142 11.5858 17.75 12 17.75Z\" fill=\"#1C274C\"/>\r\n<path d=\"M12 7C12.5523 7 13 7.44772 13 8C13 8.55228 12.5523 9 12 9C11.4477 9 11 8.55228 11 8C11 7.44772 11.4477 7 12 7Z\" fill=\"#1C274C\"/>\r\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M1.25 12C1.25 6.06294 6.06294 1.25 12 1.25C17.9371 1.25 22.75 6.06294 22.75 12C22.75 17.9371 17.9371 22.75 12 22.75C6.06294 22.75 1.25 17.9371 1.25 12ZM12 2.75C6.89137 2.75 2.75 6.89137 2.75 12C2.75 17.1086 6.89137 21.25 12 21.25C17.1086 21.25 21.25 17.1086 21.25 12C21.25 6.89137 17.1086 2.75 12 2.75Z\" fill=\"#1C274C\"/>\r\n</svg>",".crm-tooltip-container {\n display: flex;\n\n & img {\n width: 16px;\n top: 3px;\n position: relative;\n }\n}\n\n.crm-tooltip {\n position: relative;\n display: inline-block;\n border-bottom: 1px dotted black;\n}\n\n.crm-tooltip .tooltiptext {\n visibility: hidden;\n background-color: black;\n color: #fff;\n text-align: center;\n padding: 8px 12px;\n border-radius: 0px;\n position: absolute;\n z-index: 1;\n min-width: 271px;\n top: 100%;\n left: 50%;\n margin-left: -238px;\n}\n\n.crm-tooltip:hover .tooltiptext {\n visibility: visible;\n}","import { Component, h, Prop } from \"@stencil/core\";\nimport info from '../../assets/svg/info-circle-svgrepo-com.svg';\n\n\n@Component({\n tag: 'crm-tooltip',\n styleUrl: 'crm-tooltip.css'\n})\nexport class Tooltip {\n\n @Prop() text: string\n\n render() {\n return (\n <div class=\"crm-tooltip-container crm-tooltip\">\n <img src={info} />\n <span class=\"tooltiptext\">{this.text}</span>\n </div>\n );\n }\n}",":host {\n --text-color: #6D6D5F\n}\n\n.giftback-container {\n display: flex;\n flex-direction: column;\n gap: 14px;\n}\n\nh3 {\n font-size: 1.2rem;\n margin-bottom: 8px;\n color: #333;\n}\n\n.container-description {\n display: flex;\n align-items: center;\n gap: 5px;\n margin: 0 0 10px 0;\n}\n\n.container-description p {\n font-size: 14px;\n font-weight: 400;\n margin: 0px;\n}\n\n\np {\n font-size: 14px;\n color: #000;\n}\n\n.value-display h2 {\n color: #6D6D5F;\n /* Verde para o valor atual */\n font-size: 1.6rem;\n margin: 16px 0;\n}\n\ninput[type='range'] {\n width: 100%;\n margin: 12px 0;\n -webkit-appearance: none;\n background: #ddd;\n height: 4px;\n border-radius: 4px;\n outline: none;\n padding: 3px 0px 3px 3px;\n}\n\n/* input[type='range']::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n background: var(--text-color);\n border-radius: 50%;\n cursor: pointer;\n} */\n\ninput[type=\"range\"]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 20px;\n height: 20px;\n background: rgb(109, 109, 95);\n /* Cor do botão */\n border-radius: 50%;\n cursor: pointer;\n}\n\n.options {\n margin: 0px 0;\n display: flex;\n gap: 10px;\n flex-direction: column;\n}\n\n.options label {\n display: flex;\n margin: 0px 0;\n font-size: 0.9rem;\n color: #333;\n align-items: center;\n}\n\n.options input[type='radio'] {\n margin-right: 8px;\n height: 16px;\n width: 16px;\n}\n\n.options input[type='radio'] {\n appearance: none;\n -webkit-appearance: none;\n margin-right: 8px;\n width: 16px;\n height: 16px;\n border: 2px solid #ddd;\n border-radius: 50%;\n background-color: #fff;\n cursor: pointer;\n transition: all 0.3s;\n padding: 0px;\n}\n\n.options input[type='radio']:checked {\n border-color: #000;\n background-color: #FAFAFA;\n border: 4px solid #000;\n}\n\n.info-box {\n background-color: #f9f9f9;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n padding: 8px;\n font-size: 14px;\n color: #262626;\n line-height: 20px;\n}\n\n.info-icon {\n font-size: 0.9rem;\n cursor: pointer;\n color: #888;\n}\n\nh3 {\n font-size: 1.2rem;\n margin-bottom: 8px;\n color: #333;\n}\n\n.slider-wrapper {\n position: relative;\n margin: 21px 0px 0px 0px;\n}\n\n.slider {\n width: 100%;\n -webkit-appearance: none;\n background: #ddd;\n height: 4px;\n border-radius: 2px;\n outline: none;\n}\n\n.slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n background: var(--text-color);\n /* Azul para o slider */\n border-radius: 50%;\n cursor: pointer;\n}\n\n.slider-value {\n position: absolute;\n top: -30px;\n /* Posição acima do slider */\n font-size: 16px;\n font-weight: 700;\n color: var(--text-color);\n /* Verde para o texto */\n transform: translateX(-50%);\n white-space: nowrap;\n /* margin-left: 23px; */\n}\n\n.options-option {\n display: flex;\n}","import { Component, Prop, State, Watch, h } from \"@stencil/core\";\nimport { IBonus } from \"../../../../dto/validate.pin.bonus\";\n\nimport i18next from '../../../../i18n/i18n'\nimport { USED_KEY } from \"../../../../utils/keys.storage\";\nimport { defineLimit, formatDateToBr } from \"../../../../utils/utils\";\n\n@Component({\n tag: 'giftback-info',\n styleUrls: ['giftback-info.css']\n})\nexport class GiftbackInfo {\n @State() usedValue: number = 0;\n @State() selectedOption: string = 'none';\n\n @Prop() loading: boolean = false;\n @Prop() bonus: Partial<IBonus> = {\n totalBonus: 150,\n cartId: \"\",\n minimumPurchase: 500,\n bonusBalance: 50,\n calculatedValue: 150,\n firstValidityDate: \"\",\n totalValue: 400\n };\n @Prop() reserve: (amountRedeemed: number) => void;\n @Prop() cancel: () => void;\n\n @State() sliderPosition: number = 50;\n\n @Watch(\"bonus\")\n changedBonus() {\n this.updateBonus()\n }\n\n private updateBonus() {\n this.usedValue = this.bonus.bonusBalance;\n this.buildPositionSlider(0, this.bonus.totalBonus);\n }\n\n componentWillLoad() {\n this.updateBonus();\n this.selectedOption = localStorage.getItem(USED_KEY);\n }\n\n handleSliderChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.usedValue = parseFloat(input.value);\n\n // Calculando a posição do texto com base no valor do slider\n // const percentage = ((this.usedValue - parseInt(input.min)) / (parseInt(input.max) - parseInt(input.min))) * 100;\n // this.sliderPosition = percentage;\n\n this.buildPositionSlider(parseFloat(input.min), parseFloat(input.max))\n }\n\n componentDidLoad() {\n const input: any = document.getElementById(\"position_value_id\")\n \n input.value = this.bonus.bonusBalance;\n }\n\n\n private buildPositionSlider(min: number, max: number) {\n // Calculando a posição do texto com base no valor do slider\n const percentage = ((this.usedValue - min) / (max - min)) * 100;\n this.sliderPosition = percentage;\n }\n\n async handleOptionChange(option: string) {\n this.selectedOption = option;\n \n localStorage.setItem(USED_KEY, option);\n switch (this.selectedOption) {\n case 'use':\n await this.reserve(this.usedValue)\n break;\n case 'dontUse':\n await this.cancel();\n break;\n default:\n }\n }\n\n render() {\n const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;\n\n const translateDescription = i18next.t(\"giftDescription\", { amount: `${this.bonus.totalBonus.toFixed(2).replace(\".\", \",\")}`, custom_name: \"Giftback\" })\n\n const limit = defineLimit(remainingGiftback)\n return (\n\n <div class=\"giftback-container\">\n <div class=\"container-description\">\n <p innerHTML={translateDescription}></p>\n <crm-tooltip text={i18next.t(\"labelUseGiftback\", { minimumPurchase: this.bonus.minimumPurchase, expírationDate: formatDateToBr(this.bonus.firstValidityDate) })} />\n </div>\n <div class=\"slider-wrapper\">\n <div\n class=\"slider-value\"\n style={{\n left: `calc(${this.sliderPosition}% - 20px)`, // Ajuste para centralizar o texto\n\n }}\n >\n R$ {this.usedValue.toFixed(2).replace(\".\", \",\")}\n </div>\n <input\n id=\"position_value_id\"\n disabled\n type=\"range\"\n min=\"0\"\n max={this.bonus.totalBonus}\n value={this.usedValue}\n class=\"slider\"\n step=\"0.01\"\n onInput={(event) => this.handleSliderChange(event)}\n style={{\n background: `linear-gradient(to right, #6D6D5F ${this.sliderPosition}%, #ddd ${this.sliderPosition}%)`,\n }}\n />\n </div>\n\n {\n limit.isComplete && (\n <p>\n {i18next.t(\"maxAmount\")}\n </p>\n )\n }\n\n {\n !limit.isComplete && (\n <div class=\"container-description\">\n <p>\n Adicione <strong>R$ {remainingGiftback < 0 ? \"0,00\" : remainingGiftback.toFixed(2).replace(\".\", \",\")}</strong> ao carrinho para atingir o valor\n máximo! <crm-tooltip text={i18next.t(\"labelamountPartial\")} />\n </p>\n\n \n </div>\n )\n }\n\n\n <div class=\"options\">\n <div class=\"options-option\">\n <input\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"use\"\n checked={this.selectedOption === 'use'}\n onChange={() => this.handleOptionChange('use')}\n />\n <p>Usar o meu Giftback</p>\n </div>\n <div class=\"options-option\">\n <input\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"dontUse\"\n checked={this.selectedOption === 'dontUse'}\n onChange={() => this.handleOptionChange('dontUse')}\n />\n <p>Não usar o meu Giftback</p>\n </div>\n </div>\n <div class=\"info-box\">\n O Giftback será aplicado na próxima etapa.\n </div>\n </div>\n );\n }\n}","* {\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 font-weight: 100;\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} handleClick={() => this.handlePhone() } />\n </Host>\n )\n }\n}",":host {\n display: block;\n font-family: Arial, sans-serif;\n}\n\n.form-container-pin {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.pin-container {\n display: flex;\n /* margin: 26px 0; */\n justify-content: start;\n gap: 10px;\n}\n\n.pin-container input {\n width: 100%;\n height: 48px;\n font-size: 14px;\n text-align: center;\n border: 1px solid #ccc;\n border-radius: 5px;\n}\n\nbutton {\n padding: 10px 20px;\n background-color: #ddd;\n border: none;\n border-radius: 5px;\n cursor: pointer;\n}\n\n\n.success {\n color: green;\n margin-top: 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}\n\n.button-cancel {\n top: 50%;\n background-color: #ffffff;\n color: #1e1c1c;\n border: 1px solid gray;\n border-radius: 10px;\n padding: 10px;\n min-height: 30px;\n min-width: 120px;\n font-size: 19px;\n cursor: pointer;\n}\n\n.crm-description {\n font-size: 14px;\n width: 100%;\n display: flex;\n gap: 9px;\n}\n\n.crm-description a {\n font-weight: bold;\n cursor: pointer;\n text-decoration: underline;\n}\n\n.crm-description div {\n display: flex;\n gap: 5px;\n}","* {\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 font-weight: 100;\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, h, Prop, State } from '@stencil/core';\nimport { IPinSent } from '../../../../dto/pin.sent';\nimport i18next from '../../../../i18n/i18n'\nimport { IInfoStore } from '../../../../helpers/info.config.helper';\n\n@Component({\n tag: 'pin-form',\n styleUrls: ['pin-form.css', '../../giftback-form.css'],\n shadow: true,\n})\nexport class GiftbackPin {\n\n @Prop() validate: (pin: string) => void;\n @Prop() cancel: () => void;\n @Prop() resend: () => void;\n\n @Prop() sent: IPinSent;\n @Prop() loading: boolean = false;\n @Prop() phone: string;\n @Prop() config: IInfoStore;\n\n @State() pin: string[] = ['', '', '', ''];\n @State() isVerified: boolean = false;\n @State() canResend: boolean = false;\n\n componentWillLoad() {\n this.canResend = false;\n }\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 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 handleTimeout() {\n this.canResend = true;\n }\n\n async handleResend() {\n await this.resend();\n\n this.canResend = false;\n this.pin = ['', '', '', '']\n }\n\n render() {\n return (\n <div class=\"crm-phone-form\">\n <label class=\"crm-subtitle\" >{i18next.t('pin-sutitle')} <strong>+55 {this.phone}</strong></label>\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\n <slot></slot>\n\n <p class=\"crm-description\"> Não recebeu?\n {\n !this.canResend && <label> Reenviar em <countdown-timer downtime={() => this.handleTimeout()} /> </label>\n }\n {\n this.canResend && (\n <div >\n <a onClick={() => this.handleResend()}>Reenviar</a>\n <a onClick={() => this.cancel()}>Trocar número</a>\n </div>\n )\n }\n </p>\n <crm-button txtBtn={this.config?.btnApplyBonusLabel || \"Avançar\"} loading={this.loading} handleClick={() => this.validatePin()} />\n </div >\n );\n }\n}\n"],"version":3}
|
1
|
+
{"file":"countdown-timer.crm-tooltip.giftback-info.phone-form.pin-form.entry.cjs.js","mappings":";;;;;;;;;MAMa,cAAc;;;;uBAII,EAAE;;IAG7B,iBAAiB;QACb,IAAI,CAAC,UAAU,GAAG,WAAW,CAAC;YAC1B,IAAI,IAAI,CAAC,OAAO,GAAG,CAAC,EAAE;gBAClB,IAAI,CAAC,OAAO,EAAE,CAAC;aAClB;iBAAM;gBACH,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBAE/B,IAAI,CAAC,QAAQ,EAAE,CAAA;aAClB;SACJ,EAAE,IAAI,CAAC,CAAC;KACZ;IAED,oBAAoB;QAChB,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;KAClC;IAED,MAAM;QACF,QACIA,sEAAQ,IAAI,CAAC,OAAO,MAAU,EAChC;KACL;;;ACjCL,MAAM,uBAAuB,GAAG,wvCAAwvC;;ACAxxC,MAAM,aAAa,GAAG,i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W,EAAE,GAAI,CAC/H,EACT;KACL;;;;;;;;;;","names":["h","info","USED_KEY","i18next","defineLimit","formatDateToBr","giftbackFormCss","Host","index"],"sources":["src/components/countdown-timer/countdown-timer.tsx","src/assets/svg/info-circle-svgrepo-com.svg","src/components/tooltip/crm-tooltip.css?tag=crm-tooltip","src/components/tooltip/tooltip.tsx","src/components/giftback-form/subcomponents/giftback-info/giftback-info.css?tag=giftback-info","src/components/giftback-form/subcomponents/giftback-info/giftback-info.tsx","src/components/giftback-form/giftback-form.css?tag=phone-form","src/components/giftback-form/subcomponents/phone-form/phone-form.tsx","src/components/giftback-form/subcomponents/pin-form/pin-form.css?tag=pin-form&encapsulation=shadow","src/components/giftback-form/giftback-form.css?tag=pin-form&encapsulation=shadow","src/components/giftback-form/subcomponents/pin-form/pin-form.tsx"],"sourcesContent":["import { Component, h, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'countdown-timer',\n shadow: true,\n})\nexport class CountdownTimer {\n\n @Prop() downtime: () => void;\n\n @State() counter: number = 30;\n private intervalId: NodeJS.Timer;\n\n componentWillLoad() {\n this.intervalId = setInterval(() => {\n if (this.counter > 0) {\n this.counter--;\n } else {\n clearInterval(this.intervalId);\n\n this.downtime()\n }\n }, 1000); // Intervalo de 1 segundo\n }\n\n disconnectedCallback() {\n clearInterval(this.intervalId);\n }\n\n render() {\n return (\n <label>{this.counter}s</label>\n );\n }\n}\n","<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->\r\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path d=\"M12 17.75C12.4142 17.75 12.75 17.4142 12.75 17V11C12.75 10.5858 12.4142 10.25 12 10.25C11.5858 10.25 11.25 10.5858 11.25 11V17C11.25 17.4142 11.5858 17.75 12 17.75Z\" fill=\"#1C274C\"/>\r\n<path d=\"M12 7C12.5523 7 13 7.44772 13 8C13 8.55228 12.5523 9 12 9C11.4477 9 11 8.55228 11 8C11 7.44772 11.4477 7 12 7Z\" fill=\"#1C274C\"/>\r\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M1.25 12C1.25 6.06294 6.06294 1.25 12 1.25C17.9371 1.25 22.75 6.06294 22.75 12C22.75 17.9371 17.9371 22.75 12 22.75C6.06294 22.75 1.25 17.9371 1.25 12ZM12 2.75C6.89137 2.75 2.75 6.89137 2.75 12C2.75 17.1086 6.89137 21.25 12 21.25C17.1086 21.25 21.25 17.1086 21.25 12C21.25 6.89137 17.1086 2.75 12 2.75Z\" fill=\"#1C274C\"/>\r\n</svg>",".crm-tooltip-container {\n display: flex;\n\n & img {\n width: 16px;\n margin-left: 3px;\n position: relative;\n }\n}\n\n.crm-tooltip {\n position: relative;\n display: inline-block;\n}\n\n.crm-tooltip .tooltiptext {\n visibility: hidden;\n background-color: black;\n color: #fff;\n text-align: center;\n padding: 8px 12px;\n border-radius: 0px;\n position: absolute;\n z-index: 1;\n min-width: 271px;\n top: 100%;\n left: 50%;\n margin-left: -238px;\n}\n\n@media (max-width: 410px) {\n .crm-tooltip .tooltiptext {\n margin-left: -14px;\n }\n\n .crm-tooltip #crm-role-description {\n margin-left: -151px;\n }\n}\n\n@media (max-width: 250px) {\n .crm-tooltip .tooltiptext {\n margin-left: -201px;\n }\n}\n\n.crm-tooltip:hover .tooltiptext {\n visibility: visible;\n}","import { Component, h, Prop } from \"@stencil/core\";\nimport info from '../../assets/svg/info-circle-svgrepo-com.svg';\n\n\n@Component({\n tag: 'crm-tooltip',\n styleUrl: 'crm-tooltip.css'\n})\nexport class Tooltip {\n\n @Prop() text: string;\n @Prop() identity: string;\n\n render() {\n return (\n <div class=\"crm-tooltip-container crm-tooltip\">\n <img src={info} />\n <span id={this.identity} class=\"tooltiptext\">{this.text}</span>\n </div>\n );\n }\n}",":host {\n --text-color: #6D6D5F\n}\n\n.giftback-container {\n display: flex;\n flex-direction: column;\n gap: 14px;\n}\n\nh3 {\n font-size: 1.2rem;\n margin-bottom: 8px;\n color: #333;\n}\n\n.container-description {\n display: flex;\n align-items: center;\n gap: 5px;\n margin: 0 0 10px 0;\n}\n\n.container-description p {\n font-size: 14px;\n font-weight: 400;\n margin: 0px;\n}\n\n\np {\n font-size: 14px;\n color: #000;\n}\n\n.value-display h2 {\n color: #6D6D5F;\n /* Verde para o valor atual */\n font-size: 1.6rem;\n margin: 16px 0;\n}\n\ninput[type='range'] {\n width: 100%;\n margin: 12px 0;\n -webkit-appearance: none;\n background: #ddd;\n height: 4px;\n border-radius: 4px;\n outline: none;\n padding: 3px 0px 3px 3px;\n}\n\n/* input[type='range']::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n background: var(--text-color);\n border-radius: 50%;\n cursor: pointer;\n} */\n\ninput[type=\"range\"]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 20px;\n height: 20px;\n background: rgb(109, 109, 95);\n /* Cor do botão */\n border-radius: 50%;\n cursor: pointer;\n}\n\n.options {\n margin: 0px 0;\n display: flex;\n gap: 10px;\n flex-direction: column;\n}\n\n.options label {\n display: flex;\n margin: 0px 0;\n font-size: 0.9rem;\n color: #333;\n align-items: center;\n}\n\n.options input[type='radio'] {\n margin-right: 8px;\n height: 16px;\n width: 16px;\n}\n\n.options input[type='radio'] {\n appearance: none;\n -webkit-appearance: none;\n margin-right: 8px;\n width: 16px;\n height: 16px;\n border: 2px solid #ddd;\n border-radius: 50%;\n background-color: #fff;\n cursor: pointer;\n transition: all 0.3s;\n padding: 0px;\n}\n\n.options input[type='radio']:checked {\n border-color: #000;\n background-color: #FAFAFA;\n border: 4px solid #000;\n}\n\n.info-box {\n background-color: #f9f9f9;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n padding: 8px;\n font-size: 14px;\n color: #262626;\n line-height: 20px;\n}\n\n.info-icon {\n font-size: 0.9rem;\n cursor: pointer;\n color: #888;\n}\n\nh3 {\n font-size: 1.2rem;\n margin-bottom: 8px;\n color: #333;\n}\n\n.slider-wrapper {\n position: relative;\n margin: 21px 0px 0px 0px;\n}\n\n.slider {\n width: 100%;\n -webkit-appearance: none;\n background: #ddd;\n height: 4px;\n border-radius: 2px;\n outline: none;\n}\n\n.slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n background: var(--text-color);\n /* Azul para o slider */\n border-radius: 50%;\n cursor: pointer;\n}\n\n.slider-value {\n position: absolute;\n top: -30px;\n /* Posição acima do slider */\n font-size: 16px;\n font-weight: 700;\n color: var(--text-color);\n /* Verde para o texto */\n transform: translateX(-50%);\n white-space: nowrap;\n /* margin-left: 23px; */\n}\n\n.options-option {\n display: flex;\n}\n\n\n/* ########################################## */\n","import { Component, Prop, State, Watch, h } from \"@stencil/core\";\nimport { IBonus } from \"../../../../dto/validate.pin.bonus\";\n\nimport i18next from '../../../../i18n/i18n'\nimport { USED_KEY } from \"../../../../utils/keys.storage\";\nimport { defineLimit, formatDateToBr } from \"../../../../utils/utils\";\n\n@Component({\n tag: 'giftback-info',\n styleUrls: ['giftback-info.css']\n})\nexport class GiftbackInfo {\n @State() usedValue: number = 0;\n @State() selectedOption: string = 'none';\n\n @Prop() loading: boolean = false;\n @Prop() bonus: Partial<IBonus> = {\n totalBonus: 150,\n cartId: \"\",\n minimumPurchase: 500,\n bonusBalance: 50,\n calculatedValue: 150,\n firstValidityDate: \"\",\n totalValue: 400\n };\n @Prop() reserve: (amountRedeemed: number) => void;\n @Prop() cancel: () => void;\n\n @State() sliderPosition: number = 50;\n\n @Watch(\"bonus\")\n changedBonus() {\n this.updateBonus()\n }\n\n private updateBonus() {\n this.usedValue = this.bonus.bonusBalance;\n this.buildPositionSlider(0, this.bonus.totalBonus);\n }\n\n componentWillLoad() {\n this.updateBonus();\n this.selectedOption = localStorage.getItem(USED_KEY);\n }\n\n handleSliderChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.usedValue = parseFloat(input.value);\n\n // Calculando a posição do texto com base no valor do slider\n // const percentage = ((this.usedValue - parseInt(input.min)) / (parseInt(input.max) - parseInt(input.min))) * 100;\n // this.sliderPosition = percentage;\n\n this.buildPositionSlider(parseFloat(input.min), parseFloat(input.max))\n }\n\n componentDidLoad() {\n const input: any = document.getElementById(\"position_value_id\")\n\n input.value = this.bonus.bonusBalance;\n }\n\n\n private buildPositionSlider(min: number, max: number) {\n // Calculando a posição do texto com base no valor do slider\n const percentage = ((this.usedValue - min) / (max - min)) * 100;\n this.sliderPosition = percentage;\n }\n\n async handleOptionChange(option: string) {\n this.selectedOption = option;\n\n localStorage.setItem(USED_KEY, option);\n switch (this.selectedOption) {\n case 'use':\n await this.reserve(this.usedValue)\n break;\n case 'dontUse':\n await this.cancel();\n break;\n default:\n }\n }\n\n render() {\n const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;\n\n const translateDescription = i18next.t(\"giftDescription\", { amount: `${this.bonus.totalBonus.toFixed(2).replace(\".\", \",\")}`, custom_name: \"Giftback\" })\n\n const limit = defineLimit(remainingGiftback)\n return (\n\n <div class=\"giftback-container\">\n <div class=\"container-description\">\n <p innerHTML={translateDescription}></p>\n <crm-tooltip identity=\"crm-role-description\" text={i18next.t(\"labelUseGiftback\", { minimumPurchase: this.bonus.minimumPurchase, expírationDate: formatDateToBr(this.bonus.firstValidityDate) })} />\n </div>\n <div class=\"slider-wrapper\">\n <div\n class=\"slider-value\"\n style={{\n left: `calc(${this.sliderPosition}% - 20px)`, // Ajuste para centralizar o texto\n\n }}\n >\n R$ {this.usedValue.toFixed(2).replace(\".\", \",\")}\n </div>\n <input\n id=\"position_value_id\"\n disabled\n type=\"range\"\n min=\"0\"\n max={this.bonus.totalBonus}\n value={this.usedValue}\n class=\"slider\"\n step=\"0.01\"\n onInput={(event) => this.handleSliderChange(event)}\n style={{\n background: `linear-gradient(to right, #6D6D5F ${this.sliderPosition}%, #ddd ${this.sliderPosition}%)`,\n }}\n />\n </div>\n\n {\n limit.isComplete && (\n <p>\n {i18next.t(\"maxAmount\")}\n </p>\n )\n }\n\n {\n !limit.isComplete && (\n <div class=\"container-description\">\n <p>\n Adicione <strong>R$ {remainingGiftback < 0 ? \"0,00\" : remainingGiftback.toFixed(2).replace(\".\", \",\")}</strong> ao carrinho para atingir o valor\n máximo! <crm-tooltip identity=\"crm-max-description\" text={i18next.t(\"labelamountPartial\")} />\n </p>\n </div>\n )\n }\n\n\n <div class=\"options\">\n <div class=\"options-option\">\n <input\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"use\"\n checked={this.selectedOption === 'use'}\n onChange={() => this.handleOptionChange('use')}\n />\n <p>Usar o meu Giftback</p>\n </div>\n <div class=\"options-option\">\n <input\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"dontUse\"\n checked={this.selectedOption === 'dontUse'}\n onChange={() => this.handleOptionChange('dontUse')}\n />\n <p>Não usar o meu Giftback</p>\n </div>\n </div>\n <div class=\"info-box\">\n O Giftback será aplicado na próxima etapa.\n </div>\n </div>\n );\n }\n}","* {\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 font-weight: 100;\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} handleClick={() => this.handlePhone() } />\n </Host>\n )\n }\n}",":host {\n display: block;\n font-family: Arial, sans-serif;\n}\n\n.form-container-pin {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.pin-container {\n display: flex;\n /* margin: 26px 0; */\n justify-content: start;\n gap: 10px;\n}\n\n.pin-container input {\n width: 100%;\n height: 48px;\n font-size: 14px;\n text-align: center;\n border: 1px solid #ccc;\n border-radius: 5px;\n}\n\nbutton {\n padding: 10px 20px;\n background-color: #ddd;\n border: none;\n border-radius: 5px;\n cursor: pointer;\n}\n\n\n.success {\n color: green;\n margin-top: 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}\n\n.button-cancel {\n top: 50%;\n background-color: #ffffff;\n color: #1e1c1c;\n border: 1px solid gray;\n border-radius: 10px;\n padding: 10px;\n min-height: 30px;\n min-width: 120px;\n font-size: 19px;\n cursor: pointer;\n}\n\n.crm-description {\n font-size: 14px;\n width: 100%;\n display: flex;\n gap: 9px;\n}\n\n.crm-description a {\n font-weight: bold;\n cursor: pointer;\n text-decoration: underline;\n}\n\n.crm-description div {\n display: flex;\n gap: 5px;\n}","* {\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 font-weight: 100;\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, h, Prop, State } from '@stencil/core';\nimport { IPinSent } from '../../../../dto/pin.sent';\nimport i18next from '../../../../i18n/i18n'\nimport { IInfoStore } from '../../../../helpers/info.config.helper';\n\n@Component({\n tag: 'pin-form',\n styleUrls: ['pin-form.css', '../../giftback-form.css'],\n shadow: true,\n})\nexport class GiftbackPin {\n\n @Prop() validate: (pin: string) => void;\n @Prop() cancel: () => void;\n @Prop() resend: () => void;\n\n @Prop() sent: IPinSent;\n @Prop() loading: boolean = false;\n @Prop() phone: string;\n @Prop() config: IInfoStore;\n\n @State() pin: string[] = ['', '', '', ''];\n @State() isVerified: boolean = false;\n @State() canResend: boolean = false;\n\n componentWillLoad() {\n this.canResend = false;\n }\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 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 handleTimeout() {\n this.canResend = true;\n }\n\n async handleResend() {\n await this.resend();\n\n this.canResend = false;\n this.pin = ['', '', '', '']\n }\n\n render() {\n return (\n <div class=\"crm-phone-form\">\n <label class=\"crm-subtitle\" >{i18next.t('pin-sutitle')} <strong>+55 {this.phone}</strong></label>\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\n <slot></slot>\n\n <p class=\"crm-description\"> Não recebeu?\n {\n !this.canResend && <label> Reenviar em <countdown-timer downtime={() => this.handleTimeout()} /> </label>\n }\n {\n this.canResend && (\n <div >\n <a onClick={() => this.handleResend()}>Reenviar</a>\n <a onClick={() => this.cancel()}>Trocar número</a>\n </div>\n )\n }\n </p>\n <crm-button txtBtn={this.config?.btnApplyBonusLabel || \"Avançar\"} loading={this.loading} handleClick={() => this.validatePin()} />\n </div >\n );\n }\n}\n"],"version":3}
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
19
19
|
|
20
20
|
patchBrowser().then(async (options) => {
|
21
21
|
await appGlobals.globalScripts();
|
22
|
-
return index.bootstrapLazy([["crm-bonus.cjs",[[2,"crm-bonus",{"userId":[2,"userid"],"storeName":[8,"storename"],"productsInString":[1,"products"],"cartId":[8,"cartid"],"showModal":[32],"products":[32],"customer":[32],"loading":[32],"message":[32],"phone":[32],"canCancel":[32],"amountCancel":[32],"sent":[32],"session":[32],"loading_reprocess":[32],"resetBonus":[64],"reprocess":[64]},null,{"productsInString":["watchProducts"]}]]],["crm-bonus-form.cjs",[[1,"crm-bonus-form",{"storeName":[8,"storename"],"cartId":[8,"cart-id"],"products":[16],"customer":[16],"sent":[16],"stepNext":[2,"step-next"],"phone":[2],"loadingModal":[4,"loading-modal"],"saveStore":[16],"cancel":[16],"handleCustomerName":[16],"loading":[32],"step":[32],"message":[32],"bonus":[32],"setStep":[64]}]]],["crm-bonus-note.cjs",[[0,"crm-bonus-note",{"cartId":[8,"cartid"],"storename":[8],"url":[32],"config":[32],"bonus":[32]}]]],["phone-cancel-input.cjs",[[0,"phone-cancel-input",{"sendPin":[16],"loading":[4],"value":[1]}]]],["phone-input.cjs",[[0,"phone-input",{"sendPin":[16],"loading":[4],"value":[1]}]]],["app-modal.cjs",[[1,"app-modal",{"isOpen":[516,"is-open"],"modalTitle":[1,"modal-title"]}]]],["pedido-finalizado.cjs",[[0,"pedido-finalizado",{"cartId":[1,"cartid"],"orderId":[2,"orderid"],"metadadoString":[1,"metadado"]}]]],["crm-button.cjs",[[0,"crm-button",{"txtBtn":[1,"txt-btn"],"loading":[4],"handleClick":[16]}]]],["phone-input-mask.cjs",[[1,"phone-input-mask",{"initialValue":[1,"initial-value"],"disabled":[4],"phone":[32],"message":[32],"getPhone":[64]}]]],["loading-spinner.cjs",[[1,"loading-spinner",{"size":[1],"color":[1]}]]],["countdown-timer_5.cjs",[[0,"phone-form",{"value":[1],"loading":[4],"handlerSubmit":[16],"config":[16]}],[1,"pin-form",{"validate":[16],"cancel":[16],"resend":[16],"sent":[16],"loading":[4],"phone":[1],"config":[16],"pin":[32],"isVerified":[32],"canResend":[32]}],[0,"giftback-info",{"loading":[4],"bonus":[16],"reserve":[16],"cancel":[16],"usedValue":[32],"selectedOption":[32],"sliderPosition":[32]},null,{"bonus":["changedBonus"]}],[1,"countdown-timer",{"downtime":[16],"counter":[32]}],[0,"crm-tooltip",{"text":[1]}]]],["crm-giftback-form_2.cjs",[[0,"crm-giftback-form",{"storeName":[8,"storename"],"cartId":[8,"cart-id"],"products":[16],"customer":[16],"loadProducts":[16],"value":[32],"loading":[32],"message":[32],"phone":[32],"pinInfo":[32],"step":[32],"bonus":[32],"sucess":[32],"error":[32],"config":[32],"hasApplyBonus":[32],"setStep":[64],"processBonus":[64]}],[4,"loading-container",{"loading":[4]}]]],["giftback-finish_4.cjs",[[1,"giftback-pin",{"sent":[16],"validate":[16],"cancel":[16],"loading":[4],"pin":[32],"isVerified":[32]}],[1,"giftback-progress",{"loading":[4],"bonus":[16],"reserve":[16],"cancel":[16],"usedValue":[32]}],[0,"name-input",{"value":[1],"loading":[4],"applyName":[16],"cancel":[16],"newValue":[32],"message":[32]}],[1,"giftback-finish"]]]], options);
|
22
|
+
return index.bootstrapLazy([["crm-bonus.cjs",[[2,"crm-bonus",{"userId":[2,"userid"],"storeName":[8,"storename"],"productsInString":[1,"products"],"cartId":[8,"cartid"],"showModal":[32],"products":[32],"customer":[32],"loading":[32],"message":[32],"phone":[32],"canCancel":[32],"amountCancel":[32],"sent":[32],"session":[32],"loading_reprocess":[32],"resetBonus":[64],"reprocess":[64]},null,{"productsInString":["watchProducts"]}]]],["crm-bonus-form.cjs",[[1,"crm-bonus-form",{"storeName":[8,"storename"],"cartId":[8,"cart-id"],"products":[16],"customer":[16],"sent":[16],"stepNext":[2,"step-next"],"phone":[2],"loadingModal":[4,"loading-modal"],"saveStore":[16],"cancel":[16],"handleCustomerName":[16],"loading":[32],"step":[32],"message":[32],"bonus":[32],"setStep":[64]}]]],["crm-bonus-note.cjs",[[0,"crm-bonus-note",{"cartId":[8,"cartid"],"storename":[8],"url":[32],"config":[32],"bonus":[32]}]]],["phone-cancel-input.cjs",[[0,"phone-cancel-input",{"sendPin":[16],"loading":[4],"value":[1]}]]],["phone-input.cjs",[[0,"phone-input",{"sendPin":[16],"loading":[4],"value":[1]}]]],["app-modal.cjs",[[1,"app-modal",{"isOpen":[516,"is-open"],"modalTitle":[1,"modal-title"]}]]],["pedido-finalizado.cjs",[[0,"pedido-finalizado",{"cartId":[1,"cartid"],"orderId":[2,"orderid"],"metadadoString":[1,"metadado"]}]]],["crm-button.cjs",[[0,"crm-button",{"txtBtn":[1,"txt-btn"],"loading":[4],"handleClick":[16]}]]],["phone-input-mask.cjs",[[1,"phone-input-mask",{"initialValue":[1,"initial-value"],"disabled":[4],"phone":[32],"message":[32],"getPhone":[64]}]]],["loading-spinner.cjs",[[1,"loading-spinner",{"size":[1],"color":[1]}]]],["countdown-timer_5.cjs",[[0,"phone-form",{"value":[1],"loading":[4],"handlerSubmit":[16],"config":[16]}],[1,"pin-form",{"validate":[16],"cancel":[16],"resend":[16],"sent":[16],"loading":[4],"phone":[1],"config":[16],"pin":[32],"isVerified":[32],"canResend":[32]}],[0,"giftback-info",{"loading":[4],"bonus":[16],"reserve":[16],"cancel":[16],"usedValue":[32],"selectedOption":[32],"sliderPosition":[32]},null,{"bonus":["changedBonus"]}],[1,"countdown-timer",{"downtime":[16],"counter":[32]}],[0,"crm-tooltip",{"text":[1],"identity":[1]}]]],["crm-giftback-form_2.cjs",[[0,"crm-giftback-form",{"storeName":[8,"storename"],"cartId":[8,"cart-id"],"products":[16],"customer":[16],"loadProducts":[16],"value":[32],"loading":[32],"message":[32],"phone":[32],"pinInfo":[32],"step":[32],"bonus":[32],"sucess":[32],"error":[32],"config":[32],"hasApplyBonus":[32],"setStep":[64],"processBonus":[64]}],[4,"loading-container",{"loading":[4]}]]],["giftback-finish_4.cjs",[[1,"giftback-pin",{"sent":[16],"validate":[16],"cancel":[16],"loading":[4],"pin":[32],"isVerified":[32]}],[1,"giftback-progress",{"loading":[4],"bonus":[16],"reserve":[16],"cancel":[16],"usedValue":[32]}],[0,"name-input",{"value":[1],"loading":[4],"applyName":[16],"cancel":[16],"newValue":[32],"message":[32]}],[1,"giftback-finish"]]]], options);
|
23
23
|
});
|
24
24
|
|
25
25
|
exports.setNonce = index.setNonce;
|
package/dist/cjs/loader.cjs.js
CHANGED
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
9
9
|
if (typeof window === 'undefined') return undefined;
|
10
10
|
await appGlobals.globalScripts();
|
11
|
-
return index.bootstrapLazy([["crm-bonus.cjs",[[2,"crm-bonus",{"userId":[2,"userid"],"storeName":[8,"storename"],"productsInString":[1,"products"],"cartId":[8,"cartid"],"showModal":[32],"products":[32],"customer":[32],"loading":[32],"message":[32],"phone":[32],"canCancel":[32],"amountCancel":[32],"sent":[32],"session":[32],"loading_reprocess":[32],"resetBonus":[64],"reprocess":[64]},null,{"productsInString":["watchProducts"]}]]],["crm-bonus-form.cjs",[[1,"crm-bonus-form",{"storeName":[8,"storename"],"cartId":[8,"cart-id"],"products":[16],"customer":[16],"sent":[16],"stepNext":[2,"step-next"],"phone":[2],"loadingModal":[4,"loading-modal"],"saveStore":[16],"cancel":[16],"handleCustomerName":[16],"loading":[32],"step":[32],"message":[32],"bonus":[32],"setStep":[64]}]]],["crm-bonus-note.cjs",[[0,"crm-bonus-note",{"cartId":[8,"cartid"],"storename":[8],"url":[32],"config":[32],"bonus":[32]}]]],["phone-cancel-input.cjs",[[0,"phone-cancel-input",{"sendPin":[16],"loading":[4],"value":[1]}]]],["phone-input.cjs",[[0,"phone-input",{"sendPin":[16],"loading":[4],"value":[1]}]]],["app-modal.cjs",[[1,"app-modal",{"isOpen":[516,"is-open"],"modalTitle":[1,"modal-title"]}]]],["pedido-finalizado.cjs",[[0,"pedido-finalizado",{"cartId":[1,"cartid"],"orderId":[2,"orderid"],"metadadoString":[1,"metadado"]}]]],["crm-button.cjs",[[0,"crm-button",{"txtBtn":[1,"txt-btn"],"loading":[4],"handleClick":[16]}]]],["phone-input-mask.cjs",[[1,"phone-input-mask",{"initialValue":[1,"initial-value"],"disabled":[4],"phone":[32],"message":[32],"getPhone":[64]}]]],["loading-spinner.cjs",[[1,"loading-spinner",{"size":[1],"color":[1]}]]],["countdown-timer_5.cjs",[[0,"phone-form",{"value":[1],"loading":[4],"handlerSubmit":[16],"config":[16]}],[1,"pin-form",{"validate":[16],"cancel":[16],"resend":[16],"sent":[16],"loading":[4],"phone":[1],"config":[16],"pin":[32],"isVerified":[32],"canResend":[32]}],[0,"giftback-info",{"loading":[4],"bonus":[16],"reserve":[16],"cancel":[16],"usedValue":[32],"selectedOption":[32],"sliderPosition":[32]},null,{"bonus":["changedBonus"]}],[1,"countdown-timer",{"downtime":[16],"counter":[32]}],[0,"crm-tooltip",{"text":[1]}]]],["crm-giftback-form_2.cjs",[[0,"crm-giftback-form",{"storeName":[8,"storename"],"cartId":[8,"cart-id"],"products":[16],"customer":[16],"loadProducts":[16],"value":[32],"loading":[32],"message":[32],"phone":[32],"pinInfo":[32],"step":[32],"bonus":[32],"sucess":[32],"error":[32],"config":[32],"hasApplyBonus":[32],"setStep":[64],"processBonus":[64]}],[4,"loading-container",{"loading":[4]}]]],["giftback-finish_4.cjs",[[1,"giftback-pin",{"sent":[16],"validate":[16],"cancel":[16],"loading":[4],"pin":[32],"isVerified":[32]}],[1,"giftback-progress",{"loading":[4],"bonus":[16],"reserve":[16],"cancel":[16],"usedValue":[32]}],[0,"name-input",{"value":[1],"loading":[4],"applyName":[16],"cancel":[16],"newValue":[32],"message":[32]}],[1,"giftback-finish"]]]], options);
|
11
|
+
return index.bootstrapLazy([["crm-bonus.cjs",[[2,"crm-bonus",{"userId":[2,"userid"],"storeName":[8,"storename"],"productsInString":[1,"products"],"cartId":[8,"cartid"],"showModal":[32],"products":[32],"customer":[32],"loading":[32],"message":[32],"phone":[32],"canCancel":[32],"amountCancel":[32],"sent":[32],"session":[32],"loading_reprocess":[32],"resetBonus":[64],"reprocess":[64]},null,{"productsInString":["watchProducts"]}]]],["crm-bonus-form.cjs",[[1,"crm-bonus-form",{"storeName":[8,"storename"],"cartId":[8,"cart-id"],"products":[16],"customer":[16],"sent":[16],"stepNext":[2,"step-next"],"phone":[2],"loadingModal":[4,"loading-modal"],"saveStore":[16],"cancel":[16],"handleCustomerName":[16],"loading":[32],"step":[32],"message":[32],"bonus":[32],"setStep":[64]}]]],["crm-bonus-note.cjs",[[0,"crm-bonus-note",{"cartId":[8,"cartid"],"storename":[8],"url":[32],"config":[32],"bonus":[32]}]]],["phone-cancel-input.cjs",[[0,"phone-cancel-input",{"sendPin":[16],"loading":[4],"value":[1]}]]],["phone-input.cjs",[[0,"phone-input",{"sendPin":[16],"loading":[4],"value":[1]}]]],["app-modal.cjs",[[1,"app-modal",{"isOpen":[516,"is-open"],"modalTitle":[1,"modal-title"]}]]],["pedido-finalizado.cjs",[[0,"pedido-finalizado",{"cartId":[1,"cartid"],"orderId":[2,"orderid"],"metadadoString":[1,"metadado"]}]]],["crm-button.cjs",[[0,"crm-button",{"txtBtn":[1,"txt-btn"],"loading":[4],"handleClick":[16]}]]],["phone-input-mask.cjs",[[1,"phone-input-mask",{"initialValue":[1,"initial-value"],"disabled":[4],"phone":[32],"message":[32],"getPhone":[64]}]]],["loading-spinner.cjs",[[1,"loading-spinner",{"size":[1],"color":[1]}]]],["countdown-timer_5.cjs",[[0,"phone-form",{"value":[1],"loading":[4],"handlerSubmit":[16],"config":[16]}],[1,"pin-form",{"validate":[16],"cancel":[16],"resend":[16],"sent":[16],"loading":[4],"phone":[1],"config":[16],"pin":[32],"isVerified":[32],"canResend":[32]}],[0,"giftback-info",{"loading":[4],"bonus":[16],"reserve":[16],"cancel":[16],"usedValue":[32],"selectedOption":[32],"sliderPosition":[32]},null,{"bonus":["changedBonus"]}],[1,"countdown-timer",{"downtime":[16],"counter":[32]}],[0,"crm-tooltip",{"text":[1],"identity":[1]}]]],["crm-giftback-form_2.cjs",[[0,"crm-giftback-form",{"storeName":[8,"storename"],"cartId":[8,"cart-id"],"products":[16],"customer":[16],"loadProducts":[16],"value":[32],"loading":[32],"message":[32],"phone":[32],"pinInfo":[32],"step":[32],"bonus":[32],"sucess":[32],"error":[32],"config":[32],"hasApplyBonus":[32],"setStep":[64],"processBonus":[64]}],[4,"loading-container",{"loading":[4]}]]],["giftback-finish_4.cjs",[[1,"giftback-pin",{"sent":[16],"validate":[16],"cancel":[16],"loading":[4],"pin":[32],"isVerified":[32]}],[1,"giftback-progress",{"loading":[4],"bonus":[16],"reserve":[16],"cancel":[16],"usedValue":[32]}],[0,"name-input",{"value":[1],"loading":[4],"applyName":[16],"cancel":[16],"newValue":[32],"message":[32]}],[1,"giftback-finish"]]]], options);
|
12
12
|
};
|
13
13
|
|
14
14
|
exports.setNonce = index.setNonce;
|
package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js
CHANGED
@@ -65,11 +65,11 @@ export class GiftbackInfo {
|
|
65
65
|
const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;
|
66
66
|
const translateDescription = i18next.t("giftDescription", { amount: `${this.bonus.totalBonus.toFixed(2).replace(".", ",")}`, custom_name: "Giftback" });
|
67
67
|
const limit = defineLimit(remainingGiftback);
|
68
|
-
return (h("div", { key: '
|
68
|
+
return (h("div", { key: 'c1176784d8fe227f26ea11facef2897619b5e1a4', class: "giftback-container" }, h("div", { key: 'f17f2ab172829eea4b2b239a119c05bb418a9ab7', class: "container-description" }, h("p", { key: '9764f9d185761cbd6458c922d56e5cea11a69bdd', innerHTML: translateDescription }), h("crm-tooltip", { key: '7429e9509544335bc21886c785fe47d3855c240a', identity: "crm-role-description", text: i18next.t("labelUseGiftback", { minimumPurchase: this.bonus.minimumPurchase, expírationDate: formatDateToBr(this.bonus.firstValidityDate) }) })), h("div", { key: 'd6b3a9c9745510e50b1ad2c1a58c4b8998f825a6', class: "slider-wrapper" }, h("div", { key: 'be44d7c3709865d80f93e54f1ac4e58a026d6d0b', class: "slider-value", style: {
|
69
69
|
left: `calc(${this.sliderPosition}% - 20px)`, // Ajuste para centralizar o texto
|
70
|
-
} }, "R$ ", this.usedValue.toFixed(2).replace(".", ",")), h("input", { key: '
|
70
|
+
} }, "R$ ", this.usedValue.toFixed(2).replace(".", ",")), h("input", { key: '49c16e5ff1dffcb431f449993dd134cae5129451', id: "position_value_id", disabled: true, type: "range", min: "0", max: this.bonus.totalBonus, value: this.usedValue, class: "slider", step: "0.01", onInput: (event) => this.handleSliderChange(event), style: {
|
71
71
|
background: `linear-gradient(to right, #6D6D5F ${this.sliderPosition}%, #ddd ${this.sliderPosition}%)`,
|
72
|
-
} })), limit.isComplete && (h("p", { key: '
|
72
|
+
} })), limit.isComplete && (h("p", { key: 'cf1969a181b2723ee801b4ea767bcef601761b58' }, i18next.t("maxAmount"))), !limit.isComplete && (h("div", { key: 'f4d9cfcf895ac76fc7fe4bd84a8eeb0598b2c5a8', class: "container-description" }, h("p", { key: 'fa2074e6e43c96d4fbe1be21744c283dc79c9fb2' }, "Adicione ", h("strong", { key: 'f3f1ba8d8fb1522c8a3c633887c38113d16c9421' }, "R$ ", remainingGiftback < 0 ? "0,00" : remainingGiftback.toFixed(2).replace(".", ",")), " ao carrinho para atingir o valor m\u00E1ximo! ", h("crm-tooltip", { key: '5688ae6e5d56896828c85abc2d1e686716b30b99', identity: "crm-max-description", text: i18next.t("labelamountPartial") })))), h("div", { key: '933b5d3dfe851a1ec25da562c68294528252b3ff', class: "options" }, h("div", { key: 'ce0c0ff87f36cea8bdec040dfff336a20bfca767', class: "options-option" }, h("input", { key: '780e9d3fc0b3e30c774255a8a22190a9a31c6f94', type: "radio", name: "giftbackOption", value: "use", checked: this.selectedOption === 'use', onChange: () => this.handleOptionChange('use') }), h("p", { key: 'accc8fefb955ce25f1b1d58c83e26732c9a9e63a' }, "Usar o meu Giftback")), h("div", { key: '9bff7c08c9ad32fbec92af3a7a2d15675f04b903', class: "options-option" }, h("input", { key: 'd27fc0ad93f0f9202ee180ab65910bddf836e1f5', type: "radio", name: "giftbackOption", value: "dontUse", checked: this.selectedOption === 'dontUse', onChange: () => this.handleOptionChange('dontUse') }), h("p", { key: '89bb7edfd129907ebf8dd8514ff2ec6d800d65e0' }, "N\u00E3o usar o meu Giftback"))), h("div", { key: '1ee7b71ffc3aef9bde5cd48be793c74c42855d8f', class: "info-box" }, "O Giftback ser\u00E1 aplicado na pr\u00F3xima etapa.")));
|
73
73
|
}
|
74
74
|
static get is() { return "giftback-info"; }
|
75
75
|
static get originalStyleUrls() {
|
package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"giftback-info.js","sourceRoot":"","sources":["../../../../../../src/components/giftback-form/subcomponents/giftback-info/giftback-info.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAGjE,OAAO,OAAO,MAAM,uBAAuB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAMtE,MAAM,OAAO,YAAY;;yBACQ,CAAC;8BACI,MAAM;uBAEb,KAAK;qBACC;YAC7B,UAAU,EAAE,GAAG;YACf,MAAM,EAAE,EAAE;YACV,eAAe,EAAE,GAAG;YACpB,YAAY,EAAE,EAAE;YAChB,eAAe,EAAE,GAAG;YACpB,iBAAiB,E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N,4DAAK,KAAK,EAAC,gBAAgB;oBACvB,8DACI,IAAI,EAAC,OAAO,EACZ,IAAI,EAAC,gBAAgB,EACrB,KAAK,EAAC,SAAS,EACf,OAAO,EAAE,IAAI,CAAC,cAAc,KAAK,SAAS,EAC1C,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,GACpD;oBACF,2FAA8B,CAC5B,CACJ;YACN,4DAAK,KAAK,EAAC,UAAU,2DAEf,CACJ,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Prop, State, Watch, h } from \"@stencil/core\";\nimport { IBonus } from \"../../../../dto/validate.pin.bonus\";\n\nimport i18next from '../../../../i18n/i18n'\nimport { USED_KEY } from \"../../../../utils/keys.storage\";\nimport { defineLimit, formatDateToBr } from \"../../../../utils/utils\";\n\n@Component({\n tag: 'giftback-info',\n styleUrls: ['giftback-info.css']\n})\nexport class GiftbackInfo {\n @State() usedValue: number = 0;\n @State() selectedOption: string = 'none';\n\n @Prop() loading: boolean = false;\n @Prop() bonus: Partial<IBonus> = {\n totalBonus: 150,\n cartId: \"\",\n minimumPurchase: 500,\n bonusBalance: 50,\n calculatedValue: 150,\n firstValidityDate: \"\",\n totalValue: 400\n };\n @Prop() reserve: (amountRedeemed: number) => void;\n @Prop() cancel: () => void;\n\n @State() sliderPosition: number = 50;\n\n @Watch(\"bonus\")\n changedBonus() {\n this.updateBonus()\n }\n\n private updateBonus() {\n this.usedValue = this.bonus.bonusBalance;\n this.buildPositionSlider(0, this.bonus.totalBonus);\n }\n\n componentWillLoad() {\n this.updateBonus();\n this.selectedOption = localStorage.getItem(USED_KEY);\n }\n\n handleSliderChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.usedValue = parseFloat(input.value);\n\n // Calculando a posição do texto com base no valor do slider\n // const percentage = ((this.usedValue - parseInt(input.min)) / (parseInt(input.max) - parseInt(input.min))) * 100;\n // this.sliderPosition = percentage;\n\n this.buildPositionSlider(parseFloat(input.min), parseFloat(input.max))\n }\n\n componentDidLoad() {\n const input: any = document.getElementById(\"position_value_id\")\n \n input.value = this.bonus.bonusBalance;\n }\n\n\n private buildPositionSlider(min: number, max: number) {\n // Calculando a posição do texto com base no valor do slider\n const percentage = ((this.usedValue - min) / (max - min)) * 100;\n this.sliderPosition = percentage;\n }\n\n async handleOptionChange(option: string) {\n this.selectedOption = option;\n \n localStorage.setItem(USED_KEY, option);\n switch (this.selectedOption) {\n case 'use':\n await this.reserve(this.usedValue)\n break;\n case 'dontUse':\n await this.cancel();\n break;\n default:\n }\n }\n\n render() {\n const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;\n\n const translateDescription = i18next.t(\"giftDescription\", { amount: `${this.bonus.totalBonus.toFixed(2).replace(\".\", \",\")}`, custom_name: \"Giftback\" })\n\n const limit = defineLimit(remainingGiftback)\n return (\n\n <div class=\"giftback-container\">\n <div class=\"container-description\">\n <p innerHTML={translateDescription}></p>\n <crm-tooltip text={i18next.t(\"labelUseGiftback\", { minimumPurchase: this.bonus.minimumPurchase, expírationDate: formatDateToBr(this.bonus.firstValidityDate) })} />\n </div>\n <div class=\"slider-wrapper\">\n <div\n class=\"slider-value\"\n style={{\n left: `calc(${this.sliderPosition}% - 20px)`, // Ajuste para centralizar o texto\n\n }}\n >\n R$ {this.usedValue.toFixed(2).replace(\".\", \",\")}\n </div>\n <input\n id=\"position_value_id\"\n disabled\n type=\"range\"\n min=\"0\"\n max={this.bonus.totalBonus}\n value={this.usedValue}\n class=\"slider\"\n step=\"0.01\"\n onInput={(event) => this.handleSliderChange(event)}\n style={{\n background: `linear-gradient(to right, #6D6D5F ${this.sliderPosition}%, #ddd ${this.sliderPosition}%)`,\n }}\n />\n </div>\n\n {\n limit.isComplete && (\n <p>\n {i18next.t(\"maxAmount\")}\n </p>\n )\n }\n\n {\n !limit.isComplete && (\n <div class=\"container-description\">\n <p>\n Adicione <strong>R$ {remainingGiftback < 0 ? \"0,00\" : remainingGiftback.toFixed(2).replace(\".\", \",\")}</strong> ao carrinho para atingir o valor\n máximo! <crm-tooltip text={i18next.t(\"labelamountPartial\")} />\n </p>\n\n \n </div>\n )\n }\n\n\n <div class=\"options\">\n <div class=\"options-option\">\n <input\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"use\"\n checked={this.selectedOption === 'use'}\n onChange={() => this.handleOptionChange('use')}\n />\n <p>Usar o meu Giftback</p>\n </div>\n <div class=\"options-option\">\n <input\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"dontUse\"\n checked={this.selectedOption === 'dontUse'}\n onChange={() => this.handleOptionChange('dontUse')}\n />\n <p>Não usar o meu Giftback</p>\n </div>\n </div>\n <div class=\"info-box\">\n O Giftback será aplicado na próxima etapa.\n </div>\n </div>\n );\n }\n}"]}
|
1
|
+
{"version":3,"file":"giftback-info.js","sourceRoot":"","sources":["../../../../../../src/components/giftback-form/subcomponents/giftback-info/giftback-info.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAGjE,OAAO,OAAO,MAAM,uBAAuB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAMtE,MAAM,OAAO,YAAY;;yBACQ,CAAC;8BACI,MAAM;uBAEb,KAAK;qBACC;YAC7B,UAAU,EAAE,GAAG;YACf,MAAM,EAAE,EAAE;YACV,eAAe,EAAE,GAAG;YACpB,YAAY,EAAE,EAAE;YAChB,eAAe,EAAE,GAAG;YACpB,iBAAiB,EAAE,EAAE;YACrB,UAAU,EAAE,GAAG;SAClB;;;8BAIiC,EAAE;;IAGpC,YAA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EAAC,gBAAgB;oBACvB,8DACI,IAAI,EAAC,OAAO,EACZ,IAAI,EAAC,gBAAgB,EACrB,KAAK,EAAC,SAAS,EACf,OAAO,EAAE,IAAI,CAAC,cAAc,KAAK,SAAS,EAC1C,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,GACpD;oBACF,2FAA8B,CAC5B,CACJ;YACN,4DAAK,KAAK,EAAC,UAAU,2DAEf,CACJ,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Prop, State, Watch, h } from \"@stencil/core\";\nimport { IBonus } from \"../../../../dto/validate.pin.bonus\";\n\nimport i18next from '../../../../i18n/i18n'\nimport { USED_KEY } from \"../../../../utils/keys.storage\";\nimport { defineLimit, formatDateToBr } from \"../../../../utils/utils\";\n\n@Component({\n tag: 'giftback-info',\n styleUrls: ['giftback-info.css']\n})\nexport class GiftbackInfo {\n @State() usedValue: number = 0;\n @State() selectedOption: string = 'none';\n\n @Prop() loading: boolean = false;\n @Prop() bonus: Partial<IBonus> = {\n totalBonus: 150,\n cartId: \"\",\n minimumPurchase: 500,\n bonusBalance: 50,\n calculatedValue: 150,\n firstValidityDate: \"\",\n totalValue: 400\n };\n @Prop() reserve: (amountRedeemed: number) => void;\n @Prop() cancel: () => void;\n\n @State() sliderPosition: number = 50;\n\n @Watch(\"bonus\")\n changedBonus() {\n this.updateBonus()\n }\n\n private updateBonus() {\n this.usedValue = this.bonus.bonusBalance;\n this.buildPositionSlider(0, this.bonus.totalBonus);\n }\n\n componentWillLoad() {\n this.updateBonus();\n this.selectedOption = localStorage.getItem(USED_KEY);\n }\n\n handleSliderChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.usedValue = parseFloat(input.value);\n\n // Calculando a posição do texto com base no valor do slider\n // const percentage = ((this.usedValue - parseInt(input.min)) / (parseInt(input.max) - parseInt(input.min))) * 100;\n // this.sliderPosition = percentage;\n\n this.buildPositionSlider(parseFloat(input.min), parseFloat(input.max))\n }\n\n componentDidLoad() {\n const input: any = document.getElementById(\"position_value_id\")\n\n input.value = this.bonus.bonusBalance;\n }\n\n\n private buildPositionSlider(min: number, max: number) {\n // Calculando a posição do texto com base no valor do slider\n const percentage = ((this.usedValue - min) / (max - min)) * 100;\n this.sliderPosition = percentage;\n }\n\n async handleOptionChange(option: string) {\n this.selectedOption = option;\n\n localStorage.setItem(USED_KEY, option);\n switch (this.selectedOption) {\n case 'use':\n await this.reserve(this.usedValue)\n break;\n case 'dontUse':\n await this.cancel();\n break;\n default:\n }\n }\n\n render() {\n const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;\n\n const translateDescription = i18next.t(\"giftDescription\", { amount: `${this.bonus.totalBonus.toFixed(2).replace(\".\", \",\")}`, custom_name: \"Giftback\" })\n\n const limit = defineLimit(remainingGiftback)\n return (\n\n <div class=\"giftback-container\">\n <div class=\"container-description\">\n <p innerHTML={translateDescription}></p>\n <crm-tooltip identity=\"crm-role-description\" text={i18next.t(\"labelUseGiftback\", { minimumPurchase: this.bonus.minimumPurchase, expírationDate: formatDateToBr(this.bonus.firstValidityDate) })} />\n </div>\n <div class=\"slider-wrapper\">\n <div\n class=\"slider-value\"\n style={{\n left: `calc(${this.sliderPosition}% - 20px)`, // Ajuste para centralizar o texto\n\n }}\n >\n R$ {this.usedValue.toFixed(2).replace(\".\", \",\")}\n </div>\n <input\n id=\"position_value_id\"\n disabled\n type=\"range\"\n min=\"0\"\n max={this.bonus.totalBonus}\n value={this.usedValue}\n class=\"slider\"\n step=\"0.01\"\n onInput={(event) => this.handleSliderChange(event)}\n style={{\n background: `linear-gradient(to right, #6D6D5F ${this.sliderPosition}%, #ddd ${this.sliderPosition}%)`,\n }}\n />\n </div>\n\n {\n limit.isComplete && (\n <p>\n {i18next.t(\"maxAmount\")}\n </p>\n )\n }\n\n {\n !limit.isComplete && (\n <div class=\"container-description\">\n <p>\n Adicione <strong>R$ {remainingGiftback < 0 ? \"0,00\" : remainingGiftback.toFixed(2).replace(\".\", \",\")}</strong> ao carrinho para atingir o valor\n máximo! <crm-tooltip identity=\"crm-max-description\" text={i18next.t(\"labelamountPartial\")} />\n </p>\n </div>\n )\n }\n\n\n <div class=\"options\">\n <div class=\"options-option\">\n <input\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"use\"\n checked={this.selectedOption === 'use'}\n onChange={() => this.handleOptionChange('use')}\n />\n <p>Usar o meu Giftback</p>\n </div>\n <div class=\"options-option\">\n <input\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"dontUse\"\n checked={this.selectedOption === 'dontUse'}\n onChange={() => this.handleOptionChange('dontUse')}\n />\n <p>Não usar o meu Giftback</p>\n </div>\n </div>\n <div class=\"info-box\">\n O Giftback será aplicado na próxima etapa.\n </div>\n </div>\n );\n }\n}"]}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
& img {
|
5
5
|
width: 16px;
|
6
|
-
|
6
|
+
margin-left: 3px;
|
7
7
|
position: relative;
|
8
8
|
}
|
9
9
|
}
|
@@ -11,7 +11,6 @@
|
|
11
11
|
.crm-tooltip {
|
12
12
|
position: relative;
|
13
13
|
display: inline-block;
|
14
|
-
border-bottom: 1px dotted black;
|
15
14
|
}
|
16
15
|
|
17
16
|
.crm-tooltip .tooltiptext {
|
@@ -29,6 +28,22 @@
|
|
29
28
|
margin-left: -238px;
|
30
29
|
}
|
31
30
|
|
31
|
+
@media (max-width: 410px) {
|
32
|
+
.crm-tooltip .tooltiptext {
|
33
|
+
margin-left: -14px;
|
34
|
+
}
|
35
|
+
|
36
|
+
.crm-tooltip #crm-role-description {
|
37
|
+
margin-left: -151px;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
@media (max-width: 250px) {
|
42
|
+
.crm-tooltip .tooltiptext {
|
43
|
+
margin-left: -201px;
|
44
|
+
}
|
45
|
+
}
|
46
|
+
|
32
47
|
.crm-tooltip:hover .tooltiptext {
|
33
48
|
visibility: visible;
|
34
49
|
}
|
@@ -3,9 +3,10 @@ import info from "../../assets/svg/info-circle-svgrepo-com.svg";
|
|
3
3
|
export class Tooltip {
|
4
4
|
constructor() {
|
5
5
|
this.text = undefined;
|
6
|
+
this.identity = undefined;
|
6
7
|
}
|
7
8
|
render() {
|
8
|
-
return (h("div", { key: '
|
9
|
+
return (h("div", { key: '8d7de09a39f9f3412c5ee51e884a9900f65ad261', class: "crm-tooltip-container crm-tooltip" }, h("img", { key: '7605616f8135d1009a4c8f6a272cedfd66f10b88', src: info }), h("span", { key: '5b7b384d39f5c6b4d733ad129bd99ba8670bde8e', id: this.identity, class: "tooltiptext" }, this.text)));
|
9
10
|
}
|
10
11
|
static get is() { return "crm-tooltip"; }
|
11
12
|
static get originalStyleUrls() {
|
@@ -36,6 +37,23 @@ export class Tooltip {
|
|
36
37
|
},
|
37
38
|
"attribute": "text",
|
38
39
|
"reflect": false
|
40
|
+
},
|
41
|
+
"identity": {
|
42
|
+
"type": "string",
|
43
|
+
"mutable": false,
|
44
|
+
"complexType": {
|
45
|
+
"original": "string",
|
46
|
+
"resolved": "string",
|
47
|
+
"references": {}
|
48
|
+
},
|
49
|
+
"required": false,
|
50
|
+
"optional": false,
|
51
|
+
"docs": {
|
52
|
+
"tags": [],
|
53
|
+
"text": ""
|
54
|
+
},
|
55
|
+
"attribute": "identity",
|
56
|
+
"reflect": false
|
39
57
|
}
|
40
58
|
};
|
41
59
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../../../src/components/tooltip/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,IAAI,MAAM,8CAA8C,CAAC;AAOhE,MAAM,OAAO,OAAO
|
1
|
+
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../../../src/components/tooltip/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,IAAI,MAAM,8CAA8C,CAAC;AAOhE,MAAM,OAAO,OAAO;;;;;IAKhB,MAAM;QACF,OAAO,CACH,4DAAK,KAAK,EAAC,mCAAmC;YAC1C,4DAAK,GAAG,EAAE,IAAI,GAAI;YAClB,6DAAM,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAC,aAAa,IAAE,IAAI,CAAC,IAAI,CAAQ,CAC7D,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Prop } from \"@stencil/core\";\nimport info from '../../assets/svg/info-circle-svgrepo-com.svg';\n\n\n@Component({\n tag: 'crm-tooltip',\n styleUrl: 'crm-tooltip.css'\n})\nexport class Tooltip {\n\n @Prop() text: string;\n @Prop() identity: string;\n\n render() {\n return (\n <div class=\"crm-tooltip-container crm-tooltip\">\n <img src={info} />\n <span id={this.identity} class=\"tooltiptext\">{this.text}</span>\n </div>\n );\n }\n}"]}
|
@@ -4,9 +4,9 @@ import { S as StepFormEnum } from './p-24bdfca4.js';
|
|
4
4
|
import { i as instance } from './p-e8c19a64.js';
|
5
5
|
import { d as defineCustomElement$b } from './p-078fe899.js';
|
6
6
|
import { d as defineCustomElement$a } from './p-2f30297f.js';
|
7
|
-
import { d as defineCustomElement$9 } from './p-
|
8
|
-
import { d as defineCustomElement$8 } from './p-
|
9
|
-
import { d as defineCustomElement$7 } from './p-
|
7
|
+
import { d as defineCustomElement$9 } from './p-645bae5b.js';
|
8
|
+
import { d as defineCustomElement$8 } from './p-284d8322.js';
|
9
|
+
import { d as defineCustomElement$7 } from './p-03183a03.js';
|
10
10
|
import { d as defineCustomElement$6 } from './p-f1fb885c.js';
|
11
11
|
import { d as defineCustomElement$5 } from './p-169fe768.js';
|
12
12
|
import { d as defineCustomElement$4 } from './p-f0449fc0.js';
|
@@ -2,7 +2,7 @@ import { p as proxyCustomElement, H, h } from './p-3e84f78c.js';
|
|
2
2
|
import { i as instance } from './p-e8c19a64.js';
|
3
3
|
import { U as USED_KEY } from './p-f9aeffc1.js';
|
4
4
|
import { d as defineLimit, a as formatDateToBr } from './p-d3bfac80.js';
|
5
|
-
import { d as defineCustomElement$1 } from './p-
|
5
|
+
import { d as defineCustomElement$1 } from './p-284d8322.js';
|
6
6
|
|
7
7
|
const giftbackInfoCss = ":host{--text-color:#6D6D5F}.giftback-container{display:flex;flex-direction:column;gap:14px}h3{font-size:1.2rem;margin-bottom:8px;color:#333}.container-description{display:flex;align-items:center;gap:5px;margin:0 0 10px 0}.container-description p{font-size:14px;font-weight:400;margin:0px}p{font-size:14px;color:#000}.value-display h2{color:#6D6D5F;font-size:1.6rem;margin:16px 0}input[type='range']{width:100%;margin:12px 0;-webkit-appearance:none;background:#ddd;height:4px;border-radius:4px;outline:none;padding:3px 0px 3px 3px}input[type=\"range\"]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;background:rgb(109, 109, 95);border-radius:50%;cursor:pointer}.options{margin:0px 0;display:flex;gap:10px;flex-direction:column}.options label{display:flex;margin:0px 0;font-size:0.9rem;color:#333;align-items:center}.options input[type='radio']{margin-right:8px;height:16px;width:16px}.options input[type='radio']{appearance:none;-webkit-appearance:none;margin-right:8px;width:16px;height:16px;border:2px solid #ddd;border-radius:50%;background-color:#fff;cursor:pointer;transition:all 0.3s;padding:0px}.options input[type='radio']:checked{border-color:#000;background-color:#FAFAFA;border:4px solid #000}.info-box{background-color:#f9f9f9;border:1px solid #e0e0e0;border-radius:4px;padding:8px;font-size:14px;color:#262626;line-height:20px}.info-icon{font-size:0.9rem;cursor:pointer;color:#888}h3{font-size:1.2rem;margin-bottom:8px;color:#333}.slider-wrapper{position:relative;margin:21px 0px 0px 0px}.slider{width:100%;-webkit-appearance:none;background:#ddd;height:4px;border-radius:2px;outline:none}.slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;background:var(--text-color);border-radius:50%;cursor:pointer}.slider-value{position:absolute;top:-30px;font-size:16px;font-weight:700;color:var(--text-color);transform:translateX(-50%);white-space:nowrap;}.options-option{display:flex}";
|
8
8
|
const GiftbackInfoStyle0 = giftbackInfoCss;
|
@@ -71,11 +71,11 @@ const GiftbackInfo = /*@__PURE__*/ proxyCustomElement(class GiftbackInfo extends
|
|
71
71
|
const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;
|
72
72
|
const translateDescription = instance.t("giftDescription", { amount: `${this.bonus.totalBonus.toFixed(2).replace(".", ",")}`, custom_name: "Giftback" });
|
73
73
|
const limit = defineLimit(remainingGiftback);
|
74
|
-
return (h("div", { key: '
|
74
|
+
return (h("div", { key: 'c1176784d8fe227f26ea11facef2897619b5e1a4', class: "giftback-container" }, h("div", { key: 'f17f2ab172829eea4b2b239a119c05bb418a9ab7', class: "container-description" }, h("p", { key: '9764f9d185761cbd6458c922d56e5cea11a69bdd', innerHTML: translateDescription }), h("crm-tooltip", { key: '7429e9509544335bc21886c785fe47d3855c240a', identity: "crm-role-description", text: instance.t("labelUseGiftback", { minimumPurchase: this.bonus.minimumPurchase, expírationDate: formatDateToBr(this.bonus.firstValidityDate) }) })), h("div", { key: 'd6b3a9c9745510e50b1ad2c1a58c4b8998f825a6', class: "slider-wrapper" }, h("div", { key: 'be44d7c3709865d80f93e54f1ac4e58a026d6d0b', class: "slider-value", style: {
|
75
75
|
left: `calc(${this.sliderPosition}% - 20px)`, // Ajuste para centralizar o texto
|
76
|
-
} }, "R$ ", this.usedValue.toFixed(2).replace(".", ",")), h("input", { key: '
|
76
|
+
} }, "R$ ", this.usedValue.toFixed(2).replace(".", ",")), h("input", { key: '49c16e5ff1dffcb431f449993dd134cae5129451', id: "position_value_id", disabled: true, type: "range", min: "0", max: this.bonus.totalBonus, value: this.usedValue, class: "slider", step: "0.01", onInput: (event) => this.handleSliderChange(event), style: {
|
77
77
|
background: `linear-gradient(to right, #6D6D5F ${this.sliderPosition}%, #ddd ${this.sliderPosition}%)`,
|
78
|
-
} })), limit.isComplete && (h("p", { key: '
|
78
|
+
} })), limit.isComplete && (h("p", { key: 'cf1969a181b2723ee801b4ea767bcef601761b58' }, instance.t("maxAmount"))), !limit.isComplete && (h("div", { key: 'f4d9cfcf895ac76fc7fe4bd84a8eeb0598b2c5a8', class: "container-description" }, h("p", { key: 'fa2074e6e43c96d4fbe1be21744c283dc79c9fb2' }, "Adicione ", h("strong", { key: 'f3f1ba8d8fb1522c8a3c633887c38113d16c9421' }, "R$ ", remainingGiftback < 0 ? "0,00" : remainingGiftback.toFixed(2).replace(".", ",")), " ao carrinho para atingir o valor m\u00E1ximo! ", h("crm-tooltip", { key: '5688ae6e5d56896828c85abc2d1e686716b30b99', identity: "crm-max-description", text: instance.t("labelamountPartial") })))), h("div", { key: '933b5d3dfe851a1ec25da562c68294528252b3ff', class: "options" }, h("div", { key: 'ce0c0ff87f36cea8bdec040dfff336a20bfca767', class: "options-option" }, h("input", { key: '780e9d3fc0b3e30c774255a8a22190a9a31c6f94', type: "radio", name: "giftbackOption", value: "use", checked: this.selectedOption === 'use', onChange: () => this.handleOptionChange('use') }), h("p", { key: 'accc8fefb955ce25f1b1d58c83e26732c9a9e63a' }, "Usar o meu Giftback")), h("div", { key: '9bff7c08c9ad32fbec92af3a7a2d15675f04b903', class: "options-option" }, h("input", { key: 'd27fc0ad93f0f9202ee180ab65910bddf836e1f5', type: "radio", name: "giftbackOption", value: "dontUse", checked: this.selectedOption === 'dontUse', onChange: () => this.handleOptionChange('dontUse') }), h("p", { key: '89bb7edfd129907ebf8dd8514ff2ec6d800d65e0' }, "N\u00E3o usar o meu Giftback"))), h("div", { key: '1ee7b71ffc3aef9bde5cd48be793c74c42855d8f', class: "info-box" }, "O Giftback ser\u00E1 aplicado na pr\u00F3xima etapa.")));
|
79
79
|
}
|
80
80
|
static get watchers() { return {
|
81
81
|
"bonus": ["changedBonus"]
|
@@ -114,4 +114,4 @@ defineCustomElement();
|
|
114
114
|
|
115
115
|
export { GiftbackInfo as G, defineCustomElement as d };
|
116
116
|
|
117
|
-
//# sourceMappingURL=p-
|
117
|
+
//# sourceMappingURL=p-03183a03.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"p-03183a03.js","mappings":";;;;;;AAAA,MAAM,eAAe,GAAG,k7DAAk7D,CAAC;AAC38D,2BAAe,eAAe;;MCUjB,YAAY;;;;yBACQ,CAAC;8BACI,MAAM;uBAEb,KAAK;qBACC;YAC7B,UAAU,EAAE,GAAG;YACf,MAAM,EAAE,EAAE;YACV,eAAe,EAAE,GAAG;YACpB,YAAY,EAAE,EAAE;YAChB,eAAe,EAAE,GAAG;YACpB,iBAAiB,EAAE,EAAE;YACrB,UAAU,EAAE,GAAG;SAClB;;;8BAIiC,EAAE;;IAGpC,YAAY;QACR,IAAI,CAAC,WAAW,EAAE,CAAA;KACrB;IAEO,WAAW;QACf,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,mBAAmB,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;KACtD;IAED,iBAAiB;QACb,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,CAAC,cAAc,GAAG,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;KACxD;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;;;;QAMzC,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CA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EAAEA,QAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,GAAI,CAC7F,CACF,CACT,EAIL,4DAAK,KAAK,EAAC,SAAS,IAChB,4DAAK,KAAK,EAAC,gBAAgB,IACvB,8DACI,IAAI,EAAC,OAAO,EACZ,IAAI,EAAC,gBAAgB,EACrB,KAAK,EAAC,KAAK,EACX,OAAO,EAAE,IAAI,CAAC,cAAc,KAAK,KAAK,EACtC,QAAQ,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,GAChD,EACF,kFAA0B,CACxB,EACN,4DAAK,KAAK,EAAC,gBAAgB,IACvB,8DACI,IAAI,EAAC,OAAO,EACZ,IAAI,EAAC,gBAAgB,EACrB,KAAK,EAAC,SAAS,EACf,OAAO,EAAE,IAAI,CAAC,cAAc,KAAK,SAAS,EAC1C,QAAQ,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,GACpD,EACF,2FAA8B,CAC5B,CACJ,EACN,4DAAK,KAAK,EAAC,UAAU,2DAEf,CACJ,EACR;KACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["i18next"],"sources":["src/components/giftback-form/subcomponents/giftback-info/giftback-info.css?tag=giftback-info","src/components/giftback-form/subcomponents/giftback-info/giftback-info.tsx"],"sourcesContent":[":host {\n --text-color: #6D6D5F\n}\n\n.giftback-container {\n display: flex;\n flex-direction: column;\n gap: 14px;\n}\n\nh3 {\n font-size: 1.2rem;\n margin-bottom: 8px;\n color: #333;\n}\n\n.container-description {\n display: flex;\n align-items: center;\n gap: 5px;\n margin: 0 0 10px 0;\n}\n\n.container-description p {\n font-size: 14px;\n font-weight: 400;\n margin: 0px;\n}\n\n\np {\n font-size: 14px;\n color: #000;\n}\n\n.value-display h2 {\n color: #6D6D5F;\n /* Verde para o valor atual */\n font-size: 1.6rem;\n margin: 16px 0;\n}\n\ninput[type='range'] {\n width: 100%;\n margin: 12px 0;\n -webkit-appearance: none;\n background: #ddd;\n height: 4px;\n border-radius: 4px;\n outline: none;\n padding: 3px 0px 3px 3px;\n}\n\n/* input[type='range']::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n background: var(--text-color);\n border-radius: 50%;\n cursor: pointer;\n} */\n\ninput[type=\"range\"]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 20px;\n height: 20px;\n background: rgb(109, 109, 95);\n /* Cor do botão */\n border-radius: 50%;\n cursor: pointer;\n}\n\n.options {\n margin: 0px 0;\n display: flex;\n gap: 10px;\n flex-direction: column;\n}\n\n.options label {\n display: flex;\n margin: 0px 0;\n font-size: 0.9rem;\n color: #333;\n align-items: center;\n}\n\n.options input[type='radio'] {\n margin-right: 8px;\n height: 16px;\n width: 16px;\n}\n\n.options input[type='radio'] {\n appearance: none;\n -webkit-appearance: none;\n margin-right: 8px;\n width: 16px;\n height: 16px;\n border: 2px solid #ddd;\n border-radius: 50%;\n background-color: #fff;\n cursor: pointer;\n transition: all 0.3s;\n padding: 0px;\n}\n\n.options input[type='radio']:checked {\n border-color: #000;\n background-color: #FAFAFA;\n border: 4px solid #000;\n}\n\n.info-box {\n background-color: #f9f9f9;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n padding: 8px;\n font-size: 14px;\n color: #262626;\n line-height: 20px;\n}\n\n.info-icon {\n font-size: 0.9rem;\n cursor: pointer;\n color: #888;\n}\n\nh3 {\n font-size: 1.2rem;\n margin-bottom: 8px;\n color: #333;\n}\n\n.slider-wrapper {\n position: relative;\n margin: 21px 0px 0px 0px;\n}\n\n.slider {\n width: 100%;\n -webkit-appearance: none;\n background: #ddd;\n height: 4px;\n border-radius: 2px;\n outline: none;\n}\n\n.slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n background: var(--text-color);\n /* Azul para o slider */\n border-radius: 50%;\n cursor: pointer;\n}\n\n.slider-value {\n position: absolute;\n top: -30px;\n /* Posição acima do slider */\n font-size: 16px;\n font-weight: 700;\n color: var(--text-color);\n /* Verde para o texto */\n transform: translateX(-50%);\n white-space: nowrap;\n /* margin-left: 23px; */\n}\n\n.options-option {\n display: flex;\n}\n\n\n/* ########################################## */\n","import { Component, Prop, State, Watch, h } from \"@stencil/core\";\nimport { IBonus } from \"../../../../dto/validate.pin.bonus\";\n\nimport i18next from '../../../../i18n/i18n'\nimport { USED_KEY } from \"../../../../utils/keys.storage\";\nimport { defineLimit, formatDateToBr } from \"../../../../utils/utils\";\n\n@Component({\n tag: 'giftback-info',\n styleUrls: ['giftback-info.css']\n})\nexport class GiftbackInfo {\n @State() usedValue: number = 0;\n @State() selectedOption: string = 'none';\n\n @Prop() loading: boolean = false;\n @Prop() bonus: Partial<IBonus> = {\n totalBonus: 150,\n cartId: \"\",\n minimumPurchase: 500,\n bonusBalance: 50,\n calculatedValue: 150,\n firstValidityDate: \"\",\n totalValue: 400\n };\n @Prop() reserve: (amountRedeemed: number) => void;\n @Prop() cancel: () => void;\n\n @State() sliderPosition: number = 50;\n\n @Watch(\"bonus\")\n changedBonus() {\n this.updateBonus()\n }\n\n private updateBonus() {\n this.usedValue = this.bonus.bonusBalance;\n this.buildPositionSlider(0, this.bonus.totalBonus);\n }\n\n componentWillLoad() {\n this.updateBonus();\n this.selectedOption = localStorage.getItem(USED_KEY);\n }\n\n handleSliderChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.usedValue = parseFloat(input.value);\n\n // Calculando a posição do texto com base no valor do slider\n // const percentage = ((this.usedValue - parseInt(input.min)) / (parseInt(input.max) - parseInt(input.min))) * 100;\n // this.sliderPosition = percentage;\n\n this.buildPositionSlider(parseFloat(input.min), parseFloat(input.max))\n }\n\n componentDidLoad() {\n const input: any = document.getElementById(\"position_value_id\")\n\n input.value = this.bonus.bonusBalance;\n }\n\n\n private buildPositionSlider(min: number, max: number) {\n // Calculando a posição do texto com base no valor do slider\n const percentage = ((this.usedValue - min) / (max - min)) * 100;\n this.sliderPosition = percentage;\n }\n\n async handleOptionChange(option: string) {\n this.selectedOption = option;\n\n localStorage.setItem(USED_KEY, option);\n switch (this.selectedOption) {\n case 'use':\n await this.reserve(this.usedValue)\n break;\n case 'dontUse':\n await this.cancel();\n break;\n default:\n }\n }\n\n render() {\n const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;\n\n const translateDescription = i18next.t(\"giftDescription\", { amount: `${this.bonus.totalBonus.toFixed(2).replace(\".\", \",\")}`, custom_name: \"Giftback\" })\n\n const limit = defineLimit(remainingGiftback)\n return (\n\n <div class=\"giftback-container\">\n <div class=\"container-description\">\n <p innerHTML={translateDescription}></p>\n <crm-tooltip identity=\"crm-role-description\" text={i18next.t(\"labelUseGiftback\", { minimumPurchase: this.bonus.minimumPurchase, expírationDate: formatDateToBr(this.bonus.firstValidityDate) })} />\n </div>\n <div class=\"slider-wrapper\">\n <div\n class=\"slider-value\"\n style={{\n left: `calc(${this.sliderPosition}% - 20px)`, // Ajuste para centralizar o texto\n\n }}\n >\n R$ {this.usedValue.toFixed(2).replace(\".\", \",\")}\n </div>\n <input\n id=\"position_value_id\"\n disabled\n type=\"range\"\n min=\"0\"\n max={this.bonus.totalBonus}\n value={this.usedValue}\n class=\"slider\"\n step=\"0.01\"\n onInput={(event) => this.handleSliderChange(event)}\n style={{\n background: `linear-gradient(to right, #6D6D5F ${this.sliderPosition}%, #ddd ${this.sliderPosition}%)`,\n }}\n />\n </div>\n\n {\n limit.isComplete && (\n <p>\n {i18next.t(\"maxAmount\")}\n </p>\n )\n }\n\n {\n !limit.isComplete && (\n <div class=\"container-description\">\n <p>\n Adicione <strong>R$ {remainingGiftback < 0 ? \"0,00\" : remainingGiftback.toFixed(2).replace(\".\", \",\")}</strong> ao carrinho para atingir o valor\n máximo! <crm-tooltip identity=\"crm-max-description\" text={i18next.t(\"labelamountPartial\")} />\n </p>\n </div>\n )\n }\n\n\n <div class=\"options\">\n <div class=\"options-option\">\n <input\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"use\"\n checked={this.selectedOption === 'use'}\n onChange={() => this.handleOptionChange('use')}\n />\n <p>Usar o meu Giftback</p>\n </div>\n <div class=\"options-option\">\n <input\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"dontUse\"\n checked={this.selectedOption === 'dontUse'}\n onChange={() => this.handleOptionChange('dontUse')}\n />\n <p>Não usar o meu Giftback</p>\n </div>\n </div>\n <div class=\"info-box\">\n O Giftback será aplicado na próxima etapa.\n </div>\n </div>\n );\n }\n}"],"version":3}
|