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

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 (77) hide show
  1. package/.editorconfig +16 -0
  2. package/.github/workflows/npm-publish.yml +42 -0
  3. package/.gitmodules +3 -0
  4. package/LICENSE +21 -0
  5. package/README.md +13 -2
  6. package/package.json +25 -23
  7. package/src/components/ShopCart.vue +512 -0
  8. package/src/components/ShopOrderComplete.vue +73 -0
  9. package/src/components/ShopOrderConfirm.vue +291 -0
  10. package/src/components/ShopOrderStepper.vue +264 -0
  11. package/src/components/ShopUserData.vue +232 -0
  12. package/src/components/cart/CartLeaf.vue +277 -0
  13. package/src/components/cart/CartLeafModel.vue +304 -0
  14. package/src/components/cart/CartNode.vue +25 -0
  15. package/src/components/cart/CartTree.vue +54 -0
  16. package/src/components/cart/CartTreeWrapper.vue +73 -0
  17. package/src/components/cart/CartView.vue +205 -174
  18. package/src/components/cart/Discount.vue +91 -0
  19. package/src/components/lib/utils.js +0 -0
  20. package/src/components/order/OrderSidebar.vue +102 -0
  21. package/src/components/order/item/ItemView.vue +0 -1
  22. package/src/components/{cart → order/process}/ConfirmView.vue +94 -96
  23. package/src/components/order/process/ExampleUsage.vue +79 -66
  24. package/src/components/order/process/OrderTabHeader.vue +10 -1
  25. package/src/components/order/process/SelectPaymentProvider.vue +62 -0
  26. package/src/components/order/process/Shipping.vue +46 -0
  27. package/src/components/ui/ShopSummary.vue +145 -0
  28. package/src/components/ui/generic/ArticleList.vue +222 -0
  29. package/src/components/ui/generic/ExamplePagination.vue +236 -0
  30. package/src/components/ui/generic/ShopPriceFormatter.vue +41 -0
  31. package/src/components/ui/generic/alerts/ShopAlert.vue +19 -0
  32. package/src/components/ui/generic/makeData.js +39 -0
  33. package/src/components/ui/stepper/StepperItem.vue +39 -0
  34. package/src/components/ui/stepper/StepperTab.vue +133 -0
  35. package/src/components/ui/stepper/StepperTrigger.vue +35 -0
  36. package/src/components/ui/userdata/AddForm.vue +125 -0
  37. package/src/components/ui/userdata/AddressBox.vue +117 -0
  38. package/src/components/ui/userdata/BaseLayout.vue +94 -0
  39. package/src/components/ui/userdata/CustomBooleanBone.vue +58 -0
  40. package/src/components/ui/userdata/CustomSelectBone.vue +91 -0
  41. package/src/components/ui/userdata/CustomStringBone.vue +71 -0
  42. package/src/components/ui/userdata/DefaultLayout.vue +126 -0
  43. package/src/components/ui/userdata/SelectAddress.vue +21 -0
  44. package/src/components/ui/userdata/multi/ActionBar.vue +38 -0
  45. package/src/components/ui/userdata/multi/CartSelection.vue +42 -0
  46. package/src/main.js +50 -0
  47. package/src/router/index.js +1 -1
  48. package/src/stores/cart.js +267 -42
  49. package/src/style/ignite/.editorconfig +20 -0
  50. package/src/style/ignite/.github/workflows/ignite.yml +64 -0
  51. package/src/style/ignite/.github/workflows/node.yml +30 -0
  52. package/src/style/ignite/.postcssrc.cjs +25 -0
  53. package/src/style/ignite/CHANGELOG.md +244 -0
  54. package/src/style/ignite/LICENSE +21 -0
  55. package/src/style/ignite/README.md +92 -0
  56. package/src/style/ignite/dist/ignite.css +2019 -0
  57. package/src/style/ignite/dist/ignite.min.css +4 -0
  58. package/src/style/ignite/foundation/basic.css +371 -0
  59. package/src/style/ignite/foundation/color.css +323 -0
  60. package/src/style/ignite/foundation/config.css +188 -0
  61. package/src/style/ignite/foundation/grid.css +78 -0
  62. package/src/style/ignite/foundation/mediaqueries.css +71 -0
  63. package/src/style/ignite/foundation/reset.css +261 -0
  64. package/src/style/ignite/ignite.css +29 -0
  65. package/src/style/ignite/ignite.css.map +1 -0
  66. package/src/style/ignite/package-lock.json +5530 -0
  67. package/src/style/ignite/package.json +58 -0
  68. package/src/style/ignite/shoelace.css +19 -0
  69. package/src/style/ignite/themes/dark.css +12 -0
  70. package/src/style/ignite/themes/light.css +11 -0
  71. package/src/style/ignite/utilities/shoelace.css +537 -0
  72. package/src/style/ignite/utilities/utilities.css +24 -0
  73. package/vite.config.js +53 -0
  74. package/src/components/order/information/UserInfoMulti.vue +0 -427
  75. package/src/components/order/information/UserInformation.vue +0 -332
  76. package/src/components/order/process/OrderComplete.vue +0 -41
  77. package/src/components/order/process/OrderView.vue +0 -210
