@bexis2/bexis2-core-ui 0.4.96 → 0.4.97
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/README.md +99 -25
- package/dist/components/CodeEditor/CodeEditor.svelte +2 -2
- package/dist/components/Facets/ShowMore.svelte +4 -6
- package/dist/components/File/FileUploader.svelte +6 -3
- package/dist/components/Table/Table.svelte +26 -5
- package/dist/components/Table/TableContent.svelte +226 -27
- package/dist/components/Table/TablePaginationServer.svelte +27 -8
- package/dist/components/Table/clientDB.d.ts +22 -0
- package/dist/components/Table/clientDB.js +236 -0
- package/dist/components/Table/filter.js +5 -1
- package/dist/components/Table/tableWorker.d.ts +1 -0
- package/dist/components/Table/tableWorker.js +179 -0
- package/dist/components/Table/utils.d.ts +1 -2
- package/dist/components/Table/utils.js +45 -26
- package/dist/components/form/CheckboxKvPList.svelte +15 -15
- package/dist/components/form/CheckboxList.svelte +1 -1
- package/dist/components/form/DateInput.svelte +12 -1
- package/dist/components/form/DatePickerInput.svelte +51 -29
- package/dist/components/form/Dropdown.svelte +14 -3
- package/dist/components/form/DropdownKvP.svelte +13 -2
- package/dist/components/form/InputContainer.svelte +17 -15
- package/dist/components/form/MultiSelect.svelte +30 -29
- package/dist/components/form/NumberInput.svelte +12 -1
- package/dist/components/form/TextArea.svelte +12 -1
- package/dist/components/form/TextInput.svelte +12 -1
- package/dist/components/page/Alert.svelte +5 -1
- package/dist/components/page/BackToTop.svelte +3 -1
- package/dist/components/page/Docs.svelte +9 -2
- package/dist/components/page/GoToTop.svelte +14 -15
- package/dist/components/page/Page.svelte +50 -56
- package/dist/components/page/breadcrumb/BreadcrumbDataCaller.js +11 -15
- package/dist/components/page/menu/MenuAccountBar.svelte +1 -5
- package/dist/components/page/menu/MenuDataCaller.js +1 -1
- package/dist/components/page/menu/MenuItem.svelte +9 -7
- package/dist/components/page/menu/MenuSublist.svelte +7 -5
- package/dist/components/page/menu/SettingsBar.svelte +4 -1
- package/dist/components/toggle/Toggle.svelte +9 -9
- package/dist/css/core.ui.postcss +1 -2
- package/dist/services/Api.js +4 -4
- package/dist/services/BaseCaller.js +1 -1
- package/package.json +114 -114
- package/src/lib/components/CodeEditor/CodeEditor.svelte +4 -4
- package/src/lib/components/Facets/Facets.svelte +2 -2
- package/src/lib/components/Facets/ShowMore.svelte +4 -6
- package/src/lib/components/File/FileUploader.svelte +17 -14
- package/src/lib/components/Table/Table.svelte +31 -10
- package/src/lib/components/Table/TableContent.svelte +261 -38
- package/src/lib/components/Table/TableFilter.svelte +7 -2
- package/src/lib/components/Table/TablePagination.svelte +6 -2
- package/src/lib/components/Table/TablePaginationServer.svelte +36 -10
- package/src/lib/components/Table/clientDB.js +236 -0
- package/src/lib/components/Table/filter.ts +27 -23
- package/src/lib/components/Table/tableWorker.js +179 -0
- package/src/lib/components/Table/utils.ts +75 -56
- package/src/lib/components/form/Checkbox.svelte +1 -1
- package/src/lib/components/form/CheckboxKvPList.svelte +15 -16
- package/src/lib/components/form/CheckboxList.svelte +1 -1
- package/src/lib/components/form/DateInput.svelte +13 -2
- package/src/lib/components/form/DatePickerInput.svelte +51 -29
- package/src/lib/components/form/Dropdown.svelte +14 -3
- package/src/lib/components/form/DropdownKvP.svelte +13 -2
- package/src/lib/components/form/InputContainer.svelte +18 -17
- package/src/lib/components/form/MultiSelect.svelte +30 -29
- package/src/lib/components/form/NumberInput.svelte +21 -12
- package/src/lib/components/form/TextArea.svelte +13 -2
- package/src/lib/components/form/TextInput.svelte +13 -2
- package/src/lib/components/page/Alert.svelte +5 -1
- package/src/lib/components/page/BackToTop.svelte +3 -1
- package/src/lib/components/page/Docs.svelte +9 -2
- package/src/lib/components/page/GoToTop.svelte +14 -15
- package/src/lib/components/page/Notification.svelte +1 -1
- package/src/lib/components/page/Page.svelte +67 -78
- package/src/lib/components/page/breadcrumb/Breadcrumb.svelte +2 -3
- package/src/lib/components/page/breadcrumb/BreadcrumbDataCaller.js +11 -15
- package/src/lib/components/page/menu/MenuAccountBar.svelte +1 -6
- package/src/lib/components/page/menu/MenuDataCaller.js +1 -1
- package/src/lib/components/page/menu/MenuItem.svelte +10 -8
- package/src/lib/components/page/menu/MenuSublist.svelte +35 -41
- package/src/lib/components/page/menu/SettingsBar.svelte +5 -2
- package/src/lib/components/toggle/Toggle.svelte +28 -30
- package/src/lib/css/core.ui.postcss +1 -2
- package/src/lib/index.ts +1 -2
- package/src/lib/services/Api.ts +21 -20
- package/src/lib/services/BaseCaller.js +1 -1
- package/src/lib/stores/apiStores.ts +1 -5
- package/src/lib/stores/pageStores.ts +0 -2
|
@@ -14,25 +14,34 @@
|
|
|
14
14
|
export let placeholder: string = '';
|
|
15
15
|
export let help: boolean = false;
|
|
16
16
|
export let disabled: boolean = false;
|
|
17
|
-
export let description
|
|
17
|
+
export let description: string = '';
|
|
18
18
|
export let showDescription: boolean = false;
|
|
19
19
|
export let showIcon: boolean = false;
|
|
20
|
-
export let min
|
|
21
|
-
export let max
|
|
20
|
+
export let min: number | undefined = undefined;
|
|
21
|
+
export let max: number | undefined = undefined;
|
|
22
22
|
|
|
23
23
|
// Diese Zeile wird jedes Mal ausgeführt, wenn sich "menge" ändert
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
$: if (min!=undefined && (parseInt(value) < min)) {
|
|
29
|
-
value = min.toString();
|
|
30
|
-
}
|
|
31
|
-
|
|
24
|
+
$: if (max != undefined && parseInt(value) > max) {
|
|
25
|
+
value = max.toString();
|
|
26
|
+
}
|
|
32
27
|
|
|
28
|
+
$: if (min != undefined && parseInt(value) < min) {
|
|
29
|
+
value = min.toString();
|
|
30
|
+
}
|
|
33
31
|
</script>
|
|
34
32
|
|
|
35
|
-
<InputContainer
|
|
33
|
+
<InputContainer
|
|
34
|
+
{id}
|
|
35
|
+
{label}
|
|
36
|
+
{feedback}
|
|
37
|
+
{required}
|
|
38
|
+
{help}
|
|
39
|
+
{description}
|
|
40
|
+
{showDescription}
|
|
41
|
+
{showIcon}
|
|
42
|
+
on:showDescription
|
|
43
|
+
on:hideDescription
|
|
44
|
+
>
|
|
36
45
|
<input
|
|
37
46
|
{id}
|
|
38
47
|
class="input variant-form-material dark:bg-zinc-700 bg-zinc-50 placeholder:text-gray-400"
|
|
@@ -12,12 +12,23 @@
|
|
|
12
12
|
export let placeholder: string = '';
|
|
13
13
|
export let help: boolean = false;
|
|
14
14
|
export let disabled: boolean = false;
|
|
15
|
-
export let description
|
|
15
|
+
export let description: string = '';
|
|
16
16
|
export let showDescription: boolean = false;
|
|
17
17
|
export let showIcon: boolean = false;
|
|
18
18
|
</script>
|
|
19
19
|
|
|
20
|
-
<InputContainer
|
|
20
|
+
<InputContainer
|
|
21
|
+
{id}
|
|
22
|
+
{label}
|
|
23
|
+
{feedback}
|
|
24
|
+
{required}
|
|
25
|
+
{help}
|
|
26
|
+
{description}
|
|
27
|
+
{showDescription}
|
|
28
|
+
{showIcon}
|
|
29
|
+
on:showDescription
|
|
30
|
+
on:hideDescription
|
|
31
|
+
>
|
|
21
32
|
<textarea
|
|
22
33
|
{id}
|
|
23
34
|
class="textarea variant-form-material dark:bg-zinc-700 bg-zinc-50 placeholder:text-gray-400"
|
|
@@ -11,12 +11,23 @@
|
|
|
11
11
|
export let placeholder: string = '';
|
|
12
12
|
export let help: boolean = false;
|
|
13
13
|
export let disabled: boolean = false;
|
|
14
|
-
export let description
|
|
14
|
+
export let description: string = '';
|
|
15
15
|
export let showDescription: boolean = false;
|
|
16
16
|
export let showIcon: boolean = false;
|
|
17
17
|
</script>
|
|
18
18
|
|
|
19
|
-
<InputContainer
|
|
19
|
+
<InputContainer
|
|
20
|
+
{id}
|
|
21
|
+
{label}
|
|
22
|
+
{feedback}
|
|
23
|
+
{required}
|
|
24
|
+
{help}
|
|
25
|
+
{description}
|
|
26
|
+
{showDescription}
|
|
27
|
+
{showIcon}
|
|
28
|
+
on:showDescription
|
|
29
|
+
on:hideDescription
|
|
30
|
+
>
|
|
20
31
|
<input
|
|
21
32
|
{id}
|
|
22
33
|
class="input variant-form-material dark:bg-zinc-700 bg-zinc-50 placeholder:text-gray-400"
|
|
@@ -32,7 +32,11 @@
|
|
|
32
32
|
<slot name="actions" />
|
|
33
33
|
|
|
34
34
|
{#if deleteBtn}
|
|
35
|
-
<button
|
|
35
|
+
<button
|
|
36
|
+
class="btn hover:text-primary-100"
|
|
37
|
+
title="Close alert"
|
|
38
|
+
on:click={() => (show = false)}
|
|
39
|
+
>
|
|
36
40
|
<Fa icon={faXmark} />
|
|
37
41
|
</button>
|
|
38
42
|
{/if}
|
|
@@ -26,5 +26,7 @@
|
|
|
26
26
|
<svelte:window on:scroll={handleOnScroll} />
|
|
27
27
|
|
|
28
28
|
<div class="w-full items-center">
|
|
29
|
-
<button class="btn ring back-to-top" title="Back to top" on:click={goTop} class:hidden
|
|
29
|
+
<button class="btn ring back-to-top" title="Back to top" on:click={goTop} class:hidden
|
|
30
|
+
>Back to top</button
|
|
31
|
+
>
|
|
30
32
|
</div>
|
|
@@ -39,9 +39,16 @@
|
|
|
39
39
|
{/if}
|
|
40
40
|
|
|
41
41
|
{#each links as link}
|
|
42
|
-
<span
|
|
42
|
+
<span
|
|
43
|
+
role="button"
|
|
44
|
+
tabindex="0"
|
|
45
|
+
title={link.label}
|
|
46
|
+
class="chip variant-soft hover:variant-filled"
|
|
47
|
+
on:click={() => goTo(link.url, false)}
|
|
48
|
+
on:keypress={() => goTo(link.url, false)}
|
|
49
|
+
>
|
|
43
50
|
<span>
|
|
44
|
-
{#if link.label.toLowerCase()=='manual'}
|
|
51
|
+
{#if link.label.toLowerCase() == 'manual'}
|
|
45
52
|
<Fa icon={faBook} />
|
|
46
53
|
{:else}
|
|
47
54
|
{link.label}
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
import Fa from 'svelte-fa';
|
|
3
|
+
import { faAngleUp } from '@fortawesome/free-solid-svg-icons';
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
import { faAngleUp } from '@fortawesome/free-solid-svg-icons';
|
|
5
|
+
export let showAtPixel = 1000;
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
let scrollHeight = 0;
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
const gotoTop = () => {
|
|
10
|
+
window.scrollTo({ top: 0, behavior: 'smooth' });
|
|
11
|
+
};
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
window.scrollTo({ top: 0, behavior: 'smooth' })
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
$: showGotoTop = scrollHeight > showAtPixel;
|
|
13
|
+
$: showGotoTop = scrollHeight > showAtPixel;
|
|
15
14
|
</script>
|
|
16
15
|
|
|
17
16
|
{#if showGotoTop}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
<button
|
|
18
|
+
id="gotToTop"
|
|
19
|
+
title="Go to top"
|
|
20
|
+
class="btn variant-filled-warning fixed bottom-5 right-20 shadow-md"
|
|
21
|
+
on:click={gotoTop}><Fa icon={faAngleUp} /></button
|
|
22
|
+
>
|
|
24
23
|
{/if}
|
|
25
24
|
|
|
26
25
|
<svelte:window bind:scrollY={scrollHeight} />
|
|
@@ -16,20 +16,18 @@
|
|
|
16
16
|
//popup
|
|
17
17
|
import { computePosition, autoUpdate, offset, shift, flip, arrow } from '@floating-ui/dom';
|
|
18
18
|
import { storePopup } from '@skeletonlabs/skeleton';
|
|
19
|
-
import { breadcrumbStore,notificationStore } from '$store/pageStores';
|
|
20
|
-
import { errorStore,csrfTokenStore } from '$store/apiStores';
|
|
19
|
+
import { breadcrumbStore, notificationStore } from '$store/pageStores';
|
|
20
|
+
import { errorStore, csrfTokenStore } from '$store/apiStores';
|
|
21
21
|
|
|
22
22
|
storePopup.set({ computePosition, autoUpdate, offset, shift, flip, arrow });
|
|
23
23
|
|
|
24
|
-
// icons
|
|
25
|
-
import type { helpItemType, helpStoreType } from '$models/Models';
|
|
26
|
-
|
|
24
|
+
// icons
|
|
25
|
+
import type { helpItemType, helpStoreType } from '$models/Models';
|
|
27
26
|
|
|
28
27
|
import Docs from './Docs.svelte';
|
|
29
28
|
import GoToTop from './GoToTop.svelte';
|
|
30
29
|
import { getAntiForgeryToken } from './PageCaller';
|
|
31
30
|
|
|
32
|
-
|
|
33
31
|
export let title = '';
|
|
34
32
|
export let note = '';
|
|
35
33
|
export let links: linkType[] = [];
|
|
@@ -43,102 +41,93 @@ import type { helpItemType, helpStoreType } from '$models/Models';
|
|
|
43
41
|
|
|
44
42
|
let aftIsReady = false;
|
|
45
43
|
|
|
46
|
-
errorStore.subscribe((error:errorType) => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
errorStore.subscribe((error: errorType) => {
|
|
45
|
+
console.log('🚀 ~ errorStore.subscribe ~ value:', error.error);
|
|
46
|
+
notificationStore.showNotification({
|
|
47
|
+
notificationType: notificationType.error,
|
|
48
|
+
message: error.error
|
|
49
|
+
});
|
|
50
|
+
});
|
|
53
51
|
|
|
54
52
|
onMount(async () => {
|
|
55
53
|
console.log('page');
|
|
56
54
|
breadcrumbStore.clean();
|
|
57
55
|
breadcrumbStore.addItem({ label: title, link: window.location.pathname });
|
|
58
56
|
const data = await getAntiForgeryToken();
|
|
59
|
-
csrfTokenStore.set(data.csrfToken);
|
|
57
|
+
csrfTokenStore.set(data.csrfToken);
|
|
60
58
|
});
|
|
61
59
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if(value.length>0){
|
|
60
|
+
csrfTokenStore.subscribe((value) => {
|
|
61
|
+
if (value.length > 0) {
|
|
65
62
|
aftIsReady = true;
|
|
66
63
|
}
|
|
67
64
|
});
|
|
68
65
|
|
|
69
|
-
|
|
70
|
-
let app;
|
|
66
|
+
let app;
|
|
71
67
|
function scrollToTop() {
|
|
72
68
|
app.scrollIntoView();
|
|
73
69
|
}
|
|
74
|
-
|
|
75
70
|
</script>
|
|
76
71
|
|
|
77
72
|
<div class="app" bind:this={app}>
|
|
78
|
-
<AppShell>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
73
|
+
<AppShell>
|
|
74
|
+
<!--header-->
|
|
75
|
+
<svelte:fragment slot="header">
|
|
76
|
+
<AppBar padding="0" spacing="space-y-0" background="white">
|
|
77
|
+
<svelte:fragment slot="headline">
|
|
78
|
+
<Header />
|
|
79
|
+
{#if true}
|
|
80
|
+
<Menu />
|
|
81
|
+
{/if}
|
|
82
|
+
|
|
83
|
+
<div class="grid grid-cols-2">
|
|
84
|
+
<Breadcrumb bind:title />
|
|
85
|
+
<Docs {links} {note} />
|
|
86
|
+
</div>
|
|
87
|
+
</svelte:fragment>
|
|
88
|
+
</AppBar>
|
|
89
|
+
</svelte:fragment>
|
|
90
|
+
|
|
91
|
+
<slot name="description" />
|
|
92
|
+
|
|
93
|
+
{#if aftIsReady}
|
|
94
|
+
<div class="flex flex-initial space-x-5">
|
|
95
|
+
{#if $$slots.left}
|
|
96
|
+
<div class="p-5 flex-shrink-0 w-96 w-min-96 border-y border-solid border-surface-500">
|
|
97
|
+
<slot name="left" />
|
|
98
|
+
</div>
|
|
86
99
|
{/if}
|
|
87
100
|
|
|
88
|
-
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
<slot name="description" />
|
|
97
|
-
|
|
98
|
-
{#if aftIsReady}
|
|
99
|
-
|
|
100
|
-
<div class="flex flex-initial space-x-5">
|
|
101
|
-
{#if $$slots.left}
|
|
102
|
-
<div class="p-5 flex-shrink-0 w-96 w-min-96 border-y border-solid border-surface-500">
|
|
103
|
-
<slot name="left" />
|
|
104
|
-
</div>
|
|
105
|
-
{/if}
|
|
106
|
-
|
|
107
|
-
{#if contentLayoutType === pageContentLayoutType.center}
|
|
108
|
-
<div class="flex justify-center w-screen">
|
|
109
|
-
<div class="w-full max-w-7xl p-5 space-y-5 border-y border-solid border-surface-500">
|
|
110
|
-
<slot />
|
|
111
|
-
</div>
|
|
112
|
-
</div>
|
|
113
|
-
{/if}
|
|
101
|
+
{#if contentLayoutType === pageContentLayoutType.center}
|
|
102
|
+
<div class="flex justify-center w-screen">
|
|
103
|
+
<div class="w-full max-w-7xl p-5 space-y-5 border-y border-solid border-surface-500">
|
|
104
|
+
<slot />
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
{/if}
|
|
114
108
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
109
|
+
{#if contentLayoutType === pageContentLayoutType.full}
|
|
110
|
+
<div class="p-5 space-y-5 border-y border-solid border-surface-500 w-screen">
|
|
111
|
+
<slot />
|
|
112
|
+
</div>
|
|
113
|
+
{/if}
|
|
120
114
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
115
|
+
{#if $$slots.right}
|
|
116
|
+
<div class=" p-5 fixed flex-shrink-0 w-96 border-y border-solid border-surface-500">
|
|
117
|
+
<slot name="right" />
|
|
118
|
+
</div>
|
|
119
|
+
{/if}
|
|
124
120
|
</div>
|
|
125
121
|
{/if}
|
|
126
|
-
</div>
|
|
127
|
-
|
|
128
|
-
{/if}
|
|
129
|
-
|
|
130
|
-
<GoToTop/>
|
|
131
|
-
<HelpPopUp active={help} />
|
|
132
|
-
<Notification />
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
<svelte:fragment slot="footer">
|
|
136
|
-
{#if footer}
|
|
137
|
-
<Footer />
|
|
138
|
-
{/if}
|
|
139
122
|
|
|
140
|
-
|
|
123
|
+
<GoToTop />
|
|
124
|
+
<HelpPopUp active={help} />
|
|
125
|
+
<Notification />
|
|
141
126
|
|
|
142
|
-
|
|
127
|
+
<svelte:fragment slot="footer">
|
|
128
|
+
{#if footer}
|
|
129
|
+
<Footer />
|
|
130
|
+
{/if}
|
|
131
|
+
</svelte:fragment>
|
|
132
|
+
</AppShell>
|
|
143
133
|
</div>
|
|
144
|
-
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import type { breadcrumbItemType } from '$models/Page';
|
|
4
4
|
import { browser } from '$app/environment';
|
|
5
5
|
import { onMount } from 'svelte';
|
|
6
|
-
import {getApplicationName} from './BreadcrumbDataCaller';
|
|
6
|
+
import { getApplicationName } from './BreadcrumbDataCaller';
|
|
7
7
|
|
|
8
8
|
export let title;
|
|
9
9
|
|
|
@@ -22,12 +22,11 @@
|
|
|
22
22
|
list = value?.items;
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
let applicationName =
|
|
25
|
+
let applicationName = 'BEXIS2';
|
|
26
26
|
|
|
27
27
|
onMount(async () => {
|
|
28
28
|
applicationName = await getApplicationName();
|
|
29
29
|
});
|
|
30
|
-
|
|
31
30
|
</script>
|
|
32
31
|
|
|
33
32
|
<div class="px-5 py-2">
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import { Api } from '$lib/services/Api';
|
|
2
2
|
|
|
3
3
|
export const getApplicationName = async () => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const response = await Api.get(`/Home/GetApplicationName`);
|
|
4
|
+
try {
|
|
5
|
+
const response = await Api.get(`/Home/GetApplicationName`);
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return "BEXIS2"
|
|
18
|
-
}
|
|
19
|
-
}
|
|
7
|
+
if (response.status == 200) {
|
|
8
|
+
return response.data;
|
|
9
|
+
} else {
|
|
10
|
+
return 'BEXIS2';
|
|
11
|
+
}
|
|
12
|
+
} catch (error) {
|
|
13
|
+
return 'BEXIS2';
|
|
14
|
+
}
|
|
15
|
+
};
|
|
@@ -9,17 +9,12 @@
|
|
|
9
9
|
export let menuBar: menuItemType[];
|
|
10
10
|
|
|
11
11
|
let comboboxValue: string;
|
|
12
|
-
|
|
13
12
|
</script>
|
|
14
13
|
|
|
15
14
|
{#if menuBar}
|
|
16
15
|
<div class="h-full place-self-center sm:flex gap-2 w-full sm:w-auto">
|
|
17
|
-
|
|
18
16
|
{#each menuBar as menubarItem}
|
|
19
|
-
|
|
20
|
-
<Item {menubarItem} {comboboxValue} />
|
|
21
|
-
|
|
17
|
+
<Item {menubarItem} {comboboxValue} />
|
|
22
18
|
{/each}
|
|
23
|
-
|
|
24
19
|
</div>
|
|
25
20
|
{/if}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
export let comboboxValue;
|
|
15
15
|
|
|
16
16
|
let id = Math.floor(Math.random() * 100).toString();
|
|
17
|
-
let
|
|
17
|
+
let idLabel = 'menu-' + menubarItem.Title.replaceAll(' ', '-');
|
|
18
18
|
|
|
19
19
|
let popupCombobox: PopupSettings = {
|
|
20
20
|
event: 'click',
|
|
@@ -27,10 +27,11 @@
|
|
|
27
27
|
|
|
28
28
|
{#if menubarItem.Items.length < 1}
|
|
29
29
|
<div class="p-2">
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
<button id={id + 'bt'} class="grid" use:popup={popupCombobox}>
|
|
31
|
+
<a class="grid" href={menubarItem.Url} target={menubarItem.Target}>
|
|
32
|
+
<span class="capitalize whitespace-nowrap text-lg hover:text-secondary-500"
|
|
33
|
+
>{comboboxValue ?? menubarItem.Title}</span
|
|
34
|
+
>
|
|
34
35
|
</a>
|
|
35
36
|
</button>
|
|
36
37
|
</div>
|
|
@@ -45,12 +46,13 @@
|
|
|
45
46
|
<svelte:fragment slot="content"
|
|
46
47
|
><MenuSublist {id} items={menubarItem.Items} /></svelte:fragment
|
|
47
48
|
>
|
|
48
|
-
|
|
49
|
-
>
|
|
49
|
+
</AccordionItem>
|
|
50
50
|
</div>
|
|
51
51
|
<div class="hidden sm:block place-self-center" use:popup={popupCombobox}>
|
|
52
52
|
<button id={idLabel} class="flex items-center gap-x-1 px-2">
|
|
53
|
-
<span class="capitalize text-lg whitespace-nowrap hover:text-secondary-500"
|
|
53
|
+
<span class="capitalize text-lg whitespace-nowrap hover:text-secondary-500"
|
|
54
|
+
>{menubarItem.Title}▾</span
|
|
55
|
+
>
|
|
54
56
|
</button>
|
|
55
57
|
|
|
56
58
|
<div class="z-50 w-max" data-popup={id}>
|
|
@@ -23,48 +23,40 @@
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
function clickFn(item)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
{
|
|
30
|
-
logOffFn();
|
|
26
|
+
function clickFn(item) {
|
|
27
|
+
if (item.Title == 'Log Off') {
|
|
28
|
+
logOffFn();
|
|
31
29
|
return;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
goTo(item.Url, item.Internal, item.Target);
|
|
30
|
+
} else {
|
|
31
|
+
goTo(item.Url, item.Internal, item.Target);
|
|
35
32
|
}
|
|
36
33
|
}
|
|
37
34
|
|
|
38
|
-
|
|
39
35
|
async function logOffFn() {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
} else {
|
|
60
|
-
console.error('Logout failed');
|
|
61
|
-
}
|
|
62
|
-
} catch (error) {
|
|
63
|
-
console.error('Error during logout:', error);
|
|
64
|
-
}
|
|
36
|
+
console.log('logoff');
|
|
37
|
+
// Prepare the body content for the POST request
|
|
38
|
+
|
|
39
|
+
let bodyContent = '__RequestVerificationToken=' + window.antiForgeryToken;
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
const response = await fetch('/Account/logoff', {
|
|
43
|
+
method: 'POST',
|
|
44
|
+
credentials: 'include', // Include cookies for authentication
|
|
45
|
+
headers: {
|
|
46
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
47
|
+
},
|
|
48
|
+
body: bodyContent
|
|
49
|
+
});
|
|
50
|
+
if (response.ok) {
|
|
51
|
+
// Redirect to login page after logout
|
|
52
|
+
window.location.href = '/Account/Login';
|
|
53
|
+
} else {
|
|
54
|
+
console.error('Logout failed');
|
|
65
55
|
}
|
|
66
|
-
|
|
67
|
-
|
|
56
|
+
} catch (error) {
|
|
57
|
+
console.error('Error during logout:', error);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
68
60
|
</script>
|
|
69
61
|
|
|
70
62
|
<ListBox class="sm:bg-white sm:border overflow-y-auto max-h-[500px]">
|
|
@@ -74,14 +66,16 @@
|
|
|
74
66
|
<ListBoxItem
|
|
75
67
|
class="text-md sm:text-sm text-surface-800 py-1 hover:text-secondary-500 bg-transparent hover:bg-surface-200"
|
|
76
68
|
bind:group={item.Title}
|
|
77
|
-
|
|
78
69
|
name="medium"
|
|
79
70
|
value={item.Title}
|
|
80
|
-
|
|
81
71
|
>
|
|
82
|
-
|
|
83
|
-
|
|
72
|
+
<a
|
|
73
|
+
id={'menu-' + item.Title.replaceAll(' ', '-')}
|
|
74
|
+
href={item.Url}
|
|
75
|
+
target={item.Target}
|
|
76
|
+
class="w-full block"
|
|
77
|
+
on:click|preventDefault={() => clickFn(item)}>{item.Title}</a
|
|
78
|
+
>
|
|
84
79
|
</ListBoxItem>
|
|
85
|
-
|
|
86
80
|
{/each}
|
|
87
81
|
</ListBox>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { faCog } from '@fortawesome/free-solid-svg-icons';
|
|
8
8
|
|
|
9
9
|
export let menuBar: menuItemType[];
|
|
10
|
-
console.log(
|
|
10
|
+
console.log('🚀 ~ menuBar:', menuBar);
|
|
11
11
|
//uicomponents
|
|
12
12
|
import MenuSublist from './MenuSublist.svelte';
|
|
13
13
|
|
|
@@ -24,7 +24,10 @@
|
|
|
24
24
|
<div class="sm:hidden">
|
|
25
25
|
<AccordionItem padding="p-2">
|
|
26
26
|
<svelte:fragment slot="summary"
|
|
27
|
-
><button
|
|
27
|
+
><button
|
|
28
|
+
id="settings"
|
|
29
|
+
class="flex items-center gap-x-1 text-sm text-surface-800 w-5 h-full"
|
|
30
|
+
>
|
|
28
31
|
<span class="capitalize"><Fa icon={faCog} /></span>
|
|
29
32
|
</button></svelte:fragment
|
|
30
33
|
>
|