@viur/shop-components 0.0.1-dev.3 → 0.0.1-dev.30

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/package.json CHANGED
@@ -1,25 +1,7 @@
1
1
  {
2
2
  "name": "@viur/shop-components",
3
- "type": "module",
4
- "version": "0.0.1-dev.3",
3
+ "version": "0.0.1-dev.30",
5
4
  "description": "Frontend Vue components for the shop module of ViUR",
6
- "files": [
7
- "dist"
8
- ],
9
- "main": "./dist/shop-components.umd.cjs",
10
- "module": "./dist/shop-components.js",
11
- "exports": {
12
- ".": {
13
- "import": "./dist/shop-components.js",
14
- "require": "./dist/shop-components.umd.cjs"
15
- },
16
- "./dist/style.css": "./dist/style.css"
17
- },
18
- "scripts": {
19
- "build": "vite build",
20
- "dev": "vite",
21
- "serve": "vite preview"
22
- },
23
5
  "repository": {
24
6
  "type": "git",
25
7
  "url": "git+https://github.com/viur-framework/shop-components.git"
@@ -36,27 +18,16 @@
36
18
  },
37
19
  "homepage": "https://github.com/viur-framework/shop-components#readme",
38
20
  "devDependencies": {
39
- "@vitejs/plugin-vue": "^5.0.4",
40
- "postcss-custom-media": "^10.0.4",
41
- "postcss-nesting": "^12.1.2",
42
- "prettier": "^3.2.5",
43
- "rollup-plugin-copy": "^3.5.0",
44
- "rollup-plugin-visualizer": "^5.12.0",
45
- "vite": "^5.2.10",
46
- "vue-router": "^4.3.2",
47
- "vue-tsc": "^2.0.14"
21
+ "postcss-custom-media": "^10.0.0",
22
+ "postcss-nesting": "^12.0.0",
23
+ "prettier": "^3.2.5"
48
24
  },
49
25
  "dependencies": {
26
+ "@viur/ignite": "^5.0.2",
50
27
  "@viur/shoelace": "^1.0.6-v2.15.0",
51
- "@viur/vue-utils": "^1.4.4",
52
- "vue-i18n": "^9.13.1",
28
+ "@viur/vue-utils": "^1.4.5",
53
29
  "pinia": "^2.1.7",
54
- "@viur/ignite": "^5.0.2",
55
- "@viur/viur-shop-client": "^0.1.0-dev.8",
56
- "ckeditor5-vue": "^0.0.7",
57
- "vue": "^3.4.00"
58
- },
59
- "peerDependencies": {
60
- "vue": "^3.4.00"
30
+ "vue": "^3.4.27",
31
+ "vue-router": "^4.3.2"
61
32
  }
62
33
  }
