crmbonus-component-wake 0.0.8 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. package/dist/components/giftback-pin.d.ts +11 -0
  2. package/dist/components/giftback-progress.d.ts +11 -0
  3. package/dist/components/phone-input.d.ts +11 -0
  4. package/dist/crmbonus-component-wake/app-modal.entry.js +2 -2
  5. package/dist/crmbonus-component-wake/crm-bonus-form.entry.js +3865 -6
  6. package/dist/crmbonus-component-wake/crm-bonus-form.entry.js.map +1 -1
  7. package/dist/crmbonus-component-wake/crm-bonus.entry.js +3 -3
  8. package/dist/crmbonus-component-wake/crm-bonus.entry.js.map +1 -1
  9. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +3 -3
  10. package/dist/crmbonus-component-wake/giftback-pin.entry.js +38 -0
  11. package/dist/crmbonus-component-wake/giftback-pin.entry.js.map +1 -0
  12. package/dist/crmbonus-component-wake/giftback-progress.entry.js +26 -0
  13. package/dist/crmbonus-component-wake/giftback-progress.entry.js.map +1 -0
  14. package/dist/crmbonus-component-wake/index-71c2c4ae.js +3039 -0
  15. package/dist/crmbonus-component-wake/index-71c2c4ae.js.map +1 -0
  16. package/dist/crmbonus-component-wake/{index-f4f9c8f2.js → index-eeb8f9f2.js} +2 -2
  17. package/dist/crmbonus-component-wake/index-eeb8f9f2.js.map +1 -0
  18. package/dist/crmbonus-component-wake/phone-input-mask.entry.js +2 -2
  19. package/dist/crmbonus-component-wake/phone-input.entry.js +20 -0
  20. package/dist/crmbonus-component-wake/phone-input.entry.js.map +1 -0
  21. package/dist/types/components/crm-bonus/crm-bonus.d.ts +1 -0
  22. package/dist/types/components/crm-bonus-form/crm-bonus-form.d.ts +9 -2
  23. package/dist/types/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.d.ts +10 -0
  24. package/dist/types/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.d.ts +8 -0
  25. package/dist/types/components/crm-bonus-form/subcomponents/phone/phone.input.d.ts +7 -0
  26. package/dist/types/components.d.ts +57 -0
  27. package/dist/types/dto/pin.sent.d.ts +4 -0
  28. package/dist/types/dto/validate.pin.bonus.d.ts +13 -0
  29. package/dist/types/home/darlison/Projects/crmbonus/crmbonus-component-wake/.stencil/env.d.ts +4 -0
  30. package/dist/types/services/crmbonus.service.d.ts +6 -0
  31. package/package.json +5 -2
  32. package/dist/crmbonus-component-wake/index-f4f9c8f2.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h } from './index-f4f9c8f2.js';
1
+ import { r as registerInstance, h } from './index-71c2c4ae.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
 
@@ -25,7 +25,7 @@ const PhoneInputMask = class {
25
25
  return this.phone;
26
26
  }
27
27
  render() {
28
- return (h("input", { key: '1b768d2d024a5482908316d7653bb02404332a64', id: "phone", type: "tel", class: "phone", value: this.phone, onInput: (event) => this.handleInput(event), placeholder: "(12) 94567-8910" }));
28
+ return (h("input", { key: 'ce14900d1782c63886bc96130d1af61953d5f5a8', id: "phone", type: "tel", class: "phone", value: this.phone, onInput: (event) => this.handleInput(event), placeholder: "(12) 94567-8910" }));
29
29
  }
30
30
  };
31
31
  PhoneInputMask.style = phoneInputMaskCss;
@@ -0,0 +1,20 @@
1
+ import { r as registerInstance, h } from './index-71c2c4ae.js';
2
+
3
+ const PhoneInput = class {
4
+ constructor(hostRef) {
5
+ registerInstance(this, hostRef);
6
+ this.sendPin = undefined;
7
+ this.loading = undefined;
8
+ }
9
+ async validatePhone() {
10
+ const phone = await this.phoneInputMask.getPhone();
11
+ await this.sendPin(phone);
12
+ }
13
+ render() {
14
+ return (h("div", { key: '44dcf42dff601aa838ccfab5af6b3bbe4be73d14', class: "form-container" }, h("phone-input-mask", { key: 'c8b84771c1db014b0be4fc3ae04a91e7501c386a', ref: ref => this.phoneInputMask = ref }), h("button", { key: 'f61cf41450dd0485ef51c429f66ed878de3bf89e', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, "validar")));
15
+ }
16
+ };
17
+
18
+ export { PhoneInput as phone_input };
19
+
20
+ //# sourceMappingURL=phone-input.entry.js.map
@@ -0,0 +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,cAAkB,CACvI,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()}>validar</button>\n </div>\n )\n }\n}"],"version":3}
@@ -1,5 +1,6 @@
1
1
  export declare class MyComponent {
2
2
  showModal: boolean;
3
3
  userId: string;
4
+ storeName: any;
4
5
  render(): any;
5
6
  }
