crmbonus-component-wake 0.0.26 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/app-globals-3a1e7e63.js +7 -0
- package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
- package/dist/cjs/app-modal_4.cjs.entry.js +152 -0
- package/dist/cjs/app-modal_4.cjs.entry.js.map +1 -0
- package/dist/cjs/crm-bonus.cjs.entry.js +86 -0
- package/dist/cjs/crm-bonus.cjs.entry.js.map +1 -0
- package/dist/cjs/crmbonus-component-wake.cjs.js +27 -0
- package/dist/cjs/crmbonus-component-wake.cjs.js.map +1 -0
- package/dist/cjs/crmbonus.service-8412ddbf.js +3798 -0
- package/dist/cjs/crmbonus.service-8412ddbf.js.map +1 -0
- package/dist/cjs/giftback-finish_3.cjs.entry.js +102 -0
- package/dist/cjs/giftback-finish_3.cjs.entry.js.map +1 -0
- package/dist/cjs/index-296f70bf.js +11 -0
- package/dist/cjs/index-296f70bf.js.map +1 -0
- package/dist/cjs/index-52d8a075.js +1248 -0
- package/dist/cjs/index-52d8a075.js.map +1 -0
- package/dist/cjs/index.cjs.js +11 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +17 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/loading-spinner.cjs.entry.js +24 -0
- package/dist/cjs/loading-spinner.cjs.entry.js.map +1 -0
- package/dist/cjs/pedido-finalizado.cjs.entry.js +36 -0
- package/dist/cjs/pedido-finalizado.cjs.entry.js.map +1 -0
- package/dist/cjs/phone-input-mask.cjs.entry.js +45 -0
- package/dist/cjs/phone-input-mask.cjs.entry.js.map +1 -0
- package/dist/collection/collection-manifest.json +22 -0
- package/dist/collection/components/crm-bonus/assets/logo.svg +18 -0
- package/dist/collection/components/crm-bonus/assets/success-svgrepo-com.svg +8 -0
- package/dist/collection/components/crm-bonus/assets/svg/logo.svg +18 -0
- package/dist/collection/components/crm-bonus/assets/svg/success-svgrepo-com.svg +8 -0
- package/dist/collection/components/crm-bonus/crm-bonus.css +50 -0
- package/dist/collection/components/crm-bonus/crm-bonus.js +170 -0
- package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.css +19 -0
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +311 -0
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.css +10 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js +20 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.css +74 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js +127 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css +109 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js +127 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js +75 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js +75 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js.map +1 -0
- package/dist/collection/components/loading-spinner/loading-spinner.css +17 -0
- package/dist/collection/components/loading-spinner/loading-spinner.js +63 -0
- package/dist/collection/components/loading-spinner/loading-spinner.js.map +1 -0
- package/dist/collection/components/modal/app-modal.css +45 -0
- package/dist/collection/components/modal/app-modal.js +83 -0
- package/dist/collection/components/modal/app-modal.js.map +1 -0
- package/dist/collection/components/pedido/pedido.js +83 -0
- package/dist/collection/components/pedido/pedido.js.map +1 -0
- package/dist/collection/components/phone/phone-input-mask.css +47 -0
- package/dist/collection/components/phone/phone-input-mask.js +108 -0
- package/dist/collection/components/phone/phone-input-mask.js.map +1 -0
- package/dist/collection/contants/index.js +8 -0
- package/dist/collection/contants/index.js.map +1 -0
- package/dist/collection/contants/mocks.js +28 -0
- package/dist/collection/contants/mocks.js.map +1 -0
- package/dist/collection/dto/pin.sent.js +2 -0
- package/dist/collection/dto/pin.sent.js.map +1 -0
- package/dist/collection/dto/update.order.dto.js +2 -0
- package/dist/collection/dto/update.order.dto.js.map +1 -0
- package/dist/collection/dto/validate.pin.bonus.js +2 -0
- package/dist/collection/dto/validate.pin.bonus.js.map +1 -0
- package/dist/collection/index.js +11 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/services/crmbonus.service.js +42 -0
- package/dist/collection/services/crmbonus.service.js.map +1 -0
- package/dist/collection/utils/utils.js +4 -0
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/components/app-modal.js +8 -0
- package/dist/components/app-modal.js.map +1 -0
- package/dist/components/crm-bonus-form.js +8 -0
- package/dist/components/crm-bonus-form.js.map +1 -0
- package/dist/components/crm-bonus.js +167 -0
- package/dist/components/crm-bonus.js.map +1 -0
- package/dist/components/giftback-finish.js +8 -0
- package/dist/components/giftback-finish.js.map +1 -0
- package/dist/components/giftback-pin.js +8 -0
- package/dist/components/giftback-pin.js.map +1 -0
- package/dist/components/giftback-progress.js +8 -0
- package/dist/components/giftback-progress.js.map +1 -0
- package/dist/components/index.js +9 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/loading-spinner.js +8 -0
- package/dist/components/loading-spinner.js.map +1 -0
- package/dist/components/p-03918b34.js +39 -0
- package/dist/components/p-03918b34.js.map +1 -0
- package/dist/components/p-2667d525.js +36 -0
- package/dist/components/p-2667d525.js.map +1 -0
- package/dist/components/p-28ba6192.js +52 -0
- package/dist/components/p-28ba6192.js.map +1 -0
- package/dist/{crmbonus-component-wake/crmbonus.service-5208f883.js → components/p-374de9ae.js} +91 -166
- package/dist/components/p-374de9ae.js.map +1 -0
- package/dist/{crmbonus-component-wake/giftback-pin.entry.js → components/p-3e80a758.js} +39 -9
- package/dist/components/p-3e80a758.js.map +1 -0
- package/dist/components/p-675deed3.js +62 -0
- package/dist/components/p-675deed3.js.map +1 -0
- package/dist/components/p-b4c3e6bf.js +156 -0
- package/dist/components/p-b4c3e6bf.js.map +1 -0
- package/dist/components/p-c5913818.js +69 -0
- package/dist/components/p-c5913818.js.map +1 -0
- package/dist/components/p-ed6bc79c.js +52 -0
- package/dist/components/p-ed6bc79c.js.map +1 -0
- package/dist/components/p-f6396f4c.js +43 -0
- package/dist/components/p-f6396f4c.js.map +1 -0
- package/dist/components/p-faf7103e.js +1064 -0
- package/dist/components/p-faf7103e.js.map +1 -0
- package/dist/components/pedido-finalizado.js +54 -0
- package/dist/components/pedido-finalizado.js.map +1 -0
- package/dist/components/phone-cancel-input.d.ts +11 -0
- package/dist/components/phone-cancel-input.js +8 -0
- package/dist/components/phone-cancel-input.js.map +1 -0
- package/dist/components/phone-input-mask.js +8 -0
- package/dist/components/phone-input-mask.js.map +1 -0
- package/dist/components/phone-input.js +8 -0
- package/dist/components/phone-input.js.map +1 -0
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -48
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
- package/dist/crmbonus-component-wake/index.esm.js +1 -16
- package/dist/crmbonus-component-wake/index.esm.js.map +1 -1
- package/dist/crmbonus-component-wake/p-075bd04d.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-075bd04d.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-241a5303.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-241a5303.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-374de9ae.js +2 -0
- package/dist/crmbonus-component-wake/p-374de9ae.js.map +1 -0
- package/dist/crmbonus-component-wake/p-72510682.js +3 -0
- package/dist/crmbonus-component-wake/p-72510682.js.map +1 -0
- package/dist/crmbonus-component-wake/p-86d04322.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-86d04322.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-8e6cdd1e.js +2 -0
- package/dist/crmbonus-component-wake/p-8e6cdd1e.js.map +1 -0
- package/dist/crmbonus-component-wake/p-a603a26e.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-a603a26e.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-e1255160.js +2 -0
- package/dist/crmbonus-component-wake/p-e1255160.js.map +1 -0
- package/dist/crmbonus-component-wake/p-e9c2ed46.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-e9c2ed46.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-ef75ecd5.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-ef75ecd5.entry.js.map +1 -0
- package/dist/env.js +5 -0
- package/dist/env.js.map +1 -0
- package/dist/esm/app-modal_4.entry.js +145 -0
- package/dist/esm/app-modal_4.entry.js.map +1 -0
- package/dist/esm/crm-bonus.entry.js +82 -0
- package/dist/esm/crm-bonus.entry.js.map +1 -0
- package/dist/esm/crmbonus-component-wake.js +22 -0
- package/dist/esm/crmbonus-component-wake.js.map +1 -0
- package/dist/esm/crmbonus.service-053a9e38.js +3796 -0
- package/dist/esm/crmbonus.service-053a9e38.js.map +1 -0
- package/dist/esm/giftback-finish_3.entry.js +96 -0
- package/dist/esm/giftback-finish_3.entry.js.map +1 -0
- package/dist/esm/index-2bfaba2b.js +11 -0
- package/dist/esm/index-2bfaba2b.js.map +1 -0
- package/dist/esm/index-9f7bde48.js +1220 -0
- package/dist/esm/index-9f7bde48.js.map +1 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +13 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/loading-spinner.entry.js +4 -3
- package/dist/esm/loading-spinner.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/pedido-finalizado.entry.js +3 -3
- package/dist/esm/pedido-finalizado.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/phone-input-mask.entry.js +5 -3
- package/dist/esm/phone-input-mask.entry.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/crm-bonus/crm-bonus.d.ts +9 -0
- package/dist/types/components/crm-bonus-form/crm-bonus-form.d.ts +8 -4
- package/dist/types/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.d.ts +1 -1
- package/dist/types/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.d.ts +8 -0
- package/dist/types/components/phone/phone-input-mask.d.ts +1 -0
- package/dist/types/components.d.ts +32 -0
- package/package.json +1 -1
- package/dist/crmbonus-component-wake/app-modal.entry.js +0 -23
- package/dist/crmbonus-component-wake/app-modal.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/crm-bonus-form.entry.js +0 -109
- package/dist/crmbonus-component-wake/crm-bonus-form.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/crm-bonus.entry.js +0 -50
- package/dist/crmbonus-component-wake/crm-bonus.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/crmbonus.service-5208f883.js.map +0 -1
- package/dist/crmbonus-component-wake/giftback-finish.entry.js +0 -19
- package/dist/crmbonus-component-wake/giftback-finish.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/giftback-pin.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/giftback-progress.entry.js +0 -40
- package/dist/crmbonus-component-wake/giftback-progress.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/index-f557ce7c.js +0 -3039
- package/dist/crmbonus-component-wake/index-f557ce7c.js.map +0 -1
- package/dist/crmbonus-component-wake/loading-spinner.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/pedido-finalizado.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/phone-input-mask.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/phone-input.entry.js +0 -21
- package/dist/crmbonus-component-wake/phone-input.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js +0 -334
- package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js.map +0 -1
- /package/dist/{crmbonus-component-wake → esm}/app-globals-0f993ce5.js +0 -0
- /package/dist/{crmbonus-component-wake → esm}/app-globals-0f993ce5.js.map +0 -0
@@ -0,0 +1,22 @@
|
|
1
|
+
{
|
2
|
+
"entries": [
|
3
|
+
"components/crm-bonus/crm-bonus.js",
|
4
|
+
"components/crm-bonus-form/crm-bonus-form.js",
|
5
|
+
"components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js",
|
6
|
+
"components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js",
|
7
|
+
"components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js",
|
8
|
+
"components/crm-bonus-form/subcomponents/phone/phone.input.js",
|
9
|
+
"components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js",
|
10
|
+
"components/loading-spinner/loading-spinner.js",
|
11
|
+
"components/modal/app-modal.js",
|
12
|
+
"components/pedido/pedido.js",
|
13
|
+
"components/phone/phone-input-mask.js"
|
14
|
+
],
|
15
|
+
"compiler": {
|
16
|
+
"name": "@stencil/core",
|
17
|
+
"version": "4.22.2",
|
18
|
+
"typescriptVersion": "5.5.4"
|
19
|
+
},
|
20
|
+
"collections": [],
|
21
|
+
"bundles": []
|
22
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 703 103" fill="none" preserveAspectRatio="xMidYMid meet" aria-hidden="true" role="img">
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M689.2 57.5004L647.1 99.6004L637.3 89.8004L679.4 47.7004H636V33.9004H695C696.9 33.9004 698.5 34.5004 699.7 35.5004C700 35.7004 700.2 35.9004 700.4 36.1004C700.6 36.3004 700.8 36.5004 700.9 36.7004V36.8004V36.9004C702 38.1004 702.7 39.8004 702.7 41.8004V43.6004V67.0004V100.7H688.9V80.8004V57.5004H689.2Z" fill="url(#paint0_linear_1629_188)"></path>
|
3
|
+
<path d="M52.7 76.4998H67.7C65.3 91.7998 51.9 102.5 35.2 102.5C15.2 102.5 0 87.2998 0 67.3998C0 47.6998 15.2 32.2998 35.2 32.2998C51.9 32.2998 65.3 42.8998 67.7 58.2998H52.7C50.9 50.7998 44.2 45.6998 35.2 45.6998C22.9 45.6998 14.8 55.3998 14.8 67.3998C14.8 79.4998 22.9 89.0998 35.2 89.0998C44.2 89.1998 50.9 84.0998 52.7 76.4998Z" fill="currentColor"></path>
|
4
|
+
<path d="M117.2 32.7002V46.6002C106.6 47.0002 98.5002 51.0002 92.5002 58.8002V100.8H77.7002V34.1002H92.5002V43.2002C98.6002 36.5002 107 32.7002 117.2 32.7002Z" fill="currentColor"></path>
|
5
|
+
<path d="M237.4 62.5997V100.8H222.8V62.5997C222.8 50.7997 216.6 45.6997 207 45.6997C200.5 45.6997 194.2 48.0997 189.3 54.7997C189.7 56.8997 189.9 59.2997 189.9 61.7997V100.8H175.2V61.7997C175.2 49.9997 169 45.7997 160.3 45.7997C153.3 45.7997 147.1 48.5997 142.3 55.2997V100.9H127.5V34.1997H142.3V39.8997C147.3 35.3997 153.2 32.4997 162 32.4997C171.5 32.4997 179.2 35.7997 184.1 42.1997C190.6 35.7997 198.2 32.4997 207.9 32.4997C225.5 32.3997 237.4 42.8997 237.4 62.5997Z" fill="currentColor"></path>
|
6
|
+
<path d="M320 67.3C320 86.9 304.8 102.5 286.1 102.5C277.6 102.5 270.3 99.9 264.8 95.5V100.8H250V0H264.8V39.2C270.3 34.9 277.6 32.4 286.1 32.4C304.8 32.4 320 48 320 67.3ZM305.2 67.3C305.2 55.5 296.3 45.7 283.9 45.7C276.5 45.7 269.7 48.1 264.7 55.1V79.7C269.7 86.7 276.5 89.2 283.9 89.2C296.3 89.2 305.2 79.2 305.2 67.3Z" fill="currentColor"></path>
|
7
|
+
<path d="M399.2 67.5004C399.2 87.9004 384.4 102.6 363.7 102.6C343 102.6 328.2 87.9004 328.2 67.5004C328.2 47.1004 343 32.4004 363.7 32.4004C384.4 32.4004 399.2 47.0004 399.2 67.5004ZM384.4 67.5004C384.4 54.9004 375.7 45.8004 363.7 45.8004C351.7 45.8004 343 54.9004 343 67.5004C343 80.0004 351.7 89.2004 363.7 89.2004C375.7 89.2004 384.4 79.9004 384.4 67.5004Z" fill="currentColor"></path>
|
8
|
+
<path d="M474.3 63.5997V100.8H459.5V64.4996C459.5 52.2996 453 45.7997 442.2 45.7997C435.8 45.7997 428.9 49.2996 423.6 55.8996V100.9H408.8V34.1996H423.6V40.1996C429.4 35.1996 436.7 32.4996 445.2 32.4996C462.5 32.3996 474.3 44.2997 474.3 63.5997Z" fill="currentColor"></path>
|
9
|
+
<path d="M550.4 34.0996V100.8H535.8V94.2996C530 99.5996 522.7 102.5 514.1 102.5C496.8 102.5 485.1 90.1996 485.1 70.9996V34.0996H499.7V70.1996C499.7 82.3996 506.4 89.1996 517 89.1996C523.5 89.1996 530.3 85.4996 535.7 78.6996V34.0996H550.4Z" fill="currentColor"></path>
|
10
|
+
<path d="M591.5 90.5002C600.2 90.5002 606.1 87.7002 606.1 82.4002C606.1 78.4002 602.8 75.6002 597.2 74.6002L582.4 72.0002C572.2 70.3002 562.7 65.2002 562.7 53.1002C562.7 40.2002 573.9 32.2002 590.5 32.2002C603.4 32.2002 618.3 36.6002 619.7 54.1002H606.1C605.4 46.9002 599 44.0002 590.5 44.0002C582 44.0002 577.3 47.1002 577.3 51.8002C577.3 55.3002 579.9 58.8002 587.7 60.0002L600.2 62.0002C610.3 63.8002 620.2 68.2002 620.2 81.2002C620.2 95.3002 607.9 102.5 591.1 102.5C575.3 102.5 561.9 96.3002 560.2 78.7002L573.8 78.8002C575.3 87.0002 581.4 90.5002 591.5 90.5002Z" fill="currentColor"></path>
|
11
|
+
<defs>
|
12
|
+
<linearGradient id="paint0_linear_1629_188" x1="636.833" y1="97.8261" x2="713.46" y2="26.6582" gradientUnits="userSpaceOnUse">
|
13
|
+
<stop stop-color="#F7A830"></stop>
|
14
|
+
<stop offset="0.6353" stop-color="#F08336"></stop>
|
15
|
+
<stop offset="1" stop-color="#EA5346"></stop>
|
16
|
+
</linearGradient>
|
17
|
+
</defs>
|
18
|
+
</svg>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
3
|
+
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
4
|
+
viewBox="0 0 50 50" xml:space="preserve">
|
5
|
+
<circle style="fill:#25AE88;" cx="25" cy="25" r="25"/>
|
6
|
+
<polyline style="fill:none;stroke:#FFFFFF;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;" points="
|
7
|
+
38,15 22,33 12,25 "/>
|
8
|
+
</svg>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 703 103" fill="none" preserveAspectRatio="xMidYMid meet" aria-hidden="true" role="img">
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M689.2 57.5004L647.1 99.6004L637.3 89.8004L679.4 47.7004H636V33.9004H695C696.9 33.9004 698.5 34.5004 699.7 35.5004C700 35.7004 700.2 35.9004 700.4 36.1004C700.6 36.3004 700.8 36.5004 700.9 36.7004V36.8004V36.9004C702 38.1004 702.7 39.8004 702.7 41.8004V43.6004V67.0004V100.7H688.9V80.8004V57.5004H689.2Z" fill="url(#paint0_linear_1629_188)"></path>
|
3
|
+
<path d="M52.7 76.4998H67.7C65.3 91.7998 51.9 102.5 35.2 102.5C15.2 102.5 0 87.2998 0 67.3998C0 47.6998 15.2 32.2998 35.2 32.2998C51.9 32.2998 65.3 42.8998 67.7 58.2998H52.7C50.9 50.7998 44.2 45.6998 35.2 45.6998C22.9 45.6998 14.8 55.3998 14.8 67.3998C14.8 79.4998 22.9 89.0998 35.2 89.0998C44.2 89.1998 50.9 84.0998 52.7 76.4998Z" fill="currentColor"></path>
|
4
|
+
<path d="M117.2 32.7002V46.6002C106.6 47.0002 98.5002 51.0002 92.5002 58.8002V100.8H77.7002V34.1002H92.5002V43.2002C98.6002 36.5002 107 32.7002 117.2 32.7002Z" fill="currentColor"></path>
|
5
|
+
<path d="M237.4 62.5997V100.8H222.8V62.5997C222.8 50.7997 216.6 45.6997 207 45.6997C200.5 45.6997 194.2 48.0997 189.3 54.7997C189.7 56.8997 189.9 59.2997 189.9 61.7997V100.8H175.2V61.7997C175.2 49.9997 169 45.7997 160.3 45.7997C153.3 45.7997 147.1 48.5997 142.3 55.2997V100.9H127.5V34.1997H142.3V39.8997C147.3 35.3997 153.2 32.4997 162 32.4997C171.5 32.4997 179.2 35.7997 184.1 42.1997C190.6 35.7997 198.2 32.4997 207.9 32.4997C225.5 32.3997 237.4 42.8997 237.4 62.5997Z" fill="currentColor"></path>
|
6
|
+
<path d="M320 67.3C320 86.9 304.8 102.5 286.1 102.5C277.6 102.5 270.3 99.9 264.8 95.5V100.8H250V0H264.8V39.2C270.3 34.9 277.6 32.4 286.1 32.4C304.8 32.4 320 48 320 67.3ZM305.2 67.3C305.2 55.5 296.3 45.7 283.9 45.7C276.5 45.7 269.7 48.1 264.7 55.1V79.7C269.7 86.7 276.5 89.2 283.9 89.2C296.3 89.2 305.2 79.2 305.2 67.3Z" fill="currentColor"></path>
|
7
|
+
<path d="M399.2 67.5004C399.2 87.9004 384.4 102.6 363.7 102.6C343 102.6 328.2 87.9004 328.2 67.5004C328.2 47.1004 343 32.4004 363.7 32.4004C384.4 32.4004 399.2 47.0004 399.2 67.5004ZM384.4 67.5004C384.4 54.9004 375.7 45.8004 363.7 45.8004C351.7 45.8004 343 54.9004 343 67.5004C343 80.0004 351.7 89.2004 363.7 89.2004C375.7 89.2004 384.4 79.9004 384.4 67.5004Z" fill="currentColor"></path>
|
8
|
+
<path d="M474.3 63.5997V100.8H459.5V64.4996C459.5 52.2996 453 45.7997 442.2 45.7997C435.8 45.7997 428.9 49.2996 423.6 55.8996V100.9H408.8V34.1996H423.6V40.1996C429.4 35.1996 436.7 32.4996 445.2 32.4996C462.5 32.3996 474.3 44.2997 474.3 63.5997Z" fill="currentColor"></path>
|
9
|
+
<path d="M550.4 34.0996V100.8H535.8V94.2996C530 99.5996 522.7 102.5 514.1 102.5C496.8 102.5 485.1 90.1996 485.1 70.9996V34.0996H499.7V70.1996C499.7 82.3996 506.4 89.1996 517 89.1996C523.5 89.1996 530.3 85.4996 535.7 78.6996V34.0996H550.4Z" fill="currentColor"></path>
|
10
|
+
<path d="M591.5 90.5002C600.2 90.5002 606.1 87.7002 606.1 82.4002C606.1 78.4002 602.8 75.6002 597.2 74.6002L582.4 72.0002C572.2 70.3002 562.7 65.2002 562.7 53.1002C562.7 40.2002 573.9 32.2002 590.5 32.2002C603.4 32.2002 618.3 36.6002 619.7 54.1002H606.1C605.4 46.9002 599 44.0002 590.5 44.0002C582 44.0002 577.3 47.1002 577.3 51.8002C577.3 55.3002 579.9 58.8002 587.7 60.0002L600.2 62.0002C610.3 63.8002 620.2 68.2002 620.2 81.2002C620.2 95.3002 607.9 102.5 591.1 102.5C575.3 102.5 561.9 96.3002 560.2 78.7002L573.8 78.8002C575.3 87.0002 581.4 90.5002 591.5 90.5002Z" fill="currentColor"></path>
|
11
|
+
<defs>
|
12
|
+
<linearGradient id="paint0_linear_1629_188" x1="636.833" y1="97.8261" x2="713.46" y2="26.6582" gradientUnits="userSpaceOnUse">
|
13
|
+
<stop stop-color="#F7A830"></stop>
|
14
|
+
<stop offset="0.6353" stop-color="#F08336"></stop>
|
15
|
+
<stop offset="1" stop-color="#EA5346"></stop>
|
16
|
+
</linearGradient>
|
17
|
+
</defs>
|
18
|
+
</svg>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
3
|
+
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
4
|
+
viewBox="0 0 50 50" xml:space="preserve">
|
5
|
+
<circle style="fill:#25AE88;" cx="25" cy="25" r="25"/>
|
6
|
+
<polyline style="fill:none;stroke:#FFFFFF;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;" points="
|
7
|
+
38,15 22,33 12,25 "/>
|
8
|
+
</svg>
|
@@ -0,0 +1,50 @@
|
|
1
|
+
/* :host {
|
2
|
+
display: block;
|
3
|
+
} */
|
4
|
+
|
5
|
+
.container-button {
|
6
|
+
max-width: 100%;
|
7
|
+
cursor: pointer;
|
8
|
+
padding: 10px;
|
9
|
+
display: flex;
|
10
|
+
}
|
11
|
+
|
12
|
+
/* padding: 0 15px 15px;
|
13
|
+
border: 1px solid #ddd;
|
14
|
+
margin-bottom: 20px; */
|
15
|
+
|
16
|
+
.section-crm {
|
17
|
+
border: 1px solid #dbd4d4;
|
18
|
+
/* min-height: 50px; */
|
19
|
+
text-align: -webkit-center;
|
20
|
+
margin-bottom: 20px;
|
21
|
+
}
|
22
|
+
|
23
|
+
.section-cart-crm {
|
24
|
+
/* border: 1px solid #dbd4d4; */
|
25
|
+
/* min-height: 50px; */
|
26
|
+
text-align: -webkit-center;
|
27
|
+
margin-bottom: 20px;
|
28
|
+
}
|
29
|
+
|
30
|
+
.button {
|
31
|
+
top: 50%;
|
32
|
+
background-color: #6c6c7e;
|
33
|
+
color: #fff;
|
34
|
+
border: none;
|
35
|
+
/* border-radius: 10px; */
|
36
|
+
padding: 15px;
|
37
|
+
min-height: 30px;
|
38
|
+
min-width: 120px;
|
39
|
+
font-size: 20px;
|
40
|
+
cursor: pointer;
|
41
|
+
margin-left: 10px;
|
42
|
+
height: 70px;
|
43
|
+
}
|
44
|
+
|
45
|
+
.form-container {
|
46
|
+
width: 100%;
|
47
|
+
display: flex;
|
48
|
+
justify-content: center;
|
49
|
+
justify-content: space-around;
|
50
|
+
}
|
@@ -0,0 +1,170 @@
|
|
1
|
+
import { h } from "@stencil/core";
|
2
|
+
import { CrmBonusService } from "../../services/crmbonus.service";
|
3
|
+
import { StepFormEnum } from "../../contants";
|
4
|
+
export class CrmBonus {
|
5
|
+
constructor() {
|
6
|
+
this.crmBonusService = new CrmBonusService();
|
7
|
+
this.showModal = false;
|
8
|
+
this.userId = undefined;
|
9
|
+
this.storeName = undefined;
|
10
|
+
this.productsInString = undefined;
|
11
|
+
this.cartId = undefined;
|
12
|
+
this.products = undefined;
|
13
|
+
this.customer = {
|
14
|
+
birthDate: "",
|
15
|
+
document: "",
|
16
|
+
name: "",
|
17
|
+
phone: ""
|
18
|
+
};
|
19
|
+
this.loading = false;
|
20
|
+
this.message = undefined;
|
21
|
+
this.phone = undefined;
|
22
|
+
this.canCancel = false;
|
23
|
+
this.sent = undefined;
|
24
|
+
}
|
25
|
+
async componentWillLoad() {
|
26
|
+
await this.handleLoad();
|
27
|
+
}
|
28
|
+
async handleLoad() {
|
29
|
+
try {
|
30
|
+
if (this.userId) {
|
31
|
+
// this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);
|
32
|
+
console.log('user', this.customer);
|
33
|
+
}
|
34
|
+
}
|
35
|
+
catch (error) {
|
36
|
+
console.log('info customer');
|
37
|
+
}
|
38
|
+
this.products = JSON.parse(this.productsInString);
|
39
|
+
}
|
40
|
+
async sendPin(phone) {
|
41
|
+
var _a, _b;
|
42
|
+
this.loading = true;
|
43
|
+
this.message = "";
|
44
|
+
try {
|
45
|
+
const _phone = phone.replace(/\D/g, '');
|
46
|
+
this.phone = Number(_phone);
|
47
|
+
this.sent = await this.crmBonusService.sendPin(this.phone, this.storeName);
|
48
|
+
;
|
49
|
+
await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);
|
50
|
+
this.showModal = true;
|
51
|
+
}
|
52
|
+
catch (error) {
|
53
|
+
this.message = (_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.message;
|
54
|
+
}
|
55
|
+
finally {
|
56
|
+
this.loading = false;
|
57
|
+
}
|
58
|
+
}
|
59
|
+
buildProducts() {
|
60
|
+
return this.products.map(product => ({ sku: product.SKU, value: (product.PrecoPor * product.Quantidade), variantId: product.ProdutoVarianteId, qtd: product.Quantidade }));
|
61
|
+
}
|
62
|
+
handleCloseModal() {
|
63
|
+
this.showModal = false;
|
64
|
+
}
|
65
|
+
save() {
|
66
|
+
localStorage.setItem('@BYCODERS', this.cartId);
|
67
|
+
}
|
68
|
+
render() {
|
69
|
+
return (h("div", { key: '18d08a3d03ae5106cf01a426751db8300847f95c', class: "section-cart-crm" }, h("div", { key: 'dd9e939b78616cea4ea0b77ac32fe15afe63c9f9', class: "container-button" }, !this.canCancel ? h("phone-cancel-input", { value: this.customer.phone, sendPin: () => { }, loading: this.loading })
|
70
|
+
: h("phone-input", { value: this.customer.phone, sendPin: (phone) => { this.sendPin(phone); }, loading: this.loading })), h("app-modal", { key: 'abc596ebac59d08df3470d028ee814768a870ba9', isOpen: this.showModal, modalTitle: `Giftback`, onModalClosed: () => (this.showModal = false) }, h("crm-bonus-form", { key: '6ee857fd75d7261382ef8b9752bb6f3ea7918245', saveStore: () => this.save(), ref: ref => this.crmBonusRef = ref, sent: this.sent, phone: this.phone, cancel: () => this.handleCloseModal(), storeName: this.storeName, products: this.buildProducts(), cartId: this.cartId, customer: this.customer }))));
|
71
|
+
}
|
72
|
+
static get is() { return "crm-bonus"; }
|
73
|
+
static get encapsulation() { return "shadow"; }
|
74
|
+
static get originalStyleUrls() {
|
75
|
+
return {
|
76
|
+
"$": ["crm-bonus.css"]
|
77
|
+
};
|
78
|
+
}
|
79
|
+
static get styleUrls() {
|
80
|
+
return {
|
81
|
+
"$": ["crm-bonus.css"]
|
82
|
+
};
|
83
|
+
}
|
84
|
+
static get assetsDirs() { return ["assets"]; }
|
85
|
+
static get properties() {
|
86
|
+
return {
|
87
|
+
"userId": {
|
88
|
+
"type": "number",
|
89
|
+
"mutable": false,
|
90
|
+
"complexType": {
|
91
|
+
"original": "number",
|
92
|
+
"resolved": "number",
|
93
|
+
"references": {}
|
94
|
+
},
|
95
|
+
"required": false,
|
96
|
+
"optional": false,
|
97
|
+
"docs": {
|
98
|
+
"tags": [],
|
99
|
+
"text": ""
|
100
|
+
},
|
101
|
+
"attribute": "userid",
|
102
|
+
"reflect": false
|
103
|
+
},
|
104
|
+
"storeName": {
|
105
|
+
"type": "any",
|
106
|
+
"mutable": false,
|
107
|
+
"complexType": {
|
108
|
+
"original": "any",
|
109
|
+
"resolved": "any",
|
110
|
+
"references": {}
|
111
|
+
},
|
112
|
+
"required": false,
|
113
|
+
"optional": false,
|
114
|
+
"docs": {
|
115
|
+
"tags": [],
|
116
|
+
"text": ""
|
117
|
+
},
|
118
|
+
"attribute": "storename",
|
119
|
+
"reflect": false
|
120
|
+
},
|
121
|
+
"productsInString": {
|
122
|
+
"type": "string",
|
123
|
+
"mutable": false,
|
124
|
+
"complexType": {
|
125
|
+
"original": "string",
|
126
|
+
"resolved": "string",
|
127
|
+
"references": {}
|
128
|
+
},
|
129
|
+
"required": false,
|
130
|
+
"optional": false,
|
131
|
+
"docs": {
|
132
|
+
"tags": [],
|
133
|
+
"text": ""
|
134
|
+
},
|
135
|
+
"attribute": "products",
|
136
|
+
"reflect": false
|
137
|
+
},
|
138
|
+
"cartId": {
|
139
|
+
"type": "any",
|
140
|
+
"mutable": false,
|
141
|
+
"complexType": {
|
142
|
+
"original": "any",
|
143
|
+
"resolved": "any",
|
144
|
+
"references": {}
|
145
|
+
},
|
146
|
+
"required": false,
|
147
|
+
"optional": false,
|
148
|
+
"docs": {
|
149
|
+
"tags": [],
|
150
|
+
"text": ""
|
151
|
+
},
|
152
|
+
"attribute": "cartid",
|
153
|
+
"reflect": false
|
154
|
+
}
|
155
|
+
};
|
156
|
+
}
|
157
|
+
static get states() {
|
158
|
+
return {
|
159
|
+
"showModal": {},
|
160
|
+
"products": {},
|
161
|
+
"customer": {},
|
162
|
+
"loading": {},
|
163
|
+
"message": {},
|
164
|
+
"phone": {},
|
165
|
+
"canCancel": {},
|
166
|
+
"sent": {}
|
167
|
+
};
|
168
|
+
}
|
169
|
+
}
|
170
|
+
//# sourceMappingURL=crm-bonus.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"crm-bonus.js","sourceRoot":"","sources":["../../../../src/components/crm-bonus/crm-bonus.tsx"],"names":[],"mappings":"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","sourcesContent":["import { Component, Prop, State, h } from '@stencil/core';\nimport { IProduct, IProductWake, ICustomer } from '../../dto/validate.pin.bonus';\nimport { CrmBonusService } from '../../services/crmbonus.service';\nimport { IPinSent } from '../../components';\nimport { StepFormEnum } from '../../contants';\n\n@Component({\n tag: 'crm-bonus',\n styleUrl: 'crm-bonus.css',\n shadow: true,\n assetsDirs: ['assets']\n})\nexport class CrmBonus {\n\n private crmBonusService: CrmBonusService = new CrmBonusService();\n\n private crmBonusRef: HTMLCrmBonusFormElement;\n\n @State() showModal: boolean = false;\n @Prop({ attribute: 'userid' }) userId: number;\n @Prop({ attribute: 'storename' }) storeName;\n @Prop({ attribute: 'products' }) productsInString: string;\n @Prop({ attribute: 'cartid' }) cartId;\n\n @State() products: Array<IProductWake>;\n @State() customer: ICustomer = {\n birthDate: \"\",\n document: \"\",\n name: \"\",\n phone: \"\"\n };\n\n @State() loading: boolean = false;\n @State() message: string;\n @State() phone: number;\n @State() canCancel: boolean = false;\n @State() sent: IPinSent;\n\n async componentWillLoad() {\n await this.handleLoad();\n }\n\n async handleLoad() {\n try {\n if (this.userId) {\n // this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);\n console.log('user', this.customer);\n }\n } catch (error) {\n console.log('info customer')\n }\n this.products = JSON.parse(this.productsInString);\n }\n\n public async sendPin(phone: string) {\n this.loading = true;\n this.message = \"\";\n\n try {\n const _phone = phone.replace(/\\D/g, '');\n this.phone = Number(_phone);\n this.sent = await this.crmBonusService.sendPin(this.phone, this.storeName);;\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);\n this.showModal = true;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n buildProducts(): IProduct[] {\n return this.products.map(product => ({ sku: product.SKU, value: (product.PrecoPor * product.Quantidade), variantId: product.ProdutoVarianteId, qtd: product.Quantidade }))\n }\n\n handleCloseModal() {\n this.showModal = false;\n }\n\n save() {\n localStorage.setItem('@BYCODERS', this.cartId)\n }\n\n render() {\n return (\n <div class=\"section-cart-crm\">\n <div class=\"container-button\">\n {/* <img src={logo} onClick={() => (this.showModal = true)} /> */}\n {\n !this.canCancel ? <phone-cancel-input value={this.customer.phone} sendPin={() => { }} loading={this.loading} /> \n : <phone-input value={this.customer.phone} sendPin={(phone) => { this.sendPin(phone) }} loading={this.loading} />\n }\n \n </div>\n <app-modal\n isOpen={this.showModal}\n modalTitle={`Giftback`}\n onModalClosed={() => (this.showModal = false)}\n >\n <crm-bonus-form saveStore={() => this.save()} ref={ref => this.crmBonusRef = ref} sent={this.sent} phone={this.phone} cancel={() => this.handleCloseModal()} storeName={this.storeName} products={this.buildProducts()} cartId={this.cartId} customer={this.customer} />\n </app-modal>\n </div>\n )\n }\n}\n"]}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
.form-container {
|
2
|
+
width: 100%;
|
3
|
+
display: flex;
|
4
|
+
justify-content: center;
|
5
|
+
justify-content: space-around;
|
6
|
+
}
|
7
|
+
|
8
|
+
.disabled {
|
9
|
+
opacity: 0.6;
|
10
|
+
cursor: not-allowed;
|
11
|
+
}
|
12
|
+
|
13
|
+
.message-error {
|
14
|
+
color: #d11111;
|
15
|
+
font-weight: bold;
|
16
|
+
font-family: Arial;
|
17
|
+
font-size: small;
|
18
|
+
margin-left: 16px;
|
19
|
+
}
|
@@ -0,0 +1,311 @@
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
2
|
+
import { CrmBonusService } from "../../services/crmbonus.service";
|
3
|
+
import { StepFormEnum } from "../../contants";
|
4
|
+
export class CrmBonusForm {
|
5
|
+
constructor() {
|
6
|
+
this.crmBonusService = new CrmBonusService();
|
7
|
+
this.storeName = undefined;
|
8
|
+
this.cartId = undefined;
|
9
|
+
this.products = undefined;
|
10
|
+
this.customer = {
|
11
|
+
phone: "",
|
12
|
+
birthDate: "",
|
13
|
+
document: "",
|
14
|
+
name: ""
|
15
|
+
};
|
16
|
+
this.sent = undefined;
|
17
|
+
this.stepNext = undefined;
|
18
|
+
this.phone = undefined;
|
19
|
+
this.saveStore = undefined;
|
20
|
+
this.cancel = undefined;
|
21
|
+
this.loading = false;
|
22
|
+
this.step = StepFormEnum.STEP_RESERVE;
|
23
|
+
this.message = undefined;
|
24
|
+
this.bonus = undefined;
|
25
|
+
}
|
26
|
+
async setStep(step) {
|
27
|
+
this.step = step;
|
28
|
+
}
|
29
|
+
async validateBonus(pin) {
|
30
|
+
var _a, _b;
|
31
|
+
this.loading = true;
|
32
|
+
this.message = "";
|
33
|
+
const payload = {
|
34
|
+
pin: pin,
|
35
|
+
cellphone: this.phone.toString(),
|
36
|
+
loja_id: this.sent.storeId,
|
37
|
+
user_id: this.sent.userId,
|
38
|
+
cartId: this.cartId,
|
39
|
+
products: this.products
|
40
|
+
};
|
41
|
+
try {
|
42
|
+
this.bonus = await this.crmBonusService.validatePinBonus(payload, this.storeName);
|
43
|
+
console.log('[this.bonus]', this.bonus);
|
44
|
+
this.step = StepFormEnum.STEP_RESERVE;
|
45
|
+
}
|
46
|
+
catch (error) {
|
47
|
+
this.message = (_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.message;
|
48
|
+
}
|
49
|
+
finally {
|
50
|
+
this.loading = false;
|
51
|
+
}
|
52
|
+
console.log('payload', payload);
|
53
|
+
}
|
54
|
+
async reserveApply(amount) {
|
55
|
+
this.loading = true;
|
56
|
+
this.message = "";
|
57
|
+
try {
|
58
|
+
await this.reserve(amount);
|
59
|
+
this.step = StepFormEnum.STEP_APPLY;
|
60
|
+
this.saveStore();
|
61
|
+
}
|
62
|
+
catch (error) {
|
63
|
+
this.message = "ocorreu um error ao solicitar a aplicação do bonus! tente novamente";
|
64
|
+
}
|
65
|
+
finally {
|
66
|
+
this.loading = false;
|
67
|
+
}
|
68
|
+
}
|
69
|
+
async reserve(amount) {
|
70
|
+
await this.crmBonusService.reserve({
|
71
|
+
redeemed_bonus: amount,
|
72
|
+
cart_id: this.cartId,
|
73
|
+
ticket: this.cartId,
|
74
|
+
gross_value: this.bonus.totalValue,
|
75
|
+
}, this.storeName);
|
76
|
+
}
|
77
|
+
handleCancel() {
|
78
|
+
this.step = StepFormEnum.STEP_PHONE;
|
79
|
+
this.cancel();
|
80
|
+
}
|
81
|
+
render() {
|
82
|
+
return (h(Host, { key: '3e21a03b8cb534556026804922838f6162df9e30' }, this.step === StepFormEnum.STEP_PIN && h("giftback-pin", { key: '31b04dde37001453cbf2595505dd9c2520b2252c', cancel: () => this.handleCancel(), sent: this.sent, validate: (data) => this.validateBonus(data), loading: this.loading }), this.step === StepFormEnum.STEP_RESERVE && h("giftback-progress", { key: 'c85dbb4ac66a094d0b5a28b152104c6b202984cf', loading: this.loading, cancel: () => this.handleCancel(), bonus: this.bonus, reserve: (amountRedeemed) => this.reserveApply(amountRedeemed) }), this.step === StepFormEnum.STEP_APPLY && h("giftback-finish", { key: '4efa471bb962b48cae34b1c5ebfed518afd3ac31' }), h("p", { key: '5cce361016e738b76353e16a0d61f08b4abe22fc', class: "message-error" }, this.message)));
|
83
|
+
}
|
84
|
+
static get is() { return "crm-bonus-form"; }
|
85
|
+
static get encapsulation() { return "shadow"; }
|
86
|
+
static get originalStyleUrls() {
|
87
|
+
return {
|
88
|
+
"$": ["crm-bonus-form.css"]
|
89
|
+
};
|
90
|
+
}
|
91
|
+
static get styleUrls() {
|
92
|
+
return {
|
93
|
+
"$": ["crm-bonus-form.css"]
|
94
|
+
};
|
95
|
+
}
|
96
|
+
static get properties() {
|
97
|
+
return {
|
98
|
+
"storeName": {
|
99
|
+
"type": "any",
|
100
|
+
"mutable": false,
|
101
|
+
"complexType": {
|
102
|
+
"original": "any",
|
103
|
+
"resolved": "any",
|
104
|
+
"references": {}
|
105
|
+
},
|
106
|
+
"required": false,
|
107
|
+
"optional": false,
|
108
|
+
"docs": {
|
109
|
+
"tags": [],
|
110
|
+
"text": ""
|
111
|
+
},
|
112
|
+
"attribute": "storename",
|
113
|
+
"reflect": false
|
114
|
+
},
|
115
|
+
"cartId": {
|
116
|
+
"type": "any",
|
117
|
+
"mutable": false,
|
118
|
+
"complexType": {
|
119
|
+
"original": "any",
|
120
|
+
"resolved": "any",
|
121
|
+
"references": {}
|
122
|
+
},
|
123
|
+
"required": false,
|
124
|
+
"optional": false,
|
125
|
+
"docs": {
|
126
|
+
"tags": [],
|
127
|
+
"text": ""
|
128
|
+
},
|
129
|
+
"attribute": "cart-id",
|
130
|
+
"reflect": false
|
131
|
+
},
|
132
|
+
"products": {
|
133
|
+
"type": "unknown",
|
134
|
+
"mutable": false,
|
135
|
+
"complexType": {
|
136
|
+
"original": "Array<IProduct>",
|
137
|
+
"resolved": "IProduct[]",
|
138
|
+
"references": {
|
139
|
+
"Array": {
|
140
|
+
"location": "global",
|
141
|
+
"id": "global::Array"
|
142
|
+
},
|
143
|
+
"IProduct": {
|
144
|
+
"location": "import",
|
145
|
+
"path": "../../dto/validate.pin.bonus",
|
146
|
+
"id": "src/dto/validate.pin.bonus.ts::IProduct"
|
147
|
+
}
|
148
|
+
}
|
149
|
+
},
|
150
|
+
"required": false,
|
151
|
+
"optional": false,
|
152
|
+
"docs": {
|
153
|
+
"tags": [],
|
154
|
+
"text": ""
|
155
|
+
}
|
156
|
+
},
|
157
|
+
"customer": {
|
158
|
+
"type": "unknown",
|
159
|
+
"mutable": false,
|
160
|
+
"complexType": {
|
161
|
+
"original": "ICustomer",
|
162
|
+
"resolved": "ICustomer",
|
163
|
+
"references": {
|
164
|
+
"ICustomer": {
|
165
|
+
"location": "import",
|
166
|
+
"path": "../../dto/validate.pin.bonus",
|
167
|
+
"id": "src/dto/validate.pin.bonus.ts::ICustomer"
|
168
|
+
}
|
169
|
+
}
|
170
|
+
},
|
171
|
+
"required": false,
|
172
|
+
"optional": false,
|
173
|
+
"docs": {
|
174
|
+
"tags": [],
|
175
|
+
"text": ""
|
176
|
+
},
|
177
|
+
"defaultValue": "{\n phone: \"\",\n birthDate: \"\",\n document: \"\",\n name: \"\"\n }"
|
178
|
+
},
|
179
|
+
"sent": {
|
180
|
+
"type": "unknown",
|
181
|
+
"mutable": false,
|
182
|
+
"complexType": {
|
183
|
+
"original": "IPinSent",
|
184
|
+
"resolved": "IPinSent",
|
185
|
+
"references": {
|
186
|
+
"IPinSent": {
|
187
|
+
"location": "import",
|
188
|
+
"path": "../../dto/pin.sent",
|
189
|
+
"id": "src/dto/pin.sent.ts::IPinSent"
|
190
|
+
}
|
191
|
+
}
|
192
|
+
},
|
193
|
+
"required": false,
|
194
|
+
"optional": false,
|
195
|
+
"docs": {
|
196
|
+
"tags": [],
|
197
|
+
"text": ""
|
198
|
+
}
|
199
|
+
},
|
200
|
+
"stepNext": {
|
201
|
+
"type": "number",
|
202
|
+
"mutable": false,
|
203
|
+
"complexType": {
|
204
|
+
"original": "StepFormEnum",
|
205
|
+
"resolved": "StepFormEnum.STEP_APPLY | StepFormEnum.STEP_PHONE | StepFormEnum.STEP_PIN | StepFormEnum.STEP_RESERVE",
|
206
|
+
"references": {
|
207
|
+
"StepFormEnum": {
|
208
|
+
"location": "import",
|
209
|
+
"path": "../../contants",
|
210
|
+
"id": "src/contants/index.ts::StepFormEnum"
|
211
|
+
}
|
212
|
+
}
|
213
|
+
},
|
214
|
+
"required": false,
|
215
|
+
"optional": false,
|
216
|
+
"docs": {
|
217
|
+
"tags": [],
|
218
|
+
"text": ""
|
219
|
+
},
|
220
|
+
"attribute": "step-next",
|
221
|
+
"reflect": false
|
222
|
+
},
|
223
|
+
"phone": {
|
224
|
+
"type": "number",
|
225
|
+
"mutable": false,
|
226
|
+
"complexType": {
|
227
|
+
"original": "number",
|
228
|
+
"resolved": "number",
|
229
|
+
"references": {}
|
230
|
+
},
|
231
|
+
"required": false,
|
232
|
+
"optional": false,
|
233
|
+
"docs": {
|
234
|
+
"tags": [],
|
235
|
+
"text": ""
|
236
|
+
},
|
237
|
+
"attribute": "phone",
|
238
|
+
"reflect": false
|
239
|
+
},
|
240
|
+
"saveStore": {
|
241
|
+
"type": "unknown",
|
242
|
+
"mutable": false,
|
243
|
+
"complexType": {
|
244
|
+
"original": "() => void",
|
245
|
+
"resolved": "() => void",
|
246
|
+
"references": {}
|
247
|
+
},
|
248
|
+
"required": false,
|
249
|
+
"optional": false,
|
250
|
+
"docs": {
|
251
|
+
"tags": [],
|
252
|
+
"text": ""
|
253
|
+
}
|
254
|
+
},
|
255
|
+
"cancel": {
|
256
|
+
"type": "unknown",
|
257
|
+
"mutable": false,
|
258
|
+
"complexType": {
|
259
|
+
"original": "() => void",
|
260
|
+
"resolved": "() => void",
|
261
|
+
"references": {}
|
262
|
+
},
|
263
|
+
"required": false,
|
264
|
+
"optional": false,
|
265
|
+
"docs": {
|
266
|
+
"tags": [],
|
267
|
+
"text": ""
|
268
|
+
}
|
269
|
+
}
|
270
|
+
};
|
271
|
+
}
|
272
|
+
static get states() {
|
273
|
+
return {
|
274
|
+
"loading": {},
|
275
|
+
"step": {},
|
276
|
+
"message": {},
|
277
|
+
"bonus": {}
|
278
|
+
};
|
279
|
+
}
|
280
|
+
static get methods() {
|
281
|
+
return {
|
282
|
+
"setStep": {
|
283
|
+
"complexType": {
|
284
|
+
"signature": "(step: StepFormEnum) => Promise<void>",
|
285
|
+
"parameters": [{
|
286
|
+
"name": "step",
|
287
|
+
"type": "StepFormEnum",
|
288
|
+
"docs": ""
|
289
|
+
}],
|
290
|
+
"references": {
|
291
|
+
"Promise": {
|
292
|
+
"location": "global",
|
293
|
+
"id": "global::Promise"
|
294
|
+
},
|
295
|
+
"StepFormEnum": {
|
296
|
+
"location": "import",
|
297
|
+
"path": "../../contants",
|
298
|
+
"id": "src/contants/index.ts::StepFormEnum"
|
299
|
+
}
|
300
|
+
},
|
301
|
+
"return": "Promise<void>"
|
302
|
+
},
|
303
|
+
"docs": {
|
304
|
+
"text": "",
|
305
|
+
"tags": []
|
306
|
+
}
|
307
|
+
}
|
308
|
+
};
|
309
|
+
}
|
310
|
+
}
|
311
|
+
//# sourceMappingURL=crm-bonus-form.js.map
|