crmbonus-component-wake 0.0.27 → 1.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/dist/cjs/app-modal_4.cjs.entry.js +152 -0
  2. package/dist/cjs/app-modal_4.cjs.entry.js.map +1 -0
  3. package/dist/cjs/crm-bonus.cjs.entry.js +37 -6
  4. package/dist/cjs/crm-bonus.cjs.entry.js.map +1 -1
  5. package/dist/cjs/crmbonus-component-wake.cjs.js +1 -1
  6. package/dist/cjs/{giftback-finish_5.cjs.entry.js → giftback-finish_3.cjs.entry.js} +6 -59
  7. package/dist/cjs/giftback-finish_3.cjs.entry.js.map +1 -0
  8. package/dist/cjs/index-296f70bf.js +11 -0
  9. package/dist/cjs/index-296f70bf.js.map +1 -0
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/cjs/loading-spinner.cjs.entry.js +1 -1
  12. package/dist/cjs/pedido-finalizado.cjs.entry.js +1 -1
  13. package/dist/cjs/phone-input-mask.cjs.entry.js +45 -0
  14. package/dist/cjs/phone-input-mask.cjs.entry.js.map +1 -0
  15. package/dist/collection/collection-manifest.json +1 -0
  16. package/dist/collection/components/crm-bonus/crm-bonus.css +31 -1
  17. package/dist/collection/components/crm-bonus/crm-bonus.js +43 -5
  18. package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -1
  19. package/dist/collection/components/crm-bonus-form/crm-bonus-form.css +0 -13
  20. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +125 -30
  21. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js.map +1 -1
  22. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js +1 -1
  23. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js +1 -1
  24. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js +3 -3
  25. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js.map +1 -1
  26. package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js +1 -1
  27. package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js +75 -0
  28. package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js.map +1 -0
  29. package/dist/collection/components/loading-spinner/loading-spinner.js +1 -1
  30. package/dist/collection/components/modal/app-modal.js +1 -1
  31. package/dist/collection/components/pedido/pedido.js +1 -1
  32. package/dist/collection/components/phone/phone-input-mask.js +19 -1
  33. package/dist/collection/components/phone/phone-input-mask.js.map +1 -1
  34. package/dist/components/app-modal.js +1 -1
  35. package/dist/components/crm-bonus-form.js +1 -1
  36. package/dist/components/crm-bonus.js +62 -21
  37. package/dist/components/crm-bonus.js.map +1 -1
  38. package/dist/components/giftback-finish.js +1 -1
  39. package/dist/components/giftback-pin.js +1 -1
  40. package/dist/components/giftback-progress.js +1 -1
  41. package/dist/components/loading-spinner.js +1 -1
  42. package/dist/components/{p-cb5a1fdf.js → p-03918b34.js} +2 -2
  43. package/dist/components/{p-cb5a1fdf.js.map → p-03918b34.js.map} +1 -1
  44. package/dist/components/{p-cbade307.js → p-2667d525.js} +2 -2
  45. package/dist/components/{p-cbade307.js.map → p-2667d525.js.map} +1 -1
  46. package/dist/components/{p-8fcf8924.js → p-28ba6192.js} +4 -4
  47. package/dist/components/{p-8fcf8924.js.map → p-28ba6192.js.map} +1 -1
  48. package/dist/components/{p-6442ffce.js → p-3e80a758.js} +3 -3
  49. package/dist/components/{p-6442ffce.js.map → p-3e80a758.js.map} +1 -1
  50. package/dist/components/{p-e40cf14d.js → p-675deed3.js} +4 -2
  51. package/dist/components/p-675deed3.js.map +1 -0
  52. package/dist/components/{p-878ce0aa.js → p-b4c3e6bf.js} +36 -54
  53. package/dist/components/p-b4c3e6bf.js.map +1 -0
  54. package/dist/components/{p-462c12d8.js → p-c5913818.js} +5 -5
  55. package/dist/components/p-c5913818.js.map +1 -0
  56. package/dist/components/p-ed6bc79c.js +52 -0
  57. package/dist/components/p-ed6bc79c.js.map +1 -0
  58. package/dist/components/{p-e816fb90.js → p-f6396f4c.js} +2 -2
  59. package/dist/components/{p-e816fb90.js.map → p-f6396f4c.js.map} +1 -1
  60. package/dist/components/pedido-finalizado.js +1 -1
  61. package/dist/components/phone-cancel-input.d.ts +11 -0
  62. package/dist/components/phone-cancel-input.js +8 -0
  63. package/dist/components/phone-cancel-input.js.map +1 -0
  64. package/dist/components/phone-input-mask.js +1 -1
  65. package/dist/components/phone-input.js +1 -1
  66. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -1
  67. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
  68. package/dist/crmbonus-component-wake/p-075bd04d.entry.js +2 -0
  69. package/dist/crmbonus-component-wake/p-075bd04d.entry.js.map +1 -0
  70. package/dist/crmbonus-component-wake/p-241a5303.entry.js +2 -0
  71. package/dist/crmbonus-component-wake/p-241a5303.entry.js.map +1 -0
  72. package/dist/crmbonus-component-wake/p-86d04322.entry.js +2 -0
  73. package/dist/crmbonus-component-wake/p-86d04322.entry.js.map +1 -0
  74. package/dist/crmbonus-component-wake/p-8e6cdd1e.js +2 -0
  75. package/dist/crmbonus-component-wake/p-8e6cdd1e.js.map +1 -0
  76. package/dist/crmbonus-component-wake/{p-f74e4a71.entry.js → p-a603a26e.entry.js} +2 -2
  77. package/dist/crmbonus-component-wake/p-e9c2ed46.entry.js +2 -0
  78. package/dist/crmbonus-component-wake/p-e9c2ed46.entry.js.map +1 -0
  79. package/dist/crmbonus-component-wake/{p-4306a717.entry.js → p-ef75ecd5.entry.js} +2 -2
  80. package/dist/esm/app-modal_4.entry.js +145 -0
  81. package/dist/esm/app-modal_4.entry.js.map +1 -0
  82. package/dist/esm/crm-bonus.entry.js +37 -6
  83. package/dist/esm/crm-bonus.entry.js.map +1 -1
  84. package/dist/esm/crmbonus-component-wake.js +1 -1
  85. package/dist/esm/{giftback-finish_5.entry.js → giftback-finish_3.entry.js} +7 -58
  86. package/dist/esm/giftback-finish_3.entry.js.map +1 -0
  87. package/dist/esm/index-2bfaba2b.js +11 -0
  88. package/dist/esm/index-2bfaba2b.js.map +1 -0
  89. package/dist/esm/loader.js +1 -1
  90. package/dist/esm/loading-spinner.entry.js +1 -1
  91. package/dist/esm/pedido-finalizado.entry.js +1 -1
  92. package/dist/esm/phone-input-mask.entry.js +41 -0
  93. package/dist/esm/phone-input-mask.entry.js.map +1 -0
  94. package/dist/types/components/crm-bonus/crm-bonus.d.ts +9 -0
  95. package/dist/types/components/crm-bonus-form/crm-bonus-form.d.ts +8 -4
  96. package/dist/types/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.d.ts +1 -1
  97. package/dist/types/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.d.ts +8 -0
  98. package/dist/types/components/phone/phone-input-mask.d.ts +1 -0
  99. package/dist/types/components.d.ts +32 -0
  100. package/package.json +1 -1
  101. package/dist/cjs/app-modal_2.cjs.entry.js +0 -134
  102. package/dist/cjs/app-modal_2.cjs.entry.js.map +0 -1
  103. package/dist/cjs/giftback-finish_5.cjs.entry.js.map +0 -1
  104. package/dist/components/p-462c12d8.js.map +0 -1
  105. package/dist/components/p-878ce0aa.js.map +0 -1
  106. package/dist/components/p-e40cf14d.js.map +0 -1
  107. package/dist/crmbonus-component-wake/p-9985f639.entry.js +0 -2
  108. package/dist/crmbonus-component-wake/p-9985f639.entry.js.map +0 -1
  109. package/dist/crmbonus-component-wake/p-be1a56de.entry.js +0 -2
  110. package/dist/crmbonus-component-wake/p-be1a56de.entry.js.map +0 -1
  111. package/dist/crmbonus-component-wake/p-e2f165e8.entry.js +0 -2
  112. package/dist/crmbonus-component-wake/p-e2f165e8.entry.js.map +0 -1
  113. package/dist/esm/app-modal_2.entry.js +0 -129
  114. package/dist/esm/app-modal_2.entry.js.map +0 -1
  115. package/dist/esm/giftback-finish_5.entry.js.map +0 -1
  116. /package/dist/crmbonus-component-wake/{p-f74e4a71.entry.js.map → p-a603a26e.entry.js.map} +0 -0
  117. /package/dist/crmbonus-component-wake/{p-4306a717.entry.js.map → p-ef75ecd5.entry.js.map} +0 -0
