@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
@@ -1,512 +0,0 @@
1
- <template>
2
- <sl-spinner v-if="state.loading"></sl-spinner>
3
- <CartTree v-model="state.data" v-else></CartTree>
4
- </template>
5
-
6
- <script setup>
7
- import {
8
- reactive,
9
- computed,
10
- onBeforeMount,
11
- ref,
12
- watch,
13
- watchEffect,
14
- } from "vue";
15
- import { useCartStore } from "../stores/cart.js";
16
- import CartTree from "./cart/CartTree.vue";
17
-
18
- const props = defineProps({
19
- mode: { type: String, default: "basket" },
20
- cartKey: { type: String },
21
- sidebar: { type: Boolean, default: true },
22
- inOrderView: { type: Boolean, default: false },
23
- inOrderConfirm: { type: Boolean, default: false },
24
- });
25
-
26
- const cartStore = useCartStore();
27
-
28
- const confirm = ref(null);
29
- const shipping = ref(null);
30
-
31
- const state = reactive({
32
- itemsIsInit: computed(() => {
33
- return true;
34
- }),
35
- totalPrice: computed(() => {
36
- if (shipping.value) {
37
- return (
38
- cartStore.state.basketRootNode.total_discount_price +
39
- shipping.value.getShippingCost()
40
- );
41
- }
42
- return 0;
43
- }),
44
- currentItem: {},
45
- currentNode: {},
46
- data: [],
47
- loading: true,
48
- });
49
-
50
- const currentCartKey = computed(() => {
51
- return props.mode === "basket"
52
- ? cartStore.state.basketRootNode.key
53
- : props.cartKey;
54
- });
55
-
56
- async function onConfirm() {
57
- confirm.value.hide();
58
-
59
- await cartStore.updateItem(
60
- state.currentItem.article.dest.key,
61
- state.currentNode.key,
62
- 0,
63
- );
64
- await updateCart();
65
- }
66
-
67
- async function updateItem(e) {
68
- if (e.quantity === 0) {
69
- confirm.value.show();
70
- state.currentItem = e.item;
71
- state.currentNode = e.node;
72
- } else {
73
- await cartStore.updateItem(e.articleKey, e.node.key, e.quantity);
74
-
75
- await cartStore.init();
76
- }
77
-
78
- }
79
-
80
- function removeItem(e) {
81
- confirm.value.show();
82
- state.currentItem = e.item;
83
- state.currentNode = e.node;
84
- }
85
-
86
- async function onDialogHide() {
87
- // TODO: console error when removing items
88
- state.leaves[state.currentNode.key].forEach((item) => {
89
- if (item.key === state.currentItem.key) {
90
- item.quantity = 1;
91
- }
92
- });
93
-
94
- state.currentItem = {};
95
- state.currentNode = {};
96
- }
97
-
98
- async function updateCart() {
99
- state.nodes = [];
100
- state.leaves = {};
101
-
102
- await cartStore.init();
103
- await getChildren();
104
- }
105
-
106
- async function getChildren(parentKey = currentCartKey.value) {
107
- const children = await cartStore.getChildren(parentKey);
108
-
109
- children.forEach(async (child) => {
110
- if (child.skel_type === "node") {
111
- state.data.push(child);
112
- await getChildren(child.key);
113
- } else {
114
- state.data.push(child);
115
- }
116
- });
117
- }
118
-
119
- // function buildTree() {
120
- // let tempArray = state.nodes;
121
-
122
- // state.nodes.forEach((node) => {
123
- // tempArray.push(...state.leaves[node.key]);
124
- // });
125
-
126
- // const arrayToTree = (arr, parent = null) =>
127
- // arr
128
- // .filter((item) => item.parententry === parent)
129
- // .map((child) => ({ ...child, children: arrayToTree(arr, child.key) }));
130
-
131
- // let result = arrayToTree(tempArray);
132
- // return result[0];
133
- // }
134
-
135
- watch(
136
- () => state.data,
137
- (oldVal, newVal) => {
138
- console.log("oldVal", oldVal);
139
- if (oldVal.length === newVal.length) {
140
- state.loading = false;
141
- }
142
- },
143
- { deep: true },
144
- );
145
-
146
- onBeforeMount(async () => {
147
- await cartStore.init();
148
- await getChildren();
149
-
150
- if (props.mode === "basket") {
151
- state.data.push(cartStore.state.basketRootNode);
152
- }
153
- });
154
- </script>
155
-
156
- <style scoped>
157
- .viur-shop-cart-wrap {
158
- display: grid;
159
- grid-template-columns: subgrid;
160
- }
161
-
162
- sl-alert {
163
- margin-top: var(--sl-spacing-medium);
164
- margin-bottom: var(--sl-spacing-medium);
165
- }
166
-
167
- .viur-shop-cart-controlbar {
168
- width: 100%;
169
- display: flex;
170
- justify-content: space-between;
171
- align-items: center;
172
-
173
- sl-input {
174
- flex: 1;
175
-
176
- &::part(base) {
177
- margin-bottom: 0;
178
- }
179
- }
180
- }
181
-
182
- .viur-shop-cart-button-list {
183
- display: flex;
184
- flex-direction: row;
185
- gap: 10px;
186
-
187
- &.left {
188
- flex: 1;
189
- margin-right: 10px;
190
- }
191
- }
192
-
193
- .search {
194
- flex: 1 1 100%;
195
- margin-left: 10px;
196
- }
197
-
198
- .article-combobox {
199
- float: left;
200
- width: 75ch;
201
- }
202
-
203
- .viur-shop-cart-card-img {
204
- aspect-ratio: 1;
205
- }
206
-
207
- .viur-shop-cart-selection {
208
- flex: 1;
209
- }
210
-
211
- .viur-shop-cart-node {
212
- display: flex;
213
- flex-direction: column;
214
- }
215
-
216
- .cart-wrap {
217
- display: flex;
218
- flex-direction: column;
219
- width: 100%;
220
- }
221
-
222
- .soma-input {
223
- display: grid;
224
- grid-template-columns: 120px 1fr;
225
- align-items: center;
226
- }
227
-
228
- .soma-label {
229
- display: flex;
230
- flex-direction: row;
231
- align-items: center;
232
-
233
- sl-icon {
234
- margin-left: 5px;
235
- background-color: @highlightColor;
236
- color: #fff;
237
- aspect-ratio: 1;
238
- border-radius: 50%;
239
- padding: 0.3em;
240
- font-size: 0.6em;
241
- cursor: pointer;
242
- }
243
- }
244
-
245
- sl-tooltip {
246
- &::part(body) {
247
- line-height: 1.2;
248
- font-weight: 400;
249
- padding: 10px;
250
- }
251
- }
252
-
253
- .cart-tab {
254
- sl-tab {
255
- width: 25%;
256
-
257
- &::part(base) {
258
- width: 100%;
259
- height: 100%;
260
- display: flex;
261
- justify-content: center;
262
- align-items: center;
263
- position: relative;
264
- color: var(--sl-color-neutral-400);
265
- }
266
-
267
- &[aria-selected="true"]::part(base) {
268
- color: var(--ignt-color-primary) !important;
269
- }
270
- }
271
- }
272
-
273
- .cart-status-text {
274
- font-size: 0.8em;
275
- color: inherit;
276
- text-align: center;
277
- margin-top: 0.6em;
278
- white-space: initial;
279
- }
280
-
281
- .search-box {
282
- display: flex;
283
- flex-direction: row;
284
- flex-wrap: nowrap;
285
- align-items: stretch;
286
- margin-bottom: 30px;
287
-
288
- sl-button {
289
- &::part(base) {
290
- height: 100%;
291
- }
292
- }
293
-
294
- @media (--ignt-mq-max-break-medium) {
295
- flex-wrap: wrap;
296
- }
297
- }
298
-
299
- .article-combobox {
300
- flex: 1 1 100%;
301
- margin-bottom: 10px;
302
-
303
- &::part(base) {
304
- margin-bottom: 0;
305
- }
306
-
307
- @media (--ignt-mq-max-break-medium) {
308
- margin-bottom: 0;
309
- }
310
- }
311
-
312
- .comission-box {
313
- margin-right: 10px;
314
-
315
- &::part(base) {
316
- margin-bottom: 0;
317
- }
318
-
319
- @media (--ignt-mq-max-break-medium) {
320
- flex: 1;
321
- }
322
- }
323
-
324
- .search-amt {
325
- margin-right: 10px;
326
-
327
- &::part(base) {
328
- margin-bottom: 0;
329
- width: 80px;
330
- }
331
- }
332
-
333
- .viur-shop-cart-headline {
334
- &::part(base) {
335
- background-color: transparent;
336
- transition: all ease 0.3s;
337
- border-bottom: 1px solid transparent;
338
- height: auto;
339
- }
340
-
341
- :deep(.input--focused) {
342
- border-bottom: 1px solid var(--sl-color-primary-500) !important;
343
- }
344
-
345
- &::part(input) {
346
- color: var(--sl-color-primary-500);
347
- font-weight: 300;
348
- text-transform: uppercase;
349
- font-size: 1.85em;
350
- padding: 0.1em 0;
351
- height: auto;
352
- }
353
-
354
- &::part(suffix) {
355
- pointer-events: none;
356
- width: 1.5em;
357
- margin-left: -1em;
358
- font-size: 1.5em;
359
- }
360
-
361
- &:hover {
362
- &::part(base) {
363
- border-bottom: 1px solid var(--sl-color-primary-500);
364
- }
365
- }
366
- }
367
-
368
- .viur-shop-cart-descr {
369
- margin-top: 10px;
370
-
371
- &::part(base) {
372
- background-color: transparent;
373
- transition: all ease 0.3s;
374
- border-bottom: 1px solid transparent;
375
- margin-bottom: 0;
376
- }
377
-
378
- &::part(input) {
379
- padding: 0.1em 0;
380
- height: auto;
381
- color: var(--ignt-color-text);
382
- }
383
-
384
- &::part(suffix) {
385
- pointer-events: none;
386
- width: 1.5em;
387
- margin-left: -1em;
388
- font-size: 1.5em;
389
- }
390
-
391
- &:hover {
392
- &::part(base) {
393
- border-bottom: 1px solid var(--ignt-color-text);
394
- }
395
- }
396
- }
397
-
398
- sl-menu-item {
399
- &::part(base) {
400
- padding: 0.2em 0.9em 0.2em 0.8em;
401
- }
402
-
403
- &::part(checked-icon) {
404
- display: none;
405
- }
406
-
407
- &::part(prefix) {
408
- margin-right: 10px;
409
- }
410
-
411
- &::part(suffix) {
412
- margin-right: -1.5em;
413
- }
414
- }
415
-
416
- .primary-icon {
417
- color: var(--ignt-color-primary);
418
- }
419
-
420
- .delete-icon {
421
- color: @warnColor;
422
- }
423
-
424
- .dots {
425
- color: var(--ignt-color-primary);
426
- width: 1.5em;
427
- height: 100%;
428
- font-size: 1em;
429
- padding: 0.4em;
430
- }
431
-
432
- .viur-shop-cart-card {
433
- margin-bottom: var(--sl-spacing-x-large);
434
-
435
- &::part(header) {
436
- border-bottom: none;
437
- padding-top: 0;
438
- padding-right: 0;
439
- }
440
-
441
- &::part(image) {
442
- flex-basis: 25%;
443
- max-width: 250px;
444
- }
445
-
446
- &::part(body) {
447
- display: flex;
448
- flex: 1;
449
- padding-top: 0;
450
- padding-bottom: 0;
451
- padding-right: 0;
452
- }
453
-
454
- &::part(group) {
455
- padding: var(--sl-spacing-small) 0;
456
- }
457
- }
458
-
459
- .viur-shop-cart-card-body-row {
460
- display: grid;
461
- grid-template-columns: 1fr auto auto;
462
- gap: var(--sl-spacing-large);
463
- flex: 1;
464
- }
465
-
466
- .viur-shop-cart-card-body-info {
467
- display: flex;
468
- flex-direction: column;
469
- height: 100%;
470
- }
471
-
472
- .viur-shop-cart-card-descr {
473
- margin-bottom: auto;
474
- }
475
-
476
- .viur-shop-cart-card-body-footer {
477
- display: flex;
478
- flex-direction: row;
479
- gap: var(--sl-spacing-2x-small);
480
- margin-top: var(--sl-spacing-large);
481
- }
482
-
483
- .amount-input {
484
- width: 5em;
485
- }
486
-
487
- .viur-shop-cart-card-price-wrap {
488
- display: flex;
489
- flex-direction: column;
490
-
491
- .viur-shop-cart-card-small-print {
492
- font-size: 0.75em;
493
- margin-left: auto;
494
- }
495
- }
496
-
497
- .viur-shop-cart-card-price {
498
- font-size: 1.3em;
499
- }
500
-
501
- .viur-shop-cart-card-price-label {
502
- color: var(--ignt-color-primary);
503
- font-weight: 600;
504
- margin-bottom: 10px;
505
- font-size: 1em;
506
- margin-left: auto;
507
- }
508
-
509
- .viur-shop-cart-mobile-footer {
510
- display: none;
511
- }
512
- </style>