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 +1 -1
- package/src/components/hamzus-ui/DatePicker/DatePicker.svelte +5 -1
- package/src/components/hamzus-ui/DropdownMenu/Content.svelte +3 -1
- package/src/components/hamzus-ui/Tabs/Root.svelte +3 -0
- package/src/layout/Sidebar/SideBarBtn.svelte +1 -1
- package/src/layout/Sidebar/SideBarMenu/SideBarMenu.svelte +53 -44
package/package.json
CHANGED
|
@@ -142,7 +142,11 @@
|
|
|
142
142
|
|
|
143
143
|
<div class="date-picker {variant}">
|
|
144
144
|
{#if label}
|
|
145
|
-
<h5>{label}
|
|
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
|
|
|
@@ -1,51 +1,60 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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>
|