@hyvor/design 0.0.38 → 0.0.40

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.
@@ -2,12 +2,21 @@
2
2
  import Label from "../FormControl/Label.svelte";
3
3
  export let label = "";
4
4
  export let caption = "";
5
+ export let column = false;
6
+ export let flex = [1, 2];
5
7
  </script>
6
8
 
7
9
 
8
- <div class="split-control" class:has-nested={$$slots.nested}>
10
+ <div
11
+ class="split-control"
12
+ class:has-nested={$$slots.nested}
13
+ class:column={column}
14
+ >
9
15
 
10
- <div class="left">
16
+ <div
17
+ class="left"
18
+ style:flex={flex[0]}
19
+ >
11
20
 
12
21
  <div class="label-wrap">
13
22
  {#if $$slots.label}
@@ -29,7 +38,10 @@ export let caption = "";
29
38
  </div>
30
39
 
31
40
  {#if $$slots.default}
32
- <div class="right">
41
+ <div
42
+ class="right"
43
+ style:flex={flex[1]}
44
+ >
33
45
  <slot></slot>
34
46
  </div>
35
47
  {/if}
@@ -51,6 +63,12 @@ export let caption = "";
51
63
  .split-control:last-child, .split-control.has-nested {
52
64
  border-bottom: none;
53
65
  }
66
+ .split-control.column {
67
+ flex-direction: column;
68
+ }
69
+ .split-control.column .right {
70
+ padding-top: 0;
71
+ }
54
72
 
55
73
  .nested {
56
74
  margin-left: 40px;
@@ -62,12 +80,10 @@ export let caption = "";
62
80
 
63
81
  .left {
64
82
  padding: 15px;
65
- flex: 1;
66
83
  }
67
84
 
68
85
  .right {
69
86
  padding: 15px;
70
- flex: 3;
71
87
  min-width: 0;
72
88
  }
73
89
 
@@ -3,6 +3,8 @@ declare const __propDef: {
3
3
  props: {
4
4
  label?: string | undefined;
5
5
  caption?: string | undefined;
6
+ column?: boolean | undefined;
7
+ flex?: number[] | undefined;
6
8
  };
7
9
  events: {
8
10
  [evt: string]: CustomEvent<any>;
@@ -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 = $activeStore;
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
@@ -16,7 +16,7 @@ useCleaner();
16
16
  top: 0;
17
17
  left: 0;
18
18
  width: 100%;
19
- z-index: 10000;
19
+ z-index: 20000000;
20
20
  display: flex;
21
21
  flex-direction: column;
22
22
  align-items: center;
@@ -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
- show = true;
32
- await tick();
33
- positionTooltip();
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'}
@@ -7,6 +7,7 @@ declare const __propDef: {
7
7
  color?: "danger" | "accent" | "soft" | "black" | undefined;
8
8
  show?: boolean | undefined;
9
9
  maxWidth?: number | undefined;
10
+ disabled?: boolean | undefined;
10
11
  };
11
12
  events: {
12
13
  [evt: string]: CustomEvent<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyvor/design",
3
- "version": "0.0.38",
3
+ "version": "0.0.40",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "scripts": {