@viur/shop-components 0.0.1-dev.9 → 0.1.1

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 (56) hide show
  1. package/.editorconfig +16 -0
  2. package/.github/workflows/npm-publish.yml +42 -0
  3. package/.gitmodules +3 -0
  4. package/LICENSE +21 -0
  5. package/README.md +13 -2
  6. package/package.json +23 -11
  7. package/src/Shop.vue +232 -0
  8. package/src/ShopOrderStepper.vue +114 -0
  9. package/src/ShopSummary.vue +196 -0
  10. package/src/Steps/ShopCart.vue +57 -0
  11. package/src/Steps/ShopOrderComplete.vue +32 -0
  12. package/src/Steps/ShopOrderConfirm.vue +300 -0
  13. package/src/Steps/ShopPaymentProvider.vue +56 -0
  14. package/src/Steps/ShopShippingMethod.vue +67 -0
  15. package/src/Steps/ShopUserDataGuest.vue +82 -0
  16. package/src/Steps/index.js +15 -0
  17. package/src/components/AddressForm.vue +95 -0
  18. package/src/components/AddressFormLayout.vue +107 -0
  19. package/src/components/CardSelector.vue +68 -0
  20. package/src/components/CartItem.vue +353 -0
  21. package/src/components/CartItemSmall.vue +257 -0
  22. package/src/components/DiscountInput.vue +91 -0
  23. package/src/components/LoadingHandler.vue +76 -0
  24. package/src/components/PaymentOption.vue +78 -0
  25. package/src/components/PaymentProviderUnzer.vue +201 -0
  26. package/src/components/PaymentSelector.vue +55 -0
  27. package/src/components/ShopAlert.vue +30 -0
  28. package/src/components/StepperTab.vue +132 -0
  29. package/src/components/dialogButton.vue +49 -0
  30. package/src/composables/address.js +95 -0
  31. package/src/composables/cart.js +189 -0
  32. package/src/composables/order.js +80 -0
  33. package/src/composables/payment.js +75 -0
  34. package/src/composables/shipping.js +40 -0
  35. package/src/main.js +44 -0
  36. package/src/shop.js +252 -0
  37. package/src/translations/de.js +36 -0
  38. package/src/translations/en.js +5 -0
  39. package/src/utils.js +56 -0
  40. package/vite.config.js +51 -0
  41. package/src/components/cart/CartView.vue +0 -693
  42. package/src/components/cart/ConfirmView.vue +0 -314
  43. package/src/components/order/category/CategoryList.vue +0 -83
  44. package/src/components/order/category/CategoryView.vue +0 -143
  45. package/src/components/order/information/UserInfoMulti.vue +0 -427
  46. package/src/components/order/information/UserInformation.vue +0 -332
  47. package/src/components/order/information/adress/ShippingAdress.vue +0 -143
  48. package/src/components/order/item/ItemCard.vue +0 -168
  49. package/src/components/order/item/ItemView.vue +0 -233
  50. package/src/components/order/process/ExampleUsage.vue +0 -100
  51. package/src/components/order/process/OrderComplete.vue +0 -41
  52. package/src/components/order/process/OrderTabHeader.vue +0 -7
  53. package/src/components/order/process/OrderView.vue +0 -210
  54. package/src/router/index.js +0 -103
  55. package/src/stores/cart.js +0 -119
  56. package/src/views/ViewMissing.vue +0 -20
