crmbonus-component-wake 0.0.12 → 0.0.14
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 +71 -3861
- package/dist/crmbonus-component-wake/crm-bonus-form.entry.js.map +1 -1
- package/dist/crmbonus-component-wake/crm-bonus.entry.js +11 -3
- package/dist/crmbonus-component-wake/crm-bonus.entry.js.map +1 -1
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +3 -3
- package/dist/crmbonus-component-wake/crmbonus.service-134e7b0c.js +3863 -0
- package/dist/crmbonus-component-wake/crmbonus.service-134e7b0c.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-71c2c4ae.js → index-b9a7a992.js} +2 -2
- package/dist/crmbonus-component-wake/{index-71c2c4ae.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 +6 -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 +50 -10
- 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 +42 -6
- package/dist/types/services/crmbonus.service.d.ts +4 -1
- package/package.json +1 -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 = this.bonus.bonusBalance;
|
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.calculatedValue - this.bonus.totalValue;
|
32
|
+
return (h("div", { key: '04c3fff59f504b83f23255f6d03f80f363b96244', class: "giftback-container" }, h("p", { key: '89aa742ab8c386f20cec944b7091b939445c128a' }, "Voc\u00EA possui at\u00E9 ", h("strong", { key: 'ad36d1554af1a87c7079f45473b17e61ec214acf' }, "R$ ", this.bonus.totalBonus.toFixed(2)), " de Giftback nessa compra!"), h("p", { key: '7ff32bbb1fbe1117d564e95a23753a50f8cdcfe5', class: "validity" }, "V\u00E1lido at\u00E9: ", this.bonus.firstValidityDate), h("p", { key: 'e8c6c7a54941efcc4c4f7c521f9b589a2f198937' }, "Voc\u00EA est\u00E1 utilizando ", h("strong", { key: '4d49e00aa771761ff52b8a893d659c597bc3b13a' }, "R$ ", this.usedValue.toFixed(2)), " nessa compra"), h("div", { key: 'd0819f934affc37f1dfaad46bdc9368c500c7450', class: "progress-container" }, h("span", { key: 'f37dd1a68694930816f016fe19daee5bd2434773' }, "R$ 0"), h("input", { key: '736875b93eda7f2624b126a68e2e25435a723a47', disabled: true, type: "range", min: "0", max: this.bonus.totalBonus, value: this.usedValue, onInput: (event) => this.handleSliderChange(event) }), h("span", { key: '505fa0519ef4f9966df67f3a26f047df9d90b061' }, "R$ ", this.bonus.totalBonus.toFixed(2))), h("p", { key: '609ac9e378fb9294cada5d7c60a56255f7051ef9', class: "remaining" }, "Faltam ", h("strong", { key: '74e3a9f1f43bd55360ef74c76c35532ce402f5b8' }, "R$ ", remainingGiftback.toFixed(2)), " para utilizar o valor total do Giftback."), h("div", { key: '7f28bb6a5eaff1c04badfa7448f1b5330380b777', class: "footer-button-giftback" }, h("button", { key: 'a66d912787d5eeefdade835deda0c7fdbc08d77d', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => { this.loading = !this.loading; } }, !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","mappings":";;AAAA,MAAM,mBAAmB,GAAG,ogCAAogC;;MCQnhC,gBAAgB;;;yBAKI,CAAC;uBAEH,KAAK;qBAEC;YAC7B,UAAU,EAAE,CAAC;YACb,MAAM,EAAE,EAAE;YACV,eAAe,EAAE,CAAC;YAClB,YAAY,EAAE,CAAC;YACf,eAAe,EAAE,CAAC;YAClB,iBAAiB,EAAE,EAAE;SACxB;;;IAID,iBAAiB;QACb,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK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G,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAA,EAAE,IAE3H,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 = this.bonus.bonusBalance;\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.calculatedValue - 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 disabled\n type=\"range\"\n min=\"0\"\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.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.loading = !this.loading }}>\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:
|
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
|