@@ -3,9 +3,10 @@
3
3
  } */
4
4
 
5
5
  .container-button {
6
- max-width: 136px;
6
+ max-width: 100%;
7
7
  cursor: pointer;
8
8
  padding: 10px;
9
+ display: flex;
9
10
  }
10
11
 
11
12
  /* padding: 0 15px 15px;
@@ -17,4 +18,33 @@ margin-bottom: 20px; */
17
18
  /* min-height: 50px; */
18
19
  text-align: -webkit-center;
19
20
  margin-bottom: 20px;
21
+ }
22
+
23
+ .section-cart-crm {
24
+ /* border: 1px solid #dbd4d4; */
25
+ /* min-height: 50px; */
26
+ text-align: -webkit-center;
27
+ margin-bottom: 20px;
28
+ }
29
+
30
+ .button {
31
+ top: 50%;
32
+ background-color: #6c6c7e;
33
+ color: #fff;
34
+ border: none;
35
+ /* border-radius: 10px; */
36
+ padding: 15px;
37
+ min-height: 30px;
38
+ min-width: 120px;
39
+ font-size: 20px;
40
+ cursor: pointer;
41
+ margin-left: 10px;
42
+ height: 70px;
43
+ }
44
+
45
+ .form-container {
46
+ width: 100%;
47
+ display: flex;
48
+ justify-content: center;
49
+ justify-content: space-around;
20
50
  }
@@ -1,6 +1,6 @@
1
1
  import { h } from "@stencil/core";
2
- import logo from "./assets/svg/logo.svg";
3
2
  import { CrmBonusService } from "../../services/crmbonus.service";
