@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.
Files changed (77) 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 +25 -23
  7. package/src/components/ShopCart.vue +512 -0
  8. package/src/components/ShopOrderComplete.vue +73 -0
  9. package/src/components/ShopOrderConfirm.vue +291 -0
  10. package/src/components/ShopOrderStepper.vue +264 -0
  11. package/src/components/ShopUserData.vue +232 -0
  12. package/src/components/cart/CartLeaf.vue +277 -0
  13. package/src/components/cart/CartLeafModel.vue +304 -0
  14. package/src/components/cart/CartNode.vue +25 -0
  15. package/src/components/cart/CartTree.vue +54 -0
  16. package/src/components/cart/CartTreeWrapper.vue +73 -0
  17. package/src/components/cart/CartView.vue +205 -174
  18. package/src/components/cart/Discount.vue +91 -0
  19. package/src/components/lib/utils.js +0 -0
  20. package/src/components/order/OrderSidebar.vue +102 -0
  21. package/src/components/order/item/ItemView.vue +0 -1
  22. package/src/components/{cart → order/process}/ConfirmView.vue +94 -96
  23. package/src/components/order/process/ExampleUsage.vue +79 -66
  24. package/src/components/order/process/OrderTabHeader.vue +10 -1
  25. package/src/components/order/process/SelectPaymentProvider.vue +62 -0
  26. package/src/components/order/process/Shipping.vue +46 -0
  27. package/src/components/ui/ShopSummary.vue +145 -0
  28. package/src/components/ui/generic/ArticleList.vue +222 -0
  29. package/src/components/ui/generic/ExamplePagination.vue +236 -0
  30. package/src/components/ui/generic/ShopPriceFormatter.vue +41 -0
  31. package/src/components/ui/generic/alerts/ShopAlert.vue +19 -0
  32. package/src/components/ui/generic/makeData.js +39 -0
  33. package/src/components/ui/stepper/StepperItem.vue +39 -0
  34. package/src/components/ui/stepper/StepperTab.vue +133 -0
  35. package/src/components/ui/stepper/StepperTrigger.vue +35 -0
  36. package/src/components/ui/userdata/AddForm.vue +125 -0
  37. package/src/components/ui/userdata/AddressBox.vue +117 -0
  38. package/src/components/ui/userdata/BaseLayout.vue +94 -0
  39. package/src/components/ui/userdata/CustomBooleanBone.vue +58 -0
  40. package/src/components/ui/userdata/CustomSelectBone.vue +91 -0
  41. package/src/components/ui/userdata/CustomStringBone.vue +71 -0
  42. package/src/components/ui/userdata/DefaultLayout.vue +126 -0
  43. package/src/components/ui/userdata/SelectAddress.vue +21 -0
  44. package/src/components/ui/userdata/multi/ActionBar.vue +38 -0
  45. package/src/components/ui/userdata/multi/CartSelection.vue +42 -0
  46. package/src/main.js +50 -0
  47. package/src/router/index.js +1 -1
  48. package/src/stores/cart.js +267 -42
  49. package/src/style/ignite/.editorconfig +20 -0
  50. package/src/style/ignite/.github/workflows/ignite.yml +64 -0
  51. package/src/style/ignite/.github/workflows/node.yml +30 -0
  52. package/src/style/ignite/.postcssrc.cjs +25 -0
  53. package/src/style/ignite/CHANGELOG.md +244 -0
  54. package/src/style/ignite/LICENSE +21 -0
  55. package/src/style/ignite/README.md +92 -0
  56. package/src/style/ignite/dist/ignite.css +2019 -0
  57. package/src/style/ignite/dist/ignite.min.css +4 -0
  58. package/src/style/ignite/foundation/basic.css +371 -0
  59. package/src/style/ignite/foundation/color.css +323 -0
  60. package/src/style/ignite/foundation/config.css +188 -0
  61. package/src/style/ignite/foundation/grid.css +78 -0
  62. package/src/style/ignite/foundation/mediaqueries.css +71 -0
  63. package/src/style/ignite/foundation/reset.css +261 -0
  64. package/src/style/ignite/ignite.css +29 -0
  65. package/src/style/ignite/ignite.css.map +1 -0
  66. package/src/style/ignite/package-lock.json +5530 -0
  67. package/src/style/ignite/package.json +58 -0
  68. package/src/style/ignite/shoelace.css +19 -0
  69. package/src/style/ignite/themes/dark.css +12 -0
  70. package/src/style/ignite/themes/light.css +11 -0
  71. package/src/style/ignite/utilities/shoelace.css +537 -0
  72. package/src/style/ignite/utilities/utilities.css +24 -0
  73. package/vite.config.js +53 -0
  74. package/src/components/order/information/UserInfoMulti.vue +0 -427
  75. package/src/components/order/information/UserInformation.vue +0 -332
  76. package/src/components/order/process/OrderComplete.vue +0 -41
  77. package/src/components/order/process/OrderView.vue +0 -210