@@ -2,90 +2,79 @@
2
2
  <Loader v-if="!state.cartIsInit"></Loader>
3
3
 
4
4
  <template v-else>
5
- <div class="list">
6
- <h2 class="viur-shop-cart-headline headline">Bestellung prüfen</h2>
7
- <br />
8
-
9
- <div class="viur-shop-cart-address-wrap">
10
- <div class="viur-shop-cart-address">
11
- <div class="viur-shop-cart-address-headline">
12
- Versandadresse
13
- <sl-button outline size="small">
14
- <sl-icon name="pencil" slot="prefix"></sl-icon>
15
- </sl-button>
16
- </div>
17
- Roland Brose<br />
18
- Speicherstraße 33<br />
19
- 44147 Dortmund, DE<br />
20
- <br />
21
- rb@mausbrand.de<br />
22
- 0231 21 34 68 90
5
+
6
+ <div class="list">
7
+ <h2 class="viur-shop-cart-headline headline">Bestellung prüfen</h2>
8
+ <div class="viur-shop-cart-address-wrap">
9
+ <div class="viur-shop-cart-address">
10
+ <div class="viur-shop-cart-address-headline">
11
+ Versandadresse
12
+ <sl-button outline size="small">
13
+ <sl-icon name="pencil" slot="prefix"></sl-icon>
14
+ </sl-button>
23
15
  </div>
24
- <div class="viur-shop-cart-address">
25
- <div class="viur-shop-cart-address-headline">
26
- Rechnungsadresse
27
- <sl-button outline size="small">
28
- <sl-icon name="pencil" slot="prefix"></sl-icon>
29
- </sl-button>
30
- </div>
31
- Roland Brose<br />
32
- Speicherstraße 33<br />
33
- 44147 Dortmund, DE<br />
34
- <br />
35
- rb@mausbrand.de<br />
36
- 0231 21 34 68 90
16
+ {{ cartStore.state.shippingAddress.firstname }} {{ cartStore.state.shippingAddress.lastname }}<br/>
17
+ {{ cartStore.state.shippingAddress.street_name }} {{ cartStore.state.shippingAddress.street_number }}<br/>
18
+ {{ cartStore.state.shippingAddress.zip_code }} {{ cartStore.state.shippingAddress.city }}
19
+ {{ cartStore.state.shippingAddress.country }}<br/>
20
+
21
+ <br/>
22
+ ##TODO MAIL<br/>
23
+ ##TODO Phone
24
+ </div>
25
+ <div class="viur-shop-cart-address">
26
+ <div class="viur-shop-cart-address-headline">
27
+ Rechnungsadresse
28
+ <sl-button outline size="small">
29
+ <sl-icon name="pencil" slot="prefix"></sl-icon>
30
+ </sl-button>
37
31
  </div>
