crmbonus-component-wake 0.0.26 → 0.0.27
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/app-globals-3a1e7e63.js +7 -0
- package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
- package/dist/cjs/app-modal_2.cjs.entry.js +134 -0
- package/dist/cjs/app-modal_2.cjs.entry.js.map +1 -0
- package/dist/cjs/crm-bonus.cjs.entry.js +55 -0
- package/dist/cjs/crm-bonus.cjs.entry.js.map +1 -0
- package/dist/cjs/crmbonus-component-wake.cjs.js +27 -0
- package/dist/cjs/crmbonus-component-wake.cjs.js.map +1 -0
- package/dist/cjs/crmbonus.service-8412ddbf.js +3798 -0
- package/dist/cjs/crmbonus.service-8412ddbf.js.map +1 -0
- package/dist/cjs/giftback-finish_5.cjs.entry.js +155 -0
- package/dist/cjs/giftback-finish_5.cjs.entry.js.map +1 -0
- package/dist/cjs/index-52d8a075.js +1248 -0
- package/dist/cjs/index-52d8a075.js.map +1 -0
- package/dist/cjs/index.cjs.js +11 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +17 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/loading-spinner.cjs.entry.js +24 -0
- package/dist/cjs/loading-spinner.cjs.entry.js.map +1 -0
- package/dist/cjs/pedido-finalizado.cjs.entry.js +36 -0
- package/dist/cjs/pedido-finalizado.cjs.entry.js.map +1 -0
- package/dist/collection/collection-manifest.json +21 -0
- package/dist/collection/components/crm-bonus/assets/logo.svg +18 -0
- package/dist/collection/components/crm-bonus/assets/success-svgrepo-com.svg +8 -0
- package/dist/collection/components/crm-bonus/assets/svg/logo.svg +18 -0
- package/dist/collection/components/crm-bonus/assets/svg/success-svgrepo-com.svg +8 -0
- package/dist/collection/components/crm-bonus/crm-bonus.css +20 -0
- package/dist/collection/components/crm-bonus/crm-bonus.js +132 -0
- package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.css +32 -0
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +216 -0
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.css +10 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js +20 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.css +74 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js +127 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css +109 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js +127 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js +75 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js.map +1 -0
- package/dist/collection/components/loading-spinner/loading-spinner.css +17 -0
- package/dist/collection/components/loading-spinner/loading-spinner.js +63 -0
- package/dist/collection/components/loading-spinner/loading-spinner.js.map +1 -0
- package/dist/collection/components/modal/app-modal.css +45 -0
- package/dist/collection/components/modal/app-modal.js +83 -0
- package/dist/collection/components/modal/app-modal.js.map +1 -0
- package/dist/collection/components/pedido/pedido.js +83 -0
- package/dist/collection/components/pedido/pedido.js.map +1 -0
- package/dist/collection/components/phone/phone-input-mask.css +47 -0
- package/dist/collection/components/phone/phone-input-mask.js +90 -0
- package/dist/collection/components/phone/phone-input-mask.js.map +1 -0
- package/dist/collection/contants/index.js +8 -0
- package/dist/collection/contants/index.js.map +1 -0
- package/dist/collection/contants/mocks.js +28 -0
- package/dist/collection/contants/mocks.js.map +1 -0
- package/dist/collection/dto/pin.sent.js +2 -0
- package/dist/collection/dto/pin.sent.js.map +1 -0
- package/dist/collection/dto/update.order.dto.js +2 -0
- package/dist/collection/dto/update.order.dto.js.map +1 -0
- package/dist/collection/dto/validate.pin.bonus.js +2 -0
- package/dist/collection/dto/validate.pin.bonus.js.map +1 -0
- package/dist/collection/index.js +11 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/services/crmbonus.service.js +42 -0
- package/dist/collection/services/crmbonus.service.js.map +1 -0
- package/dist/collection/utils/utils.js +4 -0
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/components/app-modal.js +8 -0
- package/dist/components/app-modal.js.map +1 -0
- package/dist/components/crm-bonus-form.js +8 -0
- package/dist/components/crm-bonus-form.js.map +1 -0
- package/dist/components/crm-bonus.js +126 -0
- package/dist/components/crm-bonus.js.map +1 -0
- package/dist/components/giftback-finish.js +8 -0
- package/dist/components/giftback-finish.js.map +1 -0
- package/dist/components/giftback-pin.js +8 -0
- package/dist/components/giftback-pin.js.map +1 -0
- package/dist/components/giftback-progress.js +8 -0
- package/dist/components/giftback-progress.js.map +1 -0
- package/dist/components/index.js +9 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/loading-spinner.js +8 -0
- package/dist/components/loading-spinner.js.map +1 -0
- package/dist/{crmbonus-component-wake/crmbonus.service-5208f883.js → components/p-374de9ae.js} +91 -166
- package/dist/components/p-374de9ae.js.map +1 -0
- package/dist/components/p-462c12d8.js +69 -0
- package/dist/components/p-462c12d8.js.map +1 -0
- package/dist/{crmbonus-component-wake/giftback-pin.entry.js → components/p-6442ffce.js} +39 -9
- package/dist/components/p-6442ffce.js.map +1 -0
- package/dist/components/p-878ce0aa.js +174 -0
- package/dist/components/p-878ce0aa.js.map +1 -0
- package/dist/components/p-8fcf8924.js +52 -0
- package/dist/components/p-8fcf8924.js.map +1 -0
- package/dist/components/p-cb5a1fdf.js +39 -0
- package/dist/components/p-cb5a1fdf.js.map +1 -0
- package/dist/components/p-cbade307.js +36 -0
- package/dist/components/p-cbade307.js.map +1 -0
- package/dist/{crmbonus-component-wake/phone-input-mask.entry.js → components/p-e40cf14d.js} +30 -9
- package/dist/components/p-e40cf14d.js.map +1 -0
- package/dist/components/p-e816fb90.js +43 -0
- package/dist/components/p-e816fb90.js.map +1 -0
- package/dist/components/p-faf7103e.js +1064 -0
- package/dist/components/p-faf7103e.js.map +1 -0
- package/dist/components/pedido-finalizado.js +54 -0
- package/dist/components/pedido-finalizado.js.map +1 -0
- package/dist/components/phone-input-mask.js +8 -0
- package/dist/components/phone-input-mask.js.map +1 -0
- package/dist/components/phone-input.js +8 -0
- package/dist/components/phone-input.js.map +1 -0
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -48
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
- package/dist/crmbonus-component-wake/index.esm.js +1 -16
- package/dist/crmbonus-component-wake/index.esm.js.map +1 -1
- package/dist/crmbonus-component-wake/p-374de9ae.js +2 -0
- package/dist/crmbonus-component-wake/p-374de9ae.js.map +1 -0
- package/dist/crmbonus-component-wake/p-4306a717.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-4306a717.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-72510682.js +3 -0
- package/dist/crmbonus-component-wake/p-72510682.js.map +1 -0
- package/dist/crmbonus-component-wake/p-9985f639.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-9985f639.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-be1a56de.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-be1a56de.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-e1255160.js +2 -0
- package/dist/crmbonus-component-wake/p-e1255160.js.map +1 -0
- package/dist/crmbonus-component-wake/p-e2f165e8.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-e2f165e8.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-f74e4a71.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-f74e4a71.entry.js.map +1 -0
- package/dist/env.js +5 -0
- package/dist/env.js.map +1 -0
- package/dist/{crmbonus-component-wake/crm-bonus-form.entry.js → esm/app-modal_2.entry.js} +26 -6
- package/dist/esm/app-modal_2.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/crm-bonus.entry.js +5 -4
- package/dist/esm/crm-bonus.entry.js.map +1 -0
- package/dist/esm/crmbonus-component-wake.js +22 -0
- package/dist/esm/crmbonus-component-wake.js.map +1 -0
- package/dist/esm/crmbonus.service-053a9e38.js +3796 -0
- package/dist/esm/crmbonus.service-053a9e38.js.map +1 -0
- package/dist/esm/giftback-finish_5.entry.js +147 -0
- package/dist/esm/giftback-finish_5.entry.js.map +1 -0
- package/dist/esm/index-9f7bde48.js +1220 -0
- package/dist/esm/index-9f7bde48.js.map +1 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +13 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/loading-spinner.entry.js +4 -3
- package/dist/esm/loading-spinner.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/pedido-finalizado.entry.js +3 -3
- package/dist/esm/pedido-finalizado.entry.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
- package/dist/crmbonus-component-wake/app-modal.entry.js +0 -23
- package/dist/crmbonus-component-wake/app-modal.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/crm-bonus-form.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/crm-bonus.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/crmbonus.service-5208f883.js.map +0 -1
- package/dist/crmbonus-component-wake/giftback-finish.entry.js +0 -19
- package/dist/crmbonus-component-wake/giftback-finish.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/giftback-pin.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/giftback-progress.entry.js +0 -40
- package/dist/crmbonus-component-wake/giftback-progress.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/index-f557ce7c.js +0 -3039
- package/dist/crmbonus-component-wake/index-f557ce7c.js.map +0 -1
- package/dist/crmbonus-component-wake/loading-spinner.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/pedido-finalizado.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/phone-input-mask.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/phone-input.entry.js +0 -21
- package/dist/crmbonus-component-wake/phone-input.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js +0 -334
- package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js.map +0 -1
- /package/dist/{crmbonus-component-wake → esm}/app-globals-0f993ce5.js +0 -0
- /package/dist/{crmbonus-component-wake → esm}/app-globals-0f993ce5.js.map +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"p-462c12d8.js","mappings":";;;AAAA,MAAM,mBAAmB,GAAG,itCAAitC,CAAC;AAC9uC,+BAAe,mBAAmB;;MCOrB,gBAAgB;;;;;yBACI,CAAC;uBAEH,KAAK;qBAEC;YAC7B,UAAU,EAAE,CAAC;YACb,MAAM,EAAE,EAAE;YACV,eAAe,EAAE,CAAC;YAClB,YAAY,EAAE,CAAC;YACf,eAAe,EAAE,CAAC;YAClB,iBAAiB,EAAE,EAAE;SACxB;;;;IAKD,iBAAiB;QACb,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC;KACnE;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;KAC5C;IAED,MAAM,aAAa;QACf,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KAChC;IAED,MAAM;QACF,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC;QAE7E,QACI,4DAAK,KAAK,EAAC,oBAAoB,IAC3B,0FACoB,wEAAY,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAU,+BACtE,EACJ,0DAAG,KAAK,EAAC,UAAU,8BAAc,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAK,EAExG,+FAAwB,wEAAY,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAU,kBAAiB,EAExF,4DAAK,KAAK,EAAC,oBAAoB,IAC3B,sEAAiB,EACjB,8DACI,QAAQ,QACR,IAAI,EAAC,OAAO,EACZ,GAAG,EAAC,GAAG,EACP,IAAI,EAAC,MAAM,EACX,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EAC1B,KAAK,EAAE,IAAI,CAAC,SAAS,EACrB,OAAO,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,GACpD,EACF,sEAAU,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,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é: {new Date(this.bonus.firstValidityDate).toLocaleDateString('pt-Br')}</p>\n\n <p>Você está utilizando <strong>R$ {this.usedValue.toFixed(2)}</strong> nessa compra</p>\n\n <div class=\"progress-container\">\n <span>R$ 0</span>\n <input\n disabled\n type=\"range\"\n min=\"0\"\n step=\"0.01\"\n max={this.bonus.totalBonus}\n value={this.usedValue}\n onInput={(event) => this.handleSliderChange(event)}\n />\n <span>R$ {this.bonus.totalBonus.toFixed(2)}</span>\n </div>\n\n <p class=\"remaining\">\n Faltam <strong>R$ {remainingGiftback > 0 ? remainingGiftback.toFixed(2) : Number(0).toFixed(2)}</strong> para utilizar o valor total do Giftback.\n </p>\n\n <div class=\"footer-button-giftback\">\n\n <button class=\"button-cancel\" disabled={this.loading} onClick={() => this.cancel()}>\n Cancelar\n </button>\n\n <button class={`button ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.handleReserve()}>\n {\n !this.loading ? \"Aplicar\" : <loading-spinner size=\"10px\" color=\"#fff\" />\n }\n </button>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|
@@ -1,10 +1,14 @@
|
|
1
|
-
import {
|
1
|
+
import { p as proxyCustomElement, H, h } from './p-faf7103e.js';
|
2
|
+
import { d as defineCustomElement$1 } from './p-cb5a1fdf.js';
|
2
3
|
|
3
4
|
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%}";
|
5
|
+
const GiftbackPinStyle0 = giftbackPinCss;
|
4
6
|
|
5
|
-
const GiftbackPin = class {
|
6
|
-
constructor(
|
7
|
-
|
7
|
+
const GiftbackPin = /*@__PURE__*/ proxyCustomElement(class GiftbackPin extends H {
|
8
|
+
constructor() {
|
9
|
+
super();
|
10
|
+
this.__registerHost();
|
11
|
+
this.__attachShadow();
|
8
12
|
this.sent = undefined;
|
9
13
|
this.validate = undefined;
|
10
14
|
this.cancel = undefined;
|
@@ -34,11 +38,37 @@ const GiftbackPin = class {
|
|
34
38
|
}
|
35
39
|
}
|
36
40
|
render() {
|
37
|
-
return (h("div", { key: '
|
41
|
+
return (h("div", { key: '7fe6a9f55ca436ecfcc20f106c1efeddd8387490', class: "form-container-pin" }, h("div", { key: 'aece84fab5ecf94ce5ca90fd1912623dd3c1b9b8' }, h("p", { key: '5134dd8eb3478f59dcfcdca6612e885b76578cba' }, "Insira o PIN de 4 d\u00EDgitos enviado por SMS."), h("div", { key: '8855be06a09925746a5b18323726dd67ec73d7c3', 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: '1c5523feb6c9dafbfddd5388170de5fea7627f62', class: "footer-button" }, h("button", { key: '8506cd68998d4ecb76f8a8a262373605a06827de', class: "button-cancel", disabled: this.loading, onClick: () => this.cancel() }, "Cancelar"), h("button", { key: '4dda0af894ad5849ba27d3a4f6c15c80d6c984ae', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePin() }, !this.loading ? "Enviar" : h("loading-spinner", { size: "15px", color: "#fff" })))));
|
38
42
|
}
|
39
|
-
}
|
40
|
-
|
43
|
+
static get style() { return GiftbackPinStyle0; }
|
44
|
+
}, [1, "giftback-pin", {
|
45
|
+
"sent": [16],
|
46
|
+
"validate": [16],
|
47
|
+
"cancel": [16],
|
48
|
+
"loading": [4],
|
49
|
+
"pin": [32],
|
50
|
+
"isVerified": [32]
|
51
|
+
}]);
|
52
|
+
function defineCustomElement() {
|
53
|
+
if (typeof customElements === "undefined") {
|
54
|
+
return;
|
55
|
+
}
|
56
|
+
const components = ["giftback-pin", "loading-spinner"];
|
57
|
+
components.forEach(tagName => { switch (tagName) {
|
58
|
+
case "giftback-pin":
|
59
|
+
if (!customElements.get(tagName)) {
|
60
|
+
customElements.define(tagName, GiftbackPin);
|
61
|
+
}
|
62
|
+
break;
|
63
|
+
case "loading-spinner":
|
64
|
+
if (!customElements.get(tagName)) {
|
65
|
+
defineCustomElement$1();
|
66
|
+
}
|
67
|
+
break;
|
68
|
+
} });
|
69
|
+
}
|
70
|
+
defineCustomElement();
|
41
71
|
|
42
|
-
export { GiftbackPin as
|
72
|
+
export { GiftbackPin as G, defineCustomElement as d };
|
43
73
|
|
44
|
-
//# sourceMappingURL=
|
74
|
+
//# sourceMappingURL=p-6442ffce.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"p-6442ffce.js","mappings":";;;AAAA,MAAM,cAAc,GAAG,g1BAAg1B,CAAC;AACx2B,0BAAe,cAAc;;MCOhB,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,CAAC,CAAC;KAC5B;IAED,WAAW;QACP,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QAClC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;KACnC;IAED,SAAS;QACL,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAClC,IAAI,OAAO,KAAK,MAAM,EAAE;YACpB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;SAC1B;KACJ;IAED,MAAM;QACF,QACI,4DAAK,KAAK,EAAC,oBAAoB,IAC3B,8DACI,8GAAiD,EACjD,4DAAK,KAAK,EAAC,eAAe,IACrB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,MACnB,aACI,IAAI,EAAC,MAAM,EACX,SAAS,EAAE,CAAC,EACZ,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EACtB,OAAO,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,GACpD,CACL,CAAC,CACA,CACJ,EAEN,4DAAK,KAAK,EAAC,eAAe,IACtB,+DAAQ,KAAK,EAAC,eAAe,EAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,EAAE,eAEzE,EACT,+DAAQ,KAAK,EAAE,UAAU,IAAI,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,IAE7G,CAAC,IAAI,CAAC,OAAO,GAAG,QAAQ,GAAG,uBAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAEtE,CACP,CAGJ,EACR;KACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["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,174 @@
|
|
1
|
+
import { p as proxyCustomElement, H, h, d as Host } from './p-faf7103e.js';
|
2
|
+
import { C as CrmBonusService } from './p-374de9ae.js';
|
3
|
+
import { d as defineCustomElement$6 } from './p-cbade307.js';
|
4
|
+
import { d as defineCustomElement$5 } from './p-6442ffce.js';
|
5
|
+
import { d as defineCustomElement$4 } from './p-462c12d8.js';
|
6
|
+
import { d as defineCustomElement$3 } from './p-cb5a1fdf.js';
|
7
|
+
import { d as defineCustomElement$2 } from './p-8fcf8924.js';
|
8
|
+
import { d as defineCustomElement$1 } from './p-e40cf14d.js';
|
9
|
+
|
10
|
+
var StepFormEnum;
|
11
|
+
(function (StepFormEnum) {
|
12
|
+
StepFormEnum[StepFormEnum["STEP_PHONE"] = 1] = "STEP_PHONE";
|
13
|
+
StepFormEnum[StepFormEnum["STEP_PIN"] = 2] = "STEP_PIN";
|
14
|
+
StepFormEnum[StepFormEnum["STEP_RESERVE"] = 3] = "STEP_RESERVE";
|
15
|
+
StepFormEnum[StepFormEnum["STEP_APPLY"] = 4] = "STEP_APPLY";
|
16
|
+
})(StepFormEnum || (StepFormEnum = {}));
|
17
|
+
|
18
|
+
const crmBonusFormCss = ".form-container{width:100%;display:flex;justify-content:center;justify-content:space-around}.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}.disabled{opacity:0.6;cursor:not-allowed}.message-error{color:#d11111;font-weight:bold;font-family:Arial;font-size:small;margin-left:16px}";
|
19
|
+
const CrmBonusFormStyle0 = crmBonusFormCss;
|
20
|
+
|
21
|
+
const CrmBonusForm = /*@__PURE__*/ proxyCustomElement(class CrmBonusForm extends H {
|
22
|
+
constructor() {
|
23
|
+
super();
|
24
|
+
this.__registerHost();
|
25
|
+
this.__attachShadow();
|
26
|
+
this.crmBonusService = new CrmBonusService();
|
27
|
+
this.storeName = undefined;
|
28
|
+
this.cartId = undefined;
|
29
|
+
this.products = undefined;
|
30
|
+
this.customer = {
|
31
|
+
phone: "",
|
32
|
+
birthDate: "",
|
33
|
+
document: "",
|
34
|
+
name: ""
|
35
|
+
};
|
36
|
+
this.cancel = undefined;
|
37
|
+
this.loading = false;
|
38
|
+
this.step = StepFormEnum.STEP_PHONE;
|
39
|
+
this.sent = undefined;
|
40
|
+
this.message = undefined;
|
41
|
+
this.phone = undefined;
|
42
|
+
this.bonus = undefined;
|
43
|
+
}
|
44
|
+
async sendPin(phone) {
|
45
|
+
var _a, _b;
|
46
|
+
this.loading = true;
|
47
|
+
this.message = "";
|
48
|
+
try {
|
49
|
+
const _phone = phone.replace(/\D/g, '');
|
50
|
+
this.phone = Number(_phone);
|
51
|
+
const sent = await this.crmBonusService.sendPin(this.phone, this.storeName);
|
52
|
+
this.sent = sent;
|
53
|
+
this.step = StepFormEnum.STEP_PIN;
|
54
|
+
}
|
55
|
+
catch (error) {
|
56
|
+
this.message = (_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.message;
|
57
|
+
}
|
58
|
+
finally {
|
59
|
+
this.loading = false;
|
60
|
+
}
|
61
|
+
}
|
62
|
+
async validateBonus(pin) {
|
63
|
+
var _a, _b;
|
64
|
+
this.loading = true;
|
65
|
+
this.message = "";
|
66
|
+
const payload = {
|
67
|
+
pin: pin,
|
68
|
+
cellphone: this.phone.toString(),
|
69
|
+
loja_id: this.sent.storeId,
|
70
|
+
user_id: this.sent.userId,
|
71
|
+
cartId: this.cartId,
|
72
|
+
products: this.products
|
73
|
+
};
|
74
|
+
try {
|
75
|
+
this.bonus = await this.crmBonusService.validatePinBonus(payload, this.storeName);
|
76
|
+
console.log('[this.bonus]', this.bonus);
|
77
|
+
this.step = StepFormEnum.STEP_RESERVE;
|
78
|
+
}
|
79
|
+
catch (error) {
|
80
|
+
this.message = (_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.message;
|
81
|
+
}
|
82
|
+
finally {
|
83
|
+
this.loading = false;
|
84
|
+
}
|
85
|
+
console.log('payload', payload);
|
86
|
+
}
|
87
|
+
async reserve(amount) {
|
88
|
+
this.loading = true;
|
89
|
+
this.message = "";
|
90
|
+
try {
|
91
|
+
await this.crmBonusService.reserve({
|
92
|
+
redeemed_bonus: amount,
|
93
|
+
cart_id: this.cartId,
|
94
|
+
ticket: this.cartId,
|
95
|
+
gross_value: this.bonus.totalValue,
|
96
|
+
}, this.storeName);
|
97
|
+
this.step = StepFormEnum.STEP_APPLY;
|
98
|
+
}
|
99
|
+
catch (error) {
|
100
|
+
this.message = "ocorreu um error ao solicitar a aplicação do bonus! tente novamente";
|
101
|
+
}
|
102
|
+
finally {
|
103
|
+
this.loading = false;
|
104
|
+
}
|
105
|
+
}
|
106
|
+
handleCancel() {
|
107
|
+
this.step = StepFormEnum.STEP_PHONE;
|
108
|
+
this.cancel();
|
109
|
+
}
|
110
|
+
render() {
|
111
|
+
return (h(Host, { key: '3097220f8802f698c4c1163fa359dfbf3089921f' }, this.step === StepFormEnum.STEP_PHONE && h("phone-input", { key: '039f1d21f8b40f00b24722fe26d5a5539f9d8226', value: this.customer.phone, sendPin: (phone) => this.sendPin(phone), loading: this.loading }), this.step === StepFormEnum.STEP_PIN && h("giftback-pin", { key: '600a4adff83b3afa5d82c4fd484ab07757323ebb', cancel: () => this.handleCancel(), sent: this.sent, validate: (data) => this.validateBonus(data), loading: this.loading }), this.step === StepFormEnum.STEP_RESERVE && h("giftback-progress", { key: 'd3f430232255cc602f0cdb6c7fe4b4cc41588fdc', loading: this.loading, cancel: () => this.handleCancel(), bonus: this.bonus, reserve: (amountRedeemed) => this.reserve(amountRedeemed) }), this.step === StepFormEnum.STEP_APPLY && h("giftback-finish", { key: '6cac259c8b3d7a2fc00dd9feeb28abaad948009e' }), h("p", { key: 'f21ea87102b5aea7122aa983bed22257b7f73721', class: "message-error" }, this.message)));
|
112
|
+
}
|
113
|
+
static get style() { return CrmBonusFormStyle0; }
|
114
|
+
}, [1, "crm-bonus-form", {
|
115
|
+
"storeName": [8, "storename"],
|
116
|
+
"cartId": [8, "cart-id"],
|
117
|
+
"products": [16],
|
118
|
+
"customer": [16],
|
119
|
+
"cancel": [16],
|
120
|
+
"loading": [32],
|
121
|
+
"step": [32],
|
122
|
+
"sent": [32],
|
123
|
+
"message": [32],
|
124
|
+
"phone": [32],
|
125
|
+
"bonus": [32]
|
126
|
+
}]);
|
127
|
+
function defineCustomElement() {
|
128
|
+
if (typeof customElements === "undefined") {
|
129
|
+
return;
|
130
|
+
}
|
131
|
+
const components = ["crm-bonus-form", "giftback-finish", "giftback-pin", "giftback-progress", "loading-spinner", "phone-input", "phone-input-mask"];
|
132
|
+
components.forEach(tagName => { switch (tagName) {
|
133
|
+
case "crm-bonus-form":
|
134
|
+
if (!customElements.get(tagName)) {
|
135
|
+
customElements.define(tagName, CrmBonusForm);
|
136
|
+
}
|
137
|
+
break;
|
138
|
+
case "giftback-finish":
|
139
|
+
if (!customElements.get(tagName)) {
|
140
|
+
defineCustomElement$6();
|
141
|
+
}
|
142
|
+
break;
|
143
|
+
case "giftback-pin":
|
144
|
+
if (!customElements.get(tagName)) {
|
145
|
+
defineCustomElement$5();
|
146
|
+
}
|
147
|
+
break;
|
148
|
+
case "giftback-progress":
|
149
|
+
if (!customElements.get(tagName)) {
|
150
|
+
defineCustomElement$4();
|
151
|
+
}
|
152
|
+
break;
|
153
|
+
case "loading-spinner":
|
154
|
+
if (!customElements.get(tagName)) {
|
155
|
+
defineCustomElement$3();
|
156
|
+
}
|
157
|
+
break;
|
158
|
+
case "phone-input":
|
159
|
+
if (!customElements.get(tagName)) {
|
160
|
+
defineCustomElement$2();
|
161
|
+
}
|
162
|
+
break;
|
163
|
+
case "phone-input-mask":
|
164
|
+
if (!customElements.get(tagName)) {
|
165
|
+
defineCustomElement$1();
|
166
|
+
}
|
167
|
+
break;
|
168
|
+
} });
|
169
|
+
}
|
170
|
+
defineCustomElement();
|
171
|
+
|
172
|
+
export { CrmBonusForm as C, defineCustomElement as d };
|
173
|
+
|
174
|
+
//# sourceMappingURL=p-878ce0aa.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"p-878ce0aa.js","mappings":"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","names":[],"sources":["src/contants/index.ts","src/components/crm-bonus-form/crm-bonus-form.css?tag=crm-bonus-form&encapsulation=shadow","src/components/crm-bonus-form/crm-bonus-form.tsx"],"sourcesContent":["export enum StepFormEnum {\n STEP_PHONE = 1,\n STEP_PIN = 2,\n STEP_RESERVE = 3,\n STEP_APPLY = 4\n}",".form-container {\n width: 100%;\n display: flex;\n justify-content: center;\n justify-content: space-around;\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.disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n.message-error {\n color: #d11111;\n font-weight: bold;\n font-family: Arial;\n font-size: small;\n margin-left: 16px;\n}","import { Component, Host, Prop, State, h } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\nimport { IPinSent } from \"../../components\";\nimport { IBonus, ICustomer, IProccesPinBonusDto, IProduct } from \"../../dto/validate.pin.bonus\";\nimport { StepFormEnum } from \"../../contants\";\n\n@Component({\n tag: 'crm-bonus-form',\n styleUrl: 'crm-bonus-form.css',\n shadow: true\n})\nexport class CrmBonusForm {\n\n private crmBonusService: CrmBonusService = new CrmBonusService();\n\n @Prop({ attribute: 'storename' }) storeName;\n @Prop() cartId;\n @Prop() products: Array<IProduct>;\n @Prop() customer: ICustomer = {\n phone: \"\",\n birthDate: \"\",\n document: \"\",\n name: \"\"\n };\n @Prop() cancel: () => void;\n\n @State() loading: boolean = false;\n\n @State() step: number = StepFormEnum.STEP_PHONE;\n\n @State() sent: IPinSent;\n\n @State() message: string;\n\n @State() phone: number;\n\n @State() bonus: IBonus;\n\n public async sendPin(phone: string) {\n this.loading = true;\n this.message = \"\";\n\n try {\n const _phone = phone.replace(/\\D/g, '');\n this.phone = Number(_phone);\n const sent = await this.crmBonusService.sendPin(this.phone, this.storeName);\n this.sent = sent;\n this.step = StepFormEnum.STEP_PIN;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n public async validateBonus(pin: string) {\n this.loading = true;\n this.message = \"\";\n const payload: IProccesPinBonusDto = {\n pin: pin,\n cellphone: this.phone.toString(),\n loja_id: this.sent.storeId,\n user_id: this.sent.userId,\n cartId: this.cartId,\n products: this.products\n }\n\n try {\n this.bonus = await this.crmBonusService.validatePinBonus(payload, this.storeName);\n\n console.log('[this.bonus]', this.bonus);\n this.step = StepFormEnum.STEP_RESERVE;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false;\n }\n console.log('payload', payload)\n }\n\n public async reserve(amount: number) {\n this.loading = true;\n this.message = \"\";\n try {\n await this.crmBonusService.reserve({\n redeemed_bonus: amount,\n cart_id: this.cartId,\n ticket: this.cartId,\n gross_value: this.bonus.totalValue,\n }, this.storeName);\n\n this.step = StepFormEnum.STEP_APPLY;\n } catch (error) {\n this.message = \"ocorreu um error ao solicitar a aplicação do bonus! tente novamente\"\n } finally {\n this.loading = false;\n }\n }\n\n public handleCancel() {\n this.step = StepFormEnum.STEP_PHONE;\n this.cancel()\n }\n\n render() {\n return (\n <Host>\n {this.step === StepFormEnum.STEP_PHONE && <phone-input value={this.customer.phone} sendPin={(phone) => this.sendPin(phone)} loading={this.loading} />}\n {this.step === StepFormEnum.STEP_PIN && <giftback-pin cancel={() => this.handleCancel()} sent={this.sent} validate={(data) => this.validateBonus(data)} loading={this.loading} />}\n\n {this.step === StepFormEnum.STEP_RESERVE && <giftback-progress loading={this.loading} cancel={() => this.handleCancel()} bonus={this.bonus} reserve={(amountRedeemed: number) => this.reserve(amountRedeemed)} />}\n {this.step === StepFormEnum.STEP_APPLY && <giftback-finish />}\n <p class=\"message-error\">{this.message}</p>\n </Host>\n )\n }\n}"],"version":3}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import { p as proxyCustomElement, H, h } from './p-faf7103e.js';
|
2
|
+
import { d as defineCustomElement$2 } from './p-cb5a1fdf.js';
|
3
|
+
import { d as defineCustomElement$1 } from './p-e40cf14d.js';
|
4
|
+
|
5
|
+
const PhoneInput = /*@__PURE__*/ proxyCustomElement(class PhoneInput extends H {
|
6
|
+
constructor() {
|
7
|
+
super();
|
8
|
+
this.__registerHost();
|
9
|
+
this.sendPin = undefined;
|
10
|
+
this.loading = undefined;
|
11
|
+
this.value = undefined;
|
12
|
+
}
|
13
|
+
async validatePhone() {
|
14
|
+
const phone = await this.phoneInputMask.getPhone();
|
15
|
+
await this.sendPin(phone);
|
16
|
+
}
|
17
|
+
render() {
|
18
|
+
return (h("div", { key: '8deb65295383b9a14e1ac5c3050ce2cab709c208', class: "form-container" }, h("phone-input-mask", { key: 'd5c9b2fb84b166c67fdfa653f4d0194818d7ae54', initialValue: this.value, ref: ref => this.phoneInputMask = ref }), h("button", { key: '666403560be459bd387d743936b4de1d0cb29ade', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, !this.loading ? "validar" : h("loading-spinner", { size: "25px", color: "#fff" }))));
|
19
|
+
}
|
20
|
+
}, [0, "phone-input", {
|
21
|
+
"sendPin": [16],
|
22
|
+
"loading": [4],
|
23
|
+
"value": [1]
|
24
|
+
}]);
|
25
|
+
function defineCustomElement() {
|
26
|
+
if (typeof customElements === "undefined") {
|
27
|
+
return;
|
28
|
+
}
|
29
|
+
const components = ["phone-input", "loading-spinner", "phone-input-mask"];
|
30
|
+
components.forEach(tagName => { switch (tagName) {
|
31
|
+
case "phone-input":
|
32
|
+
if (!customElements.get(tagName)) {
|
33
|
+
customElements.define(tagName, PhoneInput);
|
34
|
+
}
|
35
|
+
break;
|
36
|
+
case "loading-spinner":
|
37
|
+
if (!customElements.get(tagName)) {
|
38
|
+
defineCustomElement$2();
|
39
|
+
}
|
40
|
+
break;
|
41
|
+
case "phone-input-mask":
|
42
|
+
if (!customElements.get(tagName)) {
|
43
|
+
defineCustomElement$1();
|
44
|
+
}
|
45
|
+
break;
|
46
|
+
} });
|
47
|
+
}
|
48
|
+
defineCustomElement();
|
49
|
+
|
50
|
+
export { PhoneInput as P, defineCustomElement as d };
|
51
|
+
|
52
|
+
//# sourceMappingURL=p-8fcf8924.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"p-8fcf8924.js","mappings":";;;;MAKa,UAAU;;;;;;;;IAQnB,MAAM,aAAa;QACf,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;QACnD,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;KAC7B;IAED,MAAM;QACF,QACI,4DAAK,KAAK,EAAC,gBAAgB,IACvB,yEAAkB,YAAY,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,IAAI,IAAI,CAAC,cAAc,GAAG,GAAG,GAAI,EACrF,+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,EACT;KACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/crm-bonus-form/subcomponents/phone/phone.input.tsx"],"sourcesContent":["import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'phone-input'\n})\nexport class PhoneInput {\n\n private phoneInputMask: HTMLPhoneInputMaskElement;\n\n @Prop() sendPin: Function;\n @Prop() loading: boolean;\n @Prop() value: string;\n\n async validatePhone() {\n const phone = await this.phoneInputMask.getPhone();\n await this.sendPin(phone);\n }\n\n render() {\n return (\n <div class=\"form-container\">\n <phone-input-mask initialValue={this.value} ref={ref => this.phoneInputMask = ref} />\n <button class={`button ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePhone()}>\n {\n !this.loading ? \"validar\" : <loading-spinner size=\"25px\" color=\"#fff\" />\n }\n </button>\n </div>\n )\n }\n}"],"version":3}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { p as proxyCustomElement, H, h } from './p-faf7103e.js';
|
2
|
+
|
3
|
+
const loadingSpinnerCss = ".spinner{display:inline-block;border:4px solid transparent;border-radius:50%;border-top-color:var(--color, #0078d7);animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";
|
4
|
+
const LoadingSpinnerStyle0 = loadingSpinnerCss;
|
5
|
+
|
6
|
+
const LoadingSpinner = /*@__PURE__*/ proxyCustomElement(class LoadingSpinner extends H {
|
7
|
+
constructor() {
|
8
|
+
super();
|
9
|
+
this.__registerHost();
|
10
|
+
this.__attachShadow();
|
11
|
+
this.size = '50px';
|
12
|
+
this.color = '#0078d7';
|
13
|
+
}
|
14
|
+
render() {
|
15
|
+
return (h("div", { key: 'cba1c6d6635d5f9ca12dd86c1d293126ffc54167', class: "spinner", style: { width: this.size, height: this.size, borderColor: `${this.color} transparent transparent transparent` } }));
|
16
|
+
}
|
17
|
+
static get style() { return LoadingSpinnerStyle0; }
|
18
|
+
}, [1, "loading-spinner", {
|
19
|
+
"size": [1],
|
20
|
+
"color": [1]
|
21
|
+
}]);
|
22
|
+
function defineCustomElement() {
|
23
|
+
if (typeof customElements === "undefined") {
|
24
|
+
return;
|
25
|
+
}
|
26
|
+
const components = ["loading-spinner"];
|
27
|
+
components.forEach(tagName => { switch (tagName) {
|
28
|
+
case "loading-spinner":
|
29
|
+
if (!customElements.get(tagName)) {
|
30
|
+
customElements.define(tagName, LoadingSpinner);
|
31
|
+
}
|
32
|
+
break;
|
33
|
+
} });
|
34
|
+
}
|
35
|
+
defineCustomElement();
|
36
|
+
|
37
|
+
export { LoadingSpinner as L, defineCustomElement as d };
|
38
|
+
|
39
|
+
//# sourceMappingURL=p-cb5a1fdf.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"p-cb5a1fdf.js","mappings":";;AAAA,MAAM,iBAAiB,GAAG,iOAAiO,CAAC;AAC5P,6BAAe,iBAAiB;;MCMnB,cAAc;;;;;oBACA,MAAM;qBACL,SAAS;;IAEjC,MAAM;QACF,QACI,4DAAK,KAAK,EAAC,SAAS,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,sCAAsC,EAAE,GAAQ,EAC/I;KACL;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/loading-spinner/loading-spinner.css?tag=loading-spinner&encapsulation=shadow","src/components/loading-spinner/loading-spinner.tsx"],"sourcesContent":[".spinner {\n display: inline-block;\n border: 4px solid transparent;\n border-radius: 50%;\n border-top-color: var(--color, #0078d7);\n animation: spin 1s linear infinite;\n}\n\n@keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n}","import { Component, h, Prop } from '@stencil/core';\n\n@Component({\n tag: 'loading-spinner',\n styleUrl: 'loading-spinner.css',\n shadow: true,\n})\nexport class LoadingSpinner {\n @Prop() size: string = '50px'; // Tamanho do spinner (padrão 50px)\n @Prop() color: string = '#0078d7'; // Cor do spinner (padrão azul)\n\n render() {\n return (\n <div class=\"spinner\" style={{ width: this.size, height: this.size, borderColor: `${this.color} transparent transparent transparent` }}></div>\n );\n }\n}\n"],"version":3}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { p as proxyCustomElement, H, h } from './p-faf7103e.js';
|
2
|
+
|
3
|
+
const successSvgrepoComSvg = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBVcGxvYWRlZCB0bzogU1ZHIFJlcG8sIHd3dy5zdmdyZXBvLmNvbSwgR2VuZXJhdG9yOiBTVkcgUmVwbyBNaXhlciBUb29scyAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiANCgkgdmlld0JveD0iMCAwIDUwIDUwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxjaXJjbGUgc3R5bGU9ImZpbGw6IzI1QUU4ODsiIGN4PSIyNSIgY3k9IjI1IiByPSIyNSIvPg0KPHBvbHlsaW5lIHN0eWxlPSJmaWxsOm5vbmU7c3Ryb2tlOiNGRkZGRkY7c3Ryb2tlLXdpZHRoOjI7c3Ryb2tlLWxpbmVjYXA6cm91bmQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEwOyIgcG9pbnRzPSINCgkzOCwxNSAyMiwzMyAxMiwyNSAiLz4NCjwvc3ZnPg==';
|
4
|
+
|
5
|
+
const giftbackFinishCss = ".message-finish{align-content:center;text-align:center}.message-finish p{color:#777676;font-size:xx-large;font-family:sans-serif}";
|
6
|
+
const GiftbackFinishStyle0 = giftbackFinishCss;
|
7
|
+
|
8
|
+
const GiftbackFinish = /*@__PURE__*/ proxyCustomElement(class GiftbackFinish extends H {
|
9
|
+
constructor() {
|
10
|
+
super();
|
11
|
+
this.__registerHost();
|
12
|
+
this.__attachShadow();
|
13
|
+
}
|
14
|
+
render() {
|
15
|
+
return (h("div", { key: 'e72f82799146a6e94acbdd62324e07cdf9f77009', class: "message-finish" }, h("img", { key: '46e2436a3dbe4745225c3b9674e6bf6c299ad63e', src: successSvgrepoComSvg, width: 80 }), h("p", { key: '270e42050956f7f3d1ae9b90f314211fa310f797' }, "Legal! O B\u00F4nus ser\u00E1 aplicado na sua compra.")));
|
16
|
+
}
|
17
|
+
static get style() { return GiftbackFinishStyle0; }
|
18
|
+
}, [1, "giftback-finish"]);
|
19
|
+
function defineCustomElement() {
|
20
|
+
if (typeof customElements === "undefined") {
|
21
|
+
return;
|
22
|
+
}
|
23
|
+
const components = ["giftback-finish"];
|
24
|
+
components.forEach(tagName => { switch (tagName) {
|
25
|
+
case "giftback-finish":
|
26
|
+
if (!customElements.get(tagName)) {
|
27
|
+
customElements.define(tagName, GiftbackFinish);
|
28
|
+
}
|
29
|
+
break;
|
30
|
+
} });
|
31
|
+
}
|
32
|
+
defineCustomElement();
|
33
|
+
|
34
|
+
export { GiftbackFinish as G, defineCustomElement as d };
|
35
|
+
|
36
|
+
//# sourceMappingURL=p-cbade307.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"p-cbade307.js","mappings":";;AAAA,MAAM,oBAAoB,GAAG,4rBAA4rB;;ACAztB,MAAM,iBAAiB,GAAG,mIAAmI,CAAC;AAC9J,6BAAe,iBAAiB;;MCOnB,cAAc;;;;;;IACvB,MAAM;QACF,QACI,4DAAK,KAAK,EAAC,gBAAgB,IACvB,4DAAK,GAAG,EAAEA,oBAAO,EAAE,KAAK,EAAE,EAAE,GAAI,EAChC,oHAAkD,CAChD,EACT;KACJ;;;;;;;;;;;;;;;;;;;;","names":["success"],"sources":["src/components/crm-bonus/assets/svg/success-svgrepo-com.svg","src/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.css?tag=giftback-finish&encapsulation=shadow","src/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.tsx"],"sourcesContent":["<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\r\n<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->\r\n<svg version=\"1.1\" id=\"Capa_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" \r\n\t viewBox=\"0 0 50 50\" xml:space=\"preserve\">\r\n<circle style=\"fill:#25AE88;\" cx=\"25\" cy=\"25\" r=\"25\"/>\r\n<polyline style=\"fill:none;stroke:#FFFFFF;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;\" points=\"\r\n\t38,15 22,33 12,25 \"/>\r\n</svg>",".message-finish {\n align-content: center;\n text-align: center;\n}\n\n.message-finish p {\n color: #777676;\n font-size: xx-large;\n font-family: sans-serif;\n}","import { Component, h } from \"@stencil/core\";\nimport success from '../../../crm-bonus/assets/svg/success-svgrepo-com.svg'\n\n@Component({\n tag: 'giftback-finish',\n styleUrl: 'giftback-finish.css',\n shadow: true\n})\nexport class GiftbackFinish {\n render() {\n return (\n <div class=\"message-finish\">\n <img src={success} width={80} />\n <p>Legal! O Bônus será aplicado na sua compra.</p>\n </div>\n )\n }\n}"],"version":3}
|
@@ -1,10 +1,13 @@
|
|
1
|
-
import {
|
1
|
+
import { p as proxyCustomElement, H, h } from './p-faf7103e.js';
|
2
2
|
|
3
3
|
const phoneInputMaskCss = ".inline-text-field-container{display:flex;flex-direction:column}@supports (top: max(0%)){.mdc-text-field--outlined{padding-right:max(16px, var(--mdc-shape-small, 4px))}}@supports (top: max(0%)){.mdc-text-field--outlined{padding-left:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}.mdc-text-field--outlined{height:55px;overflow:visible}.phone{width:300px;height:50px;font-size:18px;padding:10px;color:grey;border:1px solid #d3c6c6;outline:none}.mdc-text-field{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:0;border-bottom-left-radius:0;display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity, transform, color}";
|
4
|
+
const PhoneInputMaskStyle0 = phoneInputMaskCss;
|
4
5
|
|
5
|
-
const PhoneInputMask = class {
|
6
|
-
constructor(
|
7
|
-
|
6
|
+
const PhoneInputMask = /*@__PURE__*/ proxyCustomElement(class PhoneInputMask extends H {
|
7
|
+
constructor() {
|
8
|
+
super();
|
9
|
+
this.__registerHost();
|
10
|
+
this.__attachShadow();
|
8
11
|
this.phone = '';
|
9
12
|
this.initialValue = undefined;
|
10
13
|
}
|
@@ -29,11 +32,29 @@ const PhoneInputMask = class {
|
|
29
32
|
return this.phone;
|
30
33
|
}
|
31
34
|
render() {
|
32
|
-
return (h("input", { key: '
|
35
|
+
return (h("input", { key: 'eb90a08eb68463fb8dcb81e22d45621b8b59c754', id: "phone", type: "tel", class: "phone", value: this.phone, onInput: (event) => this.handleInput(event), placeholder: "(12) 94567-8910" }));
|
33
36
|
}
|
34
|
-
}
|
35
|
-
|
37
|
+
static get style() { return PhoneInputMaskStyle0; }
|
38
|
+
}, [1, "phone-input-mask", {
|
39
|
+
"initialValue": [1, "initial-value"],
|
40
|
+
"phone": [32],
|
41
|
+
"getPhone": [64]
|
42
|
+
}]);
|
43
|
+
function defineCustomElement() {
|
44
|
+
if (typeof customElements === "undefined") {
|
45
|
+
return;
|
46
|
+
}
|
47
|
+
const components = ["phone-input-mask"];
|
48
|
+
components.forEach(tagName => { switch (tagName) {
|
49
|
+
case "phone-input-mask":
|
50
|
+
if (!customElements.get(tagName)) {
|
51
|
+
customElements.define(tagName, PhoneInputMask);
|
52
|
+
}
|
53
|
+
break;
|
54
|
+
} });
|
55
|
+
}
|
56
|
+
defineCustomElement();
|
36
57
|
|
37
|
-
export { PhoneInputMask as
|
58
|
+
export { PhoneInputMask as P, defineCustomElement as d };
|
38
59
|
|
39
|
-
//# sourceMappingURL=
|
60
|
+
//# sourceMappingURL=p-e40cf14d.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"p-e40cf14d.js","mappings":";;AAAA,MAAM,iBAAiB,GAAG,+zBAA+zB,CAAC;AAC11B,6BAAe,iBAAiB;;MCMnB,cAAc;;;;;qBACE,EAAE;;;IAG3B,iBAAiB;QACb,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC;KAClC;IAGO,WAAW,CAAC,KAAa;QAC7B,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACzC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;QAC7D,IAAI,CAAC,KAAK;YAAE,OAAO,KAAK,CAAC;QAEzB,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC;QAC7C,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC;QAC9C,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC;QAE7C,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,EAAE,CAAC;KACrC;IAEO,WAAW,CAAC,KAAY;QAC5B,MAAM,KAAK,GAAG,KAAK,CAAC,MAA0B,CAAC;QAC/C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KAC9C;IAGM,MAAM,QAAQ;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC;KACrB;IAED,MAAM;QACF,QACI,8DACI,EAAE,EAAC,OAAO,EACV,IAAI,EAAC,KAAK,EACV,KAAK,EAAC,OAAO,EACb,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,EAC3C,WAAW,EAAC,iBAAiB,GAC/B,EACJ;KACL;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/phone/phone-input-mask.css?tag=phone-input-mask&encapsulation=shadow","src/components/phone/phone-input-mask.tsx"],"sourcesContent":[".inline-text-field-container {\n display: flex;\n flex-direction: column;\n}\n\n@supports (top: max(0%)) {\n .mdc-text-field--outlined {\n padding-right: max(16px, var(--mdc-shape-small, 4px));\n }\n}\n\n@supports (top: max(0%)) {\n .mdc-text-field--outlined {\n padding-left: max(16px, calc(var(--mdc-shape-small, 4px) + 4px));\n }\n}\n\n.mdc-text-field--outlined {\n height: 55px;\n overflow: visible;\n}\n\n.phone {\n width: 300px;\n height: 50px;\n font-size: 18px;\n padding: 10px;\n color: grey;\n border: 1px solid #d3c6c6;\n outline: none;\n}\n\n.mdc-text-field {\n border-top-left-radius: 4px;\n border-top-left-radius: var(--mdc-shape-small, 4px);\n border-top-right-radius: 4px;\n border-top-right-radius: var(--mdc-shape-small, 4px);\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n display: inline-flex;\n align-items: baseline;\n padding: 0 16px;\n position: relative;\n box-sizing: border-box;\n overflow: hidden;\n will-change: opacity, transform, color;\n}","import { Component, h, Method, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'phone-input-mask',\n styleUrl: 'phone-input-mask.css',\n shadow: true,\n})\nexport class PhoneInputMask {\n @State() phone: string = '';\n @Prop() initialValue: string;\n\n componentWillLoad() {\n this.phone = this.initialValue; \n }\n\n\n private formatPhone(value: string): string {\n const cleaned = value.replace(/\\D/g, ''); // Remove tudo que não for número\n const match = cleaned.match(/^(\\d{0,2})(\\d{0,5})(\\d{0,4})$/);\n if (!match) return value;\n\n const part1 = match[1] ? `(${match[1]}` : '';\n const part2 = match[2] ? `) ${match[2]}` : '';\n const part3 = match[3] ? `-${match[3]}` : '';\n\n return `${part1}${part2}${part3}`;\n }\n\n private handleInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.phone = this.formatPhone(input.value);\n }\n\n @Method()\n public async getPhone() {\n return this.phone;\n }\n\n render() {\n return (\n <input\n id=\"phone\"\n type=\"tel\"\n class=\"phone\"\n value={this.phone}\n onInput={(event) => this.handleInput(event)}\n placeholder=\"(12) 94567-8910\"\n />\n );\n }\n}\n"],"version":3}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import { p as proxyCustomElement, H, c as createEvent, h } from './p-faf7103e.js';
|
2
|
+
|
3
|
+
const appModalCss = ".modal-backdrop{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);display:none;justify-content:center;align-items:center;z-index:1000}.modal-backdrop.visible{display:flex}.modal{background:white;border-radius:8px;padding:1rem;max-width:500px;width:90%;box-shadow:0 2px 10px rgba(0, 0, 0, 0.3)}.modal-header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #ddd;margin-bottom:1rem}.close-button{background:none;border:none;font-size:1.5rem;cursor:pointer}.modal-body{}";
|
4
|
+
const AppModalStyle0 = appModalCss;
|
5
|
+
|
6
|
+
const AppModal = /*@__PURE__*/ proxyCustomElement(class AppModal extends H {
|
7
|
+
constructor() {
|
8
|
+
super();
|
9
|
+
this.__registerHost();
|
10
|
+
this.__attachShadow();
|
11
|
+
this.modalClosed = createEvent(this, "modalClosed", 7);
|
12
|
+
this.isOpen = false;
|
13
|
+
this.modalTitle = undefined;
|
14
|
+
}
|
15
|
+
closeModal() {
|
16
|
+
this.modalClosed.emit();
|
17
|
+
}
|
18
|
+
render() {
|
19
|
+
return (h("div", { key: '82c352862bc0e4bff13b48c82ce09643d922d66e', class: `modal-backdrop ${this.isOpen ? 'visible' : ''}` }, h("div", { key: 'ffde88a49b5e201caa1b14b52fe997ee183cbb6e', class: "modal" }, h("div", { key: 'f68a25c7ca6554d81d3d55f7b9a00f35ddbb4744', class: "modal-header" }, h("h3", { key: 'f0ec45fac1b595bd03b603a2f69dd036fe2cef16' }, this.modalTitle), h("button", { key: '1600501c66d41e9e8aa8ca7b335f41701c7e57ea', class: "close-button", onClick: () => this.closeModal() }, "\u00D7")), h("div", { key: '563e936a2717e5534b9f8d528fbd432565562790', class: "modal-body" }, h("slot", { key: '499c8c2925cc9469da0998bbe1fad360adaf1efd' })))));
|
20
|
+
}
|
21
|
+
static get style() { return AppModalStyle0; }
|
22
|
+
}, [1, "app-modal", {
|
23
|
+
"isOpen": [516, "is-open"],
|
24
|
+
"modalTitle": [1, "modal-title"]
|
25
|
+
}]);
|
26
|
+
function defineCustomElement() {
|
27
|
+
if (typeof customElements === "undefined") {
|
28
|
+
return;
|
29
|
+
}
|
30
|
+
const components = ["app-modal"];
|
31
|
+
components.forEach(tagName => { switch (tagName) {
|
32
|
+
case "app-modal":
|
33
|
+
if (!customElements.get(tagName)) {
|
34
|
+
customElements.define(tagName, AppModal);
|
35
|
+
}
|
36
|
+
break;
|
37
|
+
} });
|
38
|
+
}
|
39
|
+
defineCustomElement();
|
40
|
+
|
41
|
+
export { AppModal as A, defineCustomElement as d };
|
42
|
+
|
43
|
+
//# sourceMappingURL=p-e816fb90.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"p-e816fb90.js","mappings":";;AAAA,MAAM,WAAW,GAAG,+hBAA+hB,CAAC;AACpjB,uBAAe,WAAW;;MCMb,QAAQ;;;;;;sBAG0B,KAAK;;;IAQxC,UAAU;QACd,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;KAC3B;IAED,MAAM;QACF,QACI,4DAAK,KAAK,EAAE,kBAAkB,IAAI,CAAC,MAAM,GAAG,SAAS,GAAG,EAAE,EAAE,IACxD,4DAAK,KAAK,EAAC,OAAO,IACd,4DAAK,KAAK,EAAC,cAAc,IACrB,6DAAK,IAAI,CAAC,UAAU,CAAM,EAC1B,+DAAQ,KAAK,EAAC,cAAc,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE,aAEpD,CACP,EACN,4DAAK,KAAK,EAAC,YAAY,IACnB,8DAAQ,CACN,CACJ,CACJ,EACT;KACJ;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/modal/app-modal.css?tag=app-modal&encapsulation=shadow","src/components/modal/app-modal.tsx"],"sourcesContent":[".modal-backdrop {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n display: none;\n justify-content: center;\n align-items: center;\n z-index: 1000;\n }\n \n .modal-backdrop.visible {\n display: flex;\n }\n \n .modal {\n background: white;\n border-radius: 8px;\n padding: 1rem;\n max-width: 500px;\n width: 90%;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);\n }\n \n .modal-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-bottom: 1px solid #ddd;\n margin-bottom: 1rem;\n }\n \n .close-button {\n background: none;\n border: none;\n font-size: 1.5rem;\n cursor: pointer;\n }\n \n .modal-body {\n /* padding: 1rem 0; */\n }\n ","import { Component, Event, EventEmitter, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'app-modal',\n styleUrl: 'app-modal.css',\n shadow: true,\n})\nexport class AppModal {\n\n // Controle da visibilidade do modal\n @Prop({ reflect: true }) isOpen: boolean = false;\n\n // Título do modal\n @Prop() modalTitle: string;\n\n // Evento emitido ao fechar o modal\n @Event() modalClosed: EventEmitter<void>;\n\n private closeModal() {\n this.modalClosed.emit();\n }\n\n render() {\n return (\n <div class={`modal-backdrop ${this.isOpen ? 'visible' : ''}`}>\n <div class=\"modal\">\n <div class=\"modal-header\">\n <h3>{this.modalTitle}</h3>\n <button class=\"close-button\" onClick={() => this.closeModal()}>\n ×\n </button>\n </div>\n <div class=\"modal-body\">\n <slot />\n </div>\n </div>\n </div>\n )\n }\n}"],"version":3}
|