crmbonus-component-wake 0.0.7 → 0.0.9
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.
- package/dist/components/giftback-pin.d.ts +11 -0
- package/dist/components/giftback-progress.d.ts +11 -0
- package/dist/components/phone-input.d.ts +11 -0
- package/dist/crmbonus-component-wake/app-modal.entry.js +2 -2
- package/dist/crmbonus-component-wake/crm-bonus-form.entry.js +3865 -6
- package/dist/crmbonus-component-wake/crm-bonus-form.entry.js.map +1 -1
- package/dist/crmbonus-component-wake/crm-bonus.entry.js +3 -3
- package/dist/crmbonus-component-wake/crm-bonus.entry.js.map +1 -1
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +3 -3
- package/dist/crmbonus-component-wake/giftback-pin.entry.js +38 -0
- package/dist/crmbonus-component-wake/giftback-pin.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/giftback-progress.entry.js +26 -0
- package/dist/crmbonus-component-wake/giftback-progress.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/{index-144d2e69.js → index-71c2c4ae.js} +2 -2
- package/dist/crmbonus-component-wake/index-71c2c4ae.js.map +1 -0
- package/dist/crmbonus-component-wake/{index-f4f9c8f2.js → index-eeb8f9f2.js} +2 -2
- package/dist/crmbonus-component-wake/{index-144d2e69.js.map → index-eeb8f9f2.js.map} +1 -1
- package/dist/crmbonus-component-wake/phone-input-mask.entry.js +3 -3
- package/dist/crmbonus-component-wake/phone-input-mask.entry.js.map +1 -1
- package/dist/crmbonus-component-wake/phone-input.entry.js +20 -0
- package/dist/crmbonus-component-wake/phone-input.entry.js.map +1 -0
- package/dist/types/components/crm-bonus/crm-bonus.d.ts +1 -0
- package/dist/types/components/crm-bonus-form/crm-bonus-form.d.ts +9 -2
- package/dist/types/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.d.ts +10 -0
- package/dist/types/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.d.ts +8 -0
- package/dist/types/components/crm-bonus-form/subcomponents/phone/phone.input.d.ts +7 -0
- package/dist/types/components/phone/phone-input-mask.d.ts +1 -1
- package/dist/types/components.d.ts +58 -1
- package/dist/types/dto/pin.sent.d.ts +4 -0
- package/dist/types/dto/validate.pin.bonus.d.ts +13 -0
- package/dist/types/home/darlison/Projects/crmbonus/crmbonus-component-wake/.stencil/env.d.ts +4 -0
- package/dist/types/services/crmbonus.service.d.ts +6 -0
- package/package.json +5 -2
- package/dist/crmbonus-component-wake/index-2aa8671b.js +0 -3039
- package/dist/crmbonus-component-wake/index-2aa8671b.js.map +0 -1
- package/dist/crmbonus-component-wake/index-f4f9c8f2.js.map +0 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
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
|
|
@@ -21,11 +21,11 @@ const PhoneInputMask = class {
|
|
21
21
|
const input = event.target;
|
22
22
|
this.phone = this.formatPhone(input.value);
|
23
23
|
}
|
24
|
-
getPhone() {
|
24
|
+
async getPhone() {
|
25
25
|
return this.phone;
|
26
26
|
}
|
27
27
|
render() {
|
28
|
-
return (h("input", { key: '
|
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;
|
@@ -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,QAAQ;
|
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}
|
@@ -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,12 @@
|
|
1
|
+
import { IPinSent } from "../../components";
|
2
|
+
import { IValidatePinBonus } from "../../dto/validate.pin.bonus";
|
1
3
|
export declare class CrmBonusForm {
|
2
|
-
private
|
3
|
-
|
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
|
}
|
@@ -5,18 +5,34 @@
|
|
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
|
-
"getPhone": () => string
|
35
|
+
"getPhone": () => Promise<string>;
|
20
36
|
}
|
21
37
|
}
|
22
38
|
export interface AppModalCustomEvent<T> extends CustomEvent<T> {
|
@@ -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
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "crmbonus-component-wake",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.9",
|
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
|
}
|