@@ -1,5 +1,12 @@
1
+ import { IPinSent } from "../../components";
2
+ import { IValidatePinBonus } from "../../dto/validate.pin.bonus";
1
3
  export declare class CrmBonusForm {
2
- private phoneInputMask;
3
- validate(): Promise<void>;
4
+ private crmBonusService;
5
+ storeName: any;
6
+ loading: boolean;
7
+ step: number;
8
+ sent: IPinSent;
9
+ sendPin(phone: string): Promise<void>;
10
+ validateBonus(data: IValidatePinBonus): Promise<void>;
4
11
  render(): any;
5
12
  }
@@ -0,0 +1,10 @@
1
+ import { IPinSent } from '../../../../dto/pin.sent';
2
+ export declare class GiftbackPin {
3
+ sent: IPinSent;
4
+ pin: string[];
5
+ isVerified: boolean;
6
+ loading: boolean;
7
+ handleInput(event: Event, index: number): void;
8
+ verifyPin(): void;
9
+ render(): any;
10
+ }
@@ -0,0 +1,8 @@
1
+ export declare class GiftbackProgress {
2
+ maxValue: number;
3
+ totalGiftback: number;
4
+ validityDate: string;
5
+ usedValue: number;
6
+ handleSliderChange(event: Event): void;
7
+ render(): any;
8
+ }
@@ -0,0 +1,7 @@
1
+ export declare class PhoneInput {
2
+ private phoneInputMask;
3
+ sendPin: Function;
4
+ loading: boolean;
5
+ validatePhone(): Promise<void>;
6
+ render(): any;
7
+ }
@@ -5,15 +5,31 @@
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 { IPinSent } from "./dto/pin.sent";
9
+ export { IPinSent } from "./dto/pin.sent";
8
10
  export namespace Components {
9
11
  interface AppModal {
10
12
  "isOpen": boolean;
11
13
  "modalTitle": string;
12
14
  }
13
15
  interface CrmBonus {
16
+ "storeName": any;
14
17
  "userId": string;
15
18
  }
16
19
  interface CrmBonusForm {
20
+ "storeName": any;
21
+ }
22
+ interface GiftbackPin {
23
+ "sent": IPinSent;
24
+ }
25
+ interface GiftbackProgress {
26
+ "maxValue": number;
27
+ "totalGiftback": number;
28
+ "validityDate": string;
29
+ }
30
+ interface PhoneInput {
31
+ "loading": boolean;
32
+ "sendPin": Function;
17
33
  }
18
34
  interface PhoneInputMask {
19
35
  "getPhone": () => Promise<string>;
@@ -53,6 +69,24 @@ declare global {
53
69
  prototype: HTMLCrmBonusFormElement;
54
70
  new (): HTMLCrmBonusFormElement;
55
71
  };
72
+ interface HTMLGiftbackPinElement extends Components.GiftbackPin, HTMLStencilElement {
73
+ }
74
+ var HTMLGiftbackPinElement: {
75
+ prototype: HTMLGiftbackPinElement;
76
+ new (): HTMLGiftbackPinElement;
77
+ };
78
+ interface HTMLGiftbackProgressElement extends Components.GiftbackProgress, HTMLStencilElement {
79
+ }
80
+ var HTMLGiftbackProgressElement: {
81
+ prototype: HTMLGiftbackProgressElement;
82
+ new (): HTMLGiftbackProgressElement;
83
+ };
84
+ interface HTMLPhoneInputElement extends Components.PhoneInput, HTMLStencilElement {
85
+ }
86
+ var HTMLPhoneInputElement: {
87
+ prototype: HTMLPhoneInputElement;
88
+ new (): HTMLPhoneInputElement;
89
+ };
56
90
  interface HTMLPhoneInputMaskElement extends Components.PhoneInputMask, HTMLStencilElement {
57
91
  }
58
92
  var HTMLPhoneInputMaskElement: {
@@ -63,6 +97,9 @@ declare global {
63
97
  "app-modal": HTMLAppModalElement;
64
98
  "crm-bonus": HTMLCrmBonusElement;
65
99
  "crm-bonus-form": HTMLCrmBonusFormElement;
100
+ "giftback-pin": HTMLGiftbackPinElement;
101
+ "giftback-progress": HTMLGiftbackProgressElement;
102
+ "phone-input": HTMLPhoneInputElement;
66
103
  "phone-input-mask": HTMLPhoneInputMaskElement;
67
104
  }
68
105
  }
@@ -73,9 +110,23 @@ declare namespace LocalJSX {
73
110
  "onModalClosed"?: (event: AppModalCustomEvent<void>) => void;
74
111
  }
75
112
  interface CrmBonus {
113
+ "storeName"?: any;
76
114
  "userId"?: string;
77
115
  }
78
116
  interface CrmBonusForm {
117
+ "storeName"?: any;
118
+ }
119
+ interface GiftbackPin {
120
+ "sent"?: IPinSent;
121
+ }
122
+ interface GiftbackProgress {
123
+ "maxValue"?: number;
124
+ "totalGiftback"?: number;
125
+ "validityDate"?: string;
126
+ }
127
+ interface PhoneInput {
128
+ "loading"?: boolean;
129
+ "sendPin"?: Function;
79
130
  }
80
131
  interface PhoneInputMask {
81
132
  }
@@ -83,6 +134,9 @@ declare namespace LocalJSX {
83
134
  "app-modal": AppModal;
84
135
  "crm-bonus": CrmBonus;
85
136
  "crm-bonus-form": CrmBonusForm;
137
+ "giftback-pin": GiftbackPin;
138
+ "giftback-progress": GiftbackProgress;
139
+ "phone-input": PhoneInput;
86
140
  "phone-input-mask": PhoneInputMask;
87
141
  }
88
142
  }
@@ -93,6 +147,9 @@ declare module "@stencil/core" {
93
147
  "app-modal": LocalJSX.AppModal & JSXBase.HTMLAttributes<HTMLAppModalElement>;
94
148
  "crm-bonus": LocalJSX.CrmBonus & JSXBase.HTMLAttributes<HTMLCrmBonusElement>;
95
149
  "crm-bonus-form": LocalJSX.CrmBonusForm & JSXBase.HTMLAttributes<HTMLCrmBonusFormElement>;
150
+ "giftback-pin": LocalJSX.GiftbackPin & JSXBase.HTMLAttributes<HTMLGiftbackPinElement>;
151
+ "giftback-progress": LocalJSX.GiftbackProgress & JSXBase.HTMLAttributes<HTMLGiftbackProgressElement>;
152
+ "phone-input": LocalJSX.PhoneInput & JSXBase.HTMLAttributes<HTMLPhoneInputElement>;
96
153
  "phone-input-mask": LocalJSX.PhoneInputMask & JSXBase.HTMLAttributes<HTMLPhoneInputMaskElement>;
97
154
  }
98
155
  }
