crmbonus-component-wake 0.0.15 → 0.0.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. package/dist/components/giftback-finish.d.ts +11 -0
  2. package/dist/crmbonus-component-wake/app-modal.entry.js +2 -2
  3. package/dist/crmbonus-component-wake/assets/success-svgrepo-com.svg +8 -0
  4. package/dist/crmbonus-component-wake/crm-bonus-form.entry.js +12 -5
  5. package/dist/crmbonus-component-wake/crm-bonus-form.entry.js.map +1 -1
  6. package/dist/crmbonus-component-wake/crm-bonus.entry.js +16 -8
  7. package/dist/crmbonus-component-wake/crm-bonus.entry.js.map +1 -1
  8. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +3 -3
  9. package/dist/crmbonus-component-wake/{crmbonus.service-756d754d.js → crmbonus.service-ce105f62.js} +8 -3
  10. package/dist/crmbonus-component-wake/crmbonus.service-ce105f62.js.map +1 -0
  11. package/dist/crmbonus-component-wake/giftback-finish.entry.js +19 -0
  12. package/dist/crmbonus-component-wake/giftback-finish.entry.js.map +1 -0
  13. package/dist/crmbonus-component-wake/giftback-pin.entry.js +2 -2
  14. package/dist/crmbonus-component-wake/giftback-progress.entry.js +2 -2
  15. package/dist/crmbonus-component-wake/giftback-progress.entry.js.map +1 -1
  16. package/dist/crmbonus-component-wake/{index-b9a7a992.js → index-f557ce7c.js} +2 -2
  17. package/dist/crmbonus-component-wake/{index-b9a7a992.js.map → index-f557ce7c.js.map} +1 -1
  18. package/dist/crmbonus-component-wake/loading-spinner.entry.js +2 -2
  19. package/dist/crmbonus-component-wake/pedido-finalizado.entry.js +10 -4
  20. package/dist/crmbonus-component-wake/pedido-finalizado.entry.js.map +1 -1
  21. package/dist/crmbonus-component-wake/phone-input-mask.entry.js +6 -2
  22. package/dist/crmbonus-component-wake/phone-input-mask.entry.js.map +1 -1
  23. package/dist/crmbonus-component-wake/phone-input.entry.js +3 -2
  24. package/dist/crmbonus-component-wake/phone-input.entry.js.map +1 -1
  25. package/dist/types/components/crm-bonus/crm-bonus.d.ts +7 -4
  26. package/dist/types/components/crm-bonus-form/crm-bonus-form.d.ts +2 -1
  27. package/dist/types/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.d.ts +3 -0
  28. package/dist/types/components/crm-bonus-form/subcomponents/phone/phone.input.d.ts +1 -0
  29. package/dist/types/components/pedido/pedido.d.ts +2 -0
  30. package/dist/types/components/phone/phone-input-mask.d.ts +2 -0
  31. package/dist/types/components.d.ts +27 -4
  32. package/dist/types/contants/index.d.ts +2 -1
  33. package/dist/types/dto/validate.pin.bonus.d.ts +8 -2
  34. package/dist/types/services/crmbonus.service.d.ts +2 -1
  35. package/loader/cdn.js +1 -0
  36. package/loader/index.cjs.js +1 -0
  37. package/loader/index.d.ts +24 -0
  38. package/loader/index.es2017.js +1 -0
  39. package/loader/index.js +2 -0
  40. package/loader/package.json +11 -0
  41. package/package.json +1 -1
  42. package/dist/crmbonus-component-wake/crmbonus.service-134e7b0c.js +0 -3863
  43. package/dist/crmbonus-component-wake/crmbonus.service-134e7b0c.js.map +0 -1
  44. package/dist/crmbonus-component-wake/crmbonus.service-756d754d.js.map +0 -1
  45. /package/dist/types/home/darlison/Projects/crmbonus/{crmbonus-component-wake → app/crmbonus-component}/.stencil/env.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h } from './index-b9a7a992.js';
1
+ import { r as registerInstance, h } from './index-f557ce7c.js';
2
2
 
