@viur/shop-components 0.0.1-dev.58 → 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 (86) 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 +19 -32
  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 +723 -0
  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/category/CategoryList.vue +83 -0
  22. package/src/components/order/category/CategoryView.vue +143 -0
  23. package/src/components/order/information/adress/ShippingAdress.vue +143 -0
  24. package/src/components/order/item/ItemCard.vue +168 -0
  25. package/src/components/order/item/ItemView.vue +232 -0
  26. package/src/components/order/process/ConfirmView.vue +312 -0
  27. package/src/components/order/process/ExampleUsage.vue +113 -0
  28. package/src/components/order/process/OrderTabHeader.vue +16 -0
  29. package/src/components/order/process/SelectPaymentProvider.vue +62 -0
  30. package/src/components/order/process/Shipping.vue +46 -0
  31. package/src/components/ui/ShopSummary.vue +145 -0
  32. package/src/components/ui/generic/ArticleList.vue +222 -0
  33. package/src/components/ui/generic/ExamplePagination.vue +236 -0
  34. package/src/components/ui/generic/ShopPriceFormatter.vue +41 -0
  35. package/src/components/ui/generic/alerts/ShopAlert.vue +19 -0
  36. package/src/components/ui/generic/makeData.js +39 -0
  37. package/src/components/ui/stepper/StepperItem.vue +39 -0
  38. package/src/components/ui/stepper/StepperTab.vue +133 -0
  39. package/src/components/ui/stepper/StepperTrigger.vue +35 -0
  40. package/src/components/ui/userdata/AddForm.vue +125 -0
  41. package/src/components/ui/userdata/AddressBox.vue +117 -0
  42. package/src/components/ui/userdata/BaseLayout.vue +94 -0
  43. package/src/components/ui/userdata/CustomBooleanBone.vue +58 -0
  44. package/src/components/ui/userdata/CustomSelectBone.vue +91 -0
  45. package/src/components/ui/userdata/CustomStringBone.vue +71 -0
  46. package/src/components/ui/userdata/DefaultLayout.vue +126 -0
  47. package/src/components/ui/userdata/SelectAddress.vue +21 -0
  48. package/src/components/ui/userdata/multi/ActionBar.vue +38 -0
  49. package/src/components/ui/userdata/multi/CartSelection.vue +42 -0
  50. package/src/main.js +50 -0
  51. package/src/router/index.js +103 -0
  52. package/src/stores/cart.js +336 -0
  53. package/src/style/ignite/.editorconfig +20 -0
  54. package/src/style/ignite/.github/workflows/ignite.yml +64 -0
  55. package/src/style/ignite/.github/workflows/node.yml +30 -0
  56. package/src/style/ignite/.postcssrc.cjs +25 -0
  57. package/src/style/ignite/CHANGELOG.md +244 -0
  58. package/src/style/ignite/LICENSE +21 -0
  59. package/src/style/ignite/README.md +92 -0
  60. package/src/style/ignite/dist/ignite.css +2019 -0
  61. package/src/style/ignite/dist/ignite.min.css +4 -0
  62. package/src/style/ignite/foundation/basic.css +371 -0
  63. package/src/style/ignite/foundation/color.css +323 -0
  64. package/src/style/ignite/foundation/config.css +188 -0
  65. package/src/style/ignite/foundation/grid.css +78 -0
  66. package/src/style/ignite/foundation/mediaqueries.css +71 -0
  67. package/src/style/ignite/foundation/reset.css +261 -0
  68. package/src/style/ignite/ignite.css +29 -0
  69. package/src/style/ignite/ignite.css.map +1 -0
  70. package/src/style/ignite/package-lock.json +5530 -0
  71. package/src/style/ignite/package.json +58 -0
  72. package/src/style/ignite/shoelace.css +19 -0
  73. package/src/style/ignite/themes/dark.css +12 -0
  74. package/src/style/ignite/themes/light.css +11 -0
  75. package/src/style/ignite/utilities/shoelace.css +537 -0
  76. package/src/style/ignite/utilities/utilities.css +24 -0
  77. package/src/views/ViewMissing.vue +20 -0
  78. package/vite.config.js +53 -0
  79. package/dist/CategoryView-Z-tCFNv1.mjs +0 -60
  80. package/dist/ItemCard-CVfih_bz.mjs +0 -64
  81. package/dist/ItemView-cjeQBSTR.mjs +0 -1848
  82. package/dist/ItemView.css +0 -1
  83. package/dist/main-CZfMYx-A.mjs +0 -3167
  84. package/dist/main.css +0 -1
  85. package/dist/viur-shop-components.es.js +0 -10
  86. package/dist/viur-shop-components.umd.js +0 -417
