@viur/shop-components 0.0.1-dev.60 → 0.0.1-dev.61

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.
Files changed (135) hide show
  1. package/old/client/HttpClient.js +111 -0
  2. package/old/client/ViURShopClient.js +472 -0
  3. package/old/client/index.js +23 -0
  4. package/old/client/types.js +10 -0
  5. package/old/components/ExampleUsage.vue +95 -0
  6. package/old/components/ShopCart.vue +91 -0
  7. package/old/components/ShopOrderConfirm.vue +311 -0
  8. package/{src → old}/components/ShopOrderStepper.vue +111 -23
  9. package/old/components/ShopPaymentProvider.vue +113 -0
  10. package/old/components/ShopShippingMethod.vue +52 -0
  11. package/{src/components/ui → old/components}/ShopSummary.vue +28 -35
  12. package/{src → old}/components/ShopUserData.vue +51 -65
  13. package/{src → old}/components/cart/CartLeafModel.vue +24 -16
  14. package/{src → old}/components/cart/CartNode.vue +1 -0
  15. package/{src → old}/components/cart/CartTree.vue +13 -0
  16. package/old/components/cart/CartView.vue +82 -0
  17. package/{src → old}/components/cart/Discount.vue +8 -8
  18. package/old/components/generic/loadinghandler.vue +76 -0
  19. package/old/components/paymentProvider/prepayment.vue +0 -0
  20. package/old/components/paymentProvider/unzerPayment.vue +140 -0
  21. package/old/components/simple/ShopUserData.vue +161 -0
  22. package/old/components/simple/SimpleDefaultLayout.vue +116 -0
  23. package/old/components/ui/generic/CardSelector.vue +52 -0
  24. package/old/components/ui/generic/CartList.vue +69 -0
  25. package/old/components/ui/generic/ShippingInfo.vue +56 -0
  26. package/old/components/ui/generic/alerts/ShopAlert.vue +30 -0
  27. package/old/components/ui/payment/PaymentOption.vue +79 -0
  28. package/old/components/ui/payment/PaymentSelector.vue +158 -0
  29. package/old/components/ui/stepper/StepperItem.vue +90 -0
  30. package/{src → old}/components/ui/stepper/StepperTab.vue +30 -2
  31. package/old/components/ui/stepper/StepperTrigger.vue +69 -0
  32. package/old/components/ui/userdata/AddForm.vue +160 -0
  33. package/old/components/ui/userdata/AddressBox.vue +137 -0
  34. package/{src → old}/components/ui/userdata/BaseLayout.vue +15 -32
  35. package/old/stores/address.js +122 -0
  36. package/old/stores/cart.js +266 -0
  37. package/old/stores/message.js +21 -0
  38. package/old/stores/order.js +202 -0
  39. package/old/stores/payment.js +79 -0
  40. package/old/stores/shipping.js +78 -0
  41. package/package.json +3 -5
  42. package/src/Shop.vue +212 -0
  43. package/src/ShopOrderStepper.vue +89 -0
  44. package/src/ShopSummary.vue +170 -0
  45. package/src/Steps/ShopCart.vue +60 -0
  46. package/src/Steps/ShopOrderComplete.vue +24 -0
  47. package/src/Steps/ShopOrderConfirm.vue +295 -0
  48. package/src/Steps/ShopPaymentProvider.vue +53 -0
  49. package/src/Steps/ShopShippingMethod.vue +53 -0
  50. package/src/Steps/ShopUserDataGuest.vue +78 -0
  51. package/src/Steps/index.js +15 -0
  52. package/src/components/AddressForm.vue +84 -0
  53. package/src/components/AddressFormLayout.vue +107 -0
  54. package/src/components/CardSelector.vue +68 -0
  55. package/src/components/CartItem.vue +325 -0
  56. package/src/components/CartItemSmall.vue +257 -0
  57. package/src/components/LoadingHandler.vue +76 -0
  58. package/src/components/PaymentOption.vue +78 -0
  59. package/src/components/PaymentProviderUnzer.vue +201 -0
  60. package/src/components/PaymentSelector.vue +55 -0
  61. package/src/components/ShopAlert.vue +30 -0
  62. package/src/components/StepperTab.vue +132 -0
  63. package/src/components/dialogButton.vue +49 -0
  64. package/src/composables/address.js +95 -0
  65. package/src/composables/cart.js +132 -0
  66. package/src/composables/order.js +80 -0
  67. package/src/composables/payment.js +75 -0
  68. package/src/composables/shipping.js +32 -0
  69. package/src/main.js +32 -38
  70. package/src/shop.js +251 -0
  71. package/src/translations/de.js +15 -0
  72. package/src/translations/en.js +5 -0
  73. package/src/utils.js +49 -0
  74. package/vite.config.js +0 -2
  75. package/src/components/ShopCart.vue +0 -512
  76. package/src/components/ShopOrderConfirm.vue +0 -291
  77. package/src/components/cart/CartView.vue +0 -723
  78. package/src/components/order/OrderSidebar.vue +0 -102
  79. package/src/components/order/category/CategoryList.vue +0 -83
  80. package/src/components/order/category/CategoryView.vue +0 -143
  81. package/src/components/order/information/adress/ShippingAdress.vue +0 -143
  82. package/src/components/order/item/ItemCard.vue +0 -168
  83. package/src/components/order/item/ItemView.vue +0 -232
  84. package/src/components/order/process/ConfirmView.vue +0 -312
  85. package/src/components/order/process/ExampleUsage.vue +0 -113
  86. package/src/components/order/process/OrderTabHeader.vue +0 -16
  87. package/src/components/order/process/SelectPaymentProvider.vue +0 -62
  88. package/src/components/order/process/Shipping.vue +0 -46
  89. package/src/components/ui/generic/ArticleList.vue +0 -222
  90. package/src/components/ui/generic/ExamplePagination.vue +0 -236
  91. package/src/components/ui/generic/alerts/ShopAlert.vue +0 -19
  92. package/src/components/ui/generic/makeData.js +0 -39
  93. package/src/components/ui/stepper/StepperItem.vue +0 -39
  94. package/src/components/ui/stepper/StepperTrigger.vue +0 -35
  95. package/src/components/ui/userdata/AddForm.vue +0 -125
  96. package/src/components/ui/userdata/AddressBox.vue +0 -117
  97. package/src/router/index.js +0 -103
  98. package/src/stores/cart.js +0 -336
  99. package/src/views/ViewMissing.vue +0 -20
  100. /package/{src → old}/components/ShopOrderComplete.vue +0 -0
  101. /package/{src → old}/components/cart/CartLeaf.vue +0 -0
  102. /package/{src → old}/components/cart/CartTreeWrapper.vue +0 -0
  103. /package/{src/components/lib/utils.js → old/components/paymentProvider/paypalplus.vue} +0 -0
  104. /package/{src → old}/components/ui/generic/ShopPriceFormatter.vue +0 -0
  105. /package/{src → old}/components/ui/userdata/CustomBooleanBone.vue +0 -0
  106. /package/{src → old}/components/ui/userdata/CustomSelectBone.vue +0 -0
  107. /package/{src → old}/components/ui/userdata/CustomStringBone.vue +0 -0
  108. /package/{src → old}/components/ui/userdata/DefaultLayout.vue +0 -0
  109. /package/{src → old}/components/ui/userdata/SelectAddress.vue +0 -0
  110. /package/{src → old}/components/ui/userdata/multi/ActionBar.vue +0 -0
  111. /package/{src → old}/components/ui/userdata/multi/CartSelection.vue +0 -0
  112. /package/{src/style → old}/ignite/.editorconfig +0 -0
  113. /package/{src/style → old}/ignite/.github/workflows/ignite.yml +0 -0
  114. /package/{src/style → old}/ignite/.github/workflows/node.yml +0 -0
  115. /package/{src/style → old}/ignite/.postcssrc.cjs +0 -0
  116. /package/{src/style → old}/ignite/CHANGELOG.md +0 -0
  117. /package/{src/style → old}/ignite/LICENSE +0 -0
  118. /package/{src/style → old}/ignite/README.md +0 -0
  119. /package/{src/style → old}/ignite/dist/ignite.css +0 -0
  120. /package/{src/style → old}/ignite/dist/ignite.min.css +0 -0
  121. /package/{src/style → old}/ignite/foundation/basic.css +0 -0
  122. /package/{src/style → old}/ignite/foundation/color.css +0 -0
  123. /package/{src/style → old}/ignite/foundation/config.css +0 -0
  124. /package/{src/style → old}/ignite/foundation/grid.css +0 -0
  125. /package/{src/style → old}/ignite/foundation/mediaqueries.css +0 -0
  126. /package/{src/style → old}/ignite/foundation/reset.css +0 -0
  127. /package/{src/style → old}/ignite/ignite.css +0 -0
  128. /package/{src/style → old}/ignite/ignite.css.map +0 -0
  129. /package/{src/style → old}/ignite/package-lock.json +0 -0
  130. /package/{src/style → old}/ignite/package.json +0 -0
  131. /package/{src/style → old}/ignite/shoelace.css +0 -0
  132. /package/{src/style → old}/ignite/themes/dark.css +0 -0
  133. /package/{src/style → old}/ignite/themes/light.css +0 -0
  134. /package/{src/style → old}/ignite/utilities/shoelace.css +0 -0
  135. /package/{src/style → old}/ignite/utilities/utilities.css +0 -0
