@iroco/ui 1.1.2 → 1.1.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.
@@ -12,7 +12,7 @@
12
12
  onclick?: MouseEventHandler<HTMLButtonElement>;
13
13
  }
14
14
 
15
- let { navigationItems, type, version = null,currentRoute=$bindable(null), onclick }: Props = $props();
15
+ let { navigationItems, type, version = null,currentRoute, onclick }: Props = $props();
16
16
 
17
17
  const dispatch = createEventDispatcher();
18
18
 
@@ -24,18 +24,16 @@
24
24
  dispatch('click_link');
25
25
  };
26
26
 
27
- function isActive(current: string, item: NavigationItem): boolean {
27
+ function isActive(item: NavigationItem): boolean {
28
28
  if (typeof item.hrefOrCallback === 'string') {
29
- console.log("is string url",current);
30
- const b = item.hrefOrCallback === current;
29
+ console.log("is string url",currentRoute);
30
+ const b = item.hrefOrCallback === currentRoute;
31
31
  console.log("is active : ",b);
32
32
  return b;
33
33
  }
34
34
  return false;
35
35
  }
36
36
 
37
- let active = $derived(currentRoute ?? '');
38
-
39
37
  </script>
40
38
 
41
39
  <nav data-testid={type} class="nav__{type}">
@@ -45,7 +43,7 @@
45
43
 
46
44
  <ul class="nav__{type}__item-container">
47
45
  {#each navigationItems as item}
48
- <li class="nav__{type}__item" class:active={isActive(active, item)} aria-current={isActive(active, item)}>
46
+ <li class="nav__{type}__item" class:active={isActive(item)} aria-current={isActive(item)}>
49
47
  {#if item.type === NavigationItemType.FORM}
50
48
  <form method="POST" action={item.hrefOrCallback}>
51
49
  <button class="iroco-ui-link" type="submit">{item.name}</button>
@@ -24,6 +24,6 @@ declare const NavBar: $$__sveltets_2_IsomorphicComponent<Props, {
24
24
  click_link: CustomEvent<any>;
25
25
  } & {
26
26
  [evt: string]: CustomEvent<any>;
27
- }, {}, {}, "currentRoute">;
27
+ }, {}, {}, "">;
28
28
  type NavBar = InstanceType<typeof NavBar>;
29
29
  export default NavBar;
@@ -24,7 +24,7 @@
24
24
  title = null,
25
25
  version = null,
26
26
  color = Color.green,
27
- currentRoute = null,
27
+ currentRoute
28
28
  }: Props = $props();
29
29
  </script>
30
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iroco/ui",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Iroco design system based on Svelte",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {