@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.
Files changed (86) hide show
  1. package/README.md +99 -25
  2. package/dist/components/CodeEditor/CodeEditor.svelte +2 -2
  3. package/dist/components/Facets/ShowMore.svelte +4 -6
  4. package/dist/components/File/FileUploader.svelte +6 -3
  5. package/dist/components/Table/Table.svelte +26 -5
  6. package/dist/components/Table/TableContent.svelte +226 -27
  7. package/dist/components/Table/TablePaginationServer.svelte +27 -8
  8. package/dist/components/Table/clientDB.d.ts +22 -0
  9. package/dist/components/Table/clientDB.js +236 -0
  10. package/dist/components/Table/filter.js +5 -1
  11. package/dist/components/Table/tableWorker.d.ts +1 -0
  12. package/dist/components/Table/tableWorker.js +179 -0
  13. package/dist/components/Table/utils.d.ts +1 -2
  14. package/dist/components/Table/utils.js +45 -26
  15. package/dist/components/form/CheckboxKvPList.svelte +15 -15
  16. package/dist/components/form/CheckboxList.svelte +1 -1
  17. package/dist/components/form/DateInput.svelte +12 -1
  18. package/dist/components/form/DatePickerInput.svelte +51 -29
  19. package/dist/components/form/Dropdown.svelte +14 -3
  20. package/dist/components/form/DropdownKvP.svelte +13 -2
  21. package/dist/components/form/InputContainer.svelte +17 -15
  22. package/dist/components/form/MultiSelect.svelte +30 -29
  23. package/dist/components/form/NumberInput.svelte +12 -1
  24. package/dist/components/form/TextArea.svelte +12 -1
  25. package/dist/components/form/TextInput.svelte +12 -1
  26. package/dist/components/page/Alert.svelte +5 -1
  27. package/dist/components/page/BackToTop.svelte +3 -1
  28. package/dist/components/page/Docs.svelte +9 -2
  29. package/dist/components/page/GoToTop.svelte +14 -15
  30. package/dist/components/page/Page.svelte +50 -56
  31. package/dist/components/page/breadcrumb/BreadcrumbDataCaller.js +11 -15
  32. package/dist/components/page/menu/MenuAccountBar.svelte +1 -5
  33. package/dist/components/page/menu/MenuDataCaller.js +1 -1
  34. package/dist/components/page/menu/MenuItem.svelte +9 -7
  35. package/dist/components/page/menu/MenuSublist.svelte +7 -5
  36. package/dist/components/page/menu/SettingsBar.svelte +4 -1
  37. package/dist/components/toggle/Toggle.svelte +9 -9
  38. package/dist/css/core.ui.postcss +1 -2
  39. package/dist/services/Api.js +4 -4
  40. package/dist/services/BaseCaller.js +1 -1
  41. package/package.json +114 -114
  42. package/src/lib/components/CodeEditor/CodeEditor.svelte +4 -4
  43. package/src/lib/components/Facets/Facets.svelte +2 -2
  44. package/src/lib/components/Facets/ShowMore.svelte +4 -6
  45. package/src/lib/components/File/FileUploader.svelte +17 -14
  46. package/src/lib/components/Table/Table.svelte +31 -10
  47. package/src/lib/components/Table/TableContent.svelte +261 -38
  48. package/src/lib/components/Table/TableFilter.svelte +7 -2
  49. package/src/lib/components/Table/TablePagination.svelte +6 -2
  50. package/src/lib/components/Table/TablePaginationServer.svelte +36 -10
  51. package/src/lib/components/Table/clientDB.js +236 -0
  52. package/src/lib/components/Table/filter.ts +27 -23
  53. package/src/lib/components/Table/tableWorker.js +179 -0
  54. package/src/lib/components/Table/utils.ts +75 -56
  55. package/src/lib/components/form/Checkbox.svelte +1 -1
  56. package/src/lib/components/form/CheckboxKvPList.svelte +15 -16
  57. package/src/lib/components/form/CheckboxList.svelte +1 -1
  58. package/src/lib/components/form/DateInput.svelte +13 -2
  59. package/src/lib/components/form/DatePickerInput.svelte +51 -29
  60. package/src/lib/components/form/Dropdown.svelte +14 -3
  61. package/src/lib/components/form/DropdownKvP.svelte +13 -2
  62. package/src/lib/components/form/InputContainer.svelte +18 -17
  63. package/src/lib/components/form/MultiSelect.svelte +30 -29
  64. package/src/lib/components/form/NumberInput.svelte +21 -12
  65. package/src/lib/components/form/TextArea.svelte +13 -2
  66. package/src/lib/components/form/TextInput.svelte +13 -2
  67. package/src/lib/components/page/Alert.svelte +5 -1
  68. package/src/lib/components/page/BackToTop.svelte +3 -1
  69. package/src/lib/components/page/Docs.svelte +9 -2
  70. package/src/lib/components/page/GoToTop.svelte +14 -15
  71. package/src/lib/components/page/Notification.svelte +1 -1
  72. package/src/lib/components/page/Page.svelte +67 -78
  73. package/src/lib/components/page/breadcrumb/Breadcrumb.svelte +2 -3
  74. package/src/lib/components/page/breadcrumb/BreadcrumbDataCaller.js +11 -15
  75. package/src/lib/components/page/menu/MenuAccountBar.svelte +1 -6
  76. package/src/lib/components/page/menu/MenuDataCaller.js +1 -1
  77. package/src/lib/components/page/menu/MenuItem.svelte +10 -8
  78. package/src/lib/components/page/menu/MenuSublist.svelte +35 -41
  79. package/src/lib/components/page/menu/SettingsBar.svelte +5 -2
  80. package/src/lib/components/toggle/Toggle.svelte +28 -30
  81. package/src/lib/css/core.ui.postcss +1 -2
  82. package/src/lib/index.ts +1 -2
  83. package/src/lib/services/Api.ts +21 -20
  84. package/src/lib/services/BaseCaller.js +1 -1
  85. package/src/lib/stores/apiStores.ts +1 -5
  86. 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 : string = '';
