@gradio/dataframe 0.18.5 → 0.18.7
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,22 @@
|
|
|
1
1
|
# @gradio/dataframe
|
|
2
2
|
|
|
3
|
+
## 0.18.7
|
|
4
|
+
|
|
5
|
+
### Dependency updates
|
|
6
|
+
|
|
7
|
+
- @gradio/statustracker@0.10.16
|
|
8
|
+
- @gradio/atoms@0.16.4
|
|
9
|
+
- @gradio/client@1.17.0
|
|
10
|
+
- @gradio/upload@0.16.14
|
|
11
|
+
- @gradio/button@0.5.10
|
|
12
|
+
- @gradio/checkbox@0.4.27
|
|
13
|
+
|
|
14
|
+
## 0.18.6
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
- [#11688](https://github.com/gradio-app/gradio/pull/11688) [`56f3f09`](https://github.com/gradio-app/gradio/commit/56f3f09b6c629a5719088806dbbb37f272d8d4f5) - Fix column header logic in gr.Dataframe. Thanks @hannahblair!
|
|
19
|
+
|
|
3
20
|
## 0.18.5
|
|
4
21
|
|
|
5
22
|
### Dependency updates
|
package/Dataframe.stories.svelte
CHANGED
|
@@ -839,3 +839,37 @@
|
|
|
839
839
|
column_widths: ["200px", "200px", "200px"]
|
|
840
840
|
}}
|
|
841
841
|
/>
|
|
842
|
+
|
|
843
|
+
<Story
|
|
844
|
+
name="Dataframe column addition test"
|
|
845
|
+
args={{
|
|
846
|
+
values: [
|
|
847
|
+
["Alice", 25],
|
|
848
|
+
["Bob", 30],
|
|
849
|
+
["Carol", 22]
|
|
850
|
+
],
|
|
851
|
+
headers: ["Name", "Age"],
|
|
852
|
+
label: "Column Addition Test",
|
|
853
|
+
col_count: [2, "dynamic"],
|
|
854
|
+
row_count: [3, "dynamic"],
|
|
855
|
+
editable: true
|
|
856
|
+
}}
|
|
857
|
+
play={async ({ canvasElement }) => {
|
|
858
|
+
const canvas = within(canvasElement);
|
|
859
|
+
const user = userEvent.setup();
|
|
860
|
+
|
|
861
|
+
const header_menu_button = canvas.getAllByLabelText("Open cell menu")[0];
|
|
862
|
+
await user.click(header_menu_button);
|
|
863
|
+
|
|
864
|
+
const add_column_button = canvas.getByText("Add column to the right");
|
|
865
|
+
await user.click(add_column_button);
|
|
866
|
+
|
|
867
|
+
const new_header = canvas.getAllByText("Header 3")[0];
|
|
868
|
+
await user.keyboard("{Enter}");
|
|
869
|
+
|
|
870
|
+
const input = canvas.getByRole("textbox");
|
|
871
|
+
await user.clear(input);
|
|
872
|
+
await user.type(input, "New Column");
|
|
873
|
+
await user.keyboard("{Enter}");
|
|
874
|
+
}}
|
|
875
|
+
/>
|
|
@@ -20,9 +20,7 @@ function create_actions(state, context) {
|
|
|
20
20
|
return new_data;
|
|
21
21
|
};
|
|
22
22
|
const add_col = (data, headers, make_id, index) => {
|
|
23
|
-
const new_headers =
|
|
24
|
-
? [...headers.map((h) => context.headers[headers.indexOf(h)].value)]
|
|
25
|
-
: [...headers, `Header ${headers.length + 1}`];
|
|
23
|
+
const new_headers = [...headers, `Header ${headers.length + 1}`];
|
|
26
24
|
const new_data = data.map((row) => [...row, { value: "", id: make_id() }]);
|
|
27
25
|
if (index !== undefined) {
|
|
28
26
|
new_headers.splice(index, 0, new_headers.pop());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/dataframe",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.7",
|
|
4
4
|
"description": "Gradio UI packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "",
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
"dompurify": "^3.0.3",
|
|
18
18
|
"katex": "^0.16.7",
|
|
19
19
|
"marked": "^12.0.0",
|
|
20
|
-
"@gradio/atoms": "^0.16.
|
|
21
|
-
"@gradio/
|
|
22
|
-
"@gradio/
|
|
20
|
+
"@gradio/atoms": "^0.16.4",
|
|
21
|
+
"@gradio/button": "^0.5.10",
|
|
22
|
+
"@gradio/client": "^1.17.0",
|
|
23
|
+
"@gradio/checkbox": "^0.4.27",
|
|
24
|
+
"@gradio/icons": "^0.12.0",
|
|
23
25
|
"@gradio/markdown-code": "^0.5.0",
|
|
24
|
-
"@gradio/
|
|
25
|
-
"@gradio/
|
|
26
|
-
"@gradio/
|
|
27
|
-
"@gradio/client": "^1.16.0",
|
|
28
|
-
"@gradio/icons": "^0.12.0"
|
|
26
|
+
"@gradio/statustracker": "^0.10.16",
|
|
27
|
+
"@gradio/upload": "^0.16.14",
|
|
28
|
+
"@gradio/utils": "^0.10.2"
|
|
29
29
|
},
|
|
30
30
|
"exports": {
|
|
31
31
|
".": {
|
|
@@ -220,9 +220,7 @@ function create_actions(
|
|
|
220
220
|
make_id: () => string,
|
|
221
221
|
index?: number
|
|
222
222
|
): { data: any[][]; headers: string[] } => {
|
|
223
|
-
const new_headers =
|
|
224
|
-
? [...headers.map((h) => context.headers![headers.indexOf(h)].value)]
|
|
225
|
-
: [...headers, `Header ${headers.length + 1}`];
|
|
223
|
+
const new_headers = [...headers, `Header ${headers.length + 1}`];
|
|
226
224
|
const new_data = data.map((row) => [...row, { value: "", id: make_id() }]);
|
|
227
225
|
if (index !== undefined) {
|
|
228
226
|
new_headers.splice(index, 0, new_headers.pop()!);
|