@viur/shop-components 0.0.1-dev.2 → 0.0.1-dev.4

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.
@@ -1,569 +0,0 @@
1
- <template>
2
- <Loader v-if="!state.basketItems"></Loader>
3
- <template v-else>
4
- <div class="bind">
5
- <sl-tab-group class="cart-tab" noScrollControls>
6
- <sl-tab slot="nav" panel="general">
7
- <div class="cart-step">
8
- <sl-icon name="cart" library="hsk"></sl-icon>
9
- <div class="cart-status-text">1. Warenkorb</div>
10
- </div>
11
- <sl-icon name="chevron-right" class="cart-tab-check"></sl-icon>
12
- </sl-tab>
13
- <sl-tab slot="nav" panel="custom">
14
- <div class="cart-step">
15
- <sl-icon name="order" library="hsk"></sl-icon>
16
- <div class="cart-status-text">2. Ihr individuelles Angebot</div>
17
- </div>
18
- <sl-icon name="chevron-right" class="cart-tab-check"></sl-icon>
19
- </sl-tab>
20
- <sl-tab slot="nav" panel="advanced">
21
- <div class="cart-step">
22
- <sl-icon name="order-check" library="hsk"></sl-icon>
23
- <div class="cart-status-text">3. Bestellung prüfen</div>
24
- </div>
25
- <sl-icon name="chevron-right" class="cart-tab-check"></sl-icon>
26
- </sl-tab>
27
- <sl-tab slot="nav" panel="disabled">
28
- <div class="cart-step">
29
- <sl-icon name="order-confirmed" library="hsk"></sl-icon>
30
- <div class="cart-status-text">
31
- 4. Bestellung erfolgreich abgeschlossen.
32
- </div>
33
- </div>
34
- </sl-tab>
35
- <sl-tab-panel name="general"></sl-tab-panel>
36
- <sl-tab-panel name="custom"></sl-tab-panel>
37
- <sl-tab-panel name="advanced"></sl-tab-panel>
38
- <sl-tab-panel name="disabled"></sl-tab-panel>
39
- </sl-tab-group>
40
- <div class="controlbar">
41
- <div class="button-list left">
42
- <sl-input
43
- ref="cartNameField"
44
- name="cart-name"
45
- placeholder="Warenkorbname"
46
- v-model="state.basket.name"
47
- required="true"
48
- inputmode="text"
49
- class="cart-headline"
50
- >
51
- <sl-icon library="hsk" name="pen" slot="suffix"></sl-icon>
52
- </sl-input>
53
- </div>
54
- <sl-dropdown distance="10">
55
- <sl-icon
56
- class="dots"
57
- name="dots"
58
- library="hsk"
59
- slot="trigger"
60
- ></sl-icon>
61
- <sl-menu>
62
- <sl-menu-item @click="saveCart" title="Warenkorb speichern">
63
- <sl-icon
64
- slot="prefix"
65
- library="hsk"
66
- name="save"
67
- class="primary-icon"
68
- ></sl-icon>
69
- Warenkorb speichern
70
- </sl-menu-item>
71
- <sl-menu-item @click="saveCart" title="Zu Projekt hinzufügen">
72
- <sl-icon
73
- slot="prefix"
74
- library="hsk"
75
- name="project"
76
- class="primary-icon"
77
- ></sl-icon>
78
- Zu Projekt hinzufügen
79
- </sl-menu-item>
80
- <sl-menu-item @click="saveCart" title="Warenkorb kopieren">
81
- <sl-icon
82
- slot="prefix"
83
- library="hsk"
84
- name="clone"
85
- class="primary-icon"
86
- ></sl-icon>
87
- Warenkorb kopieren
88
- </sl-menu-item>
89
- <sl-menu-item @click="saveCart" title="Warenkorb löschen">
90
- <sl-icon
91
- slot="prefix"
92
- library="hsk"
93
- name="delete"
94
- class="delete-icon"
95
- ></sl-icon>
96
- Warenkorb löschen
97
- </sl-menu-item>
98
- </sl-menu>
99
- </sl-dropdown>
100
- </div>
101
- <sl-input
102
- name="cart-internalCartNo"
103
- placeholder="Freifeld (Kommission)"
104
- v-model="state.basket.customer_comment"
105
- inputmode="text"
106
- class="cart-descr"
107
- >
108
- <sl-icon library="hsk" name="pen" slot="suffix"></sl-icon>
109
- </sl-input>
110
- <br />
111
- <sl-alert ref="cartActionInfo" variant="primary" duration="3000" closable>
112
- <sl-icon slot="icon" name="check"></sl-icon>
113
- <strong>Warenkorb gespeichert!</strong><br />
114
- </sl-alert>
115
- <sl-alert ref="cartErrorInfo" variant="danger" duration="3000" closable>
116
- <sl-icon slot="icon" name="error"></sl-icon>
117
- <strong>Warenkorb nicht gespeichert!</strong><br />
118
- </sl-alert>
119
- <!-- <div class="search-box">
120
- <sl-input
121
- @sl-change="onSearch"
122
- type="search"
123
- label=""
124
- placeholder="Artikelnummer suchen"
125
- size="small"
126
- clearable
127
- class="article-combobox"
128
- >
129
- <sl-icon name="search" slot="suffix"></sl-icon>
130
- </sl-input>
131
- <sl-input class="comission-box"
132
- size="small"
133
- placeholder="Kommission"></sl-input>
134
- <sl-input class="search-amt" type="number"
135
- size="small"
136
- inputmode="decimal" placeholder="Anzahl" clearable step="1"
137
- name=""
138
- :value="skel.amt"></sl-input>
139
- <sl-button size="small" variant="secondary">
140
- Hinzufügen
141
- </sl-button>
142
- </div> -->
143
- <!--<div>
144
- <h2>Auftragsnr. {{ skel.value.internalCartNo }}</h2>
145
- </div>
146
- <div>
147
- <p>Sachbearbeiter {{ getBoneValue("user") }}</p>
148
- </div>
149
- <div>
150
- {{ skel.name }}
151
- </div>-->
152
- <!-- <sl-dialog ref="dialogDkAccordeon" class="dialog-width" style="--width: 50vw;" label="Wählen Sie bitte aus...">
153
- <dk-article-simple-list :skellist="cartStore.dkArtikelSearchResult"
154
- v-if="cartStore.dkSearchDialogMode === 0"></dk-article-simple-list>
155
- <dk-shop v-if="cartStore.dkSearchDialogMode === 1" :articleKey="cartStore.dkArticleSearchSelectedKey"></dk-shop>
156
- </sl-dialog>
157
- <sl-dialog label="Artikel hinzufügen" ref="dialogHkSelection" style="--width: 75vw;">
158
- <hk-selection v-if="cartStore.dkSearchDialogMode === 2"></hk-selection>
159
- </sl-dialog>
160
-
161
- <cart-article-item :key="key" :structure="cartStore.cartProductStructureByKey" :skel="item"
162
- v-for="(item, key) in cartStore.currentCart?.cartProducts"></cart-article-item>
163
-
164
-
165
- <sl-alert variant="warning" duration="5000" closable>
166
- <sl-icon slot="icon" name="exclamation-triangle"></sl-icon>
167
- <strong>Die Suche ergab keine Treffer!</strong><br/>
168
- </sl-alert> -->
169
- <!-- <code v-for="item in state.products">{{ item }}</code>-->
170
- <sl-card horizontal v-for="item in state.basketItems">
171
- <img
172
- class="card-img"
173
- slot="image"
174
- :src="getImage(state.itemsFullInfo[item.article.dest.key])"
175
- />
176
-
177
- <div class="header" slot="header">
178
- <h4 class="headline">{{ item.article.dest.shop_name }} | 425018</h4>
179
- </div>
180
- <div class="price-wrap" slot="footer">
181
- <div class="price">
182
- {{ item.article.dest.shop_price_recommended }} €
183
- </div>
184
- <div class="small-print">Brutto / Stk.</div>
185
- <div class="amount">Anzahl: 1</div>
186
- </div>
187
- <div class="card-body-row">
188
- Version: 900x900x2000 <br />
189
- Farbe: Chromoptik <br />
190
- Glasart: Klar hell mit Edelglasbeschichtung<br />
191
- Anschlag: Beidseitig variabel<br />
192
- Griff: Stangengriff Exklusiv (56)
193
- </div>
194
- </sl-card>
195
-
196
- <div class="order-footer">
197
- <div>Gesamt: {{ state.basket.total }}</div>
198
- <sl-button variant="info" size="small"> Jetzt Bestellen </sl-button>
199
- </div>
200
- </div>
201
- </template>
202
- </template>
203
-
204
- <script setup>
205
- import { inject, onMounted, reactive, computed, ref, onBeforeMount } from "vue";
206
- import Loader from "@viur/vue-utils/generic/Loader.vue";
207
- import { useCartStore } from "../../stores/cart.js";
208
- import { Request } from "@viur/vue-utils";
209
-
210
- const cartStore = useCartStore();
211
-
212
- // const searchWarning = ref()
213
- const state = reactive({ basket: {}, basketItems: {}, itemsFullInfo: {} });
214
-
215
- function getArticleView(key) {
216
- return Request.get(`/json/variante/view/${key}`);
217
- }
218
-
219
- function getImage(item) {
220
- let imageUrl =
221
- "https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80";
222
-
223
- if (item.dk_artikel.dest.image) {
224
- return Request.downloadUrlFor(item.dk_artikel.dest.image);
225
- }
226
-
227
- return imageUrl;
228
- }
229
-
230
- function getBasketItems(basketKey) {
231
- return Request.get("/shop/api/cart_list", {
232
- dataObj: { cart_key: basketKey },
233
- });
234
- }
235
-
236
- function getBasket() {
237
- return Request.get("/shop/api/cart_list");
238
- }
239
-
240
- onBeforeMount(() => {
241
- getBasket().then(async (resp) => {
242
- let data = await resp.json();
243
- data.forEach((cart) => {
244
- if (cart.cart_type === "basket") {
245
- state.basket = cart;
246
-
247
- getBasketItems(cart.key).then(async (resp) => {
248
- let data = await resp.json();
249
- state.basketItems = data;
250
-
251
- data.forEach((item) => {
252
- getArticleView(item.article.dest.key).then(async (resp) => {
253
- let data = await resp.json();
254
- state.itemsFullInfo[data.values.key] = data.values;
255
- });
256
- });
257
- });
258
- }
259
- });
260
- });
261
- });
262
- </script>
263
-
264
- <style scoped>
265
- sl-alert {
266
- margin-top: var(--sl-spacing-medium);
267
- margin-bottom: var(--sl-spacing-medium);
268
- }
269
-
270
- .controlbar {
271
- width: 100%;
272
- display: flex;
273
- justify-content: space-between;
274
- align-items: center;
275
-
276
- sl-input {
277
- flex: 1;
278
-
279
- &::part(base) {
280
- margin-bottom: 0;
281
- }
282
- }
283
- }
284
-
285
- .button-list {
286
- display: flex;
287
- flex-direction: row;
288
- gap: 10px;
289
-
290
- &.left {
291
- flex: 1;
292
- margin-right: 10px;
293
- }
294
- }
295
-
296
- .search {
297
- flex: 1 1 100%;
298
- margin-left: 10px;
299
- }
300
-
301
- .article-combobox {
302
- float: left;
303
- width: 75ch;
304
- }
305
-
306
- .card-img {
307
- aspect-ratio: 1;
308
- }
309
-
310
- .cart-selection {
311
- flex: 1;
312
- }
313
-
314
- .cart-wrap {
315
- display: flex;
316
- flex-direction: column;
317
- width: 100%;
318
- }
319
-
320
- .soma-input {
321
- display: grid;
322
- grid-template-columns: 120px 1fr;
323
- align-items: center;
324
- }
325
-
326
- .soma-label {
327
- display: flex;
328
- flex-direction: row;
329
- align-items: center;
330
-
331
- sl-icon {
332
- margin-left: 5px;
333
- background-color: @highlightColor;
334
- color: #fff;
335
- aspect-ratio: 1;
336
- border-radius: 50%;
337
- padding: 0.3em;
338
- font-size: 0.6em;
339
- cursor: pointer;
340
- }
341
- }
342
-
343
- sl-tooltip {
344
- &::part(body) {
345
- line-height: 1.2;
346
- font-weight: 400;
347
- padding: 10px;
348
- }
349
- }
350
-
351
- .cart-tab {
352
- sl-tab {
353
- width: 25%;
354
-
355
- &::part(base) {
356
- width: 100%;
357
- height: 100%;
358
- display: flex;
359
- justify-content: center;
360
- align-items: center;
361
- position: relative;
362
- color: var(--sl-color-neutral-400);
363
- }
364
-
365
- &[aria-selected="true"]::part(base) {
366
- color: var(--ignt-color-primary) !important;
367
- }
368
- }
369
- }
370
-
371
- .cart-status-text {
372
- font-size: 0.8em;
373
- color: inherit;
374
- text-align: center;
375
- margin-top: 0.6em;
376
- white-space: initial;
377
- }
378
-
379
- .cart-step {
380
- width: 100%;
381
- height: 100%;
382
- display: flex;
383
- flex-direction: column;
384
- justify-content: flex-start;
385
- align-items: center;
386
-
387
- @media (--ignt-mq-max-break-small) {
388
- justify-content: center;
389
- }
390
-
391
- sl-icon {
392
- font-size: 2.5em;
393
- margin-bottom: 10px;
394
-
395
- @media (--ignt-mq-max-break-small) {
396
- display: none;
397
- }
398
- }
399
- }
400
-
401
- .cart-tab-check {
402
- position: absolute;
403
- right: -0.5em;
404
-
405
- @media (--ignt-mq-max-break-small) {
406
- font-size: 0.7em;
407
- right: -0.35em;
408
- top: calc(50% - 0.35em);
409
- }
410
- }
411
-
412
- .search-box {
413
- display: flex;
414
- flex-direction: row;
415
- flex-wrap: nowrap;
416
- align-items: stretch;
417
- margin-bottom: 30px;
418
-
419
- sl-button {
420
- &::part(base) {
421
- height: 100%;
422
- }
423
- }
424
-
425
- @media (--ignt-mq-max-break-medium) {
426
- flex-wrap: wrap;
427
- }
428
- }
429
-
430
- .article-combobox {
431
- flex: 1 1 100%;
432
- margin-bottom: 10px;
433
-
434
- &::part(base) {
435
- margin-bottom: 0;
436
- }
437
-
438
- @media (--ignt-mq-max-break-medium) {
439
- margin-bottom: 0;
440
- }
441
- }
442
-
443
- .comission-box {
444
- margin-right: 10px;
445
-
446
- &::part(base) {
447
- margin-bottom: 0;
448
- }
449
-
450
- @media (--ignt-mq-max-break-medium) {
451
- flex: 1;
452
- }
453
- }
454
-
455
- .search-amt {
456
- margin-right: 10px;
457
-
458
- &::part(base) {
459
- margin-bottom: 0;
460
- width: 80px;
461
- }
462
- }
463
-
464
- .cart-headline {
465
- &::part(base) {
466
- background-color: transparent;
467
- transition: all ease 0.3s;
468
- border-bottom: 1px solid transparent;
469
- height: auto;
470
- }
471
-
472
- :deep(.input--focused) {
473
- border-bottom: 1px solid var(--sl-color-primary-500) !important;
474
- }
475
-
476
- &::part(input) {
477
- color: var(--sl-color-primary-500);
478
- font-weight: 300;
479
- text-transform: uppercase;
480
- font-size: 1.85em;
481
- padding: 0.1em 0;
482
- height: auto;
483
- }
484
-
485
- &::part(suffix) {
486
- pointer-events: none;
487
- width: 1.5em;
488
- margin-left: -1em;
489
- font-size: 1.5em;
490
- }
491
-
492
- &:hover {
493
- &::part(base) {
494
- border-bottom: 1px solid var(--sl-color-primary-500);
495
- }
496
- }
497
- }
498
-
499
- .cart-descr {
500
- margin-top: 10px;
501
-
502
- &::part(base) {
503
- background-color: transparent;
504
- transition: all ease 0.3s;
505
- border-bottom: 1px solid transparent;
506
- margin-bottom: 0;
507
- }
508
-
509
- &::part(input) {
510
- padding: 0.1em 0;
511
- height: auto;
512
- color: var(--ignt-color-text);
513
- }
514
-
515
- &::part(suffix) {
516
- pointer-events: none;
517
- width: 1.5em;
518
- margin-left: -1em;
519
- font-size: 1.5em;
520
- }
521
-
522
- &:hover {
523
- &::part(base) {
524
- border-bottom: 1px solid var(--ignt-color-text);
525
- }
526
- }
527
- }
528
-
529
- sl-menu-item {
530
- &::part(base) {
531
- padding: 0.2em 0.9em 0.2em 0.8em;
532
- }
533
-
534
- &::part(checked-icon) {
535
- display: none;
536
- }
537
-
538
- &::part(prefix) {
539
- margin-right: 10px;
540
- }
541
-
542
- &::part(suffix) {
543
- margin-right: -1.5em;
544
- }
545
- }
546
-
547
- .primary-icon {
548
- color: var(--ignt-color-primary);
549
- }
550
-
551
- .delete-icon {
552
- color: @warnColor;
553
- }
554
-
555
- .dots {
556
- color: var(--ignt-color-primary);
557
- width: 1.5em;
558
- height: 100%;
559
- font-size: 1em;
560
- padding: 0.4em;
561
- }
562
-
563
- .order-footer {
564
- width: 100%;
565
- display: flex;
566
- justify-content: space-between;
567
- margin-bottom: 30px;
568
- }
569
- </style>
package/src/index.html DELETED
@@ -1,13 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Vite + Vue</title>
8
- </head>
9
- <body>
10
- <div id="app"></div>
11
- <script type="module" src="/src/main.js"></script>
12
- </body>
13
- </html>
package/src/index.js DELETED
@@ -1,4 +0,0 @@
1
- //import CategoryList from "./components/order/category/CategoryList.vue";
2
- import createRouterInstance from "./router";
3
-
4
- export { createRouterInstance };
package/src/main.js DELETED
@@ -1,9 +0,0 @@
1
- import { createPinia } from "pinia";
2
- import { createApp } from "vue";
3
- import App from "./App.vue";
4
-
5
- const pinia = createPinia();
6
- const app = createApp(App)
7
- app.use(pinia)
8
-
9
- app.mount("#app");
@@ -1,54 +0,0 @@
1
- // import "@viur/shoelace/dist/themes/viur.css"
2
- import "@viur/shoelace/dist/components/button/button.js";
3
- import "@viur/shoelace/dist/components/button-group/button-group.js";
4
- import "@viur/shoelace/dist/components/icon/icon.js";
5
- import "@viur/shoelace/dist/components/input/input.js";
6
- import "@viur/shoelace/dist/components/dropdown/dropdown.js";
7
- import "@viur/shoelace/dist/components/menu/menu.js";
8
- import "@viur/shoelace/dist/components/menu-item/menu-item.js";
9
- import "@viur/shoelace/dist/components/badge/badge.js";
10
- import "@viur/shoelace/dist/components/divider/divider.js";
11
- import "@viur/shoelace/dist/components/avatar/avatar.js";
12
- import "@viur/shoelace/dist/components/dialog/dialog.js";
13
- import "@viur/shoelace/dist/components/tooltip/tooltip.js";
14
- import "@viur/shoelace/dist/components/split-panel/split-panel.js";
15
- import "@viur/shoelace/dist/components/radio-group/radio-group.js";
16
- import "@viur/shoelace/dist/components/radio-button/radio-button.js";
17
- import "@viur/shoelace/dist/components/select/select.js";
18
- import "@viur/shoelace/dist/components/option/option.js";
19
- import "@viur/shoelace/dist/components/spinner/spinner.js";
20
- import "@viur/shoelace/dist/components/switch/switch.js";
21
- import "@viur/shoelace/dist/components/card/card.js";
22
- import "@viur/shoelace/dist/components/tag/tag.js";
23
- import "@viur/shoelace/dist/components/tooltip/tooltip.js";
24
- import "@viur/shoelace/dist/components/checkbox/checkbox.js";
25
- import "@viur/shoelace/dist/components/table-wrapper/table-wrapper.js";
26
- import "@viur/shoelace/dist/components/drawer/drawer.js";
27
- import "@viur/shoelace/dist/components/alert/alert.js";
28
- import "@viur/shoelace/dist/components/icon-button/icon-button.js";
29
- import "@viur/shoelace/dist/components/tree/tree.js";
30
- import "@viur/shoelace/dist/components/tree-item/tree-item.js";
31
- import "@viur/shoelace/dist/components/breadcrumb/breadcrumb.js";
32
- import "@viur/shoelace/dist/components/breadcrumb-item/breadcrumb-item.js";
33
- import "@viur/shoelace/dist/components/format-date/format-date.js";
34
- import "@viur/shoelace/dist/components/format-bytes/format-bytes.js";
35
- import "@viur/shoelace/dist/components/tab-group/tab-group.js";
36
- import "@viur/shoelace/dist/components/tab/tab.js";
37
- import "@viur/shoelace/dist/components/tab-panel/tab-panel.js";
38
- import "@viur/shoelace/dist/components/combobox/combobox.js";
39
-
40
- import { setBasePath } from "@viur/shoelace/dist/utilities/base-path.js";
41
- import { registerIconLibrary } from "@viur/shoelace/dist/utilities/icon-library.js";
42
-
43
- if (import.meta.env.DEV) {
44
- setBasePath(`/static/dashboard/shoelace`);
45
- } else {
46
- setBasePath(`shoelace`);
47
- }
48
-
49
-
50
- // Register a custom icons repository for this app
51
-
52
- // registerIconLibrary("logo", {
53
- // resolver: (name) => `/static/app-logos/${name}.svg`,
54
- // });