@@ -0,0 +1,4 @@
1
+ export interface IPinSent {
2
+ storeId: number;
3
+ userId: number;
4
+ }
@@ -0,0 +1,13 @@
1
+ export interface IProduct {
2
+ variantId: string;
3
+ sku: string;
4
+ amount: number;
5
+ }
6
+ export interface IValidatePinBonus {
7
+ storeId: number;
8
+ userId: number;
9
+ cartId: string;
10
+ products: Array<IProduct>;
11
+ phone: number;
12
+ pin: number;
13
+ }
@@ -0,0 +1,4 @@
1
+ export declare const CRM_BONUS_API_URL = "https://typically-workable-perch.ngrok-free.app";
2
+ export declare const CRM_BONUS_ID_LOJA = "undefined";
3
+ export declare const CRM_BONUS_CODEMPRESA = "undefined";
4
+ export declare const CRM_BONUS_AUTHORIZATION = "undefined";
@@ -0,0 +1,6 @@
1
+ import { IPinSent } from '../dto/pin.sent';
2
+ export declare class CrmBonusService {
3
+ private axiosInstance;
4
+ constructor();
5
+ sendPin(phone: number, store: string): Promise<IPinSent>;
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crmbonus-component-wake",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "description": "Stencil Component Starter",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -46,5 +46,8 @@
46
46
  "jest-cli": "^29.7.0",
47
47
  "puppeteer": "^21.9.0"
48
48
  },
49
- "license": "MIT"
49
+ "license": "MIT",
50
+ "dependencies": {
51
+ "axios": "^1.7.7"
52
+ }
50
53
  }