@gradio/dataframe 0.17.7 → 0.17.8
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,11 @@
|
|
|
1
1
|
# @gradio/dataframe
|
|
2
2
|
|
|
3
|
+
## 0.17.8
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- [#11033](https://github.com/gradio-app/gradio/pull/11033) [`0dbc14f`](https://github.com/gradio-app/gradio/commit/0dbc14fa867ef57a2f810e0b869b7d13d98f2544) - Allow setting an empty value in `display_value` of `gr.Dataframe`. Thanks @abidlabs!
|
|
8
|
+
|
|
3
9
|
## 0.17.7
|
|
4
10
|
|
|
5
11
|
### Fixes
|
package/Dataframe.stories.svelte
CHANGED
|
@@ -763,14 +763,14 @@
|
|
|
763
763
|
[91, 93, 90],
|
|
764
764
|
[82, 81, 83]
|
|
765
765
|
],
|
|
766
|
-
headers: ["Model A", "Model B", "
|
|
766
|
+
headers: ["Model A", "Model B", "Empty Values"],
|
|
767
767
|
display_value: [
|
|
768
|
-
["🥇 95", "92", "
|
|
769
|
-
["🥈 89", "90", "
|
|
770
|
-
["🥉 92", "88", "
|
|
771
|
-
["87", "85", "
|
|
772
|
-
["91", "93", "
|
|
773
|
-
["82", "81", "
|
|
768
|
+
["🥇 95", "92", ""],
|
|
769
|
+
["🥈 89", "90", ""],
|
|
770
|
+
["🥉 92", "88", ""],
|
|
771
|
+
["87", "85", ""],
|
|
772
|
+
["91", "93", ""],
|
|
773
|
+
["82", "81", ""]
|
|
774
774
|
],
|
|
775
775
|
label: "Model Performance with Medal Indicators",
|
|
776
776
|
col_count: [3, "dynamic"],
|
package/dist/shared/Table.svelte
CHANGED
|
@@ -209,7 +209,7 @@ $:
|
|
|
209
209
|
row.forEach((cell, col_idx) => {
|
|
210
210
|
cell_map.set(cell.id, {
|
|
211
211
|
value: cell.value,
|
|
212
|
-
display_value: cell.display_value
|
|
212
|
+
display_value: cell.display_value !== void 0 ? cell.display_value : String(cell.value),
|
|
213
213
|
styling: styling?.[row_idx]?.[col_idx] || ""
|
|
214
214
|
});
|
|
215
215
|
});
|
|
@@ -220,7 +220,7 @@ $:
|
|
|
220
220
|
const original = cell_map.get(cell.id);
|
|
221
221
|
return {
|
|
222
222
|
...cell,
|
|
223
|
-
display_value: original?.display_value
|
|
223
|
+
display_value: original?.display_value !== void 0 ? original.display_value : String(cell.value),
|
|
224
224
|
styling: original?.styling || ""
|
|
225
225
|
};
|
|
226
226
|
})
|
|
@@ -487,7 +487,9 @@ function commit_filter() {
|
|
|
487
487
|
const styling_row = [];
|
|
488
488
|
row.forEach((cell) => {
|
|
489
489
|
data_row.push(cell.value);
|
|
490
|
-
display_row.push(
|
|
490
|
+
display_row.push(
|
|
491
|
+
cell.display_value !== void 0 ? cell.display_value : String(cell.value)
|
|
492
|
+
);
|
|
491
493
|
styling_row.push(cell.styling || "");
|
|
492
494
|
});
|
|
493
495
|
filtered_data.push(data_row);
|
|
@@ -579,10 +581,10 @@ $:
|
|
|
579
581
|
function get_cell_display_value(row, col) {
|
|
580
582
|
const is_search_active = $df_state.current_search_query !== void 0;
|
|
581
583
|
if (is_search_active && search_results?.[row]?.[col]) {
|
|
582
|
-
return search_results[row][col].display_value
|
|
584
|
+
return search_results[row][col].display_value !== void 0 ? search_results[row][col].display_value : String(search_results[row][col].value);
|
|
583
585
|
}
|
|
584
586
|
if (data?.[row]?.[col]) {
|
|
585
|
-
return data[row][col].display_value
|
|
587
|
+
return data[row][col].display_value !== void 0 ? data[row][col].display_value : String(data[row][col].value);
|
|
586
588
|
}
|
|
587
589
|
return "";
|
|
588
590
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/dataframe",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.8",
|
|
4
4
|
"description": "Gradio UI packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "",
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
"dompurify": "^3.0.3",
|
|
18
18
|
"katex": "^0.16.7",
|
|
19
19
|
"marked": "^12.0.0",
|
|
20
|
-
"@gradio/button": "^0.4.15",
|
|
21
|
-
"@gradio/icons": "^0.12.0",
|
|
22
|
-
"@gradio/atoms": "^0.15.2",
|
|
23
20
|
"@gradio/client": "^1.14.2",
|
|
21
|
+
"@gradio/atoms": "^0.15.2",
|
|
22
|
+
"@gradio/icons": "^0.12.0",
|
|
23
|
+
"@gradio/button": "^0.4.15",
|
|
24
24
|
"@gradio/markdown-code": "^0.4.3",
|
|
25
|
+
"@gradio/statustracker": "^0.10.9",
|
|
25
26
|
"@gradio/upload": "^0.16.2",
|
|
26
|
-
"@gradio/utils": "^0.10.2"
|
|
27
|
-
"@gradio/statustracker": "^0.10.9"
|
|
27
|
+
"@gradio/utils": "^0.10.2"
|
|
28
28
|
},
|
|
29
29
|
"exports": {
|
|
30
30
|
".": {
|
package/shared/Table.svelte
CHANGED
|
@@ -276,7 +276,10 @@
|
|
|
276
276
|
row.forEach((cell, col_idx) => {
|
|
277
277
|
cell_map.set(cell.id, {
|
|
278
278
|
value: cell.value,
|
|
279
|
-
display_value:
|
|
279
|
+
display_value:
|
|
280
|
+
cell.display_value !== undefined
|
|
281
|
+
? cell.display_value
|
|
282
|
+
: String(cell.value),
|
|
280
283
|
styling: styling?.[row_idx]?.[col_idx] || ""
|
|
281
284
|
});
|
|
282
285
|
});
|
|
@@ -289,7 +292,10 @@
|
|
|
289
292
|
const original = cell_map.get(cell.id);
|
|
290
293
|
return {
|
|
291
294
|
...cell,
|
|
292
|
-
display_value:
|
|
295
|
+
display_value:
|
|
296
|
+
original?.display_value !== undefined
|
|
297
|
+
? original.display_value
|
|
298
|
+
: String(cell.value),
|
|
293
299
|
styling: original?.styling || ""
|
|
294
300
|
};
|
|
295
301
|
})
|
|
@@ -609,7 +615,11 @@
|
|
|
609
615
|
|
|
610
616
|
row.forEach((cell) => {
|
|
611
617
|
data_row.push(cell.value);
|
|
612
|
-
display_row.push(
|
|
618
|
+
display_row.push(
|
|
619
|
+
cell.display_value !== undefined
|
|
620
|
+
? cell.display_value
|
|
621
|
+
: String(cell.value)
|
|
622
|
+
);
|
|
613
623
|
styling_row.push(cell.styling || "");
|
|
614
624
|
});
|
|
615
625
|
|
|
@@ -713,14 +723,15 @@
|
|
|
713
723
|
const is_search_active = $df_state.current_search_query !== undefined;
|
|
714
724
|
|
|
715
725
|
if (is_search_active && search_results?.[row]?.[col]) {
|
|
716
|
-
return
|
|
717
|
-
search_results[row][col].display_value
|
|
718
|
-
String(search_results[row][col].value)
|
|
719
|
-
);
|
|
726
|
+
return search_results[row][col].display_value !== undefined
|
|
727
|
+
? search_results[row][col].display_value
|
|
728
|
+
: String(search_results[row][col].value);
|
|
720
729
|
}
|
|
721
730
|
|
|
722
731
|
if (data?.[row]?.[col]) {
|
|
723
|
-
return data[row][col].display_value
|
|
732
|
+
return data[row][col].display_value !== undefined
|
|
733
|
+
? data[row][col].display_value
|
|
734
|
+
: String(data[row][col].value);
|
|
724
735
|
}
|
|
725
736
|
|
|
726
737
|
return "";
|
package/shared/TableCell.svelte
CHANGED
|
@@ -122,7 +122,9 @@
|
|
|
122
122
|
<EditableCell
|
|
123
123
|
bind:value
|
|
124
124
|
bind:el={el.input}
|
|
125
|
-
display_value={display_value
|
|
125
|
+
display_value={display_value !== undefined
|
|
126
|
+
? display_value
|
|
127
|
+
: String(value)}
|
|
126
128
|
{latex_delimiters}
|
|
127
129
|
{line_breaks}
|
|
128
130
|
{editable}
|