@gradio/dataframe 0.16.0 → 0.16.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 CHANGED
@@ -1,5 +1,25 @@
1
1
  # @gradio/dataframe
2
2
 
3
+ ## 0.16.2
4
+
5
+ ### Fixes
6
+
7
+ - [#10597](https://github.com/gradio-app/gradio/pull/10597) [`8c87eb8`](https://github.com/gradio-app/gradio/commit/8c87eb83066278b0e28267a6648d4729d6f39aa9) - Fix issue where styling changes were overridden when value was updated simultaneously. Thanks @abidlabs!
8
+
9
+ ### Dependency updates
10
+
11
+ - @gradio/upload@0.15.2
12
+ - @gradio/statustracker@0.10.4
13
+ - @gradio/atoms@0.13.3
14
+ - @gradio/button@0.4.7
15
+
16
+ ## 0.16.1
17
+
18
+ ### Fixes
19
+
20
+ - [#10607](https://github.com/gradio-app/gradio/pull/10607) [`c354f5f`](https://github.com/gradio-app/gradio/commit/c354f5ff16c787d722f4e53d5a97f729abba955e) - Add empty dataframe functionality. Thanks @hannahblair!
21
+ - [#10596](https://github.com/gradio-app/gradio/pull/10596) [`a8bde76`](https://github.com/gradio-app/gradio/commit/a8bde76e2b0f65b3565019beb03ac8b1fd152963) - Fix margin above `gr.Dataframe` when no header is provided. Thanks @abidlabs!
22
+
3
23
  ## 0.16.0
4
24
 
5
25
  ### Features
@@ -152,6 +152,21 @@
152
152
  }}
153
153
  />
154
154
 
155
+ <Story
156
+ name="Dataframe without a label"
157
+ args={{
158
+ values: [
159
+ [800, 100, 800],
160
+ [200, 800, 700]
161
+ ],
162
+ headers: ["Math", "Reading", "Writing"],
163
+ show_label: false,
164
+ col_count: [3, "dynamic"],
165
+ row_count: [2, "dynamic"],
166
+ editable: false
167
+ }}
168
+ />
169
+
155
170
  <Story
156
171
  name="Dataframe with different colors"
157
172
  args={{
package/Example.svelte CHANGED
@@ -6,6 +6,7 @@
6
6
 
7
7
  let hovered = false;
8
8
  let loaded = Array.isArray(value);
9
+ let is_empty = loaded && (value.length === 0 || value[0].length === 0);
9
10
  </script>
10
11
 
11
12
  {#if loaded}
@@ -20,6 +21,12 @@
20
21
  >
21
22
  {#if typeof value === "string"}
22
23
  {value}
24
+ {:else if is_empty}
25
+ <table class="">
26
+ <tr>
27
+ <td>Empty</td>
28
+ </tr>
29
+ </table>
23
30
  {:else}
24
31
  <table class="">
25
32
  {#each value.slice(0, 3) as row, i}
package/Index.svelte CHANGED
@@ -103,7 +103,8 @@
103
103
  {styling}
104
104
  headers={_headers}
105
105
  on:change={(e) => {
106
- value = e.detail;
106
+ value.data = e.detail.data;
107
+ value.headers = e.detail.headers;
107
108
  gradio.dispatch("change");
108
109
  }}
109
110
  on:input={(e) => gradio.dispatch("input")}
@@ -4,6 +4,7 @@ export let selected = false;
4
4
  export let index;
5
5
  let hovered = false;
6
6
  let loaded = Array.isArray(value);
7
+ let is_empty = loaded && (value.length === 0 || value[0].length === 0);
7
8
  </script>
8
9
 
9
10
  {#if loaded}
@@ -18,6 +19,12 @@ let loaded = Array.isArray(value);
18
19
  >
19
20
  {#if typeof value === "string"}
20
21
  {value}
22
+ {:else if is_empty}
23
+ <table class="">
24
+ <tr>
25
+ <td>Empty</td>
26
+ </tr>
27
+ </table>
21
28
  {:else}
22
29
  <table class="">
23
30
  {#each value.slice(0, 3) as row, i}
package/dist/Index.svelte CHANGED
@@ -81,7 +81,8 @@ $:
81
81
  {styling}
82
82
  headers={_headers}
83
83
  on:change={(e) => {
84
- value = e.detail;
84
+ value.data = e.detail.data;
85
+ value.headers = e.detail.headers;
85
86
  gradio.dispatch("change");
86
87
  }}
87
88
  on:input={(e) => gradio.dispatch("input")}
@@ -81,7 +81,7 @@ function position_menu() {
81
81
  <style>
82
82
  .cell-menu {
83
83
  position: fixed;
84
- z-index: var(--layer-2);
84
+ z-index: var(--layer-4);
85
85
  background: var(--background-fill-primary);
86
86
  border: 1px solid var(--border-color-primary);
87
87
  border-radius: var(--radius-sm);
@@ -84,7 +84,6 @@ function handle_click() {
84
84
  class:multiline={header}
85
85
  on:focus|preventDefault
86
86
  style={styling}
87
- class="table-cell-text"
88
87
  data-editable={editable}
89
88
  placeholder=" "
90
89
  >
@@ -123,8 +122,6 @@ function handle_click() {
123
122
  position: relative;
124
123
  display: inline-block;
125
124
  outline: none;
126
- padding: var(--size-2);
127
- padding-right: 0;
128
125
  -webkit-user-select: text;
129
126
  -moz-user-select: text;
130
127
  -ms-user-select: text;
@@ -151,6 +148,7 @@ function handle_click() {
151
148
  font-weight: var(--weight-bold);
152
149
  white-space: normal;
153
150
  word-break: break-word;
151
+ margin-left: var(--size-1);
154
152
  }
155
153
 
156
154
  .edit {