3
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
4
 
@@ -9,7 +9,7 @@ const LoadingSpinner = class {
9
9
  this.color = '#0078d7';
10
10
  }
11
11
  render() {
12
- return (h("div", { key: '671c2b621a084871eb30ae2d4e8def280844d612', class: "spinner", style: { width: this.size, height: this.size, borderColor: `${this.color} transparent transparent transparent` } }));
12
+ return (h("div", { key: 'b6cf2bbbb16ae4dbaa3850c450b21251f99d4bb6', class: "spinner", style: { width: this.size, height: this.size, borderColor: `${this.color} transparent transparent transparent` } }));
13
13
  }
14
14
  };
15
15
  LoadingSpinner.style = loadingSpinnerCss;
@@ -1,15 +1,21 @@
1
- import { r as registerInstance, h } from './index-b9a7a992.js';
2
- import { C as CrmBonusService } from './crmbonus.service-756d754d.js';
1
+ import { r as registerInstance, h } from './index-f557ce7c.js';
2
+ import { C as CrmBonusService } from './crmbonus.service-ce105f62.js';
3
3
 
4
4
  const Pedido = class {
5
5
  constructor(hostRef) {
6
6
  registerInstance(this, hostRef);
7
+ this.cartId = undefined;
8
+ this.orderId = undefined;
7
9
  }
8
10
  async componentWillLoad() {
9
- await new CrmBonusService().teste();
11
+ console.log('this.cartId', this.cartId);
12
+ console.log('this.orderid', this.orderId);
13
+ if (this.cartId && this.orderId) {
14
+ await new CrmBonusService().updateOrder(this.cartId, this.orderId);
15
+ }
10
16
  }
11
17
  render() {
12
- return (h("div", { key: '389b1bfc2c348caff62c9b4b5faad4bdcaee17f9' }, "oi"));
18
+ return (h("div", { key: '86d63a792c62b57256fb0b52daadff4302c7cc2a' }));
13
19
  }
14
20
  };
15
21
 
@@ -1 +1 @@
1
- {"file":"pedido-finalizado.entry.esm.js","mappings":";;;MAOa,MAAM;;;;IAEf,MAAM,iBAAiB;QACnB,MAAM,IAAI,eAAe,EAAE,CAAC,KAAK,EAAE,CAAA;KACtC;IAED,MAAM;QACF,QACI,mEAAa,EAChB;KACJ;;;;;","names":[],"sources":["src/components/pedido/pedido.tsx"],"sourcesContent":["import { Component, h } from \"@stencil/core\";\nimport axios from \"axios\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\n\n@Component({\n tag: \"pedido-finalizado\"\n})\nexport class Pedido {\n\n async componentWillLoad() {\n await new CrmBonusService().teste()\n }\n\n render() {\n return (\n <div>oi</div>\n )\n }\n}"],"version":3}
1
+ {"file":"pedido-finalizado.entry.esm.js","mappings":";;;MAMa,MAAM;;;;;;IAKf,MAAM,iBAAiB;QACnB,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,IAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE;YAC5B,MAAM,IAAI,eAAe,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;SACrE;KACJ;IAED,MAAM;QACF,QACI,6DAAW,EACd;KACJ;;;;;","names":[],"sources":["src/components/pedido/pedido.tsx"],"sourcesContent":["import { Component, Prop, h } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\n\n@Component({\n tag: \"pedido-finalizado\"\n})\nexport class Pedido {\n\n @Prop({ attribute:\"cartid\" }) cartId: string;\n @Prop({ attribute:\"orderid\" }) orderId: number;\n\n async componentWillLoad() {\n console.log('this.cartId', this.cartId);\n console.log('this.orderid', this.orderId);\n if(this.cartId && this.orderId) {\n await new CrmBonusService().updateOrder(this.cartId, this.orderId)\n }\n }\n\n render() {\n return (\n <div></div>\n )\n }\n}"],"version":3}
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h } from './index-b9a7a992.js';
1
+ import { r as registerInstance, h } from './index-f557ce7c.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
4
 