32
+ {{ cartStore.state.billingAddress.firstname }} {{ cartStore.state.billingAddress.lastname }}<br/>
33
+ {{ cartStore.state.billingAddress.street_name }} {{ cartStore.state.billingAddress.street_number }}<br/>
34
+ {{ cartStore.state.billingAddress.zip_code }} {{ cartStore.state.billingAddress.city }}
35
+ {{ cartStore.state.billingAddress.country }}<br/>
36
+ <br/>
37
+ ##TODO MAIL<br/>
38
+ ##TODO Phone
39
+
38
40
  </div>
39
41
 
40
- <div class="viur-shop-cart-payment">
41
- <div class="viur-shop-cart-payment-method">
42
- <span>Zahlungsmethode:</span>
43
- Paypal
44
- </div>
45
- <sl-button outline size="small">
46
- <sl-icon name="pencil" slot="prefix"></sl-icon>
47
- </sl-button>
42
+ </div>
43
+
44
+ <div class="viur-shop-cart-payment">
45
+ <div class="viur-shop-cart-payment-method">
46
+ <span>Zahlungsmethode:</span>
47
+ {{ state.selectedPaymentProvider }}
48
48
  </div>
49
+ <sl-button outline size="small">
50
+ <sl-icon name="pencil" slot="prefix"></sl-icon>
51
+ </sl-button>
52
+ </div>
49
53
 
50
- <h2 class="viur-shop-cart-headline headline">Warenkorb</h2>
51
- <br />
52
-
53
- <sl-card
54
- horizontal
55
- class="viur-shop-cart-mini-card"
56
- v-for="item in cartStore.state.carts[cartStore.state.basket].items"
57
- >
58
- <img
59
- class="viur-shop-cart-mini-card-img"
60
- slot="image"
61
- :src="getImage(item.article.dest.key)"
62
- />
63
-
64
- <div class="viur-shop-cart-mini-cart-header" slot="header">
65
- <h4 class="viur-shop-cart-mini-headline headline">{{ item.article.dest.shop_name }} | 425018</h4>
66
- </div>
67
- <div class="viur-shop-cart-mini-card-body-row">
68
- <div class="viur-shop-cart-mini-card-body-info">
69
- <div class="viur-shop-cart-mini-card-info-wrap">
70
- <div class="viur-shop-cart-mini-card-info">
71
- <span>Anzahl: </span>
72
- 1
73
- </div>
74
- <div class="viur-shop-cart-mini-card-info">
75
- <span>Preis: </span>
76
- {{ item.article.dest.shop_price_recommended }} €
77
- </div>
78
- </div>
79
- </div>
80
- </div>
81
- </sl-card>
54
+ <h2 class="viur-shop-cart-headline headline">Warenkorb</h2>
55
+
56
+ <CartView :in-order-confirm="true"></CartView>
57
+
58
+ <sl-checkbox @sl-change="onTosAccept">
59
+ Ich akzeptiere die geltenden AGBs und Datenschutzbestimmungen
60
+ </sl-checkbox>
82
61
 
83
- <teleport to="#order_sidebar">
62
+ <div class="viur-shop-cart-sidebar-btn-wrap" v-if="state.showOrderButton">
63
+ <sl-button
64
+ :variant="state.showOrderButton ? 'info' : 'disabled'"
65
+ size="small"
66
+ :disabled="!state.showOrderButton"
67
+ @click="addOrder"
68
+ >
69
+ Zahlungspflichtig bestellen
70
+ </sl-button>
71
+ </div>
72
+ <teleport to="#order_sidebar" v-show="false"><!--TOO-->
84
73
  <h2 class="viur-shop-cart-sidebar-headline headline">Jetzt Bestellen</h2>
