@hyvor/design 0.0.38 → 0.0.39
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/dist/components/SplitControl/SplitControl.svelte +9 -4
- package/dist/components/SplitControl/SplitControl.svelte.d.ts +1 -0
- package/dist/components/TabNav/TabNav.svelte +8 -2
- package/dist/components/Tooltip/Tooltip.svelte +7 -4
- package/dist/components/Tooltip/Tooltip.svelte.d.ts +1 -0
- package/package.json +1 -1
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
import Label from "../FormControl/Label.svelte";
|
|
3
3
|
export let label = "";
|
|
4
4
|
export let caption = "";
|
|
5
|
+
export let flex = [1, 2];
|
|
5
6
|
</script>
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
<div class="split-control" class:has-nested={$$slots.nested}>
|
|
9
10
|
|
|
10
|
-
<div
|
|
11
|
+
<div
|
|
12
|
+
class="left"
|
|
13
|
+
style:flex={flex[0]}
|
|
14
|
+
>
|
|
11
15
|
|
|
12
16
|
<div class="label-wrap">
|
|
13
17
|
{#if $$slots.label}
|
|
@@ -29,7 +33,10 @@ export let caption = "";
|
|
|
29
33
|
</div>
|
|
30
34
|
|
|
31
35
|
{#if $$slots.default}
|
|
32
|
-
<div
|
|
36
|
+
<div
|
|
37
|
+
class="right"
|
|
38
|
+
style:flex={flex[1]}
|
|
39
|
+
>
|
|
33
40
|
<slot></slot>
|
|
34
41
|
</div>
|
|
35
42
|
{/if}
|
|
@@ -62,12 +69,10 @@ export let caption = "";
|
|
|
62
69
|
|
|
63
70
|
.left {
|
|
64
71
|
padding: 15px;
|
|
65
|
-
flex: 1;
|
|
66
72
|
}
|
|
67
73
|
|
|
68
74
|
.right {
|
|
69
75
|
padding: 15px;
|
|
70
|
-
flex: 3;
|
|
71
76
|
min-width: 0;
|
|
72
77
|
}
|
|
73
78
|
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
<script>import { setContext } from "svelte";
|
|
1
|
+
<script>import { onMount, setContext } from "svelte";
|
|
2
2
|
import { writable } from "svelte/store";
|
|
3
3
|
export let active;
|
|
4
4
|
const activeStore = writable(active);
|
|
5
5
|
setContext("tab-nav-active", activeStore);
|
|
6
6
|
$:
|
|
7
|
-
active
|
|
7
|
+
active, activeStore.set(active);
|
|
8
|
+
onMount(() => {
|
|
9
|
+
const unsubscribe = activeStore.subscribe((value) => {
|
|
10
|
+
active = value;
|
|
11
|
+
});
|
|
12
|
+
return unsubscribe;
|
|
13
|
+
});
|
|
8
14
|
</script>
|
|
9
15
|
|
|
10
16
|
<div
|
|
@@ -4,6 +4,7 @@ export let position = "top";
|
|
|
4
4
|
export let color = "black";
|
|
5
5
|
export let show = false;
|
|
6
6
|
export let maxWidth = 300;
|
|
7
|
+
export let disabled = false;
|
|
7
8
|
let wrap;
|
|
8
9
|
let tooltip;
|
|
9
10
|
function positionTooltip() {
|
|
@@ -28,9 +29,11 @@ function positionTooltip() {
|
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
async function handleMouseEnter() {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
if (!disabled) {
|
|
33
|
+
show = true;
|
|
34
|
+
await tick();
|
|
35
|
+
positionTooltip();
|
|
36
|
+
}
|
|
34
37
|
}
|
|
35
38
|
function handleMouseLeave() {
|
|
36
39
|
show = false;
|
|
@@ -61,7 +64,7 @@ onMount(() => {
|
|
|
61
64
|
>
|
|
62
65
|
<slot />
|
|
63
66
|
|
|
64
|
-
{#if show}
|
|
67
|
+
{#if !disabled && show}
|
|
65
68
|
<div
|
|
66
69
|
class="tooltip {position}"
|
|
67
70
|
style:max-width={maxWidth + 'px'}
|