@@ -1,314 +0,0 @@
1
- <template>
2
- <Loader v-if="!state.cartIsInit"></Loader>
3
-
4
- <template v-else>
5
- <div class="list">
6
- <h2 class="viur-shop-cart-headline headline">Bestellung prüfen</h2>
7
- <br />
8
-
9
- <div class="viur-shop-cart-address-wrap">
10
- <div class="viur-shop-cart-address">
11
- <div class="viur-shop-cart-address-headline">
12
- Versandadresse
13
- <sl-button outline size="small">
14
- <sl-icon name="pencil" slot="prefix"></sl-icon>
15
- </sl-button>
16
- </div>
17
- Roland Brose<br />
18
- Speicherstraße 33<br />
19
- 44147 Dortmund, DE<br />
20
- <br />
21
- rb@mausbrand.de<br />
22
- 0231 21 34 68 90
23
- </div>
24
- <div class="viur-shop-cart-address">
25
- <div class="viur-shop-cart-address-headline">
26
- Rechnungsadresse
27
- <sl-button outline size="small">
28
- <sl-icon name="pencil" slot="prefix"></sl-icon>
29
- </sl-button>
30
- </div>
31
- Roland Brose<br />
32
- Speicherstraße 33<br />
33
- 44147 Dortmund, DE<br />
34
- <br />
35
- rb@mausbrand.de<br />
36
- 0231 21 34 68 90
37
- </div>
38
- </div>
39
-
40
- <div class="viur-shop-cart-payment">
41
- <div class="viur-shop-cart-payment-method">
42
- <span>Zahlungsmethode:</span>
43
- Paypal
44
- </div>
45
- <sl-button outline size="small">
46
- <sl-icon name="pencil" slot="prefix"></sl-icon>
47
- </sl-button>
48
- </div>
49
-
50
- <h2 class="viur-shop-cart-headline headline">Warenkorb</h2>
51
- <br />
52
-
53
- <sl-card
54
- horizontal
55
- class="viur-shop-cart-mini-card"
56
- v-for="item in cartStore.state.carts[cartStore.state.basket].items"
57
- >
58
- <img
59
- class="viur-shop-cart-mini-card-img"
60
- slot="image"
61
- :src="getImage(item.article.dest.key)"
62
- />
63
-
64
- <div class="viur-shop-cart-mini-cart-header" slot="header">
65
- <h4 class="viur-shop-cart-mini-headline headline">{{ item.article.dest.shop_name }} | 425018</h4>
66
- </div>
67
- <div class="viur-shop-cart-mini-card-body-row">
68
- <div class="viur-shop-cart-mini-card-body-info">
69
- <div class="viur-shop-cart-mini-card-info-wrap">
70
- <div class="viur-shop-cart-mini-card-info">
71
- <span>Anzahl: </span>
72
- 1
73
- </div>
74
- <div class="viur-shop-cart-mini-card-info">
75
- <span>Preis: </span>
76
- {{ item.article.dest.shop_price_recommended }} €
77
- </div>
78
- </div>
79
- </div>
80
- </div>
81
- </sl-card>
82
-
83
- <teleport to="#order_sidebar">
84
- <h2 class="viur-shop-cart-sidebar-headline headline">Jetzt Bestellen</h2>
85
- <br />
86
- <div class="viur-shop-cart-sidebar-info-line">
87
- <span>Zwischensumme</span>
88
- {{ cartStore.state.carts[cartStore.state.basket].info.total }} €
89
- </div>
90
- <div class="viur-shop-cart-sidebar-info-line">
91
- <span>Rabatt</span>
92
- 0 €
93
- </div>
94
- <div class="viur-shop-cart-sidebar-info-line">
95
- <span>Versandkosten</span>
96
- 0 €
97
- </div>
98
- <div class="viur-shop-cart-sidebar-info-line total">
99
- <span>Gesamt:</span>
100
- {{ cartStore.state.carts[cartStore.state.basket].info.total }} €
101
- </div>
102
-
103
- <sl-checkbox @sl-change="onTosAccept">
104
- Ich akzeptiere die geltenden AGBs und Datenschutzbestimmungen
105
- </sl-checkbox>
106
-
107
- <div class="viur-shop-cart-sidebar-btn-wrap">
108
- <sl-button
109
- :variant="state.showOrderButton ? 'info' : 'disabled'"
110
- size="small"
111
- :disabled="!state.showOrderButton"
112
- >
113
- Zahlungspflichtig bestellen
114
- </sl-button>
115
- </div>
116
- </teleport>
117
- </div>
118
- </template>
119
- </template>
120
-
121
- <script setup>
122
- import { reactive, onBeforeMount, computed } from "vue";
123
- import Loader from "@viur/vue-utils/generic/Loader.vue";
124
- import { useCartStore } from "../../stores/cart.js";
125
- import { Request } from "@viur/vue-utils";
126
-
127
- const cartStore = useCartStore();
128
-
129
- // const searchWarning = ref()
130
- const state = reactive({
131
- cartIsInit: computed(() => {
132
- return cartStore.state.basket.length ? true : false;
133
- }),
134
- itemsIsInit: computed(() => {
135
- return cartStore.state.carts[cartStore.state.basket].items ? true : false;
136
- }),
137
- images: {},
138
- showOrderButton: false,
139
- });
140
-
141
- function getImage(item) {
142
- Request.get(`/json/dk_variante/view/${item}`).then(async (resp) => {
143
- let data = await resp.json();
144
-
145
- data = data.values;
146
-
147
- let imageUrl = data.dk_artikel.dest.image
148
- ? Request.downloadUrlFor(data.dk_artikel.dest.image)
149
- : "https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80";
150
-
151
- state.images[item] = imageUrl;
152
- });
153
-
154
- return state.images[item];
155
- }
156
-
157
- function onTosAccept(e) {
158
- if (e.target.checked) state.showOrderButton = true;
159
- if (!e.target.checked) state.showOrderButton = false;
160
- }
161
-
162
- onBeforeMount(async () => {
163
- await cartStore.init();
164
- });
165
- </script>
166
-
167
- <style scoped>
168
-
169
- .viur-shop-cart-sidebar-btn-wrap {
170
- display: flex;
171
- flex-direction: column;
172
- margin-top: var(--sl-spacing-large);
173
-
174
- sl-button {
175
- margin-bottom: var(--sl-spacing-x-small);
176
- }
177
- }
178
-
179
- sl-alert {
180
- margin-top: var(--sl-spacing-medium);
181
- margin-bottom: var(--sl-spacing-medium);
182
- }
183
-
184
- sl-tooltip {
185
- &::part(body) {
186
- line-height: 1.2;
187
- font-weight: 400;
188
- padding: 10px;
189
- }
190
- }
191
-
192
- sl-menu-item {
193
- &::part(base) {
194
- padding: 0.2em 0.9em 0.2em 0.8em;
195
- }
196
-
197
- &::part(checked-icon) {
198
- display: none;
199
- }
200
-
201
- &::part(prefix) {
202
- margin-right: 10px;
203
- }
204
-
205
- &::part(suffix) {
206
- margin-right: -1.5em;
207
- }
208
- }
209
-
210
- .viur-shop-cart-sidebar-info-line {
211
- display: flex;
212
- flex-direction: row;
213
- flex-wrap: nowrap;
214
- margin: var(--sl-spacing-2x-small) 0;
215
-
216
- span {
217
- margin-right: auto;
218
- }
219
-
220
- &.total {
221
- font-weight: 600;
222
- border-top: 1px solid var(--sl-color-neutral-300);
223
- border-bottom: 1px solid var(--sl-color-neutral-300);
224
- padding: var(--sl-spacing-x-small) 0;
225
- margin: var(--sl-spacing-small) 0;
226
- }
227
- }
228
-
229
- .viur-shop-cart-mini-card {
230
- margin-bottom: var(--sl-spacing-x-large);
231
-
232
- &::part(header) {
233
- border-bottom: none;
234
- padding-top: 0;
235
- padding-right: 0;
236
- }
237
-
238
- &::part(image) {
239
- flex-basis: 25%;
240
- max-width: 90px;
241
- }
242
-
243
- &::part(body) {
244
- display: flex;
245
- flex: 1;
246
- padding-top: 0;
247
- padding-bottom: 0;
248
- padding-right: 0;
249
- }
250
-
251
- &::part(group) {
252
- padding: var(--sl-spacing-small) 0;
253
- }
254
- }
255
-
256
- .viur-shop-cart-mini-card-body-row {
257
- display: grid;
258
- grid-template-columns: 1fr auto auto;
259
- gap: var(--sl-spacing-large);
260
- flex: 1;
261
- }
262
-
263
- .viur-shop-cart-mini-card-body-info {
264
- display: flex;
265
- flex-direction: column;
266
- height: 100%;
267
- }
268
-
269
- .viur-shop-cart-mini-card-info-wrap {
270
- display: flex;
271
- flex-wrap: nowrap;
272
- gap: var(--sl-spacing-medium);
273
- }
274
-
275
- .viur-shop-cart-mini-card-info {
276
- display: flex;
277
- flex-direction: row;
278
- flex-wrap: nowrap;
279
-
280
- span {
281
- margin-right: var(--sl-spacing-x-small);
282
- font-weight: 600;
283
- }
284
- }
285
-
286
- .viur-shop-cart-address-wrap {
287
- display: grid;
288
- grid-template-columns: 1fr 1fr;
289
- gap: var(--sl-spacing-x-large);
290
- margin-bottom: var(--sl-spacing-x-large);
291
- }
292
-
293
- .viur-shop-cart-address-headline {
294
- display: flex;
295
- flex-direction: row;
296
- flex-wrap: nowrap;
297
- align-items: center;
298
- justify-content: space-between;
299
- font-weight: 600;
300
- }
301
-
302
- .viur-shop-cart-payment {
303
- display: flex;
304
- flex-direction: row;
305
- flex-wrap: nowrap;
306
- align-items: center;
307
- justify-content: space-between;
308
- margin-bottom: var(--sl-spacing-x-large);
309
-
310
- span {
311
- font-weight: 600;
312
- }
313
- }
314
- </style>
@@ -1,83 +0,0 @@
1
- <template>
2
- <RouterLink :to="{ name: 'CategoryView', params: { identifier: 'dk' } }"
3
- v-for="item in list"
4
- :key="item"
5
- class="viur-shop-category-list-item-link"
6
- >
7
- <sl-card class="viur-shop-category-list-item">
8
- <img
9
- slot="image"
10
- src="https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80"
11
- alt="A kitten."
12
- class="viur-shop-category-list-item-img"
13
- />
14
- <h2 class="viur-shop-category-list-item-headline"> {{ item }}</h2>
15
- <div class="viur-shop-category-list-fake-link">Alle anzeigen &raquo;</div>
16
-
17
- </sl-card>
18
- </RouterLink>
19
- </template>
20
-
21
- <script setup>
22
- import { onBeforeMount } from "vue";
23
- import ItemCard from "../item/ItemCard.vue";
24
- import { useCartStore } from "../../../stores/cart";
25
-
26
- const cartStore = useCartStore();
27
- const props = defineProps({
28
- list: { type: Array, required: true },
29
- });
30
-
31
- onBeforeMount(async () => {
32
- await cartStore.init();
33
- });
34
- </script>
35
-
36
- <style scoped>
37
-
38
- .viur-shop-category-list-item-link{
39
- display: flex;
40
- flex-direction: column;
41
- width: 100%;
42
-
43
- &:hover{
44
- .viur-shop-category-list-fake-link{
45
- text-decoration: underline;
46
- }
47
-
48
- .viur-shop-category-list-item-img{
49
- transform: scale(1.02);
50
- }
51
- }
52
- }
53
-
54
- .viur-shop-category-list-item{
55
- width: 100%;
56
-
57
- &::part(header){
58
- padding: var(--sl-spacing-medium) 0;
59
- }
60
-
61
- &::part(body){
62
- padding: var(--sl-spacing-medium) 0;
63
- }
64
-
65
- &::part(footer){
66
- padding: var(--sl-spacing-medium) 0;
67
- }
68
- }
69
-
70
- .viur-shop-category-list-item-headline{
71
- font-size: 1.4em;
72
- margin-bottom: var(--sl-spacing-medium);
73
- color: var(--ignt-basic-color-text);
74
- }
75
-
76
- .viur-shop-category-list-item-img{
77
- aspect-ratio: 1;
78
- object-fit: cover;
79
- transition: all ease .3s;
80
- }
81
-
82
-
83
- </style>
@@ -1,143 +0,0 @@
1
- <template>
2
- <div class="viur-shop-loading-wrap" v-if="state.loading">
3
- <sl-spinner></sl-spinner>
4
- </div>
5
-
6
- <div class="bind" v-else>
7
- <div class="page-header">
8
- <h1>{{ pageHeader }}</h1>
9
- </div>
10
- <slot name="filter" v-if="filter">
11
- text-transform text-transform TEST
12
- </slot>
13
- <div class="viur-shop-category-view-list">
14
- <!-- <router-link
15
- v-for="item in state.skellist"
16
- :key="item.shop_name"
17
- :to="{ name: 'itemView', params: { item: item.key } }"
18
- > -->
19
-
20
- <ItemCard
21
- v-for="item in state.skellist"
22
- :key="item.shop_name"
23
- :item="item"
24
- >
25
- </ItemCard>
26
- <!-- </router-link> -->
27
- </div>
28
-
29
- <sl-button
30
- @click="loadMore"
31
- :loading="state.loading"
32
- :disabled="state.isLastItem"
33
- class="viur-shop-category-view-more-button"
34
- >
35
- Mehr anzeigen
36
- </sl-button>
37
- </div>
38
- </template>
39
-
40
- <script setup>
41
- import { onMounted, reactive, computed } from "vue";
42
- import { useCartStore } from "../../../stores/cart";
43
- import { useRoute } from "vue-router";
44
- import { Request, ListRequest } from "@viur/vue-utils";
45
- // import { ViURShopClient } from "@viur/viur-shop-client";
46
-
47
- // component imports
48
- import ItemCard from "../item/ItemCard.vue";
49
-
50
- const props = defineProps({
51
- skellist: { type: Array },
52
- filter: { type: Boolean, default: true },
53
- pageHeader: { type: String, default: "Artikel Liste" },
54
- listHandler: { type: Object, required: true },
55
- });
56
-
57
- const route = useRoute();
58
-
59
- const cartStore = useCartStore();
60
-
61
- const state = reactive({
62
- skellist: [],
63
- loading: true,
64
- currentCursor: "",
65
- isLastItem: false,
66
- itemCount: 99,
67
- itemType: computed(() => route.params.identifier),
68
- });
69
-
70
- const categoryList = props.listHandler;
71
-
72
- function listItems() {
73
- let params = {
74
- limit: state.itemCount,
75
- cursor: state.currentCursor,
76
- type: state.itemType,
77
- };
78
-
79
- state.loading = true;
80
-
81
- Request.get("/json/variante/list", { dataObj: params }).then(async (resp) => {
82
- let data = await resp.json();
83
-
84
- if (data.cursor !== state.currentCursor && !state.isLastItem) {
85
- state.currentCursor = data.cursor;
86
- state.skellist.push(...data.skellist);
87
- state.loading = false;
88
- } else if (data.cursor === state.currentCursor) {
89
- state.isLastItem = true;
90
- state.loading = false;
91
- }
92
-
93
- console.log("hier", data);
94
- });
95
- }
96
-
97
- async function loadMore() {
98
- state.loading = true;
99
- await categoryList.next();
100
-
101
- if (state.skellist.length < categoryList.state.skellist.length) {
102
- state.skellist = categoryList.state.skellist;
103
- state.loading = false;
104
- } else {
105
- state.loading = false;
106
- state.isLastItem = true;
107
- }
108
- }
109
-
110
- onMounted(async () => {
111
- await cartStore.init();
112
- await categoryList.fetch(true);
113
- state.skellist = categoryList.state.skellist;
114
- state.loading = false;
115
-
116
- // await cartStore.init();
117
- });
118
- </script>
119
-
120
- <style scoped>
121
- .viur-shop-category-view-list {
122
- display: grid;
123
- width: 100%;
124
- grid-gap: var(--sl-spacing-medium);
125
- grid-template-columns: repeat(4, 1fr);
126
- }
127
-
128
- .viur-shop-loading-wrap {
129
- position: absolute;
130
- top: 0;
131
- bottom: 0;
132
- left: 0;
133
- right: 0;
134
- display: flex;
135
- align-items: center;
136
- justify-content: center;
137
-
138
- sl-spinner {
139
- font-size: 3.5em;
140
- --track-width: 4px;
141
- }
142
- }
143
- </style>