@@ -6,6 +6,10 @@ const PhoneInputMask = class {
6
6
  constructor(hostRef) {
7
7
  registerInstance(this, hostRef);
8
8
  this.phone = '';
9
+ this.initialValue = undefined;
10
+ }
11
+ componentWillLoad() {
12
+ this.phone = this.initialValue;
9
13
  }
10
14
  formatPhone(value) {
11
15
  const cleaned = value.replace(/\D/g, ''); // Remove tudo que não for número
@@ -25,7 +29,7 @@ const PhoneInputMask = class {
25
29
  return this.phone;
26
30
  }
27
31
  render() {
28
- return (h("input", { key: '3b00242e5569a40f078a985a7b4bc99dad86e161', id: "phone", type: "tel", class: "phone", value: this.phone, onInput: (event) => this.handleInput(event), placeholder: "(12) 94567-8910" }));
32
+ return (h("input", { key: 'af9b2988d3866d22465821bcd16be45f3cd12ae4', id: "phone", type: "tel", class: "phone", value: this.phone, onInput: (event) => this.handleInput(event), placeholder: "(12) 94567-8910" }));
29
33
  }
30
34
  };
31
35
  PhoneInputMask.style = phoneInputMaskCss;
@@ -1 +1 @@
1
- {"file":"phone-input-mask.entry.esm.js","mappings":";;AAAA,MAAM,iBAAiB,GAAG,+zBAA+zB;;MCO50B,cAAc;;;qBACE,EAAE;;IAEnB,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, 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\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}
1
+ {"file":"phone-input-mask.entry.esm.js","mappings":";;AAAA,MAAM,iBAAiB,GAAG,+zBAA+zB;;MCO50B,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}
@@ -1,17 +1,18 @@
1
- import { r as registerInstance, h } from './index-b9a7a992.js';
1
+ import { r as registerInstance, h } from './index-f557ce7c.js';
2
2
 
3
3
  const PhoneInput = class {
4
4
  constructor(hostRef) {
5
5
  registerInstance(this, hostRef);
6
6
  this.sendPin = undefined;
7
7
  this.loading = undefined;
8
+ this.value = undefined;
8
9
  }
9
10
  async validatePhone() {
10
11
  const phone = await this.phoneInputMask.getPhone();
11
12
  await this.sendPin(phone);
12
13
  }
13
14
  render() {
14
- return (h("div", { key: '7cacb66e387cdc92af272234e128ac0084ac76b5', class: "form-container" }, h("phone-input-mask", { key: 'd8f5d6ed8d34136d8eb9aeb0f16de934ba376976', ref: ref => this.phoneInputMask = ref }), h("button", { key: '4b3170982fa5b3908829b1ccd386aa481f46170e', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, !this.loading ? "validar" : h("loading-spinner", { size: "25px", color: "#fff" }))));
15
+ return (h("div", { key: 'e61b8c94eadb746b3bb163b58f2eb0d6edb5da2b', class: "form-container" }, h("phone-input-mask", { key: 'bdbf45fc9484c60d0178b3ced6194e8f2b7622a5', initialValue: this.value, ref: ref => this.phoneInputMask = ref }), h("button", { key: '757ab72b47a673bcd27236ef9a50b201a6e75477', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, !this.loading ? "validar" : h("loading-spinner", { size: "25px", color: "#fff" }))));
15
16
  }
16
17
  };
17
18
 
@@ -1 +1 @@
1
- {"file":"phone-input.entry.esm.js","mappings":";;MAKa,UAAU;;;;;;IAOnB,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,GAAG,EAAE,GAAG,IAAI,IAAI,CAAC,cAAc,GAAG,GAAG,GAAI,EAC3D,+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\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 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}
1
+ {"file":"phone-input.entry.esm.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}
@@ -1,12 +1,15 @@
1
- import { IProduct, IProductWake } from '../../dto/validate.pin.bonus';
2
- export declare class MyComponent {
1
+ import { IProduct, IProductWake, ICustomer } from '../../dto/validate.pin.bonus';
2
+ export declare class CrmBonus {
3
+ private crmBonusService;
3
4
  showModal: boolean;
4
- userId: string;
5
+ userId: number;
5
6
  storeName: any;
6
7
  productsInString: string;
7
8
  cartId: any;
8
9
  products: Array<IProductWake>;
9
- componentWillLoad(): void;
10
+ customer: ICustomer;
11
+ componentWillLoad(): Promise<void>;
12
+ handleLoad(): Promise<void>;
10
13
  buildProducts(): IProduct[];
11
14
  render(): any;
12
15
  }
@@ -1,10 +1,11 @@
1
1
  import { IPinSent } from "../../components";
2
- import { IBonus, IProduct } from "../../dto/validate.pin.bonus";
2
+ import { IBonus, ICustomer, IProduct } from "../../dto/validate.pin.bonus";
3
3
  export declare class CrmBonusForm {
4
4
  private crmBonusService;
5
5
  storeName: any;
6
6
  cartId: any;
7
7
  products: Array<IProduct>;
8
+ customer: ICustomer;
8
9
  loading: boolean;
9
10
  step: number;
10
11
  sent: IPinSent;
@@ -0,0 +1,3 @@
1
+ export declare class GiftbackFinish {
2
+ render(): any;
3
+ }
@@ -2,6 +2,7 @@ export declare class PhoneInput {
2
2
  private phoneInputMask;
3
3
  sendPin: Function;
4
4
  loading: boolean;
5
+ value: string;
5
6
  validatePhone(): Promise<void>;
6
7
  render(): any;
7
8
  }
@@ -1,4 +1,6 @@
1
1
  export declare class Pedido {
2
+ cartId: string;
3
+ orderId: number;
2
4
  componentWillLoad(): Promise<void>;
3
5
  render(): any;
4
6
  }
@@ -1,5 +1,7 @@
1
1
  export declare class PhoneInputMask {
2
2
  phone: string;
3
+ initialValue: string;
4
+ componentWillLoad(): void;
3
5
  private formatPhone;
4
6
  private handleInput;
5
7
  getPhone(): Promise<string>;
@@ -5,9 +5,9 @@
5
5
  * It contains typing information for all components that exist in this project.
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
- import { IBonus, IProduct } from "./dto/validate.pin.bonus";
8
+ import { IBonus, ICustomer, IProduct } from "./dto/validate.pin.bonus";
9
9
  import { IPinSent } from "./dto/pin.sent";
10
- export { IBonus, IProduct } from "./dto/validate.pin.bonus";
10
+ export { IBonus, ICustomer, IProduct } from "./dto/validate.pin.bonus";
11
11
  export { IPinSent } from "./dto/pin.sent";
12
12
  export namespace Components {
13
13
  interface AppModal {
@@ -18,13 +18,16 @@ export namespace Components {
18
18
  "cartId": any;
19
19
  "productsInString": string;
20
20
  "storeName": any;
21
- "userId": string;
21
+ "userId": number;
22
22
  }
23
23
  interface CrmBonusForm {
24
24
  "cartId": any;
25
+ "customer": ICustomer;
25
26
  "products": Array<IProduct>;
26
27
  "storeName": any;
27
28
  }
29
+ interface GiftbackFinish {
30
+ }
28
31
  interface GiftbackPin {
29
32
  "loading": boolean;
30
33
  "sent": IPinSent;
@@ -40,13 +43,17 @@ export namespace Components {
40
43
  "size": string;
41
44
  }
42
45
  interface PedidoFinalizado {
46
+ "cartId": string;
47
+ "orderId": number;
43
48
  }
44
49
  interface PhoneInput {
45
50
  "loading": boolean;
46
51
  "sendPin": Function;
52
+ "value": string;
47
53
  }
48
54
  interface PhoneInputMask {
49
55
  "getPhone": () => Promise<string>;
56
+ "initialValue": string;
50
57
  }
51
58
  }
52
59
  export interface AppModalCustomEvent<T> extends CustomEvent<T> {
@@ -83,6 +90,12 @@ declare global {
83
90
  prototype: HTMLCrmBonusFormElement;
84
91
  new (): HTMLCrmBonusFormElement;
85
92
  };
93
+ interface HTMLGiftbackFinishElement extends Components.GiftbackFinish, HTMLStencilElement {
94
+ }
95
+ var HTMLGiftbackFinishElement: {
96
+ prototype: HTMLGiftbackFinishElement;
97
+ new (): HTMLGiftbackFinishElement;
98
+ };
86
99
  interface HTMLGiftbackPinElement extends Components.GiftbackPin, HTMLStencilElement {
87
100
  }
88
101
  var HTMLGiftbackPinElement: {
@@ -123,6 +136,7 @@ declare global {
123
136
  "app-modal": HTMLAppModalElement;
124
137
  "crm-bonus": HTMLCrmBonusElement;
125
138
  "crm-bonus-form": HTMLCrmBonusFormElement;
139
+ "giftback-finish": HTMLGiftbackFinishElement;
126
140
  "giftback-pin": HTMLGiftbackPinElement;
127
141
  "giftback-progress": HTMLGiftbackProgressElement;
128
142
  "loading-spinner": HTMLLoadingSpinnerElement;
@@ -141,13 +155,16 @@ declare namespace LocalJSX {
141
155
  "cartId"?: any;
142
156
  "productsInString"?: string;
143
157
  "storeName"?: any;
144
- "userId"?: string;
158
+ "userId"?: number;
145
159
  }
146
160
  interface CrmBonusForm {
147
161
  "cartId"?: any;
162
+ "customer"?: ICustomer;
148
163
  "products"?: Array<IProduct>;
149
164
  "storeName"?: any;
150
165
  }
166
+ interface GiftbackFinish {
167
+ }
151
168
  interface GiftbackPin {
152
169
  "loading"?: boolean;
153
170
  "sent"?: IPinSent;
@@ -163,17 +180,22 @@ declare namespace LocalJSX {
163
180
  "size"?: string;
164
181
  }
165
182
  interface PedidoFinalizado {
183
+ "cartId"?: string;
184
+ "orderId"?: number;
166
185
  }
167
186
  interface PhoneInput {
168
187
  "loading"?: boolean;
169
188
  "sendPin"?: Function;
189
+ "value"?: string;
170
190
  }
171
191
  interface PhoneInputMask {
192
+ "initialValue"?: string;
172
193
  }
173
194
  interface IntrinsicElements {
174
195
  "app-modal": AppModal;
175
196
  "crm-bonus": CrmBonus;
176
197
  "crm-bonus-form": CrmBonusForm;
198
+ "giftback-finish": GiftbackFinish;
177
199
  "giftback-pin": GiftbackPin;
178
200
  "giftback-progress": GiftbackProgress;
179
201
  "loading-spinner": LoadingSpinner;
@@ -189,6 +211,7 @@ declare module "@stencil/core" {
189
211
  "app-modal": LocalJSX.AppModal & JSXBase.HTMLAttributes<HTMLAppModalElement>;
190
212
  "crm-bonus": LocalJSX.CrmBonus & JSXBase.HTMLAttributes<HTMLCrmBonusElement>;
191
213
  "crm-bonus-form": LocalJSX.CrmBonusForm & JSXBase.HTMLAttributes<HTMLCrmBonusFormElement>;
214
+ "giftback-finish": LocalJSX.GiftbackFinish & JSXBase.HTMLAttributes<HTMLGiftbackFinishElement>;
192
215
  "giftback-pin": LocalJSX.GiftbackPin & JSXBase.HTMLAttributes<HTMLGiftbackPinElement>;
193
216
  "giftback-progress": LocalJSX.GiftbackProgress & JSXBase.HTMLAttributes<HTMLGiftbackProgressElement>;
194
217
  "loading-spinner": LocalJSX.LoadingSpinner & JSXBase.HTMLAttributes<HTMLLoadingSpinnerElement>;
@@ -1,5 +1,6 @@
1
1
  export declare enum StepFormEnum {
2
2
  STEP_PHONE = 1,
3
3
  STEP_PIN = 2,
4
- STEP_RESERVE = 3
4
+ STEP_RESERVE = 3,
5
+ STEP_APPLY = 4
5
6
  }
@@ -10,6 +10,12 @@ export interface IProductWake {
10
10
  PrecoPor: number;
11
11
  Quantidade: number;
12
12
  }
13
+ export interface ICustomer {
14
+ birthDate: string;
15
+ document: string;
16
+ name: string;
17
+ phone: string;
18
+ }
13
19
  export interface IProccesPinBonusDto {
14
20
  cartId: string;
15
21
  products: Array<IProduct>;
@@ -45,7 +51,7 @@ export interface IBonus {
45
51
  }
46
52
  export interface IReserveDTO {
47
53
  cart_id: string;
48
- valor_bruto: number;
49
- bonus_resgatado: number;
54
+ gross_value: number;
55
+ redeemed_bonus: number;
50
56
  ticket: string;
51
57
  }
@@ -3,7 +3,8 @@ import { IBonus, IProccesPinBonusDto, IReserveDTO } from '../dto/validate.pin.bo
3
3
  export declare class CrmBonusService {
4
4
  private axiosInstance;
5
5
  constructor();
6
- teste(): Promise<void>;
6
+ getCustomer(userId: number, store: string): Promise<any>;
7
+ updateOrder(cartId: string, orderId: number): Promise<void>;
7
8
  sendPin(phone: number, store: string): Promise<IPinSent>;
8
9
  validatePinBonus(payload: IProccesPinBonusDto, store: string): Promise<IBonus>;
9
10
  reserve(payload: IReserveDTO, store: string): Promise<any>;
package/loader/cdn.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('../dist/cjs/loader.cjs.js');
@@ -0,0 +1 @@
1
+ module.exports = require('../dist/cjs/loader.cjs.js');
@@ -0,0 +1,24 @@
1
+ export * from '../dist/types/components';
2
+ export interface CustomElementsDefineOptions {
3
+ exclude?: string[];
4
+ resourcesUrl?: string;
5
+ syncQueue?: boolean;
6
+ jmp?: (c: Function) => any;
7
+ raf?: (c: FrameRequestCallback) => number;
8
+ ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
9
+ rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
10
+ }
11
+ export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): void;
12
+ /**
13
+ * @deprecated
14
+ */
15
+ export declare function applyPolyfills(): Promise<void>;
16
+
17
+ /**
18
+ * Used to specify a nonce value that corresponds with an application's CSP.
19
+ * When set, the nonce will be added to all dynamically created script and style tags at runtime.
20
+ * Alternatively, the nonce value can be set on a meta tag in the DOM head
21
+ * (<meta name="csp-nonce" content="{ nonce value here }" />) which
22
+ * will result in the same behavior.
23
+ */
24
+ export declare function setNonce(nonce: string): void;
@@ -0,0 +1 @@
1
+ export * from '../dist/esm/loader.js';
@@ -0,0 +1,2 @@
1
+ (function(){if("undefined"!==typeof window&&void 0!==window.Reflect&&void 0!==window.customElements){var a=HTMLElement;window.HTMLElement=function(){return Reflect.construct(a,[],this.constructor)};HTMLElement.prototype=a.prototype;HTMLElement.prototype.constructor=HTMLElement;Object.setPrototypeOf(HTMLElement,a)}})();
2
+ export * from '../dist/esm/loader.js';
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "crmbonus-component-wake-loader",
3
+ "private": true,
4
+ "typings": "./index.d.ts",
5
+ "module": "./index.js",
6
+ "main": "./index.cjs.js",
7
+ "jsnext:main": "./index.es2017.js",
8
+ "es2015": "./index.es2017.js",
9
+ "es2017": "./index.es2017.js",
10
+ "unpkg": "./cdn.js"
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crmbonus-component-wake",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "Stencil Component Starter",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",