3
+ import { StepFormEnum } from "../../contants";
4
4
  export class CrmBonus {
5
5
  constructor() {
6
6
  this.crmBonusService = new CrmBonusService();
@@ -10,7 +10,17 @@ export class CrmBonus {
10
10
  this.productsInString = undefined;
11
11
  this.cartId = undefined;
12
12
  this.products = undefined;
13
- this.customer = undefined;
13
+ this.customer = {
14
+ birthDate: "",
15
+ document: "",
16
+ name: "",
17
+ phone: ""
18
+ };
19
+ this.loading = false;
20
+ this.message = undefined;
21
+ this.phone = undefined;
22
+ this.canCancel = false;
23
+ this.sent = undefined;
14
24
  }
15
25
  async componentWillLoad() {
16
26
  await this.handleLoad();
@@ -18,7 +28,7 @@ export class CrmBonus {
18
28
  async handleLoad() {
19
29
  try {
20
30
  if (this.userId) {
21
- this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);
31
+ // this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);
22
32
  console.log('user', this.customer);
23
33
  }
24
34
  }
@@ -27,14 +37,37 @@ export class CrmBonus {
27
37
  }
28
38
  this.products = JSON.parse(this.productsInString);
29
39
  }
40
+ async sendPin(phone) {
41
+ var _a, _b;
42
+ this.loading = true;
43
+ this.message = "";
44
+ try {
45
+ const _phone = phone.replace(/\D/g, '');
46
+ this.phone = Number(_phone);
47
+ this.sent = await this.crmBonusService.sendPin(this.phone, this.storeName);
48
+ ;
49
+ await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);
50
+ this.showModal = true;
51
+ }
52
+ catch (error) {
53
+ 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;
54
+ }
55
+ finally {
56
+ this.loading = false;
57
+ }
58
+ }
30
59
  buildProducts() {
31
60
  return this.products.map(product => ({ sku: product.SKU, value: (product.PrecoPor * product.Quantidade), variantId: product.ProdutoVarianteId, qtd: product.Quantidade }));
32
61
  }
33
62
  handleCloseModal() {
34
63
  this.showModal = false;
35
64
  }
65
+ save() {
66
+ localStorage.setItem('@BYCODERS', this.cartId);
67
+ }
36
68
  render() {
37
- return (h("div", { key: 'c9db6de8e4503b454fd69302ec52808ed4d46812', class: "section-crm" }, h("div", { key: '4dcfd2946439206652ca8668ca37bbe35d5e0e2d', class: "container-button" }, h("img", { key: '07391e65e467aaebf1f1fabdc0d7dcf3fc1d5182', src: logo, onClick: () => (this.showModal = true) })), h("app-modal", { key: '8aa6c41f5faf07e6389a755faed661803b689cd5', isOpen: this.showModal, modalTitle: `Giftback`, onModalClosed: () => (this.showModal = false) }, h("crm-bonus-form", { key: 'e5903b6dd43617e619230490a23ffaaf5d77c9c6', cancel: () => this.handleCloseModal(), storeName: this.storeName, products: this.buildProducts(), cartId: this.cartId, customer: this.customer }))));
69
+ return (h("div", { key: '18d08a3d03ae5106cf01a426751db8300847f95c', class: "section-cart-crm" }, h("div", { key: 'dd9e939b78616cea4ea0b77ac32fe15afe63c9f9', class: "container-button" }, !this.canCancel ? h("phone-cancel-input", { value: this.customer.phone, sendPin: () => { }, loading: this.loading })
70
+ : h("phone-input", { value: this.customer.phone, sendPin: (phone) => { this.sendPin(phone); }, loading: this.loading })), h("app-modal", { key: 'abc596ebac59d08df3470d028ee814768a870ba9', isOpen: this.showModal, modalTitle: `Giftback`, onModalClosed: () => (this.showModal = false) }, h("crm-bonus-form", { key: '6ee857fd75d7261382ef8b9752bb6f3ea7918245', saveStore: () => this.save(), ref: ref => this.crmBonusRef = ref, sent: this.sent, phone: this.phone, cancel: () => this.handleCloseModal(), storeName: this.storeName, products: this.buildProducts(), cartId: this.cartId, customer: this.customer }))));
38
71
  }
39
72
  static get is() { return "crm-bonus"; }
40
73
  static get encapsulation() { return "shadow"; }
@@ -125,7 +158,12 @@ export class CrmBonus {
125
158
  return {
126
159
  "showModal": {},
127
160
  "products": {},
128
- "customer": {}
161
+ "customer": {},
162
+ "loading": {},
163
+ "message": {},
164
+ "phone": {},
165
+ "canCancel": {},
166
+ "sent": {}
129
167
  };
130
168
  }
131
169
  }
@@ -1 +1 @@
1
- {"version":3,"file":"crm-bonus.js","sourceRoot":"","sources":["../../../../src/components/crm-bonus/crm-bonus.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,IAAI,MAAM,uBAAuB,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAQlE,MAAM,OAAO,QAAQ;;QAEX,oBAAe,GAAoB,IAAI,eAAe,EAAE,CAAC;yB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AAU,EAAE,UAAU,EACtB,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;gBAE7C,uEAAgB,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,GAAI,CACxJ,CACR,CACP,CAAA;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, State, h } from '@stencil/core';\nimport logo from './assets/svg/logo.svg';\nimport { IProduct, IProductWake, ICustomer } from '../../dto/validate.pin.bonus';\nimport { CrmBonusService } from '../../services/crmbonus.service';\n\n@Component({\n tag: 'crm-bonus',\n styleUrl: 'crm-bonus.css',\n shadow: true,\n assetsDirs: ['assets']\n})\nexport class CrmBonus {\n\n private crmBonusService: CrmBonusService = new CrmBonusService();\n\n @State() showModal: boolean = false;\n @Prop({ attribute: 'userid' }) userId: number;\n @Prop({ attribute: 'storename' }) storeName;\n @Prop({ attribute: 'products' }) productsInString: string;\n @Prop({ attribute: 'cartid' }) cartId;\n\n @State() products: Array<IProductWake>;\n @State() customer: ICustomer;\n\n async componentWillLoad() {\n await this.handleLoad();\n }\n\n async handleLoad() {\n try {\n if(this.userId) {\n this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);\n console.log('user', this.customer);\n }\n } catch (error) {\n console.log('info customer')\n }\n this.products = JSON.parse(this.productsInString);\n }\n\n buildProducts(): IProduct[] {\n return this.products.map(product => ({ sku: product.SKU, value: (product.PrecoPor * product.Quantidade), variantId: product.ProdutoVarianteId, qtd: product.Quantidade }))\n }\n\n handleCloseModal() {\n this.showModal = false;\n }\n\n render() {\n return (\n <div class=\"section-crm\">\n <div class=\"container-button\">\n <img src={logo} onClick={() => (this.showModal = true)} />\n </div>\n <app-modal\n isOpen={this.showModal}\n modalTitle={`Giftback`}\n onModalClosed={() => (this.showModal = false)}\n >\n <crm-bonus-form cancel={() => this.handleCloseModal()} storeName={this.storeName} products={this.buildProducts()} cartId={this.cartId} customer={this.customer} />\n </app-modal>\n </div>\n )\n }\n}\n"]}
1
+ {"version":3,"file":"crm-bonus.js","sourceRoot":"","sources":["../../../../src/components/crm-bonus/crm-bonus.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,MAAM,OAAO,QAAQ;;QAEX,oBAAe,GAAoB,IAAI,eAAe,EAAE,CAAC;yBAInC,KAAK;;;;;;wBAOJ;YAC7B,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,EAAE;YACR,KAAK,EAAE,EAAE;SACV;uBAE2B,KAAK;;;yBAGH,KAAK;;;IAGnC,KAAK,CAAC,iBAAiB;QACrB,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,UAAU;QACd,IAAI,CAAC;YACH,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gBAChB,uFAAuF;gBACvF,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YACrC,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;QAC9B,CAAC;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,C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;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, State, h } from '@stencil/core';\nimport { IProduct, IProductWake, ICustomer } from '../../dto/validate.pin.bonus';\nimport { CrmBonusService } from '../../services/crmbonus.service';\nimport { IPinSent } from '../../components';\nimport { StepFormEnum } from '../../contants';\n\n@Component({\n tag: 'crm-bonus',\n styleUrl: 'crm-bonus.css',\n shadow: true,\n assetsDirs: ['assets']\n})\nexport class CrmBonus {\n\n private crmBonusService: CrmBonusService = new CrmBonusService();\n\n private crmBonusRef: HTMLCrmBonusFormElement;\n\n @State() showModal: boolean = false;\n @Prop({ attribute: 'userid' }) userId: number;\n @Prop({ attribute: 'storename' }) storeName;\n @Prop({ attribute: 'products' }) productsInString: string;\n @Prop({ attribute: 'cartid' }) cartId;\n\n @State() products: Array<IProductWake>;\n @State() customer: ICustomer = {\n birthDate: \"\",\n document: \"\",\n name: \"\",\n phone: \"\"\n };\n\n @State() loading: boolean = false;\n @State() message: string;\n @State() phone: number;\n @State() canCancel: boolean = false;\n @State() sent: IPinSent;\n\n async componentWillLoad() {\n await this.handleLoad();\n }\n\n async handleLoad() {\n try {\n if (this.userId) {\n // this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);\n console.log('user', this.customer);\n }\n } catch (error) {\n console.log('info customer')\n }\n this.products = JSON.parse(this.productsInString);\n }\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 this.sent = await this.crmBonusService.sendPin(this.phone, this.storeName);;\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);\n this.showModal = true;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n buildProducts(): IProduct[] {\n return this.products.map(product => ({ sku: product.SKU, value: (product.PrecoPor * product.Quantidade), variantId: product.ProdutoVarianteId, qtd: product.Quantidade }))\n }\n\n handleCloseModal() {\n this.showModal = false;\n }\n\n save() {\n localStorage.setItem('@BYCODERS', this.cartId)\n }\n\n render() {\n return (\n <div class=\"section-cart-crm\">\n <div class=\"container-button\">\n {/* <img src={logo} onClick={() => (this.showModal = true)} /> */}\n {\n !this.canCancel ? <phone-cancel-input value={this.customer.phone} sendPin={() => { }} loading={this.loading} /> \n : <phone-input value={this.customer.phone} sendPin={(phone) => { this.sendPin(phone) }} loading={this.loading} />\n }\n \n </div>\n <app-modal\n isOpen={this.showModal}\n modalTitle={`Giftback`}\n onModalClosed={() => (this.showModal = false)}\n >\n <crm-bonus-form saveStore={() => this.save()} ref={ref => this.crmBonusRef = ref} sent={this.sent} phone={this.phone} cancel={() => this.handleCloseModal()} storeName={this.storeName} products={this.buildProducts()} cartId={this.cartId} customer={this.customer} />\n </app-modal>\n </div>\n )\n }\n}\n"]}
@@ -5,19 +5,6 @@
5
5
  justify-content: space-around;
6
6
  }