@@ -0,0 +1,236 @@
1
+ <script setup lang="ts">
2
+ // ! JUST FOR DEVELOPMENT WILL BE DELETED AFTER FINISHED
3
+
4
+ import {
5
+ FlexRender,
6
+ getCoreRowModel,
7
+ getPaginationRowModel,
8
+ useVueTable,
9
+ createColumnHelper,
10
+ } from "@tanstack/vue-table";
11
+ import { ref } from "vue";
12
+ import { makeData, Person } from "./makeData";
13
+
14
+ const INITIAL_PAGE_INDEX = 0;
15
+
16
+ const defaultData = makeData(100);
17
+ const columnHelper = createColumnHelper<Person>();
18
+ const goToPageNumber = ref(INITIAL_PAGE_INDEX + 1);
19
+ const pageSizes = [10, 20, 30, 40, 50];
20
+ const data = ref(defaultData);
21
+
22
+ const columns = [
23
+ columnHelper.group({
24
+ header: "Name",
25
+ footer: (props) => props.column.id,
26
+ columns: [
27
+ columnHelper.accessor("firstName", {
28
+ cell: (info) => info.getValue(),
29
+ footer: (props) => props.column.id,
30
+ }),
31
+ columnHelper.accessor((row) => row.lastName, {
32
+ id: "lastName",
33
+ cell: (info) => info.getValue(),
34
+ header: () => "Last Name",
35
+ footer: (props) => props.column.id,
36
+ }),
37
+ ],
38
+ }),
39
+ columnHelper.group({
40
+ header: "Info",
41
+ footer: (props) => props.column.id,
42
+ columns: [
43
+ columnHelper.accessor("age", {
44
+ header: () => "Age",
45
+ footer: (props) => props.column.id,
46
+ }),
47
+ columnHelper.group({
48
+ header: "More Info",
49
+ columns: [
50
+ columnHelper.accessor("visits", {
51
+ header: () => "Visits",
52
+ footer: (props) => props.column.id,
53
+ }),
54
+ columnHelper.accessor("status", {
55
+ header: "Status",
56
+ footer: (props) => props.column.id,
57
+ }),
58
+ columnHelper.accessor("progress", {
59
+ header: "Profile Progress",
60
+ footer: (props) => props.column.id,
61
+ }),
62
+ ],
63
+ }),
64
+ ],
65
+ }),
66
+ ];
67
+
68
+ const table = useVueTable({
69
+ get data() {
70
+ return data.value;
71
+ },
72
+ columns,
73
+ getCoreRowModel: getCoreRowModel(),
74
+ getPaginationRowModel: getPaginationRowModel(),
75
+ });
76
+
77
+ function rerender() {
78
+ data.value = defaultData;
79
+ }
80
+
81
+ function handleGoToPage(e: any) {
82
+ const page = e.target.value ? Number(e.target.value) - 1 : 0;
83
+ goToPageNumber.value = page + 1;
84
+ table.setPageIndex(page);
85
+ }
86
+
87
+ function handlePageSizeChange(e: any) {
88
+ table.setPageSize(Number(e.target.value));
89
+ }
90
+ </script>
91
+
92
+ <template>
93
+ <div class="p-2">
94
+ <table>
95
+ <thead>
96
+ <tr
97
+ v-for="headerGroup in table.getHeaderGroups()"
98
+ :key="headerGroup.id"
99
+ >
100
+ <th
101
+ v-for="header in headerGroup.headers"
102
+ :key="header.id"
103
+ :colSpan="header.colSpan"
104
+ >
105
+ <FlexRender
106
+ v-if="!header.isPlaceholder"
107
+ :render="header.column.columnDef.header"
108
+ :props="header.getContext()"
109
+ />
110
+ </th>
111
+ </tr>
112
+ </thead>
113
+ <tbody>
114
+ <tr v-for="row in table.getRowModel().rows" :key="row.id">
115
+ <td v-for="cell in row.getVisibleCells()" :key="cell.id">
116
+ <FlexRender
117
+ :render="cell.column.columnDef.cell"
118
+ :props="cell.getContext()"
119
+ />
120
+ </td>
121
+ </tr>
122
+ </tbody>
123
+ <tfoot>
124
+ <tr
125
+ v-for="footerGroup in table.getFooterGroups()"
126
+ :key="footerGroup.id"
127
+ >
128
+ <th
129
+ v-for="header in footerGroup.headers"
130
+ :key="header.id"
131
+ :colSpan="header.colSpan"
132
+ >
133
+ <FlexRender
134
+ v-if="!header.isPlaceholder"
135
+ :render="header.column.columnDef.footer"
136
+ :props="header.getContext()"
137
+ />
138
+ </th>
139
+ </tr>
140
+ </tfoot>
141
+ </table>
142
+ <div>
143
+ <div class="flex items-center gap-2">
144
+ <button
145
+ class="border rounded p-1"
146
+ @click="() => table.setPageIndex(0)"
147
+ :disabled="!table.getCanPreviousPage()"
148
+ >
149
+ «
150
+ </button>
151
+ <button
152
+ class="border rounded p-1"
153
+ @click="() => table.previousPage()"
154
+ :disabled="!table.getCanPreviousPage()"
155
+ >
156
+
157
+ </button>
158
+ <button
159
+ class="border rounded p-1"
160
+ @click="() => table.nextPage()"
161
+ :disabled="!table.getCanNextPage()"
162
+ >
163
+
164
+ </button>
165
+ <button
166
+ class="border rounded p-1"
167
+ @click="() => table.setPageIndex(table.getPageCount() - 1)"
168
+ :disabled="!table.getCanNextPage()"
169
+ >
170
+ »
171
+ </button>
172
+ <span class="flex items-center gap-1">
173
+ <div>Page</div>
174
+ <strong>
175
+ {{ table.getState().pagination.pageIndex + 1 }} of
176
+ {{ table.getPageCount() }}
177
+ </strong>
178
+ </span>
179
+ <span class="flex items-center gap-1">
180
+ | Go to page:
181
+ <input
182
+ type="number"
183
+ :value="goToPageNumber"
184
+ @change="handleGoToPage"
185
+ class="border p-1 rounded w-16"
186
+ />
187
+ </span>
188
+ <select
189
+ :value="table.getState().pagination.pageSize"
190
+ @change="handlePageSizeChange"
191
+ >
192
+ <option
193
+ :key="pageSize"
194
+ :value="pageSize"
195
+ v-for="pageSize in pageSizes"
196
+ >
197
+ Show {{ pageSize }}
198
+ </option>
199
+ </select>
200
+ </div>
201
+ <div>{{ table.getRowModel().rows.length }} Rows</div>
202
+ <pre>{{ JSON.stringify(table.getState().pagination, null, 2) }}</pre>
203
+ </div>
204
+ <div class="h-2" />
205
+ <button @click="rerender" class="border p-2">Rerender</button>
206
+ </div>
207
+ </template>
208
+
209
+ <style>
210
+ html {
211
+ font-family: sans-serif;
212
+ font-size: 14px;
213
+ }
214
+
215
+ table {
216
+ border: 1px solid lightgray;
217
+ }
218
+
219
+ tbody {
220
+ border-bottom: 1px solid lightgray;
221
+ }
222
+
223
+ th {
224
+ border-bottom: 1px solid lightgray;
225
+ border-right: 1px solid lightgray;
226
+ padding: 2px 4px;
227
+ }
228
+
229
+ tfoot {
230
+ color: gray;
231
+ }
232
+
233
+ tfoot th {
234
+ font-weight: normal;
235
+ }
236
+ </style>
@@ -0,0 +1,41 @@
1
+ <template>
2
+ <!-- TODO: at a very later point -->
3
+ <div class="price-wrap">
4
+ <sl-format-number
5
+ class="viur-shop-cart-leaf-value viur-shop-cart-leaf-value--unitprice"
6
+ lang="de"
7
+ type="currency"
8
+ currency="EUR"
9
+ :value="price.retail"
10
+ >
11
+ </sl-format-number>
12
+ <sl-format-number
13
+ class="viur-shop-cart-leaf-value viur-shop-cart-leaf-value--unitprice"
14
+ lang="de"
15
+ type="currency"
16
+ currency="EUR"
17
+ :value="price.recommended"
18
+ >
19
+ </sl-format-number>
20
+ </div>
21
+ </template>
22
+
23
+ <script setup>
24
+ const props = defineProps({
25
+ price: {
26
+ type: Object,
27
+ required: true,
28
+ },
29
+ });
30
+
31
+ function priceGetter() {
32
+
33
+ }
34
+ </script>
35
+
36
+ <style scoped>
37
+ .price-wrap {
38
+ display: flex;
39
+ flex-direction: column;
40
+ }
41
+ </style>
@@ -0,0 +1,19 @@
1
+ <template>
2
+ <sl-alert :variant="variant" open closable duration="3000" @sl-hide="onHide">
3
+ <sl-icon slot="icon" :name="iconName"></sl-icon>
4
+ <slot name="alertMsg">ALERT!</slot>
5
+ </sl-alert>
6
+ </template>
7
+
8
+ <script setup>
9
+ const props = defineProps({
10
+ variant: { type: String, default: "primary" },
11
+ iconName: { type: String, default: "info-circle" },
12
+ });
13
+
14
+ const emit = defineEmits(["onHide"]);
15
+
16
+ function onHide() {
17
+ emit("onHide");
18
+ }
19
+ </script>
@@ -0,0 +1,39 @@
1
+ // ! JUST FOR DEVELOPMENT WILL BE DELETED AFTER FINISHED
2
+ import { faker } from '@faker-js/faker'
3
+
4
+ const range = (len) => {
5
+ const arr = []
6
+ for (let i = 0; i < len; i++) {
7
+ arr.push(i)
8
+ }
9
+ return arr
10
+ }
11
+
12
+ const newPerson = () => {
13
+ return {
14
+ firstName: faker.person.firstName(),
15
+ lastName: faker.person.lastName(),
16
+ age: faker.number.int(40),
17
+ visits: faker.number.int(1000),
18
+ progress: faker.number.int(100),
19
+ status: faker.helpers.shuffle([
20
+ 'relationship',
21
+ 'complicated',
22
+ 'single',
23
+ ]),
24
+ }
25
+ }
26
+
27
+ export function makeData(...lens) {
28
+ const makeDataLevel = (depth = 0) => {
29
+ const len = lens[depth]
30
+ return range(len).map(() => {
31
+ return {
32
+ ...newPerson(),
33
+ subRows: lens[depth + 1] ? makeDataLevel(depth + 1) : undefined,
34
+ }
35
+ })
36
+ }
37
+
38
+ return makeDataLevel()
39
+ }
@@ -0,0 +1,39 @@
1
+ <template>
2
+ <sl-tab-panel class="viur-shop-order-tab-panel" :name="tab">
3
+ <component
4
+ :is="tabs[tab].component"
5
+ v-bind="tabs[tab].props ? tabs[tab].props : ''"
6
+ @goToStart="goToStart()"
7
+ @editAddress="goToUserData"
8
+ >
9
+ </component>
10
+ </sl-tab-panel>
11
+ </template>
12
+
13
+ <script setup>
14
+ const props = defineProps({
15
+ tab: {
16
+ type: String,
17
+ required: true,
18
+ },
19
+ tabs: {
20
+ type: Object,
21
+ required: true,
22
+ },
23
+ });
24
+
25
+ const emit = defineEmits(["goToStart", "editAddress"]);
26
+
27
+ function goToStart() {
28
+ emit("goToStart");
29
+ }
30
+
31
+ function goToUserData(e) {
32
+ emit("editAddress", e);
33
+ }
34
+ </script>
35
+
36
+ <style scoped>
37
+ .viur-shop-order-tab-panel {
38
+ }
39
+ </style>
@@ -0,0 +1,133 @@
1
+ <template>
2
+ <sl-tab
3
+ class="viur-shop-order-tab"
4
+ slot="nav"
5
+ :panel="tab"
6
+ :disabled="tabs[tab].disabled"
7
+ >
8
+ <div class="viur-shop-order-step">
9
+ <sl-icon
10
+ class="viur-shop-order-step-icon"
11
+ v-if="tabs[tab].icon?.name"
12
+ :name="tabs[tab].icon.name"
13
+ :library="tabs[tab].icon.library ? tabs[tab].icon.library : 'default'"
14
+ >
15
+ </sl-icon>
16
+
17
+ <div class="viur-shop-order-status-text">
18
+ {{ tabIdx + 1 }}.
19
+ <span class="viur-shop-order-status-span">{{
20
+ tabs[tab].displayName
21
+ }}</span>
22
+ </div>
23
+ </div>
24
+
25
+ <sl-icon
26
+ name="chevron-right"
27
+ class="viur-shop-order-tab-check"
28
+ v-if="tabIdx < stepperLength - 1"
29
+ >
30
+ </sl-icon>
31
+ </sl-tab>
32
+ </template>
33
+
34
+ <script setup>
35
+ const props = defineProps({
36
+ tab: {
37
+ type: String,
38
+ required: true,
39
+ },
40
+ tabIdx: {
41
+ type: Number,
42
+ required: true,
43
+ },
44
+ stepperLength: {
45
+ type: Number,
46
+ required: true,
47
+ },
48
+ tabs: {
49
+ type: Object,
50
+ required: true,
51
+ },
52
+ });
53
+ </script>
54
+
55
+ <style scoped>
56
+ .viur-shop-order-tab {
57
+ width: 25%;
58
+ position: relative;
59
+
60
+ &::part(base) {
61
+ color: var(--shop-tab-color);
62
+ display: flex;
63
+ height: 100%;
64
+ }
65
+
66
+ &[aria-selected="true"] {
67
+ --shop-tab-color: var(--shop-tab-color--active);
68
+ }
69
+
70
+ @media (max-width: 900px) {
71
+ &::part(base) {
72
+ height: 100%;
73
+ padding: var(--sl-spacing-small) var(--sl-spacing-medium);
74
+ }
75
+ }
76
+
77
+ @media (max-width: 600px) {
78
+ &[aria-selected="true"] {
79
+ width: 100%;
80
+ }
81
+
82
+ &:not([aria-selected="true"]) {
83
+ .viur-shop-order-status-span {
84
+ display: none;
85
+ }
86
+ }
87
+ }
88
+ }
89
+
90
+ .viur-shop-order-step {
91
+ width: 100%;
92
+ height: 100%;
93
+ display: flex;
94
+ flex-direction: column;
95
+ justify-content: center;
96
+ align-items: center;
97
+
98
+ &:has(sl-icon) {
99
+ justify-content: flex-start;
100
+ }
101
+
102
+ sl-icon {
103
+ font-size: 2.5em;
104
+ margin-bottom: 15px;
105
+ }
106
+
107
+ @media (max-width: 900px) {
108
+ justify-content: center;
109
+
110
+ sl-icon {
111
+ display: none;
112
+ }
113
+ }
114
+ }
115
+
116
+ .viur-shop-order-status-text {
117
+ font-size: 0.8em;
118
+ color: inherit;
119
+ text-align: center;
120
+ white-space: initial;
121
+ }
122
+
123
+ .viur-shop-order-tab-check {
124
+ position: absolute;
125
+ right: -0.5em;
126
+
127
+ @media (max-width: 900px) {
128
+ font-size: 0.7em;
129
+ right: -0.35em;
130
+ top: calc(50% - 0.35em);
131
+ }
132
+ }
133
+ </style>
@@ -0,0 +1,35 @@
1
+ <template>
2
+ <sl-button type="submit" v-show="index !== 0" @click="prevTab()">
3
+ Zurück
4
+ <!-- TODO: $t(i18n referenz) -->
5
+ </sl-button>
6
+
7
+ <sl-button type="submit" variant="primary" @click="nextTab()">
8
+ Weiter
9
+ <!-- TODO: $t(i18n referenz) -->
10
+ </sl-button>
11
+ </template>
12
+
13
+ <script setup>
14
+ const props = defineProps({
15
+ index: {
16
+ type: Number,
17
+ required: true,
18
+ },
19
+ });
20
+ const emit = defineEmits({prevTab: null, nextTab: null});
21
+
22
+ function prevTab() {
23
+ emit("prevTab");
24
+ }
25
+
26
+ function nextTab() {
27
+ emit("nextTab");
28
+ }
29
+ </script>
30
+
31
+ <style scoped>
32
+ .sticky {
33
+ position: sticky;
34
+ }
35
+ </style>
@@ -0,0 +1,125 @@
1
+ <template>
2
+ <sl-spinner v-if="state.isLoading"></sl-spinner>
3
+ <ViForm
4
+ ref="addForm"
5
+ module="shop/address"
6
+ action="add"
7
+ :useCategories="false"
8
+ :layout="layout ? layout : DefaultLayout"
9
+ :values="modelValue"
10
+ :skel="
11
+ mode === 'shipping'
12
+ ? cartStore.state.activeShippingAddress
13
+ : cartStore.state.activeBillingAddress
14
+ "
15
+ @change="updateValues"
16
+ >
17
+ </ViForm>
18
+
19
+ <sl-bar>
20
+ <div slot="left">
21
+ <!-- BUTTON NUR PLATZHALTER FÜR TESTS -->
22
+ <sl-button
23
+ variant="success"
24
+ @click.stop.prevent="sendForm"
25
+ :loading="state.isSending"
26
+ >
27
+ <sl-icon name="floppy2" slot="prefix"></sl-icon>
28
+ {{
29
+ $t("actions.add").charAt(0).toUpperCase() + $t("actions.add").slice(1)
30
+ }}
31
+ </sl-button>
32
+ </div>
33
+ </sl-bar>
34
+ </template>
35
+
36
+ <script setup>
37
+ import { reactive, ref, computed, onMounted } from "vue";
38
+ import ViForm from "@viur/vue-utils/forms/ViForm.vue";
39
+ import DefaultLayout from "./DefaultLayout.vue";
40
+ import { useCartStore } from "../../../stores/cart";
41
+
42
+ const props = defineProps({
43
+ layout: { required: false },
44
+ customer: { type: Object, required: true },
45
+ mode: { type: String, default: "shipping" },
46
+ modelValue: { type: Object },
47
+ });
48
+ const emit = defineEmits(["update:modelValue", "addSuccess"]);
49
+ const cartStore = useCartStore();
50
+ const addForm = ref(null);
51
+ const state = reactive({
52
+ isLoading: computed(() => (addForm.value ? addForm.value.loading : true)),
53
+ isSending: false,
54
+ wasSuccess: false,
55
+ user: {},
56
+ skel: computed(() => {
57
+ if (props.mode === "shipping") return cartStore.state.activeShippingAddress;
58
+ else return cartStore.state.activeBillingAddress;
59
+ }),
60
+ });
61
+
62
+ function sendForm() {
63
+ if (props.mode === "shipping") {
64
+ cartStore.state.activeShippingAddress = addForm.value.state.skel;
65
+ } else {
66
+ cartStore.state.activeBillingAddress = addForm.value.state.skel;
67
+ }
68
+
69
+ state.isSending = true;
70
+ addForm.value.sendData().then(async (resp) => {
71
+ let data = await resp.json();
72
+ state.isSending = false;
73
+ if (data["action"] === "addSuccess") {
74
+ emit("addSuccess", {
75
+ show: true,
76
+ msg: "Erfolg!",
77
+ variant: "success",
78
+ icon: "check2-circle",
79
+ });
80
+ }
81
+ });
82
+ }
83
+
84
+ function setSkelValues(dict = {}) {
85
+ let structure = cartStore.state.structure.address;
86
+ let skel = {};
87
+
88
+ Object.keys(structure).forEach((boneName) => {
89
+ if (boneName === "customer") {
90
+ skel[boneName] = state.user.key;
91
+ return;
92
+ }
93
+ skel[boneName] = null;
94
+ });
95
+
96
+ Object.entries(dict).forEach(([boneName, boneValue]) => {
97
+ skel[boneName] = boneValue;
98
+ });
99
+
100
+ return skel;
101
+ }
102
+
103
+ function updateValues() {
104
+ emit("update:modelValue", addForm.value.state.skel);
105
+ }
106
+
107
+ // onBeforeMount(() => {
108
+ // cartStore.getAddressStructure();
109
+
110
+ // // state.skel = setSkelValues({
111
+ // // address_type: "shipping",
112
+ // // customer: props.customer.key,
113
+ // // });
114
+ // });
115
+ onMounted(() => {
116
+ cartStore.getAddressStructure();
117
+ // updateValues();
118
+ // state.skel = setSkelValues({
119
+ // address_type: "shipping",
120
+ // customer: props.customer.key,
121
+ // });
122
+ });
123
+ </script>
124
+
125
+ <style scoped></style>