85
- <br />
86
- <div class="viur-shop-cart-sidebar-info-line">
74
+ <br/>
75
+ <!-- <div class="viur-shop-cart-sidebar-info-line">
87
76
  <span>Zwischensumme</span>
88
- {{ cartStore.state.carts[cartStore.state.basket].info.total }} €
77
+ {{ cartStore.state?.basket ? cartStore.state.carts[cartStore.state.basket].info.total : "00,00" }} €
89
78
  </div>
90
79
  <div class="viur-shop-cart-sidebar-info-line">
91
80
  <span>Rabatt</span>
@@ -97,47 +86,47 @@
97
86
  </div>
98
87
  <div class="viur-shop-cart-sidebar-info-line total">
99
88
  <span>Gesamt:</span>
100
- {{ cartStore.state.carts[cartStore.state.basket].info.total }} €
101
- </div>
89
+ {{ cartStore.state?.basket ? cartStore.state.carts[cartStore.state.basket].info.total : "00" }} €
90
+ </div> -->
102
91
 
103
- <sl-checkbox @sl-change="onTosAccept">
104
- Ich akzeptiere die geltenden AGBs und Datenschutzbestimmungen
105
- </sl-checkbox>
106
92
 
107
- <div class="viur-shop-cart-sidebar-btn-wrap">
108
- <sl-button
109
- :variant="state.showOrderButton ? 'info' : 'disabled'"
110
- size="small"
111
- :disabled="!state.showOrderButton"
112
- >
113
- Zahlungspflichtig bestellen
114
- </sl-button>
115
- </div>
116
93
  </teleport>
117
94
  </div>
118
95
  </template>
119
96
  </template>
120
97
 
121
98
  <script setup>
122
- import { reactive, onBeforeMount, computed } from "vue";
99
+ import {reactive, onBeforeMount, computed} from "vue";
123
100
  import Loader from "@viur/vue-utils/generic/Loader.vue";
124
- import { useCartStore } from "../../stores/cart.js";
125
- import { Request } from "@viur/vue-utils";
101
+ import {useCartStore} from "../../../stores/cart.js";
102
+ import {Request} from "@viur/vue-utils";
103
+ import CartView from "../../cart/CartView.vue";
126
104
 
127
105
  const cartStore = useCartStore();
128
106
 
129
107
  // const searchWarning = ref()
130
108
  const state = reactive({
131
109
  cartIsInit: computed(() => {
132
- return cartStore.state.basket.length ? true : false;
110
+ return true
133
111
  }),
134
112
  itemsIsInit: computed(() => {
135
- return cartStore.state.carts[cartStore.state.basket].items ? true : false;
113
+ return !!cartStore.state?.carts[cartStore.state.basket].items;
114
+ }),
115
+ selectedPaymentProvider: computed(() => {
116
+ /* fixme this compute generates an error
117
+ Uncaught (in promise) TypeError: Cannot set properties of null (setting '__vnode')
118
+ but the value is correct.
119
+ */
120
+ return cartStore.state?.selectedPaymentProvider.title;
121
+
122
+
136
123
  }),
137
124
  images: {},
138
125
  showOrderButton: false,
126
+
139
127
  });
140
128
 