7
7
 
8
- .button {
9
- top: 50%;
10
- background-color: #6c6c7e;
11
- color: #fff;
12
- border: none;
13
- border-radius: 10px;
14
- padding: 15px;
15
- min-height: 30px;
16
- min-width: 120px;
17
- font-size: 20px;
18
- cursor: pointer;
19
- }
20
-
21
8
  .disabled {
22
9
  opacity: 0.6;
23
10
  cursor: not-allowed;
@@ -13,31 +13,18 @@ export class CrmBonusForm {
13
13
  document: "",
14
14
  name: ""
15
15
  };
16
+ this.sent = undefined;
17
+ this.stepNext = undefined;
18
+ this.phone = undefined;
19
+ this.saveStore = undefined;
16
20
  this.cancel = undefined;
17
21
  this.loading = false;
18
- this.step = StepFormEnum.STEP_PHONE;
19
- this.sent = undefined;
22
+ this.step = StepFormEnum.STEP_RESERVE;
20
23
  this.message = undefined;
21
- this.phone = undefined;
22
24
  this.bonus = undefined;
23
25
  }
24
- async sendPin(phone) {
25
- var _a, _b;
26
- this.loading = true;
27
- this.message = "";
28
- try {
29
- const _phone = phone.replace(/\D/g, '');
30
- this.phone = Number(_phone);
31
- const sent = await this.crmBonusService.sendPin(this.phone, this.storeName);
32
- this.sent = sent;
33
- this.step = StepFormEnum.STEP_PIN;
34
- }
35
- catch (error) {
36
- 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;
37
- }
38
- finally {
39
- this.loading = false;
40
- }
26
+ async setStep(step) {
27
+ this.step = step;
41
28
  }
42
29
  async validateBonus(pin) {
43
30
  var _a, _b;
@@ -64,17 +51,13 @@ export class CrmBonusForm {
64
51
  }
65
52
  console.log('payload', payload);
66
53
  }
67
- async reserve(amount) {
54
+ async reserveApply(amount) {
68
55
  this.loading = true;
69
56
  this.message = "";
70
57
  try {
71
- await this.crmBonusService.reserve({
72
- redeemed_bonus: amount,
73
- cart_id: this.cartId,
74
- ticket: this.cartId,
75
- gross_value: this.bonus.totalValue,
76
- }, this.storeName);
58
+ await this.reserve(amount);
77
59
  this.step = StepFormEnum.STEP_APPLY;
60
+ this.saveStore();
78
61
  }
79
62
  catch (error) {
80
63
  this.message = "ocorreu um error ao solicitar a aplicação do bonus! tente novamente";
@@ -83,12 +66,20 @@ export class CrmBonusForm {
83
66
  this.loading = false;
84
67
  }
85
68
  }
69
+ async reserve(amount) {
70
+ await this.crmBonusService.reserve({
71
+ redeemed_bonus: amount,
72
+ cart_id: this.cartId,
73
+ ticket: this.cartId,
74
+ gross_value: this.bonus.totalValue,
75
+ }, this.storeName);
76
+ }
86
77
  handleCancel() {
87
78
  this.step = StepFormEnum.STEP_PHONE;
88
79
  this.cancel();
89
80
  }
90
81
  render() {
91
- 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)));
82
+ return (h(Host, { key: '3e21a03b8cb534556026804922838f6162df9e30' }, this.step === StepFormEnum.STEP_PIN && h("giftback-pin", { key: '31b04dde37001453cbf2595505dd9c2520b2252c', cancel: () => this.handleCancel(), sent: this.sent, validate: (data) => this.validateBonus(data), loading: this.loading }), this.step === StepFormEnum.STEP_RESERVE && h("giftback-progress", { key: 'c85dbb4ac66a094d0b5a28b152104c6b202984cf', loading: this.loading, cancel: () => this.handleCancel(), bonus: this.bonus, reserve: (amountRedeemed) => this.reserveApply(amountRedeemed) }), this.step === StepFormEnum.STEP_APPLY && h("giftback-finish", { key: '4efa471bb962b48cae34b1c5ebfed518afd3ac31' }), h("p", { key: '5cce361016e738b76353e16a0d61f08b4abe22fc', class: "message-error" }, this.message)));
92
83
  }
93
84
  static get is() { return "crm-bonus-form"; }
94
85
  static get encapsulation() { return "shadow"; }
@@ -185,6 +176,82 @@ export class CrmBonusForm {
185
176
  },
186
177
  "defaultValue": "{\n phone: \"\",\n birthDate: \"\",\n document: \"\",\n name: \"\"\n }"
187
178
  },
