hamzus-ui 0.0.54 → 0.0.56

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.54",
3
+ "version": "0.0.56",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "svelte": "index.js",
@@ -142,7 +142,11 @@
142
142
 
143
143
  <div class="date-picker {variant}">
144
144
  {#if label}
145
- <h5>{label}</h5>
145
+ <h5>{label}
146
+ {#if required}
147
+ <span style="color:var(--red)">*</span>
148
+ {/if}
149
+ </h5>
146
150
  {/if}
147
151
  <DropdownMenu.Root triggerFullWidth bind:toggleDisplay>
148
152
  <DropdownMenu.Trigger slot="trigger">
@@ -1,9 +1,11 @@
1
1
  <script>
2
+ import { blur } from "svelte/transition";
3
+
2
4
  export let width = "max-content"
3
5
  export let style;
4
6
  </script>
5
7
 
6
- <div class="content" style="--width:{width};{style}" {...$$restProps}>
8
+ <div transition:blur class="content" style="--width:{width};{style}" {...$$restProps}>
7
9
  <slot/>
8
10
  </div>
9
11
 
@@ -12,6 +12,9 @@
12
12
  onMount(() => {
13
13
  activeTab.set(value);
14
14
  });
15
+ $: {
16
+ activeTab.set(value);
17
+ }
15
18
 
16
19
  </script>
17
20
 
@@ -10,7 +10,7 @@
10
10
 
11
11
  let active = false
12
12
 
13
- $: if (currentPath.includes(href)) {
13
+ $: if (currentPath.startsWith(href)) {
14
14
  active = true
15
15
  }else{
16
16
  active = false
@@ -1,51 +1,60 @@
1
1
  <script>
2
- import SideBarBtn from "../SideBarBtn.svelte";
3
- import SideBarMenuBtn from "./SideBarMenuBtn.svelte";
4
- import { page } from "$app/stores";
5
-
6
- export let title = "";
7
- export let ref;
8
-
9
- let active = false;
10
- let open = false
11
- $: currentPath = $page.url.pathname;
12
-
13
- $: if (currentPath.startsWith(ref)) {
14
- active = true
15
- open = true
16
- }else{
17
- active = false
18
- }
19
-
20
-
21
-
22
-
23
- function handleClick() {
24
- open = !open
25
-
26
- }
2
+ import SideBarBtn from '../SideBarBtn.svelte';
3
+ import SideBarMenuBtn from './SideBarMenuBtn.svelte';
4
+ import { page } from '$app/stores';
5
+
6
+ export let title = '';
7
+ export let ref;
8
+
9
+ let active = false;
10
+ let open = false;
11
+ $: currentPath = $page.url.pathname;
12
+
13
+ $: if (typeof ref === 'string') {
14
+ if (currentPath.startsWith(ref)) {
15
+ active = true;
16
+ open = true;
17
+ } else {
18
+ active = false;
19
+ }
20
+ } else {
21
+ // parcourir les ref parce que c est un array et verifier si il y a un match ?
22
+ for (const route of ref) {
23
+ if (currentPath.startsWith(route)) {
24
+ active = true;
25
+ open = true;
26
+ break;
27
+ }
28
+ }
29
+
30
+ active = false;
31
+ }
32
+
33
+ function handleClick() {
34
+ open = !open;
35
+ }
27
36
  </script>
28
37
 
29
38
  <div class="menu-list">
30
- <SideBarMenuBtn on:click={handleClick} {active} label={title} {open}>
31
- <slot name="icon" slot="icon"/>
32
- </SideBarMenuBtn>
33
- {#if open}
34
- <div class="content">
35
- <slot></slot>
36
- </div>
37
- {/if}
39
+ <SideBarMenuBtn on:click={handleClick} {active} label={title} {open}>
40
+ <slot name="icon" slot="icon" />
41
+ </SideBarMenuBtn>
42
+ {#if open}
43
+ <div class="content">
44
+ <slot></slot>
45
+ </div>
46
+ {/if}
38
47
  </div>
39
48
 
40
49
  <style>
41
- .menu-list{
42
- display: flex;
43
- flex-direction: column;
44
- width: 100%;
45
- }
46
- .content{
47
- display: flex;
48
- flex-direction: column;
49
- width: 100%;
50
- }
51
- </style>
50
+ .menu-list {
51
+ display: flex;
52
+ flex-direction: column;
53
+ width: 100%;
54
+ }
55
+ .content {
56
+ display: flex;
57
+ flex-direction: column;
58
+ width: 100%;
59
+ }
60
+ </style>