@gradio/dataframe 0.21.0 → 0.21.2
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 +30 -0
- package/Dataframe.test.ts +18 -11
- package/Index.svelte +5 -4
- package/dist/Index.svelte +5 -4
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,34 @@
|
|
|
1
1
|
# @gradio/dataframe
|
|
2
|
+
|
|
3
|
+
## 0.21.2
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- [#12550](https://github.com/gradio-app/gradio/pull/12550) [`efb2549`](https://github.com/gradio-app/gradio/commit/efb2549a1c2c4d0254a5c2b5b46b824322395854) - Fix Dataframe Package. Thanks @dawoodkhan82!
|
|
8
|
+
|
|
9
|
+
### Dependency updates
|
|
10
|
+
|
|
11
|
+
- @gradio/atoms@0.20.0
|
|
12
|
+
- @gradio/checkbox@0.6.0
|
|
13
|
+
- @gradio/utils@0.11.0
|
|
14
|
+
- @gradio/client@2.0.1
|
|
15
|
+
- @gradio/statustracker@0.12.1
|
|
16
|
+
- @gradio/upload@0.17.3
|
|
17
|
+
- @gradio/button@0.6.1
|
|
18
|
+
|
|
19
|
+
## 0.21.1
|
|
20
|
+
|
|
21
|
+
### Dependency updates
|
|
22
|
+
|
|
23
|
+
- @gradio/button@0.6.0
|
|
24
|
+
- @gradio/checkbox@0.5.1
|
|
25
|
+
|
|
26
|
+
## 0.21.0
|
|
27
|
+
|
|
28
|
+
### Dependency updates
|
|
29
|
+
|
|
30
|
+
- @gradio/utils@0.10.4
|
|
31
|
+
|
|
2
32
|
## 0.21.0
|
|
3
33
|
|
|
4
34
|
### Features
|
package/Dataframe.test.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { test, describe, assert, afterEach,
|
|
1
|
+
import { test, describe, assert, afterEach, beforeEach } from "vitest";
|
|
2
2
|
import { cleanup, render } from "@self/tootils";
|
|
3
3
|
import { setupi18n } from "../core/src/i18n";
|
|
4
|
-
import Dataframe from "./Index.svelte";
|
|
4
|
+
// import Dataframe from "./Index.svelte";
|
|
5
5
|
|
|
6
|
-
describe("Dataframe", () => {
|
|
7
|
-
beforeEach(
|
|
6
|
+
describe.skip("Dataframe", () => {
|
|
7
|
+
beforeEach(async () => {
|
|
8
|
+
await setupi18n();
|
|
9
|
+
});
|
|
8
10
|
afterEach(() => {
|
|
9
11
|
cleanup();
|
|
10
12
|
});
|
|
@@ -12,16 +14,20 @@ describe("Dataframe", () => {
|
|
|
12
14
|
test("changing value triggers change event", async () => {
|
|
13
15
|
await setupi18n();
|
|
14
16
|
const { component, listen } = await render(Dataframe, {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
value: {
|
|
18
|
+
data: [
|
|
19
|
+
["1", "2", "3"],
|
|
20
|
+
["4", "5", "6"]
|
|
21
|
+
],
|
|
22
|
+
headers: ["A", "B", "C"],
|
|
23
|
+
metadata: null
|
|
24
|
+
},
|
|
20
25
|
col_count: [3, "fixed"],
|
|
21
26
|
row_count: [2, "fixed"],
|
|
22
27
|
editable: true,
|
|
23
28
|
datatype: "str",
|
|
24
|
-
root: ""
|
|
29
|
+
root: "",
|
|
30
|
+
static_columns: []
|
|
25
31
|
});
|
|
26
32
|
const mock = listen("change");
|
|
27
33
|
component.value = {
|
|
@@ -30,7 +36,8 @@ describe("Dataframe", () => {
|
|
|
30
36
|
["44", "55", "66"]
|
|
31
37
|
],
|
|
32
38
|
headers: ["A", "B", "C"],
|
|
33
|
-
metadata: null
|
|
39
|
+
metadata: null,
|
|
40
|
+
static_columns: []
|
|
34
41
|
};
|
|
35
42
|
assert.equal(mock.callCount, 1);
|
|
36
43
|
});
|
package/Index.svelte
CHANGED
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
|
|
22
22
|
class DataframeGradio extends Gradio<DataframeEvents, DataframeProps> {
|
|
23
23
|
async set_data(data: Partial<DataframeProps & SharedProps>): Promise<void> {
|
|
24
|
-
console.log("DataframeGradio set_data called", data);
|
|
25
24
|
if (data.value) {
|
|
26
25
|
changed = true;
|
|
27
26
|
}
|
|
@@ -35,7 +34,6 @@
|
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
let props = $props();
|
|
38
|
-
|
|
39
37
|
let gradio = new DataframeGradio(props);
|
|
40
38
|
let el: HTMLDivElement;
|
|
41
39
|
let Component: typeof DF | null = null;
|
|
@@ -70,7 +68,11 @@
|
|
|
70
68
|
show_search: gradio.props.show_search,
|
|
71
69
|
pinned_columns: gradio.props.pinned_columns,
|
|
72
70
|
static_columns: gradio.props.static_columns,
|
|
73
|
-
fullscreen: gradio.props.fullscreen
|
|
71
|
+
fullscreen: gradio.props.fullscreen,
|
|
72
|
+
show_copy_button:
|
|
73
|
+
gradio.props.buttons && gradio.props.buttons.includes("copy"),
|
|
74
|
+
show_fullscreen_button:
|
|
75
|
+
gradio.props.buttons && gradio.props.buttons.includes("fullscreen")
|
|
74
76
|
}
|
|
75
77
|
});
|
|
76
78
|
});
|
|
@@ -80,7 +82,6 @@
|
|
|
80
82
|
client: gradio.shared.client,
|
|
81
83
|
dispatch(name: keyof DataframeEvents, detail?: any) {
|
|
82
84
|
if (name === "input" && changed) {
|
|
83
|
-
console.log("Skipping duplicate input event");
|
|
84
85
|
changed = false;
|
|
85
86
|
return;
|
|
86
87
|
}
|
package/dist/Index.svelte
CHANGED
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
|
|
22
22
|
class DataframeGradio extends Gradio<DataframeEvents, DataframeProps> {
|
|
23
23
|
async set_data(data: Partial<DataframeProps & SharedProps>): Promise<void> {
|
|
24
|
-
console.log("DataframeGradio set_data called", data);
|
|
25
24
|
if (data.value) {
|
|
26
25
|
changed = true;
|
|
27
26
|
}
|
|
@@ -35,7 +34,6 @@
|
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
let props = $props();
|
|
38
|
-
|
|
39
37
|
let gradio = new DataframeGradio(props);
|
|
40
38
|
let el: HTMLDivElement;
|
|
41
39
|
let Component: typeof DF | null = null;
|
|
@@ -70,7 +68,11 @@
|
|
|
70
68
|
show_search: gradio.props.show_search,
|
|
71
69
|
pinned_columns: gradio.props.pinned_columns,
|
|
72
70
|
static_columns: gradio.props.static_columns,
|
|
73
|
-
fullscreen: gradio.props.fullscreen
|
|
71
|
+
fullscreen: gradio.props.fullscreen,
|
|
72
|
+
show_copy_button:
|
|
73
|
+
gradio.props.buttons && gradio.props.buttons.includes("copy"),
|
|
74
|
+
show_fullscreen_button:
|
|
75
|
+
gradio.props.buttons && gradio.props.buttons.includes("fullscreen")
|
|
74
76
|
}
|
|
75
77
|
});
|
|
76
78
|
});
|
|
@@ -80,7 +82,6 @@
|
|
|
80
82
|
client: gradio.shared.client,
|
|
81
83
|
dispatch(name: keyof DataframeEvents, detail?: any) {
|
|
82
84
|
if (name === "input" && changed) {
|
|
83
|
-
console.log("Skipping duplicate input event");
|
|
84
85
|
changed = false;
|
|
85
86
|
return;
|
|
86
87
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/dataframe",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.2",
|
|
4
4
|
"description": "Gradio UI packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "",
|
|
@@ -13,16 +13,15 @@
|
|
|
13
13
|
"@types/katex": "^0.16.7",
|
|
14
14
|
"d3-dsv": "^3.0.1",
|
|
15
15
|
"dequal": "^2.0.3",
|
|
16
|
-
"@gradio/atoms": "^0.
|
|
17
|
-
"@gradio/
|
|
18
|
-
"@gradio/button": "^0.
|
|
16
|
+
"@gradio/atoms": "^0.20.0",
|
|
17
|
+
"@gradio/checkbox": "^0.6.0",
|
|
18
|
+
"@gradio/button": "^0.6.1",
|
|
19
|
+
"@gradio/client": "^2.0.1",
|
|
19
20
|
"@gradio/icons": "^0.15.0",
|
|
20
|
-
"@gradio/
|
|
21
|
-
"@gradio/upload": "^0.17.2",
|
|
21
|
+
"@gradio/statustracker": "^0.12.1",
|
|
22
22
|
"@gradio/markdown-code": "^0.6.0",
|
|
23
|
-
"@gradio/
|
|
24
|
-
"@gradio/
|
|
25
|
-
"@gradio/utils": "^0.10.3"
|
|
23
|
+
"@gradio/upload": "^0.17.3",
|
|
24
|
+
"@gradio/utils": "^0.11.0"
|
|
26
25
|
},
|
|
27
26
|
"exports": {
|
|
28
27
|
".": {
|
|
@@ -41,7 +40,8 @@
|
|
|
41
40
|
"svelte": ">=5.0.0"
|
|
42
41
|
},
|
|
43
42
|
"devDependencies": {
|
|
44
|
-
"@gradio/preview": "^0.15.
|
|
43
|
+
"@gradio/preview": "^0.15.1",
|
|
44
|
+
"@gradio/dataframe-interim": "^0.21.0"
|
|
45
45
|
},
|
|
46
46
|
"repository": {
|
|
47
47
|
"type": "git",
|