@@ -0,0 +1,71 @@
1
+ <template>
2
+ <sl-input
3
+ ref="stringBone"
4
+ :placeholder="boneState.bonestructure.descr"
5
+ :disabled="boneState.readonly"
6
+ :value="Utils.unescape(value)"
7
+ :required="boneState.bonestructure.required"
8
+ @sl-change="changeEvent"
9
+ @keyup="changeEvent"
10
+ ></sl-input>
11
+ </template>
12
+
13
+ <script lang="ts">
14
+ //@ts-nocheck
15
+ import { reactive, defineComponent, onMounted, inject, computed, watchEffect, ref } from "vue"
16
+ import { useTimeoutFn } from "@vueuse/core"
17
+ import Utils from "@viur/vue-utils//bones/utils"
18
+
19
+ export default defineComponent({
20
+ inheritAttrs: false,
21
+ props: {
22
+ name: String,
23
+ value: [Object, String, Number, Boolean, Array],
24
+ index: Number,
25
+ lang: String,
26
+ autofocus: Boolean
27
+ },
28
+ components: {},
29
+ emits: ["change"],
30
+ setup(props, context) {
31
+ const boneState = inject("boneState")
32
+ const state = reactive({
33
+ value: computed(() => props.value)
34
+ })
35
+
36
+ const stringBone = ref(null)
37
+
38
+ function changeEvent(event) {
39
+ context.emit("change", props.name, event.target.value, props.lang, props.index)
40
+ }
41
+
42
+ watchEffect(() => {
43
+ if (props.autofocus) {
44
+ if (stringBone.value && stringBone.value !== null && stringBone !== null) {
45
+ const { start } = useTimeoutFn(() => {
46
+ stringBone.value.focus()
47
+ }, 600)
48
+
49
+ start()
50
+ }
51
+ }
52
+ })
53
+
54
+ onMounted(() => {
55
+ context.emit("change", props.name, props.value, props.lang, props.index) //init
56
+ })
57
+
58
+ return {
59
+ state,
60
+ Utils,
61
+ boneState,
62
+ changeEvent,
63
+ stringBone
64
+ }
65
+ }
66
+ })
67
+ </script>
68
+
69
+ <style scoped>
70
+
71
+ </style>
@@ -0,0 +1,126 @@
1
+ <template>
2
+ <div class="vi-shop-cart-form-wrap" v-if="Object.keys(formState.structure).length > 0">
3
+ <slot
4
+ boneName="salutation"
5
+ :widget="CustomSelectBone"
6
+ label="hide"
7
+ >
8
+ </slot>
9
+
10
+ <slot boneName="firstname"
11
+ :widget="CustomStringBone"
12
+ label="hide">
13
+ </slot>
14
+
15
+ <slot boneName="lastname"
16
+ :widget="CustomStringBone"
17
+ label="hide">
18
+ </slot>
19
+
20
+ <slot boneName="street_name"
21
+ :widget="CustomStringBone"
22
+ label="hide">
23
+ </slot>
24
+
25
+ <slot boneName="street_number"
26
+ :widget="CustomStringBone"
27
+ label="hide">
28
+ </slot>
29
+
30
+ <slot
31
+ boneName="zip_code"
32
+ :widget="CustomStringBone"
33
+ placeholder="PLZ"
34
+ label="hide"
35
+ >
36
+ </slot>
37
+
38
+ <slot boneName="city"
39
+ :widget="CustomStringBone"
40
+ label="hide">
41
+ </slot>
42
+
43
+
44
+ <slot boneName="country"
45
+ :widget="CustomSelectBone"
46
+ label="hide">
47
+ </slot>
48
+
49
+ <!--<slot boneName="address_type"
50
+ :widget="CustomSelectBone"
51
+ label="hide">
52
+ </slot>-->
53
+
54
+ <slot
55
+ boneName="is_default"
56
+ :widget="CustomBooleanBone"
57
+ label="hide"
58
+ >
59
+ </slot>
60
+
61
+
62
+ </div>
63
+
64
+
65
+ </template>
66
+ <script setup>
67
+ import { inject } from "vue";
68
+ import { getBoneWidget } from "@viur/vue-utils/bones/edit";
69
+ import CustomBooleanBone from "./CustomBooleanBone.vue";
70
+ import CustomStringBone from "./CustomStringBone.vue";
71
+ import CustomSelectBone from "./CustomSelectBone.vue";
72
+ import booleanBone from '@viur/vue-utils/bones/edit/default/booleanBone.vue';
73
+
74
+ const formState = inject("formState");
75
+ const formUpdate = inject("formUpdate");
76
+ </script>
77
+ <style scoped>
78
+
79
+ .vi-shop-cart-form-wrap{
80
+ display: grid;
81
+ grid-template-columns: repeat(4, minmax(0, 1fr));
82
+ gap: var(--sl-spacing-small);
83
+ margin-bottom: var(--sl-spacing-medium);
84
+ }
85
+
86
+ :deep(.bone-wrapper){
87
+ margin: 0;
88
+ }
89
+
90
+ :deep(.wrapper-bone-firstname){
91
+ grid-column: 1 / span 2;
92
+ }
93
+
94
+ :deep(.wrapper-bone-lastname){
95
+ grid-column: 3 / span 2;
96
+ }
97
+
98
+ :deep(.wrapper-bone-street_name){
99
+ grid-column: 1 / span 3;
100
+ }
101
+
102
+ :deep(.wrapper-bone-street_number){
103
+ grid-column: 4 / span 1;
104
+ }
105
+
106
+ :deep(.wrapper-bone-zip_code){
107
+ grid-column: 1 / span 2;
108
+ }
109
+
110
+ :deep(.wrapper-bone-city){
111
+ grid-column: 3 / span 2;
112
+ }
113
+
114
+ :deep(.wrapper-bone-country){
115
+ grid-column: 1 / span 4;
116
+ }
117
+
118
+ :deep(.wrapper-bone-is_default){
119
+ padding: var(--sl-spacing-x-small) 0;
120
+ grid-column: 1 / span 4;
121
+ }
122
+
123
+
124
+
125
+
126
+ </style>
@@ -0,0 +1,21 @@
1
+ <template>
2
+ <sl-select
3
+ :value="modelValue"
4
+ @sl-change="emit('update:modelValue', $event.target.value)"
5
+ >
6
+ <sl-option
7
+ v-for="address in addressList"
8
+ :key="address.key"
9
+ :value="address.key"
10
+ >
11
+ {{ address.street_name }} {{ address.street_number }}
12
+ </sl-option>
13
+ </sl-select>
14
+ </template>
15
+ <script setup>
16
+ const props = defineProps({
17
+ addressList: { type: Array, required: true },
18
+ modelValue: { type: String },
19
+ });
20
+ const emit = defineEmits(["update:modelValue"]);
21
+ </script>
@@ -0,0 +1,38 @@
1
+ <template>
2
+ <div class="viur-shop-form-btn-wrap">
3
+ <sl-button
4
+ size="medium"
5
+ title="Lieferadresse entfernen"
6
+ @click="removeAddress"
7
+ >
8
+ <sl-icon name="x-lg" slot="prefix"></sl-icon>
9
+ </sl-button>
10
+ <sl-button size="medium" variant="primary" @click="addAddress">
11
+ <sl-icon name="plus-lg" slot="prefix"></sl-icon>
12
+ Lieferadresse hinzufügen
13
+ </sl-button>
14
+ </div>
15
+ </template>
16
+
17
+ <script setup>
18
+ const emit = defineEmits(["onAddressAdd", "onAddressRemove"]);
19
+ function addAddress() {
20
+ emit("onAddressAdd");
21
+ }
22
+
23
+ function removeAddress() {
24
+ emit("onAddressRemove");
25
+ }
26
+ </script>
27
+
28
+ <style scoped>
29
+ .viur-shop-form-btn-wrap {
30
+ display: flex;
31
+ flex-direction: row;
32
+ flex-wrap: nowrap;
33
+ justify-content: space-between;
34
+ width: 100%;
35
+
36
+ margin-top: var(--sl-spacing-medium);
37
+ }
38
+ </style>
@@ -0,0 +1,42 @@
1
+ <template>
2
+ <sl-select
3
+ :value="state.selectedCarts"
4
+ multiple="true"
5
+ clearable
6
+ @sl-change="handleSelect"
7
+ @sl-clear="reset"
8
+ >
9
+ <sl-option v-for="cart in carts" :key="cart.key" :value="cart.key">
10
+ {{ cart.name }}
11
+ </sl-option>
12
+ </sl-select>
13
+ </template>
14
+ <script setup>
15
+ import { onBeforeMount, reactive } from "vue";
16
+
17
+ const props = defineProps({
18
+ carts: { type: Array, required: true },
19
+ });
20
+ const emit = defineEmits(["cartSelected", "onReset"]);
21
+
22
+ const state = reactive({
23
+ selectedCarts: [],
24
+ });
25
+
26
+ function handleSelect(e) {
27
+ state.selectedCarts = e.target.value;
28
+ emit("cartSelected", e.target.value);
29
+ }
30
+
31
+ function reset() {
32
+ emit("onReset");
33
+ }
34
+
35
+ onBeforeMount(() => {
36
+ props.carts.forEach((cart) => {
37
+ state.selectedCarts.push(cart.key);
38
+ });
39
+ emit("cartSelected", state.selectedCarts);
40
+ });
41
+ </script>
42
+ <style scoped></style>
package/src/main.js ADDED
@@ -0,0 +1,50 @@
1
+ // imports
2
+ import { createPinia } from "pinia";
3
+ import { createI18n } from "vue-i18n";
4
+ import {
5
+ de_translations,
6
+ en_translations,
7
+ } from "@viur/vue-components/translations/translations";
8
+
9
+ import { useCartStore } from "./stores/cart";
10
+ import createRouterInstance from "./router/index";
11
+ import CartNode from "./components/cart/CartNode.vue";
12
+ import CartLeaf from "./components/cart/CartLeaf.vue";
13
+ // import { createApp } from "vue";
14
+ // import bone from "@viur/vue-utils/bones/edit/bone.vue";
15
+ // import Wrapper_nested from "@viur/vue-utils/bones/edit/wrapper_nested.vue";
16
+
17
+ export { useCartStore, createRouterInstance };
18
+
19
+ // export all main components
20
+ export { default as ShopOrderStepper } from "./components/ShopOrderStepper.vue";
21
+ export { default as ShopUserData } from "./components/ShopUserData.vue";
22
+
23
+ export { default as CartView } from "./components/cart/CartView.vue";
24
+ export { default as ExampleUsage } from "./components/order/process/ExampleUsage.vue";
25
+ export { default as ConfirmView } from "./components/ShopOrderConfirm.vue";
26
+ export { default as OrderComplete } from "./components/ShopOrderComplete.vue";
27
+ // export { default as UserInformation } from "./components/order/information/UserInformation.vue";
28
+ // export { default as UserInfoMulti } from "./components/order/information/UserInfoMulti.vue";
29
+ export { default as SelectPaymentProvider } from "./components/order/process/SelectPaymentProvider.vue";
30
+
31
+ const pinia = createPinia();
32
+ const i18n = createI18n({
33
+ locale: "de",
34
+ fallbackLocale: "en",
35
+ messages: {
36
+ en: { ...en_translations },
37
+ de: { ...de_translations },
38
+ },
39
+ });
40
+
41
+ // Create a plugin to install all components
42
+ const ViurShopComponents = {
43
+ install(app) {
44
+ app.use(pinia);
45
+ app.use(i18n);
46
+ },
47
+ };
48
+
49
+ // Export the plugin as default
50
+ export default ViurShopComponents;
@@ -31,7 +31,7 @@ const default_routes = [
31
31
  {
32
32
  path: "/shop/order/confirm",
33
33
  name: "ConfirmView",
34
- component: () => import("../components/cart/ConfirmView.vue"),
34
+ component: () => import("../components/ShopOrderConfirm.vue"),
35
35
  },
36
36
  ];4
37
37