@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
@@ -0,0 +1,78 @@
1
+ <template>
2
+ <div class="viur-shop-cart-address-headline">
3
+ {{ $t("skeleton.address.address_type.shipping") }}
4
+ </div>
5
+
6
+ <address-form :formtype="addressState.billingIsShipping?'both':'shipping'">
7
+ </address-form>
8
+ <div>
9
+ <sl-switch :checked="addressState.billingIsShipping" @sl-change="switchAddresses">Verwende Lieferadresse als Rechnungsadresse</sl-switch>
10
+ </div>
11
+
12
+ <div v-show="!addressState.billingIsShipping">
13
+ <div class="viur-shop-cart-address-headline">
14
+ {{ $t("skeleton.address.address_type.billing") }}
15
+ </div>
16
+ <address-form formtype="billing" ></address-form>
17
+ </div>
18
+
19
+ <slot
20
+ nextName="weiter"
21
+ :activefunction="()=>true"
22
+ :nextfunction="nextStep"
23
+ >
24
+ </slot>
25
+ </template>
26
+
27
+
28
+
29
+ <script setup>
30
+ import {reactive, onBeforeMount, watch} from 'vue'
31
+ import AddressForm from '../components/AddressForm.vue'
32
+ import {useAddress} from "../composables/address";
33
+ import {useViurShopStore} from "../shop";
34
+ const shopStore = useViurShopStore();
35
+ const {state:addressState,saveAddresses} = useAddress()
36
+
37
+ const state = reactive({
38
+ })
39
+
40
+ function switchAddresses(event){
41
+ addressState.billingIsShipping=event.target.checked
42
+ }
43
+
44
+ onBeforeMount(()=>{
45
+ if (shopStore.state.cartRoot?.['shipping_address']?.['dest']?.['address_type']?.includes('billing') || !shopStore.state.cartRoot?.['shipping_address']?.['dest']){
46
+ addressState.billingIsShipping = true
47
+ }else{
48
+ addressState.billingIsShipping = false
49
+ }
50
+ })
51
+
52
+
53
+ async function nextStep(){
54
+ // form is only valid if the action field ends with Success
55
+ try{
56
+ let result = await saveAddresses(addressState.billingIsShipping)
57
+ if (result['action'] && result['action'].endsWith('Success')){
58
+ return true
59
+ }
60
+ return false
61
+ } catch(error){
62
+ return false
63
+ }
64
+ }
65
+
66
+ </script>
67
+
68
+ <style scoped>
69
+ .viur-shop-cart-address-headline {
70
+ display: flex;
71
+ flex-direction: row;
72
+ flex-wrap: nowrap;
73
+ align-items: center;
74
+ justify-content: space-between;
75
+ font-weight: 600;
76
+ margin-bottom: var(--sl-spacing-medium);
77
+ }
78
+ </style>
@@ -0,0 +1,15 @@
1
+ import ShopCart from './ShopCart.vue'
2
+ import ShopUserDataGuest from './ShopUserDataGuest.vue'
3
+ import ShopShippingMethod from './ShopShippingMethod.vue'
4
+ import ShopPaymentProvider from './ShopPaymentProvider.vue'
5
+ import ShopOrderConfirm from './ShopOrderConfirm.vue'
6
+ import ShopOrderComplete from './ShopOrderComplete.vue'
7
+
8
+ export {
9
+ ShopCart,
10
+ ShopUserDataGuest,
11
+ ShopShippingMethod,
12
+ ShopPaymentProvider,
13
+ ShopOrderConfirm,
14
+ ShopOrderComplete
15
+ }
@@ -0,0 +1,84 @@
1
+ <template>
2
+ <LoadingHandler :is-loading="addressState[`${state.formtype}IsLoading`]"></LoadingHandler>
3
+ <ViForm
4
+ :ref="(el)=>{addressState[`${state.formtype}Form`]=el; return el}"
5
+ :module="`${shopStore.state.moduleName}/address`"
6
+ :action="state.action"
7
+ :skelkey="state.skelkey"
8
+ :values="{'address_type':state.address_type, 'customer_type':'private'}"
9
+ :useCategories="false"
10
+ :layout="AddressFormLayout"
11
+ >
12
+ </ViForm>
13
+ </template>
14
+
15
+ <script setup>
16
+ import {computed, reactive, watch} from 'vue'
17
+ import LoadingHandler from './LoadingHandler.vue';
18
+ import AddressFormLayout from './AddressFormLayout.vue';
19
+ import ViForm from "@viur/vue-utils/forms/ViForm.vue";
20
+ import {useViurShopStore} from "../shop";
21
+ import {useAddress} from "../composables/address";
22
+
23
+ const shopStore = useViurShopStore();
24
+ const {state:addressState} = useAddress();
25
+
26
+ const props = defineProps({
27
+ formtype:{
28
+ type:String,
29
+ default:"shipping" // formtype: shipping, billing, both
30
+ }
31
+ })
32
+
33
+ const state = reactive({
34
+ formtype:computed(()=>{
35
+ if (['shipping','both'].includes(props.formtype)){
36
+ return "shipping"
37
+ }
38
+ return 'billing'
39
+ }),
40
+
41
+ action: computed(()=>{
42
+ if (state.formtype ==='shipping' && shopStore.state.cartRoot?.['shipping_address']){
43
+ return 'edit'
44
+ } else if (props.formtype === 'billing' && shopStore.state.order?.['billing_address']){
45
+ return 'edit'
46
+ } else {
47
+ return 'add'
48
+ }
49
+ }),
50
+
51
+ skelkey:computed(()=>{
52
+ if (state.formtype === 'shipping' && shopStore.state.cartRoot?.['shipping_address']){
53
+ return shopStore.state.cartRoot['shipping_address']?.['dest']?.['key']
54
+ } else if (props.formtype === 'billing' && shopStore.state.order?.['billing_address']){
55
+ return shopStore.state.order?.['billing_address']?.['dest']?.['key']
56
+ }
57
+ return null
58
+
59
+ }),
60
+ address_type:computed(()=>{
61
+ if (props.formtype === 'both'){
62
+ return ["shipping",'billing']
63
+ }
64
+ return [state.formtype]
65
+ }),
66
+ })
67
+
68
+ watch(()=>addressState.billingIsShipping, (newVal,oldVal)=>{
69
+ if(oldVal && !newVal){
70
+ if(shopStore.state.order?.['billing_address']){
71
+ shopStore.state.order['billing_address'] = null
72
+ }
73
+
74
+ addressState[`billingForm`].state.skel = {'address_type':state.address_type, 'customer_type':'private'}
75
+
76
+ }
77
+
78
+ })
79
+
80
+ </script>
81
+
82
+ <style scoped>
83
+
84
+ </style>
@@ -0,0 +1,107 @@
1
+ <template>
2
+ <div class="vi-shop-cart-form-wrap" v-if="Object.keys(formState.structure).length > 0">
3
+ <slot
4
+ boneName="salutation"
5
+ :widget="getBoneWidget(formState.structure['salutation']['type'])"
6
+ label="placeholder"
7
+ >
8
+ </slot>
9
+
10
+ <slot boneName="firstname"
11
+ :widget="getBoneWidget(formState.structure['firstname']['type'])"
12
+ label="placeholder">
13
+ </slot>
14
+
15
+ <slot boneName="lastname"
16
+ :widget="getBoneWidget(formState.structure['lastname']['type'])"
17
+ label="placeholder">
18
+ </slot>
19
+
20
+ <slot boneName="street_name"
21
+ :widget="getBoneWidget(formState.structure['street_name']['type'])"
22
+ label="placeholder">
23
+ </slot>
24
+
25
+ <slot boneName="street_number"
26
+ :widget="getBoneWidget(formState.structure['street_number']['type'])"
27
+ label="placeholder">
28
+ </slot>
29
+
30
+ <slot
31
+ boneName="zip_code"
32
+ :widget="getBoneWidget(formState.structure['zip_code']['type'])"
33
+ placeholder="placeholder"
34
+ label="placeholder"
35
+ >
36
+ </slot>
37
+
38
+ <slot boneName="city"
39
+ :widget="getBoneWidget(formState.structure['city']['type'])"
40
+ label="placeholder">
41
+ </slot>
42
+
43
+
44
+ <slot boneName="country"
45
+ :widget="getBoneWidget(formState.structure['country']['type'])"
46
+ label="placeholder">
47
+ </slot>
48
+
49
+ </div>
50
+ </template>
51
+ <script setup>
52
+ import { inject } from "vue";
53
+ import { getBoneWidget } from "@viur/vue-utils/bones/edit";
54
+
55
+ const formState = inject("formState");
56
+ const formUpdate = inject("formUpdate");
57
+ </script>
58
+ <style scoped>
59
+
60
+ .vi-shop-cart-form-wrap{
61
+ display: grid;
62
+ grid-template-columns: repeat(4, minmax(0, 1fr));
63
+ gap: var(--sl-spacing-small);
64
+ margin-bottom: var(--sl-spacing-medium);
65
+ }
66
+
67
+ :deep(.bone-wrapper){
68
+ margin: 0;
69
+ }
70
+
71
+ :deep(.wrapper-bone-firstname){
72
+ grid-column: 1 / span 2;
73
+ }
74
+
75
+ :deep(.wrapper-bone-lastname){
76
+ grid-column: 3 / span 2;
77
+ }
78
+
79
+ :deep(.wrapper-bone-street_name){
80
+ grid-column: 1 / span 3;
81
+ }
82
+
83
+ :deep(.wrapper-bone-street_number){
84
+ grid-column: 4 / span 1;
85
+ }
86
+
87
+ :deep(.wrapper-bone-zip_code){
88
+ grid-column: 1 / span 2;
89
+ }
90
+
91
+ :deep(.wrapper-bone-city){
92
+ grid-column: 3 / span 2;
93
+ }
94
+
95
+ :deep(.wrapper-bone-country){
96
+ grid-column: 1 / span 4;
97
+ }
98
+
99
+ :deep(.wrapper-bone-is_default){
100
+ padding: var(--sl-spacing-x-small) 0;
101
+ grid-column: 1 / span 4;
102
+ }
103
+
104
+
105
+
106
+
107
+ </style>
@@ -0,0 +1,68 @@
1
+ <template>
2
+ <sl-radio-group :value="state.currentSelection">
3
+ <template v-for="(option,i) in options">
4
+ <sl-card selectable @sl-change="changeSelection(i)" :selected="i===state.currentSelection" horizontal>
5
+ <slot :option="option" :index="i">
6
+ {{i}}: {{ option }}
7
+ </slot>
8
+ <sl-radio :value="i"></sl-radio>
9
+ </sl-card>
10
+ </template>
11
+ </sl-radio-group>
12
+ </template>
13
+
14
+ <script setup>
15
+ import {onMounted, reactive, watch} from 'vue'
16
+
17
+ const selection = defineModel("selection")
18
+
19
+ const emits = defineEmits(['change'])
20
+
21
+ const props = defineProps({
22
+ options:{
23
+ type: Array,
24
+ default:[]
25
+ },
26
+ })
27
+
28
+ const state = reactive({
29
+ currentSelection:null
30
+ })
31
+
32
+ function changeSelection(i){
33
+ if (state.currentSelection === i){
34
+ state.currentSelection = null
35
+ selection.value = null
36
+ }else{
37
+ state.currentSelection = i
38
+ selection.value = props.options[i]
39
+ }
40
+ emits("change", selection.value)
41
+ }
42
+
43
+ onMounted(()=>{
44
+ if (selection){
45
+ state.currentSelection = props.options.findIndex((option)=>option['dest']['key']===selection.value?.['dest']?.['key'])
46
+ }
47
+
48
+ })
49
+
50
+ </script>
51
+
52
+ <style scoped>
53
+ sl-card{
54
+ width: 100%;
55
+ &[selected]::part(base){
56
+ border:1px solid var(--sl-color-primary-500);
57
+ box-shadow: 0 0 0 var(--sl-focus-ring-width) var(--sl-input-focus-ring-color);
58
+ }
59
+
60
+ &::part(body){
61
+ display:flex;
62
+ flex-direction: row;
63
+ justify-content: space-between;
64
+ align-items: center;
65
+ }
66
+ }
67
+
68
+ </style>
@@ -0,0 +1,325 @@
1
+ <template>
2
+ <div class="item-wrapper">
3
+ <sl-card horizontal class="viur-shop-cart-leaf">
4
+ <img
5
+ class="viur-shop-cart-leaf-image"
6
+ slot="image"
7
+ :src="
8
+ getImage(
9
+ item?.shop_image
10
+ ? item.shop_image
11
+ : undefined,
12
+ )
13
+ "
14
+ />
15
+ <h4
16
+ class="viur-shop-cart-leaf-headline headline"
17
+ v-html="getValue(item.shop_name)"
18
+ ></h4>
19
+ <h5 class="viur-shop-cart-leaf-artno">
20
+ {{ getValue(item.shop_art_no_or_gtin) }}
21
+ </h5>
22
+ <div
23
+ class="viur-shop-cart-leaf-description"
24
+ v-html="getValue(item.shop_description)"
25
+ ></div>
26
+ <sl-input
27
+ :disabled="!edit"
28
+ class="viur-shop-cart-leaf-value viur-shop-cart-leaf-value--quantity"
29
+ type="number"
30
+ placeholder="Number"
31
+ min="0"
32
+ noSpinButtons
33
+ :value="item.quantity"
34
+ @sl-change="changeAmount($event.target.value)"
35
+ >
36
+ <dialog-Button slot="prefix" class="decent" v-if="item.quantity===1" variant="danger" outline>
37
+ <sl-icon name="trash"></sl-icon>
38
+ <template #dialog="{close}">
39
+ Wollen sie den Artikel wirklich entfernen?
40
+ <sl-bar>
41
+ <sl-button slot="left" @click="close">Abbrechen</sl-button>
42
+ <sl-button slot="right" variant="danger" @click="removeArticle(); close()">Löschen</sl-button>
43
+ </sl-bar>
44
+ </template>
45
+ </dialog-Button>
46
+ <sl-button slot="prefix" v-else @click="changeAmount(item.quantity-=1)">
47
+ <sl-icon name="dash-lg"></sl-icon>
48
+ </sl-button>
49
+ <sl-button slot="suffix" @click="changeAmount(item.quantity+=1)">
50
+ <sl-icon name="plus-lg"></sl-icon>
51
+ </sl-button>
52
+ </sl-input>
53
+
54
+ <div class="viur-shop-cart-leaf-unitprice">
55
+ <div class="viur-shop-cart-leaf-label">Stückpreis</div>
56
+ <sl-format-number
57
+ class="viur-shop-cart-leaf-value viur-shop-cart-leaf-value--unitprice"
58
+ lang="de"
59
+ type="currency"
60
+ currency="EUR"
61
+ :value="item.shop_price_retail"
62
+ >
63
+ </sl-format-number>
64
+ </div>
65
+
66
+ <!--<div class="viur-shop-cart-leaf-actions">
67
+ <dialogButton
68
+ v-if="edit"
69
+ size="small"
70
+ outline
71
+ class="viur-shop-cart-leaf-delete-btn"
72
+ variant="danger"
73
+ title="Remove from cart"
74
+ >
75
+ <sl-icon name="trash" slot="prefix"></sl-icon>
76
+ <template #dialog="{close}">
77
+ Wollen sie den Artikel wirklich entfernen?
78
+ <sl-bar>
79
+ <sl-button slot="left" @click="close">Abbrechen</sl-button>
80
+ <sl-button slot="right" variant="danger" @click="removeArticle(); close()">Löschen</sl-button>
81
+ </sl-bar>
82
+ </template>
83
+ </dialogButton>
84
+ </div>-->
85
+
86
+ <div class="viur-shop-cart-leaf-price">
87
+ <div class="viur-shop-cart-leaf-label">Gesamtpreis</div>
88
+ <sl-format-number
89
+ class="viur-shop-cart-leaf-value viur-shop-cart-leaf-value--price"
90
+ lang="de"
91
+ type="currency"
92
+ currency="EUR"
93
+ :value="item.shop_price_retail * item.quantity"
94
+ >
95
+ </sl-format-number>
96
+ </div>
97
+
98
+
99
+ </sl-card>
100
+ <div class="loading" v-if="cartState.isUpdating">
101
+ <sl-spinner></sl-spinner>
102
+ </div>
103
+ </div>
104
+ </template>
105
+ <script setup>
106
+ import { useDebounceFn } from '@vueuse/core'
107
+ import { getImage } from '../utils';
108
+ import { useCart } from '../composables/cart';
109
+ import dialogButton from './dialogButton.vue';
110
+
111
+ const {addItem, removeItem, state:cartState, getValue} = useCart()
112
+
113
+ const changeAmount = useDebounceFn((amount) => {
114
+ props.item.quantity = amount
115
+ addItem(props.item['article']['dest']['key'],amount)
116
+ }, 1000)
117
+
118
+
119
+
120
+
121
+
122
+ const props = defineProps({
123
+ item:{
124
+ required:true
125
+ },
126
+ edit:{
127
+ type:Boolean,
128
+ default:false //true
129
+ }
130
+ })
131
+
132
+ function removeArticle(){
133
+ removeItem(props.item['article']['dest']['key'])
134
+ }
135
+
136
+ </script>
137
+ <style scoped>
138
+ @layer foundation.shop {
139
+ .viur-shop-cart-leaf {
140
+ --shop-leaf-label-color: var(--ignt-color-primary);
141
+ --shop-leaf-label-font-weight: 600;
142
+ --shop-leaf-label-font-size: 1em;
143
+ --shop-leaf-price-font-size: 1em;
144
+ --shop-leaf-headline-font-size: 1.3em;
145
+
146
+ &::part(base) {
147
+ display: flex;
148
+ position: relative;
149
+ }
150
+
151
+ &::part(header) {
152
+ border-bottom: none;
153
+ padding-top: 0;
154
+ padding-right: 0;
155
+ }
156
+
157
+ &::part(image) {
158
+ aspect-ratio: 1;
159
+ }
160
+
161
+ &::part(body) {
162
+ display: grid;
163
+ grid-template-columns: repeat(5, minmax(0, 1fr));
164
+ gap: var(--sl-spacing-medium);
165
+ padding: var(--sl-spacing-large);
166
+ height: 100%;
167
+ }
168
+
169
+ &::part(group) {
170
+ padding: 0;
171
+ }
172
+
173
+ @media (max-width: 600px) {
174
+ &::part(body) {
175
+ grid-template-columns: repeat(2, minmax(0, 1fr));
176
+ gap: var(--sl-spacing-medium);
177
+ padding: var(--sl-spacing-large);
178
+ height: 100%;
179
+ }
180
+
181
+ &::part(image) {
182
+ border-radius: var(--border-radius);
183
+ align-self: baseline;
184
+ }
185
+ }
186
+ }
187
+
188
+ .viur-shop-cart-leaf-image {
189
+ aspect-ratio: 1;
190
+ }
191
+
192
+ .viur-shop-cart-leaf-headline {
193
+ grid-column: 1 / span 4;
194
+ order: -2;
195
+ margin: 0;
196
+ font-size: var(--shop-leaf-headline-font-size);
197
+
198
+ @media (max-width: 600px) {
199
+ grid-column: 1 / span 2;
200
+ }
201
+ }
202
+
203
+ .viur-shop-cart-leaf-artno {
204
+ grid-column: 1 / span 5;
205
+ margin: 0;
206
+
207
+ @media (max-width: 600px) {
208
+ grid-column: 1 / span 2;
209
+ }
210
+ }
211
+
212
+ .viur-shop-cart-leaf-actions {
213
+ display: flex;
214
+ justify-content: start;
215
+ gap: var(--sl-spacing-x-small);
216
+
217
+ @media (min-width: 600px) {
218
+ grid-column: 5 / span 1;
219
+ order: -1;
220
+ justify-content: end;
221
+ align-items: end;
222
+ }
223
+ }
224
+
225
+ .viur-shop-cart-leaf-description {
226
+ grid-column: 1 / span 5;
227
+ margin-bottom: var(--ignt-spacing-small);
228
+ display: -webkit-box;
229
+ -webkit-line-clamp: 3;
230
+ -webkit-box-orient: vertical;
231
+ height: fit-content;
232
+ overflow: hidden;
233
+
234
+ &:deep(*) {
235
+ margin: 0;
236
+ }
237
+
238
+ @media (max-width: 600px) {
239
+ grid-column: span 2;
240
+ }
241
+
242
+ @media (max-width: 500px) {
243
+ display: none;
244
+ }
245
+ }
246
+
247
+ .viur-shop-cart-leaf-price {
248
+ grid-column: 5 / span 1;
249
+ align-self: center;
250
+ text-align: right;
251
+ font-size: var(--shop-leaf-price-font-size);
252
+ }
253
+
254
+ .viur-shop-cart-leaf-quantity {
255
+ align-self: center;
256
+ }
257
+
258
+ .viur-shop-cart-leaf-unitprice {
259
+ align-self: center;
260
+
261
+ @media (max-width: 600px) {
262
+ text-align: right;
263
+ }
264
+ }
265
+
266
+ .viur-shop-cart-leaf-label,
267
+ .viur-shop-cart-leaf-value--quantity::part(form-control-label) {
268
+ color: var(--shop-leaf-label-color);
269
+ font-weight: var(--shop-leaf-label-font-weight);
270
+ font-size: calc(var(--shop-leaf-label-font-size) * .75);
271
+ margin-bottom: var(--ignt-spacing-2x-small);
272
+ }
273
+
274
+ .loading{
275
+ position: absolute;
276
+ top: 0;
277
+ background: #ffffffcc;
278
+ width: 100%;
279
+ height: 100%;
280
+ display: flex;
281
+ flex-direction: row;
282
+ flex-wrap: nowrap;
283
+ justify-content: center;
284
+ align-items: center;
285
+
286
+
287
+ & sl-spinner{
288
+ font-size:3rem;
289
+ }
290
+ }
291
+
292
+ .item-wrapper{
293
+ position: relative;
294
+ }
295
+
296
+
297
+ .viur-shop-cart-leaf-value--quantity{
298
+ align-self: center;
299
+ grid-column: span 1;
300
+
301
+ &::part(input){
302
+ text-align: center;
303
+ padding: 0;
304
+ }
305
+
306
+ sl-button{
307
+ margin: 0;
308
+ transition: all ease .3s;
309
+
310
+ &::part(base){
311
+ background-color: transparent;
312
+ border: none;
313
+ }
314
+
315
+ &::part(label){
316
+ padding: 0;
317
+ height: var(--sl-input-height-medium);
318
+ width: calc(var(--sl-input-height-medium) / 5 * 4);
319
+ }
320
+ }
321
+
322
+ }
323
+
324
+ }
325
+ </style>