@gradio/tabitem 0.4.6 → 0.6.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # @gradio/tabitem
2
2
 
3
+ ## 0.6.0
4
+
5
+ ### Features
6
+
7
+ - [#11783](https://github.com/gradio-app/gradio/pull/11783) [`f407daf`](https://github.com/gradio-app/gradio/commit/f407daf8046f37e042ab8b86730ff0ab8d174bcf) - Add Walkthrough and Step compoents to facilitate multi-step workflows. Thanks @pngwn!
8
+
9
+ ### Dependency updates
10
+
11
+ - @gradio/tabs@0.5.0
12
+ - @gradio/column@0.2.1
13
+
14
+ ## 0.5.0
15
+
16
+ ### Dependency updates
17
+
18
+ - @gradio/column@0.2.1
19
+
20
+ ## 0.5.0
21
+
22
+ ### Dependency updates
23
+
24
+ - @gradio/column@0.2.1
25
+
26
+ ## 0.5.0
27
+
28
+ ### Dependency updates
29
+
30
+ - @gradio/column@0.2.1
31
+
32
+ ## 0.5.0
33
+
34
+ ### Features
35
+
36
+ - [#11427](https://github.com/gradio-app/gradio/pull/11427) [`6b2bcd0`](https://github.com/gradio-app/gradio/commit/6b2bcd097ae5ef999a7fb273ecf7c7e4c0eab305) - Improve load times of the Gradio front-end. Thanks @pngwn!
37
+
38
+ ### Dependency updates
39
+
40
+ - @gradio/column@0.2.1
41
+ - @gradio/tabs@0.4.5
42
+
3
43
  ## 0.4.6
4
44
 
5
45
  ### Dependency updates
package/Index.svelte CHANGED
@@ -32,5 +32,7 @@
32
32
  {scale}
33
33
  on:select={({ detail }) => gradio?.dispatch("select", detail)}
34
34
  >
35
- <slot />
35
+ {#if visible}
36
+ <slot />
37
+ {/if}
36
38
  </TabItem>
package/dist/Index.svelte CHANGED
@@ -24,5 +24,7 @@ export let scale;
24
24
  {scale}
25
25
  on:select={({ detail }) => gradio?.dispatch("select", detail)}
26
26
  >
27
- <slot />
27
+ {#if visible}
28
+ <slot />
29
+ {/if}
28
30
  </TabItem>
@@ -3,15 +3,15 @@ export { default as BaseTabItem } from "./shared/TabItem.svelte";
3
3
  import type { Gradio, SelectData } from "@gradio/utils";
4
4
  declare const __propDef: {
5
5
  props: {
6
- elem_id?: string | undefined;
7
- elem_classes?: string[] | undefined;
6
+ elem_id?: string;
7
+ elem_classes?: string[];
8
8
  label: string;
9
9
  id: string | number;
10
10
  gradio: Gradio<{
11
11
  select: SelectData;
12
12
  }> | undefined;
13
- visible?: boolean | undefined;
14
- interactive?: boolean | undefined;
13
+ visible?: boolean;
14
+ interactive?: boolean;
15
15
  order: number;
16
16
  scale: number;
17
17
  };
@@ -21,6 +21,8 @@ declare const __propDef: {
21
21
  slots: {
22
22
  default: {};
23
23
  };
24
+ exports?: {} | undefined;
25
+ bindings?: string | undefined;
24
26
  };
25
27
  export type IndexProps = typeof __propDef.props;
26
28
  export type IndexEvents = typeof __propDef.events;
@@ -12,33 +12,30 @@ export let scale;
12
12
  const dispatch = createEventDispatcher();
13
13
  const { register_tab, unregister_tab, selected_tab, selected_tab_index } = getContext(TABS);
14
14
  let tab_index;
15
- $:
16
- tab_index = register_tab(
17
- { label, id, elem_id, visible, interactive, scale },
18
- order
19
- );
15
+ $: tab_index = register_tab(
16
+ { label, id, elem_id, visible, interactive, scale },
17
+ order
18
+ );
20
19
  onMount(() => {
21
20
  return () => unregister_tab({ label, id, elem_id }, order);
22
21
  });
23
- $:
24
- $selected_tab_index === tab_index && tick().then(() => dispatch("select", { value: label, index: tab_index }));
22
+ $: $selected_tab_index === tab_index && tick().then(() => dispatch("select", { value: label, index: tab_index }));
25
23
  </script>
26
24
 
27
- <!-- {#if $selected_tab === id && visible} -->
28
- <div
29
- id={elem_id}
30
- class="tabitem {elem_classes.join(' ')}"
31
- class:grow-children={scale >= 1}
32
- style:display={$selected_tab === id && visible ? "flex" : "none"}
33
- style:flex-grow={scale}
34
- role="tabpanel"
35
- >
36
- <Column scale={scale >= 1 ? scale : null}>
37
- <slot />
38
- </Column>
39
- </div>
40
-
41
- <!-- {/if} -->
25
+ {#if $selected_tab === id && visible}
26
+ <div
27
+ id={elem_id}
28
+ class="tabitem {elem_classes.join(' ')}"
29
+ class:grow-children={scale >= 1}
30
+ style:display={$selected_tab === id && visible ? "flex" : "none"}
31
+ style:flex-grow={scale}
32
+ role="tabpanel"
33
+ >
34
+ <Column scale={scale >= 1 ? scale : null}>
35
+ <slot />
36
+ </Column>
37
+ </div>
38
+ {/if}
42
39
 
43
40
  <style>
44
41
  div {
@@ -47,7 +44,6 @@ $:
47
44
  position: relative;
48
45
  border: none;
49
46
  border-radius: var(--radius-sm);
50
- padding: var(--block-padding);
51
47
  width: 100%;
52
48
  box-sizing: border-box;
53
49
  }
@@ -2,10 +2,10 @@ import { SvelteComponent } from "svelte";
2
2
  import type { SelectData } from "@gradio/utils";
3
3
  declare const __propDef: {
4
4
  props: {
5
- elem_id?: string | undefined;
6
- elem_classes?: string[] | undefined;
5
+ elem_id?: string;
6
+ elem_classes?: string[];
7
7
  label: string;
8
- id?: (string | number | object) | undefined;
8
+ id?: string | number | object;
9
9
  visible: boolean;
10
10
  interactive: boolean;
11
11
  order: number;
@@ -19,6 +19,8 @@ declare const __propDef: {
19
19
  slots: {
20
20
  default: {};
21
21
  };
22
+ exports?: {} | undefined;
23
+ bindings?: string | undefined;
22
24
  };
23
25
  export type TabItemProps = typeof __propDef.props;
24
26
  export type TabItemEvents = typeof __propDef.events;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/tabitem",
3
- "version": "0.4.6",
3
+ "version": "0.6.0",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
@@ -17,11 +17,11 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "@gradio/column": "^0.2.1",
20
- "@gradio/tabs": "^0.4.5",
20
+ "@gradio/tabs": "^0.5.0",
21
21
  "@gradio/utils": "^0.10.2"
22
22
  },
23
23
  "devDependencies": {
24
- "@gradio/preview": "^0.13.2"
24
+ "@gradio/preview": "^0.14.0"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "svelte": "^4.0.0"
@@ -33,21 +33,20 @@
33
33
  tick().then(() => dispatch("select", { value: label, index: tab_index }));
34
34
  </script>
35
35
 
36
- <!-- {#if $selected_tab === id && visible} -->
37
- <div
38
- id={elem_id}
39
- class="tabitem {elem_classes.join(' ')}"
40
- class:grow-children={scale >= 1}
41
- style:display={$selected_tab === id && visible ? "flex" : "none"}
42
- style:flex-grow={scale}
43
- role="tabpanel"
44
- >
45
- <Column scale={scale >= 1 ? scale : null}>
46
- <slot />
47
- </Column>
48
- </div>
49
-
50
- <!-- {/if} -->
36
+ {#if $selected_tab === id && visible}
37
+ <div
38
+ id={elem_id}
39
+ class="tabitem {elem_classes.join(' ')}"
40
+ class:grow-children={scale >= 1}
41
+ style:display={$selected_tab === id && visible ? "flex" : "none"}
42
+ style:flex-grow={scale}
43
+ role="tabpanel"
44
+ >
45
+ <Column scale={scale >= 1 ? scale : null}>
46
+ <slot />
47
+ </Column>
48
+ </div>
49
+ {/if}
51
50
 
52
51
  <style>
53
52
  div {
@@ -56,7 +55,6 @@
56
55
  position: relative;
57
56
  border: none;
58
57
  border-radius: var(--radius-sm);
59
- padding: var(--block-padding);
60
58
  width: 100%;
61
59
  box-sizing: border-box;
62
60
  }