179
+ "sent": {
180
+ "type": "unknown",
181
+ "mutable": false,
182
+ "complexType": {
183
+ "original": "IPinSent",
184
+ "resolved": "IPinSent",
185
+ "references": {
186
+ "IPinSent": {
187
+ "location": "import",
188
+ "path": "../../dto/pin.sent",
189
+ "id": "src/dto/pin.sent.ts::IPinSent"
190
+ }
191
+ }
192
+ },
193
+ "required": false,
194
+ "optional": false,
195
+ "docs": {
196
+ "tags": [],
197
+ "text": ""
198
+ }
199
+ },
200
+ "stepNext": {
201
+ "type": "number",
202
+ "mutable": false,
203
+ "complexType": {
204
+ "original": "StepFormEnum",
205
+ "resolved": "StepFormEnum.STEP_APPLY | StepFormEnum.STEP_PHONE | StepFormEnum.STEP_PIN | StepFormEnum.STEP_RESERVE",
206
+ "references": {
207
+ "StepFormEnum": {
208
+ "location": "import",
209
+ "path": "../../contants",
210
+ "id": "src/contants/index.ts::StepFormEnum"
211
+ }
212
+ }
213
+ },
214
+ "required": false,
215
+ "optional": false,
216
+ "docs": {
217
+ "tags": [],
218
+ "text": ""
219
+ },
220
+ "attribute": "step-next",
221
+ "reflect": false
222
+ },
223
+ "phone": {
224
+ "type": "number",
225
+ "mutable": false,
226
+ "complexType": {
227
+ "original": "number",
228
+ "resolved": "number",
229
+ "references": {}
230
+ },
231
+ "required": false,
232
+ "optional": false,
233
+ "docs": {
234
+ "tags": [],
235
+ "text": ""
236
+ },
237
+ "attribute": "phone",
238
+ "reflect": false
239
+ },
240
+ "saveStore": {
241
+ "type": "unknown",
242
+ "mutable": false,
243
+ "complexType": {
244
+ "original": "() => void",
245
+ "resolved": "() => void",
246
+ "references": {}
247
+ },
248
+ "required": false,
249
+ "optional": false,
250
+ "docs": {
251
+ "tags": [],
252
+ "text": ""
253
+ }
254
+ },
188
255
  "cancel": {
189
256
  "type": "unknown",
190
257
  "mutable": false,
@@ -206,11 +273,39 @@ export class CrmBonusForm {
206
273
  return {
207
274
  "loading": {},
208
275
  "step": {},
209
- "sent": {},
210
276
  "message": {},
211
- "phone": {},
212
277
  "bonus": {}
213
278
  };
214
279
  }
280
+ static get methods() {
281
+ return {
282
+ "setStep": {
283
+ "complexType": {
284
+ "signature": "(step: StepFormEnum) => Promise<void>",
285
+ "parameters": [{
286
+ "name": "step",
287
+ "type": "StepFormEnum",
288
+ "docs": ""
289
+ }],
290
+ "references": {
291
+ "Promise": {
292
+ "location": "global",
293
+ "id": "global::Promise"
294
+ },
295
+ "StepFormEnum": {
296
+ "location": "import",
297
+ "path": "../../contants",
298
+ "id": "src/contants/index.ts::StepFormEnum"
299
+ }
300
+ },
301
+ "return": "Promise<void>"
302
+ },
303
+ "docs": {
304
+ "text": "",
305
+ "tags": []
306
+ }
307
+ }
308
+ };
309
+ }
215
310
  }
216
311
  //# sourceMappingURL=crm-bonus-form.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"crm-bonus-form.js","sourceRoot":"","sources":["../../../../src/components/crm-bonus-form/crm-bonus-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGlE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAO9C,MAAM,OAAO,YAAY;;QAEb,oBAAe,GAAoB,IAAI,eAAe,EAAE,CAAC;;;;wBAKnC;YAC1B,KAAK,EAAE,EAAE;YACT,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,EAAE;SACX;;uBAG2B,KAAK;oBAET,YAAY,CAAC,UAAU;;;;;;IAUxC,KAAK,CAAC,OAAO,CAAC,KAAa;;QAC9B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAElB,IAAI,CAAC;YACD,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YACxC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;YAC5B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;YAC5E,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YACjB,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC,Q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CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,GAAI;YAEhL,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,YAAY,IAAI,0EAAmB,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,cAAsB,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,GAAI;YAChN,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,UAAU,IAAI,yEAAmB;YAC7D,0DAAG,KAAK,EAAC,eAAe,IAAE,IAAI,CAAC,OAAO,CAAK,CACxC,CACV,CAAA;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["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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,EAAE,CAAA;IACjB,CAAC;IAED,MAAM;QACF,OAAO,CACH,EAAC,IAAI;YAEA,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,QAAQ,IAAI,qEAAc,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,GAAI;YAEhL,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,YAAY,IAAI,0EAAmB,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,cAAsB,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,GAAI;YACrN,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,UAAU,IAAI,yEAAmB;YAC7D,0DAAG,KAAK,EAAC,eAAe,IAAE,IAAI,CAAC,OAAO,CAAK,CACxC,CACV,CAAA;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Host, Method, Prop, State, h } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\nimport { IBonus, ICustomer, IProccesPinBonusDto, IProduct } from \"../../dto/validate.pin.bonus\";\nimport { StepFormEnum } from \"../../contants\";\nimport { IPinSent } from '../../dto/pin.sent';\n\n@Component({\n tag: 'crm-bonus-form',\n styleUrl: 'crm-bonus-form.css',\n shadow: true\n})\nexport class CrmBonusForm {\n\n private crmBonusService: CrmBonusService = new CrmBonusService();\n\n @Prop({ attribute: 'storename' }) storeName;\n @Prop() cartId;\n @Prop() products: Array<IProduct>;\n @Prop() customer: ICustomer = {\n phone: \"\",\n birthDate: \"\",\n document: \"\",\n name: \"\"\n };\n @Prop() sent: IPinSent;\n @Prop() stepNext: StepFormEnum;\n @Prop() phone: number;\n\n @Prop() saveStore: () => void;\n\n @Prop() cancel: () => void;\n\n @State() loading: boolean = false;\n\n @State() step: number = StepFormEnum.STEP_RESERVE;\n\n @State() message: string;\n\n @State() bonus: IBonus;\n\n @Method()\n async setStep(step: StepFormEnum) {\n this.step = step\n }\n\n public async validateBonus(pin: string) {\n this.loading = true;\n this.message = \"\";\n const payload: IProccesPinBonusDto = {\n pin: pin,\n cellphone: this.phone.toString(),\n loja_id: this.sent.storeId,\n user_id: this.sent.userId,\n cartId: this.cartId,\n products: this.products\n }\n\n try {\n this.bonus = await this.crmBonusService.validatePinBonus(payload, this.storeName);\n\n console.log('[this.bonus]', this.bonus);\n this.step = StepFormEnum.STEP_RESERVE;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false;\n }\n console.log('payload', payload)\n }\n\n public async reserveApply(amount: number) {\n this.loading = true;\n this.message = \"\";\n try {\n await this.reserve(amount);\n\n this.step = StepFormEnum.STEP_APPLY;\n\n this.saveStore()\n } catch (error) {\n this.message = \"ocorreu um error ao solicitar a aplicação do bonus! tente novamente\"\n } finally {\n this.loading = false;\n }\n }\n\n public async reserve(amount: number) {\n await this.crmBonusService.reserve({\n redeemed_bonus: amount,\n cart_id: this.cartId,\n ticket: this.cartId,\n gross_value: this.bonus.totalValue,\n }, this.storeName);\n }\n\n public handleCancel() {\n this.step = StepFormEnum.STEP_PHONE;\n this.cancel()\n }\n\n render() {\n return (\n <Host>\n {/* {this.step === StepFormEnum.STEP_PHONE && <phone-input value={this.customer.phone} sendPin={(phone) => this.sendPin(phone)} loading={this.loading} />} */}\n {this.step === StepFormEnum.STEP_PIN && <giftback-pin cancel={() => this.handleCancel()} sent={this.sent} validate={(data) => this.validateBonus(data)} loading={this.loading} />}\n\n {this.step === StepFormEnum.STEP_RESERVE && <giftback-progress loading={this.loading} cancel={() => this.handleCancel()} bonus={this.bonus} reserve={(amountRedeemed: number) => this.reserveApply(amountRedeemed)} />}\n {this.step === StepFormEnum.STEP_APPLY && <giftback-finish />}\n <p class=\"message-error\">{this.message}</p>\n </Host>\n )\n }\n}"]}