17
+ export let description: string = '';
18
18
  export let showDescription: boolean = false;
19
19
  export let showIcon: boolean = false;
20
- export let min : number | undefined = undefined;
21
- export let max : number | undefined = undefined;
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
- $: if (max!=undefined && (parseInt(value) > max)) {
25
- value = max.toString();
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 {id} {label} {feedback} {required} {help} {description} {showDescription} {showIcon} on:showDescription on:hideDescription>
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 : string = '';
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 {id} {label} {feedback} {required} {help} {description} {showDescription} {showIcon} on:showDescription on:hideDescription>
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 : string = '';
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 {id} {label} {feedback} {required} {help} {description} {showDescription} {showIcon} on:showDescription on:hideDescription>
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 class="btn hover:text-primary-100" title="Close alert" on:click={() => (show = false)}>
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>Back to top</button>
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 role="button" tabindex="0" title={link.label} class="chip variant-soft hover:variant-filled" on:click={() => goTo(link.url, false)} on:keypress={() => goTo(link.url, false)}>
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
- import Fa from 'svelte-fa';
4
- import { faAngleUp } from '@fortawesome/free-solid-svg-icons';
5
+ export let showAtPixel = 1000;
5
6
 
6
- export let showAtPixel = 1000;
7
+ let scrollHeight = 0;
7
8
 
8
- let scrollHeight = 0;
9
+ const gotoTop = () => {
10
+ window.scrollTo({ top: 0, behavior: 'smooth' });
11
+ };
9
12
 
10
- const gotoTop = () => {
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
- <button
19
- id="gotToTop"
20
- title="Go to top"
21
- class="btn variant-filled-warning fixed bottom-5 right-20 shadow-md"
22
- on:click={gotoTop}
23
- ><Fa icon={faAngleUp}/></button >
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} />
@@ -13,7 +13,7 @@
13
13
  ? notificationStore.getBtnStyle()
14
14
  : $notificationStore.btnStyle;
15
15
 
16
- $: $notificationStore, triggerToast();
16
+ $: ($notificationStore, triggerToast());
17
17
 
18
18
  onMount(() => {
19
19
  toastStore.clear();
@@ -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
- console.log("🚀 ~ errorStore.subscribe ~ value:", error.error)
48
- notificationStore.showNotification({
49
- notificationType: notificationType.error,
50
- message: error.error
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
- csrfTokenStore.subscribe(value => {
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
- <!--header-->
80
- <svelte:fragment slot="header">
81
- <AppBar padding="0" spacing="space-y-0" background="white">
82
- <svelte:fragment slot="headline">
83
- <Header />
84
- {#if true}
85
- <Menu />
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
- <div class="grid grid-cols-2">
89
- <Breadcrumb bind:title />
90
- <Docs {links} {note} />
91
- </div>
92
- </svelte:fragment>
93
- </AppBar>
94
- </svelte:fragment>
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
- {#if contentLayoutType === pageContentLayoutType.full}
116
- <div class="p-5 space-y-5 border-y border-solid border-surface-500 w-screen">
117
- <slot />
118
- </div>
119
- {/if}
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
- {#if $$slots.right}
122
- <div class=" p-5 fixed flex-shrink-0 w-96 border-y border-solid border-surface-500">
123
- <slot name="right" />
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
- </svelte:fragment>
123
+ <GoToTop />
124
+ <HelpPopUp active={help} />
125
+ <Notification />
141
126
 
142
- </AppShell>
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 = "BEXIS2";
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
- try
5
- {
6
- const response = await Api.get(`/Home/GetApplicationName`);
4
+ try {
5
+ const response = await Api.get(`/Home/GetApplicationName`);
7
6
 
8
- if(response.status == 200)
9
- {
10
- return response.data;
11
- }
12
- else
13
- {
14
- return "BEXIS2";
15
- }
16
- } catch (error) {
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}
@@ -3,7 +3,7 @@ import { Api } from '$lib/services/Api';
3
3
  export const getMenuItems = async () => {
4
4
  try {
5
5
  const response = await Api.get('/menu');
6
-
6
+
7
7
  return response.data;
8
8
  } catch (error) {
9
9
  console.error(error);
@@ -14,7 +14,7 @@
14
14
  export let comboboxValue;
15
15
 
16
16
  let id = Math.floor(Math.random() * 100).toString();
17
- let idLabel = "menu-"+menubarItem.Title.replaceAll(' ', '-');
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
- <button id={id+"bt"} class="grid" use:popup={popupCombobox} >
32
- <a class="grid" href={menubarItem.Url} target="{menubarItem.Target}">
33
- <span class="capitalize whitespace-nowrap text-lg hover:text-secondary-500">{comboboxValue ?? menubarItem.Title}</span>
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
- </AccordionItem
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">{menubarItem.Title}▾</span>
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
- if(item.Title =="Log Off")
29
- {
30
- logOffFn();
26
+ function clickFn(item) {
27
+ if (item.Title == 'Log Off') {
28
+ logOffFn();
31
29
  return;
32
- }
33
- else{
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
- console.log('logoff');
42
- // Prepare the body content for the POST request
43
-
44
-
45
- let bodyContent = '__RequestVerificationToken='+ window.antiForgeryToken;
46
-
47
- try {
48
- const response = await fetch('/Account/logoff', {
49
- method: 'POST',
50
- credentials: 'include', // Include cookies for authentication
51
- headers: {
52
- 'Content-Type': 'application/x-www-form-urlencoded'
53
- },
54
- body:bodyContent
55
- });
56
- if (response.ok) {
57
- // Redirect to login page after logout
58
- window.location.href = '/Account/Login';
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
- <a id={"menu-"+item.Title.replaceAll(' ', '-')} href={item.Url} target="{item.Target}" class="w-full block" on:click|preventDefault={()=>clickFn(item)}>{item.Title}</a>
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("🚀 ~ menuBar:", menuBar)
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 id="settings" class="flex items-center gap-x-1 text-sm text-surface-800 w-5 h-full">
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
  >