@gradio/dataframe 0.18.1 → 0.18.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 +6 -0
- package/dist/shared/Table.svelte +2 -1
- package/dist/shared/context/dataframe_context.d.ts +1 -0
- package/dist/shared/utils/keyboard_utils.js +5 -0
- package/package.json +3 -3
- package/shared/Table.svelte +2 -1
- package/shared/context/dataframe_context.ts +1 -0
- package/shared/utils/keyboard_utils.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @gradio/dataframe
|
|
2
2
|
|
|
3
|
+
## 0.18.2
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- [#11496](https://github.com/gradio-app/gradio/pull/11496) [`ee0da48`](https://github.com/gradio-app/gradio/commit/ee0da481446da5ffd79151a457cd3847db645bfb) - Prevent deletion of values in static columns. Thanks @hannahblair!
|
|
8
|
+
|
|
3
9
|
## 0.18.1
|
|
4
10
|
|
|
5
11
|
### Fixes
|
package/dist/shared/Table.svelte
CHANGED
|
@@ -59,6 +59,7 @@ function handle_header_navigation(event, ctx) {
|
|
|
59
59
|
}
|
|
60
60
|
return false;
|
|
61
61
|
}
|
|
62
|
+
// eslint-disable-next-line complexity
|
|
62
63
|
function handle_delete_operation(event, ctx) {
|
|
63
64
|
if (!ctx.data || !ctx.headers || !ctx.els || !ctx.dispatch)
|
|
64
65
|
return false;
|
|
@@ -69,6 +70,10 @@ function handle_delete_operation(event, ctx) {
|
|
|
69
70
|
return false;
|
|
70
71
|
const editing = state.ui_state.editing;
|
|
71
72
|
const selected_cells = state.ui_state.selected_cells;
|
|
73
|
+
const static_columns = state.config.static_columns || [];
|
|
74
|
+
if (selected_cells.some(([_, col]) => static_columns.includes(col))) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
72
77
|
if (editing) {
|
|
73
78
|
const [row, col] = editing;
|
|
74
79
|
const input_el = ctx.els[ctx.data[row][col].id]?.input;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/dataframe",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.2",
|
|
4
4
|
"description": "Gradio UI packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "",
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
"katex": "^0.16.7",
|
|
19
19
|
"marked": "^12.0.0",
|
|
20
20
|
"@gradio/atoms": "^0.16.3",
|
|
21
|
-
"@gradio/button": "^0.5.6",
|
|
22
21
|
"@gradio/checkbox": "^0.4.25",
|
|
22
|
+
"@gradio/button": "^0.5.6",
|
|
23
23
|
"@gradio/client": "^1.15.5",
|
|
24
24
|
"@gradio/icons": "^0.12.0",
|
|
25
|
-
"@gradio/markdown-code": "^0.5.0",
|
|
26
25
|
"@gradio/statustracker": "^0.10.14",
|
|
26
|
+
"@gradio/markdown-code": "^0.5.0",
|
|
27
27
|
"@gradio/utils": "^0.10.2",
|
|
28
28
|
"@gradio/upload": "^0.16.10"
|
|
29
29
|
},
|
package/shared/Table.svelte
CHANGED
|
@@ -88,6 +88,7 @@ function handle_header_navigation(
|
|
|
88
88
|
return false;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
// eslint-disable-next-line complexity
|
|
91
92
|
function handle_delete_operation(
|
|
92
93
|
event: KeyboardEvent,
|
|
93
94
|
ctx: DataFrameContext
|
|
@@ -101,6 +102,11 @@ function handle_delete_operation(
|
|
|
101
102
|
const editing = state.ui_state.editing;
|
|
102
103
|
const selected_cells = state.ui_state.selected_cells;
|
|
103
104
|
|
|
105
|
+
const static_columns = state.config.static_columns || [];
|
|
106
|
+
if (selected_cells.some(([_, col]) => static_columns.includes(col))) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
|
|
104
110
|
if (editing) {
|
|
105
111
|
const [row, col] = editing;
|
|
106
112
|
const input_el = ctx.els[ctx.data[row][col].id]?.input;
|