@bexis2/bexis2-core-ui 0.2.30 → 0.2.32

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 (90) hide show
  1. package/README.md +10 -1
  2. package/dist/TableView.svelte +1 -1
  3. package/dist/components/CodeEditor/CodeEditor.svelte +32 -8
  4. package/dist/components/CodeEditor/CodeEditor.svelte.d.ts +1 -0
  5. package/dist/components/File/FileIcon.svelte +45 -45
  6. package/dist/components/File/FileInfo.svelte +13 -13
  7. package/dist/components/ListView.svelte +5 -5
  8. package/dist/components/Table/Table.svelte +87 -25
  9. package/dist/components/Table/TableFilter.svelte +1 -1
  10. package/dist/components/form/Checkbox.svelte +13 -13
  11. package/dist/components/form/CheckboxKvPList.svelte +16 -16
  12. package/dist/components/form/CheckboxList.svelte +10 -10
  13. package/dist/components/form/DateInput.svelte +14 -14
  14. package/dist/components/form/DropdownKvP.svelte +54 -54
  15. package/dist/components/form/MultiSelect.svelte +181 -181
  16. package/dist/components/form/NumberInput.svelte +15 -15
  17. package/dist/components/form/TextArea.svelte +14 -14
  18. package/dist/components/form/TextInput.svelte +15 -15
  19. package/dist/components/page/Alert.svelte +28 -28
  20. package/dist/components/page/BackToTop.svelte +30 -30
  21. package/dist/components/page/Docs.svelte +22 -22
  22. package/dist/components/page/ErrorMessage.svelte +8 -8
  23. package/dist/components/page/Footer.svelte +5 -5
  24. package/dist/components/page/Header.svelte +5 -5
  25. package/dist/components/page/HelpPopUp.svelte +30 -30
  26. package/dist/components/page/PageCaller.js +19 -19
  27. package/dist/components/page/Spinner.svelte +14 -14
  28. package/dist/components/page/breadcrumb/Breadcrumb.svelte +19 -19
  29. package/dist/components/page/menu/MenuDataCaller.js +10 -10
  30. package/dist/css/core.ui.postcss +17 -17
  31. package/dist/css/themes/theme-bexis2.css +96 -96
  32. package/dist/css/themes/theme-crimson.css +101 -101
  33. package/dist/css/themes/theme-gold-nouveau.css +140 -140
  34. package/dist/css/themes/theme-hamlindigo.css +112 -112
  35. package/dist/css/themes/theme-modern.css +127 -127
  36. package/dist/css/themes/theme-rocket.css +119 -119
  37. package/dist/css/themes/theme-sahara.css +128 -128
  38. package/dist/css/themes/theme-seafoam.css +122 -122
  39. package/dist/css/themes/theme-seasonal.css +115 -115
  40. package/dist/css/themes/theme-skeleton.css +118 -118
  41. package/dist/css/themes/theme-vintage.css +125 -125
  42. package/dist/models/Models.d.ts +3 -0
  43. package/dist/services/BaseCaller.js +16 -16
  44. package/package.json +3 -1
  45. package/src/lib/TableView.svelte +1 -1
  46. package/src/lib/components/CodeEditor/CodeEditor.svelte +43 -9
  47. package/src/lib/components/ListView.svelte +11 -11
  48. package/src/lib/components/Table/Table.svelte +107 -26
  49. package/src/lib/components/Table/TableFilter.svelte +2 -1
  50. package/src/lib/components/Table/filter.ts +141 -141
  51. package/src/lib/components/{File → file}/FileIcon.svelte +45 -45
  52. package/src/lib/components/{File → file}/FileInfo.svelte +13 -13
  53. package/src/lib/components/form/Checkbox.svelte +24 -24
  54. package/src/lib/components/form/CheckboxKvPList.svelte +29 -29
  55. package/src/lib/components/form/CheckboxList.svelte +21 -21
  56. package/src/lib/components/form/DateInput.svelte +27 -27
  57. package/src/lib/components/form/DropdownKvP.svelte +54 -54
  58. package/src/lib/components/form/MultiSelect.svelte +181 -181
  59. package/src/lib/components/form/NumberInput.svelte +30 -30
  60. package/src/lib/components/form/TextArea.svelte +28 -28
  61. package/src/lib/components/form/TextInput.svelte +28 -28
  62. package/src/lib/components/page/Alert.svelte +41 -41
  63. package/src/lib/components/page/BackToTop.svelte +30 -30
  64. package/src/lib/components/page/Docs.svelte +46 -46
  65. package/src/lib/components/page/ErrorMessage.svelte +10 -10
  66. package/src/lib/components/page/Footer.svelte +18 -18
  67. package/src/lib/components/page/Header.svelte +18 -18
  68. package/src/lib/components/page/HelpPopUp.svelte +72 -72
  69. package/src/lib/components/page/PageCaller.js +19 -19
  70. package/src/lib/components/page/Spinner.svelte +20 -20
  71. package/src/lib/components/page/breadcrumb/Breadcrumb.svelte +39 -39
  72. package/src/lib/components/page/menu/MenuDataCaller.js +10 -10
  73. package/src/lib/css/core.ui.postcss +17 -17
  74. package/src/lib/css/themes/theme-bexis2.css +96 -96
  75. package/src/lib/css/themes/theme-crimson.css +101 -101
  76. package/src/lib/css/themes/theme-gold-nouveau.css +140 -140
  77. package/src/lib/css/themes/theme-hamlindigo.css +112 -112
  78. package/src/lib/css/themes/theme-modern.css +127 -127
  79. package/src/lib/css/themes/theme-rocket.css +119 -119
  80. package/src/lib/css/themes/theme-sahara.css +128 -128
  81. package/src/lib/css/themes/theme-seafoam.css +122 -122
  82. package/src/lib/css/themes/theme-seasonal.css +115 -115
  83. package/src/lib/css/themes/theme-skeleton.css +118 -118
  84. package/src/lib/css/themes/theme-vintage.css +125 -125
  85. package/src/lib/models/Models.ts +10 -7
  86. package/src/lib/models/Page.ts +40 -40
  87. package/src/lib/services/Api.ts +55 -55
  88. package/src/lib/services/BaseCaller.js +16 -16
  89. package/src/lib/stores/apiStores.ts +31 -31
  90. /package/src/lib/components/{File → file}/FileUploader.svelte +0 -0