@@ -1,102 +0,0 @@
1
- ,
2
- <template>
3
- <div class="viur-shop-sidebar">
4
- <h2 class="viur-shop-cart-sidebar-headline headline">Zusammenfassung</h2>
5
- <br />
6
- <div class="viur-shop-cart-sidebar-info-line">
7
- <span>Zwischensumme</span>
8
- 999.99 €
9
- </div>
10
- <div class="viur-shop-cart-sidebar-info-line">
11
- <span>Rabatt</span>
12
- {{
13
- cartStore.state.basketRootNode.total -
14
- cartStore.state.basketRootNode.total_discount_price
15
- }}
16
-
17
- </div>
18
- <div class="viur-shop-cart-sidebar-info-line">
19
- <span>Versandkosten</span>
20
- 0 €
21
- </div>
22
- <div class="viur-shop-cart-sidebar-info-line total">
23
- <span>Gesamt:</span>
24
- <!--{{ cartStore.state.basketRootNode }}-->
25
-
26
- </div>
27
- <div class="viur-shop-cart-sidebar-btn-wrap">
28
-
29
- <!-- TODO: Placement of discount? -->
30
- <div class="viur-shop-discount-wrap">
31
- <Discount></Discount>
32
- </div>
33
-
34
- <sl-button variant="primary" size="medium"> Jetzt Bestellen</sl-button>
35
- <sl-button size="medium" variant="info">
36
- <sl-icon name="paypal" slot="prefix"></sl-icon>
37
- Paypal
38
- </sl-button>
39
- </div>
40
- </div>
41
- </template>
42
-
43
- <script setup>
44
- import { onBeforeMount } from "vue";
45
- import { useCartStore } from "../../stores/cart.js";
46
- import Discount from "../cart/Discount.vue";
47
-
48
- const cartStore = useCartStore();
49
-
50
- onBeforeMount(() => {
51
- cartStore.init();
52
- });
53
- </script>
54
-
55
- <style>
56
- .viur-shop-cart-sidebar-info-line {
57
- display: flex;
58
- flex-direction: row;
59
- flex-wrap: nowrap;
60
- margin: var(--sl-spacing-2x-small) 0;
61
-
62
- &.total {
63
- font-weight: 600;
64
- border-top: 1px solid var(--sl-color-neutral-300);
65
- border-bottom: 1px solid var(--sl-color-neutral-300);
66
- padding: var(--sl-spacing-x-small) 0;
67
- margin: var(--sl-spacing-small) 0;
68
- }
69
-
70
- span {
71
- margin-right: auto;
72
- }
73
- }
74
-
75
- .viur-shop-cart-sidebar-btn-wrap {
76
- display: flex;
77
- flex-direction: column;
78
- margin-top: var(--sl-spacing-large);
79
-
80
- sl-button {
81
- margin-bottom: var(--sl-spacing-x-small);
82
- }
83
- }
84
- .viur-shop-cart-sidebar-headline {
85
- margin: 0 0 var(--sl-spacing-large) 0;
86
- }
87
-
88
- .viur-shop-sidebar {
89
- display: flex;
90
- flex-direction: column;
91
- background-color: var(--shop-sidebar-background);
92
- padding: var(--sl-spacing-medium);
93
- overflow: hidden;
94
- border-radius: var(--sl-border-radius-medium);
95
-
96
- @media (min-width: 1024px) {
97
- position: sticky;
98
- top: 0;
99
- margin-left: var(--sl-spacing-2x-large);
100
- }
101
- }
102
- </style>
@@ -1,83 +0,0 @@
1
- <template>
2
- <RouterLink :to="{ name: 'CategoryView', params: { identifier: 'dk' } }"
3
- v-for="item in list"
4
- :key="item"
5
- class="viur-shop-category-list-item-link"
6
- >
7
- <sl-card class="viur-shop-category-list-item">
8
- <img
9
- slot="image"
10
- src="https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80"
11
- alt="A kitten."
12
- class="viur-shop-category-list-item-img"
13
- />
14
- <h2 class="viur-shop-category-list-item-headline"> {{ item }}</h2>
15
- <div class="viur-shop-category-list-fake-link">Alle anzeigen &raquo;</div>
16
-
17
- </sl-card>
18
- </RouterLink>
19
- </template>
20
-
21
- <script setup>
22
- import { onBeforeMount } from "vue";
23
- import ItemCard from "../item/ItemCard.vue";
24
- import { useCartStore } from "../../../stores/cart";
25
-
26
- const cartStore = useCartStore();
27
- const props = defineProps({
28
- list: { type: Array, required: true },
29
- });
30
-
31
- onBeforeMount(async () => {
32
- await cartStore.init();
33
- });
34
- </script>
35
-
36
- <style scoped>
37
-
38
- .viur-shop-category-list-item-link{
39
- display: flex;
40
- flex-direction: column;
41
- width: 100%;
42
-
43
- &:hover{
44
- .viur-shop-category-list-fake-link{
45
- text-decoration: underline;
46
- }
47
-
48
- .viur-shop-category-list-item-img{
49
- transform: scale(1.02);
50
- }
51
- }
52
- }
53
-
54
- .viur-shop-category-list-item{
55
- width: 100%;
56
-
57
- &::part(header){
58
- padding: var(--sl-spacing-medium) 0;
59
- }
60
-
61
- &::part(body){
62
- padding: var(--sl-spacing-medium) 0;
63
- }
64
-
65
- &::part(footer){
66
- padding: var(--sl-spacing-medium) 0;
67
- }
68
- }
69
-
70
- .viur-shop-category-list-item-headline{
71
- font-size: 1.4em;
72
- margin-bottom: var(--sl-spacing-medium);
73
- color: var(--ignt-basic-color-text);
74
- }
75
-
76
- .viur-shop-category-list-item-img{
77
- aspect-ratio: 1;
78
- object-fit: cover;
79
- transition: all ease .3s;
80
- }
81
-
82
-
83
- </style>
@@ -1,143 +0,0 @@
1
- <template>
2
- <div class="viur-shop-loading-wrap" v-if="state.loading">
3
- <sl-spinner></sl-spinner>
4
- </div>
5
-
6
- <div class="bind" v-else>
7
- <div class="page-header">
8
- <h1>{{ pageHeader }}</h1>
9
- </div>
10
- <slot name="filter" v-if="filter">
11
- text-transform text-transform TEST
12
- </slot>
13
- <div class="viur-shop-category-view-list">
14
- <!-- <router-link
15
- v-for="item in state.skellist"
16
- :key="item.shop_name"
17
- :to="{ name: 'itemView', params: { item: item.key } }"
18
- > -->
19
-
20
- <ItemCard
21
- v-for="item in state.skellist"
22
- :key="item.shop_name"
23
- :item="item"
24
- >
25
- </ItemCard>
26
- <!-- </router-link> -->
27
- </div>
28
-
29
- <sl-button
30
- @click="loadMore"
31
- :loading="state.loading"
32
- :disabled="state.isLastItem"
33
- class="viur-shop-category-view-more-button"
34
- >
35
- Mehr anzeigen
36
- </sl-button>
37
- </div>
38
- </template>
39
-
40
- <script setup>
41
- import { onMounted, reactive, computed } from "vue";
42
- import { useCartStore } from "../../../stores/cart";
43
- import { useRoute } from "vue-router";
44
- import { Request, ListRequest } from "@viur/vue-utils";
45
- // import { ViURShopClient } from "@viur/viur-shop-client";
46
-
47
- // component imports
48
- import ItemCard from "../item/ItemCard.vue";
49
-
50
- const props = defineProps({
51
- skellist: { type: Array },
52
- filter: { type: Boolean, default: true },
53
- pageHeader: { type: String, default: "Artikel Liste" },
54
- listHandler: { type: Object, required: true },
55
- });
56
-
57
- const route = useRoute();
58
-
59
- const cartStore = useCartStore();
60
-
61
- const state = reactive({
62
- skellist: [],
63
- loading: true,
64
- currentCursor: "",
65
- isLastItem: false,
66
- itemCount: 99,
67
- itemType: computed(() => route.params.identifier),
68
- });
69
-
70
- const categoryList = props.listHandler;
71
-
72
- function listItems() {
73
- let params = {
74
- limit: state.itemCount,
75
- cursor: state.currentCursor,
76
- type: state.itemType,
77
- };
78
-
79
- state.loading = true;
80
-
81
- Request.get("/json/variante/list", { dataObj: params }).then(async (resp) => {
82
- let data = await resp.json();
83
-
84
- if (data.cursor !== state.currentCursor && !state.isLastItem) {
85
- state.currentCursor = data.cursor;
86
- state.skellist.push(...data.skellist);
87
- state.loading = false;
88
- } else if (data.cursor === state.currentCursor) {
89
- state.isLastItem = true;
90
- state.loading = false;
91
- }
92
-
93
- console.log("hier", data);
94
- });
95
- }
96
-
97
- async function loadMore() {
98
- state.loading = true;
99
- await categoryList.next();
100
-
101
- if (state.skellist.length < categoryList.state.skellist.length) {
102
- state.skellist = categoryList.state.skellist;
103
- state.loading = false;
104
- } else {
105
- state.loading = false;
106
- state.isLastItem = true;
107
- }
108
- }
109
-
110
- onMounted(async () => {
111
- await cartStore.init();
112
- await categoryList.fetch(true);
113
- state.skellist = categoryList.state.skellist;
114
- state.loading = false;
115
-
116
- // await cartStore.init();
117
- });
118
- </script>
119
-
120
- <style scoped>
121
- .viur-shop-category-view-list {
122
- display: grid;
123
- width: 100%;
124
- grid-gap: var(--sl-spacing-medium);
125
- grid-template-columns: repeat(4, 1fr);
126
- }
127
-
128
- .viur-shop-loading-wrap {
129
- position: absolute;
130
- top: 0;
131
- bottom: 0;
132
- left: 0;
133
- right: 0;
134
- display: flex;
135
- align-items: center;
136
- justify-content: center;
137
-
138
- sl-spinner {
139
- font-size: 3.5em;
140
- --track-width: 4px;
141
- }
142
- }
143
- </style>
@@ -1,143 +0,0 @@
1
- <template>
2
- <sl-splinner
3
- v-if="!cartStore.state.carts[cartStore.state.basket]?.items"
4
- ></sl-splinner>
5
- <template v-else>
6
- <div class="form-wrap">
7
- <sl-select
8
- v-if="multiAdress"
9
- multiple
10
- clearable
11
- ref="itemSelection"
12
- @sl-change="onItemSelect"
13
- @sl-clear="onItemReset"
14
- :label="'Lieferadresse für: ' + state.selectedItem"
15
- class="grid-w-4"
16
- >
17
- <sl-option
18
- v-for="item in cartStore.state.carts[cartStore.state.basket]?.items"
19
- :value="item.key"
20
- >
21
- {{ item.shop_name }}</sl-option
22
- >
23
- </sl-select>
24
- <sl-input
25
- name="street"
26
- @sl-change="onInput"
27
- placeholder="Straße"
28
- class="grid-w-3"
29
- :disabled="!state.isItemSelected"
30
- >
31
- <label slot="label">Strasse *</label>
32
- </sl-input>
33
- <sl-input
34
- name="street"
35
- @sl-change="onInput"
36
- placeholder="Hausnummer"
37
- type="number"
38
- :disabled="!state.isItemSelected"
39
- >
40
- <label slot="label">Hausnummer *</label>
41
- </sl-input>
42
- <sl-input
43
- name="street"
44
- @sl-change="onInput"
45
- placeholder="Postleitzahl"
46
- type="number"
47
- class="grid-w-2"
48
- :disabled="!state.isItemSelected"
49
- >
50
- <label slot="label">Postleitzahl *</label>
51
- </sl-input>
52
- <sl-input
53
- name="city"
54
- @sl-change="onInput"
55
- placeholder="Stadt"
56
- class="grid-w-2"
57
- :disabled="!state.isItemSelected"
58
- >
59
- <label slot="label">Stadt*</label>
60
- </sl-input>
61
- <sl-input
62
- name="province"
63
- @sl-change="onInput"
64
- placeholder="Bundesland"
65
- class="grid-w-2"
66
- :disabled="!state.isItemSelected"
67
- >
68
- <label slot="label">Bundesland</label>
69
- </sl-input>
70
- </div>
71
- </template>
72
- </template>
73
-
74
- <script setup>
75
- import { onBeforeMount, reactive, ref } from "vue";
76
- import { useCartStore } from "../../../../stores/cart";
77
-
78
- const props = defineProps({
79
- multiAdress: { type: Boolean, default: false },
80
- items: { type: Array },
81
- });
82
-
83
- const emit = defineEmits(["adressInput", "itemSelection"]);
84
-
85
- const state = reactive({
86
- selectedItem: null,
87
- isItemSelected: false,
88
- items: {},
89
- });
90
-
91
- const itemSelection = ref(null);
92
- const cartStore = useCartStore();
93
-
94
- function onInput(e) {
95
- let key = `${[state.selectedItem]}.${[e.target.name]}`;
96
- emit("adressInput", {
97
- [`${[state.selectedItem]}.${[e.target.name]}`]: e.target.value,
98
- });
99
- }
100
-
101
- function onItemSelect(e) {
102
- console.log(e.target.value);
103
- if (!e.target.value.length) {
104
- onItemReset();
105
- return;
106
- }
107
- state.selectedItem = e.target.value;
108
- state.isItemSelected = true;
109
- }
110
-
111
- function onItemReset() {
112
- console.log("clearing...");
113
- state.selectedItem = null;
114
- state.isItemSelected = false;
115
- }
116
-
117
- onBeforeMount(() => {
118
- console.log(props.items);
119
- });
120
- </script>
121
-
122
- <style scoped>
123
- .form-wrap {
124
- display: grid;
125
- grid-template-columns: repeat(4, minmax(0, 1fr));
126
- gap: 0 var(--sl-spacing-medium);
127
- margin: var(--sl-spacing-large) 0 var(--sl-spacing-x-large) 0;
128
- padding-bottom: var(--sl-spacing-medium);
129
- border-bottom: 1px solid var(--sl-color-neutral-400);
130
- }
131
-
132
- .grid-w-2 {
133
- grid-column: span 2;
134
- }
135
-
136
- .grid-w-3 {
137
- grid-column: span 3;
138
- }
139
-
140
- .grid-w-4 {
141
- grid-column: span 4;
142
- }
143
- </style>
@@ -1,168 +0,0 @@
1
- <template>
2
- <sl-card class="viur-shop-item-card-card">
3
- <img
4
- slot="image"
5
- :src="getImage(item)"
6
- :alt="item.shop_name"
7
- loading="lazy"
8
- class="viur-shop-item-card-image"
9
- />
10
- <h3 class="viur-shop-item-card-headline">{{ item.shop_name }}</h3>
11
- <h4 class="viur-shop-item-card-subline">B 21 x H 6,5 x T 19 cm</h4>
12
- <div class="viur-shop-item-card-price">{{ item.shop_price_retail }} €</div>
13
- <div class="viur-shop-item-card-footer" slot="footer">
14
- <!-- <sl-button-group label="Amount">
15
- <sl-tooltip content="Remove">
16
- <sl-icon-button
17
- variant="primary"
18
- name="cart-dash"
19
- label="Remove Amount"
20
- style="font-size: 2em"
21
- >
22
- </sl-icon-button>
23
- </sl-tooltip>
24
- <sl-tooltip content="Plus">
25
- <sl-icon-button
26
- variant="primary"
27
- name="cart-plus"
28
- label="Add Amount"
29
- style="font-size: 2em"
30
- >
31
- </sl-icon-button>
32
- </sl-tooltip>
33
- <sl-tooltip content="Add to cart">
34
- <sl-icon-button
35
- variant="primary"
36
- name="cart-check"
37
- label="Add to cart"
38
- style="font-size: 2em"
39
- @click="
40
- cartStore.addToCart(item.key, cartStore.state.currentCart)
41
- "
42
- >
43
- </sl-icon-button>
44
- </sl-tooltip>
45
- </sl-button-group> -->
46
- <sl-button
47
- size="small"
48
- class="viur-shop-item-card-add-to-cart-btn"
49
- variant="primary"
50
- title="Add to cart"
51
- @click.stop="cartStore.addToCart(item.key, cartStore.state.basket)"
52
- >
53
- <sl-icon name="bag-plus" slot="prefix"></sl-icon>
54
-
55
- In den Warenkorb
56
- </sl-button>
57
-
58
- <sl-button
59
- size="small"
60
- outline
61
- class="viur-shop-item-card-add-to-favourites-btn"
62
- variant="primary"
63
- title="Add to favourites"
64
- >
65
- <sl-icon name="heart" slot="prefix"></sl-icon>
66
- </sl-button>
67
- </div>
68
- </sl-card>
69
- </template>
70
-
71
- <script setup>
72
- import { Request } from "@viur/vue-utils";
73
- import { useCartStore } from "../../../stores/cart";
74
-
75
- const props = defineProps({
76
- item: {
77
- type: Object,
78
- required: true,
79
- },
80
- });
81
-
82
- const cartStore = useCartStore();
83
-
84
- function getImage(item) {
85
- let imageUrl =
86
- "https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80";
87
- if (item.dk_artikel.dest.image) {
88
- return Request.downloadUrlFor(item.dk_artikel.dest.image);
89
- }
90
-
91
- return imageUrl;
92
- }
93
- </script>
94
-
95
- <style scoped>
96
- .viur-shop-item-card-card {
97
- width: 100%;
98
-
99
- &::part(header) {
100
- padding: var(--sl-spacing-medium) 0;
101
- }
102
-
103
- &::part(body) {
104
- padding: var(--sl-spacing-medium) 0;
105
- }
106
-
107
- &::part(footer) {
108
- padding: var(--sl-spacing-medium) 0;
109
- }
110
-
111
- &:hover {
112
- .viur-shop-item-card-add-to-cart-btn {
113
- opacity: 1;
114
- }
115
-
116
- .viur-shop-item-card-headline {
117
- color: var(--sl-color-primary-500);
118
- }
119
-
120
- .viur-shop-item-card-image {
121
- transform: scale(1.02);
122
- }
123
- }
124
- }
125
-
126
- .viur-shop-item-card-footer {
127
- display: flex;
128
- flex-direction: row;
129
- align-items: center;
130
- width: 100%;
131
- }
132
-
133
- .viur-shop-item-card-add-to-cart-btn {
134
- transition: all ease 0.3s;
135
- margin-right: var(--sl-spacing-medium);
136
- opacity: 0;
137
- }
138
-
139
- .viur-shop-item-card-add-to-favourites-btn {
140
- margin-left: auto;
141
- }
142
-
143
- .viur-shop-item-card-image {
144
- aspect-ratio: 1;
145
- object-fit: cover;
146
- transition: all ease 0.3s;
147
- }
148
-
149
- .viur-shop-item-card-headline {
150
- font-size: 1.1em;
151
- font-weight: bold;
152
- color: var(--ignt-basic-color-text);
153
- margin-bottom: var(--sl-spacing-2x-small);
154
- transition: all ease 0.3s;
155
- }
156
-
157
- .viur-shop-item-card-subline {
158
- color: var(--ignt-basic-color-text);
159
- margin-bottom: var(--sl-spacing-2x-small);
160
- }
161
-
162
- .viur-shop-item-card-price {
163
- font-size: 1.1em;
164
- font-weight: bold;
165
- color: var(--ignt-basic-color-text);
166
- margin-left: auto;
167
- }
168
- </style>