@gradio/dataframe 0.12.3 → 0.12.5

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,28 @@
1
1
  # @gradio/dataframe
2
2
 
3
+ ## 0.12.5
4
+
5
+ ### Dependency updates
6
+
7
+ - @gradio/statustracker@0.9.7
8
+ - @gradio/upload@0.14.3
9
+ - @gradio/button@0.3.9
10
+ - @gradio/atoms@0.12.0
11
+
12
+ ## 0.12.4
13
+
14
+ ### Fixes
15
+
16
+ - [#9945](https://github.com/gradio-app/gradio/pull/9945) [`e9f0d03`](https://github.com/gradio-app/gradio/commit/e9f0d0315d27325f55a8b1c5c763d07e3d78fd06) - Ensure Enter is correctly handled in Safari and Firefox. Thanks @hannahblair!
17
+
18
+ ### Dependency updates
19
+
20
+ - @gradio/atoms@0.11.2
21
+ - @gradio/utils@0.9.0
22
+ - @gradio/button@0.3.8
23
+ - @gradio/statustracker@0.9.6
24
+ - @gradio/upload@0.14.2
25
+
3
26
  ## 0.12.3
4
27
 
5
28
  ### Fixes
@@ -32,6 +32,13 @@ function handle_blur({
32
32
  value = currentTarget.value;
33
33
  dispatch("blur");
34
34
  }
35
+ function handle_keydown(event) {
36
+ if (event.key === "Enter") {
37
+ value = _value;
38
+ dispatch("blur");
39
+ }
40
+ dispatch("keydown", event);
41
+ }
35
42
  </script>
36
43
 
37
44
  {#if edit}
@@ -43,7 +50,7 @@ function handle_blur({
43
50
  tabindex="-1"
44
51
  on:blur={handle_blur}
45
52
  use:use_focus
46
- on:keydown
53
+ on:keydown={handle_keydown}
47
54
  />
48
55
  {/if}
49
56
 
@@ -20,10 +20,10 @@ declare const __propDef: {
20
20
  el: HTMLInputElement | null;
21
21
  };
22
22
  events: {
23
- keydown: KeyboardEvent;
24
23
  dblclick: MouseEvent;
25
24
  focus: FocusEvent;
26
25
  blur: CustomEvent<any>;
26
+ keydown: CustomEvent<any>;
27
27
  } & {
28
28
  [evt: string]: CustomEvent<any>;
29
29
  };
@@ -209,6 +209,11 @@ async function handle_keydown(event) {
209
209
  selected = [i + 1, j];
210
210
  } else {
211
211
  if (dequal(editing, [i, j])) {
212
+ const cell_id = data[i][j].id;
213
+ const input_el = els[cell_id].input;
214
+ if (input_el) {
215
+ data[i][j].value = input_el.value;
216
+ }
212
217
  editing = false;
213
218
  await tick();
214
219
  selected = [i, j];
@@ -298,7 +303,7 @@ async function edit_header(i, _select = false) {
298
303
  function end_header_edit(event) {
299
304
  if (!editable)
300
305
  return;
301
- switch (event.key) {
306
+ switch (event.detail.key) {
302
307
  case "Escape":
303
308
  case "Enter":
304
309
  case "Tab":
@@ -1033,7 +1038,7 @@ function reset_selection() {
1033
1038
  min-width: var(--size-5);
1034
1039
  padding: 0;
1035
1040
  margin-right: var(--spacing-sm);
1036
- z-index: var(--layer-2);
1041
+ z-index: var(--layer-1);
1037
1042
  }
1038
1043
 
1039
1044
  .cell-menu-button:hover {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/dataframe",
3
- "version": "0.12.3",
3
+ "version": "0.12.5",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
@@ -17,13 +17,13 @@
17
17
  "dompurify": "^3.0.3",
18
18
  "katex": "^0.16.7",
19
19
  "marked": "^12.0.0",
20
- "@gradio/atoms": "^0.11.1",
21
- "@gradio/button": "^0.3.7",
22
- "@gradio/markdown-code": "^0.2.1",
23
- "@gradio/statustracker": "^0.9.5",
20
+ "@gradio/atoms": "^0.12.0",
21
+ "@gradio/button": "^0.3.9",
24
22
  "@gradio/client": "^1.8.0",
25
- "@gradio/utils": "^0.8.0",
26
- "@gradio/upload": "^0.14.1"
23
+ "@gradio/markdown-code": "^0.2.1",
24
+ "@gradio/statustracker": "^0.9.7",
25
+ "@gradio/upload": "^0.14.3",
26
+ "@gradio/utils": "^0.9.0"
27
27
  },
28
28
  "exports": {
29
29
  ".": {
@@ -51,6 +51,14 @@
51
51
  value = currentTarget.value;
52
52
  dispatch("blur");
53
53
  }
54
+
55
+ function handle_keydown(event: KeyboardEvent): void {
56
+ if (event.key === "Enter") {
57
+ value = _value;
58
+ dispatch("blur");
59
+ }
60
+ dispatch("keydown", event);
61
+ }
54
62
  </script>
55
63
 
56
64
  {#if edit}
@@ -62,7 +70,7 @@
62
70
  tabindex="-1"
63
71
  on:blur={handle_blur}
64
72
  use:use_focus
65
- on:keydown
73
+ on:keydown={handle_keydown}
66
74
  />
67
75
  {/if}
68
76
 
@@ -293,6 +293,11 @@
293
293
  selected = [i + 1, j];
294
294
  } else {
295
295
  if (dequal(editing, [i, j])) {
296
+ const cell_id = data[i][j].id;
297
+ const input_el = els[cell_id].input;
298
+ if (input_el) {
299
+ data[i][j].value = input_el.value;
300
+ }
296
301
  editing = false;
297
302
  await tick();
298
303
  selected = [i, j];
@@ -392,10 +397,10 @@
392
397
  select_on_focus = _select;
393
398
  }
394
399
 
395
- function end_header_edit(event: KeyboardEvent): void {
400
+ function end_header_edit(event: CustomEvent<KeyboardEvent>): void {
396
401
  if (!editable) return;
397
402
 
398
- switch (event.key) {
403
+ switch (event.detail.key) {
399
404
  case "Escape":
400
405
  case "Enter":
401
406
  case "Tab":
@@ -1227,7 +1232,7 @@
1227
1232
  min-width: var(--size-5);
1228
1233
  padding: 0;
1229
1234
  margin-right: var(--spacing-sm);
1230
- z-index: var(--layer-2);
1235
+ z-index: var(--layer-1);
1231
1236
  }
1232
1237
 
1233
1238
  .cell-menu-button:hover {