cloudcommerce 0.3.0 → 0.4.1
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/CHANGELOG.md +40 -0
- package/package.json +8 -8
- package/packages/api/package.json +1 -1
- package/packages/apps/correios/package.json +2 -2
- package/packages/apps/custom-payment/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/datafrete/package.json +3 -3
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/emails/package.json +1 -1
- package/packages/apps/fb-conversions/package.json +2 -2
- package/packages/apps/frenet/package.json +3 -3
- package/packages/apps/galaxpay/package.json +3 -3
- package/packages/apps/google-analytics/package.json +3 -3
- package/packages/apps/infinitepay/lib/ip-create-transaction.js +1 -1
- package/packages/apps/infinitepay/lib/ip-create-transaction.js.map +1 -1
- package/packages/apps/infinitepay/package.json +3 -3
- package/packages/apps/infinitepay/src/ip-create-transaction.ts +1 -1
- package/packages/apps/jadlog/package.json +2 -2
- package/packages/apps/loyalty-points/package.json +1 -1
- package/packages/apps/melhor-envio/package.json +3 -3
- package/packages/apps/mercadopago/package.json +3 -3
- package/packages/apps/pagarme/package.json +3 -3
- package/packages/apps/paghiper/package.json +3 -3
- package/packages/apps/pix/package.json +3 -3
- package/packages/apps/tiny-erp/package.json +3 -3
- package/packages/apps/webhooks/CHANGELOG.md +1 -0
- package/packages/apps/webhooks/README.md +1 -0
- package/packages/apps/webhooks/lib/app-webhooks.js +9 -0
- package/packages/apps/webhooks/lib/app-webhooks.js.map +1 -0
- package/packages/apps/webhooks/lib/events-to-webhooks-app.js +127 -0
- package/packages/apps/webhooks/lib/events-to-webhooks-app.js.map +1 -0
- package/packages/apps/webhooks/lib/index.js +2 -0
- package/packages/apps/webhooks/lib/index.js.map +1 -0
- package/packages/apps/webhooks/package.json +32 -0
- package/packages/apps/webhooks/src/app-webhooks.ts +14 -0
- package/packages/apps/webhooks/src/events-to-webhooks-app.ts +178 -0
- package/packages/apps/webhooks/src/index.ts +1 -0
- package/packages/apps/webhooks/tsconfig.json +3 -0
- package/packages/cli/lib/setup-gcloud.js +120 -20
- package/packages/cli/package.json +1 -1
- package/packages/cli/src/cli.ts +1 -1
- package/packages/cli/src/setup-gcloud.ts +146 -21
- package/packages/config/package.json +1 -1
- package/packages/emails/package.json +2 -2
- package/packages/emails/tests/assets/order.json +1 -1
- package/packages/events/lib/firebase.js +2 -0
- package/packages/events/lib/firebase.js.map +1 -1
- package/packages/events/package.json +3 -2
- package/packages/events/src/firebase.ts +2 -0
- package/packages/firebase/lib/config.d.ts +4 -0
- package/packages/firebase/lib/config.js +10 -1
- package/packages/firebase/lib/config.js.map +1 -1
- package/packages/firebase/lib/handlers/check-store-events.js +13 -4
- package/packages/firebase/lib/handlers/check-store-events.js.map +1 -1
- package/packages/firebase/package.json +2 -2
- package/packages/firebase/src/config.ts +10 -7
- package/packages/firebase/src/handlers/check-store-events.ts +14 -4
- package/packages/i18n/package.json +1 -1
- package/packages/modules/lib/firebase/checkout.js +4 -4
- package/packages/modules/lib/firebase/checkout.js.map +1 -1
- package/packages/modules/package.json +3 -3
- package/packages/modules/schemas/@checkout.cjs +0 -5
- package/packages/modules/schemas/create_transaction.cjs +6 -1
- package/packages/modules/src/firebase/checkout.ts +4 -4
- package/packages/passport/package.json +2 -2
- package/packages/ssr/package.json +7 -7
- package/packages/storefront/dist/client/_astro/PitchBar.004b6ea4.js +1 -0
- package/packages/storefront/dist/client/_astro/Prices.f311909a.js +1 -0
- package/packages/storefront/dist/client/_astro/Prices.vue_vue_type_script_setup_true_lang.ef47de70.js +1 -0
- package/packages/storefront/dist/client/_astro/ProductCard.34de5097.js +1 -0
- package/packages/storefront/dist/client/_astro/ShopHeader.cbfee289.js +1 -0
- package/packages/storefront/dist/client/_astro/{_...slug_.32968ccf.css → _...slug_.bcc33d9d.css} +1 -1
- package/packages/storefront/dist/client/_astro/{client.5a46cc02.js → client.56d86c9b.js} +1 -1
- package/packages/storefront/dist/client/_astro/index.0c833781.css +1 -0
- package/packages/storefront/dist/client/_astro/index.2d12be6c.js +1 -0
- package/packages/storefront/dist/client/_astro/{modules-info.d9373e21.js → modules-info.0debb0b0.js} +1 -1
- package/packages/storefront/dist/client/_astro/runtime-core.esm-bundler.a0432a8e.js +1 -0
- package/packages/storefront/dist/client/_astro/{runtime-dom.esm-bundler.00313542.js → runtime-dom.esm-bundler.0e5774ce.js} +1 -1
- package/packages/storefront/dist/client/fallback/index.html +10 -10
- package/packages/storefront/dist/client/sw.js +1 -1
- package/packages/storefront/dist/server/chunks/{astro.89bd9221.mjs → astro.0f5b754a.mjs} +871 -826
- package/packages/storefront/dist/server/chunks/pages/{all.23de4e5c.mjs → all.671e6bc1.mjs} +367 -466
- package/packages/storefront/dist/server/chunks/{prerender.f40361a3.mjs → prerender.fd8cdc24.mjs} +0 -0
- package/packages/storefront/dist/server/entry.mjs +20 -12
- package/packages/storefront/package.json +11 -11
- package/packages/storefront/src/lib/components/Drawer.vue +48 -45
- package/packages/storefront/src/lib/components/ProductCard.vue +1 -1
- package/packages/storefront/src/lib/components/ShopHeader.vue +42 -13
- package/packages/storefront/src/lib/components/ShopSidenav.vue +26 -0
- package/packages/storefront/src/lib/composables/use-pitch-bar.ts +27 -0
- package/packages/storefront/src/lib/composables/use-sticky-header.ts +111 -0
- package/packages/storefront/src/lib/layouts/BaseBody.astro +3 -1
- package/packages/storefront/src/lib/layouts/PagesHeader.astro +16 -25
- package/packages/types/index.ts +1 -0
- package/packages/types/modules/@checkout:params.d.ts +1 -5
- package/packages/types/modules/apply_discount:params.d.ts +1 -1
- package/packages/types/modules/apply_discount:response.d.ts +1 -1
- package/packages/types/modules/calculate_shipping:params.d.ts +1 -1
- package/packages/types/modules/calculate_shipping:response.d.ts +1 -1
- package/packages/types/modules/create_transaction:params.d.ts +6 -2
- package/packages/types/modules/create_transaction:response.d.ts +1 -1
- package/packages/types/modules/list_payments:params.d.ts +1 -1
- package/packages/types/modules/list_payments:response.d.ts +1 -1
- package/packages/types/package.json +1 -1
- package/packages/storefront/dist/client/_astro/PitchBar.209c6645.js +0 -1
- package/packages/storefront/dist/client/_astro/Prices.6fbcb5ac.js +0 -1
- package/packages/storefront/dist/client/_astro/Prices.vue_vue_type_script_setup_true_lang.44f23680.js +0 -1
- package/packages/storefront/dist/client/_astro/ProductCard.ee5eee91.js +0 -1
- package/packages/storefront/dist/client/_astro/ShopHeader.b801c785.js +0 -1
- package/packages/storefront/dist/client/_astro/index.844a4059.js +0 -1
- package/packages/storefront/dist/client/_astro/index.90df622b.css +0 -1
- package/packages/storefront/dist/client/_astro/runtime-core.esm-bundler.f04cee62.js +0 -1
- package/packages/storefront/dist/client/_astro/use-component-variant.58788b6e.js +0 -1
- package/packages/storefront/src/lib/components/PitchBar.vue +0 -66
- package/packages/storefront/src/lib/components/Prices.vue +0 -176
- package/packages/storefront/src/lib/components/StickyHeader.vue +0 -84
- package/packages/storefront/src/lib/composables/use-component-variant.ts +0 -17
|
@@ -9,11 +9,10 @@ import 'node:os';
|
|
|
9
9
|
import sizeOf from 'image-size';
|
|
10
10
|
import 'magic-string';
|
|
11
11
|
import 'node:stream';
|
|
12
|
-
import '
|
|
13
|
-
import { c as createAstro, a as createComponent, r as renderTemplate, b as addAttribute, d as renderComponent, u as unescapeHTML, F as Fragment, m as maybeRenderHead, e as renderSlot, f as renderHead, s as spreadAttributes } from '../astro.89bd9221.mjs';
|
|
12
|
+
import { c as createAstro, a as createComponent, r as renderTemplate, b as addAttribute, d as renderComponent, u as unescapeHTML, F as Fragment, m as maybeRenderHead, e as renderSlot, f as renderHead, s as spreadAttributes } from '../astro.0f5b754a.mjs';
|
|
14
13
|
import api from '@cloudcommerce/api';
|
|
15
|
-
import { reactive, computed, defineComponent, inject, mergeProps, useSSRContext, ref, watch, toRef, onMounted, onBeforeUnmount, provide, createVNode, resolveDynamicComponent, withCtx, renderSlot as renderSlot$1, unref, withDirectives, vShow, openBlock, createBlock, createCommentVNode, Fragment as Fragment$1, renderList, resolveComponent, withModifiers,
|
|
16
|
-
import { ssrRenderAttrs, ssrRenderSlot, ssrRenderClass, ssrRenderVNode, ssrRenderComponent, ssrRenderStyle, ssrRenderList,
|
|
14
|
+
import { reactive, computed, defineComponent, inject, mergeProps, useSSRContext, ref, watch, toRef, onMounted, onBeforeUnmount, provide, createVNode, resolveDynamicComponent, withCtx, renderSlot as renderSlot$1, unref, withDirectives, vShow, openBlock, createBlock, createCommentVNode, Fragment as Fragment$1, renderList, resolveComponent, withModifiers, Teleport, toDisplayString, createTextVNode } from 'vue';
|
|
15
|
+
import { ssrRenderAttrs, ssrRenderSlot, ssrRenderClass, ssrRenderVNode, ssrRenderComponent, ssrRenderStyle, ssrRenderList, ssrIncludeBooleanAttr, ssrRenderAttr, ssrRenderTeleport, ssrInterpolate } from 'vue/server-renderer';
|
|
17
16
|
import { img, price, formatMoney, onPromotion } from '@ecomplus/utils';
|
|
18
17
|
/* empty css */import { EventEmitter } from 'node:events';
|
|
19
18
|
import fs, { readFileSync } from 'node:fs';
|
|
@@ -568,7 +567,7 @@ async function getPicture(params) {
|
|
|
568
567
|
throw new Error("[@astrojs/image] `src` is required");
|
|
569
568
|
}
|
|
570
569
|
if (!widths || !Array.isArray(widths)) {
|
|
571
|
-
throw new Error("[@astrojs/image] at least one `width` is required");
|
|
570
|
+
throw new Error("[@astrojs/image] at least one `width` is required. ex: `widths={[100]}`");
|
|
572
571
|
}
|
|
573
572
|
const aspectRatio = await resolveAspectRatio(params);
|
|
574
573
|
if (!aspectRatio) {
|
|
@@ -797,9 +796,11 @@ const $$BaseBody = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
797
796
|
const Astro2 = $$result.createAstro($$Astro$e, $$props, $$slots);
|
|
798
797
|
Astro2.self = $$BaseBody;
|
|
799
798
|
return renderTemplate`${maybeRenderHead($$result)}<body>
|
|
799
|
+
<div id="teleported-overlap" class="relative z-50"></div>
|
|
800
|
+
<div id="teleported-top" class="relative z-0"></div>
|
|
800
801
|
${renderSlot($$result, $$slots["default"])}
|
|
801
802
|
${renderSlot($$result, $$slots["before-body-end"])}
|
|
802
|
-
<div id="teleported"></div>
|
|
803
|
+
<div id="teleported-bottom" class="relative z-0"></div>
|
|
803
804
|
</body>`;
|
|
804
805
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/BaseBody.astro");
|
|
805
806
|
|
|
@@ -993,6 +994,21 @@ const parseShippingPhrase = (phrase) => {
|
|
|
993
994
|
return parsePhrase(phrase, "calculate_shipping", "free_shipping_from_value");
|
|
994
995
|
};
|
|
995
996
|
|
|
997
|
+
const usePitchBar = (props) => {
|
|
998
|
+
const parsedContents = computed(() => {
|
|
999
|
+
return props.slides.map(({ html }) => {
|
|
1000
|
+
return parseShippingPhrase(html).value;
|
|
1001
|
+
});
|
|
1002
|
+
});
|
|
1003
|
+
const countValidSlides = computed(() => {
|
|
1004
|
+
return parsedContents.value.filter((html) => html).length;
|
|
1005
|
+
});
|
|
1006
|
+
return {
|
|
1007
|
+
parsedContents,
|
|
1008
|
+
countValidSlides
|
|
1009
|
+
};
|
|
1010
|
+
};
|
|
1011
|
+
|
|
996
1012
|
const carouselKey = Symbol("carousel");
|
|
997
1013
|
|
|
998
1014
|
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
@@ -1226,48 +1242,34 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1226
1242
|
},
|
|
1227
1243
|
setup(__props) {
|
|
1228
1244
|
const props = __props;
|
|
1229
|
-
const
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
});
|
|
1234
|
-
const countValidSlides = computed(() => {
|
|
1235
|
-
return parsedContents.value.filter((html) => html).length;
|
|
1236
|
-
});
|
|
1245
|
+
const {
|
|
1246
|
+
parsedContents,
|
|
1247
|
+
countValidSlides
|
|
1248
|
+
} = usePitchBar(props);
|
|
1237
1249
|
return (_ctx, _push, _parent, _attrs) => {
|
|
1238
|
-
_push(`<div${ssrRenderAttrs(mergeProps({
|
|
1239
|
-
class: "bg-base-100",
|
|
1240
|
-
"data-pitch-bar": ""
|
|
1241
|
-
}, _attrs))}><div class="container md:w-2/3 mx-auto px-3 py-1">`);
|
|
1250
|
+
_push(`<div${ssrRenderAttrs(mergeProps({ class: "bg-base-100 relative z-1" }, _attrs))}><div class="container md:w-2/3 mx-auto px-3 py-1">`);
|
|
1242
1251
|
_push(ssrRenderComponent(_sfc_main$6, {
|
|
1243
1252
|
autoplay: unref(countValidSlides) > 1 ? 7e3 : null
|
|
1244
1253
|
}, {
|
|
1245
1254
|
controls: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
1246
1255
|
if (_push2) {
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
_push2(`</div>`);
|
|
1255
|
-
}, _push2, _parent2, _scopeId);
|
|
1256
|
+
_push2(`<div style="${ssrRenderStyle(unref(countValidSlides) > 1 ? null : { display: "none" })}" class="text-xl leading-none text-base-400"${_scopeId}>`);
|
|
1257
|
+
_push2(ssrRenderComponent(_sfc_main$7, {
|
|
1258
|
+
direction: -1,
|
|
1259
|
+
class: "pr-2 bg-base-100 hover:text-base-700"
|
|
1260
|
+
}, null, _parent2, _scopeId));
|
|
1261
|
+
_push2(ssrRenderComponent(_sfc_main$7, { class: "pl-2 bg-base-100 hover:text-base-700" }, null, _parent2, _scopeId));
|
|
1262
|
+
_push2(`</div>`);
|
|
1256
1263
|
} else {
|
|
1257
1264
|
return [
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
"
|
|
1262
|
-
},
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
}),
|
|
1267
|
-
createVNode(_sfc_main$7, { class: "pl-2 bg-base-100 hover:text-base-700" })
|
|
1268
|
-
], 512), [
|
|
1269
|
-
[vShow, unref(countValidSlides) > 1]
|
|
1270
|
-
])
|
|
1265
|
+
withDirectives(createVNode("div", { class: "text-xl leading-none text-base-400" }, [
|
|
1266
|
+
createVNode(_sfc_main$7, {
|
|
1267
|
+
direction: -1,
|
|
1268
|
+
class: "pr-2 bg-base-100 hover:text-base-700"
|
|
1269
|
+
}),
|
|
1270
|
+
createVNode(_sfc_main$7, { class: "pl-2 bg-base-100 hover:text-base-700" })
|
|
1271
|
+
], 512), [
|
|
1272
|
+
[vShow, unref(countValidSlides) > 1]
|
|
1271
1273
|
])
|
|
1272
1274
|
];
|
|
1273
1275
|
}
|
|
@@ -1284,23 +1286,18 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1284
1286
|
}, {
|
|
1285
1287
|
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
1286
1288
|
if (_push3) {
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
}
|
|
1293
|
-
}, _push3, _parent3, _scopeId2);
|
|
1289
|
+
if (unref(parsedContents)[i]) {
|
|
1290
|
+
_push3(`<span class="prose text-sm text-base-800"${_scopeId2}>${unref(parsedContents)[i]}</span>`);
|
|
1291
|
+
} else {
|
|
1292
|
+
_push3(`<!---->`);
|
|
1293
|
+
}
|
|
1294
1294
|
} else {
|
|
1295
1295
|
return [
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
"data-pitch-bar-slide": ""
|
|
1302
|
-
}, null, 8, ["innerHTML"])) : createCommentVNode("", true)
|
|
1303
|
-
])
|
|
1296
|
+
unref(parsedContents)[i] ? (openBlock(), createBlock("span", {
|
|
1297
|
+
key: 0,
|
|
1298
|
+
innerHTML: unref(parsedContents)[i],
|
|
1299
|
+
class: "prose text-sm text-base-800"
|
|
1300
|
+
}, null, 8, ["innerHTML"])) : createCommentVNode("", true)
|
|
1304
1301
|
];
|
|
1305
1302
|
}
|
|
1306
1303
|
}),
|
|
@@ -1319,14 +1316,11 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1319
1316
|
class: ["inline-block px-8", slide.href ? "hover:underline" : null]
|
|
1320
1317
|
}, {
|
|
1321
1318
|
default: withCtx(() => [
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
"data-pitch-bar-slide": ""
|
|
1328
|
-
}, null, 8, ["innerHTML"])) : createCommentVNode("", true)
|
|
1329
|
-
])
|
|
1319
|
+
unref(parsedContents)[i] ? (openBlock(), createBlock("span", {
|
|
1320
|
+
key: 0,
|
|
1321
|
+
innerHTML: unref(parsedContents)[i],
|
|
1322
|
+
class: "prose text-sm text-base-800"
|
|
1323
|
+
}, null, 8, ["innerHTML"])) : createCommentVNode("", true)
|
|
1330
1324
|
]),
|
|
1331
1325
|
_: 2
|
|
1332
1326
|
}, 1032, ["href", "target", "class"]))
|
|
@@ -1335,7 +1329,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1335
1329
|
];
|
|
1336
1330
|
}
|
|
1337
1331
|
}),
|
|
1338
|
-
_:
|
|
1332
|
+
_: 1
|
|
1339
1333
|
}, _parent));
|
|
1340
1334
|
_push(`</div></div>`);
|
|
1341
1335
|
};
|
|
@@ -1345,7 +1339,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1345
1339
|
const _sfc_setup$5 = _sfc_main$5.setup;
|
|
1346
1340
|
_sfc_main$5.setup = (props, ctx) => {
|
|
1347
1341
|
const ssrContext = useSSRContext();
|
|
1348
|
-
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/
|
|
1342
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/PitchBar.vue");
|
|
1349
1343
|
return _sfc_setup$5 ? _sfc_setup$5(props, ctx) : void 0;
|
|
1350
1344
|
};
|
|
1351
1345
|
|
|
@@ -1353,18 +1347,46 @@ const i19myAccount = "Minha conta";
|
|
|
1353
1347
|
const i19openCart = "Abrir carrinho";
|
|
1354
1348
|
const i19searchProducts = "Buscar produtos";
|
|
1355
1349
|
|
|
1356
|
-
const
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1350
|
+
const useStickyHeader = (props) => {
|
|
1351
|
+
const {
|
|
1352
|
+
header,
|
|
1353
|
+
canSetStyles,
|
|
1354
|
+
canCreateHeightDiv,
|
|
1355
|
+
isShownOnScrollDown
|
|
1356
|
+
} = {
|
|
1357
|
+
canSetStyles: true,
|
|
1358
|
+
canCreateHeightDiv: true,
|
|
1359
|
+
...props
|
|
1360
|
+
};
|
|
1361
|
+
const { ready, start } = useTimeout(100, { controls: true, immediate: false });
|
|
1362
|
+
const staticHeight = ref(0);
|
|
1363
|
+
const staticY = ref(0);
|
|
1364
|
+
const { y } = { y: ref(0) };
|
|
1365
|
+
const isSticky = computed(() => ready.value && y.value > staticY.value * 1.2);
|
|
1366
|
+
const transition = ref("none");
|
|
1367
|
+
watch(isSticky, async (_isSticky) => {
|
|
1368
|
+
if (canSetStyles) {
|
|
1369
|
+
header.value.style.position = _isSticky ? "sticky" : null;
|
|
1370
|
+
}
|
|
1371
|
+
if (!_isSticky) {
|
|
1372
|
+
start();
|
|
1373
|
+
transition.value = "none";
|
|
1374
|
+
} else {
|
|
1375
|
+
await promiseTimeout(300);
|
|
1376
|
+
transition.value = "opacity var(--transition-slow), transform var(--transition)";
|
|
1377
|
+
}
|
|
1367
1378
|
});
|
|
1379
|
+
const isScrollUp = ref(false);
|
|
1380
|
+
watch(y, (newY, oldY) => {
|
|
1381
|
+
isScrollUp.value = newY > 0 && newY < oldY;
|
|
1382
|
+
});
|
|
1383
|
+
return {
|
|
1384
|
+
staticHeight,
|
|
1385
|
+
staticY,
|
|
1386
|
+
isSticky,
|
|
1387
|
+
isScrollUp,
|
|
1388
|
+
transition
|
|
1389
|
+
};
|
|
1368
1390
|
};
|
|
1369
1391
|
|
|
1370
1392
|
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
@@ -1373,7 +1395,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1373
1395
|
props: {
|
|
1374
1396
|
modelValue: { type: Boolean, default: false },
|
|
1375
1397
|
placement: { default: "start" },
|
|
1376
|
-
|
|
1398
|
+
position: { default: "fixed" },
|
|
1377
1399
|
hasCloseButton: { type: Boolean, default: true }
|
|
1378
1400
|
},
|
|
1379
1401
|
emits: [
|
|
@@ -1382,10 +1404,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1382
1404
|
setup(__props, { emit }) {
|
|
1383
1405
|
const props = __props;
|
|
1384
1406
|
const close = () => emit("update:modelValue", false);
|
|
1385
|
-
const
|
|
1386
|
-
const canvas = ref(null);
|
|
1407
|
+
const drawer = ref(null);
|
|
1387
1408
|
const outsideClickListener = (ev) => {
|
|
1388
|
-
if (!
|
|
1409
|
+
if (!drawer.value?.contains(ev.target)) {
|
|
1389
1410
|
close();
|
|
1390
1411
|
}
|
|
1391
1412
|
};
|
|
@@ -1395,23 +1416,14 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1395
1416
|
}
|
|
1396
1417
|
};
|
|
1397
1418
|
watch(toRef(props, "modelValue"), async (isOpen) => {
|
|
1398
|
-
const header = anchor.value.closest('[class*="backdrop-"]');
|
|
1399
1419
|
if (isOpen) {
|
|
1400
1420
|
document.body.style.overflow = "hidden";
|
|
1401
|
-
if (header) {
|
|
1402
|
-
header.style.backdropFilter = "none";
|
|
1403
|
-
}
|
|
1404
1421
|
setTimeout(() => {
|
|
1405
1422
|
document.addEventListener("click", outsideClickListener, { passive: true });
|
|
1406
1423
|
document.addEventListener("keydown", escClickListener, { passive: true });
|
|
1407
1424
|
}, 500);
|
|
1408
1425
|
} else {
|
|
1409
1426
|
document.body.style.overflow = null;
|
|
1410
|
-
if (header) {
|
|
1411
|
-
setTimeout(() => {
|
|
1412
|
-
header.style.backdropFilter = null;
|
|
1413
|
-
}, 500);
|
|
1414
|
-
}
|
|
1415
1427
|
document.removeEventListener("click", outsideClickListener);
|
|
1416
1428
|
document.removeEventListener("keydown", escClickListener);
|
|
1417
1429
|
}
|
|
@@ -1428,73 +1440,109 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1428
1440
|
return "down";
|
|
1429
1441
|
}
|
|
1430
1442
|
});
|
|
1431
|
-
const
|
|
1443
|
+
const isFixed = computed(() => {
|
|
1444
|
+
return props.position === "fixed";
|
|
1445
|
+
});
|
|
1446
|
+
const isPlacementX = computed(() => {
|
|
1447
|
+
return props.placement === "start" || props.placement === "end";
|
|
1448
|
+
});
|
|
1432
1449
|
return (_ctx, _push, _parent, _attrs) => {
|
|
1433
1450
|
const _component_Fade = resolveComponent("Fade");
|
|
1434
|
-
_push(
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
}, _attrs)
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
_push3(`<i class="i-close text-base-400 text-3xl"${_scopeId}></i>`);
|
|
1453
|
-
}, _push3, _parent2, _scopeId);
|
|
1454
|
-
_push3(`</button>`);
|
|
1455
|
-
} else {
|
|
1456
|
-
_push3(`<!---->`);
|
|
1457
|
-
}
|
|
1458
|
-
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push3, _parent2, _scopeId);
|
|
1459
|
-
_push3(`</div></dialog>`);
|
|
1451
|
+
_push(ssrRenderComponent(_component_Fade, mergeProps({
|
|
1452
|
+
slide: unref(slideTo),
|
|
1453
|
+
speed: "slow",
|
|
1454
|
+
"is-floating": ""
|
|
1455
|
+
}, _attrs), {
|
|
1456
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
1457
|
+
if (_push2) {
|
|
1458
|
+
if (__props.modelValue) {
|
|
1459
|
+
_push2(`<dialog class="${ssrRenderClass([[
|
|
1460
|
+
__props.position,
|
|
1461
|
+
unref(isFixed) ? `top-0 left-0 ${unref(isPlacementX) ? "h-screen" : ""}` : null
|
|
1462
|
+
], "w-screen max-w-sm shadow p-0 m-0 z-50"])}"${ssrIncludeBooleanAttr(__props.modelValue) ? " open" : ""}${ssrRenderAttr("data-drawer", __props.placement)}${_scopeId}><div class="relative"${_scopeId}>`);
|
|
1463
|
+
if (__props.hasCloseButton) {
|
|
1464
|
+
_push2(`<button type="button"${ssrRenderAttr("aria-label", "Fechar")} class="${ssrRenderClass([__props.placement === "end" ? "left-2" : "right-2", "absolute top-2"])}" data-drawer-close${_scopeId}>`);
|
|
1465
|
+
ssrRenderSlot(_ctx.$slots, "close", {}, () => {
|
|
1466
|
+
_push2(`<i class="i-close text-base-400 text-3xl"${_scopeId}></i>`);
|
|
1467
|
+
}, _push2, _parent2, _scopeId);
|
|
1468
|
+
_push2(`</button>`);
|
|
1460
1469
|
} else {
|
|
1461
|
-
|
|
1470
|
+
_push2(`<!---->`);
|
|
1462
1471
|
}
|
|
1472
|
+
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push2, _parent2, _scopeId);
|
|
1473
|
+
_push2(`</div>`);
|
|
1474
|
+
ssrRenderTeleport(_push2, (_push3) => {
|
|
1475
|
+
_push3(ssrRenderComponent(_component_Fade, null, {
|
|
1476
|
+
default: withCtx((_2, _push4, _parent3, _scopeId2) => {
|
|
1477
|
+
if (_push4) {
|
|
1478
|
+
if (__props.modelValue) {
|
|
1479
|
+
_push4(`<div class="fixed top-0 left-0 w-screen h-screen bg-black/50 z-40" data-drawer-backdrop${_scopeId2}></div>`);
|
|
1480
|
+
} else {
|
|
1481
|
+
_push4(`<!---->`);
|
|
1482
|
+
}
|
|
1483
|
+
} else {
|
|
1484
|
+
return [
|
|
1485
|
+
__props.modelValue ? (openBlock(), createBlock("div", {
|
|
1486
|
+
key: 0,
|
|
1487
|
+
class: "fixed top-0 left-0 w-screen h-screen bg-black/50 z-40",
|
|
1488
|
+
"data-drawer-backdrop": ""
|
|
1489
|
+
})) : createCommentVNode("", true)
|
|
1490
|
+
];
|
|
1491
|
+
}
|
|
1492
|
+
}),
|
|
1493
|
+
_: 1
|
|
1494
|
+
}, _parent2, _scopeId));
|
|
1495
|
+
}, "#teleported-top", false, _parent2);
|
|
1496
|
+
_push2(`</dialog>`);
|
|
1463
1497
|
} else {
|
|
1464
|
-
|
|
1465
|
-
__props.modelValue ? (openBlock(), createBlock("dialog", {
|
|
1466
|
-
key: 0,
|
|
1467
|
-
class: ["w-screen max-w-sm p-0 z-50", __props.isTeleported ? "fixed top-0 left-0" : "absolute"],
|
|
1468
|
-
open: __props.modelValue,
|
|
1469
|
-
"data-drawer": unref(componentVariant)
|
|
1470
|
-
}, [
|
|
1471
|
-
createVNode("div", {
|
|
1472
|
-
ref_key: "canvas",
|
|
1473
|
-
ref: canvas,
|
|
1474
|
-
class: "relative"
|
|
1475
|
-
}, [
|
|
1476
|
-
__props.hasCloseButton ? (openBlock(), createBlock("button", {
|
|
1477
|
-
key: 0,
|
|
1478
|
-
type: "button",
|
|
1479
|
-
"aria-label": "Fechar",
|
|
1480
|
-
onClick: withModifiers(close, ["prevent"]),
|
|
1481
|
-
class: ["absolute top-2", __props.placement === "end" ? "left-2" : "right-2"],
|
|
1482
|
-
"data-drawer-close": ""
|
|
1483
|
-
}, [
|
|
1484
|
-
renderSlot$1(_ctx.$slots, "close", {}, () => [
|
|
1485
|
-
createVNode("i", { class: "i-close text-base-400 text-3xl" })
|
|
1486
|
-
])
|
|
1487
|
-
], 10, ["onClick"])) : createCommentVNode("", true),
|
|
1488
|
-
renderSlot$1(_ctx.$slots, "default")
|
|
1489
|
-
], 512)
|
|
1490
|
-
], 10, ["open", "data-drawer"])) : createCommentVNode("", true)
|
|
1491
|
-
];
|
|
1498
|
+
_push2(`<!---->`);
|
|
1492
1499
|
}
|
|
1493
|
-
}
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1500
|
+
} else {
|
|
1501
|
+
return [
|
|
1502
|
+
__props.modelValue ? (openBlock(), createBlock("dialog", {
|
|
1503
|
+
key: 0,
|
|
1504
|
+
ref_key: "drawer",
|
|
1505
|
+
ref: drawer,
|
|
1506
|
+
class: ["w-screen max-w-sm shadow p-0 m-0 z-50", [
|
|
1507
|
+
__props.position,
|
|
1508
|
+
unref(isFixed) ? `top-0 left-0 ${unref(isPlacementX) ? "h-screen" : ""}` : null
|
|
1509
|
+
]],
|
|
1510
|
+
open: __props.modelValue,
|
|
1511
|
+
"data-drawer": __props.placement
|
|
1512
|
+
}, [
|
|
1513
|
+
createVNode("div", { class: "relative" }, [
|
|
1514
|
+
__props.hasCloseButton ? (openBlock(), createBlock("button", {
|
|
1515
|
+
key: 0,
|
|
1516
|
+
type: "button",
|
|
1517
|
+
"aria-label": "Fechar",
|
|
1518
|
+
onClick: withModifiers(close, ["prevent"]),
|
|
1519
|
+
class: ["absolute top-2", __props.placement === "end" ? "left-2" : "right-2"],
|
|
1520
|
+
"data-drawer-close": ""
|
|
1521
|
+
}, [
|
|
1522
|
+
renderSlot$1(_ctx.$slots, "close", {}, () => [
|
|
1523
|
+
createVNode("i", { class: "i-close text-base-400 text-3xl" })
|
|
1524
|
+
])
|
|
1525
|
+
], 10, ["onClick"])) : createCommentVNode("", true),
|
|
1526
|
+
renderSlot$1(_ctx.$slots, "default")
|
|
1527
|
+
]),
|
|
1528
|
+
(openBlock(), createBlock(Teleport, { to: "#teleported-top" }, [
|
|
1529
|
+
createVNode(_component_Fade, null, {
|
|
1530
|
+
default: withCtx(() => [
|
|
1531
|
+
__props.modelValue ? (openBlock(), createBlock("div", {
|
|
1532
|
+
key: 0,
|
|
1533
|
+
class: "fixed top-0 left-0 w-screen h-screen bg-black/50 z-40",
|
|
1534
|
+
"data-drawer-backdrop": ""
|
|
1535
|
+
})) : createCommentVNode("", true)
|
|
1536
|
+
]),
|
|
1537
|
+
_: 1
|
|
1538
|
+
})
|
|
1539
|
+
]))
|
|
1540
|
+
], 10, ["open", "data-drawer"])) : createCommentVNode("", true)
|
|
1541
|
+
];
|
|
1542
|
+
}
|
|
1543
|
+
}),
|
|
1544
|
+
_: 3
|
|
1545
|
+
}, _parent));
|
|
1498
1546
|
};
|
|
1499
1547
|
}
|
|
1500
1548
|
});
|
|
@@ -1507,45 +1555,22 @@ _sfc_main$4.setup = (props, ctx) => {
|
|
|
1507
1555
|
};
|
|
1508
1556
|
|
|
1509
1557
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
1510
|
-
__name: "
|
|
1558
|
+
__name: "ShopSidenav",
|
|
1511
1559
|
__ssrInlineRender: true,
|
|
1512
1560
|
props: {
|
|
1513
|
-
|
|
1561
|
+
categories: null
|
|
1514
1562
|
},
|
|
1515
1563
|
setup(__props) {
|
|
1516
1564
|
const props = __props;
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
const height = ref(0);
|
|
1520
|
-
const { y } = { y: ref(0) };
|
|
1521
|
-
const isSticky = computed(() => ready.value && y.value > height.value * 1.5);
|
|
1522
|
-
const transition = ref("none");
|
|
1523
|
-
watch(isSticky, async (isSetSticky) => {
|
|
1524
|
-
if (!isSetSticky) {
|
|
1525
|
-
start();
|
|
1526
|
-
transition.value = "none";
|
|
1527
|
-
} else {
|
|
1528
|
-
await promiseTimeout(300);
|
|
1529
|
-
transition.value = "opacity var(--transition-slow), transform var(--transition)";
|
|
1530
|
-
}
|
|
1531
|
-
});
|
|
1532
|
-
const isScrollUp = ref(false);
|
|
1533
|
-
watch(y, (newY, oldY) => {
|
|
1534
|
-
isScrollUp.value = newY > 0 && newY < oldY;
|
|
1565
|
+
const mainCategories = props.categories.filter(({ slug, parent }) => {
|
|
1566
|
+
return slug && !parent;
|
|
1535
1567
|
});
|
|
1536
|
-
const componentVariant = useComponentVariant(reactive({
|
|
1537
|
-
...props,
|
|
1538
|
-
isSticky,
|
|
1539
|
-
isScrollUp
|
|
1540
|
-
}));
|
|
1541
1568
|
return (_ctx, _push, _parent, _attrs) => {
|
|
1542
|
-
_push(
|
|
1543
|
-
|
|
1544
|
-
"
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
|
|
1548
|
-
_push(`</header><!--]-->`);
|
|
1569
|
+
_push(`<aside${ssrRenderAttrs(mergeProps({ "data-sidenav": "" }, _attrs))}><nav class="py-5" data-sidenav-nav><ul><!--[-->`);
|
|
1570
|
+
ssrRenderList(unref(mainCategories), (mainCategory) => {
|
|
1571
|
+
_push(`<li><a${ssrRenderAttr("href", `/${mainCategory.slug}`)}>${ssrInterpolate(mainCategory.name)}</a></li>`);
|
|
1572
|
+
});
|
|
1573
|
+
_push(`<!--]--></ul></nav></aside>`);
|
|
1549
1574
|
};
|
|
1550
1575
|
}
|
|
1551
1576
|
});
|
|
@@ -1553,13 +1578,16 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
1553
1578
|
const _sfc_setup$3 = _sfc_main$3.setup;
|
|
1554
1579
|
_sfc_main$3.setup = (props, ctx) => {
|
|
1555
1580
|
const ssrContext = useSSRContext();
|
|
1556
|
-
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/
|
|
1581
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/ShopSidenav.vue");
|
|
1557
1582
|
return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
|
|
1558
1583
|
};
|
|
1559
1584
|
|
|
1560
1585
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1561
1586
|
__name: "ShopHeader",
|
|
1562
1587
|
__ssrInlineRender: true,
|
|
1588
|
+
props: {
|
|
1589
|
+
categories: null
|
|
1590
|
+
},
|
|
1563
1591
|
setup(__props) {
|
|
1564
1592
|
const buttons = ref({
|
|
1565
1593
|
search: {
|
|
@@ -1582,114 +1610,73 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1582
1610
|
}
|
|
1583
1611
|
});
|
|
1584
1612
|
const isSidenavOpen = ref(false);
|
|
1613
|
+
const header = ref(null);
|
|
1614
|
+
const {
|
|
1615
|
+
isSticky,
|
|
1616
|
+
staticHeight,
|
|
1617
|
+
staticY
|
|
1618
|
+
} = useStickyHeader({ header });
|
|
1619
|
+
const sidenavHeight = computed(() => {
|
|
1620
|
+
return isSticky.value ? staticHeight.value : staticY.value;
|
|
1621
|
+
});
|
|
1585
1622
|
return (_ctx, _push, _parent, _attrs) => {
|
|
1586
|
-
_push(
|
|
1623
|
+
_push(`<header${ssrRenderAttrs(mergeProps({
|
|
1624
|
+
ref_key: "header",
|
|
1625
|
+
ref: header,
|
|
1626
|
+
class: ["top-0 z-50 transition-colors", [
|
|
1627
|
+
unref(isSticky) && !isSidenavOpen.value ? "bg-white/80" : "bg-white",
|
|
1628
|
+
unref(isSticky) ? "backdrop-blur-md shadow py-2 md:py-3" : "py-3 sm:py-4 md:py-5"
|
|
1629
|
+
]]
|
|
1630
|
+
}, _attrs))}><div class="container lg:max-w-7xl mx-auto px-1 lg:pl-3 grid grid-flow-col grid-cols-3 justify-between items-center md:grid-cols-none md:auto-cols-max">`);
|
|
1631
|
+
ssrRenderSlot(_ctx.$slots, "sidenav-toggle", {}, () => {
|
|
1632
|
+
_push(`<div class="md:hidden" data-sidenav-toggle><button class="px-2 my-1"${ssrRenderAttr("aria-label", "Abrir/fechar menu")}>`);
|
|
1633
|
+
ssrRenderSlot(_ctx.$slots, "sidenav-toggle-content", {}, () => {
|
|
1634
|
+
_push(`<i class="${ssrRenderClass([isSidenavOpen.value ? "i-close" : "i-menu", "text-base-500 text-3xl"])}"></i>`);
|
|
1635
|
+
}, _push, _parent);
|
|
1636
|
+
_push(`</button></div>`);
|
|
1637
|
+
}, _push, _parent);
|
|
1638
|
+
ssrRenderSlot(_ctx.$slots, "logo", {}, null, _push, _parent);
|
|
1639
|
+
ssrRenderSlot(_ctx.$slots, "nav", {}, null, _push, _parent);
|
|
1640
|
+
ssrRenderSlot(_ctx.$slots, "buttons", {}, () => {
|
|
1641
|
+
_push(`<div class="px-2 flex justify-end items-center gap-3 lg:gap-4 text-base-800" data-header-buttons><!--[-->`);
|
|
1642
|
+
ssrRenderList(buttons.value, ({ icon, onClick, label }, name) => {
|
|
1643
|
+
ssrRenderSlot(_ctx.$slots, "button", mergeProps({ key: name }, { name, icon, onClick }), () => {
|
|
1644
|
+
_push(`<button class="${ssrRenderClass(name === "account" ? "hidden sm:block" : null)}"${ssrRenderAttr("aria-label", label)}${ssrRenderAttr("data-header-button", name)}>`);
|
|
1645
|
+
ssrRenderSlot(_ctx.$slots, "button-content", { name, icon }, () => {
|
|
1646
|
+
_push(`<i class="${ssrRenderClass([icon, "hover:text-primary w-7 h-7 hover:scale-110 active:scale-125"])}"></i>`);
|
|
1647
|
+
}, _push, _parent);
|
|
1648
|
+
_push(`</button>`);
|
|
1649
|
+
}, _push, _parent);
|
|
1650
|
+
});
|
|
1651
|
+
_push(`<!--]--></div>`);
|
|
1652
|
+
}, _push, _parent);
|
|
1653
|
+
_push(`</div>`);
|
|
1654
|
+
_push(ssrRenderComponent(_sfc_main$4, {
|
|
1655
|
+
modelValue: isSidenavOpen.value,
|
|
1656
|
+
"onUpdate:modelValue": ($event) => isSidenavOpen.value = $event,
|
|
1657
|
+
"has-close-button": false,
|
|
1658
|
+
position: "absolute",
|
|
1659
|
+
class: "mt-2 -z-1",
|
|
1660
|
+
style: { height: `calc(100vh - ${unref(sidenavHeight)}px + .5rem)` }
|
|
1661
|
+
}, {
|
|
1587
1662
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
1588
1663
|
if (_push2) {
|
|
1589
|
-
_push2(
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
_push2(`<i class="i-menu text-base-500 text-3xl"${_scopeId}></i>`);
|
|
1594
|
-
}, _push2, _parent2, _scopeId);
|
|
1595
|
-
_push2(`</button>`);
|
|
1596
|
-
_push2(ssrRenderComponent(_sfc_main$4, {
|
|
1597
|
-
modelValue: isSidenavOpen.value,
|
|
1598
|
-
"onUpdate:modelValue": ($event) => isSidenavOpen.value = $event,
|
|
1599
|
-
class: "-ml-1 lg:-ml-3"
|
|
1600
|
-
}, {
|
|
1601
|
-
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
1602
|
-
if (_push3) {
|
|
1603
|
-
_push3(` MENU `);
|
|
1604
|
-
} else {
|
|
1605
|
-
return [
|
|
1606
|
-
createTextVNode(" MENU ")
|
|
1607
|
-
];
|
|
1608
|
-
}
|
|
1609
|
-
}),
|
|
1610
|
-
_: 1
|
|
1611
|
-
}, _parent2, _scopeId));
|
|
1612
|
-
_push2(`</div>`);
|
|
1613
|
-
}, _push2, _parent2, _scopeId);
|
|
1614
|
-
ssrRenderSlot(_ctx.$slots, "logo", {}, null, _push2, _parent2, _scopeId);
|
|
1615
|
-
ssrRenderSlot(_ctx.$slots, "nav", {}, null, _push2, _parent2, _scopeId);
|
|
1616
|
-
ssrRenderSlot(_ctx.$slots, "buttons", {}, () => {
|
|
1617
|
-
_push2(`<div class="px-2 flex justify-end items-center gap-3 lg:gap-4 text-base-800" data-header-buttons${_scopeId}><!--[-->`);
|
|
1618
|
-
ssrRenderList(buttons.value, ({ icon, onClick, label }, name) => {
|
|
1619
|
-
ssrRenderSlot(_ctx.$slots, "button", mergeProps({ key: name }, { name, icon, onClick }), () => {
|
|
1620
|
-
_push2(`<button class="${ssrRenderClass(name === "account" ? "hidden sm:block" : null)}"${ssrRenderAttr("aria-label", label)}${ssrRenderAttr("data-header-button", name)}${_scopeId}>`);
|
|
1621
|
-
ssrRenderSlot(_ctx.$slots, "button-content", { name, icon }, () => {
|
|
1622
|
-
_push2(`<i class="${ssrRenderClass([icon, "hover:text-primary w-7 h-7 hover:scale-110 active:scale-125"])}"${_scopeId}></i>`);
|
|
1623
|
-
}, _push2, _parent2, _scopeId);
|
|
1624
|
-
_push2(`</button>`);
|
|
1625
|
-
}, _push2, _parent2, _scopeId);
|
|
1626
|
-
});
|
|
1627
|
-
_push2(`<!--]--></div>`);
|
|
1628
|
-
}, _push2, _parent2, _scopeId);
|
|
1629
|
-
_push2(`</div>`);
|
|
1664
|
+
_push2(ssrRenderComponent(_sfc_main$3, {
|
|
1665
|
+
class: "bg-white pt-6",
|
|
1666
|
+
categories: __props.categories
|
|
1667
|
+
}, null, _parent2, _scopeId));
|
|
1630
1668
|
} else {
|
|
1631
1669
|
return [
|
|
1632
|
-
createVNode(
|
|
1633
|
-
class: "
|
|
1634
|
-
|
|
1635
|
-
}, [
|
|
1636
|
-
renderSlot$1(_ctx.$slots, "sidenav-toggle", {}, () => [
|
|
1637
|
-
createVNode("div", {
|
|
1638
|
-
class: "md:hidden",
|
|
1639
|
-
"data-sidenav-toggle": ""
|
|
1640
|
-
}, [
|
|
1641
|
-
createVNode("button", {
|
|
1642
|
-
class: "px-2 my-1",
|
|
1643
|
-
"aria-label": "Abrir/fechar menu",
|
|
1644
|
-
onClick: ($event) => isSidenavOpen.value = !isSidenavOpen.value
|
|
1645
|
-
}, [
|
|
1646
|
-
renderSlot$1(_ctx.$slots, "sidenav-toggle-content", {}, () => [
|
|
1647
|
-
createVNode("i", { class: "i-menu text-base-500 text-3xl" })
|
|
1648
|
-
])
|
|
1649
|
-
], 8, ["onClick"]),
|
|
1650
|
-
createVNode(_sfc_main$4, {
|
|
1651
|
-
modelValue: isSidenavOpen.value,
|
|
1652
|
-
"onUpdate:modelValue": ($event) => isSidenavOpen.value = $event,
|
|
1653
|
-
class: "-ml-1 lg:-ml-3"
|
|
1654
|
-
}, {
|
|
1655
|
-
default: withCtx(() => [
|
|
1656
|
-
createTextVNode(" MENU ")
|
|
1657
|
-
]),
|
|
1658
|
-
_: 1
|
|
1659
|
-
}, 8, ["modelValue", "onUpdate:modelValue"])
|
|
1660
|
-
])
|
|
1661
|
-
]),
|
|
1662
|
-
renderSlot$1(_ctx.$slots, "logo"),
|
|
1663
|
-
renderSlot$1(_ctx.$slots, "nav"),
|
|
1664
|
-
renderSlot$1(_ctx.$slots, "buttons", {}, () => [
|
|
1665
|
-
createVNode("div", {
|
|
1666
|
-
class: "px-2 flex justify-end items-center gap-3 lg:gap-4 text-base-800",
|
|
1667
|
-
"data-header-buttons": ""
|
|
1668
|
-
}, [
|
|
1669
|
-
(openBlock(true), createBlock(Fragment$1, null, renderList(buttons.value, ({ icon, onClick, label }, name) => {
|
|
1670
|
-
return renderSlot$1(_ctx.$slots, "button", mergeProps({ key: name }, { name, icon, onClick }), () => [
|
|
1671
|
-
createVNode("button", {
|
|
1672
|
-
class: name === "account" ? "hidden sm:block" : null,
|
|
1673
|
-
"aria-label": label,
|
|
1674
|
-
onClick,
|
|
1675
|
-
"data-header-button": name
|
|
1676
|
-
}, [
|
|
1677
|
-
renderSlot$1(_ctx.$slots, "button-content", { name, icon }, () => [
|
|
1678
|
-
createVNode("i", {
|
|
1679
|
-
class: [icon, "hover:text-primary w-7 h-7 hover:scale-110 active:scale-125"]
|
|
1680
|
-
}, null, 2)
|
|
1681
|
-
])
|
|
1682
|
-
], 10, ["aria-label", "onClick", "data-header-button"])
|
|
1683
|
-
]);
|
|
1684
|
-
}), 128))
|
|
1685
|
-
])
|
|
1686
|
-
])
|
|
1687
|
-
])
|
|
1670
|
+
createVNode(_sfc_main$3, {
|
|
1671
|
+
class: "bg-white pt-6",
|
|
1672
|
+
categories: __props.categories
|
|
1673
|
+
}, null, 8, ["categories"])
|
|
1688
1674
|
];
|
|
1689
1675
|
}
|
|
1690
1676
|
}),
|
|
1691
|
-
_:
|
|
1677
|
+
_: 1
|
|
1692
1678
|
}, _parent));
|
|
1679
|
+
_push(`</header>`);
|
|
1693
1680
|
};
|
|
1694
1681
|
}
|
|
1695
1682
|
});
|
|
@@ -1723,20 +1710,22 @@ const $$PagesHeader = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
1723
1710
|
html: header.marketing_stripe.text
|
|
1724
1711
|
}];
|
|
1725
1712
|
}
|
|
1726
|
-
const
|
|
1713
|
+
const shopHeader = {
|
|
1714
|
+
categories: apiState.categories
|
|
1715
|
+
};
|
|
1727
1716
|
const LogoHeading = Astro2.props.logoHeading || (isHomepage ? "h1" : "h2");
|
|
1728
1717
|
return renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": () => renderTemplate`${renderSlot($$result, $$slots["pitch-bar"], renderTemplate`
|
|
1729
|
-
${pitchBar.slides.length > 1 && renderTemplate`${renderComponent($$result, "PitchBar", _sfc_main$5, { ...pitchBar, "client:idle": true, "client:component-hydration": "idle", "client:component-path": "
|
|
1718
|
+
${pitchBar.slides.length > 1 && renderTemplate`${renderComponent($$result, "PitchBar", _sfc_main$5, { ...pitchBar, "client:idle": true, "client:component-hydration": "idle", "client:component-path": "~/components/PitchBar.vue", "client:component-export": "default" })}`}
|
|
1730
1719
|
${pitchBar.slides.length === 1 && renderTemplate`${renderComponent($$result, "PitchBar", _sfc_main$5, { ...pitchBar })}`}
|
|
1731
1720
|
`)}${renderSlot($$result, $$slots["sticky-header"], renderTemplate`
|
|
1732
|
-
${renderComponent($$result, "ShopHeader", _sfc_main$2, { "client:load": true, "client:component-hydration": "load", "client:component-path": "@@sf/components/ShopHeader.vue", "client:component-export": "default" }, { "logo": () => renderTemplate`${renderComponent($$result, "Fragment", Fragment, { "slot": "logo" }, { "default": () => renderTemplate`${renderSlot($$result, $$slots["logo"], renderTemplate`
|
|
1721
|
+
${renderComponent($$result, "ShopHeader", _sfc_main$2, { ...shopHeader, "client:load": true, "client:component-hydration": "load", "client:component-path": "@@sf/components/ShopHeader.vue", "client:component-export": "default" }, { "logo": () => renderTemplate`${renderComponent($$result, "Fragment", Fragment, { "slot": "logo" }, { "default": () => renderTemplate`${renderSlot($$result, $$slots["logo"], renderTemplate`
|
|
1733
1722
|
${maybeRenderHead($$result)}<a href="/">
|
|
1734
|
-
${renderComponent($$result, "LogoHeading", LogoHeading, {}, { "default": () => renderTemplate`${
|
|
1723
|
+
${renderComponent($$result, "LogoHeading", LogoHeading, {}, { "default": () => renderTemplate`${renderSlot($$result, $$slots["logo-picture"], renderTemplate`
|
|
1724
|
+
${renderComponent($$result, "Picture", $$Picture, { "src": header.logo || settings.logo, "alt": settings.name, "widths": [300], "sizes": "150px", "fetchpriority": "high", "class": "hover:drop-shadow-sm" })}
|
|
1725
|
+
`)}` })}
|
|
1735
1726
|
</a>
|
|
1736
1727
|
`)}` })}` })}
|
|
1737
|
-
`)}` })}
|
|
1738
|
-
|
|
1739
|
-
`;
|
|
1728
|
+
`)}` })}`;
|
|
1740
1729
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/PagesHeader.astro");
|
|
1741
1730
|
|
|
1742
1731
|
const $$Astro$6 = createAstro("https://ecom2-002.web.app");
|
|
@@ -1744,8 +1733,9 @@ const $$Pages = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
1744
1733
|
const Astro2 = $$result.createAstro($$Astro$6, $$props, $$slots);
|
|
1745
1734
|
Astro2.self = $$Pages;
|
|
1746
1735
|
const { pageContext, title } = Astro2.props;
|
|
1736
|
+
const { settings } = pageContext;
|
|
1747
1737
|
return renderTemplate`${renderComponent($$result, "Base", $$Base, { "pageContext": pageContext, "title": title }, { "default": () => renderTemplate`${renderSlot($$result, $$slots["header"], renderTemplate`
|
|
1748
|
-
${renderComponent($$result, "Header", $$PagesHeader, { "pageContext": pageContext })}
|
|
1738
|
+
${renderComponent($$result, "Header", $$PagesHeader, { "pageContext": pageContext }, { "logo-picture": () => renderTemplate`${renderComponent($$result, "Picture", $$Picture, { "slot": "logo-picture", "src": settings.logo, "alt": settings.name, "widths": [300], "sizes": "150px", "fetchpriority": "high", "class": "hover:drop-shadow-sm" })}` })}
|
|
1749
1739
|
`)}${renderSlot($$result, $$slots["default"])}` })}`;
|
|
1750
1740
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Pages.astro");
|
|
1751
1741
|
|
|
@@ -1918,7 +1908,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1918
1908
|
},
|
|
1919
1909
|
setup(__props) {
|
|
1920
1910
|
const props = __props;
|
|
1921
|
-
const prices = usePrices(props);
|
|
1922
1911
|
const {
|
|
1923
1912
|
hasVariedPrices,
|
|
1924
1913
|
salePrice,
|
|
@@ -1930,223 +1919,135 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1930
1919
|
installmentValue,
|
|
1931
1920
|
priceWithDiscount,
|
|
1932
1921
|
discountLabel
|
|
1933
|
-
} =
|
|
1934
|
-
const componentVariant = useComponentVariant(props);
|
|
1922
|
+
} = usePrices(props);
|
|
1935
1923
|
return (_ctx, _push, _parent, _attrs) => {
|
|
1936
1924
|
const _component_Fade = resolveComponent("Fade");
|
|
1937
1925
|
_push(`<div${ssrRenderAttrs(mergeProps({
|
|
1938
|
-
class: "text-base-600",
|
|
1939
|
-
"data-prices":
|
|
1926
|
+
class: ["text-base-600", __props.isBig ? "text-lg" : null],
|
|
1927
|
+
"data-prices": ""
|
|
1940
1928
|
}, _attrs))}>`);
|
|
1941
1929
|
if (unref(comparePrice)) {
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
if (__props.isLiteral) {
|
|
1956
|
-
_push(`<small>${ssrInterpolate(` ${"Por"}`)}</small>`);
|
|
1957
|
-
} else {
|
|
1958
|
-
_push(`<!---->`);
|
|
1959
|
-
}
|
|
1960
|
-
}, _push, _parent);
|
|
1961
|
-
_push(`</span>`);
|
|
1962
|
-
}, _push, _parent);
|
|
1930
|
+
_push(`<span class="text-base-500 mr-1">`);
|
|
1931
|
+
if (__props.isLiteral) {
|
|
1932
|
+
_push(`<small>${ssrInterpolate(`${"De"} `)}</small>`);
|
|
1933
|
+
} else {
|
|
1934
|
+
_push(`<!---->`);
|
|
1935
|
+
}
|
|
1936
|
+
_push(`<s>${ssrInterpolate(_ctx.$money(unref(comparePrice)))}</s>`);
|
|
1937
|
+
if (__props.isLiteral) {
|
|
1938
|
+
_push(`<small>${ssrInterpolate(` ${"Por"}`)}</small>`);
|
|
1939
|
+
} else {
|
|
1940
|
+
_push(`<!---->`);
|
|
1941
|
+
}
|
|
1942
|
+
_push(`</span>`);
|
|
1963
1943
|
} else {
|
|
1964
1944
|
_push(`<!---->`);
|
|
1965
1945
|
}
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
}
|
|
1974
|
-
}, _push, _parent);
|
|
1975
|
-
ssrRenderSlot(_ctx.$slots, "sale-value", { salePrice: unref(salePrice) }, () => {
|
|
1976
|
-
_push(`${ssrInterpolate(_ctx.$money(unref(salePrice)))}`);
|
|
1977
|
-
}, _push, _parent);
|
|
1978
|
-
ssrRenderSlot(_ctx.$slots, "sale-post", {}, null, _push, _parent);
|
|
1979
|
-
_push(`</strong>`);
|
|
1980
|
-
}, _push, _parent);
|
|
1946
|
+
_push(`<strong class="${ssrRenderClass([__props.isBig ? "text-5xl block" : null, "inline-block text-base-800"])}">`);
|
|
1947
|
+
if (unref(hasVariedPrices)) {
|
|
1948
|
+
_push(`<small>${ssrInterpolate(`${"A partir de"} `)}</small>`);
|
|
1949
|
+
} else {
|
|
1950
|
+
_push(`<!---->`);
|
|
1951
|
+
}
|
|
1952
|
+
_push(` ${ssrInterpolate(_ctx.$money(unref(salePrice)))}</strong>`);
|
|
1981
1953
|
_push(ssrRenderComponent(_component_Fade, { slide: "down" }, {
|
|
1982
1954
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
1983
1955
|
if (_push2) {
|
|
1984
|
-
if (unref(cashbackValue)) {
|
|
1985
|
-
|
|
1986
|
-
if (__props.hasCashback) {
|
|
1987
|
-
_push2(`<div class="relative z-10" data-prices-cashback${_scopeId}><span${ssrRenderAttr("data-tooltip", "Receba $1 de volta".replace("$1", _ctx.$percentage(unref(cashbackPercentage))))}${_scopeId}>`);
|
|
1988
|
-
ssrRenderSlot(_ctx.$slots, "cashback-pre", {}, () => {
|
|
1989
|
-
_push2(`<i class="i-cashback mr-1"${_scopeId}></i>`);
|
|
1990
|
-
}, _push2, _parent2, _scopeId);
|
|
1991
|
-
ssrRenderSlot(_ctx.$slots, "cashback-value", { salePrice: unref(salePrice), cashbackValue: unref(cashbackValue), cashbackPercentage: unref(cashbackPercentage) }, () => {
|
|
1992
|
-
_push2(`<span class="font-medium"${_scopeId}>${ssrInterpolate(_ctx.$money(unref(cashbackValue)))}</span>`);
|
|
1993
|
-
}, _push2, _parent2, _scopeId);
|
|
1994
|
-
ssrRenderSlot(_ctx.$slots, "cashback-post", {}, () => {
|
|
1995
|
-
_push2(`<small${_scopeId}> cashback</small>`);
|
|
1996
|
-
}, _push2, _parent2, _scopeId);
|
|
1997
|
-
_push2(`</span></div>`);
|
|
1998
|
-
} else {
|
|
1999
|
-
_push2(`<!---->`);
|
|
2000
|
-
}
|
|
2001
|
-
}, _push2, _parent2, _scopeId);
|
|
1956
|
+
if (unref(cashbackValue) && __props.hasCashback) {
|
|
1957
|
+
_push2(`<div class="relative z-10"${_scopeId}><span${ssrRenderAttr("data-tooltip", "Receba $1 de volta".replace("$1", _ctx.$percentage(unref(cashbackPercentage))))}${_scopeId}><i class="i-cashback mr-1"${_scopeId}></i><span class="font-medium"${_scopeId}>${ssrInterpolate(_ctx.$money(unref(cashbackValue)))}</span><small${_scopeId}> cashback</small></span></div>`);
|
|
2002
1958
|
} else {
|
|
2003
1959
|
_push2(`<!---->`);
|
|
2004
1960
|
}
|
|
2005
1961
|
} else {
|
|
2006
1962
|
return [
|
|
2007
|
-
unref(cashbackValue)
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
1963
|
+
unref(cashbackValue) && __props.hasCashback ? (openBlock(), createBlock("div", {
|
|
1964
|
+
key: 0,
|
|
1965
|
+
class: "relative z-10"
|
|
1966
|
+
}, [
|
|
1967
|
+
createVNode("span", {
|
|
1968
|
+
"data-tooltip": "Receba $1 de volta".replace("$1", _ctx.$percentage(unref(cashbackPercentage)))
|
|
2012
1969
|
}, [
|
|
2013
|
-
createVNode("
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
]),
|
|
2019
|
-
renderSlot$1(_ctx.$slots, "cashback-value", { salePrice: unref(salePrice), cashbackValue: unref(cashbackValue), cashbackPercentage: unref(cashbackPercentage) }, () => [
|
|
2020
|
-
createVNode("span", { class: "font-medium" }, toDisplayString(_ctx.$money(unref(cashbackValue))), 1)
|
|
2021
|
-
]),
|
|
2022
|
-
renderSlot$1(_ctx.$slots, "cashback-post", {}, () => [
|
|
2023
|
-
createVNode("small", null, " cashback")
|
|
2024
|
-
])
|
|
2025
|
-
], 8, ["data-tooltip"])
|
|
2026
|
-
])) : createCommentVNode("", true)
|
|
2027
|
-
]) : createCommentVNode("", true)
|
|
1970
|
+
createVNode("i", { class: "i-cashback mr-1" }),
|
|
1971
|
+
createVNode("span", { class: "font-medium" }, toDisplayString(_ctx.$money(unref(cashbackValue))), 1),
|
|
1972
|
+
createVNode("small", null, " cashback")
|
|
1973
|
+
], 8, ["data-tooltip"])
|
|
1974
|
+
])) : createCommentVNode("", true)
|
|
2028
1975
|
];
|
|
2029
1976
|
}
|
|
2030
1977
|
}),
|
|
2031
|
-
_:
|
|
1978
|
+
_: 1
|
|
2032
1979
|
}, _parent));
|
|
2033
1980
|
_push(ssrRenderComponent(_component_Fade, { slide: "down" }, {
|
|
2034
1981
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
2035
1982
|
if (_push2) {
|
|
2036
|
-
if (unref(installmentValue)) {
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
ssrRenderSlot(_ctx.$slots, "installment-post", {}, () => {
|
|
2057
|
-
if (!unref(monthlyInterest) && __props.isLiteral) {
|
|
2058
|
-
_push2(`<small${_scopeId}>${ssrInterpolate("Sem juros")}</small>`);
|
|
2059
|
-
} else {
|
|
2060
|
-
_push2(`<!---->`);
|
|
2061
|
-
}
|
|
2062
|
-
}, _push2, _parent2, _scopeId);
|
|
2063
|
-
_push2(`</div>`);
|
|
2064
|
-
} else {
|
|
2065
|
-
_push2(`<!---->`);
|
|
2066
|
-
}
|
|
2067
|
-
}, _push2, _parent2, _scopeId);
|
|
1983
|
+
if (unref(installmentValue) && __props.hasPriceOptions) {
|
|
1984
|
+
_push2(`<div${_scopeId}>`);
|
|
1985
|
+
if (__props.isLiteral) {
|
|
1986
|
+
_push2(`<small${_scopeId}>${ssrInterpolate(`${"Até"} `)}</small>`);
|
|
1987
|
+
} else {
|
|
1988
|
+
_push2(`<!---->`);
|
|
1989
|
+
}
|
|
1990
|
+
_push2(` ${ssrInterpolate(unref(installmentsNumber))}x `);
|
|
1991
|
+
if (__props.isLiteral) {
|
|
1992
|
+
_push2(`<small${_scopeId}>${ssrInterpolate(` ${"De"} `)}</small>`);
|
|
1993
|
+
} else {
|
|
1994
|
+
_push2(`<!---->`);
|
|
1995
|
+
}
|
|
1996
|
+
_push2(`<span${_scopeId}>${ssrInterpolate(_ctx.$money(unref(installmentValue)))}</span>`);
|
|
1997
|
+
if (!unref(monthlyInterest) && __props.isLiteral) {
|
|
1998
|
+
_push2(`<small${_scopeId}>${ssrInterpolate("Sem juros")}</small>`);
|
|
1999
|
+
} else {
|
|
2000
|
+
_push2(`<!---->`);
|
|
2001
|
+
}
|
|
2002
|
+
_push2(`</div>`);
|
|
2068
2003
|
} else {
|
|
2069
2004
|
_push2(`<!---->`);
|
|
2070
2005
|
}
|
|
2071
2006
|
} else {
|
|
2072
2007
|
return [
|
|
2073
|
-
unref(installmentValue) ?
|
|
2074
|
-
__props.
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
]),
|
|
2081
|
-
renderSlot$1(_ctx.$slots, "installment-value", { salePrice: unref(salePrice), installmentValue: unref(installmentValue), installmentsNumber: unref(installmentsNumber), monthlyInterest: unref(monthlyInterest) }, () => [
|
|
2082
|
-
createTextVNode(toDisplayString(unref(installmentsNumber)) + "x ", 1),
|
|
2083
|
-
__props.isLiteral ? (openBlock(), createBlock("small", { key: 0 }, toDisplayString(` ${"De"} `))) : createCommentVNode("", true),
|
|
2084
|
-
createVNode("span", null, toDisplayString(_ctx.$money(unref(installmentValue))), 1)
|
|
2085
|
-
]),
|
|
2086
|
-
renderSlot$1(_ctx.$slots, "installment-post", {}, () => [
|
|
2087
|
-
!unref(monthlyInterest) && __props.isLiteral ? (openBlock(), createBlock("small", { key: 0 }, toDisplayString("Sem juros"))) : createCommentVNode("", true)
|
|
2088
|
-
])
|
|
2089
|
-
])) : createCommentVNode("", true)
|
|
2090
|
-
]) : createCommentVNode("", true)
|
|
2008
|
+
unref(installmentValue) && __props.hasPriceOptions ? (openBlock(), createBlock("div", { key: 0 }, [
|
|
2009
|
+
__props.isLiteral ? (openBlock(), createBlock("small", { key: 0 }, toDisplayString(`${"Até"} `))) : createCommentVNode("", true),
|
|
2010
|
+
createTextVNode(" " + toDisplayString(unref(installmentsNumber)) + "x ", 1),
|
|
2011
|
+
__props.isLiteral ? (openBlock(), createBlock("small", { key: 1 }, toDisplayString(` ${"De"} `))) : createCommentVNode("", true),
|
|
2012
|
+
createVNode("span", null, toDisplayString(_ctx.$money(unref(installmentValue))), 1),
|
|
2013
|
+
!unref(monthlyInterest) && __props.isLiteral ? (openBlock(), createBlock("small", { key: 2 }, toDisplayString("Sem juros"))) : createCommentVNode("", true)
|
|
2014
|
+
])) : createCommentVNode("", true)
|
|
2091
2015
|
];
|
|
2092
2016
|
}
|
|
2093
2017
|
}),
|
|
2094
|
-
_:
|
|
2018
|
+
_: 1
|
|
2095
2019
|
}, _parent));
|
|
2096
2020
|
_push(ssrRenderComponent(_component_Fade, { slide: "down" }, {
|
|
2097
2021
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
2098
2022
|
if (_push2) {
|
|
2099
|
-
if (unref(priceWithDiscount) < unref(salePrice)) {
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
ssrRenderSlot(_ctx.$slots, "discount-post", {}, () => {
|
|
2114
|
-
if (unref(discountLabel)) {
|
|
2115
|
-
_push2(`<small${_scopeId}>${ssrInterpolate(` ${unref(discountLabel)}`)}</small>`);
|
|
2116
|
-
} else {
|
|
2117
|
-
_push2(`<!---->`);
|
|
2118
|
-
}
|
|
2119
|
-
}, _push2, _parent2, _scopeId);
|
|
2120
|
-
_push2(`</div>`);
|
|
2121
|
-
} else {
|
|
2122
|
-
_push2(`<!---->`);
|
|
2123
|
-
}
|
|
2124
|
-
}, _push2, _parent2, _scopeId);
|
|
2023
|
+
if (unref(priceWithDiscount) < unref(salePrice) && __props.hasPriceOptions) {
|
|
2024
|
+
_push2(`<div${_scopeId}>`);
|
|
2025
|
+
if (!unref(discountLabel)) {
|
|
2026
|
+
_push2(`<small${_scopeId}>${ssrInterpolate(`${"A partir de"} `)}</small>`);
|
|
2027
|
+
} else {
|
|
2028
|
+
_push2(`<!---->`);
|
|
2029
|
+
}
|
|
2030
|
+
_push2(`<span${_scopeId}>${ssrInterpolate(_ctx.$money(unref(priceWithDiscount)))}</span>`);
|
|
2031
|
+
if (unref(discountLabel)) {
|
|
2032
|
+
_push2(`<small${_scopeId}>${ssrInterpolate(` ${unref(discountLabel)}`)}</small>`);
|
|
2033
|
+
} else {
|
|
2034
|
+
_push2(`<!---->`);
|
|
2035
|
+
}
|
|
2036
|
+
_push2(`</div>`);
|
|
2125
2037
|
} else {
|
|
2126
2038
|
_push2(`<!---->`);
|
|
2127
2039
|
}
|
|
2128
2040
|
} else {
|
|
2129
2041
|
return [
|
|
2130
|
-
unref(priceWithDiscount) < unref(salePrice) ?
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
renderSlot$1(_ctx.$slots, "discount-pre", {}, () => [
|
|
2136
|
-
!unref(discountLabel) ? (openBlock(), createBlock("small", { key: 0 }, toDisplayString(`${"A partir de"} `))) : createCommentVNode("", true)
|
|
2137
|
-
]),
|
|
2138
|
-
renderSlot$1(_ctx.$slots, "discount-value", { salePrice: unref(salePrice), priceWithDiscount: unref(priceWithDiscount), discountLabel: unref(discountLabel) }, () => [
|
|
2139
|
-
createVNode("span", null, toDisplayString(_ctx.$money(unref(priceWithDiscount))), 1)
|
|
2140
|
-
]),
|
|
2141
|
-
renderSlot$1(_ctx.$slots, "discount-post", {}, () => [
|
|
2142
|
-
unref(discountLabel) ? (openBlock(), createBlock("small", { key: 0 }, toDisplayString(` ${unref(discountLabel)}`), 1)) : createCommentVNode("", true)
|
|
2143
|
-
])
|
|
2144
|
-
])) : createCommentVNode("", true)
|
|
2145
|
-
]) : createCommentVNode("", true)
|
|
2042
|
+
unref(priceWithDiscount) < unref(salePrice) && __props.hasPriceOptions ? (openBlock(), createBlock("div", { key: 0 }, [
|
|
2043
|
+
!unref(discountLabel) ? (openBlock(), createBlock("small", { key: 0 }, toDisplayString(`${"A partir de"} `))) : createCommentVNode("", true),
|
|
2044
|
+
createVNode("span", null, toDisplayString(_ctx.$money(unref(priceWithDiscount))), 1),
|
|
2045
|
+
unref(discountLabel) ? (openBlock(), createBlock("small", { key: 1 }, toDisplayString(` ${unref(discountLabel)}`), 1)) : createCommentVNode("", true)
|
|
2046
|
+
])) : createCommentVNode("", true)
|
|
2146
2047
|
];
|
|
2147
2048
|
}
|
|
2148
2049
|
}),
|
|
2149
|
-
_:
|
|
2050
|
+
_: 1
|
|
2150
2051
|
}, _parent));
|
|
2151
2052
|
_push(`</div>`);
|
|
2152
2053
|
};
|
|
@@ -2156,7 +2057,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2156
2057
|
const _sfc_setup$1 = _sfc_main$1.setup;
|
|
2157
2058
|
_sfc_main$1.setup = (props, ctx) => {
|
|
2158
2059
|
const ssrContext = useSSRContext();
|
|
2159
|
-
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/
|
|
2060
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Prices.vue");
|
|
2160
2061
|
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
|
|
2161
2062
|
};
|
|
2162
2063
|
|
|
@@ -2326,7 +2227,7 @@ const $$Home = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
2326
2227
|
</label>
|
|
2327
2228
|
</div>
|
|
2328
2229
|
</div>
|
|
2329
|
-
${renderComponent($$result, "Prices", _sfc_main$1, { "price": 10, "client:load": true, "client:component-hydration": "load", "client:component-path": "
|
|
2230
|
+
${renderComponent($$result, "Prices", _sfc_main$1, { "price": 10, "client:load": true, "client:component-hydration": "load", "client:component-path": "~/components/Prices.vue", "client:component-export": "default" })}
|
|
2330
2231
|
${renderComponent($$result, "ProductCard", _sfc_main, { "client:load": true, "client:component-hydration": "load", "client:component-path": "@@sf/components/ProductCard.vue", "client:component-export": "default" })}
|
|
2331
2232
|
</main>`;
|
|
2332
2233
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/main/Home.astro");
|