@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
|
@@ -1,427 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- <slot name="form" v-if="mode === 'form'">
|
|
3
|
-
<sl-spinner v-if="!state.isInit"></sl-spinner>
|
|
4
|
-
<form @submit.prevent="sendData" v-else>
|
|
5
|
-
<h2 class="viur-shop-form-input-headline headline">Nutzterdaten</h2>
|
|
6
|
-
<div class="viur-shop-form-wrap">
|
|
7
|
-
<sl-input
|
|
8
|
-
name="email"
|
|
9
|
-
v-model="state.formValues['email']"
|
|
10
|
-
placeholder="E-Mail"
|
|
11
|
-
class="viur-shop-form-grid-w-4"
|
|
12
|
-
>
|
|
13
|
-
<label slot="label">E-Mail*</label>
|
|
14
|
-
</sl-input>
|
|
15
|
-
<sl-input
|
|
16
|
-
name="name"
|
|
17
|
-
v-model="state.formValues['lastname']"
|
|
18
|
-
placeholder="Name"
|
|
19
|
-
class="viur-shop-form-grid-w-2"
|
|
20
|
-
>
|
|
21
|
-
<label slot="label">Name*</label>
|
|
22
|
-
</sl-input>
|
|
23
|
-
<sl-input
|
|
24
|
-
name="firstname"
|
|
25
|
-
v-model="state.formValues['firstname']"
|
|
26
|
-
placeholder="Vorname"
|
|
27
|
-
class="viur-shop-form-grid-w-2"
|
|
28
|
-
>
|
|
29
|
-
<label slot="label">Vorname*</label>
|
|
30
|
-
</sl-input>
|
|
31
|
-
</div>
|
|
32
|
-
<div class="viur-shop-form-adress-wrapper">
|
|
33
|
-
<div class="viur-shop-form-adress-column">
|
|
34
|
-
<h2 class="viur-shop-form-input-headline headline">Lieferadresse</h2>
|
|
35
|
-
<component
|
|
36
|
-
:is="ShippingAdress"
|
|
37
|
-
v-bind="{
|
|
38
|
-
multiAdress: true,
|
|
39
|
-
items: cartStore.state.carts[cartStore.state.basket].items,
|
|
40
|
-
}"
|
|
41
|
-
v-for="a in state.shippingAdressAmount"
|
|
42
|
-
:key="a"
|
|
43
|
-
@adressInput="log"
|
|
44
|
-
@itemSelection="log"
|
|
45
|
-
></component>
|
|
46
|
-
|
|
47
|
-
<div class="viur-shop-form-btn-wrap">
|
|
48
|
-
|
|
49
|
-
<sl-button
|
|
50
|
-
size="medium"
|
|
51
|
-
@click="decreaseAdress"
|
|
52
|
-
title="Lieferadresse entfernen"
|
|
53
|
-
>
|
|
54
|
-
<sl-icon name="x-lg"
|
|
55
|
-
slot="prefix"></sl-icon>
|
|
56
|
-
</sl-button>
|
|
57
|
-
<sl-button
|
|
58
|
-
size="medium"
|
|
59
|
-
variant="primary"
|
|
60
|
-
@click="increaseAdress"
|
|
61
|
-
>
|
|
62
|
-
<sl-icon name="plus-lg"
|
|
63
|
-
slot="prefix"></sl-icon>
|
|
64
|
-
Lieferadresse hinzufügen
|
|
65
|
-
</sl-button>
|
|
66
|
-
|
|
67
|
-
</div>
|
|
68
|
-
|
|
69
|
-
<sl-alert
|
|
70
|
-
variant="warning"
|
|
71
|
-
duration="2000"
|
|
72
|
-
ref="shippingWarning"
|
|
73
|
-
closable
|
|
74
|
-
>
|
|
75
|
-
<sl-icon slot="icon" name="exclamation-triangle"></sl-icon>
|
|
76
|
-
<strong>{{ state.amountAlert.title }} </strong><br />
|
|
77
|
-
{{ state.amountAlert.msg }}
|
|
78
|
-
</sl-alert>
|
|
79
|
-
</div>
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
<sl-checkbox @sl-change="onCustomAdressChange" checked>
|
|
83
|
-
Rechnungsadresse wie Lieferadresse
|
|
84
|
-
</sl-checkbox>
|
|
85
|
-
|
|
86
|
-
<div class="viur-shop-form-adress-column" v-show="state.isCustomAdress">
|
|
87
|
-
<h2 class="viur-shop-form-headline headline">Rechnungsadresse</h2>
|
|
88
|
-
<div class="viur-shop-form-wrap">
|
|
89
|
-
<sl-input
|
|
90
|
-
name="street"
|
|
91
|
-
v-model="state.formValues['billing.street']"
|
|
92
|
-
placeholder="Straße"
|
|
93
|
-
class="viur-shop-form-grid-w-3"
|
|
94
|
-
>
|
|
95
|
-
<label slot="label">Strasse *</label>
|
|
96
|
-
</sl-input>
|
|
97
|
-
<sl-input
|
|
98
|
-
name="street"
|
|
99
|
-
v-model="state.formValues['billing.streetnumber']"
|
|
100
|
-
placeholder="Hausnummer"
|
|
101
|
-
type="number"
|
|
102
|
-
>
|
|
103
|
-
<label slot="label">Hausnummer *</label>
|
|
104
|
-
</sl-input>
|
|
105
|
-
<sl-input
|
|
106
|
-
name="street"
|
|
107
|
-
v-model="state.formValues['billing.areacode']"
|
|
108
|
-
placeholder="Postleitzahl"
|
|
109
|
-
type="number"
|
|
110
|
-
class="viur-shop-form-grid-w-2"
|
|
111
|
-
>
|
|
112
|
-
<label slot="label">Postleitzahl *</label>
|
|
113
|
-
</sl-input>
|
|
114
|
-
<sl-input
|
|
115
|
-
name="city"
|
|
116
|
-
v-model="state.formValues['billing.city']"
|
|
117
|
-
placeholder="Stadt"
|
|
118
|
-
class="viur-shop-form-grid-w-2"
|
|
119
|
-
>
|
|
120
|
-
<label slot="label">Stadt*</label>
|
|
121
|
-
</sl-input>
|
|
122
|
-
<sl-input
|
|
123
|
-
name="province"
|
|
124
|
-
v-model="state.formValues['billing.province']"
|
|
125
|
-
placeholder="Bundesland"
|
|
126
|
-
class="viur-shop-form-grid-w-2"
|
|
127
|
-
>
|
|
128
|
-
<label slot="label">Bundesland</label>
|
|
129
|
-
</sl-input>
|
|
130
|
-
</div>
|
|
131
|
-
</div>
|
|
132
|
-
</div>
|
|
133
|
-
</form>
|
|
134
|
-
</slot> -->
|
|
135
|
-
|
|
136
|
-
<div>
|
|
137
|
-
<h2 class="viur-shop-form-headline headline">Nutzterdaten</h2>
|
|
138
|
-
<template v-for="item in state.addSkel" :key="item[0]">
|
|
139
|
-
<bone
|
|
140
|
-
:is="getBoneWidget(item[1].type)"
|
|
141
|
-
v-if="item[1].visible && item[1].params.group === 'Customer Info'"
|
|
142
|
-
:name="item[0]"
|
|
143
|
-
:structure="structToDict(state.addSkel)"
|
|
144
|
-
:errors="state.errors[item[0]] ? state.errors[item[0]] : []"
|
|
145
|
-
:skel="state.formValues"
|
|
146
|
-
@change="changeEvent(item[0], $event)"
|
|
147
|
-
class="viur-shop-form-grid-w-2"
|
|
148
|
-
>
|
|
149
|
-
</bone>
|
|
150
|
-
</template>
|
|
151
|
-
</div>
|
|
152
|
-
|
|
153
|
-
<h2 class="viur-shop-form-headline headline">Lieferadresse</h2>
|
|
154
|
-
<div v-for="a in state.shippingAdressAmount" :key="a">
|
|
155
|
-
<sl-select
|
|
156
|
-
clearable
|
|
157
|
-
ref="itemSelection"
|
|
158
|
-
@sl-change="onItemSelect($event, a)"
|
|
159
|
-
@sl-clear="onItemReset($event, a)"
|
|
160
|
-
:label="state.selectedItem[a] ? cartStore.state.carts[state.selectedItem[a]].info.name : 'Warenkorb für Adresse wählen.'"
|
|
161
|
-
class="grid-w-4"
|
|
162
|
-
>
|
|
163
|
-
<sl-option v-for="(v, k) in cartStore.state.carts" :value="k">
|
|
164
|
-
{{ v.info.name }}</sl-option
|
|
165
|
-
>
|
|
166
|
-
</sl-select>
|
|
167
|
-
<template v-for="item in state.addSkel" :key="item[0]">
|
|
168
|
-
<bone
|
|
169
|
-
:is="getBoneWidget(item[1].type)"
|
|
170
|
-
v-if="item[1].visible && item[1].params.group === 'Customer Address'"
|
|
171
|
-
:name="item[0]"
|
|
172
|
-
:structure="structToDict(state.addSkel)"
|
|
173
|
-
:errors="state.errors[item[0]] ? state.errors[item[0]] : []"
|
|
174
|
-
:skel="state.formValues"
|
|
175
|
-
@change="changeEvent(item[0], $event)"
|
|
176
|
-
>
|
|
177
|
-
</bone>
|
|
178
|
-
</template>
|
|
179
|
-
</div>
|
|
180
|
-
|
|
181
|
-
<div v-if="state.isCustomAdress">
|
|
182
|
-
<h2 class="viur-shop-form-headline headline">Rechnungsadresse</h2>
|
|
183
|
-
<template v-for="item in state.addSkel" :key="item[0]">
|
|
184
|
-
<bone
|
|
185
|
-
:is="getBoneWidget(item[1].type)"
|
|
186
|
-
v-if="item[1].visible && item[1].params.group === 'Customer Address'"
|
|
187
|
-
:name="item[0]"
|
|
188
|
-
:structure="structToDict(state.addSkel)"
|
|
189
|
-
:errors="state.errors[item[0]] ? state.errors[item[0]] : []"
|
|
190
|
-
:skel="state.formValues"
|
|
191
|
-
@change="changeEvent(item[0], $event)"
|
|
192
|
-
>
|
|
193
|
-
</bone>
|
|
194
|
-
</template>
|
|
195
|
-
</div>
|
|
196
|
-
|
|
197
|
-
<div class="viur-shop-form-btn-wrap">
|
|
198
|
-
<sl-button
|
|
199
|
-
size="medium"
|
|
200
|
-
@click="decreaseAdress"
|
|
201
|
-
title="Lieferadresse entfernen"
|
|
202
|
-
>
|
|
203
|
-
<sl-icon name="x-lg" slot="prefix"></sl-icon>
|
|
204
|
-
</sl-button>
|
|
205
|
-
<sl-button size="medium" variant="primary" @click="increaseAdress">
|
|
206
|
-
<sl-icon name="plus-lg" slot="prefix"></sl-icon>
|
|
207
|
-
Lieferadresse hinzufügen
|
|
208
|
-
</sl-button>
|
|
209
|
-
</div>
|
|
210
|
-
|
|
211
|
-
<sl-alert variant="warning" duration="2000" ref="shippingWarning" closable>
|
|
212
|
-
<sl-icon slot="icon" name="exclamation-triangle"></sl-icon>
|
|
213
|
-
<strong>{{ state.amountAlert.title }} </strong><br />
|
|
214
|
-
{{ state.amountAlert.msg }}
|
|
215
|
-
</sl-alert>
|
|
216
|
-
|
|
217
|
-
<sl-checkbox @sl-change="onCustomAdressChange" checked>
|
|
218
|
-
Rechnungsadresse wie Lieferadresse
|
|
219
|
-
</sl-checkbox>
|
|
220
|
-
</template>
|
|
221
|
-
|
|
222
|
-
<script setup>
|
|
223
|
-
import { getBoneWidget } from "@viur/vue-utils/bones/edit/index";
|
|
224
|
-
|
|
225
|
-
import { reactive, computed, watch, ref, onBeforeMount } from "vue";
|
|
226
|
-
// import ShippingAdress from "./adress/ShippingAdress.vue";
|
|
227
|
-
import { useCartStore } from "../../../stores/cart";
|
|
228
|
-
|
|
229
|
-
const props = defineProps({
|
|
230
|
-
mode: { type: String, default: "form" },
|
|
231
|
-
});
|
|
232
|
-
|
|
233
|
-
const cartStore = useCartStore();
|
|
234
|
-
|
|
235
|
-
const state = reactive({
|
|
236
|
-
formValues: {},
|
|
237
|
-
requiredFieldsFilled: computed(() => {
|
|
238
|
-
// TODO: automatisierte logik anhand der required felder aus struktur der bones
|
|
239
|
-
if (state.isCustomAdress) {
|
|
240
|
-
return (
|
|
241
|
-
Object.keys(state.formValues).includes("city") &&
|
|
242
|
-
Object.keys(state.formValues).includes("street") &&
|
|
243
|
-
Object.keys(state.formValues).includes("billing.city") &&
|
|
244
|
-
Object.keys(state.formValues).includes("billing.street") &&
|
|
245
|
-
Object.keys(state.formValues).includes("email") &&
|
|
246
|
-
Object.keys(state.formValues).includes("firstname") &&
|
|
247
|
-
Object.keys(state.formValues).includes("lastname")
|
|
248
|
-
);
|
|
249
|
-
}
|
|
250
|
-
if (!state.isCustomAdress) {
|
|
251
|
-
return (
|
|
252
|
-
Object.keys(state.formValues).includes("city") &&
|
|
253
|
-
Object.keys(state.formValues).includes("street") &&
|
|
254
|
-
Object.keys(state.formValues).includes("email") &&
|
|
255
|
-
Object.keys(state.formValues).includes("firstname") &&
|
|
256
|
-
Object.keys(state.formValues).includes("lastname")
|
|
257
|
-
);
|
|
258
|
-
}
|
|
259
|
-
}),
|
|
260
|
-
isCustomAdress: false,
|
|
261
|
-
shippingAdressAmount: 1,
|
|
262
|
-
maxShippingAdress: computed(
|
|
263
|
-
() => Object.keys(cartStore.state.carts).length + 2,
|
|
264
|
-
),
|
|
265
|
-
amountAlert: { title: "", msg: "" },
|
|
266
|
-
items: null,
|
|
267
|
-
addSkel: null,
|
|
268
|
-
errors: {},
|
|
269
|
-
selectedItem: {},
|
|
270
|
-
isInit: computed(() => {
|
|
271
|
-
if (cartStore.state.carts[cartStore.state.basket]) {
|
|
272
|
-
return true;
|
|
273
|
-
} else {
|
|
274
|
-
return false;
|
|
275
|
-
}
|
|
276
|
-
}),
|
|
277
|
-
});
|
|
278
|
-
|
|
279
|
-
const itemSelection = ref(null);
|
|
280
|
-
const shippingWarning = ref(null);
|
|
281
|
-
|
|
282
|
-
// function updateFormValues(e){
|
|
283
|
-
// state.formValues[e.target.name] = e.target.value
|
|
284
|
-
// }
|
|
285
|
-
|
|
286
|
-
function sendData(e) {
|
|
287
|
-
console.log("sende daten...", state.formValues);
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
function onCustomAdressChange(e) {
|
|
291
|
-
if (e.target.checked) state.isCustomAdress = false;
|
|
292
|
-
if (!e.target.checked) state.isCustomAdress = true;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
function increaseAdress() {
|
|
296
|
-
if (state.shippingAdressAmount === state.maxShippingAdress) {
|
|
297
|
-
state.amountAlert.title = "Zu viele Lieferadressen";
|
|
298
|
-
state.amountAlert.msg = `Sie können nur maximal: "${state.maxShippingAdress}" Lieferadressen verwenden.`;
|
|
299
|
-
shippingWarning.value.show();
|
|
300
|
-
return;
|
|
301
|
-
}
|
|
302
|
-
state.shippingAdressAmount += 1;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
function changeEvent(boneName, ev) {
|
|
306
|
-
for (const [key, value] of Object.entries(ev.value[0])) {
|
|
307
|
-
state.formValues[key] = value;
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
function decreaseAdress() {
|
|
312
|
-
if (state.shippingAdressAmount === 1) {
|
|
313
|
-
state.amountAlert.title = "Zu wenig Lieferadressen";
|
|
314
|
-
state.amountAlert.msg =
|
|
315
|
-
"Mindestens eine Lieferadresse muss angegeben werden.";
|
|
316
|
-
shippingWarning.value.show();
|
|
317
|
-
return;
|
|
318
|
-
}
|
|
319
|
-
state.shippingAdressAmount -= 1;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
function log(e) {
|
|
323
|
-
console.log("emit hier", e);
|
|
324
|
-
Object.assign(state.formValues, e);
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
function onItemSelect(e, a) {
|
|
328
|
-
console.log(e.target.value);
|
|
329
|
-
if (!e.target.value.length) {
|
|
330
|
-
onItemReset();
|
|
331
|
-
return;
|
|
332
|
-
}
|
|
333
|
-
state.selectedItem[a] = e.target.value;
|
|
334
|
-
state.isItemSelected = true;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
function onItemReset(e, a) {
|
|
338
|
-
console.log("clearing...");
|
|
339
|
-
delete state.selectedItem[a]
|
|
340
|
-
state.isItemSelected = false;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
function getLabel(cart) {
|
|
344
|
-
console.log("hier", cart)
|
|
345
|
-
if (cart) {
|
|
346
|
-
return "Lieferadresse für: " + cartStore.state.carts[cart].info.name;
|
|
347
|
-
}
|
|
348
|
-
return "Warenkorb für Lieferadresse wählen.";
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
function structToDict(structure) {
|
|
352
|
-
let output = {};
|
|
353
|
-
|
|
354
|
-
structure.forEach((bone) => {
|
|
355
|
-
let boneName = bone[0];
|
|
356
|
-
let boneValues = bone[1];
|
|
357
|
-
|
|
358
|
-
output[boneName] = boneValues;
|
|
359
|
-
});
|
|
360
|
-
|
|
361
|
-
return output;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
watch(state.formValues, (newValues) => {
|
|
365
|
-
Object.entries(newValues).forEach(([k, v]) => {
|
|
366
|
-
if (v === "") {
|
|
367
|
-
delete state.formValues[k];
|
|
368
|
-
}
|
|
369
|
-
});
|
|
370
|
-
});
|
|
371
|
-
|
|
372
|
-
onBeforeMount(async () => {
|
|
373
|
-
await cartStore.getAdressStructure();
|
|
374
|
-
state.addSkel = cartStore.state.structure.address;
|
|
375
|
-
});
|
|
376
|
-
</script>
|
|
377
|
-
|
|
378
|
-
<style scoped>
|
|
379
|
-
.viur-shop-form-footer {
|
|
380
|
-
display: flex;
|
|
381
|
-
justify-content: space-between;
|
|
382
|
-
margin-top: var(--sl-spacing-large);
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
.viur-shop-form-adress-wrapper {
|
|
386
|
-
display: flex;
|
|
387
|
-
flex-direction: column;
|
|
388
|
-
gap: 1rem;
|
|
389
|
-
width: 100%;
|
|
390
|
-
justify-content: space-around;
|
|
391
|
-
align-items: flex-start;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
.viur-shop-form-adress-column {
|
|
395
|
-
align-self: flex-start;
|
|
396
|
-
flex-grow: 1;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
.viur-shop-form-wrap {
|
|
400
|
-
display: grid;
|
|
401
|
-
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
402
|
-
gap: 0 var(--sl-spacing-medium);
|
|
403
|
-
margin: var(--sl-spacing-large) 0;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
.viur-shop-form-grid-w-2 {
|
|
407
|
-
grid-column: span 2;
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
.viur-shop-form-grid-w-3 {
|
|
411
|
-
grid-column: span 3;
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
.viur-shop-form-grid-w-4 {
|
|
415
|
-
grid-column: span 4;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
.viur-shop-form-btn-wrap {
|
|
419
|
-
display: flex;
|
|
420
|
-
flex-direction: row;
|
|
421
|
-
flex-wrap: nowrap;
|
|
422
|
-
justify-content: space-between;
|
|
423
|
-
width: 100%;
|
|
424
|
-
|
|
425
|
-
margin-top: var(--sl-spacing-x-large);
|
|
426
|
-
}
|
|
427
|
-
</style>
|