@rkosafo/cai.components 0.0.22 → 0.0.24

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.
@@ -11,7 +11,8 @@
11
11
  appShortName,
12
12
  hideSidebar = false,
13
13
  menuItems = [],
14
- logo
14
+ logo,
15
+ isActiveFunction
15
16
  }: TFSidebarProps = $props();
16
17
 
17
18
  let activeUrl = $state('');
@@ -44,7 +45,7 @@
44
45
  {#if menuItems.length > 0}
45
46
  <ul class="side-menu top relative pt-4">
46
47
  {#each menuItems as item}
47
- {@const active = activeUrl === item.path}
48
+ {@const active = isActiveFunction ? isActiveFunction(item) : activeUrl === item.path}
48
49
  {@render menuItemSnippet(item, active)}
49
50
  {/each}
50
51
  </ul>
@@ -31,6 +31,7 @@ export interface TFSidebarProps {
31
31
  hideSidebar?: boolean;
32
32
  menuItems: IMenuItem[];
33
33
  logo?: Snippet;
34
+ isActiveFunction?: (val: IMenuItem) => boolean;
34
35
  }
35
36
  export interface IMenuItem {
36
37
  title: string;
@@ -32,7 +32,9 @@
32
32
  <span class="text-sm">
33
33
  {tab.title}
34
34
  </span>
35
- <iconify-icon icon={tab.icon} style="font-size: 15px;"></iconify-icon>
35
+ {#if tab.icon}
36
+ <iconify-icon icon={tab.icon} style="font-size: 15px;"></iconify-icon>
37
+ {/if}
36
38
  {#if tab.isClosable}
37
39
  <CloseButton
38
40
  size="sm"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rkosafo/cai.components",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "files": [
5
5
  "dist",
6
6
  "!dist/**/*.test.*",