@viur/shop-components 0.0.1-dev.6 → 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.
- package/.editorconfig +16 -0
- package/.github/workflows/npm-publish.yml +42 -0
- package/.gitmodules +3 -0
- package/LICENSE +21 -0
- package/README.md +13 -2
- package/old/client/HttpClient.js +111 -0
- package/old/client/ViURShopClient.js +472 -0
- package/old/client/index.js +23 -0
- package/old/client/types.js +10 -0
- package/old/components/ExampleUsage.vue +95 -0
- package/old/components/ShopCart.vue +91 -0
- package/old/components/ShopOrderComplete.vue +73 -0
- package/old/components/ShopOrderConfirm.vue +311 -0
- package/old/components/ShopOrderStepper.vue +352 -0
- package/old/components/ShopPaymentProvider.vue +113 -0
- package/old/components/ShopShippingMethod.vue +52 -0
- package/old/components/ShopSummary.vue +138 -0
- package/old/components/ShopUserData.vue +218 -0
- package/old/components/cart/CartLeaf.vue +277 -0
- package/old/components/cart/CartLeafModel.vue +312 -0
- package/old/components/cart/CartNode.vue +26 -0
- package/old/components/cart/CartTree.vue +67 -0
- package/old/components/cart/CartTreeWrapper.vue +73 -0
- package/old/components/cart/CartView.vue +82 -0
- package/old/components/cart/Discount.vue +91 -0
- package/old/components/generic/loadinghandler.vue +76 -0
- package/old/components/paymentProvider/paypalplus.vue +0 -0
- package/old/components/paymentProvider/prepayment.vue +0 -0
- package/old/components/paymentProvider/unzerPayment.vue +140 -0
- package/old/components/simple/ShopUserData.vue +161 -0
- package/old/components/simple/SimpleDefaultLayout.vue +116 -0
- package/old/components/ui/generic/CardSelector.vue +52 -0
- package/old/components/ui/generic/CartList.vue +69 -0
- package/old/components/ui/generic/ShippingInfo.vue +56 -0
- package/old/components/ui/generic/ShopPriceFormatter.vue +41 -0
- package/old/components/ui/generic/alerts/ShopAlert.vue +30 -0
- package/old/components/ui/payment/PaymentOption.vue +79 -0
- package/old/components/ui/payment/PaymentSelector.vue +158 -0
- package/old/components/ui/stepper/StepperItem.vue +90 -0
- package/old/components/ui/stepper/StepperTab.vue +161 -0
- package/old/components/ui/stepper/StepperTrigger.vue +69 -0
- package/old/components/ui/userdata/AddForm.vue +160 -0
- package/old/components/ui/userdata/AddressBox.vue +137 -0
- package/old/components/ui/userdata/BaseLayout.vue +77 -0
- package/old/components/ui/userdata/CustomBooleanBone.vue +58 -0
- package/old/components/ui/userdata/CustomSelectBone.vue +91 -0
- package/old/components/ui/userdata/CustomStringBone.vue +71 -0
- package/old/components/ui/userdata/DefaultLayout.vue +126 -0
- package/old/components/ui/userdata/SelectAddress.vue +21 -0
- package/old/components/ui/userdata/multi/ActionBar.vue +38 -0
- package/old/components/ui/userdata/multi/CartSelection.vue +42 -0
- package/old/ignite/.editorconfig +20 -0
- package/old/ignite/.github/workflows/ignite.yml +64 -0
- package/old/ignite/.github/workflows/node.yml +30 -0
- package/old/ignite/.postcssrc.cjs +25 -0
- package/old/ignite/CHANGELOG.md +244 -0
- package/old/ignite/LICENSE +21 -0
- package/old/ignite/README.md +92 -0
- package/old/ignite/dist/ignite.css +2019 -0
- package/old/ignite/dist/ignite.min.css +4 -0
- package/old/ignite/foundation/basic.css +371 -0
- package/old/ignite/foundation/color.css +323 -0
- package/old/ignite/foundation/config.css +188 -0
- package/old/ignite/foundation/grid.css +78 -0
- package/old/ignite/foundation/mediaqueries.css +71 -0
- package/old/ignite/foundation/reset.css +261 -0
- package/old/ignite/ignite.css +29 -0
- package/old/ignite/ignite.css.map +1 -0
- package/old/ignite/package-lock.json +5530 -0
- package/old/ignite/package.json +58 -0
- package/old/ignite/shoelace.css +19 -0
- package/old/ignite/themes/dark.css +12 -0
- package/old/ignite/themes/light.css +11 -0
- package/old/ignite/utilities/shoelace.css +537 -0
- package/old/ignite/utilities/utilities.css +24 -0
- package/old/stores/address.js +122 -0
- package/old/stores/cart.js +266 -0
- package/old/stores/message.js +21 -0
- package/old/stores/order.js +202 -0
- package/old/stores/payment.js +79 -0
- package/old/stores/shipping.js +78 -0
- package/package.json +23 -23
- package/src/Shop.vue +212 -0
- package/src/ShopOrderStepper.vue +89 -0
- package/src/ShopSummary.vue +170 -0
- package/src/Steps/ShopCart.vue +60 -0
- package/src/Steps/ShopOrderComplete.vue +24 -0
- package/src/Steps/ShopOrderConfirm.vue +295 -0
- package/src/Steps/ShopPaymentProvider.vue +53 -0
- package/src/Steps/ShopShippingMethod.vue +53 -0
- package/src/Steps/ShopUserDataGuest.vue +78 -0
- package/src/Steps/index.js +15 -0
- package/src/components/AddressForm.vue +84 -0
- package/src/components/AddressFormLayout.vue +107 -0
- package/src/components/CardSelector.vue +68 -0
- package/src/components/CartItem.vue +325 -0
- package/src/components/CartItemSmall.vue +257 -0
- package/src/components/LoadingHandler.vue +76 -0
- package/src/components/PaymentOption.vue +78 -0
- package/src/components/PaymentProviderUnzer.vue +201 -0
- package/src/components/PaymentSelector.vue +55 -0
- package/src/components/ShopAlert.vue +30 -0
- package/src/components/StepperTab.vue +132 -0
- package/src/components/dialogButton.vue +49 -0
- package/src/composables/address.js +95 -0
- package/src/composables/cart.js +132 -0
- package/src/composables/order.js +80 -0
- package/src/composables/payment.js +75 -0
- package/src/composables/shipping.js +32 -0
- package/src/main.js +44 -0
- package/src/shop.js +251 -0
- package/src/translations/de.js +15 -0
- package/src/translations/en.js +5 -0
- package/src/utils.js +49 -0
- package/vite.config.js +51 -0
- package/src/components/cart/CartView.vue +0 -692
- package/src/components/cart/ConfirmView.vue +0 -314
- package/src/components/order/category/CategoryList.vue +0 -83
- package/src/components/order/category/CategoryView.vue +0 -143
- package/src/components/order/information/UserInfoMulti.vue +0 -427
- package/src/components/order/information/UserInformation.vue +0 -332
- package/src/components/order/information/adress/ShippingAdress.vue +0 -143
- package/src/components/order/item/ItemCard.vue +0 -168
- package/src/components/order/item/ItemView.vue +0 -233
- package/src/components/order/process/ExampleUsage.vue +0 -100
- package/src/components/order/process/OrderComplete.vue +0 -41
- package/src/components/order/process/OrderTabHeader.vue +0 -7
- package/src/components/order/process/OrderView.vue +0 -210
- package/src/router/index.js +0 -103
- package/src/stores/cart.js +0 -111
- package/src/views/ViewMissing.vue +0 -20
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- TODO: at a very later point -->
|
|
3
|
+
<div class="price-wrap">
|
|
4
|
+
<sl-format-number
|
|
5
|
+
class="viur-shop-cart-leaf-value viur-shop-cart-leaf-value--unitprice"
|
|
6
|
+
lang="de"
|
|
7
|
+
type="currency"
|
|
8
|
+
currency="EUR"
|
|
9
|
+
:value="price.retail"
|
|
10
|
+
>
|
|
11
|
+
</sl-format-number>
|
|
12
|
+
<sl-format-number
|
|
13
|
+
class="viur-shop-cart-leaf-value viur-shop-cart-leaf-value--unitprice"
|
|
14
|
+
lang="de"
|
|
15
|
+
type="currency"
|
|
16
|
+
currency="EUR"
|
|
17
|
+
:value="price.recommended"
|
|
18
|
+
>
|
|
19
|
+
</sl-format-number>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script setup>
|
|
24
|
+
const props = defineProps({
|
|
25
|
+
price: {
|
|
26
|
+
type: Object,
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
function priceGetter() {
|
|
32
|
+
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<style scoped>
|
|
37
|
+
.price-wrap {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
}
|
|
41
|
+
</style>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<sl-alert :variant="variant" open :closable="closeable" :duration="duration" @sl-hide="onHide">
|
|
3
|
+
<slot name="icon">
|
|
4
|
+
<sl-icon slot="icon" :name="iconName"></sl-icon>
|
|
5
|
+
</slot>
|
|
6
|
+
<slot name="alertMsg">{{ msg }}</slot>
|
|
7
|
+
</sl-alert>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup>
|
|
11
|
+
const props = defineProps({
|
|
12
|
+
variant: { type: String, default: "primary" },
|
|
13
|
+
iconName: { type: String, default: "info-circle" },
|
|
14
|
+
closeable:{
|
|
15
|
+
type:Boolean,
|
|
16
|
+
default:true
|
|
17
|
+
},
|
|
18
|
+
duration:{
|
|
19
|
+
type: [Number, String],
|
|
20
|
+
default: 3000 // use "Infinity" for fix message
|
|
21
|
+
},
|
|
22
|
+
msg: { type: String, default: "ALERT!" },
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const emit = defineEmits(["onHide"]);
|
|
26
|
+
|
|
27
|
+
function onHide() {
|
|
28
|
+
emit("onHide");
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<sl-details :class="{
|
|
3
|
+
simple:widget==='simple'
|
|
4
|
+
}"
|
|
5
|
+
@sl-show="selection" >
|
|
6
|
+
<div slot="summary" class="payment-selection">
|
|
7
|
+
<div class="start">
|
|
8
|
+
<sl-icon :name="icon"></sl-icon>
|
|
9
|
+
{{ name }}
|
|
10
|
+
</div>
|
|
11
|
+
<sl-radio :value="paymenttype" ></sl-radio>
|
|
12
|
+
</div>
|
|
13
|
+
<slot>
|
|
14
|
+
{{description}}
|
|
15
|
+
</slot>
|
|
16
|
+
|
|
17
|
+
<template v-if="widget==='simple'">
|
|
18
|
+
<div slot="expand-icon" style="width:1em"></div>
|
|
19
|
+
<div slot="collapse-icon" style="width:1em"></div>
|
|
20
|
+
</template>
|
|
21
|
+
</sl-details>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script setup>
|
|
25
|
+
const emits = defineEmits(['change'])
|
|
26
|
+
const props = defineProps({
|
|
27
|
+
paymenttype: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: 'prepayment'
|
|
30
|
+
},
|
|
31
|
+
name: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: 'Paymentname'
|
|
34
|
+
},
|
|
35
|
+
icon: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: 'currency-euro'
|
|
38
|
+
},
|
|
39
|
+
description: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: 'Payment description'
|
|
42
|
+
},
|
|
43
|
+
widget:{
|
|
44
|
+
type:String,
|
|
45
|
+
default:'default' //simple
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
function selection(){
|
|
50
|
+
console.log("FFF")
|
|
51
|
+
emits('change',props.paymenttype)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<style scoped>
|
|
59
|
+
.payment-selection{
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
flex-wrap: nowrap;
|
|
63
|
+
flex-direction: row;
|
|
64
|
+
align-content: center;
|
|
65
|
+
justify-content: space-between;
|
|
66
|
+
width: 100%;
|
|
67
|
+
|
|
68
|
+
.start{
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
flex-wrap: nowrap;
|
|
72
|
+
gap:10px;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.simple::part(content){
|
|
77
|
+
display:none;
|
|
78
|
+
}
|
|
79
|
+
</style>
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<sl-radio-group :value="state.selection">
|
|
3
|
+
<sl-details-group>
|
|
4
|
+
|
|
5
|
+
<payment-option v-for="option in options" :key="option.id"
|
|
6
|
+
:paymenttype="option.paymenttype"
|
|
7
|
+
:name="option.name"
|
|
8
|
+
:icon="option.icon"
|
|
9
|
+
:widget="option.widget"
|
|
10
|
+
:description="option.description"
|
|
11
|
+
@change="optionChanged"
|
|
12
|
+
|
|
13
|
+
>
|
|
14
|
+
<template v-if="option.paymenttype.startsWith('unzer-')">
|
|
15
|
+
<form class="unzerUI form" ref="unzerform">
|
|
16
|
+
<template v-if="option.paymenttype === 'unzer-card'">
|
|
17
|
+
<div class="field">
|
|
18
|
+
<div id="card-element-id-number" class="unzerInput">
|
|
19
|
+
<!-- Card number UI Element is inserted here. -->
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="two fields">
|
|
23
|
+
<div class="field ten wide">
|
|
24
|
+
<div id="card-element-id-expiry" class="unzerInput">
|
|
25
|
+
<!-- Card expiry date UI Element is inserted here. -->
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="field six wide">
|
|
29
|
+
<div id="card-element-id-cvc" class="unzerInput">
|
|
30
|
+
<!-- Card CVC UI Element is inserted here. -->
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<template v-else-if="option.paymenttype === 'unzer-paypal'">
|
|
37
|
+
<div id="paypal-element" class="field"></div>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<template v-else-if="option.paymenttype === 'unzer-ideal'">
|
|
41
|
+
<div id="ideal-element" class="field"></div>
|
|
42
|
+
</template>
|
|
43
|
+
</form>
|
|
44
|
+
</template>
|
|
45
|
+
</payment-option>
|
|
46
|
+
|
|
47
|
+
</sl-details-group>
|
|
48
|
+
</sl-radio-group>
|
|
49
|
+
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<script setup>
|
|
53
|
+
import {usePaymentStore} from "../../../stores/payment"
|
|
54
|
+
import PaymentOption from "./PaymentOption.vue"
|
|
55
|
+
import {computed, reactive, ref} from 'vue'
|
|
56
|
+
import {Request} from "@viur/vue-utils";
|
|
57
|
+
|
|
58
|
+
const paymentStore = usePaymentStore()
|
|
59
|
+
|
|
60
|
+
const unzerform = ref(null)
|
|
61
|
+
|
|
62
|
+
const props = defineProps({
|
|
63
|
+
selection: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: null
|
|
66
|
+
},
|
|
67
|
+
options: {
|
|
68
|
+
type: Array,
|
|
69
|
+
default: () => []
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
const state = reactive({
|
|
74
|
+
unzer: computed(()=>{
|
|
75
|
+
//if (!orderStore.state.checkout) return null
|
|
76
|
+
return new unzer(orderStore.state.checkout.payment.public_key, {locale: 'de-DE'})
|
|
77
|
+
}),
|
|
78
|
+
selection:null,
|
|
79
|
+
hasError:false
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
function initUnzerForm(){
|
|
83
|
+
//Unzer field definition
|
|
84
|
+
if (state.selection === 'unzer-card' && !paymentStore.state.paymentHandler['unzer-card']) {
|
|
85
|
+
const card = state.unzer.Card();
|
|
86
|
+
// Rendering input field card number
|
|
87
|
+
card.create('number', {
|
|
88
|
+
containerId: 'card-element-id-number',
|
|
89
|
+
onlyIframe: false,
|
|
90
|
+
});
|
|
91
|
+
// Rendering input field card expiry
|
|
92
|
+
card.create('expiry', {
|
|
93
|
+
containerId: 'card-element-id-expiry',
|
|
94
|
+
onlyIframe: false,
|
|
95
|
+
});
|
|
96
|
+
// Rendering input field card cvc
|
|
97
|
+
card.create('cvc', {
|
|
98
|
+
containerId: 'card-element-id-cvc',
|
|
99
|
+
onlyIframe: false,
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
paymentStore.state.paymentHandler['unzer-card'] = card
|
|
103
|
+
} else if (state.selection === 'unzer-paypal' && !paymentStore.state.paymentHandler['unzer-paypal']) {
|
|
104
|
+
// Creating a PayPal instance
|
|
105
|
+
const paypal = state.unzer.Paypal()
|
|
106
|
+
// Rendering input field
|
|
107
|
+
//paypal.create('email', {
|
|
108
|
+
// containerId: 'paypal-element',
|
|
109
|
+
//});
|
|
110
|
+
paymentStore.state.paymentHandler['unzer-paypal']= paypal;
|
|
111
|
+
} else if (state.selection === 'unzer-sofort' && !paymentStore.state.paymentHandler['unzer-sofort']) {
|
|
112
|
+
const sofort = state.unzer.Sofort()
|
|
113
|
+
paymentStore.state.paymentHandler['unzer-sofort'] = sofort;
|
|
114
|
+
} else if (state.selection=== 'unzer-ideal' && !paymentStore.state.paymentHandler['unzer-ideal']) {
|
|
115
|
+
const ideal = state.unzer.Ideal()
|
|
116
|
+
ideal.create('ideal', {
|
|
117
|
+
containerId: 'ideal-element',
|
|
118
|
+
});
|
|
119
|
+
paymentStore.state.paymentHandler['unzer-ideal'] = ideal;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
function submitFormToUnzer(){
|
|
125
|
+
let paymenttarget = paymentStore.state.paymentSelection[0].split("-")[1]
|
|
126
|
+
//send to unzer
|
|
127
|
+
state.handler.createResource().then((result)=>{
|
|
128
|
+
Request.post(`/${orderStore.state.shopClient.shop_module}/pp_unzer_${paymenttarget}/save_type`, {dataObj:{
|
|
129
|
+
order_key: orderStore.state.currentOrderkey,
|
|
130
|
+
type_id: result.id,
|
|
131
|
+
}}).then(async (resp)=>{
|
|
132
|
+
let data = await resp.json()
|
|
133
|
+
orderStore.state.currentOrder = data
|
|
134
|
+
await orderStore.startCheckout()
|
|
135
|
+
}).catch(error => {
|
|
136
|
+
console.log(error)
|
|
137
|
+
})
|
|
138
|
+
}).catch((error)=> {
|
|
139
|
+
// handle errors
|
|
140
|
+
console.error(error)
|
|
141
|
+
})
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function optionChanged(type){
|
|
145
|
+
console.log(state)
|
|
146
|
+
console.log(paymentStore)
|
|
147
|
+
console.log(unzerform)
|
|
148
|
+
state.selection=type
|
|
149
|
+
initUnzerForm()
|
|
150
|
+
paymentStore.state.paymentSelection = state.selection
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
</script>
|
|
155
|
+
|
|
156
|
+
<style scoped>
|
|
157
|
+
|
|
158
|
+
</style>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<sl-tab-panel class="viur-shop-order-tab-panel" :name="tab">
|
|
3
|
+
<div v-if="!tabs[tab]?.['loaded']"></div>
|
|
4
|
+
<component
|
|
5
|
+
:is="tabs[tab].component"
|
|
6
|
+
v-bind="tabs[tab].props ? tabs[tab].props : ''"
|
|
7
|
+
@valid="emit('valid', $event)"
|
|
8
|
+
v-else
|
|
9
|
+
>
|
|
10
|
+
</component>
|
|
11
|
+
</sl-tab-panel>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup>
|
|
15
|
+
import {watch, onBeforeMount} from 'vue'
|
|
16
|
+
|
|
17
|
+
const props = defineProps({
|
|
18
|
+
tab: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
tabs: {
|
|
23
|
+
type: Object,
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
currentTab: {
|
|
27
|
+
type: String,
|
|
28
|
+
required: true,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const emit = defineEmits(["goToStart", "editAddress", 'valid']);
|
|
33
|
+
|
|
34
|
+
function goToStart() {
|
|
35
|
+
emit("goToStart");
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function goToUserData(e) {
|
|
39
|
+
emit("editAddress", e);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
watch(()=>props.currentTab === props.tab, (newVal,oldVal)=>{
|
|
43
|
+
if (newVal){
|
|
44
|
+
props.tabs[props.tab]['loaded'] = true
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
onBeforeMount(()=>{
|
|
49
|
+
if (props.currentTab === props.tab){
|
|
50
|
+
props.tabs[props.tab]['loaded'] = true
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<style scoped>
|
|
57
|
+
.viur-shop-order-tab-panel {
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.skeleton-overview header {
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
margin-bottom: 1rem;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.skeleton-overview header sl-skeleton:last-child {
|
|
67
|
+
flex: 0 0 auto;
|
|
68
|
+
width: 30%;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.skeleton-overview sl-skeleton {
|
|
72
|
+
margin-bottom: 1rem;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.skeleton-overview sl-skeleton:nth-child(1) {
|
|
76
|
+
float: left;
|
|
77
|
+
width: 3rem;
|
|
78
|
+
height: 3rem;
|
|
79
|
+
margin-right: 1rem;
|
|
80
|
+
vertical-align: middle;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.skeleton-overview sl-skeleton:nth-child(3) {
|
|
84
|
+
width: 95%;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.skeleton-overview sl-skeleton:nth-child(4) {
|
|
88
|
+
width: 80%;
|
|
89
|
+
}
|
|
90
|
+
</style>
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<sl-tab
|
|
3
|
+
class="viur-shop-order-tab"
|
|
4
|
+
slot="nav"
|
|
5
|
+
:panel="tab"
|
|
6
|
+
:disabled="false"
|
|
7
|
+
>
|
|
8
|
+
<div class="viur-shop-order-step">
|
|
9
|
+
<sl-icon
|
|
10
|
+
class="viur-shop-order-step-icon"
|
|
11
|
+
v-if="tabs[tab].icon?.name"
|
|
12
|
+
:name="tabs[tab].icon.name"
|
|
13
|
+
:library="tabs[tab].icon.library ? tabs[tab].icon.library : 'default'"
|
|
14
|
+
>
|
|
15
|
+
</sl-icon>
|
|
16
|
+
|
|
17
|
+
<div class="viur-shop-order-status-text">
|
|
18
|
+
{{ tabIdx + 1 }}.
|
|
19
|
+
<span class="viur-shop-order-status-span">{{
|
|
20
|
+
tabs[tab].displayName
|
|
21
|
+
}}</span>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<sl-icon
|
|
26
|
+
name="chevron-right"
|
|
27
|
+
class="viur-shop-order-tab-check"
|
|
28
|
+
v-if="tabIdx < stepperLength - 1"
|
|
29
|
+
>
|
|
30
|
+
</sl-icon>
|
|
31
|
+
</sl-tab>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script setup>
|
|
35
|
+
import { watch, onBeforeMount, inject } from "vue";
|
|
36
|
+
|
|
37
|
+
const props = defineProps({
|
|
38
|
+
tab: {
|
|
39
|
+
type: String,
|
|
40
|
+
required: true,
|
|
41
|
+
},
|
|
42
|
+
tabIdx: {
|
|
43
|
+
type: Number,
|
|
44
|
+
required: true,
|
|
45
|
+
},
|
|
46
|
+
stepperLength: {
|
|
47
|
+
type: Number,
|
|
48
|
+
required: true,
|
|
49
|
+
},
|
|
50
|
+
tabs: {
|
|
51
|
+
type: Object,
|
|
52
|
+
required: true,
|
|
53
|
+
},
|
|
54
|
+
currentTab: {
|
|
55
|
+
type: String,
|
|
56
|
+
required: true,
|
|
57
|
+
},
|
|
58
|
+
disabled: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: true,
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const stepperState = inject("stepperState");
|
|
65
|
+
|
|
66
|
+
// watch(()=>props.tabs[props.tab]['valid'],(newVal, oldVal)=>{
|
|
67
|
+
// let nextTab = stepperState.tabNames?.[props.tabIdx+1]
|
|
68
|
+
// if (!nextTab) return
|
|
69
|
+
|
|
70
|
+
// props.tabs[nextTab]['disabled'] = false //enable nextTab
|
|
71
|
+
// })
|
|
72
|
+
|
|
73
|
+
// onBeforeMount(()=>{
|
|
74
|
+
// props.tabs[props.tab]['disabled'] = true //default all tabs disabled
|
|
75
|
+
|
|
76
|
+
// if (props.currentTab === props.tab){
|
|
77
|
+
// props.tabs[props.tab]['disabled'] = false //activate the first one
|
|
78
|
+
// }
|
|
79
|
+
|
|
80
|
+
// })
|
|
81
|
+
</script>
|
|
82
|
+
|
|
83
|
+
<style scoped>
|
|
84
|
+
.viur-shop-order-tab {
|
|
85
|
+
width: 25%;
|
|
86
|
+
position: relative;
|
|
87
|
+
|
|
88
|
+
&::part(base) {
|
|
89
|
+
color: var(--shop-tab-color);
|
|
90
|
+
display: flex;
|
|
91
|
+
height: 100%;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&[aria-selected="true"] {
|
|
95
|
+
--shop-tab-color: var(--shop-tab-color--active);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@media (max-width: 900px) {
|
|
99
|
+
&::part(base) {
|
|
100
|
+
height: 100%;
|
|
101
|
+
padding: var(--sl-spacing-small) var(--sl-spacing-medium);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@media (max-width: 600px) {
|
|
106
|
+
&[aria-selected="true"] {
|
|
107
|
+
width: 100%;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&:not([aria-selected="true"]) {
|
|
111
|
+
.viur-shop-order-status-span {
|
|
112
|
+
display: none;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.viur-shop-order-step {
|
|
119
|
+
width: 100%;
|
|
120
|
+
height: 100%;
|
|
121
|
+
display: flex;
|
|
122
|
+
flex-direction: column;
|
|
123
|
+
justify-content: center;
|
|
124
|
+
align-items: center;
|
|
125
|
+
|
|
126
|
+
&:has(sl-icon) {
|
|
127
|
+
justify-content: flex-start;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
sl-icon {
|
|
131
|
+
font-size: 2.5em;
|
|
132
|
+
margin-bottom: 15px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
@media (max-width: 900px) {
|
|
136
|
+
justify-content: center;
|
|
137
|
+
|
|
138
|
+
sl-icon {
|
|
139
|
+
display: none;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.viur-shop-order-status-text {
|
|
145
|
+
font-size: 1em;
|
|
146
|
+
color: inherit;
|
|
147
|
+
text-align: center;
|
|
148
|
+
white-space: initial;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.viur-shop-order-tab-check {
|
|
152
|
+
position: absolute;
|
|
153
|
+
right: -0.5em;
|
|
154
|
+
|
|
155
|
+
@media (max-width: 900px) {
|
|
156
|
+
font-size: 0.7em;
|
|
157
|
+
right: -0.35em;
|
|
158
|
+
top: calc(50% - 0.35em);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
</style>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<sl-button
|
|
3
|
+
type="submit"
|
|
4
|
+
v-show="index !== 0 && state.showPrev"
|
|
5
|
+
@click="prevTab()"
|
|
6
|
+
>
|
|
7
|
+
Zurück
|
|
8
|
+
<!-- TODO: $t(i18n referenz) -->
|
|
9
|
+
</sl-button>
|
|
10
|
+
|
|
11
|
+
<sl-button
|
|
12
|
+
type="submit"
|
|
13
|
+
variant="primary"
|
|
14
|
+
@click="nextTab()"
|
|
15
|
+
v-show="state.showNext"
|
|
16
|
+
:disabled="!tabs[tab].valid"
|
|
17
|
+
>
|
|
18
|
+
Weiter
|
|
19
|
+
<!-- TODO: $t(i18n referenz) -->
|
|
20
|
+
</sl-button>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script setup>
|
|
24
|
+
import { computed, reactive } from "vue";
|
|
25
|
+
|
|
26
|
+
const props = defineProps({
|
|
27
|
+
index: {
|
|
28
|
+
type: Number,
|
|
29
|
+
required: true,
|
|
30
|
+
},
|
|
31
|
+
tab: {
|
|
32
|
+
type: String,
|
|
33
|
+
required: true,
|
|
34
|
+
},
|
|
35
|
+
tabs: {
|
|
36
|
+
type: Object,
|
|
37
|
+
required: true,
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
const state = reactive({
|
|
41
|
+
showPrev: computed(() => {
|
|
42
|
+
if (props.tabs[props.tab]["showPrev"] !== undefined) {
|
|
43
|
+
return !!props.tabs[props.tab]["showPrev"];
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
}),
|
|
47
|
+
showNext: computed(() => {
|
|
48
|
+
if (props.tabs[props.tab]["showNext"] !== undefined) {
|
|
49
|
+
return !!props.tabs[props.tab]["showNext"];
|
|
50
|
+
}
|
|
51
|
+
return true;
|
|
52
|
+
}),
|
|
53
|
+
});
|
|
54
|
+
const emit = defineEmits({ prevTab: null, nextTab: null });
|
|
55
|
+
|
|
56
|
+
function prevTab() {
|
|
57
|
+
emit("prevTab");
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function nextTab() {
|
|
61
|
+
emit("nextTab");
|
|
62
|
+
}
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<style scoped>
|
|
66
|
+
.sticky {
|
|
67
|
+
position: sticky;
|
|
68
|
+
}
|
|
69
|
+
</style>
|