Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .changeset/calm-columns-appear.md

This file was deleted.

70 changes: 0 additions & 70 deletions demo/shared_props/run.py

This file was deleted.

2 changes: 1 addition & 1 deletion js/column/Index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
);
</script>

<BaseColumn {...gradio.shared} {...gradio.props}>
<BaseColumn {...gradio.shared}>
<slot />
</BaseColumn>

Expand Down
2 changes: 0 additions & 2 deletions js/core/src/Blocks.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@
{
root,
theme: theme_mode,
theme_mode,
version,
api_prefix,
max_file_size,
Expand Down Expand Up @@ -245,7 +244,6 @@
app_tree.reload(components, layout, dependencies, {
root,
theme: theme_mode,
theme_mode,
version,
api_prefix,
max_file_size,
Expand Down
1 change: 0 additions & 1 deletion js/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ export type LoadingComponent = Promise<{
export interface AppConfig {
root: string;
theme: string;
theme_mode: ThemeMode;
version: string;
max_file_size?: number;
autoscroll: boolean;
Expand Down
35 changes: 0 additions & 35 deletions js/dataset/Dataset.test.ts

This file was deleted.

5 changes: 0 additions & 5 deletions js/dataset/DatasetRootExample.svelte

This file was deleted.

1 change: 0 additions & 1 deletion js/dataset/Index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
onselect={(data) => gradio.dispatch("select", data)}
load_component={gradio.shared.load_component}
{...gradio.props}
root={gradio.shared.root}
{samples}
/>
</Block>
Expand Down
1 change: 1 addition & 0 deletions js/dataset/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface DatasetProps {
samples: any[][] | null;
sample_labels: string[] | null;
value: number | null;
root: string;
proxy_url: null | string;
samples_per_page: number;

Expand Down
2 changes: 1 addition & 1 deletion js/html/Index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
elem_id={gradio.shared.elem_id}
elem_classes={gradio.shared.elem_classes}
container={gradio.shared.container}
padding={gradio.shared.padding !== false}
padding={gradio.props.padding !== false}
overflow_behavior="visible"
>
{#if gradio.shared.show_label && gradio.props.buttons && gradio.props.buttons.length > 0}
Expand Down
1 change: 1 addition & 0 deletions js/html/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface HTMLProps {
head: string | null;
component_class_name: string;
buttons: (string | CustomButton)[] | null;
padding: boolean;
}

export interface HTMLEvents {
Expand Down
2 changes: 1 addition & 1 deletion js/json/Index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<JSON
value={gradio.props.value}
open={gradio.props.open}
theme_mode={gradio.shared.theme_mode}
theme_mode={gradio.props.theme_mode}
show_indices={gradio.props.show_indices}
show_copy_button={gradio.props.buttons == null
? true
Expand Down
1 change: 1 addition & 0 deletions js/json/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface JSONProps {
height: number | string | undefined;
min_height: number | string | undefined;
max_height: number | string | undefined;
theme_mode: "system" | "light" | "dark";
buttons: (string | CustomButton)[];
}

Expand Down
2 changes: 1 addition & 1 deletion js/plot/Index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
/>
<Plot
value={gradio.props.value}
theme_mode={gradio.shared.theme_mode}
theme_mode={gradio.props.theme_mode}
show_label={gradio.shared.show_label}
caption={gradio.props.caption}
bokeh_version={gradio.props.bokeh_version}
Expand Down
1 change: 1 addition & 0 deletions js/plot/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export type ThemeMode = "system" | "light" | "dark";

export interface PlotProps {
value: null | string;
theme_mode: ThemeMode;
caption: string;
bokeh_version: string | null;
show_actions_button: boolean;
Expand Down
46 changes: 0 additions & 46 deletions js/spa/test/shared_props.spec.ts

This file was deleted.

2 changes: 1 addition & 1 deletion js/tabitem/Index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
interactive={gradio.shared.interactive}
id={gradio.props.id}
order={gradio.props.order}
scale={gradio.shared.scale}
scale={gradio.props.scale}
component_id={gradio.props.component_id}
onselect={(data) => gradio.dispatch("select", data)}
>
Expand Down
1 change: 1 addition & 0 deletions js/tabitem/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface TabItemProps {
visible: boolean | "hidden";
interactive: boolean;
order: number;
scale: number;
component_id: number;
}

Expand Down
13 changes: 3 additions & 10 deletions js/textbox/Index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

async function handle_input(value: string): Promise<void> {
if (!gradio.shared || !gradio.props) return;
clear_validation_error();
gradio.props.validation_error = null;
gradio.props.value = value;
await tick();
gradio.dispatch("input");
Expand All @@ -44,16 +44,9 @@

function handle_change(value: string): void {
if (!gradio.shared || !gradio.props) return;
clear_validation_error();
gradio.props.validation_error = null;
gradio.props.value = value;
}

function clear_validation_error(): void {
gradio.shared.validation_error = null;
if (gradio.shared.loading_status) {
gradio.shared.loading_status.validation_error = null;
}
}
</script>

<Block
Expand Down Expand Up @@ -101,7 +94,7 @@
onchange={handle_change}
oninput={handle_input}
onsubmit={() => {
clear_validation_error();
gradio.shared.validation_error = null;
gradio.dispatch("submit");
}}
onblur={() => gradio.dispatch("blur")}
Expand Down
20 changes: 0 additions & 20 deletions js/textbox/Textbox.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,6 @@ describe("Textbox", () => {

expect(item.value).toBe("hi some text");
});

test.each(["input", "change"] as const)(
"%s clears the shared validation error",
async (event_name) => {
const result = await render(Textbox, {
...default_props,
value: "",
validation_error: "Shared error",
loading_status: { validation_error: "Required" }
});
const textbox = result.getByRole("textbox");

expect(result.getByText("Required")).toBeVisible();
await fireEvent[event_name](textbox, { target: { value: "valid" } });

await waitFor(() => {
expect(result.queryByText("Required")).not.toBeInTheDocument();
});
}
);
});

describe("Props: type", () => {
Expand Down
1 change: 1 addition & 0 deletions js/textbox/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export interface TextboxProps {
autoscroll: boolean;
max_length: number;
html_attributes: InputHTMLAttributes;
validation_error: string | null;
}

type FullAutoFill =
Expand Down
2 changes: 1 addition & 1 deletion js/utils/src/utils.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface SharedProps {
client: Client;
scale: number;
min_width: number;
padding: boolean;
padding: number;
load_component: load_component;
loading_status?: any;
label: string;
Expand Down
Loading