crmbonus-component-wake 1.0.47 → 2.0.47
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/cjs/app-modal.cjs.entry.js +28 -0
- package/dist/cjs/app-modal.cjs.entry.js.map +1 -0
- package/dist/cjs/countdown-timer_4.cjs.entry.js +170 -0
- package/dist/cjs/countdown-timer_4.cjs.entry.js.map +1 -0
- package/dist/cjs/crm-bonus-form.cjs.entry.js +103 -0
- package/dist/cjs/crm-bonus-form.cjs.entry.js.map +1 -0
- package/dist/cjs/crm-bonus-note.cjs.entry.js +1 -1
- package/dist/cjs/crm-bonus.cjs.entry.js +36 -4
- package/dist/cjs/crm-bonus.cjs.entry.js.map +1 -1
- package/dist/cjs/crm-button.cjs.entry.js +24 -0
- package/dist/cjs/crm-button.cjs.entry.js.map +1 -0
- package/dist/cjs/crm-giftback-form.cjs.entry.js +108 -0
- package/dist/cjs/crm-giftback-form.cjs.entry.js.map +1 -0
- package/dist/cjs/crmbonus-component-wake.cjs.js +2 -2
- package/dist/cjs/giftback-finish_4.cjs.entry.js +5 -5
- package/dist/cjs/giftback-finish_4.cjs.entry.js.map +1 -1
- package/dist/cjs/i18n-db722856.js +2208 -0
- package/dist/cjs/i18n-db722856.js.map +1 -0
- package/dist/cjs/{index-52d8a075.js → index-80419303.js} +9 -4
- package/dist/cjs/index-80419303.js.map +1 -0
- package/dist/cjs/{index-861e0cbe.js → index-fdad75ce.js} +4 -1
- package/dist/cjs/index-fdad75ce.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/loading-spinner.cjs.entry.js +2 -2
- package/dist/cjs/pedido-finalizado.cjs.entry.js +2 -2
- package/dist/cjs/phone-cancel-input.cjs.entry.js +25 -0
- package/dist/cjs/phone-cancel-input.cjs.entry.js.map +1 -0
- package/dist/cjs/phone-input-mask.cjs.entry.js +17 -4
- package/dist/cjs/phone-input-mask.cjs.entry.js.map +1 -1
- package/dist/cjs/phone-input.cjs.entry.js +25 -0
- package/dist/cjs/phone-input.cjs.entry.js.map +1 -0
- package/dist/collection/collection-manifest.json +6 -0
- package/dist/collection/components/button/crm-button.css +22 -0
- package/dist/collection/components/button/index.js +59 -0
- package/dist/collection/components/button/index.js.map +1 -1
- package/dist/collection/components/countdown-timer/countdown-timer.js +51 -0
- package/dist/collection/components/countdown-timer/countdown-timer.js.map +1 -0
- package/dist/collection/components/crm-bonus/crm-bonus.css +0 -3
- package/dist/collection/components/crm-bonus/crm-bonus.js +34 -2
- package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -1
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +1 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js +1 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js +1 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js +1 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.js +1 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js +1 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js +1 -1
- package/dist/collection/components/giftback-form/giftback-form.css +47 -0
- package/dist/collection/components/giftback-form/giftback-form.js +182 -0
- package/dist/collection/components/giftback-form/giftback-form.js.map +1 -0
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.css +152 -0
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js +143 -0
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js.map +1 -0
- package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js +80 -0
- package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js.map +1 -0
- package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.css +87 -0
- package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js +180 -0
- package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js.map +1 -0
- package/dist/collection/components/loading-spinner/loading-spinner.js +1 -1
- package/dist/collection/components/modal/app-modal.js +1 -1
- package/dist/collection/components/pedido/pedido.js +1 -1
- package/dist/collection/components/phone/phone-input-mask.css +18 -39
- package/dist/collection/components/phone/phone-input-mask.js +17 -3
- package/dist/collection/components/phone/phone-input-mask.js.map +1 -1
- package/dist/collection/contants/index.js +1 -0
- package/dist/collection/contants/index.js.map +1 -1
- package/dist/collection/i18n/i18n.js +24 -0
- package/dist/collection/i18n/i18n.js.map +1 -0
- package/dist/components/app-modal.js +39 -1
- package/dist/components/app-modal.js.map +1 -1
- package/dist/components/countdown-timer.d.ts +11 -0
- package/dist/components/countdown-timer.js +8 -0
- package/dist/components/countdown-timer.js.map +1 -0
- package/dist/components/crm-bonus-form.js +158 -1
- package/dist/components/crm-bonus-form.js.map +1 -1
- package/dist/components/crm-bonus-note.js +1 -1
- package/dist/components/crm-bonus.js +53 -32
- package/dist/components/crm-bonus.js.map +1 -1
- package/dist/components/crm-button.d.ts +11 -0
- package/dist/components/crm-button.js +8 -0
- package/dist/components/crm-button.js.map +1 -0
- package/dist/components/crm-giftback-form.d.ts +11 -0
- package/dist/components/crm-giftback-form.js +8 -0
- package/dist/components/crm-giftback-form.js.map +1 -0
- package/dist/components/giftback-finish.js +1 -1
- package/dist/components/giftback-info.d.ts +11 -0
- package/dist/components/giftback-info.js +8 -0
- package/dist/components/giftback-info.js.map +1 -0
- package/dist/components/giftback-pin.js +1 -1
- package/dist/components/giftback-progress.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/loading-spinner.js +1 -1
- package/dist/components/name-input.js +1 -1
- package/dist/components/{p-0e99f907.js → p-0c1aa75b.js} +4 -4
- package/dist/components/{p-0e99f907.js.map → p-0c1aa75b.js.map} +1 -1
- package/dist/components/p-1539def7.js +44 -0
- package/dist/components/p-1539def7.js.map +1 -0
- package/dist/components/{p-faf7103e.js → p-2f266d73.js} +6 -2
- package/dist/components/p-2f266d73.js.map +1 -0
- package/dist/components/p-39d680b6.js +49 -0
- package/dist/components/p-39d680b6.js.map +1 -0
- package/dist/components/p-7e8a1832.js +76 -0
- package/dist/components/p-7e8a1832.js.map +1 -0
- package/dist/components/p-9a435c31.js +79 -0
- package/dist/components/p-9a435c31.js.map +1 -0
- package/dist/components/p-a7e91243.js +2206 -0
- package/dist/components/p-a7e91243.js.map +1 -0
- package/dist/components/p-b1841bad.js +62 -0
- package/dist/components/p-b1841bad.js.map +1 -0
- package/dist/components/p-bc925ed6.js +112 -0
- package/dist/components/p-bc925ed6.js.map +1 -0
- package/dist/components/{p-ddc0ac71.js → p-bf93729e.js} +3 -3
- package/dist/components/{p-ddc0ac71.js.map → p-bf93729e.js.map} +1 -1
- package/dist/{esm/index-ea02697e.js → components/p-dddd9ee6.js} +3 -2
- package/dist/components/p-dddd9ee6.js.map +1 -0
- package/dist/components/{p-19b83423.js → p-e443d670.js} +4 -4
- package/dist/components/{p-19b83423.js.map → p-e443d670.js.map} +1 -1
- package/dist/components/{p-e2727638.js → p-f2ab4eea.js} +4 -4
- package/dist/components/p-f2ab4eea.js.map +1 -0
- package/dist/components/{p-530006e6.js → p-f5fcff75.js} +3 -3
- package/dist/components/{p-530006e6.js.map → p-f5fcff75.js.map} +1 -1
- package/dist/components/p-f8b4698f.js +174 -0
- package/dist/components/p-f8b4698f.js.map +1 -0
- package/dist/components/pedido-finalizado.js +2 -2
- package/dist/components/phone-cancel-input.js +48 -1
- package/dist/components/phone-cancel-input.js.map +1 -1
- package/dist/components/phone-form.d.ts +11 -0
- package/dist/components/phone-form.js +8 -0
- package/dist/components/phone-form.js.map +1 -0
- package/dist/components/phone-input-mask.js +1 -1
- package/dist/components/phone-input.js +48 -1
- package/dist/components/phone-input.js.map +1 -1
- package/dist/components/pin-form.d.ts +11 -0
- package/dist/components/pin-form.js +8 -0
- package/dist/components/pin-form.js.map +1 -0
- package/dist/crmbonus-component-wake/crmbonus-component-wake.css +1 -0
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -1
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
- package/dist/crmbonus-component-wake/{p-2636f2f0.entry.js → p-574108d2.entry.js} +2 -2
- package/dist/crmbonus-component-wake/p-574108d2.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-5ede3b10.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-5ede3b10.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-61462d71.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-61462d71.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-63d2a359.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-63d2a359.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-6e6bf96e.js +3 -0
- package/dist/crmbonus-component-wake/p-6e6bf96e.js.map +1 -0
- package/dist/crmbonus-component-wake/p-7aff6c4e.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-7aff6c4e.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-83182e85.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-83182e85.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-8b9a1aec.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-8b9a1aec.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-a7e91243.js +2 -0
- package/dist/crmbonus-component-wake/p-a7e91243.js.map +1 -0
- package/dist/crmbonus-component-wake/p-adb37e26.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-adb37e26.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-be553772.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-be553772.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/{p-a01c57ab.entry.js → p-cdd018cc.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-001e3e2b.entry.js → p-d6af7631.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-9b967605.js → p-dddd9ee6.js} +2 -2
- package/dist/crmbonus-component-wake/p-dddd9ee6.js.map +1 -0
- package/dist/crmbonus-component-wake/{p-5febaa3c.entry.js → p-e23e8d6d.entry.js} +2 -2
- package/dist/crmbonus-component-wake/p-e3b52362.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-e3b52362.entry.js.map +1 -0
- package/dist/esm/app-modal.entry.js +24 -0
- package/dist/esm/app-modal.entry.js.map +1 -0
- package/dist/esm/countdown-timer_4.entry.js +163 -0
- package/dist/esm/countdown-timer_4.entry.js.map +1 -0
- package/dist/esm/crm-bonus-form.entry.js +99 -0
- package/dist/esm/crm-bonus-form.entry.js.map +1 -0
- package/dist/esm/crm-bonus-note.entry.js +1 -1
- package/dist/esm/crm-bonus.entry.js +36 -4
- package/dist/esm/crm-bonus.entry.js.map +1 -1
- package/dist/esm/crm-button.entry.js +20 -0
- package/dist/esm/crm-button.entry.js.map +1 -0
- package/dist/esm/crm-giftback-form.entry.js +104 -0
- package/dist/esm/crm-giftback-form.entry.js.map +1 -0
- package/dist/esm/crmbonus-component-wake.js +3 -3
- package/dist/esm/giftback-finish_4.entry.js +5 -5
- package/dist/esm/giftback-finish_4.entry.js.map +1 -1
- package/dist/esm/i18n-d8b777a9.js +2206 -0
- package/dist/esm/i18n-d8b777a9.js.map +1 -0
- package/dist/esm/index-7101ea0c.js +13 -0
- package/dist/esm/index-7101ea0c.js.map +1 -0
- package/dist/esm/{index-9f7bde48.js → index-a4c14fca.js} +9 -4
- package/dist/esm/index-a4c14fca.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/loading-spinner.entry.js +2 -2
- package/dist/esm/pedido-finalizado.entry.js +2 -2
- package/dist/esm/phone-cancel-input.entry.js +21 -0
- package/dist/esm/phone-cancel-input.entry.js.map +1 -0
- package/dist/esm/phone-input-mask.entry.js +17 -4
- package/dist/esm/phone-input-mask.entry.js.map +1 -1
- package/dist/esm/phone-input.entry.js +21 -0
- package/dist/esm/phone-input.entry.js.map +1 -0
- package/dist/types/components/button/index.d.ts +5 -0
- package/dist/types/components/countdown-timer/countdown-timer.d.ts +8 -0
- package/dist/types/components/giftback-form/giftback-form.d.ts +24 -0
- package/dist/types/components/giftback-form/subcomponents/giftback-info/giftback-info.d.ts +15 -0
- package/dist/types/components/giftback-form/subcomponents/phone-form/phone-form.d.ts +8 -0
- package/dist/types/components/giftback-form/subcomponents/pin-form/pin-form.d.ts +20 -0
- package/dist/types/components/phone/phone-input-mask.d.ts +2 -0
- package/dist/types/components.d.ts +116 -0
- package/dist/types/contants/index.d.ts +1 -0
- package/dist/types/i18n/i18n.d.ts +2 -0
- package/package.json +3 -2
- package/dist/cjs/app-modal_4.cjs.entry.js +0 -157
- package/dist/cjs/app-modal_4.cjs.entry.js.map +0 -1
- package/dist/cjs/index-52d8a075.js.map +0 -1
- package/dist/cjs/index-861e0cbe.js.map +0 -1
- package/dist/components/p-03c2447c.js +0 -170
- package/dist/components/p-03c2447c.js.map +0 -1
- package/dist/components/p-1dbb0f43.js +0 -43
- package/dist/components/p-1dbb0f43.js.map +0 -1
- package/dist/components/p-3c29c6ad.js +0 -62
- package/dist/components/p-3c29c6ad.js.map +0 -1
- package/dist/components/p-41d42a66.js +0 -52
- package/dist/components/p-41d42a66.js.map +0 -1
- package/dist/components/p-6c553ee7.js +0 -52
- package/dist/components/p-6c553ee7.js.map +0 -1
- package/dist/components/p-e2727638.js.map +0 -1
- package/dist/components/p-faf7103e.js.map +0 -1
- package/dist/crmbonus-component-wake/p-002f2417.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-002f2417.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-2636f2f0.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-3582baf8.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-3582baf8.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-61df4eb6.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-61df4eb6.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-72510682.js +0 -3
- package/dist/crmbonus-component-wake/p-72510682.js.map +0 -1
- package/dist/crmbonus-component-wake/p-9b967605.js.map +0 -1
- package/dist/esm/app-modal_4.entry.js +0 -150
- package/dist/esm/app-modal_4.entry.js.map +0 -1
- package/dist/esm/index-9f7bde48.js.map +0 -1
- package/dist/esm/index-ea02697e.js.map +0 -1
- /package/dist/crmbonus-component-wake/{p-a01c57ab.entry.js.map → p-cdd018cc.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-001e3e2b.entry.js.map → p-d6af7631.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-5febaa3c.entry.js.map → p-e23e8d6d.entry.js.map} +0 -0
@@ -0,0 +1,87 @@
|
|
1
|
+
:host {
|
2
|
+
display: block;
|
3
|
+
font-family: Arial, sans-serif;
|
4
|
+
}
|
5
|
+
|
6
|
+
.form-container-pin {
|
7
|
+
display: flex;
|
8
|
+
flex-direction: column;
|
9
|
+
align-items: center;
|
10
|
+
}
|
11
|
+
|
12
|
+
.pin-container {
|
13
|
+
display: flex;
|
14
|
+
/* margin: 26px 0; */
|
15
|
+
justify-content: start;
|
16
|
+
gap: 10px;
|
17
|
+
}
|
18
|
+
|
19
|
+
input {
|
20
|
+
width: 40px;
|
21
|
+
height: 48px;
|
22
|
+
font-size: 14px;
|
23
|
+
text-align: center;
|
24
|
+
border: 1px solid #ccc;
|
25
|
+
border-radius: 5px;
|
26
|
+
}
|
27
|
+
|
28
|
+
button {
|
29
|
+
padding: 10px 20px;
|
30
|
+
background-color: #ddd;
|
31
|
+
border: none;
|
32
|
+
border-radius: 5px;
|
33
|
+
cursor: pointer;
|
34
|
+
}
|
35
|
+
|
36
|
+
button:hover {
|
37
|
+
background-color: #bbb;
|
38
|
+
}
|
39
|
+
|
40
|
+
.success {
|
41
|
+
color: green;
|
42
|
+
margin-top: 10px;
|
43
|
+
}
|
44
|
+
|
45
|
+
.button {
|
46
|
+
top: 50%;
|
47
|
+
background-color: #6c6c7e;
|
48
|
+
color: #fff;
|
49
|
+
border: none;
|
50
|
+
border-radius: 10px;
|
51
|
+
padding: 15px;
|
52
|
+
min-height: 30px;
|
53
|
+
min-width: 120px;
|
54
|
+
font-size: 20px;
|
55
|
+
cursor: pointer;
|
56
|
+
}
|
57
|
+
|
58
|
+
.button-cancel {
|
59
|
+
top: 50%;
|
60
|
+
background-color: #ffffff;
|
61
|
+
color: #1e1c1c;
|
62
|
+
border: 1px solid gray;
|
63
|
+
border-radius: 10px;
|
64
|
+
padding: 10px;
|
65
|
+
min-height: 30px;
|
66
|
+
min-width: 120px;
|
67
|
+
font-size: 19px;
|
68
|
+
cursor: pointer;
|
69
|
+
}
|
70
|
+
|
71
|
+
.crm-description {
|
72
|
+
font-size: 14px;
|
73
|
+
width: 100%;
|
74
|
+
display: flex;
|
75
|
+
gap: 9px;
|
76
|
+
}
|
77
|
+
|
78
|
+
.crm-description a {
|
79
|
+
font-weight: bold;
|
80
|
+
cursor: pointer;
|
81
|
+
text-decoration: underline;
|
82
|
+
}
|
83
|
+
|
84
|
+
.crm-description div {
|
85
|
+
display: flex;
|
86
|
+
gap: 5px;
|
87
|
+
}
|
@@ -0,0 +1,180 @@
|
|
1
|
+
import { h } from "@stencil/core";
|
2
|
+
import i18next from "../../../../i18n/i18n";
|
3
|
+
export class GiftbackPin {
|
4
|
+
constructor() {
|
5
|
+
this.validate = undefined;
|
6
|
+
this.cancel = undefined;
|
7
|
+
this.resend = undefined;
|
8
|
+
this.sent = undefined;
|
9
|
+
this.loading = false;
|
10
|
+
this.phone = undefined;
|
11
|
+
this.pin = ['', '', '', ''];
|
12
|
+
this.isVerified = false;
|
13
|
+
this.canResend = false;
|
14
|
+
}
|
15
|
+
componentWillLoad() {
|
16
|
+
this.canResend = false;
|
17
|
+
}
|
18
|
+
handleInput(event, index) {
|
19
|
+
const input = event.target;
|
20
|
+
const value = input.value.slice(0, 1); // Limitar a um único dígito
|
21
|
+
this.pin[index] = value;
|
22
|
+
// Focar no próximo campo, se possível
|
23
|
+
if (value && index < this.pin.length - 1) {
|
24
|
+
const nextInput = input.nextElementSibling;
|
25
|
+
nextInput === null || nextInput === void 0 ? void 0 : nextInput.focus();
|
26
|
+
}
|
27
|
+
this.pin = [...this.pin];
|
28
|
+
}
|
29
|
+
validatePin() {
|
30
|
+
console.log('this.pin', this.pin);
|
31
|
+
this.validate(this.pin.join(""));
|
32
|
+
}
|
33
|
+
verifyPin() {
|
34
|
+
const pinCode = this.pin.join('');
|
35
|
+
if (pinCode === '9999') {
|
36
|
+
this.isVerified = true;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
handleTimeout() {
|
40
|
+
this.canResend = true;
|
41
|
+
}
|
42
|
+
async handleResend() {
|
43
|
+
await this.resend();
|
44
|
+
this.canResend = false;
|
45
|
+
}
|
46
|
+
renderOptions() {
|
47
|
+
if (!this.canResend) {
|
48
|
+
return h("label", null, " Reenviar em ", h("countdown-timer", { downtime: () => this.handleTimeout() }), " ");
|
49
|
+
}
|
50
|
+
return (h("div", null, h("a", { onClick: () => this.resend() }, "Reenviar"), h("a", { onClick: () => this.cancel() }, "Trocar n\u00FAmero")));
|
51
|
+
}
|
52
|
+
render() {
|
53
|
+
return (h("div", { key: '59ca50f43a04ec29730c8b3d4a05d7f55c5348ca', class: "crm-phone-form" }, h("label", { key: '1118fe90c74966783f63ce7160b7e16ea7dd9e57', class: "crm-subtitle" }, i18next.t('pin-sutitle'), " ", h("strong", { key: '66cfeccfecf01c7c10371e052349c1b46bffef03' }, "+55 ", this.phone)), h("div", { key: 'a74a395304d383664f336445e636a5379879f8c2', class: "pin-container" }, this.pin.map((_, index) => (h("input", { type: "text", maxLength: 1, value: this.pin[index], onInput: (event) => this.handleInput(event, index) })))), h("slot", { key: '13c13e409fe4f06d78f0b181b13f777c9df67e7e' }), h("p", { key: '8db0e64c2fdc0d14aa51613f8ddf958e62668aee', class: "crm-description" }, " N\u00E3o recebeu?", !this.canResend && h("label", { key: 'f732ad5ab9104c240c67db62b1046f05ff3657e8' }, " Reenviar em ", h("countdown-timer", { key: '5ed248ad9e2a667b8b8d11607c267bae47484b4e', downtime: () => this.handleTimeout() }), " "), this.canResend && (h("div", { key: '95d33dbd95e0583e5a475c0c43b42ab653723bcb' }, h("a", { key: 'f10e5af3f4744db9b7b80a7fbe4ae9b2b3344781', onClick: () => this.resend() }, "Reenviar"), h("a", { key: '00443627b9cdcbad2111cc85e63faae91a4c4676', onClick: () => this.cancel() }, "Trocar n\u00FAmero")))), h("crm-button", { key: 'b57cfa6170cd537e7d47661a3706d957e87ebe7e', txtBtn: "Avan\u00E7ar", loading: this.loading, onClick: () => this.validatePin() })));
|
54
|
+
}
|
55
|
+
static get is() { return "pin-form"; }
|
56
|
+
static get encapsulation() { return "shadow"; }
|
57
|
+
static get originalStyleUrls() {
|
58
|
+
return {
|
59
|
+
"$": ["pin-form.css", "../../giftback-form.css"]
|
60
|
+
};
|
61
|
+
}
|
62
|
+
static get styleUrls() {
|
63
|
+
return {
|
64
|
+
"$": ["pin-form.css", "../../giftback-form.css"]
|
65
|
+
};
|
66
|
+
}
|
67
|
+
static get properties() {
|
68
|
+
return {
|
69
|
+
"validate": {
|
70
|
+
"type": "unknown",
|
71
|
+
"mutable": false,
|
72
|
+
"complexType": {
|
73
|
+
"original": "(pin: string) => void",
|
74
|
+
"resolved": "(pin: string) => void",
|
75
|
+
"references": {}
|
76
|
+
},
|
77
|
+
"required": false,
|
78
|
+
"optional": false,
|
79
|
+
"docs": {
|
80
|
+
"tags": [],
|
81
|
+
"text": ""
|
82
|
+
}
|
83
|
+
},
|
84
|
+
"cancel": {
|
85
|
+
"type": "unknown",
|
86
|
+
"mutable": false,
|
87
|
+
"complexType": {
|
88
|
+
"original": "() => void",
|
89
|
+
"resolved": "() => void",
|
90
|
+
"references": {}
|
91
|
+
},
|
92
|
+
"required": false,
|
93
|
+
"optional": false,
|
94
|
+
"docs": {
|
95
|
+
"tags": [],
|
96
|
+
"text": ""
|
97
|
+
}
|
98
|
+
},
|
99
|
+
"resend": {
|
100
|
+
"type": "unknown",
|
101
|
+
"mutable": false,
|
102
|
+
"complexType": {
|
103
|
+
"original": "() => void",
|
104
|
+
"resolved": "() => void",
|
105
|
+
"references": {}
|
106
|
+
},
|
107
|
+
"required": false,
|
108
|
+
"optional": false,
|
109
|
+
"docs": {
|
110
|
+
"tags": [],
|
111
|
+
"text": ""
|
112
|
+
}
|
113
|
+
},
|
114
|
+
"sent": {
|
115
|
+
"type": "unknown",
|
116
|
+
"mutable": false,
|
117
|
+
"complexType": {
|
118
|
+
"original": "IPinSent",
|
119
|
+
"resolved": "IPinSent",
|
120
|
+
"references": {
|
121
|
+
"IPinSent": {
|
122
|
+
"location": "import",
|
123
|
+
"path": "../../../../dto/pin.sent",
|
124
|
+
"id": "src/dto/pin.sent.ts::IPinSent"
|
125
|
+
}
|
126
|
+
}
|
127
|
+
},
|
128
|
+
"required": false,
|
129
|
+
"optional": false,
|
130
|
+
"docs": {
|
131
|
+
"tags": [],
|
132
|
+
"text": ""
|
133
|
+
}
|
134
|
+
},
|
135
|
+
"loading": {
|
136
|
+
"type": "boolean",
|
137
|
+
"mutable": false,
|
138
|
+
"complexType": {
|
139
|
+
"original": "boolean",
|
140
|
+
"resolved": "boolean",
|
141
|
+
"references": {}
|
142
|
+
},
|
143
|
+
"required": false,
|
144
|
+
"optional": false,
|
145
|
+
"docs": {
|
146
|
+
"tags": [],
|
147
|
+
"text": ""
|
148
|
+
},
|
149
|
+
"attribute": "loading",
|
150
|
+
"reflect": false,
|
151
|
+
"defaultValue": "false"
|
152
|
+
},
|
153
|
+
"phone": {
|
154
|
+
"type": "string",
|
155
|
+
"mutable": false,
|
156
|
+
"complexType": {
|
157
|
+
"original": "string",
|
158
|
+
"resolved": "string",
|
159
|
+
"references": {}
|
160
|
+
},
|
161
|
+
"required": false,
|
162
|
+
"optional": false,
|
163
|
+
"docs": {
|
164
|
+
"tags": [],
|
165
|
+
"text": ""
|
166
|
+
},
|
167
|
+
"attribute": "phone",
|
168
|
+
"reflect": false
|
169
|
+
}
|
170
|
+
};
|
171
|
+
}
|
172
|
+
static get states() {
|
173
|
+
return {
|
174
|
+
"pin": {},
|
175
|
+
"isVerified": {},
|
176
|
+
"canResend": {}
|
177
|
+
};
|
178
|
+
}
|
179
|
+
}
|
180
|
+
//# sourceMappingURL=pin-form.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"pin-form.js","sourceRoot":"","sources":["../../../../../../src/components/giftback-form/subcomponents/pin-form/pin-form.tsx"],"names":[],"mappings":"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","sourcesContent":["import { Component, h, Prop, State } from '@stencil/core';\nimport { IPinSent } from '../../../../dto/pin.sent';\nimport i18next from '../../../../i18n/i18n'\n\n@Component({\n tag: 'pin-form',\n styleUrls: ['pin-form.css', '../../giftback-form.css'],\n shadow: true,\n})\nexport class GiftbackPin {\n\n @Prop() validate: (pin: string) => void;\n @Prop() cancel: () => void;\n @Prop() resend: () => void;\n\n @Prop() sent: IPinSent;\n @Prop() loading: boolean = false;\n @Prop() phone: string;\n\n @State() pin: string[] = ['', '', '', ''];\n @State() isVerified: boolean = false;\n @State() canResend: boolean = false;\n\n componentWillLoad() {\n this.canResend = false;\n }\n\n handleInput(event: Event, index: number) {\n const input = event.target as HTMLInputElement;\n const value = input.value.slice(0, 1); // Limitar a um único dígito\n this.pin[index] = value;\n\n // Focar no próximo campo, se possível\n if (value && index < this.pin.length - 1) {\n const nextInput = input.nextElementSibling as HTMLInputElement;\n nextInput?.focus();\n }\n\n this.pin = [...this.pin];\n }\n\n validatePin() {\n console.log('this.pin', this.pin);\n this.validate(this.pin.join(\"\"))\n }\n\n verifyPin() {\n const pinCode = this.pin.join('');\n if (pinCode === '9999') {\n this.isVerified = true;\n }\n }\n\n handleTimeout() {\n this.canResend = true;\n }\n\n async handleResend() {\n await this.resend();\n\n this.canResend = false;\n }\n\n renderOptions() {\n\n if (!this.canResend) {\n return <label> Reenviar em <countdown-timer downtime={() => this.handleTimeout()} /> </label>\n }\n\n return (\n <div>\n <a onClick={() => this.resend()}>Reenviar</a>\n <a onClick={() => this.cancel()}>Trocar número</a>\n </div>\n )\n }\n\n render() {\n return (\n <div class=\"crm-phone-form\">\n <label class=\"crm-subtitle\" >{i18next.t('pin-sutitle')} <strong>+55 {this.phone}</strong></label>\n <div class=\"pin-container\">\n {this.pin.map((_, index) => (\n <input\n type=\"text\"\n maxLength={1}\n value={this.pin[index]}\n onInput={(event) => this.handleInput(event, index)}\n />\n ))}\n </div>\n\n <slot></slot>\n\n <p class=\"crm-description\"> Não recebeu?\n {\n !this.canResend && <label> Reenviar em <countdown-timer downtime={() => this.handleTimeout()} /> </label>\n }\n {\n this.canResend && (\n <div >\n <a onClick={() => this.resend()}>Reenviar</a>\n <a onClick={() => this.cancel()}>Trocar número</a>\n </div>\n )\n }\n </p>\n <crm-button txtBtn=\"Avançar\" loading={this.loading} onClick={() => this.validatePin()} />\n\n\n {/* <div class=\"footer-button\">\n <button class=\"button-cancel\" disabled={this.loading} onClick={() => this.cancel()}>\n Cancelar\n </button>\n <button class={`button ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePin()}>\n {\n !this.loading ? \"Enviar\" : <loading-spinner size=\"15px\" color=\"#fff\" />\n }\n </button>\n </div> */}\n {/* <button onClick={() => this.verifyPin()}>Enviar</button>\n {this.isVerified && <p class=\"success\">Código verificado com sucesso!</p>} */}\n </div >\n );\n }\n}\n"]}
|
@@ -5,7 +5,7 @@ export class LoadingSpinner {
|
|
5
5
|
this.color = '#0078d7';
|
6
6
|
}
|
7
7
|
render() {
|
8
|
-
return (h("div", { key: '
|
8
|
+
return (h("div", { key: '54eff3c98337066831f2fbd1cd1dc933e828b9c3', 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: '
|
11
|
+
return (h("div", { key: 'c585013bfc8037246c708ee159cc576bb503fef4', class: `modal-backdrop ${this.isOpen ? 'visible' : ''}` }, h("div", { key: 'a161eb13fd0edf11a50a3a7583cc50d2fb3f41b7', class: "modal" }, h("div", { key: 'ec35247715277eecaa66289fa781e3ccbfe64d14', class: "modal-header" }, h("h3", { key: 'e135b986cb204b2e1e730a3d892bd72e48caeea5' }, this.modalTitle), h("button", { key: 'ac13ce69abf4f4d6df9c1f7abb3b4bbf8058eb13', class: "close-button", onClick: () => this.closeModal() }, "\u00D7")), h("div", { key: '5269a7eb49f02c84cb596e4ca4fbf2d888b741c9', class: "modal-body" }, h("slot", { key: '7088b50487948779c78ac881c046424389757998' })))));
|
12
12
|
}
|
13
13
|
static get is() { return "app-modal"; }
|
14
14
|
static get encapsulation() { return "shadow"; }
|
@@ -21,7 +21,7 @@ export class Pedido {
|
|
21
21
|
}
|
22
22
|
}
|
23
23
|
render() {
|
24
|
-
return (h("div", { key: '
|
24
|
+
return (h("div", { key: 'de2c3581e87e17dcbc24364d99f6903d051a7d2e' }));
|
25
25
|
}
|
26
26
|
static get is() { return "pedido-finalizado"; }
|
27
27
|
static get properties() {
|
@@ -1,27 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
.inline-text-field-container {
|
6
|
-
display: flex;
|
7
|
-
flex-direction: column;
|
8
|
-
}
|
9
|
-
|
10
|
-
@supports (top: max(0%)) {
|
11
|
-
.mdc-text-field--outlined {
|
12
|
-
padding-right: max(16px, var(--mdc-shape-small, 4px));
|
13
|
-
}
|
14
|
-
}
|
15
|
-
|
16
|
-
@supports (top: max(0%)) {
|
17
|
-
.mdc-text-field--outlined {
|
18
|
-
padding-left: max(16px, calc(var(--mdc-shape-small, 4px) + 4px));
|
19
|
-
}
|
20
|
-
}
|
21
|
-
|
22
|
-
.mdc-text-field--outlined {
|
23
|
-
height: 55px;
|
24
|
-
overflow: visible;
|
1
|
+
* {
|
2
|
+
margin: 0;
|
3
|
+
padding: 0;
|
4
|
+
box-sizing: border-box;
|
25
5
|
}
|
26
6
|
|
27
7
|
.phone {
|
@@ -43,18 +23,17 @@
|
|
43
23
|
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
|
44
24
|
}
|
45
25
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
border
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
}
|
26
|
+
|
27
|
+
.phone-input-form {
|
28
|
+
width: 246px;
|
29
|
+
height: 48px;
|
30
|
+
padding: 13px 16px 13px 16px;
|
31
|
+
border: 1px solid #CCCCCC;
|
32
|
+
}
|
33
|
+
|
34
|
+
.crm-erro-msg {
|
35
|
+
color: #E11D48;
|
36
|
+
font-size: 12px;
|
37
|
+
font-weight: 500;
|
38
|
+
margin-top: 11px;
|
39
|
+
}
|
@@ -1,7 +1,9 @@
|
|
1
1
|
import { h } from "@stencil/core";
|
2
|
+
import { MESSAGE_ERROR_INVALID_NUMBER } from "../../contants";
|
2
3
|
export class PhoneInputMask {
|
3
4
|
constructor() {
|
4
5
|
this.phone = '';
|
6
|
+
this.message = "";
|
5
7
|
this.initialValue = undefined;
|
6
8
|
this.disabled = undefined;
|
7
9
|
}
|
@@ -15,18 +17,29 @@ export class PhoneInputMask {
|
|
15
17
|
return value;
|
16
18
|
const part1 = match[1] ? `(${match[1]}` : '';
|
17
19
|
const part2 = match[2] ? `) ${match[2]}` : '';
|
18
|
-
const part3 = match[3] ?
|
20
|
+
const part3 = match[3] ? ` ${match[3]}` : '';
|
19
21
|
return `${part1}${part2}${part3}`;
|
20
22
|
}
|
21
23
|
handleInput(event) {
|
22
24
|
const input = event.target;
|
23
25
|
this.phone = this.formatPhone(input.value);
|
26
|
+
if (!this.validatePhoneNumber(input.value)) {
|
27
|
+
this.message = MESSAGE_ERROR_INVALID_NUMBER;
|
28
|
+
}
|
29
|
+
else {
|
30
|
+
this.message = "";
|
31
|
+
}
|
32
|
+
}
|
33
|
+
validatePhoneNumber(phone) {
|
34
|
+
console.log('phone', phone);
|
35
|
+
const phoneRegex = /^\(\d{2}\) \d{5} \d{4}$/; // Valida formato (99) 99999-9999
|
36
|
+
return phoneRegex.test(phone);
|
24
37
|
}
|
25
38
|
async getPhone() {
|
26
39
|
return this.phone;
|
27
40
|
}
|
28
41
|
render() {
|
29
|
-
return (h("input", { key: '
|
42
|
+
return (h("div", { key: '3cc6984552f8f636d6dfa5ed5de14ebd54156774' }, h("input", { key: 'c4de0e7de64a9255af19fc3cc9363d190a80d6f1', disabled: this.disabled, id: "phone", type: "text", class: "phone-input-form", value: this.phone, onInput: (event) => this.handleInput(event), placeholder: "(12) 94567-8910" }), h("p", { key: '1c6e6334c2995896c730f0ce93fdcb623933595d', class: "crm-erro-msg" }, this.message)));
|
30
43
|
}
|
31
44
|
static get is() { return "phone-input-mask"; }
|
32
45
|
static get encapsulation() { return "shadow"; }
|
@@ -80,7 +93,8 @@ export class PhoneInputMask {
|
|
80
93
|
}
|
81
94
|
static get states() {
|
82
95
|
return {
|
83
|
-
"phone": {}
|
96
|
+
"phone": {},
|
97
|
+
"message": {}
|
84
98
|
};
|
85
99
|
}
|
86
100
|
static get methods() {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"phone-input-mask.js","sourceRoot":"","sources":["../../../../src/components/phone/phone-input-mask.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;
|
1
|
+
{"version":3,"file":"phone-input-mask.js","sourceRoot":"","sources":["../../../../src/components/phone/phone-input-mask.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAO9D,MAAM,OAAO,cAAc;;qBACE,EAAE;uBACA,EAAE;;;;IAK7B,iBAAiB;QACb,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC;IACnC,CAAC;IAEO,WAAW,CAAC,KAAa;QAE7B,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,iCAAiC;QAC3E,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;QAE7D,IAAI,CAAC,KAAK;YAAE,OAAO,KAAK,CAAC;QAEzB,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7C,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9C,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAE7C,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,EAAE,CAAC;IACtC,CAAC;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;QAE3C,IAAG,CAAC,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;YACxC,IAAI,CAAC,OAAO,GAAG,4BAA4B,CAAA;QAC/C,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,OAAO,GAAG,EAAE,CAAA;QACrB,CAAC;IACL,CAAC;IAED,mBAAmB,CAAC,KAAa;QAC7B,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QAC3B,MAAM,UAAU,GAAG,yBAAyB,CAAC,CAAC,iCAAiC;QAC/E,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAGM,KAAK,CAAC,QAAQ;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,MAAM;QACF,OAAO,CACH;YACI,8DACI,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,EAAE,EAAC,OAAO,EACV,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,kBAAkB,EACxB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,EAC3C,WAAW,EAAC,iBAAiB,GAC/B;YACF,0DAAG,KAAK,EAAC,cAAc,IAAE,IAAI,CAAC,OAAO,CAAK,CACxC,CAET,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Method, Prop, State } from '@stencil/core';\nimport { MESSAGE_ERROR_INVALID_NUMBER } from '../../contants';\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 @State() message: string = \"\";\n\n @Prop() initialValue: string;\n @Prop() disabled: boolean;\n\n componentWillLoad() {\n this.phone = this.initialValue;\n }\n\n private formatPhone(value: string): string {\n\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\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 if(!this.validatePhoneNumber(input.value)) {\n this.message = MESSAGE_ERROR_INVALID_NUMBER\n } else {\n this.message = \"\"\n }\n }\n\n validatePhoneNumber(phone: string): boolean {\n console.log('phone', phone)\n const phoneRegex = /^\\(\\d{2}\\) \\d{5} \\d{4}$/; // Valida formato (99) 99999-9999\n return phoneRegex.test(phone);\n }\n\n @Method()\n public async getPhone() {\n return this.phone;\n }\n\n render() {\n return (\n <div>\n <input\n disabled={this.disabled}\n id=\"phone\"\n type=\"text\"\n class=\"phone-input-form\"\n value={this.phone}\n onInput={(event) => this.handleInput(event)}\n placeholder=\"(12) 94567-8910\"\n />\n <p class=\"crm-erro-msg\">{this.message}</p>\n </div>\n\n );\n }\n}\n"]}
|
@@ -6,4 +6,5 @@ export var StepFormEnum;
|
|
6
6
|
StepFormEnum[StepFormEnum["STEP_RESERVE"] = 3] = "STEP_RESERVE";
|
7
7
|
StepFormEnum[StepFormEnum["STEP_APPLY"] = 4] = "STEP_APPLY";
|
8
8
|
})(StepFormEnum || (StepFormEnum = {}));
|
9
|
+
export const MESSAGE_ERROR_INVALID_NUMBER = "Número inválido";
|
9
10
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/contants/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,YAMX;AAND,WAAY,YAAY;IACpB,yDAAa,CAAA;IACb,2DAAc,CAAA;IACd,uDAAY,CAAA;IACZ,+DAAgB,CAAA;IAChB,2DAAc,CAAA;AAClB,CAAC,EANW,YAAY,KAAZ,YAAY,QAMvB","sourcesContent":["export enum StepFormEnum {\n STEP_NAME = 0,\n STEP_PHONE = 1,\n STEP_PIN = 2,\n STEP_RESERVE = 3,\n STEP_APPLY = 4\n}"]}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/contants/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,YAMX;AAND,WAAY,YAAY;IACpB,yDAAa,CAAA;IACb,2DAAc,CAAA;IACd,uDAAY,CAAA;IACZ,+DAAgB,CAAA;IAChB,2DAAc,CAAA;AAClB,CAAC,EANW,YAAY,KAAZ,YAAY,QAMvB;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAE,iBAAiB,CAAA","sourcesContent":["export enum StepFormEnum {\n STEP_NAME = 0,\n STEP_PHONE = 1,\n STEP_PIN = 2,\n STEP_RESERVE = 3,\n STEP_APPLY = 4\n}\n\nexport const MESSAGE_ERROR_INVALID_NUMBER= \"Número inválido\""]}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import i18next from "i18next";
|
2
|
+
i18next.init({
|
3
|
+
lng: 'pt', // Idioma padrão
|
4
|
+
fallbackLng: 'en', // Idioma de fallback
|
5
|
+
resources: {
|
6
|
+
en: {
|
7
|
+
translation: {
|
8
|
+
welcome: "Welcome",
|
9
|
+
description: "This is an example",
|
10
|
+
'pin-sutitle': "Enter the 4-digit code sent via SMS to the number"
|
11
|
+
},
|
12
|
+
},
|
13
|
+
pt: {
|
14
|
+
translation: {
|
15
|
+
welcome: "Bem-vindo",
|
16
|
+
description: "Este é um exemplo",
|
17
|
+
'pin-sutitle': "Digite o código de 4 dígitos enviado por SMS ao número",
|
18
|
+
giftDescription: "Você tem até <strong>R$ {{amount}}</strong> de {{custom_name}}"
|
19
|
+
},
|
20
|
+
},
|
21
|
+
},
|
22
|
+
});
|
23
|
+
export default i18next;
|
24
|
+
//# sourceMappingURL=i18n.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../../src/i18n/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,CAAC,IAAI,CAAC;IACX,GAAG,EAAE,IAAI,EAAE,gBAAgB;IAC3B,WAAW,EAAE,IAAI,EAAE,qBAAqB;IACxC,SAAS,EAAE;QACT,EAAE,EAAE;YACF,WAAW,EAAE;gBACX,OAAO,EAAE,SAAS;gBAClB,WAAW,EAAE,oBAAoB;gBACjC,aAAa,EAAE,mDAAmD;aACnE;SACF;QACD,EAAE,EAAE;YACF,WAAW,EAAE;gBACX,OAAO,EAAE,WAAW;gBACpB,WAAW,EAAE,mBAAmB;gBAChC,aAAa,EAAE,wDAAwD;gBACvE,eAAe,EAAE,gEAAgE;aAClF;SACF;KACF;CACF,CAAC,CAAC;AAEH,eAAe,OAAO,CAAC","sourcesContent":["import i18next from 'i18next';\n\ni18next.init({\n lng: 'pt', // Idioma padrão\n fallbackLng: 'en', // Idioma de fallback\n resources: {\n en: {\n translation: {\n welcome: \"Welcome\",\n description: \"This is an example\",\n 'pin-sutitle': \"Enter the 4-digit code sent via SMS to the number\"\n },\n },\n pt: {\n translation: {\n welcome: \"Bem-vindo\",\n description: \"Este é um exemplo\",\n 'pin-sutitle': \"Digite o código de 4 dígitos enviado por SMS ao número\",\n giftDescription: \"Você tem até <strong>R$ {{amount}}</strong> de {{custom_name}}\"\n },\n },\n },\n});\n\nexport default i18next;\n"]}
|
@@ -1,4 +1,42 @@
|
|
1
|
-
import {
|
1
|
+
import { p as proxyCustomElement, H, c as createEvent, h } from './p-2f266d73.js';
|
2
|
+
|
3
|
+
const appModalCss = ".modal-backdrop{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);display:none;justify-content:center;align-items:center;z-index:1000}.modal-backdrop.visible{display:flex}.modal{background:white;border-radius:8px;padding:1rem;max-width:500px;width:90%;box-shadow:0 2px 10px rgba(0, 0, 0, 0.3)}.modal-header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #ddd;margin-bottom:1rem}.close-button{background:none;border:none;font-size:1.5rem;cursor:pointer}.modal-body{}";
|
4
|
+
const AppModalStyle0 = appModalCss;
|
5
|
+
|
6
|
+
const AppModal$1 = /*@__PURE__*/ proxyCustomElement(class AppModal extends H {
|
7
|
+
constructor() {
|
8
|
+
super();
|
9
|
+
this.__registerHost();
|
10
|
+
this.__attachShadow();
|
11
|
+
this.modalClosed = createEvent(this, "modalClosed", 7);
|
12
|
+
this.isOpen = false;
|
13
|
+
this.modalTitle = undefined;
|
14
|
+
}
|
15
|
+
closeModal() {
|
16
|
+
this.modalClosed.emit();
|
17
|
+
}
|
18
|
+
render() {
|
19
|
+
return (h("div", { key: 'c585013bfc8037246c708ee159cc576bb503fef4', class: `modal-backdrop ${this.isOpen ? 'visible' : ''}` }, h("div", { key: 'a161eb13fd0edf11a50a3a7583cc50d2fb3f41b7', class: "modal" }, h("div", { key: 'ec35247715277eecaa66289fa781e3ccbfe64d14', class: "modal-header" }, h("h3", { key: 'e135b986cb204b2e1e730a3d892bd72e48caeea5' }, this.modalTitle), h("button", { key: 'ac13ce69abf4f4d6df9c1f7abb3b4bbf8058eb13', class: "close-button", onClick: () => this.closeModal() }, "\u00D7")), h("div", { key: '5269a7eb49f02c84cb596e4ca4fbf2d888b741c9', class: "modal-body" }, h("slot", { key: '7088b50487948779c78ac881c046424389757998' })))));
|
20
|
+
}
|
21
|
+
static get style() { return AppModalStyle0; }
|
22
|
+
}, [1, "app-modal", {
|
23
|
+
"isOpen": [516, "is-open"],
|
24
|
+
"modalTitle": [1, "modal-title"]
|
25
|
+
}]);
|
26
|
+
function defineCustomElement$1() {
|
27
|
+
if (typeof customElements === "undefined") {
|
28
|
+
return;
|
29
|
+
}
|
30
|
+
const components = ["app-modal"];
|
31
|
+
components.forEach(tagName => { switch (tagName) {
|
32
|
+
case "app-modal":
|
33
|
+
if (!customElements.get(tagName)) {
|
34
|
+
customElements.define(tagName, AppModal$1);
|
35
|
+
}
|
36
|
+
break;
|
37
|
+
} });
|
38
|
+
}
|
39
|
+
defineCustomElement$1();
|
2
40
|
|
3
41
|
const AppModal = AppModal$1;
|
4
42
|
const defineCustomElement = defineCustomElement$1;
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"app-modal.js","mappings":"
|
1
|
+
{"file":"app-modal.js","mappings":";;AAAA,MAAM,WAAW,GAAG,+hBAA+hB,CAAC;AACpjB,uBAAe,WAAW;;MCMbA,UAAQ;;;;;;sBAG0B,KAAK;;;IAQxC,UAAU;QACd,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;KAC3B;IAED,MAAM;QACF,QACI,4DAAK,KAAK,EAAE,kBAAkB,IAAI,CAAC,MAAM,GAAG,SAAS,GAAG,EAAE,EAAE,IACxD,4DAAK,KAAK,EAAC,OAAO,IACd,4DAAK,KAAK,EAAC,cAAc,IACrB,6DAAK,IAAI,CAAC,UAAU,CAAM,EAC1B,+DAAQ,KAAK,EAAC,cAAc,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE,aAEpD,CACP,EACN,4DAAK,KAAK,EAAC,YAAY,IACnB,8DAAQ,CACN,CACJ,CACJ,EACT;KACJ;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["AppModal"],"sources":["src/components/modal/app-modal.css?tag=app-modal&encapsulation=shadow","src/components/modal/app-modal.tsx"],"sourcesContent":[".modal-backdrop {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n display: none;\n justify-content: center;\n align-items: center;\n z-index: 1000;\n }\n \n .modal-backdrop.visible {\n display: flex;\n }\n \n .modal {\n background: white;\n border-radius: 8px;\n padding: 1rem;\n max-width: 500px;\n width: 90%;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);\n }\n \n .modal-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-bottom: 1px solid #ddd;\n margin-bottom: 1rem;\n }\n \n .close-button {\n background: none;\n border: none;\n font-size: 1.5rem;\n cursor: pointer;\n }\n \n .modal-body {\n /* padding: 1rem 0; */\n }\n ","import { Component, Event, EventEmitter, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'app-modal',\n styleUrl: 'app-modal.css',\n shadow: true,\n})\nexport class AppModal {\n\n // Controle da visibilidade do modal\n @Prop({ reflect: true }) isOpen: boolean = false;\n\n // Título do modal\n @Prop() modalTitle: string;\n\n // Evento emitido ao fechar o modal\n @Event() modalClosed: EventEmitter<void>;\n\n private closeModal() {\n this.modalClosed.emit();\n }\n\n render() {\n return (\n <div class={`modal-backdrop ${this.isOpen ? 'visible' : ''}`}>\n <div class=\"modal\">\n <div class=\"modal-header\">\n <h3>{this.modalTitle}</h3>\n <button class=\"close-button\" onClick={() => this.closeModal()}>\n ×\n </button>\n </div>\n <div class=\"modal-body\">\n <slot />\n </div>\n </div>\n </div>\n )\n }\n}"],"version":3}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
2
|
+
|
3
|
+
interface CountdownTimer extends Components.CountdownTimer, HTMLElement {}
|
4
|
+
export const CountdownTimer: {
|
5
|
+
prototype: CountdownTimer;
|
6
|
+
new (): CountdownTimer;
|
7
|
+
};
|
8
|
+
/**
|
9
|
+
* Used to define this component and all nested components recursively.
|
10
|
+
*/
|
11
|
+
export const defineCustomElement: () => void;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { C as CountdownTimer$1, d as defineCustomElement$1 } from './p-39d680b6.js';
|
2
|
+
|
3
|
+
const CountdownTimer = CountdownTimer$1;
|
4
|
+
const defineCustomElement = defineCustomElement$1;
|
5
|
+
|
6
|
+
export { CountdownTimer, defineCustomElement };
|
7
|
+
|
8
|
+
//# sourceMappingURL=countdown-timer.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"countdown-timer.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|