@@ -2,7 +2,7 @@ import { h } from "@stencil/core";
2
2
  import success from "../../../crm-bonus/assets/svg/success-svgrepo-com.svg";
3
3
  export class GiftbackFinish {
4
4
  render() {
5
- return (h("div", { key: 'e72f82799146a6e94acbdd62324e07cdf9f77009', class: "message-finish" }, h("img", { key: '46e2436a3dbe4745225c3b9674e6bf6c299ad63e', src: success, width: 80 }), h("p", { key: '270e42050956f7f3d1ae9b90f314211fa310f797' }, "Legal! O B\u00F4nus ser\u00E1 aplicado na sua compra.")));
5
+ return (h("div", { key: '4fd9a7731194fbe8e9dbe0e2fc9d4241f0baf733', class: "message-finish" }, h("img", { key: 'ba423d92f1672f14be34334fd0495f38f1f70f4a', src: success, width: 80 }), h("p", { key: '75d6b9648c1357ced70ad43cb94091da73224179' }, "Legal! O B\u00F4nus ser\u00E1 aplicado na sua compra.")));
6
6
  }
7
7
  static get is() { return "giftback-finish"; }
8
8
  static get encapsulation() { return "shadow"; }
@@ -30,7 +30,7 @@ export class GiftbackPin {
30
30
  }
31
31
  }
32
32
  render() {
33
- 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" })))));
33
+ return (h("div", { key: 'eb95118bcc7de8cf50c3ffa97656e5635a9b72de', class: "form-container-pin" }, h("div", { key: 'cc149d68ccf12e688fe477079c15931ce0ea6536' }, h("p", { key: 'fbcbb77d526981fca9129e2a1acbc55eba5c9d33' }, "Insira o PIN de 4 d\u00EDgitos enviado por SMS."), h("div", { key: 'ac9887bbc7ef732fd95c890b459b8962652c6fef', class: "pin-container" }, this.pin.map((_, index) => (h("input", { type: "text", maxLength: 1, value: this.pin[index], onInput: (event) => this.handleInput(event, index) }))))), h("div", { key: 'ca835c16a8aa1177c80cc37f43faaa2f1a7af025', class: "footer-button" }, h("button", { key: '6eabe644de6085a1780bec151503c09aa123e459', class: "button-cancel", disabled: this.loading, onClick: () => this.cancel() }, "Cancelar"), h("button", { key: '2b6dd05d209e86ce5dc0d1113b38b16d541e107f', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePin() }, !this.loading ? "Enviar" : h("loading-spinner", { size: "15px", color: "#fff" })))));
34
34
  }
35
35
  static get is() { return "giftback-pin"; }
36
36
  static get encapsulation() { return "shadow"; }
@@ -21,12 +21,12 @@ export class GiftbackProgress {
21
21
  const input = event.target;
22
22
  this.usedValue = parseFloat(input.value);
23
23
  }
