@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.
- 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/package.json +25 -23
- package/src/components/ShopCart.vue +512 -0
- package/src/components/ShopOrderComplete.vue +73 -0
- package/src/components/ShopOrderConfirm.vue +291 -0
- package/src/components/ShopOrderStepper.vue +264 -0
- package/src/components/ShopUserData.vue +232 -0
- package/src/components/cart/CartLeaf.vue +277 -0
- package/src/components/cart/CartLeafModel.vue +304 -0
- package/src/components/cart/CartNode.vue +25 -0
- package/src/components/cart/CartTree.vue +54 -0
- package/src/components/cart/CartTreeWrapper.vue +73 -0
- package/src/components/cart/CartView.vue +205 -174
- package/src/components/cart/Discount.vue +91 -0
- package/src/components/lib/utils.js +0 -0
- package/src/components/order/OrderSidebar.vue +102 -0
- package/src/components/order/item/ItemView.vue +0 -1
- package/src/components/{cart → order/process}/ConfirmView.vue +94 -96
- package/src/components/order/process/ExampleUsage.vue +79 -66
- package/src/components/order/process/OrderTabHeader.vue +10 -1
- package/src/components/order/process/SelectPaymentProvider.vue +62 -0
- package/src/components/order/process/Shipping.vue +46 -0
- package/src/components/ui/ShopSummary.vue +145 -0
- package/src/components/ui/generic/ArticleList.vue +222 -0
- package/src/components/ui/generic/ExamplePagination.vue +236 -0
- package/src/components/ui/generic/ShopPriceFormatter.vue +41 -0
- package/src/components/ui/generic/alerts/ShopAlert.vue +19 -0
- package/src/components/ui/generic/makeData.js +39 -0
- package/src/components/ui/stepper/StepperItem.vue +39 -0
- package/src/components/ui/stepper/StepperTab.vue +133 -0
- package/src/components/ui/stepper/StepperTrigger.vue +35 -0
- package/src/components/ui/userdata/AddForm.vue +125 -0
- package/src/components/ui/userdata/AddressBox.vue +117 -0
- package/src/components/ui/userdata/BaseLayout.vue +94 -0
- package/src/components/ui/userdata/CustomBooleanBone.vue +58 -0
- package/src/components/ui/userdata/CustomSelectBone.vue +91 -0
- package/src/components/ui/userdata/CustomStringBone.vue +71 -0
- package/src/components/ui/userdata/DefaultLayout.vue +126 -0
- package/src/components/ui/userdata/SelectAddress.vue +21 -0
- package/src/components/ui/userdata/multi/ActionBar.vue +38 -0
- package/src/components/ui/userdata/multi/CartSelection.vue +42 -0
- package/src/main.js +50 -0
- package/src/router/index.js +1 -1
- package/src/stores/cart.js +267 -42
- package/src/style/ignite/.editorconfig +20 -0
- package/src/style/ignite/.github/workflows/ignite.yml +64 -0
- package/src/style/ignite/.github/workflows/node.yml +30 -0
- package/src/style/ignite/.postcssrc.cjs +25 -0
- package/src/style/ignite/CHANGELOG.md +244 -0
- package/src/style/ignite/LICENSE +21 -0
- package/src/style/ignite/README.md +92 -0
- package/src/style/ignite/dist/ignite.css +2019 -0
- package/src/style/ignite/dist/ignite.min.css +4 -0
- package/src/style/ignite/foundation/basic.css +371 -0
- package/src/style/ignite/foundation/color.css +323 -0
- package/src/style/ignite/foundation/config.css +188 -0
- package/src/style/ignite/foundation/grid.css +78 -0
- package/src/style/ignite/foundation/mediaqueries.css +71 -0
- package/src/style/ignite/foundation/reset.css +261 -0
- package/src/style/ignite/ignite.css +29 -0
- package/src/style/ignite/ignite.css.map +1 -0
- package/src/style/ignite/package-lock.json +5530 -0
- package/src/style/ignite/package.json +58 -0
- package/src/style/ignite/shoelace.css +19 -0
- package/src/style/ignite/themes/dark.css +12 -0
- package/src/style/ignite/themes/light.css +11 -0
- package/src/style/ignite/utilities/shoelace.css +537 -0
- package/src/style/ignite/utilities/utilities.css +24 -0
- package/vite.config.js +53 -0
- package/src/components/order/information/UserInfoMulti.vue +0 -427
- package/src/components/order/information/UserInformation.vue +0 -332
- package/src/components/order/process/OrderComplete.vue +0 -41
- package/src/components/order/process/OrderView.vue +0 -210
|
@@ -1,332 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- <slot name="form" v-if="mode === 'form'">
|
|
3
|
-
<form @submit.prevent="sendData">
|
|
4
|
-
<h2 class="viur-shop-form-headline headline">Nutzterdaten</h2>
|
|
5
|
-
<div class="viur-shop-form-wrap">
|
|
6
|
-
<sl-input
|
|
7
|
-
name="email"
|
|
8
|
-
v-model="state.formValues['email']"
|
|
9
|
-
placeholder="E-Mail"
|
|
10
|
-
class="viur-shop-form-grid-w-4"
|
|
11
|
-
>
|
|
12
|
-
<label slot="label">E-Mail*</label>
|
|
13
|
-
</sl-input>
|
|
14
|
-
<sl-input
|
|
15
|
-
name="name"
|
|
16
|
-
v-model="state.formValues['lastname']"
|
|
17
|
-
placeholder="Name"
|
|
18
|
-
class="viur-shop-form-grid-w-2"
|
|
19
|
-
>
|
|
20
|
-
<label slot="label">Name*</label>
|
|
21
|
-
</sl-input>
|
|
22
|
-
<sl-input
|
|
23
|
-
name="firstname"
|
|
24
|
-
v-model="state.formValues['firstname']"
|
|
25
|
-
placeholder="Vorname"
|
|
26
|
-
class="viur-shop-form-grid-w-2"
|
|
27
|
-
>
|
|
28
|
-
<label slot="label">Vorname*</label>
|
|
29
|
-
</sl-input>
|
|
30
|
-
</div>
|
|
31
|
-
<div class="viur-shop-form-adress-wrapper">
|
|
32
|
-
<div class="viur-shop-form-adress-column">
|
|
33
|
-
<h2 class="viur-shop-form-headline headline">Lieferadresse</h2>
|
|
34
|
-
<div class="viur-shop-form-wrap">
|
|
35
|
-
<sl-input
|
|
36
|
-
name="street"
|
|
37
|
-
v-model="state.formValues['street']"
|
|
38
|
-
placeholder="Straße"
|
|
39
|
-
class="viur-shop-form-grid-w-3"
|
|
40
|
-
>
|
|
41
|
-
<label slot="label">Strasse *</label>
|
|
42
|
-
</sl-input>
|
|
43
|
-
<sl-input
|
|
44
|
-
name="street"
|
|
45
|
-
v-model="state.formValues['streetnumber']"
|
|
46
|
-
placeholder="Hausnummer"
|
|
47
|
-
type="number"
|
|
48
|
-
>
|
|
49
|
-
<label slot="label">Hausnummer *</label>
|
|
50
|
-
</sl-input>
|
|
51
|
-
<sl-input
|
|
52
|
-
name="street"
|
|
53
|
-
v-model="state.formValues['areacode']"
|
|
54
|
-
placeholder="Postleitzahl"
|
|
55
|
-
class="viur-shop-form-grid-w-2"
|
|
56
|
-
type="number"
|
|
57
|
-
>
|
|
58
|
-
<label slot="label">Postleitzahl *</label>
|
|
59
|
-
</sl-input>
|
|
60
|
-
<sl-input
|
|
61
|
-
name="city"
|
|
62
|
-
v-model="state.formValues['city']"
|
|
63
|
-
placeholder="Stadt"
|
|
64
|
-
class="viur-shop-form-grid-w-2"
|
|
65
|
-
>
|
|
66
|
-
<label slot="label">Stadt*</label>
|
|
67
|
-
</sl-input>
|
|
68
|
-
<sl-input
|
|
69
|
-
name="province"
|
|
70
|
-
v-model="state.formValues['province']"
|
|
71
|
-
placeholder="Bundesland"
|
|
72
|
-
class="viur-shop-form-grid-w-2"
|
|
73
|
-
>
|
|
74
|
-
<label slot="label">Bundesland</label>
|
|
75
|
-
</sl-input>
|
|
76
|
-
</div>
|
|
77
|
-
</div>
|
|
78
|
-
|
|
79
|
-
<sl-checkbox @sl-change="onCustomAdressChange" checked>
|
|
80
|
-
Rechnungsadresse wie Lieferadresse
|
|
81
|
-
</sl-checkbox>
|
|
82
|
-
|
|
83
|
-
<div class="viur-shop-form-adress-column" v-show="state.isCustomAdress">
|
|
84
|
-
<h2 class="viur-shop-form-headline headline">Rechnungsadresse</h2>
|
|
85
|
-
<div class="viur-shop-form-wrap">
|
|
86
|
-
<sl-input
|
|
87
|
-
name="street"
|
|
88
|
-
v-model="state.formValues['billing.street']"
|
|
89
|
-
placeholder="Straße"
|
|
90
|
-
class="viur-shop-form-grid-w-3"
|
|
91
|
-
>
|
|
92
|
-
<label slot="label">Strasse *</label>
|
|
93
|
-
</sl-input>
|
|
94
|
-
<sl-input
|
|
95
|
-
name="street"
|
|
96
|
-
v-model="state.formValues['billing.streetnumber']"
|
|
97
|
-
placeholder="Hausnummer"
|
|
98
|
-
type="number"
|
|
99
|
-
>
|
|
100
|
-
<label slot="label">Hausnummer *</label>
|
|
101
|
-
</sl-input>
|
|
102
|
-
<sl-input
|
|
103
|
-
name="city"
|
|
104
|
-
v-model="state.formValues['billing.areacode']"
|
|
105
|
-
placeholder="Postleitzahl"
|
|
106
|
-
type="number"
|
|
107
|
-
class="viur-shop-form-grid-w-2"
|
|
108
|
-
>
|
|
109
|
-
<label slot="label">Postleitzahl *</label>
|
|
110
|
-
</sl-input>
|
|
111
|
-
<sl-input
|
|
112
|
-
name="city"
|
|
113
|
-
v-model="state.formValues['billing.city']"
|
|
114
|
-
placeholder="Stadt"
|
|
115
|
-
class="viur-shop-form-grid-w-2"
|
|
116
|
-
>
|
|
117
|
-
<label slot="label">Stadt*</label>
|
|
118
|
-
</sl-input>
|
|
119
|
-
<sl-input
|
|
120
|
-
name="province"
|
|
121
|
-
v-model="state.formValues['billing.province']"
|
|
122
|
-
placeholder="Bundesland"
|
|
123
|
-
class="viur-shop-form-grid-w-2"
|
|
124
|
-
>
|
|
125
|
-
<label slot="label">Bundesland</label>
|
|
126
|
-
</sl-input>
|
|
127
|
-
</div>
|
|
128
|
-
</div>
|
|
129
|
-
</div>
|
|
130
|
-
<div class="viur-shop-form-footer">
|
|
131
|
-
<sl-button type="submit"> Zurück </sl-button>
|
|
132
|
-
<sl-button
|
|
133
|
-
:disabled="!state.requiredFieldsFilled"
|
|
134
|
-
type="submit"
|
|
135
|
-
variant="primary"
|
|
136
|
-
>
|
|
137
|
-
Weiter
|
|
138
|
-
</sl-button>
|
|
139
|
-
</div>
|
|
140
|
-
</form>
|
|
141
|
-
</slot> -->
|
|
142
|
-
<!-- <div class="viur-shop-form-wrap"> -->
|
|
143
|
-
|
|
144
|
-
<div>
|
|
145
|
-
<h2 class="viur-shop-form-headline headline">Nutzterdaten</h2>
|
|
146
|
-
<template v-for="item in state.addSkel" :key="item[0]">
|
|
147
|
-
<bone
|
|
148
|
-
:is="getBoneWidget(item[1].type)"
|
|
149
|
-
v-if="item[1].visible && item[1].params.group === 'Customer Info'"
|
|
150
|
-
:name="item[0]"
|
|
151
|
-
:structure="structToDict(state.addSkel)"
|
|
152
|
-
:errors="state.errors[item[0]] ? state.errors[item[0]] : []"
|
|
153
|
-
:skel="state.formValues"
|
|
154
|
-
@change="changeEvent(item[0], $event)"
|
|
155
|
-
class="viur-shop-form-grid-w-2"
|
|
156
|
-
>
|
|
157
|
-
</bone>
|
|
158
|
-
</template>
|
|
159
|
-
</div>
|
|
160
|
-
<div>
|
|
161
|
-
<h2 class="viur-shop-form-headline headline">Lieferadresse</h2>
|
|
162
|
-
<template v-for="item in state.addSkel" :key="item[0]">
|
|
163
|
-
<bone
|
|
164
|
-
:is="getBoneWidget(item[1].type)"
|
|
165
|
-
v-if="item[1].visible && item[1].params.group === 'Customer Address'"
|
|
166
|
-
:name="item[0]"
|
|
167
|
-
:structure="structToDict(state.addSkel)"
|
|
168
|
-
:errors="state.errors[item[0]] ? state.errors[item[0]] : []"
|
|
169
|
-
:skel="state.formValues"
|
|
170
|
-
@change="changeEvent(item[0], $event)"
|
|
171
|
-
>
|
|
172
|
-
</bone>
|
|
173
|
-
</template>
|
|
174
|
-
</div>
|
|
175
|
-
<div v-if="state.isCustomAdress">
|
|
176
|
-
<h2 class="viur-shop-form-headline headline">Rechnungsadresse</h2>
|
|
177
|
-
<template v-for="item in state.addSkel" :key="item[0]">
|
|
178
|
-
<bone
|
|
179
|
-
:is="getBoneWidget(item[1].type)"
|
|
180
|
-
v-if="item[1].visible && item[1].params.group === 'Customer Address'"
|
|
181
|
-
:name="item[0]"
|
|
182
|
-
:structure="structToDict(state.addSkel)"
|
|
183
|
-
:errors="state.errors[item[0]] ? state.errors[item[0]] : []"
|
|
184
|
-
:skel="state.formValues"
|
|
185
|
-
@change="changeEvent(item[0], $event)"
|
|
186
|
-
>
|
|
187
|
-
</bone>
|
|
188
|
-
</template>
|
|
189
|
-
</div>
|
|
190
|
-
|
|
191
|
-
<sl-checkbox @sl-change="onCustomAdressChange" checked>
|
|
192
|
-
Rechnungsadresse wie Lieferadresse
|
|
193
|
-
</sl-checkbox>
|
|
194
|
-
|
|
195
|
-
<!-- </div> -->
|
|
196
|
-
</template>
|
|
197
|
-
|
|
198
|
-
<script setup>
|
|
199
|
-
import { getBoneWidget } from "@viur/vue-utils/bones/edit/index";
|
|
200
|
-
|
|
201
|
-
import { reactive, computed, watch, onBeforeMount } from "vue";
|
|
202
|
-
import { useCartStore } from "../../../stores/cart";
|
|
203
|
-
|
|
204
|
-
const props = defineProps({
|
|
205
|
-
mode: { type: String, default: "form" },
|
|
206
|
-
conditions: { type: Function },
|
|
207
|
-
});
|
|
208
|
-
|
|
209
|
-
const cartStore = useCartStore();
|
|
210
|
-
|
|
211
|
-
const state = reactive({
|
|
212
|
-
formValues: {},
|
|
213
|
-
requiredFieldsFilled: computed(() => {
|
|
214
|
-
if (state.isCustomAdress) {
|
|
215
|
-
return (
|
|
216
|
-
Object.keys(state.formValues).includes("city") &&
|
|
217
|
-
Object.keys(state.formValues).includes("street") &&
|
|
218
|
-
Object.keys(state.formValues).includes("billing.city") &&
|
|
219
|
-
Object.keys(state.formValues).includes("billing.street") &&
|
|
220
|
-
Object.keys(state.formValues).includes("email") &&
|
|
221
|
-
Object.keys(state.formValues).includes("firstname") &&
|
|
222
|
-
Object.keys(state.formValues).includes("lastname")
|
|
223
|
-
);
|
|
224
|
-
}
|
|
225
|
-
if (!state.isCustomAdress) {
|
|
226
|
-
return (
|
|
227
|
-
Object.keys(state.formValues).includes("city") &&
|
|
228
|
-
Object.keys(state.formValues).includes("street") &&
|
|
229
|
-
Object.keys(state.formValues).includes("email") &&
|
|
230
|
-
Object.keys(state.formValues).includes("firstname") &&
|
|
231
|
-
Object.keys(state.formValues).includes("lastname")
|
|
232
|
-
);
|
|
233
|
-
}
|
|
234
|
-
}),
|
|
235
|
-
isCustomAdress: false,
|
|
236
|
-
addSkel: null,
|
|
237
|
-
errors: {},
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
// function updateFormValues(e){
|
|
241
|
-
// state.formValues[e.target.name] = e.target.value
|
|
242
|
-
// }
|
|
243
|
-
|
|
244
|
-
function sendData(e) {
|
|
245
|
-
console.log("sende daten...", state.formValues);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
function onCustomAdressChange(e) {
|
|
249
|
-
if (e.target.checked) state.isCustomAdress = false;
|
|
250
|
-
if (!e.target.checked) state.isCustomAdress = true;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
function changeEvent(boneName, ev) {
|
|
254
|
-
for (const [key, value] of Object.entries(ev.value[0])) {
|
|
255
|
-
state.formValues[key] = value;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
function structToDict(structure) {
|
|
260
|
-
let output = {};
|
|
261
|
-
|
|
262
|
-
structure.forEach((bone) => {
|
|
263
|
-
let boneName = bone[0];
|
|
264
|
-
let boneValues = bone[1];
|
|
265
|
-
|
|
266
|
-
output[boneName] = boneValues;
|
|
267
|
-
});
|
|
268
|
-
|
|
269
|
-
return output;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
function initBoneNames(structure) {
|
|
273
|
-
let output = [];
|
|
274
|
-
|
|
275
|
-
structure.forEach((bone) => {
|
|
276
|
-
let boneName = bone[0];
|
|
277
|
-
|
|
278
|
-
output.push(boneName);
|
|
279
|
-
});
|
|
280
|
-
|
|
281
|
-
return output;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
watch(state.formValues, (newValues) => {
|
|
285
|
-
Object.entries(newValues).forEach(([k, v]) => {
|
|
286
|
-
if (v === "") {
|
|
287
|
-
delete state.formValues[k];
|
|
288
|
-
}
|
|
289
|
-
});
|
|
290
|
-
});
|
|
291
|
-
|
|
292
|
-
onBeforeMount(async () => {
|
|
293
|
-
await cartStore.getAdressStructure();
|
|
294
|
-
state.addSkel = cartStore.state.structure.address;
|
|
295
|
-
});
|
|
296
|
-
</script>
|
|
297
|
-
|
|
298
|
-
<style scoped>
|
|
299
|
-
|
|
300
|
-
.viur-shop-form-adress-wrapper {
|
|
301
|
-
display: flex;
|
|
302
|
-
flex-direction: column;
|
|
303
|
-
gap: 1rem;
|
|
304
|
-
width: 100%;
|
|
305
|
-
justify-content: space-around;
|
|
306
|
-
align-items: flex-start;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
.viur-shop-form-adress-column {
|
|
310
|
-
align-self: flex-start;
|
|
311
|
-
flex-grow: 1;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
.viur-shop-form-wrap {
|
|
315
|
-
display: grid;
|
|
316
|
-
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
317
|
-
gap: 0 var(--sl-spacing-medium);
|
|
318
|
-
margin: var(--sl-spacing-large) 0;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
.viur-shop-form-grid-w-2 {
|
|
322
|
-
grid-column: span 2;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
.viur-shop-form-grid-w-3 {
|
|
326
|
-
grid-column: span 3;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
.viur-shop-form-grid-w-4 {
|
|
330
|
-
grid-column: span 4;
|
|
331
|
-
}
|
|
332
|
-
</style>
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="bind">
|
|
3
|
-
<h1 class="headline">Vielen Dank für Ihre Bestellung</h1>
|
|
4
|
-
<br>
|
|
5
|
-
<p class="paragraph">
|
|
6
|
-
<strong>Ihre Bestellnummer:</strong> 123345670
|
|
7
|
-
</p>
|
|
8
|
-
<p class="paragraph">
|
|
9
|
-
Wir haben Ihre Bestellung erhalten und werden diese schenllstmöglich bearbeiten.<br>
|
|
10
|
-
Sie erhalten in wenigen Minuten eine Bestätigung per E-Mail.
|
|
11
|
-
|
|
12
|
-
<div class="btn-wrap">
|
|
13
|
-
<sl-button size="medium">
|
|
14
|
-
Zur Startseite
|
|
15
|
-
</sl-button>
|
|
16
|
-
|
|
17
|
-
<sl-button variant="primary"
|
|
18
|
-
size="medium">
|
|
19
|
-
Weiter Einkaufen
|
|
20
|
-
</sl-button>
|
|
21
|
-
</div>
|
|
22
|
-
</p>
|
|
23
|
-
|
|
24
|
-
</div>
|
|
25
|
-
</template>
|
|
26
|
-
|
|
27
|
-
<script setup></script>
|
|
28
|
-
|
|
29
|
-
<style scoped>
|
|
30
|
-
|
|
31
|
-
.btn-wrap{
|
|
32
|
-
display: flex;
|
|
33
|
-
flex-direction: row;
|
|
34
|
-
flex-wrap: nowrap;
|
|
35
|
-
justify-content: space-between;
|
|
36
|
-
width: 100%;
|
|
37
|
-
|
|
38
|
-
margin-top: var(--sl-spacing-x-large);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
</style>
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="bind viur-shop-wrap">
|
|
3
|
-
<sl-tab-group
|
|
4
|
-
class="viur-shop-order-tab"
|
|
5
|
-
noScrollControls
|
|
6
|
-
@sl-tab-show="onTabChange"
|
|
7
|
-
ref="tabGroup"
|
|
8
|
-
>
|
|
9
|
-
<sl-tab
|
|
10
|
-
slot="nav"
|
|
11
|
-
:panel="tab"
|
|
12
|
-
v-for="(tab, index) in state.tabNames"
|
|
13
|
-
:key="tab"
|
|
14
|
-
:disabled="tabs[tab].disabled"
|
|
15
|
-
>
|
|
16
|
-
<div class="viur-shop-order-step">
|
|
17
|
-
<sl-icon
|
|
18
|
-
:name="tabs[tab].icon.name"
|
|
19
|
-
:library="tabs[tab].icon.library"
|
|
20
|
-
>
|
|
21
|
-
</sl-icon>
|
|
22
|
-
<div class="viur-shop-order-status-text">
|
|
23
|
-
{{ index + 1 }}. {{ tabs[tab].displayName }}
|
|
24
|
-
</div>
|
|
25
|
-
</div>
|
|
26
|
-
<sl-icon
|
|
27
|
-
name="chevron-right"
|
|
28
|
-
class="viur-shop-order-tab-check"
|
|
29
|
-
v-if="index < state.tabNames.length - 1"
|
|
30
|
-
></sl-icon>
|
|
31
|
-
</sl-tab>
|
|
32
|
-
|
|
33
|
-
<sl-tab-panel
|
|
34
|
-
:name="tab"
|
|
35
|
-
v-for="(tab, index) in state.tabNames"
|
|
36
|
-
:key="tab"
|
|
37
|
-
>
|
|
38
|
-
<component
|
|
39
|
-
:is="tabs[tab].component"
|
|
40
|
-
v-bind="tabs[tab].props ? tabs[tab].props : ''"
|
|
41
|
-
>
|
|
42
|
-
</component>
|
|
43
|
-
<div
|
|
44
|
-
class="viur-shop-form-footer"
|
|
45
|
-
:class="{ 'flex-end': state.isFirstTab(index) }"
|
|
46
|
-
v-if="index !== state.tabNames.length - 1"
|
|
47
|
-
>
|
|
48
|
-
<sl-button type="submit" v-show="index !== 0" @click="prevTab(state.tabNames[index-1])">
|
|
49
|
-
Zurück
|
|
50
|
-
</sl-button>
|
|
51
|
-
<!-- :disabled="!state.requiredFieldsFilled" -->
|
|
52
|
-
<sl-button type="submit" variant="primary" @click="nextTab(state.tabNames[index+1])">
|
|
53
|
-
Weiter
|
|
54
|
-
</sl-button>
|
|
55
|
-
</div>
|
|
56
|
-
</sl-tab-panel>
|
|
57
|
-
</sl-tab-group>
|
|
58
|
-
|
|
59
|
-
<div class="viur-shop-sidebar" id="order_sidebar"></div>
|
|
60
|
-
</div>
|
|
61
|
-
</template>
|
|
62
|
-
|
|
63
|
-
<script setup>
|
|
64
|
-
import { reactive, computed, ref } from "vue";
|
|
65
|
-
|
|
66
|
-
const props = defineProps({
|
|
67
|
-
tabs: {
|
|
68
|
-
type: Object,
|
|
69
|
-
required: true,
|
|
70
|
-
},
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
const emit = defineEmits(["tabChange"]);
|
|
74
|
-
|
|
75
|
-
const state = reactive({
|
|
76
|
-
tabNames: computed(() => sortTabs(props.tabs)),
|
|
77
|
-
isFirstTab: (index) => {
|
|
78
|
-
if (index === 0) {
|
|
79
|
-
return true;
|
|
80
|
-
}
|
|
81
|
-
return false;
|
|
82
|
-
},
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
const tabGroup = ref(null);
|
|
86
|
-
|
|
87
|
-
function sortTabs(tabs) {
|
|
88
|
-
let sortedArray = [];
|
|
89
|
-
let outputArray = [];
|
|
90
|
-
|
|
91
|
-
for (const tab in tabs) {
|
|
92
|
-
if (tabs[tab].position) {
|
|
93
|
-
sortedArray.push([tab, tabs[tab].position]);
|
|
94
|
-
} else {
|
|
95
|
-
sortedArray.push([tab, 0]);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
sortedArray.sort((a, b) => {
|
|
100
|
-
return a[1] - b[1];
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
sortedArray.forEach((tab) => {
|
|
104
|
-
outputArray.push(tab[0]);
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
return outputArray;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function onTabChange(e) {
|
|
111
|
-
emit("tabChange", e);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
function prevTab(tabName) {
|
|
116
|
-
tabGroup.value.show(tabName);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
function nextTab(tabName) {
|
|
120
|
-
tabGroup.value.show(tabName);
|
|
121
|
-
}
|
|
122
|
-
</script>
|
|
123
|
-
|
|
124
|
-
<style scoped>
|
|
125
|
-
.viur-shop-wrap {
|
|
126
|
-
flex-direction: row;
|
|
127
|
-
gap: var(--sl-spacing-x-large);
|
|
128
|
-
align-items: flex-start;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.viur-shop-sidebar {
|
|
132
|
-
display: flex;
|
|
133
|
-
flex-direction: column;
|
|
134
|
-
background-color: var(--sl-color-neutral-100);
|
|
135
|
-
min-width: 300px;
|
|
136
|
-
padding: var(--sl-spacing-medium);
|
|
137
|
-
position: sticky;
|
|
138
|
-
top: 0;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.viur-shop-order-tab {
|
|
142
|
-
sl-tab {
|
|
143
|
-
width: 25%;
|
|
144
|
-
|
|
145
|
-
&::part(base) {
|
|
146
|
-
width: 100%;
|
|
147
|
-
height: 100%;
|
|
148
|
-
display: flex;
|
|
149
|
-
justify-content: center;
|
|
150
|
-
align-items: center;
|
|
151
|
-
position: relative;
|
|
152
|
-
color: var(--sl-color-neutral-400);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
&[aria-selected="true"]::part(base) {
|
|
156
|
-
color: var(--ignt-color-primary) !important;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
.viur-shop-order-step {
|
|
162
|
-
width: 100%;
|
|
163
|
-
height: 100%;
|
|
164
|
-
display: flex;
|
|
165
|
-
flex-direction: column;
|
|
166
|
-
justify-content: flex-start;
|
|
167
|
-
align-items: center;
|
|
168
|
-
|
|
169
|
-
@media (--ignt-mq-max-break-small) {
|
|
170
|
-
justify-content: center;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
sl-icon {
|
|
174
|
-
font-size: 2.5em;
|
|
175
|
-
margin-bottom: 10px;
|
|
176
|
-
|
|
177
|
-
@media (--ignt-mq-max-break-small) {
|
|
178
|
-
display: none;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.viur-shop-order-tab-check {
|
|
184
|
-
position: absolute;
|
|
185
|
-
right: -0.5em;
|
|
186
|
-
|
|
187
|
-
@media (--ignt-mq-max-break-small) {
|
|
188
|
-
font-size: 0.7em;
|
|
189
|
-
right: -0.35em;
|
|
190
|
-
top: calc(50% - 0.35em);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
.viur-shop-order-status-text {
|
|
195
|
-
font-size: 0.8em;
|
|
196
|
-
color: inherit;
|
|
197
|
-
text-align: center;
|
|
198
|
-
margin-top: 0.6em;
|
|
199
|
-
white-space: initial;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.viur-shop-form-footer {
|
|
203
|
-
display: flex;
|
|
204
|
-
justify-content: space-between;
|
|
205
|
-
margin-top: var(--sl-spacing-large);
|
|
206
|
-
}
|
|
207
|
-
.flex-end {
|
|
208
|
-
justify-content: flex-end;
|
|
209
|
-
}
|
|
210
|
-
</style>
|