crmbonus-component-wake 0.0.20 → 0.0.21
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/crmbonus-component-wake/app-modal.entry.js +23 -0
- package/dist/crmbonus-component-wake/app-modal.entry.js.map +1 -0
- package/dist/{esm/app-modal_2.entry.js → crmbonus-component-wake/crm-bonus-form.entry.js} +13 -26
- package/dist/crmbonus-component-wake/crm-bonus-form.entry.js.map +1 -0
- package/dist/{esm → crmbonus-component-wake}/crm-bonus.entry.js +16 -8
- package/dist/crmbonus-component-wake/crm-bonus.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +48 -1
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
- package/dist/{cjs/crmbonus.service-a626c034.js → crmbonus-component-wake/crmbonus.service-5e579e1c.js} +165 -92
- package/dist/crmbonus-component-wake/crmbonus.service-5e579e1c.js.map +1 -0
- package/dist/{components/p-629fcb5b.js → crmbonus-component-wake/crmbonus.service-72c64bc3.js} +166 -91
- package/dist/crmbonus-component-wake/crmbonus.service-72c64bc3.js.map +1 -0
- package/dist/crmbonus-component-wake/crmbonus.service-a0dea046.js +3868 -0
- package/dist/crmbonus-component-wake/crmbonus.service-a0dea046.js.map +1 -0
- package/dist/{esm/crmbonus.service-83f67708.js → crmbonus-component-wake/crmbonus.service-ce105f62.js} +165 -90
- package/dist/crmbonus-component-wake/crmbonus.service-ce105f62.js.map +1 -0
- package/dist/crmbonus-component-wake/giftback-finish.entry.js +19 -0
- package/dist/crmbonus-component-wake/giftback-finish.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/giftback-pin.entry.js +44 -0
- package/dist/crmbonus-component-wake/giftback-pin.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/giftback-progress.entry.js +40 -0
- package/dist/crmbonus-component-wake/giftback-progress.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/index-f557ce7c.js +3039 -0
- package/dist/crmbonus-component-wake/index-f557ce7c.js.map +1 -0
- package/dist/crmbonus-component-wake/index.esm.js +16 -1
- package/dist/crmbonus-component-wake/index.esm.js.map +1 -1
- package/dist/{esm → crmbonus-component-wake}/loading-spinner.entry.js +3 -4
- package/dist/crmbonus-component-wake/loading-spinner.entry.js.map +1 -0
- package/dist/{esm → crmbonus-component-wake}/pedido-finalizado.entry.js +3 -3
- package/dist/crmbonus-component-wake/pedido-finalizado.entry.js.map +1 -0
- package/dist/{components/p-2dbfb2c7.js → crmbonus-component-wake/phone-input-mask.entry.js} +9 -30
- package/dist/crmbonus-component-wake/phone-input-mask.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/phone-input.entry.js +21 -0
- package/dist/crmbonus-component-wake/phone-input.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js +334 -0
- package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js.map +1 -0
- package/dist/types/components/crm-bonus/crm-bonus.d.ts +1 -0
- package/dist/types/components/crm-bonus-form/crm-bonus-form.d.ts +2 -0
- package/dist/types/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.d.ts +1 -0
- package/dist/types/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.d.ts +1 -0
- package/dist/types/components.d.ts +6 -0
- package/package.json +1 -1
- package/dist/cjs/app-globals-3a1e7e63.js +0 -7
- package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
- package/dist/cjs/app-modal_2.cjs.entry.js +0 -127
- package/dist/cjs/app-modal_2.cjs.entry.js.map +0 -1
- package/dist/cjs/crm-bonus.cjs.entry.js +0 -46
- package/dist/cjs/crm-bonus.cjs.entry.js.map +0 -1
- package/dist/cjs/crmbonus-component-wake.cjs.js +0 -27
- package/dist/cjs/crmbonus-component-wake.cjs.js.map +0 -1
- package/dist/cjs/crmbonus.service-a626c034.js.map +0 -1
- package/dist/cjs/giftback-finish_5.cjs.entry.js +0 -153
- package/dist/cjs/giftback-finish_5.cjs.entry.js.map +0 -1
- package/dist/cjs/index-52d8a075.js +0 -1248
- package/dist/cjs/index-52d8a075.js.map +0 -1
- package/dist/cjs/index.cjs.js +0 -11
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/loader.cjs.js +0 -17
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/loading-spinner.cjs.entry.js +0 -24
- package/dist/cjs/loading-spinner.cjs.entry.js.map +0 -1
- package/dist/cjs/pedido-finalizado.cjs.entry.js +0 -28
- package/dist/cjs/pedido-finalizado.cjs.entry.js.map +0 -1
- package/dist/collection/collection-manifest.json +0 -21
- package/dist/collection/components/crm-bonus/assets/logo.svg +0 -18
- package/dist/collection/components/crm-bonus/assets/success-svgrepo-com.svg +0 -8
- package/dist/collection/components/crm-bonus/assets/svg/logo.svg +0 -18
- package/dist/collection/components/crm-bonus/assets/svg/success-svgrepo-com.svg +0 -8
- package/dist/collection/components/crm-bonus/crm-bonus.css +0 -20
- package/dist/collection/components/crm-bonus/crm-bonus.js +0 -123
- package/dist/collection/components/crm-bonus/crm-bonus.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.css +0 -32
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +0 -194
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.css +0 -10
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js +0 -20
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.css +0 -54
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js +0 -111
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css +0 -95
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js +0 -111
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js +0 -75
- package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js.map +0 -1
- package/dist/collection/components/loading-spinner/loading-spinner.css +0 -17
- package/dist/collection/components/loading-spinner/loading-spinner.js +0 -63
- package/dist/collection/components/loading-spinner/loading-spinner.js.map +0 -1
- package/dist/collection/components/modal/app-modal.css +0 -45
- package/dist/collection/components/modal/app-modal.js +0 -83
- package/dist/collection/components/modal/app-modal.js.map +0 -1
- package/dist/collection/components/pedido/pedido.js +0 -58
- package/dist/collection/components/pedido/pedido.js.map +0 -1
- package/dist/collection/components/phone/phone-input-mask.css +0 -47
- package/dist/collection/components/phone/phone-input-mask.js +0 -90
- package/dist/collection/components/phone/phone-input-mask.js.map +0 -1
- package/dist/collection/contants/index.js +0 -8
- package/dist/collection/contants/index.js.map +0 -1
- package/dist/collection/contants/mocks.js +0 -28
- package/dist/collection/contants/mocks.js.map +0 -1
- package/dist/collection/dto/pin.sent.js +0 -2
- package/dist/collection/dto/pin.sent.js.map +0 -1
- package/dist/collection/dto/validate.pin.bonus.js +0 -2
- package/dist/collection/dto/validate.pin.bonus.js.map +0 -1
- package/dist/collection/index.js +0 -11
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/services/crmbonus.service.js +0 -39
- package/dist/collection/services/crmbonus.service.js.map +0 -1
- package/dist/collection/utils/utils.js +0 -4
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/components/app-modal.js +0 -8
- package/dist/components/app-modal.js.map +0 -1
- package/dist/components/crm-bonus-form.js +0 -8
- package/dist/components/crm-bonus-form.js.map +0 -1
- package/dist/components/crm-bonus.js +0 -117
- package/dist/components/crm-bonus.js.map +0 -1
- package/dist/components/giftback-finish.js +0 -8
- package/dist/components/giftback-finish.js.map +0 -1
- package/dist/components/giftback-pin.js +0 -8
- package/dist/components/giftback-pin.js.map +0 -1
- package/dist/components/giftback-progress.js +0 -8
- package/dist/components/giftback-progress.js.map +0 -1
- package/dist/components/index.js +0 -9
- package/dist/components/index.js.map +0 -1
- package/dist/components/loading-spinner.js +0 -8
- package/dist/components/loading-spinner.js.map +0 -1
- package/dist/components/p-17ee9996.js +0 -52
- package/dist/components/p-17ee9996.js.map +0 -1
- package/dist/components/p-2dbfb2c7.js.map +0 -1
- package/dist/components/p-563ea4c5.js +0 -166
- package/dist/components/p-563ea4c5.js.map +0 -1
- package/dist/components/p-629fcb5b.js.map +0 -1
- package/dist/components/p-7294e43f.js +0 -36
- package/dist/components/p-7294e43f.js.map +0 -1
- package/dist/components/p-78529eea.js +0 -39
- package/dist/components/p-78529eea.js.map +0 -1
- package/dist/components/p-8e0ed8dd.js +0 -43
- package/dist/components/p-8e0ed8dd.js.map +0 -1
- package/dist/components/p-a1781d03.js +0 -72
- package/dist/components/p-a1781d03.js.map +0 -1
- package/dist/components/p-a88bc337.js +0 -67
- package/dist/components/p-a88bc337.js.map +0 -1
- package/dist/components/p-faf7103e.js +0 -1064
- package/dist/components/p-faf7103e.js.map +0 -1
- package/dist/components/pedido-finalizado.js +0 -45
- package/dist/components/pedido-finalizado.js.map +0 -1
- package/dist/components/phone-input-mask.js +0 -8
- package/dist/components/phone-input-mask.js.map +0 -1
- package/dist/components/phone-input.js +0 -8
- package/dist/components/phone-input.js.map +0 -1
- package/dist/crmbonus-component-wake/p-54e51298.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-54e51298.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-629fcb5b.js +0 -2
- package/dist/crmbonus-component-wake/p-629fcb5b.js.map +0 -1
- package/dist/crmbonus-component-wake/p-6b075110.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-6b075110.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-72510682.js +0 -3
- package/dist/crmbonus-component-wake/p-72510682.js.map +0 -1
- package/dist/crmbonus-component-wake/p-ba53f0f3.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-ba53f0f3.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-bf4b486e.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-bf4b486e.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-e1255160.js +0 -2
- package/dist/crmbonus-component-wake/p-e1255160.js.map +0 -1
- package/dist/crmbonus-component-wake/p-f0d68c31.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-f0d68c31.entry.js.map +0 -1
- package/dist/env.js +0 -5
- package/dist/env.js.map +0 -1
- package/dist/esm/app-modal_2.entry.js.map +0 -1
- package/dist/esm/crm-bonus.entry.js.map +0 -1
- package/dist/esm/crmbonus-component-wake.js +0 -22
- package/dist/esm/crmbonus-component-wake.js.map +0 -1
- package/dist/esm/crmbonus.service-83f67708.js.map +0 -1
- package/dist/esm/giftback-finish_5.entry.js +0 -145
- package/dist/esm/giftback-finish_5.entry.js.map +0 -1
- package/dist/esm/index-9f7bde48.js +0 -1220
- package/dist/esm/index-9f7bde48.js.map +0 -1
- package/dist/esm/index.js +0 -7
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/loader.js +0 -13
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/loading-spinner.entry.js.map +0 -1
- package/dist/esm/pedido-finalizado.entry.js.map +0 -1
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- /package/dist/{esm → crmbonus-component-wake}/app-globals-0f993ce5.js +0 -0
- /package/dist/{esm → crmbonus-component-wake}/app-globals-0f993ce5.js.map +0 -0
@@ -0,0 +1,44 @@
|
|
1
|
+
import { r as registerInstance, h } from './index-f557ce7c.js';
|
2
|
+
|
3
|
+
const giftbackPinCss = ":host{display:block;font-family:Arial, sans-serif}.form-container-pin{display:flex;flex-direction:column;align-items:center}.pin-container{display:flex;gap:10px;margin:26px 0}input{width:58px;height:40px;font-size:18px;text-align:center;border:1px solid #ccc;border-radius:5px}button{padding:10px 20px;background-color:#ddd;border:none;border-radius:5px;cursor:pointer}button:hover{background-color:#bbb}.success{color:green;margin-top:10px}.button{top:50%;background-color:#6c6c7e;color:#fff;border:none;border-radius:10px;padding:15px;min-height:30px;min-width:120px;font-size:20px;cursor:pointer}.button-cancel{top:50%;background-color:#ffffff;color:#1e1c1c;border:1px solid gray;border-radius:10px;padding:10px;min-height:30px;min-width:120px;font-size:19px;cursor:pointer}.footer-button{display:flex;justify-content:space-between;width:100%}";
|
4
|
+
|
5
|
+
const GiftbackPin = class {
|
6
|
+
constructor(hostRef) {
|
7
|
+
registerInstance(this, hostRef);
|
8
|
+
this.sent = undefined;
|
9
|
+
this.validate = undefined;
|
10
|
+
this.cancel = undefined;
|
11
|
+
this.pin = ['', '', '', ''];
|
12
|
+
this.isVerified = false;
|
13
|
+
this.loading = false;
|
14
|
+
}
|
15
|
+
handleInput(event, index) {
|
16
|
+
const input = event.target;
|
17
|
+
const value = input.value.slice(0, 1); // Limitar a um único dígito
|
18
|
+
this.pin[index] = value;
|
19
|
+
// Focar no próximo campo, se possível
|
20
|
+
if (value && index < this.pin.length - 1) {
|
21
|
+
const nextInput = input.nextElementSibling;
|
22
|
+
nextInput === null || nextInput === void 0 ? void 0 : nextInput.focus();
|
23
|
+
}
|
24
|
+
this.pin = [...this.pin];
|
25
|
+
}
|
26
|
+
validatePin() {
|
27
|
+
console.log('this.pin', this.pin);
|
28
|
+
this.validate(this.pin.join(""));
|
29
|
+
}
|
30
|
+
verifyPin() {
|
31
|
+
const pinCode = this.pin.join('');
|
32
|
+
if (pinCode === '9999') {
|
33
|
+
this.isVerified = true;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
render() {
|
37
|
+
return (h("div", { key: '1984f00883037262bde49257fed2d583c7a7ae96', class: "form-container-pin" }, h("div", { key: 'a09cb57ad64090c1f57e457d194964c77ea1f75f' }, h("p", { key: '17c6118d47990e475f38cc8faf270601741e9e0e' }, "Insira o PIN de 4 d\u00EDgitos enviado por SMS."), h("div", { key: 'e4d0db2861144d277de16e766b3d2cfdf165b5c7', class: "pin-container" }, this.pin.map((_, index) => (h("input", { type: "text", maxLength: 1, value: this.pin[index], onInput: (event) => this.handleInput(event, index) }))))), h("div", { key: 'd7b39e3255b2d62fbac1547bd50dd3e0687a31b6', class: "footer-button" }, h("button", { key: '5f123fba6ceddc8360e2b2424f10a1d365162118', class: "button-cancel", disabled: this.loading, onClick: () => this.cancel() }, "Cancelar"), h("button", { key: '0f4c13699d23fb4d037534c9be6c164bd36b84ba', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePin() }, !this.loading ? "Enviar" : h("loading-spinner", { size: "15px", color: "#fff" })))));
|
38
|
+
}
|
39
|
+
};
|
40
|
+
GiftbackPin.style = giftbackPinCss;
|
41
|
+
|
42
|
+
export { GiftbackPin as giftback_pin };
|
43
|
+
|
44
|
+
//# sourceMappingURL=giftback-pin.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"giftback-pin.entry.esm.js","mappings":";;AAAA,MAAM,cAAc,GAAG,g1BAAg1B;;MCQ11B,WAAW;;;;;;mBAMK,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;0BACV,KAAK;uBAET,KAAK;;IAEhC,WAAW,CAAC,KAAY,EAAE,KAAa;QACnC,MAAM,KAAK,GAAG,KAAK,CAAC,MAA0B,CAAC;QAC/C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACtC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;;QAGxB,IAAI,KAAK,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE;YACtC,MAAM,SAAS,GAAG,KAAK,CAAC,kBAAsC,CAAC;YAC/D,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,EAAE,CAAC;SACtB;QAED,IAAI,CAAC,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAA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":["src/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.css?tag=giftback-pin&encapsulation=shadow","src/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.tsx"],"sourcesContent":[":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 gap: 10px;\n margin: 26px 0;\n}\n\ninput {\n width: 58px;\n height: 40px;\n font-size: 18px;\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\nbutton:hover {\n background-color: #bbb;\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.footer-button {\n display: flex;\n justify-content: space-between;\n width: 100%;\n}","import { Component, h, Prop, State } from '@stencil/core';\nimport { IPinSent } from '../../../../dto/pin.sent';\n\n@Component({\n tag: 'giftback-pin',\n styleUrl: 'giftback-pin.css',\n shadow: true,\n})\nexport class GiftbackPin {\n\n @Prop() sent: IPinSent;\n @Prop() validate: (pin: string) => void;\n @Prop() cancel: () => void;\n\n @State() pin: string[] = ['', '', '', ''];\n @State() isVerified: boolean = false;\n\n @Prop() loading: boolean = false;\n\n handleInput(event: Event, index: number) {\n const input = event.target as HTMLInputElement;\n const value = input.value.slice(0, 1); // Limitar a um único dígito\n this.pin[index] = value;\n\n // Focar no próximo campo, se possível\n if (value && index < this.pin.length - 1) {\n const nextInput = input.nextElementSibling as HTMLInputElement;\n nextInput?.focus();\n }\n\n this.pin = [...this.pin];\n }\n\n validatePin() {\n console.log('this.pin', this.pin);\n this.validate(this.pin.join(\"\"))\n }\n\n verifyPin() {\n const pinCode = this.pin.join('');\n if (pinCode === '9999') {\n this.isVerified = true;\n }\n }\n\n render() {\n return (\n <div class=\"form-container-pin\">\n <div >\n <p>Insira o PIN de 4 dígitos enviado por SMS.</p>\n <div class=\"pin-container\">\n {this.pin.map((_, index) => (\n <input\n type=\"text\"\n maxLength={1}\n value={this.pin[index]}\n onInput={(event) => this.handleInput(event, index)}\n />\n ))}\n </div>\n </div>\n\n <div class=\"footer-button\">\n <button class=\"button-cancel\" disabled={this.loading} onClick={() => this.cancel()}>\n Cancelar\n </button>\n <button class={`button ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePin()}>\n {\n !this.loading ? \"Enviar\" : <loading-spinner size=\"15px\" color=\"#fff\" />\n }\n </button>\n </div>\n {/* <button onClick={() => this.verifyPin()}>Enviar</button>\n {this.isVerified && <p class=\"success\">Código verificado com sucesso!</p>} */}\n </div>\n );\n }\n}\n"],"version":3}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import { r as registerInstance, h } from './index-f557ce7c.js';
|
2
|
+
|
3
|
+
const giftbackProgressCss = ":host{display:flex;font-family:Arial, sans-serif;border-radius:10px;padding:16px;max-width:100%;flex-direction:column}.giftback-container{display:flex;flex-direction:column}.giftback-container p{font-size:medium}h3{margin:0 0 10px;font-size:18px}p{margin:5px 0;font-size:14px;align-self:start}.validity{font-size:12px;color:#888}.progress-container{display:flex;align-items:center;margin:10px 0}progress-container span{font-size:12px;color:#666}input[type='range']{flex:1;margin:0 10px;appearance:none;background-color:#ccc;height:6px;border-radius:3px;outline:none;cursor:pointer}input[type='range']::-webkit-slider-thumb{appearance:none;width:14px;height:14px;border-radius:50%;background-color:#555;cursor:pointer}.remaining{font-weight:bold;font-size:14px;color:#333}.button{top:50%;background-color:#6c6c7e;color:#fff;border:none;border-radius:10px;padding:10px;min-height:30px;min-width:120px;font-size:19px;cursor:pointer}.button-cancel{top:50%;background-color:#ffffff;color:#1e1c1c;border:1px solid gray;border-radius:10px;padding:10px;min-height:30px;min-width:120px;font-size:19px;cursor:pointer}.disabled{opacity:0.6;cursor:not-allowed}.footer-button-giftback{display:flex;justify-content:space-between;margin-top:14px}";
|
4
|
+
|
5
|
+
const GiftbackProgress = class {
|
6
|
+
constructor(hostRef) {
|
7
|
+
registerInstance(this, hostRef);
|
8
|
+
this.usedValue = 0;
|
9
|
+
this.loading = false;
|
10
|
+
this.bonus = {
|
11
|
+
totalBonus: 0,
|
12
|
+
cartId: "",
|
13
|
+
minimumPurchase: 0,
|
14
|
+
bonusBalance: 0,
|
15
|
+
calculatedValue: 0,
|
16
|
+
firstValidityDate: ""
|
17
|
+
};
|
18
|
+
this.reserve = undefined;
|
19
|
+
this.cancel = undefined;
|
20
|
+
}
|
21
|
+
componentWillLoad() {
|
22
|
+
this.usedValue = parseFloat(this.bonus.bonusBalance.toString());
|
23
|
+
}
|
24
|
+
handleSliderChange(event) {
|
25
|
+
const input = event.target;
|
26
|
+
this.usedValue = parseFloat(input.value);
|
27
|
+
}
|
28
|
+
async handleReserve() {
|
29
|
+
this.reserve(this.usedValue);
|
30
|
+
}
|
31
|
+
render() {
|
32
|
+
const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;
|
33
|
+
return (h("div", { key: '8e61dd9045fbf407e1f296675850e561689694b1', class: "giftback-container" }, h("p", { key: '9e35fb4d9656889fa13f59af01419b14a8697a9e' }, "Voc\u00EA possui at\u00E9 ", h("strong", { key: '0e9b41cd042de367b4291a70a99bd67e23bbd5fe' }, "R$ ", this.bonus.totalBonus.toFixed(2)), " de Giftback nessa compra!"), h("p", { key: '8bbfec249686c834f8b6b4c59c5697b4b8e9007f', class: "validity" }, "V\u00E1lido at\u00E9: ", this.bonus.firstValidityDate), h("p", { key: 'ff294b49a11b595ff66cb206835c0b188cb96095' }, "Voc\u00EA est\u00E1 utilizando ", h("strong", { key: 'cac539e866b15c7072f59bae7514b288fd27c941' }, "R$ ", this.usedValue.toFixed(2)), " nessa compra"), h("div", { key: 'ab7d29de1e6d83ec246448a127c3a9eeecbff94b', class: "progress-container" }, h("span", { key: '075f662a7a70b4da0c084d04326cbca46bd6d322' }, "R$ 0"), h("input", { key: '9ac0d0da95c4d3e08964c3079f408ea020fc1af7', disabled: true, type: "range", min: "0", step: "0.01", max: this.bonus.totalBonus, value: this.usedValue, onInput: (event) => this.handleSliderChange(event) }), h("span", { key: '00a268609fa0bb0751fc12a261f7e798f7751389' }, "R$ ", this.bonus.totalBonus.toFixed(2))), h("p", { key: 'eddc0c0c9851dcde0c7962958a5dc901444e1cd0', class: "remaining" }, "Faltam ", h("strong", { key: '0e85235055a354f1336c5c370e7dab3cdba1499e' }, "R$ ", remainingGiftback > 0 ? remainingGiftback.toFixed(2) : Number(0).toFixed(2)), " para utilizar o valor total do Giftback."), h("div", { key: 'bfd3a14c84ac24f402d0c6922f43584f1b3f789a', class: "footer-button-giftback" }, h("button", { key: '3bb6e6d37274249a48c3cb1995859fa59127aaa4', class: "button-cancel", disabled: this.loading, onClick: () => this.cancel() }, "Cancelar"), h("button", { key: '8589f3cff75ee1ce58ff8516cfc47b4837865fc9', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.handleReserve() }, !this.loading ? "Aplicar" : h("loading-spinner", { size: "10px", color: "#fff" })))));
|
34
|
+
}
|
35
|
+
};
|
36
|
+
GiftbackProgress.style = giftbackProgressCss;
|
37
|
+
|
38
|
+
export { GiftbackProgress as giftback_progress };
|
39
|
+
|
40
|
+
//# sourceMappingURL=giftback-progress.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"giftback-progress.entry.esm.js","mappings":";;AAAA,MAAM,mBAAmB,GAAG,itCAAitC;;MCQhuC,gBAAgB;;;yBACI,CAAC;uBAEH,KAAK;qBAEC;YAC7B,UAAU,EAAE,CAAC;YACb,MAAM,E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,OAAO,CAAC,CAAC,CAAC,CAAQ,CAChD,EAEN,0DAAG,KAAK,EAAC,WAAW,eACT,wEAAY,iBAAiB,GAAG,CAAC,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAU,8CACxG,EAEJ,4DAAK,KAAK,EAAC,wBAAwB,IAE/B,+DAAQ,KAAK,EAAC,eAAe,EAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,EAAE,eAEzE,EAET,+DAAQ,KAAK,EAAE,UAAU,IAAI,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,aAAa,EAAE,IAE/G,CAAC,IAAI,CAAC,OAAO,GAAG,SAAS,GAAG,uBAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAEvE,CACP,CACJ,EACR;KACL;;;;;;","names":[],"sources":["src/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css?tag=giftback-progress&encapsulation=shadow","src/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.tsx"],"sourcesContent":[":host {\n display: flex;\n font-family: Arial, sans-serif;\n /* background-color: #f8f4eb; */\n border-radius: 10px;\n padding: 16px;\n /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */\n max-width: 100%;\n flex-direction: column;\n}\n\n.giftback-container {\n display: flex;\n flex-direction: column;\n}\n\n.giftback-container p {\n font-size: medium;\n}\n\nh3 {\n margin: 0 0 10px;\n font-size: 18px;\n}\n\np {\n margin: 5px 0;\n font-size: 14px;\n align-self: start;\n}\n\n.validity {\n font-size: 12px;\n color: #888;\n}\n\n.progress-container {\n display: flex;\n align-items: center;\n margin: 10px 0;\n}\n\nprogress-container span {\n font-size: 12px;\n color: #666;\n}\n\ninput[type='range'] {\n flex: 1;\n margin: 0 10px;\n appearance: none;\n background-color: #ccc;\n height: 6px;\n border-radius: 3px;\n outline: none;\n cursor: pointer;\n}\n\ninput[type='range']::-webkit-slider-thumb {\n appearance: none;\n width: 14px;\n height: 14px;\n border-radius: 50%;\n background-color: #555;\n cursor: pointer;\n}\n\n.remaining {\n font-weight: bold;\n font-size: 14px;\n color: #333;\n}\n\n.button {\n top: 50%;\n background-color: #6c6c7e;\n color: #fff;\n border: none;\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.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.disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n.footer-button-giftback {\n display: flex;\n justify-content: space-between;\n margin-top: 14px;\n}","import { Component, h, State, Prop } from '@stencil/core';\nimport { IBonus } from '../../../../dto/validate.pin.bonus';\n\n@Component({\n tag: 'giftback-progress',\n styleUrl: 'giftback-progress.css',\n shadow: true,\n})\nexport class GiftbackProgress {\n @State() usedValue: number = 0;\n\n @Prop() loading: boolean = false;\n\n @Prop() bonus: Partial<IBonus> = {\n totalBonus: 0,\n cartId: \"\",\n minimumPurchase: 0,\n bonusBalance: 0,\n calculatedValue: 0,\n firstValidityDate: \"\"\n };\n\n @Prop() reserve: (amountRedeemed: number) => void;\n @Prop() cancel: () => void;\n\n componentWillLoad() {\n this.usedValue = parseFloat(this.bonus.bonusBalance.toString());\n }\n\n handleSliderChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.usedValue = parseFloat(input.value);\n }\n\n async handleReserve() {\n this.reserve(this.usedValue);\n }\n\n render() {\n const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;\n\n return (\n <div class=\"giftback-container\">\n <p>\n Você possui até <strong>R$ {this.bonus.totalBonus.toFixed(2)}</strong> de Giftback nessa compra!\n </p>\n <p class=\"validity\">Válido até: {this.bonus.firstValidityDate}</p>\n\n <p>Você está utilizando <strong>R$ {this.usedValue.toFixed(2)}</strong> nessa compra</p>\n\n <div class=\"progress-container\">\n <span>R$ 0</span>\n <input\n disabled\n type=\"range\"\n min=\"0\"\n step=\"0.01\"\n max={this.bonus.totalBonus}\n value={this.usedValue}\n onInput={(event) => this.handleSliderChange(event)}\n />\n <span>R$ {this.bonus.totalBonus.toFixed(2)}</span>\n </div>\n\n <p class=\"remaining\">\n Faltam <strong>R$ {remainingGiftback > 0 ? remainingGiftback.toFixed(2) : Number(0).toFixed(2)}</strong> para utilizar o valor total do Giftback.\n </p>\n\n <div class=\"footer-button-giftback\">\n\n <button class=\"button-cancel\" disabled={this.loading} onClick={() => this.cancel()}>\n Cancelar\n </button>\n\n <button class={`button ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.handleReserve()}>\n {\n !this.loading ? \"Aplicar\" : <loading-spinner size=\"10px\" color=\"#fff\" />\n }\n </button>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|