24
- async handleReserve() {
25
- this.reserve(this.usedValue);
24
+ async handleReserve(value) {
25
+ this.reserve(value);
26
26
  }
27
27
  render() {
28
28
  const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;
29
- return (h("div", { key: '0949784aa871d4e5a1e3fd5e68f24abd92f9b4f9', class: "giftback-container" }, h("p", { key: '129a7c66ec49abe6d1cf2e93ad8be39030807ce0' }, "Voc\u00EA possui at\u00E9 ", h("strong", { key: '4872e8b42cc25c9339004f5fa7518a269894cc04' }, "R$ ", this.bonus.totalBonus.toFixed(2)), " de Giftback nessa compra!"), h("p", { key: 'd47e314d9f597a2a44a43d353f76f4382e77657d', class: "validity" }, "V\u00E1lido at\u00E9: ", new Date(this.bonus.firstValidityDate).toLocaleDateString('pt-Br')), h("p", { key: '8f3cb7e066eacf5073c5154c3c418fad05b66b67' }, "Voc\u00EA est\u00E1 utilizando ", h("strong", { key: 'aff6a1a0c1be96396640d35cb1429f8e2ece2f1e' }, "R$ ", this.usedValue.toFixed(2)), " nessa compra"), h("div", { key: 'ab8b39df640a1ad036209410cbcda37caf8b6825', class: "progress-container" }, h("span", { key: 'adc4ee7e73575394b2e19e70440cc86474033011' }, "R$ 0"), h("input", { key: '2b80b3ac24e278e002c68fa25449416791e36b9c', disabled: true, type: "range", min: "0", step: "0.01", max: this.bonus.totalBonus, value: this.usedValue, onInput: (event) => this.handleSliderChange(event) }), h("span", { key: '74453f038dcac7a8755edfc9d13f5b0908f5f484' }, "R$ ", this.bonus.totalBonus.toFixed(2))), h("p", { key: 'c48bc53e9eb4213ddc2580c968b9f170a6805b9c', class: "remaining" }, "Faltam ", h("strong", { key: 'd0e91b9121c82ff8051910180496503581f6e498' }, "R$ ", remainingGiftback > 0 ? remainingGiftback.toFixed(2) : Number(0).toFixed(2)), " para utilizar o valor total do Giftback."), h("div", { key: 'd87e4ade049fc1ad8cc4094ab4d1482edea2d9f7', class: "footer-button-giftback" }, h("button", { key: '49ed40adb615dfedcf97ca369d82275e1037b078', class: "button-cancel", disabled: this.loading, onClick: () => this.cancel() }, "Cancelar"), h("button", { key: '5cba6462515c0b9995660bd5974da88b2c90bdda', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.handleReserve() }, !this.loading ? "Aplicar" : h("loading-spinner", { size: "10px", color: "#fff" })))));
29
+ return (h("div", { key: 'e6f36ce0f31f70d5402cf89f20b54b7d4f4de7f6', class: "giftback-container" }, h("p", { key: '6075406b5eaefb21357161f6980bf6a0e709b98c' }, "Voc\u00EA possui at\u00E9 ", h("strong", { key: 'f80192384fe4b189469fb7ee16de266270a8e30c' }, "R$ ", this.bonus.totalBonus.toFixed(2)), " de Giftback nessa compra!"), h("p", { key: '453c0a71fe2f8cb2ebf9a6e6b8b55397ee3a9d5b', class: "validity" }, "V\u00E1lido at\u00E9: ", new Date(this.bonus.firstValidityDate).toLocaleDateString('pt-Br')), h("p", { key: 'ae7d8bbdb67801ff3b336ce9bcafb381a52c41e1' }, "Voc\u00EA est\u00E1 utilizando ", h("strong", { key: '7aa9370121720872deddd9596edbf841ccb4119b' }, "R$ ", this.usedValue.toFixed(2)), " nessa compra"), h("div", { key: '010aac89dd4192cc992d342fc334f6719620663e', class: "progress-container" }, h("span", { key: 'b2d0ee511ef6e32cdefeadcb0d740682c6da5124' }, "R$ 0"), h("input", { key: '3b659919ff940fa353c819fbc395c5fd15ad386b', disabled: true, type: "range", min: "0", step: "0.01", max: this.bonus.totalBonus, value: this.usedValue, onInput: (event) => this.handleSliderChange(event) }), h("span", { key: '60e99bf9891b4172f68f8abfbcdf18175a0cc6b0' }, "R$ ", this.bonus.totalBonus.toFixed(2))), h("p", { key: '07d1bd092cf438bb2e6b1ca0838d4215e73c4ef0', class: "remaining" }, "Faltam ", h("strong", { key: '180966167d48f8ea247ea785a4d35d37c6b5944b' }, "R$ ", remainingGiftback > 0 ? remainingGiftback.toFixed(2) : Number(0).toFixed(2)), " para utilizar o valor total do Giftback."), h("div", { key: '277aed85f840f66a517fa23849dadacddda43f5a', class: "footer-button-giftback" }, h("button", { key: '30c0779c496b54b86e0c4025528aa1e348f69c1c', class: "button-cancel", disabled: this.loading, onClick: () => this.cancel() }, "Cancelar"), h("button", { key: 'ec7e9d6982c5910b8c6fc9fef7310072a07d00c1', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.handleReserve(this.usedValue) }, !this.loading ? "Aplicar" : h("loading-spinner", { size: "10px", color: "#fff" })))));
30
30
  }
31
31
  static get is() { return "giftback-progress"; }
32
32
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- {"version":3,"file":"giftback-progress.js","sourceRoot":"","sources":["../../../../../../src/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAQ1D,MAAM,OAAO,gBAAgB;;yBACI,CAAC;uBAEH,KAAK;qBAEC;YAC7B,UAAU,EAAE,CAAC;YACb,MAAM,EAAE,EAAE;YACV,eAAe,EAAE,CAAC;YAClB,YAAY,EAAE,CAAC;YACf,eAAe,EAAE,CAAC;YAClB,iBAAiB,EAAE,EAAE;SACxB;;;;IAKD,iBAAiB;QACb,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,kBAAkB,CAAC,KAAY;QAC3B,MAAM,KAAK,GAAG,KAAK,CAAC,MAA0B,CAAC;QAC/C,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,aAAa;QACf,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED,MAAM;QACF,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC;QAE7E,OAAO,CACH,4DA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AAG,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,IAE/G,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,uBAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAEvE,CACP,CACJ,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, State, Prop } from '@stencil/core';\nimport { IBonus } from '../../../../dto/validate.pin.bonus';\n\n@Component({\n tag: 'giftback-progress',\n styleUrl: 'giftback-progress.css',\n shadow: true,\n})\nexport class GiftbackProgress {\n @State() usedValue: number = 0;\n\n @Prop() loading: boolean = false;\n\n @Prop() bonus: Partial<IBonus> = {\n totalBonus: 0,\n cartId: \"\",\n minimumPurchase: 0,\n bonusBalance: 0,\n calculatedValue: 0,\n firstValidityDate: \"\"\n };\n\n @Prop() reserve: (amountRedeemed: number) => void;\n @Prop() cancel: () => void;\n\n componentWillLoad() {\n this.usedValue = parseFloat(this.bonus.bonusBalance.toString());\n }\n\n handleSliderChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.usedValue = parseFloat(input.value);\n }\n\n async handleReserve() {\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"]}
1
+ {"version":3,"file":"giftback-progress.js","sourceRoot":"","sources":["../../../../../../src/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAQ1D,MAAM,OAAO,gBAAgB;;yBACI,CAAC;uBAEH,KAAK;qBAEC;YAC7B,UAAU,EAAE,CAAC;YACb,MAAM,EAAE,EAAE;YACV,eAAe,EAAE,CAAC;YAClB,YAAY,EAAE,CAAC;YACf,eAAe,EAAE,CAAC;YAClB,iBAAiB,EAAE,EAAE;SACxB;;;;IAKD,iBAAiB;QACb,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,kBAAkB,CAAC,KAAY;QAC3B,MAAM,KAAK,GAAG,KAAK,CAAC,MAA0B,CAAC;QAC/C,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,KA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Q,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,eAEzE;gBAET,+DAAQ,KAAK,EAAE,UAAU,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,IAE7H,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,uBAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAEvE,CACP,CACJ,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, State, Prop } from '@stencil/core';\nimport { IBonus } from '../../../../dto/validate.pin.bonus';\n\n@Component({\n tag: 'giftback-progress',\n styleUrl: 'giftback-progress.css',\n shadow: true,\n})\nexport class GiftbackProgress {\n @State() usedValue: number = 0;\n\n @Prop() loading: boolean = false;\n\n @Prop() bonus: Partial<IBonus> = {\n totalBonus: 0,\n cartId: \"\",\n minimumPurchase: 0,\n bonusBalance: 0,\n calculatedValue: 0,\n firstValidityDate: \"\"\n };\n\n @Prop() reserve: (amountRedeemed: number) => void;\n @Prop() cancel: () => void;\n\n componentWillLoad() {\n this.usedValue = parseFloat(this.bonus.bonusBalance.toString());\n }\n\n handleSliderChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.usedValue = parseFloat(input.value);\n }\n\n async handleReserve(value: number) {\n this.reserve(value);\n }\n\n render() {\n const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;\n\n return (\n <div class=\"giftback-container\">\n <p>\n Você possui até <strong>R$ {this.bonus.totalBonus.toFixed(2)}</strong> de Giftback nessa compra!\n </p>\n <p class=\"validity\">Válido até: {new Date(this.bonus.firstValidityDate).toLocaleDateString('pt-Br')}</p>\n\n <p>Você está utilizando <strong>R$ {this.usedValue.toFixed(2)}</strong> nessa compra</p>\n\n <div class=\"progress-container\">\n <span>R$ 0</span>\n <input\n disabled\n type=\"range\"\n min=\"0\"\n step=\"0.01\"\n max={this.bonus.totalBonus}\n value={this.usedValue}\n onInput={(event) => this.handleSliderChange(event)}\n />\n <span>R$ {this.bonus.totalBonus.toFixed(2)}</span>\n </div>\n\n <p class=\"remaining\">\n Faltam <strong>R$ {remainingGiftback > 0 ? remainingGiftback.toFixed(2) : Number(0).toFixed(2)}</strong> para utilizar o valor total do Giftback.\n </p>\n\n <div class=\"footer-button-giftback\">\n\n <button class=\"button-cancel\" disabled={this.loading} onClick={() => this.cancel()} >\n Cancelar\n </button>\n\n <button class={`button ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.handleReserve(this.usedValue)}>\n {\n !this.loading ? \"Aplicar\" : <loading-spinner size=\"10px\" color=\"#fff\" />\n }\n </button>\n </div>\n </div>\n );\n }\n}\n"]}
@@ -10,7 +10,7 @@ export class PhoneInput {
10
10
  await this.sendPin(phone);
11
11
  }
12
12
  render() {
13
- 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" }))));
13
+ return (h("div", { key: 'f24f14d158d9565b17aa024837d4e62e6b64c7a3', class: "form-container" }, h("phone-input-mask", { key: '88bf98c7f35b4a4211354a826fa16c922838d228', initialValue: this.value, ref: ref => this.phoneInputMask = ref }), h("button", { key: '34fe30a30fd755b3b710c9b00f6d511eeef70013', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, !this.loading ? "validar" : h("loading-spinner", { size: "25px", color: "#fff" }))));
14
14
  }
15
15
  static get is() { return "phone-input"; }
16
16
  static get properties() {
@@ -0,0 +1,75 @@
1
+ import { h } from "@stencil/core";
2
+ export class PhoneCancelInput {
3
+ constructor() {
4
+ this.sendPin = undefined;
5
+ this.loading = undefined;
6
+ this.value = undefined;
7
+ }
8
+ async validatePhone() {
9
+ const phone = await this.phoneInputMask.getPhone();
10
+ await this.sendPin(phone);
11
+ }
12
+ render() {
13
+ return (h("div", { key: '9e5524ba40c38bcc04325a8b786ea1b29d92e233', class: "form-container" }, h("phone-input-mask", { key: 'a6625e16e686ffd1738989c29245172ebeee13cf', initialValue: "Valor aplicado R$ 100", ref: ref => this.phoneInputMask = ref, disabled: true }), h("button", { key: '7b0416d694bccaa80d418ff062889607eabc9aff', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, !this.loading ? "Cancelar" : h("loading-spinner", { size: "25px", color: "#fff" }))));
14
+ }
15
+ static get is() { return "phone-cancel-input"; }
16
+ static get properties() {
17
+ return {
18
+ "sendPin": {
19
+ "type": "unknown",
20
+ "mutable": false,
21
+ "complexType": {
22
+ "original": "Function",
23
+ "resolved": "Function",
24
+ "references": {
25
+ "Function": {
26
+ "location": "global",
27
+ "id": "global::Function"
28
+ }
29
+ }
30
+ },
31
+ "required": false,
32
+ "optional": false,
33
+ "docs": {
34
+ "tags": [],
35
+ "text": ""
36
+ }
37
+ },
38
+ "loading": {
39
+ "type": "boolean",
40
+ "mutable": false,
41
+ "complexType": {
42
+ "original": "boolean",
43
+ "resolved": "boolean",
44
+ "references": {}
45
+ },
46
+ "required": false,
47
+ "optional": false,
48
+ "docs": {
49
+ "tags": [],
50
+ "text": ""
51
+ },
52
+ "attribute": "loading",
53
+ "reflect": false
54
+ },
55
+ "value": {
56
+ "type": "string",
57
+ "mutable": false,
58
+ "complexType": {
59
+ "original": "string",
60
+ "resolved": "string",
61
+ "references": {}
62
+ },
63
+ "required": false,
64
+ "optional": false,
65
+ "docs": {
66
+ "tags": [],
67
+ "text": ""
68
+ },
69
+ "attribute": "value",
70
+ "reflect": false
71
+ }
72
+ };
73
+ }
74
+ }
75
+ //# sourceMappingURL=phone.cancel.input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phone.cancel.input.js","sourceRoot":"","sources":["../../../../../../src/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAKnD,MAAM,OAAO,gBAAgB;;;;;;IAQzB,KAAK,CAAC,aAAa;QACf,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;QACnD,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM;QACF,OAAO,CACH,4DAAK,KAAK,EAAC,gBAAgB;YACvB,yEAAkB,YAAY,EAAE,uBAAuB,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,GAAG,GAAG,EAAE,QAAQ,EAAE,IAAI,GAAI;YAClH,+DAAQ,KAAK,EAAE,UAAU,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,IAE/G,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,uBAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAExE,CACP,CACT,CAAA;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'phone-cancel-input'\n})\nexport class PhoneCancelInput {\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={\"Valor aplicado R$ 100\"} ref={ref => this.phoneInputMask = ref} disabled={true} />\n <button class={`button ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePhone()}>\n {\n !this.loading ? \"Cancelar\" : <loading-spinner size=\"25px\" color=\"#fff\" />\n }\n </button>\n </div>\n )\n }\n}"]}
@@ -5,7 +5,7 @@ export class LoadingSpinner {
5
5
  this.color = '#0078d7';
6
6
  }
7
7
  render() {
8
- return (h("div", { key: 'cba1c6d6635d5f9ca12dd86c1d293126ffc54167', class: "spinner", style: { width: this.size, height: this.size, borderColor: `${this.color} transparent transparent transparent` } }));
8
+ return (h("div", { key: '78b8ba44c23dcf2fe6b86d343242ff696592bacd', class: "spinner", style: { width: this.size, height: this.size, borderColor: `${this.color} transparent transparent transparent` } }));
9
9
  }
10
10
  static get is() { return "loading-spinner"; }
11
11
  static get encapsulation() { return "shadow"; }
@@ -8,7 +8,7 @@ export class AppModal {
8
8
  this.modalClosed.emit();
9
9
  }
10
10
  render() {
11
- 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' })))));
11
+ return (h("div", { key: '8dab3bfa7301dbd20a783917037c26451cdab5a8', class: `modal-backdrop ${this.isOpen ? 'visible' : ''}` }, h("div", { key: '2846620c39106abde226cd19b2cc0a58b7a88a11', class: "modal" }, h("div", { key: '46b63f75e09aec5d2b9255334733b2813156a5e6', class: "modal-header" }, h("h3", { key: '6a7baae6fc8430ec9cbbcf959f75842ddac253ac' }, this.modalTitle), h("button", { key: 'c6b76e2c862db06657c5ce91fb2bba56fa89e04d', class: "close-button", onClick: () => this.closeModal() }, "\u00D7")), h("div", { key: '7caebe8e0fab2569e3e4e33cc512133bc691b331', class: "modal-body" }, h("slot", { key: 'aa5bd4a5ff5810e1d74727b01121b97ec7b54d51' })))));
12
12
  }
13
13
  static get is() { return "app-modal"; }
14
14
  static get encapsulation() { return "shadow"; }