@viur/shop-components 0.0.1-dev.47 → 0.0.1-dev.48

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.
@@ -0,0 +1,60 @@
1
+ import { reactive as p, computed as m, onMounted as f, openBlock as a, createElementBlock as i, createElementVNode as o, toDisplayString as g, renderSlot as _, createTextVNode as h, createCommentVNode as k, Fragment as y, renderList as v, createBlock as w, pushScopeId as I, popScopeId as S } from "vue";
2
+ import { _ as C, u as b } from "./main-BAXph9jY.mjs";
3
+ import { useRoute as x } from "vue-router";
4
+ import "@viur/vue-utils";
5
+ import { I as L } from "./ItemCard-Cyjlw1FW.mjs";
6
+ const V = (t) => (I("data-v-532e5cf3"), t = t(), S(), t), B = {
7
+ key: 0,
8
+ class: "viur-shop-loading-wrap"
9
+ }, H = /* @__PURE__ */ V(() => /* @__PURE__ */ o("sl-spinner", null, null, -1)), T = [
10
+ H
11
+ ], E = {
12
+ key: 1,
13
+ class: "bind"
14
+ }, M = { class: "page-header" }, N = { class: "viur-shop-category-view-list" }, A = ["loading", "disabled"], j = {
15
+ __name: "CategoryView",
16
+ props: {
17
+ skellist: { type: Array },
18
+ filter: { type: Boolean, default: !0 },
19
+ pageHeader: { type: String, default: "Artikel Liste" },
20
+ listHandler: { type: Object, required: !0 }
21
+ },
22
+ setup(t) {
23
+ const l = t, n = x(), c = b(), e = p({
24
+ skellist: [],
25
+ loading: !0,
26
+ currentCursor: "",
27
+ isLastItem: !1,
28
+ itemCount: 99,
29
+ itemType: m(() => n.params.identifier)
30
+ }), s = l.listHandler;
31
+ async function d() {
32
+ e.loading = !0, await s.next(), e.skellist.length < s.state.skellist.length ? (e.skellist = s.state.skellist, e.loading = !1) : (e.loading = !1, e.isLastItem = !0);
33
+ }
34
+ return f(async () => {
35
+ await c.init(), await s.fetch(!0), e.skellist = s.state.skellist, e.loading = !1;
36
+ }), (u, q) => e.loading ? (a(), i("div", B, T)) : (a(), i("div", E, [
37
+ o("div", M, [
38
+ o("h1", null, g(t.pageHeader), 1)
39
+ ]),
40
+ t.filter ? _(u.$slots, "filter", { key: 0 }, () => [
41
+ h(" text-transform text-transform TEST ")
42
+ ], !0) : k("", !0),
43
+ o("div", N, [
44
+ (a(!0), i(y, null, v(e.skellist, (r) => (a(), w(L, {
45
+ key: r.shop_name,
46
+ item: r
47
+ }, null, 8, ["item"]))), 128))
48
+ ]),
49
+ o("sl-button", {
50
+ onClick: d,
51
+ loading: e.loading,
52
+ disabled: e.isLastItem,
53
+ class: "viur-shop-category-view-more-button"
54
+ }, " Mehr anzeigen ", 8, A)
55
+ ]));
56
+ }
57
+ }, $ = /* @__PURE__ */ C(j, [["__scopeId", "data-v-532e5cf3"]]);
58
+ export {
59
+ $ as default
60
+ };
@@ -0,0 +1,64 @@
1
+ import { openBlock as l, createElementBlock as n, createElementVNode as e, toDisplayString as r, withModifiers as m, unref as d, createTextVNode as p, pushScopeId as u, popScopeId as h } from "vue";
2
+ import { Request as _ } from "@viur/vue-utils";
3
+ import { _ as f, u as v } from "./main-BAXph9jY.mjs";
4
+ const i = (t) => (u("data-v-dc32dd0b"), t = t(), h(), t), b = { class: "viur-shop-item-card-card" }, g = ["src", "alt"], k = { class: "viur-shop-item-card-headline" }, x = /* @__PURE__ */ i(() => /* @__PURE__ */ e("h4", { class: "viur-shop-item-card-subline" }, "B 21 x H 6,5 x T 19 cm", -1)), I = { class: "viur-shop-item-card-price" }, y = {
5
+ class: "viur-shop-item-card-footer",
6
+ slot: "footer"
7
+ }, S = /* @__PURE__ */ i(() => /* @__PURE__ */ e("sl-icon", {
8
+ name: "bag-plus",
9
+ slot: "prefix"
10
+ }, null, -1)), C = /* @__PURE__ */ i(() => /* @__PURE__ */ e("sl-button", {
11
+ size: "small",
12
+ outline: "",
13
+ class: "viur-shop-item-card-add-to-favourites-btn",
14
+ variant: "primary",
15
+ title: "Add to favourites"
16
+ }, [
17
+ /* @__PURE__ */ e("sl-icon", {
18
+ name: "heart",
19
+ slot: "prefix"
20
+ })
21
+ ], -1)), w = {
22
+ __name: "ItemCard",
23
+ props: {
24
+ item: {
25
+ type: Object,
26
+ required: !0
27
+ }
28
+ },
29
+ setup(t) {
30
+ const a = v();
31
+ function c(s) {
32
+ let o = "https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80";
33
+ return s.dk_artikel.dest.image ? _.downloadUrlFor(s.dk_artikel.dest.image) : o;
34
+ }
35
+ return (s, o) => (l(), n("sl-card", b, [
36
+ e("img", {
37
+ slot: "image",
38
+ src: c(t.item),
39
+ alt: t.item.shop_name,
40
+ loading: "lazy",
41
+ class: "viur-shop-item-card-image"
42
+ }, null, 8, g),
43
+ e("h3", k, r(t.item.shop_name), 1),
44
+ x,
45
+ e("div", I, r(t.item.shop_price_retail) + " €", 1),
46
+ e("div", y, [
47
+ e("sl-button", {
48
+ size: "small",
49
+ class: "viur-shop-item-card-add-to-cart-btn",
50
+ variant: "primary",
51
+ title: "Add to cart",
52
+ onClick: o[0] || (o[0] = m((B) => d(a).addToCart(t.item.key, d(a).state.basket), ["stop"]))
53
+ }, [
54
+ S,
55
+ p(" In den Warenkorb ")
56
+ ]),
57
+ C
58
+ ])
59
+ ]));
60
+ }
61
+ }, T = /* @__PURE__ */ f(w, [["__scopeId", "data-v-dc32dd0b"]]);
62
+ export {
63
+ T as I
64
+ };