@@ -1,41 +1,41 @@
1
- <script lang="ts">
2
- import Fa from 'svelte-fa';
3
-
4
- import { faXmark } from '@fortawesome/free-solid-svg-icons';
5
-
6
- import { fade } from 'svelte/transition';
7
-
8
- export let title: string = '';
9
- export let message: string = '';
10
- export let cssClass: string = '';
11
- export let deleteBtn: boolean = true;
12
-
13
- $: show = true;
14
- </script>
15
-
16
- {#if show}
17
- <aside class="alert {cssClass}" transition:fade|local={{ duration: 100 }}>
18
- <!-- Icon -->
19
- <!-- <div>(icon)</div> -->
20
- <!-- Message -->
21
- <div class="alert-message">
22
- {#if title}
23
- <h3 class="h3">{title}</h3>
24
- {/if}
25
- <p>
26
- {message}
27
- <slot />
28
- </p>
29
- </div>
30
- <!-- Actions -->
31
- <div class="alert-actions">
32
- <slot name="actions" />
33
-
34
- {#if deleteBtn}
35
- <button class="btn hover:text-primary-100" on:click={() => (show = false)}>
36
- <Fa icon={faXmark} />
37
- </button>
38
- {/if}
39
- </div>
40
- </aside>
41
- {/if}
1
+ <script lang="ts">
2
+ import Fa from 'svelte-fa';
3
+
4
+ import { faXmark } from '@fortawesome/free-solid-svg-icons';
5
+
6
+ import { fade } from 'svelte/transition';
7
+
8
+ export let title: string = '';
9
+ export let message: string = '';
10
+ export let cssClass: string = '';
11
+ export let deleteBtn: boolean = true;
12
+
13
+ $: show = true;
14
+ </script>
15
+
16
+ {#if show}
17
+ <aside class="alert {cssClass}" transition:fade|local={{ duration: 100 }}>
18
+ <!-- Icon -->
19
+ <!-- <div>(icon)</div> -->
20
+ <!-- Message -->
21
+ <div class="alert-message">
22
+ {#if title}
23
+ <h3 class="h3">{title}</h3>
24
+ {/if}
25
+ <p>
26
+ {message}
27
+ <slot />
28
+ </p>
29
+ </div>
30
+ <!-- Actions -->
31
+ <div class="alert-actions">
32
+ <slot name="actions" />
33
+
34
+ {#if deleteBtn}
35
+ <button class="btn hover:text-primary-100" on:click={() => (show = false)}>
36
+ <Fa icon={faXmark} />
37
+ </button>
38
+ {/if}
39
+ </div>
40
+ </aside>
41
+ {/if}
@@ -1,30 +1,30 @@
1
- <script>
2
- export let showOnPx = 150;
3
- let hidden = true;
4
-
5
- function goTop() {
6
- document.body.scrollIntoView();
7
- }
8
-
9
- function scrollContainer() {
10
- return document.documentElement || document.body;
11
- }
12
-
13
- function handleOnScroll() {
14
- if (!scrollContainer()) {
15
- return;
16
- }
17
-
18
- if (scrollContainer().scrollTop > showOnPx) {
19
- hidden = false;
20
- } else {
21
- hidden = true;
22
- }
23
- }
24
- </script>
25
-
26
- <svelte:window on:scroll={handleOnScroll} />
27
-
28
- <div class="w-full items-center">
29
- <button class="btn ring back-to-top" on:click={goTop} class:hidden>Back to top</button>
30
- </div>
1
+ <script>
2
+ export let showOnPx = 150;
3
+ let hidden = true;
4
+
5
+ function goTop() {
6
+ document.body.scrollIntoView();
7
+ }
8
+
9
+ function scrollContainer() {
10
+ return document.documentElement || document.body;
11
+ }
12
+
13
+ function handleOnScroll() {
14
+ if (!scrollContainer()) {
15
+ return;
16
+ }
17
+
18
+ if (scrollContainer().scrollTop > showOnPx) {
19
+ hidden = false;
20
+ } else {
21
+ hidden = true;
22
+ }
23
+ }
24
+ </script>
25
+
26
+ <svelte:window on:scroll={handleOnScroll} />
27
+
28
+ <div class="w-full items-center">
29
+ <button class="btn ring back-to-top" on:click={goTop} class:hidden>Back to top</button>
30
+ </div>
@@ -1,46 +1,46 @@
1
- <script lang="ts">
2
- import Fa from 'svelte-fa/src/fa.svelte';
3
- import { faQuestion } from '@fortawesome/free-solid-svg-icons';
4
- import { goTo } from '$services/BaseCaller';
5
-
6
- // links
7
- import type { linkType } from '$lib/models/Models';
8
- export let links: linkType[] = [];
9
-
10
- // popup for note
11
- import { popup } from '@skeletonlabs/skeleton';
12
- import type { PopupSettings } from '@skeletonlabs/skeleton';
13
- import { computePosition, autoUpdate, offset, shift, flip, arrow } from '@floating-ui/dom';
14
- import { storePopup } from '@skeletonlabs/skeleton';
15
- storePopup.set({ computePosition, autoUpdate, offset, shift, flip, arrow });
16
-
17
- export let note: string;
18
-
19
- //popup
20
- const noteSettings: PopupSettings = {
21
- event: 'click',
22
- target: 'noteTarget',
23
- placement: 'bottom'
24
- };
25
- </script>
26
-
27
- <div class="text-right p-2">
28
- {#if note}
29
- <span class="chip variant-soft hover:variant-filled" use:popup={noteSettings}>
30
- <span><Fa icon={faQuestion} /></span>
31
- </span>
32
-
33
- <div
34
- class="card p-4 variant-filled-primary w-60 z-50 text-left shadow-md"
35
- data-popup="noteTarget"
36
- >
37
- {note}
38
- </div>
39
- {/if}
40
-
41
- {#each links as link}
42
- <span class="chip variant-soft hover:variant-filled" on:click={() => goTo(link.url, false)}>
43
- <span>{link.label}</span>
44
- </span>
45
- {/each}
46
- </div>
1
+ <script lang="ts">
2
+ import Fa from 'svelte-fa/src/fa.svelte';
3
+ import { faQuestion } from '@fortawesome/free-solid-svg-icons';
4
+ import { goTo } from '$services/BaseCaller';
5
+
6
+ // links
7
+ import type { linkType } from '$lib/models/Models';
8
+ export let links: linkType[] = [];
9
+
10
+ // popup for note
11
+ import { popup } from '@skeletonlabs/skeleton';
12
+ import type { PopupSettings } from '@skeletonlabs/skeleton';
13
+ import { computePosition, autoUpdate, offset, shift, flip, arrow } from '@floating-ui/dom';
14
+ import { storePopup } from '@skeletonlabs/skeleton';
15
+ storePopup.set({ computePosition, autoUpdate, offset, shift, flip, arrow });
16
+
17
+ export let note: string;
18
+
19
+ //popup
20
+ const noteSettings: PopupSettings = {
21
+ event: 'click',
22
+ target: 'noteTarget',
23
+ placement: 'bottom'
24
+ };
25
+ </script>
26
+
27
+ <div class="text-right p-2">
28
+ {#if note}
29
+ <span class="chip variant-soft hover:variant-filled" use:popup={noteSettings}>
30
+ <span><Fa icon={faQuestion} /></span>
31
+ </span>
32
+
33
+ <div
34
+ class="card p-4 variant-filled-primary w-60 z-50 text-left shadow-md"
35
+ data-popup="noteTarget"
36
+ >
37
+ {note}
38
+ </div>
39
+ {/if}
40
+
41
+ {#each links as link}
42
+ <span class="chip variant-soft hover:variant-filled" on:click={() => goTo(link.url, false)}>
43
+ <span>{link.label}</span>
44
+ </span>
45
+ {/each}
46
+ </div>
@@ -1,10 +1,10 @@
1
- <script lang="ts">
2
- export let error: Error;
3
- </script>
4
-
5
- <div class="card bg-error-300 border-solid border-2 border-error-500 shadow-md max-w-md">
6
- <div class="p-5 space-y-4">
7
- <h3 class="h3">{error.name}</h3>
8
- <p>{error.message}</p>
9
- </div>
10
- </div>
1
+ <script lang="ts">
2
+ export let error: Error;
3
+ </script>
4
+
5
+ <div class="card bg-error-300 border-solid border-2 border-error-500 shadow-md max-w-md">
6
+ <div class="p-5 space-y-4">
7
+ <h3 class="h3">{error.name}</h3>
8
+ <p>{error.message}</p>
9
+ </div>
10
+ </div>
@@ -1,18 +1,18 @@
1
- <script lang="ts">
2
- import { onMount } from 'svelte';
3
- import { getFooter } from './PageCaller';
4
-
5
- let content: string = '';
6
- $: content;
7
-
8
- onMount(async () => {
9
- console.log('footer');
10
-
11
- content = await getFooter();
12
- console.log(content);
13
- });
14
- </script>
15
-
16
- {#if content != undefined}
17
- {@html content}
18
- {/if}
1
+ <script lang="ts">
2
+ import { onMount } from 'svelte';
3
+ import { getFooter } from './PageCaller';
4
+
5
+ let content: string = '';
6
+ $: content;
7
+
8
+ onMount(async () => {
9
+ console.log('footer');
10
+
11
+ content = await getFooter();
12
+ console.log(content);
13
+ });
14
+ </script>
15
+
16
+ {#if content != undefined}
17
+ {@html content}
18
+ {/if}
@@ -1,18 +1,18 @@
1
- <script lang="ts">
2
- import { onMount } from 'svelte';
3
- import { getHeader } from './PageCaller';
4
-
5
- let content: string = '';
6
- $: content;
7
-
8
- onMount(async () => {
9
- console.log('header');
10
-
11
- content = await getHeader();
12
- console.log(content);
13
- });
14
- </script>
15
-
16
- {#if content != undefined}
17
- {@html content}
18
- {/if}
1
+ <script lang="ts">
2
+ import { onMount } from 'svelte';
3
+ import { getHeader } from './PageCaller';
4
+
5
+ let content: string = '';
6
+ $: content;
7
+
8
+ onMount(async () => {
9
+ console.log('header');
10
+
11
+ content = await getHeader();
12
+ console.log(content);
13
+ });
14
+ </script>
15
+
16
+ {#if content != undefined}
17
+ {@html content}
18
+ {/if}
@@ -1,72 +1,72 @@
1
- <script lang="ts">
2
- import { helpStore } from '$store/pageStores';
3
- import type { helpItemType, helpStoreType } from '$models/Models';
4
- import Fa from 'svelte-fa/src/fa.svelte';
5
- import { faQuestion } from '@fortawesome/free-solid-svg-icons';
6
-
7
- //popup
8
- import { popup } from '@skeletonlabs/skeleton';
9
- import type { PopupSettings } from '@skeletonlabs/skeleton';
10
- //import { computePosition, autoUpdate, offset, shift, flip, arrow } from '@floating-ui/dom';
11
- //import { storePopup } from '@skeletonlabs/skeleton';
12
- import delay from 'delay';
13
-
14
- export let active: boolean = false;
15
-
16
- let hs: helpStoreType;
17
- $: helpStore.subscribe((value) => {
18
- hs = value;
19
- });
20
- let helpItem: helpItemType = { id: undefined, name: '', description: '' };
21
- $: helpItem =
22
- active === true
23
- ? hs.itemId == ''
24
- ? { id: undefined, name: '', description: '' }
25
- : hs.helpItems.find((h) => h.id === hs.itemId)!
26
- : { id: undefined, name: '', description: '' };
27
-
28
- const helpClick: PopupSettings = {
29
- event: 'click',
30
- target: 'helpTarget',
31
- placement: 'top',
32
- state: (s) => {
33
- if (s != true) {
34
- resetItemId();
35
- }
36
- }
37
- };
38
-
39
- async function resetItemId() {
40
- await delay(100);
41
- helpStore.resetItemId();
42
- }
43
- </script>
44
-
45
- {#if active}
46
- <button
47
- id="helpButton"
48
- class="chip variant-filled-warning fixed bottom-5 right-10 shadow-md"
49
- use:popup={helpClick}><Fa icon={faQuestion} /></button
50
- >
51
-
52
- <div
53
- class="card bg-primary-300 border-solid border-2 border-primary-500 shadow-md"
54
- data-popup="helpTarget"
55
- >
56
- {#if helpItem && helpItem.id}
57
- <div class="p-5 w-96 space-y-4" id={'helpPopup.' + helpItem.id}>
58
- <h3 class="h3">{helpItem.name}</h3>
59
- <p>{@html helpItem.description}</p>
60
- {#if helpItem.link}
61
- <p><a class="anchor" href={helpItem.link}>... read more</a></p>
62
- {/if}
63
- </div>
64
- {:else}
65
- <div class="p-5 w-96 space-y-4" id="helpPopup">
66
- <h3 class="h3">Help</h3>
67
- <p>Hover over the Element, you like to know more about.</p>
68
- </div>
69
- {/if}
70
- <div class="arrow variant-filled-primary" />
71
- </div>
72
- {/if}
1
+ <script lang="ts">
2
+ import { helpStore } from '$store/pageStores';
3
+ import type { helpItemType, helpStoreType } from '$models/Models';
4
+ import Fa from 'svelte-fa/src/fa.svelte';
5
+ import { faQuestion } from '@fortawesome/free-solid-svg-icons';
6
+
7
+ //popup
8
+ import { popup } from '@skeletonlabs/skeleton';
9
+ import type { PopupSettings } from '@skeletonlabs/skeleton';
10
+ //import { computePosition, autoUpdate, offset, shift, flip, arrow } from '@floating-ui/dom';
11
+ //import { storePopup } from '@skeletonlabs/skeleton';
12
+ import delay from 'delay';
13
+
14
+ export let active: boolean = false;
15
+
16
+ let hs: helpStoreType;
17
+ $: helpStore.subscribe((value) => {
18
+ hs = value;
19
+ });
20
+ let helpItem: helpItemType = { id: undefined, name: '', description: '' };
21
+ $: helpItem =
22
+ active === true
23
+ ? hs.itemId == ''
24
+ ? { id: undefined, name: '', description: '' }
25
+ : hs.helpItems.find((h) => h.id === hs.itemId)!
26
+ : { id: undefined, name: '', description: '' };
27
+
28
+ const helpClick: PopupSettings = {
29
+ event: 'click',
30
+ target: 'helpTarget',
31
+ placement: 'top',
32
+ state: (s) => {
33
+ if (s != true) {
34
+ resetItemId();
35
+ }
36
+ }
37
+ };
38
+
39
+ async function resetItemId() {
40
+ await delay(100);
41
+ helpStore.resetItemId();
42
+ }
43
+ </script>
44
+
45
+ {#if active}
46
+ <button
47
+ id="helpButton"
48
+ class="chip variant-filled-warning fixed bottom-5 right-10 shadow-md"
49
+ use:popup={helpClick}><Fa icon={faQuestion} /></button
50
+ >
51
+
52
+ <div
53
+ class="card bg-primary-300 border-solid border-2 border-primary-500 shadow-md"
54
+ data-popup="helpTarget"
55
+ >
56
+ {#if helpItem && helpItem.id}
57
+ <div class="p-5 w-96 space-y-4" id={'helpPopup.' + helpItem.id}>
58
+ <h3 class="h3">{helpItem.name}</h3>
59
+ <p>{@html helpItem.description}</p>
60
+ {#if helpItem.link}
61
+ <p><a class="anchor" href={helpItem.link}>... read more</a></p>
62
+ {/if}
63
+ </div>
64
+ {:else}
65
+ <div class="p-5 w-96 space-y-4" id="helpPopup">
66
+ <h3 class="h3">Help</h3>
67
+ <p>Hover over the Element, you like to know more about.</p>
68
+ </div>
69
+ {/if}
70
+ <div class="arrow variant-filled-primary" />
71
+ </div>
72
+ {/if}
@@ -1,19 +1,19 @@
1
- import { Api } from '$lib/services/Api';
2
-
3
- export const getFooter = async () => {
4
- try {
5
- const response = await Api.get('/footer');
6
- return response.data;
7
- } catch (error) {
8
- console.error(error);
9
- }
10
- };
11
-
12
- export const getHeader = async () => {
13
- try {
14
- const response = await Api.get('/header');
15
- return response.data;
16
- } catch (error) {
17
- console.error(error);
18
- }
19
- };
1
+ import { Api } from '$lib/services/Api';
2
+
3
+ export const getFooter = async () => {
4
+ try {
5
+ const response = await Api.get('/footer');
6
+ return response.data;
7
+ } catch (error) {
8
+ console.error(error);
9
+ }
10
+ };
11
+
12
+ export const getHeader = async () => {
13
+ try {
14
+ const response = await Api.get('/header');
15
+ return response.data;
16
+ } catch (error) {
17
+ console.error(error);
18
+ }
19
+ };
@@ -1,20 +1,20 @@
1
- <script lang="ts">
2
- import { positionType } from '$lib/models/Enums';
3
-
4
- export let textCss = 'text-surface-600';
5
- export let label = '';
6
- export let position: positionType = positionType.center;
7
- </script>
8
-
9
- <div class="flex justify-{position} items-{position} h-full w-full gap-5 pt-2 {textCss}">
10
- <div
11
- class="inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-current border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]"
12
- role="status"
13
- >
14
- <span
15
- class="!absolute !-m-px !h-px !w-px !overflow-hidden !whitespace-nowrap !border-0 !p-0 ![clip:rect(0,0,0,0)]"
16
- >Loading...</span
17
- >
18
- </div>
19
- <span>{label}</span>
20
- </div>
1
+ <script lang="ts">
2
+ import { positionType } from '$lib/models/Enums';
3
+
4
+ export let textCss = 'text-surface-600';
5
+ export let label = '';
6
+ export let position: positionType = positionType.center;
7
+ </script>
8
+
9
+ <div class="flex justify-{position} items-{position} h-full w-full gap-5 pt-2 {textCss}">
10
+ <div
11
+ class="inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-current border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]"
12
+ role="status"
13
+ >
14
+ <span
15
+ class="!absolute !-m-px !h-px !w-px !overflow-hidden !whitespace-nowrap !border-0 !p-0 ![clip:rect(0,0,0,0)]"
16
+ >Loading...</span
17
+ >
18
+ </div>
19
+ <span>{label}</span>
20
+ </div>
@@ -1,39 +1,39 @@
1
- <script lang="ts">
2
- import { breadcrumbStore } from '$store/pageStores';
3
- import type { breadcrumbItemType } from '$models/Page';
4
-
5
- export let title;
6
-
7
- $:update(title)
8
-
9
-
10
- function update(t)
11
- {
12
- breadcrumbStore.updateItem({ label: t, link: window.location.pathname });
13
- }
14
-
15
- let list: breadcrumbItemType[] = [];
16
- $: list;
17
-
18
- $: breadcrumbStore.subscribe((value) => {
19
- list = value?.items;
20
- });
21
- </script>
22
-
23
- <div class="px-5 py-2">
24
- <ol class="breadcrumb -p50">
25
- <!--default home-->
26
- <li class="crumb"><a class="anchor" href={'/'}>Home</a></li>
27
- <li class="crumb-separator" aria-hidden>&rsaquo;</li>
28
-
29
- {#each list as crumb, i}
30
- <!-- If crumb index is less than the breadcrumb length minus 1 -->
31
- {#if i < list.length - 1}
32
- <li class="crumb"><a class="anchor" href={crumb.link}>{crumb.label}</a></li>
33
- <li class="crumb-separator" aria-hidden>&rsaquo;</li>
34
- {:else}
35
- <li class="crumb">{crumb.label}</li>
36
- {/if}
37
- {/each}
38
- </ol>
39
- </div>
1
+ <script lang="ts">
2
+ import { breadcrumbStore } from '$store/pageStores';
3
+ import type { breadcrumbItemType } from '$models/Page';
4
+
5
+ export let title;
6
+
7
+ $:update(title)
8
+
9
+
10
+ function update(t)
11
+ {
12
+ breadcrumbStore.updateItem({ label: t, link: window.location.pathname });
13
+ }
14
+
15
+ let list: breadcrumbItemType[] = [];
16
+ $: list;
17
+
18
+ $: breadcrumbStore.subscribe((value) => {
19
+ list = value?.items;
20
+ });
21
+ </script>
22
+
23
+ <div class="px-5 py-2">
24
+ <ol class="breadcrumb -p50">
25
+ <!--default home-->
26
+ <li class="crumb"><a class="anchor" href={'/'}>Home</a></li>
27
+ <li class="crumb-separator" aria-hidden>&rsaquo;</li>
28
+
29
+ {#each list as crumb, i}
30
+ <!-- If crumb index is less than the breadcrumb length minus 1 -->
31
+ {#if i < list.length - 1}
32
+ <li class="crumb"><a class="anchor" href={crumb.link}>{crumb.label}</a></li>
33
+ <li class="crumb-separator" aria-hidden>&rsaquo;</li>
34
+ {:else}
35
+ <li class="crumb">{crumb.label}</li>
36
+ {/if}
37
+ {/each}
38
+ </ol>
39
+ </div>
@@ -1,10 +1,10 @@
1
- import { Api } from '$lib/services/Api';
2
-
3
- export const getMenuItems = async () => {
4
- try {
5
- const response = await Api.get('/menu');
6
- return response.data;
7
- } catch (error) {
8
- console.error(error);
9
- }
10
- };
1
+ import { Api } from '$lib/services/Api';
2
+
3
+ export const getMenuItems = async () => {
4
+ try {
5
+ const response = await Api.get('/menu');
6
+ return response.data;
7
+ } catch (error) {
8
+ console.error(error);
9
+ }
10
+ };