crmbonus-component-wake 0.0.13 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/loading-spinner.d.ts +11 -0
- package/dist/components/pedido-finalizado.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 +72 -3861
- package/dist/crmbonus-component-wake/crm-bonus-form.entry.js.map +1 -1
- package/dist/crmbonus-component-wake/crm-bonus.entry.js +6 -2
- 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/crmbonus.service-134e7b0c.js +3863 -0
- package/dist/crmbonus-component-wake/crmbonus.service-134e7b0c.js.map +1 -0
- package/dist/crmbonus-component-wake/crmbonus.service-756d754d.js +3863 -0
- package/dist/crmbonus-component-wake/crmbonus.service-756d754d.js.map +1 -0
- package/dist/crmbonus-component-wake/giftback-pin.entry.js +3 -5
- package/dist/crmbonus-component-wake/giftback-pin.entry.js.map +1 -1
- package/dist/crmbonus-component-wake/giftback-progress.entry.js +21 -8
- package/dist/crmbonus-component-wake/giftback-progress.entry.js.map +1 -1
- package/dist/crmbonus-component-wake/{index-9ebfa0b2.js → index-b9a7a992.js} +2 -2
- package/dist/crmbonus-component-wake/{index-9ebfa0b2.js.map → index-b9a7a992.js.map} +1 -1
- package/dist/crmbonus-component-wake/loading-spinner.entry.js +19 -0
- package/dist/crmbonus-component-wake/loading-spinner.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/pedido-finalizado.entry.js +18 -0
- package/dist/crmbonus-component-wake/pedido-finalizado.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/phone-input-mask.entry.js +2 -2
- package/dist/crmbonus-component-wake/phone-input.entry.js +2 -2
- package/dist/crmbonus-component-wake/phone-input.entry.js.map +1 -1
- package/dist/types/components/crm-bonus/crm-bonus.d.ts +4 -1
- package/dist/types/components/crm-bonus-form/crm-bonus-form.d.ts +8 -2
- package/dist/types/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.d.ts +1 -1
- package/dist/types/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.d.ts +6 -3
- package/dist/types/components/loading-spinner/loading-spinner.d.ts +5 -0
- package/dist/types/components/pedido/pedido.d.ts +4 -0
- package/dist/types/components.d.ts +48 -8
- package/dist/types/contants/index.d.ts +5 -0
- package/dist/types/contants/mocks.d.ts +4 -0
- package/dist/types/dto/validate.pin.bonus.d.ts +44 -6
- package/dist/types/home/darlison/Projects/crmbonus/crmbonus-component-wake/.stencil/env.d.ts +1 -1
- package/dist/types/services/crmbonus.service.d.ts +4 -1
- package/package.json +1 -1
- package/dist/crmbonus-component-wake/index-71c2c4ae.js +0 -3039
- package/dist/crmbonus-component-wake/index-71c2c4ae.js.map +0 -1
@@ -1,22 +1,35 @@
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
1
|
+
import { r as registerInstance, h } from './index-b9a7a992.js';
|
2
2
|
|
3
|
-
const giftbackProgressCss = ":host{display:flex;font-family:Arial, sans-serif;border-radius:10px;padding:16px;max-width:100%;flex-direction:column}.giftback-container{display:flex;flex-direction:column}.giftback-container p{font-size:medium}h3{margin:0 0 10px;font-size:18px}p{margin:5px 0;font-size:14px}.validity{font-size:12px;color:#888}.progress-container{display:flex;align-items:center;margin:10px 0}progress-container span{font-size:12px;color:#666}input[type='range']{flex:1;margin:0 10px;appearance:none;background-color:#ccc;height:6px;border-radius:3px;outline:none;cursor:pointer}input[type='range']::-webkit-slider-thumb{appearance:none;width:14px;height:14px;border-radius:50%;background-color:#555;cursor:pointer}.remaining{font-weight:bold;font-size:14px;color:#333}";
|
3
|
+
const giftbackProgressCss = ":host{display:flex;font-family:Arial, sans-serif;border-radius:10px;padding:16px;max-width:100%;flex-direction:column}.giftback-container{display:flex;flex-direction:column}.giftback-container p{font-size:medium}h3{margin:0 0 10px;font-size:18px}p{margin:5px 0;font-size:14px}.validity{font-size:12px;color:#888}.progress-container{display:flex;align-items:center;margin:10px 0}progress-container span{font-size:12px;color:#666}input[type='range']{flex:1;margin:0 10px;appearance:none;background-color:#ccc;height:6px;border-radius:3px;outline:none;cursor:pointer}input[type='range']::-webkit-slider-thumb{appearance:none;width:14px;height:14px;border-radius:50%;background-color:#555;cursor:pointer}.remaining{font-weight:bold;font-size:14px;color:#333}.button{top:50%;background-color:#6c6c7e;color:#fff;border:none;border-radius:10px;padding:10px;min-height:30px;min-width:120px;font-size:19px;cursor:pointer}.disabled{opacity:0.6;cursor:not-allowed}.footer-button-giftback{display:flex;justify-content:end;margin-top:14px}";
|
4
4
|
|
5
5
|
const GiftbackProgress = class {
|
6
6
|
constructor(hostRef) {
|
7
7
|
registerInstance(this, hostRef);
|
8
|
-
this.
|
9
|
-
this.
|
10
|
-
this.
|
11
|
-
|
8
|
+
this.usedValue = 0;
|
9
|
+
this.loading = false;
|
10
|
+
this.bonus = {
|
11
|
+
totalBonus: 0,
|
12
|
+
cartId: "",
|
13
|
+
minimumPurchase: 0,
|
14
|
+
bonusBalance: 0,
|
15
|
+
calculatedValue: 0,
|
16
|
+
firstValidityDate: ""
|
17
|
+
};
|
18
|
+
this.reserve = undefined;
|
19
|
+
}
|
20
|
+
componentWillLoad() {
|
21
|
+
this.usedValue = parseFloat(this.bonus.bonusBalance.toString());
|
12
22
|
}
|
13
23
|
handleSliderChange(event) {
|
14
24
|
const input = event.target;
|
15
25
|
this.usedValue = parseFloat(input.value);
|
16
26
|
}
|
27
|
+
async handleReserve() {
|
28
|
+
this.reserve(this.usedValue);
|
29
|
+
}
|
17
30
|
render() {
|
18
|
-
const remainingGiftback = this.
|
19
|
-
return (h("div", { key: '
|
31
|
+
const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;
|
32
|
+
return (h("div", { key: '8dcfbdb324c4f27542aaf93ed0baa46dd6276796', class: "giftback-container" }, h("p", { key: '2c2074cb4a2612493315e9d876faa49f206ba972' }, "Voc\u00EA possui at\u00E9 ", h("strong", { key: '94d3397276e48d69b01ac14408dd34abbfdcae23' }, "R$ ", this.bonus.totalBonus.toFixed(2)), " de Giftback nessa compra!"), h("p", { key: '8a1c18efc43784d3787f5d0d693e274d384af08f', class: "validity" }, "V\u00E1lido at\u00E9: ", this.bonus.firstValidityDate), h("p", { key: '77bedaa9587fa92598eb4192b9c5e66536223ffe' }, "Voc\u00EA est\u00E1 utilizando ", h("strong", { key: 'c0561fe0190a8a8193f98b51154366f5e9ae84c4' }, "R$ ", this.usedValue.toFixed(2)), " nessa compra"), h("div", { key: 'eb14f8c9cdf1e360a6e26f1dfdc0a667de8ca9b4', class: "progress-container" }, h("span", { key: '33754059c390e8d529a1f630466447763f67ecc0' }, "R$ 0"), h("input", { key: 'a6fe1cbaf8b4e1778c1aa644c6cec738c483ca16', type: "range", min: "0", step: "0.01", max: this.bonus.totalBonus, value: this.usedValue, onInput: (event) => this.handleSliderChange(event) }), h("span", { key: '2414629fe478f624e6e0c6803e4ec4b77e9c922b' }, "R$ ", this.bonus.totalBonus.toFixed(2))), h("p", { key: '90e0cadb6044f3d4b9436ca7149508e1ea53e8f6', class: "remaining" }, "Faltam ", h("strong", { key: '6dbe9c683e6cee7665ccbb01ccc9fb45a3522bf8' }, "R$ ", remainingGiftback > 0 ? remainingGiftback.toFixed(2) : Number(0).toFixed(2)), " para utilizar o valor total do Giftback."), h("div", { key: 'f47d2694b2a699d8ddbd8a621ca9925a9d5e04eb', class: "footer-button-giftback" }, h("button", { key: 'b9569078702a67f78a31b70a39ac5c24decd6c4a', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.handleReserve() }, !this.loading ? "Aplicar" : h("loading-spinner", { size: "10px", color: "#fff" })))));
|
20
33
|
}
|
21
34
|
};
|
22
35
|
GiftbackProgress.style = giftbackProgressCss;
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"giftback-progress.entry.esm.js","mappings":";;AAAA,MAAM,mBAAmB,GAAG,
|
1
|
+
{"file":"giftback-progress.entry.esm.js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OAAO,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,GACpD,EACF,sEAAU,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAQ,CAChD,EAEN,0DAAG,KAAK,EAAC,WAAW,eACT,wEAAa,iBAAiB,GAAG,CAAC,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,GAAE,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAU,8CACxG,EAEJ,4DAAK,KAAK,EAAC,wBAAwB,IAC/B,+DAAQ,KAAK,EAAE,UAAU,IAAI,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,aAAa,EAAE,IAE/G,CAAC,IAAI,CAAC,OAAO,GAAG,SAAS,GAAG,uBAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAEvE,CACP,CACJ,EACR;KACL;;;;;;","names":[],"sources":["src/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css?tag=giftback-progress&encapsulation=shadow","src/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.tsx"],"sourcesContent":[":host {\n display: flex;\n font-family: Arial, sans-serif;\n /* background-color: #f8f4eb; */\n border-radius: 10px;\n padding: 16px;\n /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */\n max-width: 100%;\n flex-direction: column;\n}\n\n.giftback-container {\n display: flex;\n flex-direction: column;\n}\n\n.giftback-container p {\n font-size: medium;\n}\n\nh3 {\n margin: 0 0 10px;\n font-size: 18px;\n}\n\np {\n margin: 5px 0;\n font-size: 14px;\n}\n\n.validity {\n font-size: 12px;\n color: #888;\n}\n\n.progress-container {\n display: flex;\n align-items: center;\n margin: 10px 0;\n}\n\nprogress-container span {\n font-size: 12px;\n color: #666;\n}\n\ninput[type='range'] {\n flex: 1;\n margin: 0 10px;\n appearance: none;\n background-color: #ccc;\n height: 6px;\n border-radius: 3px;\n outline: none;\n cursor: pointer;\n}\n\ninput[type='range']::-webkit-slider-thumb {\n appearance: none;\n width: 14px;\n height: 14px;\n border-radius: 50%;\n background-color: #555;\n cursor: pointer;\n}\n\n.remaining {\n font-weight: bold;\n font-size: 14px;\n color: #333;\n}\n\n.button {\n top: 50%;\n background-color: #6c6c7e;\n color: #fff;\n border: none;\n border-radius: 10px;\n padding: 10px;\n min-height: 30px;\n min-width: 120px;\n font-size: 19px;\n cursor: pointer;\n}\n\n.disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n.footer-button-giftback {\n display: flex;\n justify-content: end;\n margin-top: 14px;\n}","import { Component, h, State, Prop } from '@stencil/core';\nimport { IBonus } from '../../../../dto/validate.pin.bonus';\n\n@Component({\n tag: 'giftback-progress',\n styleUrl: 'giftback-progress.css',\n shadow: true,\n})\nexport class GiftbackProgress {\n // @Prop() maxValue: number = 50; // Valor máximo de Giftback permitido na compra\n // @Prop() totalGiftback: number = 300; // Valor total disponível de Giftback\n // @Prop() validityDate: string = '30/10/2024'; // Data de validade\n\n @State() usedValue: number = 0; // Valor inicial de Giftback utilizado\n\n @Prop() loading: boolean = false;\n\n @Prop() bonus: Partial<IBonus> = {\n totalBonus: 0,\n cartId: \"\",\n minimumPurchase: 0,\n bonusBalance: 0,\n calculatedValue: 0,\n firstValidityDate: \"\"\n };\n\n @Prop() reserve: (amountRedeemed: number) => void;\n\n componentWillLoad() {\n this.usedValue = parseFloat(this.bonus.bonusBalance.toString());\n }\n\n handleSliderChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.usedValue = parseFloat(input.value);\n }\n\n async handleReserve() {\n this.reserve(this.usedValue);\n }\n\n render() {\n const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;\n\n return (\n <div class=\"giftback-container\">\n <p>\n Você possui até <strong>R$ {this.bonus.totalBonus.toFixed(2)}</strong> de Giftback nessa compra!\n </p>\n <p class=\"validity\">Válido até: {this.bonus.firstValidityDate}</p>\n\n <p>Você está utilizando <strong>R$ {this.usedValue.toFixed(2)}</strong> nessa compra</p>\n\n <div class=\"progress-container\">\n <span>R$ 0</span>\n <input\n type=\"range\"\n min=\"0\"\n step=\"0.01\"\n max={this.bonus.totalBonus}\n value={this.usedValue}\n onInput={(event) => this.handleSliderChange(event)}\n />\n <span>R$ {this.bonus.totalBonus.toFixed(2)}</span>\n </div>\n\n <p class=\"remaining\">\n Faltam <strong>R$ { remainingGiftback > 0 ? remainingGiftback.toFixed(2): Number(0).toFixed(2)}</strong> para utilizar o valor total do Giftback.\n </p>\n\n <div class=\"footer-button-giftback\">\n <button class={`button ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.handleReserve()}>\n {\n !this.loading ? \"Aplicar\" : <loading-spinner size=\"10px\" color=\"#fff\" />\n }\n </button>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
const NAMESPACE = 'crmbonus-component-wake';
|
2
|
-
const BUILD = /* crmbonus-component-wake */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: false, cssAnnotations: true, devTools: true, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: true, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: true, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, observeAttribute: true, profile: true, prop: true, propBoolean: true, propMutable: false, propNumber:
|
2
|
+
const BUILD = /* crmbonus-component-wake */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: false, cssAnnotations: true, devTools: true, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: true, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: true, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, observeAttribute: true, profile: true, prop: true, propBoolean: true, propMutable: false, propNumber: false, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: false };
|
3
3
|
const Env = /* crmbonus-component-wake */ {};
|
4
4
|
|
5
5
|
/*
|
@@ -3036,4 +3036,4 @@ var insertChildVNodeAnnotations = (doc2, vnodeChild, cmpData, hostId, depth, ind
|
|
3036
3036
|
|
3037
3037
|
export { BUILD as B, H, NAMESPACE as N, createEvent as a, bootstrapLazy as b, consoleDevInfo as c, doc as d, Host as e, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
3038
3038
|
|
3039
|
-
//# sourceMappingURL=index-
|
3039
|
+
//# sourceMappingURL=index-b9a7a992.js.map
|