hamzus-ui 0.0.56 → 0.0.57

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hamzus-ui",
3
- "version": "0.0.56",
3
+ "version": "0.0.57",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "svelte": "index.js",
@@ -4,13 +4,13 @@
4
4
  import { page } from '$app/stores';
5
5
 
6
6
  export let title = '';
7
- export let ref;
7
+ export let ref = "";
8
8
 
9
9
  let active = false;
10
10
  let open = false;
11
11
  $: currentPath = $page.url.pathname;
12
12
 
13
- $: if (typeof ref === 'string') {
13
+ $: if (ref && typeof ref === 'string') {
14
14
  if (currentPath.startsWith(ref)) {
15
15
  active = true;
16
16
  open = true;
@@ -19,15 +19,18 @@
19
19
  }
20
20
  } else {
21
21
  // parcourir les ref parce que c est un array et verifier si il y a un match ?
22
+ let isActive = false
22
23
  for (const route of ref) {
23
24
  if (currentPath.startsWith(route)) {
25
+ isActive = true
24
26
  active = true;
25
27
  open = true;
26
28
  break;
27
29
  }
28
30
  }
29
-
30
- active = false;
31
+ if (!isActive) {
32
+ active = false;
33
+ }
31
34
  }
32
35
 
33
36
  function handleClick() {