129
+
141
130
  function getImage(item) {
142
131
  Request.get(`/json/dk_variante/view/${item}`).then(async (resp) => {
143
132
  let data = await resp.json();
@@ -155,8 +144,12 @@ function getImage(item) {
155
144
  }
156
145
 
157
146
  function onTosAccept(e) {
158
- if (e.target.checked) state.showOrderButton = true;
159
- if (!e.target.checked) state.showOrderButton = false;
147
+ state.showOrderButton = e.target.checked;
148
+ }
149
+ function addOrder()
150
+ {
151
+ console.log("start order add");
152
+ cartStore.orderAdd();
160
153
  }
161
154
 
162
155
  onBeforeMount(async () => {
@@ -311,4 +304,9 @@ sl-menu-item {
311
304
  font-weight: 600;
312
305
  }
313
306
  }
307
+
308
+ .viur-shop-cart-headline {
309
+ margin: 0 0 var(--sl-spacing-x-large) 0;
310
+ font-size: var(--shop-form-headline-size);
311
+ }
314
312
  </style>
@@ -1,100 +1,113 @@
1
1
  <template>
2
- <order-view :tabs="state.tabs" @tabChange="handleTabs" />
2
+ <shop-order-stepper
3
+ :tabs="state.tabs"
4
+ @tabChange="handleTabs"
5
+ :sidebar="true"
6
+ :sidebar-bottom="false"
7
+ :show-discount="false"
8
+ >
9
+ <!-- customize slots -->
10
+ <!-- <template #main> The Order Stepper </template> -->
11
+ <!-- <template #trigger> Buttons for Stepper control </template> -->
12
+ <!-- <template #sidebar> the side/bottom bar </template> -->
13
+ </shop-order-stepper>
3
14
  </template>
4
15
 
5
16
  <script setup>
6
- import { onBeforeMount, reactive, shallowRef } from "vue";
7
- import { ListRequest } from "@viur/vue-utils";
8
-
17
+ import { onBeforeMount, reactive, shallowRef, computed } from "vue";
18
+ import ShopOrderStepper from "../../ShopOrderStepper.vue";
9
19
  import CartView from "../../cart/CartView.vue";
10
- import ConfirmView from "../../cart/ConfirmView.vue";
11
- import OrderView from "./OrderView.vue";
12
- import CategoryView from "../category/CategoryView.vue";
13
- import OrderComplete from "./OrderComplete.vue";
14
- import UserInformation from "../information/UserInformation.vue";
15
- import UserInfoMulti from "../information/UserInfoMulti.vue";
20
+ import ShopCart from "../../ShopCart.vue";
21
+ import ConfirmView from "../../ShopOrderConfirm.vue";
22
+ import ShopOrderComplete from "../../ShopOrderComplete.vue";
23
+ import ShopUserData from "../../ShopUserData.vue";
16
24
  import { useCartStore } from "../../../stores/cart";
17
25
 
18
26
  const cartStore = useCartStore();
19
27
 
28
+ const rootNode = computed(() =>
29
+ cartStore.state.basketRootNode.key ? cartStore.state.basketRootNode.key : "",
30
+ );
20
31
  const state = reactive({
32
+ rootNode: {},
21
33
  tabs: {
22
34
  cart: {
23
35
  component: shallowRef(CartView),
24
- props: { sidebar: true, mode: "basket" },
36
+ props: {
37
+ sidebar: true,
38
+ mode: "basket",
39
+ cartKey: rootNode, // cartKey (on initial call has to be a root node) is a required prop, make sure that cartStore.init() is called before cart is mounted
40
+ placeholder: "/static/partnerbereich/img/placeholder.svg",
41
+ standalone: false,
42
+ },
25
43
  displayName: "Warenkorb",
26
- icon: { name: "cart", library: "hsk" },
44
+ icon: { name: "bag" },
27
45
  position: 2,
28
46
  disabled: false,
29
- atShow: null,
30
- atHide: null,
31
47
  },
32
- // confirm: {
33
- // component: shallowRef(ConfirmView),
34
- // props: {},
35
- // displayName: "Bestellung prüfen",
36
- // icon: { name: "order-check", library: "hsk" },
37
- // position: 5,
38
- // disabled: false,
39
- // atShow: null,
40
- // atHide: null,
41
- // },
42
- // order: {
43
- // component: shallowRef(CategoryView),
44
- // props: {
45
- // listHandler: ListRequest("categorystore", {
46
- // module: "variante",
47
- // params: { type: "dk", limit: 99 },
48
- // }),
49
- // },
50
- // displayName: "Artikel Bestellen",
51
- // icon: { name: "cart-add", library: "hsk" },
52
- // position: 1,
53
- // disabled: false,
54
- // atShow: null,
55
- // atHide: null,
56
- // },
57
- // orderComplete: {
58
- // component: shallowRef(OrderComplete),
59
- // props: {},
60
- // displayName: "Bestellung Abgeschlossen",
61
- // icon: { name: "order-confirmed", library: "hsk" },
62
- // position: 6,
63
- // disabled: true,
64
- // atShow: null,
65
- // atHide: null,
66
- // },
48
+ confirm: {
49
+ component: shallowRef(ConfirmView),
50
+ props: {
51
+ tabName: "userInfo",
52
+ },
53
+ displayName: "Bestellung prüfen",
54
+ icon: { name: "clipboard-check" },
55
+ position: 5,
56
+ disabled: false,
57
+ },
58
+ orderComplete: {
59
+ component: shallowRef(ShopOrderComplete),
60
+ props: {
61
+ redirectUrl: "http://localhost:8081",
62
+ additionalComponents: [
63
+ {
64
+ component: shallowRef(CartView),
65
+ props: {
66
+ sidebar: true,
67
+ mode: "basket",
68
+ cartKey: rootNode,
69
+ },
70
+ },
71
+ ],
72
+ },
73
+ displayName: "Bestellung Abgeschlossen",
74
+ icon: { name: "bag-check" },
75
+ position: 6,
76
+ disabled: true,
77
+ },
67
78
  userInfo: {
68
- component: shallowRef(UserInformation),
69
- props: {},
79
+ component: shallowRef(ShopUserData),
80
+ props: { multiMode: false },
70
81
  displayName: "Daten Eingeben",
71
- icon: { name: "user", library: "hsk" },
82
+ icon: { name: "card-list" },
72
83
  position: 3,
73
84
  disabled: false,
74
- atShow: null,
75
- atHide: null,
76
85
  },
77
- // userInfoMulti: {
78
- // component: shallowRef(UserInfoMulti),
79
- // props: {},
80
- // displayName: "Daten Eingeben (Multi)",
81
- // icon: { name: "user", library: "hsk" },
82
- // position: 4,
83
- // disabled: false,
84
- // atShow: null,
85
- // atHide: null,
86
- // },
86
+ cartTest: {
87
+ component: shallowRef(ShopCart),
88
+ props: {
89
+ sidebar: true,
90
+ mode: "basket",
91
+ cartKey: rootNode, // cartKey (on initial call has to be a root node) is a required prop, make sure that cartStore.init() is called before cart is mounted
92
+ placeholder: "/static/partnerbereich/img/placeholder.svg",
93
+ standalone: false,
94
+ },
95
+ displayName: "neuer Korb",
96
+ icon: { name: "bag" },
97
+ position: 1,
98
+ disabled: false,
99
+ },
87
100
  },
88
101
  });
89
102
 
90
103
  function handleTabs(e) {
91
- // console.dir("hier", e.target)
92
104
  if (e?.detail.name === "confirm") {
93
105
  state.tabs.orderComplete.disabled = false;
94
106
  }
95
107
  }
96
108
 
97
109
  onBeforeMount(async () => {
98
- await cartStore.getAdressStructure();
110
+ await cartStore.init("/static/partnerbereich/img/placeholder.svg");
111
+ await cartStore.getAddressStructure();
99
112
  });
100
113
  </script>
@@ -1,7 +1,16 @@
1
1
  <template>
2
-
3
2
  HALLO
3
+ <div v-if="a">{{ a }}</div>
4
+ <div v-if="b">{{ b }}</div>
4
5
  </template>
5
6
 
6
7
  <script setup>
8
+ const props = defineProps({
9
+ a: {
10
+ type: String,
11
+ },
12
+ b: {
13
+ type: String,
14
+ },
15
+ });
7
16
  </script>
@@ -0,0 +1,62 @@
1
+ <template>
2
+
3
+ <div v-for="(providerData,providerName,i) in cartStore.state.paymentProviders">
4
+ <sl-card selectable :id="'povider__'+providerName" @sl-change="providerChanged" :selected="i===0">
5
+ <img
6
+ slot="image"
7
+ src="https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80"
8
+ alt="A kitten sits patiently between a terracotta pot and decorative grasses."
9
+ />
10
+ <div slot="footer">
11
+ {{ providerData?.title }}
12
+ <br>
13
+ {{ providerData?.descr }}
14
+ </div>
15
+ </sl-card>
16
+ </div>
17
+
18
+ </template>
19
+
20
+ <script setup>
21
+ //todo styling
22
+ // set image
23
+
24
+ import {onBeforeMount, reactive} from "vue";
25
+ import {useCartStore} from "../../../stores/cart";
26
+
27
+ const cartStore = useCartStore();
28
+
29
+ function providerChanged(e) {
30
+ if (e.target.selected) {
31
+ console.log( "a",cartStore.state.selectedPaymentProvider)
32
+ console.log( "b",cartStore.state.paymentProviders)
33
+
34
+
35
+ cartStore.state.selectedPaymentProviderName = e.target.id.replace("povider__", "")
36
+ cartStore.state.selectedPaymentProvider = cartStore.state.paymentProviders[e.target.id.replace("povider__", "")]
37
+ console.log(cartStore.state.selectedPaymentProvider)
38
+ document.querySelectorAll("sl-card").forEach((card) => {
39
+
40
+ if (card !== e.target) {
41
+ card.selected = false;
42
+ }
43
+ })
44
+
45
+ } else {//can't deselect now
46
+ e.target.selected = true;
47
+
48
+ }
49
+ console.log("provider changed", e)
50
+ }
51
+
52
+ onBeforeMount(async () => {
53
+ await cartStore.getPaymentProviders();
54
+ })
55
+ </script>
56
+
57
+ <style scoped>
58
+ /*todo select styling for sl-card*/
59
+ sl-card[selected]::part(base) {
60
+ border: 5px solid #39b200;
61
+ }
62
+ </style>
@@ -0,0 +1,46 @@
1
+ <template>
2
+ <div class="viur-shop-cart-sidebar-info-line">
3
+
4
+ <span>Versandkosten </span>
5
+ <sl-format-number
6
+ type="currency"
7
+ currency="EUR"
8
+ :value="shippingCost"
9
+ lang="de">
10
+ </sl-format-number>
11
+
12
+ </div>
13
+ <div class="viur-shop-cart-sidebar-info-line">
14
+ <slot name="custom"></slot>
15
+ </div>
16
+
17
+ </template>
18
+ <script setup>
19
+ import {useCartStore} from "../../../stores/cart";
20
+ import {onBeforeMount, reactive,computed} from "vue";
21
+
22
+ const cartStore = useCartStore();
23
+ const shippingCost = computed(() => {
24
+ return cartStore.state.basketRootNode?.shipping?.dest.shipping_cost ? cartStore.state.basketRootNode?.shipping.dest.shipping_cost : 0
25
+ })
26
+ onBeforeMount(async () => {
27
+ await cartStore.init();
28
+ console.log("has shipping ? ",cartStore.state.basketRootNode.shipping);
29
+ });
30
+
31
+ </script>
32
+
33
+ <style scoped>
34
+ .viur-shop-cart-sidebar-info-line {
35
+ display: flex;
36
+ flex-direction: row;
37
+ flex-wrap: nowrap;
38
+ margin: var(--sl-spacing-2x-small) 0;
39
+
40
+
41
+
42
+ span {
43
+ margin-right: auto;
44
+ }
45
+ }
46
+ </style>