@@ -0,0 +1,195 @@
1
+ <template>
2
+ <sl-card horizontal class="viur-shop-cart-card">
3
+ <img
4
+ class="viur-shop-cart-card-img"
5
+ slot="image"
6
+ :src="getImage(state.leaf.shop_image ? state.leaf.shop_image : undefined)"
7
+ />
8
+ <div class="viur-shop-cart-card-header" slot="header">
9
+ <h4 class="viur-shop-cart-card-headline headline">
10
+ {{ state.leaf.shop_name }} | {{ leaf.shop_art_no_or_gtin }}
11
+ </h4>
12
+ </div>
13
+ <div class="viur-shop-cart-card-body-row">
14
+ <div class="viur-shop-cart-card-body-info">
15
+ <div class="viur-shop-cart-card-descr">
16
+ Version: 900x900x2000 <br />
17
+ Farbe: Chromoptik <br />
18
+ Glasart: Klar hell mit Edelglasbeschichtung<br />
19
+ Anschlag: Beidseitig variabel<br />
20
+ Griff: Stangengriff Exklusiv (56)
21
+ </div>
22
+ <div class="viur-shop-cart-card-body-footer">
23
+ <sl-button
24
+ size="small"
25
+ outline
26
+ class="viur-shop-cart-card-add-to-favourites-btn"
27
+ variant="primary"
28
+ title="Add to favourites"
29
+ >
30
+ <sl-icon name="heart" slot="prefix"></sl-icon>
31
+ </sl-button>
32
+ <sl-button
33
+ size="small"
34
+ outline
35
+ class="viur-shop-cart-card-delete-btn"
36
+ variant="primary"
37
+ title="Remove from cart"
38
+ @click="removeItem(state.leaf, state.leaf.article.dest.key, node)"
39
+ >
40
+ <sl-icon name="trash" slot="prefix"></sl-icon>
41
+ </sl-button>
42
+ </div>
43
+ </div>
44
+ <div class="viur-shop-cart-card-body-amount">
45
+ <sl-input
46
+ class="amount-input"
47
+ type="number"
48
+ label="Anzahl"
49
+ placeholder="Number"
50
+ min="0"
51
+ v-model="state.leaf.quantity"
52
+ @input="
53
+ updateItem(
54
+ state.leaf,
55
+ state.leaf.article.dest.key,
56
+ node,
57
+ state.leaf.quantity,
58
+ )
59
+ "
60
+ >
61
+ </sl-input>
62
+ </div>
63
+ <div class="viur-shop-cart-card-price-wrap" slot="footer">
64
+ <div class="viur-shop-cart-card-price-label">Preis</div>
65
+ <div class="viur-shop-cart-card-price">
66
+ {{ state.leaf.price.retail }}
67
+
68
+ </div>
69
+ <div class="viur-shop-cart-card-small-print">Brutto / Stk.</div>
70
+ </div>
71
+ </div>
72
+ </sl-card>
73
+ </template>
74
+
75
+ <script setup>
76
+ import { computed, onBeforeMount, reactive } from "vue";
77
+ import { Request } from "@viur/vue-utils";
78
+
79
+ const props = defineProps({
80
+ leaf: { type: Object, required: true },
81
+ node: { type: Object, required: true },
82
+ });
83
+
84
+ const emit = defineEmits(["updateItem", "removeItem"]);
85
+
86
+ const state = reactive({
87
+ leaf: {},
88
+ });
89
+
90
+ function getImage(image) {
91
+ if (image !== undefined) return Request.downloadUrlFor(image);
92
+
93
+ return "https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80";
94
+ }
95
+
96
+ function updateItem(item, articleKey, node, quantity) {
97
+ emit("updateItem", {
98
+ item: item,
99
+ articleKey: articleKey,
100
+ node: node,
101
+ quantity: quantity,
102
+ });
103
+ }
104
+
105
+ function removeItem(item, articleKey, node) {
106
+ emit("removeItem", { item: item, articleKey: articleKey, node: node });
107
+ }
108
+
109
+ onBeforeMount(() => {
110
+ state.leaf = props.leaf;
111
+ });
112
+ </script>
113
+
114
+ <style scoped>
115
+ .viur-shop-cart-card-img {
116
+ aspect-ratio: 1;
117
+ }
118
+
119
+ .viur-shop-cart-card {
120
+ margin-bottom: var(--sl-spacing-x-large);
121
+
122
+ &::part(header) {
123
+ border-bottom: none;
124
+ padding-top: 0;
125
+ padding-right: 0;
126
+ }
127
+
128
+ &::part(image) {
129
+ flex-basis: 25%;
130
+ max-width: 250px;
131
+ }
132
+
133
+ &::part(body) {
134
+ display: flex;
135
+ flex: 1;
136
+ padding-top: 0;
137
+ padding-bottom: 0;
138
+ padding-right: 0;
139
+ }
140
+
141
+ &::part(group) {
142
+ padding: var(--sl-spacing-small) 0;
143
+ }
144
+ }
145
+
146
+ .viur-shop-cart-card-body-row {
147
+ display: grid;
148
+ grid-template-columns: 1fr auto auto;
149
+ gap: var(--sl-spacing-large);
150
+ flex: 1;
151
+ }
152
+
153
+ .viur-shop-cart-card-body-info {
154
+ display: flex;
155
+ flex-direction: column;
156
+ height: 100%;
157
+ }
158
+
159
+ .viur-shop-cart-card-descr {
160
+ margin-bottom: auto;
161
+ }
162
+
163
+ .viur-shop-cart-card-body-footer {
164
+ display: flex;
165
+ flex-direction: row;
166
+ gap: var(--sl-spacing-2x-small);
167
+ margin-top: var(--sl-spacing-large);
168
+ }
169
+
170
+ .amount-input {
171
+ width: 5em;
172
+ }
173
+
174
+ .viur-shop-cart-card-price-wrap {
175
+ display: flex;
176
+ flex-direction: column;
177
+
178
+ .viur-shop-cart-card-small-print {
179
+ font-size: 0.75em;
180
+ margin-left: auto;
181
+ }
182
+ }
183
+
184
+ .viur-shop-cart-card-price {
185
+ font-size: 1.3em;
186
+ }
187
+
188
+ .viur-shop-cart-card-price-label {
189
+ color: var(--ignt-color-primary);
190
+ font-weight: 600;
191
+ margin-bottom: 10px;
192
+ font-size: 1em;
193
+ margin-left: auto;
194
+ }
195
+ </style>
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <pre>{{ node.name }}</pre>
3
+ </template>
4
+
5
+ <script setup>
6
+ import { computed, reactive } from "vue";
7
+
8
+ const props = defineProps({
9
+ node: { type: Object, required: true },
10
+ });
11
+
12
+ const state = reactive({});
13
+ </script>