@gradio/tabitem 0.5.0 → 0.6.1
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 +40 -0
- package/Index.svelte +2 -4
- package/dist/Index.svelte +1 -3
- package/dist/Index.svelte.d.ts +6 -4
- package/dist/shared/TabItem.svelte +17 -22
- package/dist/shared/TabItem.svelte.d.ts +6 -4
- package/package.json +4 -4
- package/shared/TabItem.svelte +13 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# @gradio/tabitem
|
|
2
2
|
|
|
3
|
+
## 0.6.1
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- [#11784](https://github.com/gradio-app/gradio/pull/11784) [`d9dd3f5`](https://github.com/gradio-app/gradio/commit/d9dd3f54b7fb34cf7118e549d39fc63937ca3489) - Add "hidden" option to component's `visible` kwarg to render but visually hide the component. Thanks @pngwn!
|
|
8
|
+
|
|
9
|
+
### Dependency updates
|
|
10
|
+
|
|
11
|
+
- @gradio/tabs@0.5.1
|
|
12
|
+
- @gradio/column@0.2.2
|
|
13
|
+
|
|
14
|
+
## 0.6.0
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
- [#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!
|
|
19
|
+
|
|
20
|
+
### Dependency updates
|
|
21
|
+
|
|
22
|
+
- @gradio/tabs@0.5.0
|
|
23
|
+
- @gradio/column@0.2.1
|
|
24
|
+
|
|
25
|
+
## 0.5.0
|
|
26
|
+
|
|
27
|
+
### Dependency updates
|
|
28
|
+
|
|
29
|
+
- @gradio/column@0.2.1
|
|
30
|
+
|
|
31
|
+
## 0.5.0
|
|
32
|
+
|
|
33
|
+
### Dependency updates
|
|
34
|
+
|
|
35
|
+
- @gradio/column@0.2.1
|
|
36
|
+
|
|
37
|
+
## 0.5.0
|
|
38
|
+
|
|
39
|
+
### Dependency updates
|
|
40
|
+
|
|
41
|
+
- @gradio/column@0.2.1
|
|
42
|
+
|
|
3
43
|
## 0.5.0
|
|
4
44
|
|
|
5
45
|
### Features
|
package/Index.svelte
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
select: SelectData;
|
|
16
16
|
}>
|
|
17
17
|
| undefined;
|
|
18
|
-
export let visible = true;
|
|
18
|
+
export let visible: boolean | "hidden" = true;
|
|
19
19
|
export let interactive = true;
|
|
20
20
|
export let order: number;
|
|
21
21
|
export let scale: number;
|
|
@@ -32,7 +32,5 @@
|
|
|
32
32
|
{scale}
|
|
33
33
|
on:select={({ detail }) => gradio?.dispatch("select", detail)}
|
|
34
34
|
>
|
|
35
|
-
|
|
36
|
-
<slot />
|
|
37
|
-
{/if}
|
|
35
|
+
<slot />
|
|
38
36
|
</TabItem>
|
package/dist/Index.svelte
CHANGED
package/dist/Index.svelte.d.ts
CHANGED
|
@@ -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
|
|
7
|
-
elem_classes?: string[]
|
|
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 |
|
|
14
|
-
interactive?: boolean
|
|
13
|
+
visible?: boolean | "hidden";
|
|
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,32 +12,28 @@ 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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
>
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
</div>
|
|
40
|
-
{/if}
|
|
25
|
+
<div
|
|
26
|
+
id={elem_id}
|
|
27
|
+
class="tabitem {elem_classes.join(' ')}"
|
|
28
|
+
class:grow-children={scale >= 1}
|
|
29
|
+
style:display={$selected_tab === id && visible !== false ? "flex" : "none"}
|
|
30
|
+
style:flex-grow={scale}
|
|
31
|
+
role="tabpanel"
|
|
32
|
+
>
|
|
33
|
+
<Column scale={scale >= 1 ? scale : null}>
|
|
34
|
+
<slot />
|
|
35
|
+
</Column>
|
|
36
|
+
</div>
|
|
41
37
|
|
|
42
38
|
<style>
|
|
43
39
|
div {
|
|
@@ -46,7 +42,6 @@ $:
|
|
|
46
42
|
position: relative;
|
|
47
43
|
border: none;
|
|
48
44
|
border-radius: var(--radius-sm);
|
|
49
|
-
padding: var(--block-padding);
|
|
50
45
|
width: 100%;
|
|
51
46
|
box-sizing: border-box;
|
|
52
47
|
}
|
|
@@ -2,11 +2,11 @@ import { SvelteComponent } from "svelte";
|
|
|
2
2
|
import type { SelectData } from "@gradio/utils";
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
elem_id?: string
|
|
6
|
-
elem_classes?: string[]
|
|
5
|
+
elem_id?: string;
|
|
6
|
+
elem_classes?: string[];
|
|
7
7
|
label: string;
|
|
8
|
-
id?:
|
|
9
|
-
visible: boolean;
|
|
8
|
+
id?: string | number | object;
|
|
9
|
+
visible: boolean | "hidden";
|
|
10
10
|
interactive: boolean;
|
|
11
11
|
order: number;
|
|
12
12
|
scale: 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.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Gradio UI packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"./package.json": "./package.json"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@gradio/column": "^0.2.
|
|
20
|
-
"@gradio/
|
|
21
|
-
"@gradio/
|
|
19
|
+
"@gradio/column": "^0.2.2",
|
|
20
|
+
"@gradio/utils": "^0.10.2",
|
|
21
|
+
"@gradio/tabs": "^0.5.1"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@gradio/preview": "^0.14.0"
|
package/shared/TabItem.svelte
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
export let elem_classes: string[] = [];
|
|
9
9
|
export let label: string;
|
|
10
10
|
export let id: string | number | object = {};
|
|
11
|
-
export let visible: boolean;
|
|
11
|
+
export let visible: boolean | "hidden";
|
|
12
12
|
export let interactive: boolean;
|
|
13
13
|
export let order: number;
|
|
14
14
|
export let scale: number;
|
|
@@ -33,20 +33,18 @@
|
|
|
33
33
|
tick().then(() => dispatch("select", { value: label, index: tab_index }));
|
|
34
34
|
</script>
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
>
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</div>
|
|
49
|
-
{/if}
|
|
36
|
+
<div
|
|
37
|
+
id={elem_id}
|
|
38
|
+
class="tabitem {elem_classes.join(' ')}"
|
|
39
|
+
class:grow-children={scale >= 1}
|
|
40
|
+
style:display={$selected_tab === id && visible !== false ? "flex" : "none"}
|
|
41
|
+
style:flex-grow={scale}
|
|
42
|
+
role="tabpanel"
|
|
43
|
+
>
|
|
44
|
+
<Column scale={scale >= 1 ? scale : null}>
|
|
45
|
+
<slot />
|
|
46
|
+
</Column>
|
|
47
|
+
</div>
|
|
50
48
|
|
|
51
49
|
<style>
|
|
52
50
|
div {
|
|
@@ -55,7 +53,6 @@
|
|
|
55
53
|
position: relative;
|
|
56
54
|
border: none;
|
|
57
55
|
border-radius: var(--radius-sm);
|
|
58
|
-
padding: var(--block-padding);
|
|
59
56
|
width: 100%;
|
|
60
57
|
box-sizing: border-box;
|
|
61
58
|
}
|