@gradio/dataframe 0.6.0 → 0.6.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,15 +1,33 @@
1
1
  # @gradio/dataframe
2
2
 
3
+ ## 0.6.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`17fb116`](https://github.com/gradio-app/gradio/commit/17fb116492f951ab66e3a39b5fdfb598f5446b6f), [`065c5b1`](https://github.com/gradio-app/gradio/commit/065c5b163c4badb9d9cbd06d627fb4ba086003e7)]:
8
+ - @gradio/markdown@0.6.3
9
+ - @gradio/utils@0.3.0
10
+ - @gradio/atoms@0.5.2
11
+ - @gradio/button@0.2.21
12
+ - @gradio/statustracker@0.4.6
13
+ - @gradio/upload@0.7.3
14
+
15
+ ## 0.6.1
16
+
17
+ ### Fixes
18
+
19
+ - [#7354](https://github.com/gradio-app/gradio/pull/7354) [`a7fa47a`](https://github.com/gradio-app/gradio/commit/a7fa47a175fbcf0fd6573ca19334a3a55b55bb24) - ensure Dataframes in background tabs are visible when the tab is selected. Thanks [@pngwn](https://github.com/pngwn)!
20
+
3
21
  ## 0.6.0
4
22
 
5
23
  ### Features
6
24
 
7
- - [#7298](https://github.com/gradio-app/gradio/pull/7298) [`e5344ba`](https://github.com/gradio-app/gradio/commit/e5344ba0cd63d21dbb525330bbc07ca2eca57832) - chore(deps): update dependency marked to v12. Thanks [@renovate](https://github.com/apps/renovate)!
8
- - [#7154](https://github.com/gradio-app/gradio/pull/7154) [`aab2a75`](https://github.com/gradio-app/gradio/commit/aab2a75f0610dd7ed0b481264c6b9f01cfe92094) - Allow selecting texts in dataframe cells. Thanks [@shubhamofbce](https://github.com/shubhamofbce)!
25
+ - [#7298](https://github.com/gradio-app/gradio/pull/7298) [`e5344ba`](https://github.com/gradio-app/gradio/commit/e5344ba0cd63d21dbb525330bbc07ca2eca57832) - chore(deps): update dependency marked to v12. Thanks [@renovate](https://github.com/apps/renovate)!
26
+ - [#7154](https://github.com/gradio-app/gradio/pull/7154) [`aab2a75`](https://github.com/gradio-app/gradio/commit/aab2a75f0610dd7ed0b481264c6b9f01cfe92094) - Allow selecting texts in dataframe cells. Thanks [@shubhamofbce](https://github.com/shubhamofbce)!
9
27
 
10
28
  ### Fixes
11
29
 
12
- - [#7283](https://github.com/gradio-app/gradio/pull/7283) [`757dba6`](https://github.com/gradio-app/gradio/commit/757dba66baf624eae11ff076f0e8d6bfc2314630) - Add `show_label` check to `gr.Dataframe`. Thanks [@hannahblair](https://github.com/hannahblair)!
30
+ - [#7283](https://github.com/gradio-app/gradio/pull/7283) [`757dba6`](https://github.com/gradio-app/gradio/commit/757dba66baf624eae11ff076f0e8d6bfc2314630) - Add `show_label` check to `gr.Dataframe`. Thanks [@hannahblair](https://github.com/hannahblair)!
13
31
 
14
32
  ## 0.5.1
15
33
 
@@ -337,4 +355,4 @@ Thanks [@pngwn](https://github.com/pngwn)!
337
355
 
338
356
  - Updated dependencies [[`667875b2`](https://github.com/gradio-app/gradio/commit/667875b2441753e74d25bd9d3c8adedd8ede11cd), [`37caa2e0`](https://github.com/gradio-app/gradio/commit/37caa2e0fe95d6cab8beb174580fb557904f137f)]:
339
357
  - @gradio/upload@0.0.3
340
- - @gradio/button@0.1.0
358
+ - @gradio/button@0.1.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/dataframe",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
@@ -17,12 +17,12 @@
17
17
  "dompurify": "^3.0.3",
18
18
  "katex": "^0.16.7",
19
19
  "marked": "^12.0.0",
20
- "@gradio/atoms": "^0.5.1",
21
- "@gradio/button": "^0.2.19",
22
- "@gradio/markdown": "^0.6.2",
23
- "@gradio/statustracker": "^0.4.5",
24
- "@gradio/upload": "^0.7.1",
25
- "@gradio/utils": "^0.2.2"
20
+ "@gradio/atoms": "^0.5.2",
21
+ "@gradio/button": "^0.2.21",
22
+ "@gradio/upload": "^0.7.3",
23
+ "@gradio/statustracker": "^0.4.6",
24
+ "@gradio/markdown": "^0.6.3",
25
+ "@gradio/utils": "^0.3.0"
26
26
  },
27
27
  "exports": {
28
28
  ".": "./Index.svelte",
@@ -43,6 +43,7 @@
43
43
  let selected: false | [number, number] = false;
44
44
  let display_value: string[][] | null = value?.metadata?.display_value ?? null;
45
45
  let styling: string[][] | null = value?.metadata?.styling ?? null;
46
+ let t_rect: DOMRectReadOnly;
46
47
 
47
48
  $: {
48
49
  if (value) {
@@ -523,8 +524,6 @@
523
524
 
524
525
  let dragging = false;
525
526
 
526
- let t_width = 0;
527
-
528
527
  function get_max(
529
528
  _d: { value: any; id: string }[][]
530
529
  ): { value: any; id: string }[] {
@@ -617,6 +616,7 @@
617
616
  $: selected_index = !!selected && selected[0];
618
617
 
619
618
  let is_visible = false;
619
+
620
620
  onMount(() => {
621
621
  const observer = new IntersectionObserver((entries, observer) => {
622
622
  entries.forEach((entry) => {
@@ -660,7 +660,7 @@
660
660
  tabindex="0"
661
661
  >
662
662
  <table
663
- bind:clientWidth={t_width}
663
+ bind:contentRect={t_rect}
664
664
  bind:this={table}
665
665
  class:fixed-layout={column_widths.length != 0}
666
666
  >
@@ -735,7 +735,6 @@
735
735
  >
736
736
  <VirtualTable
737
737
  bind:items={data}
738
- table_width={t_width}
739
738
  max_height={height}
740
739
  bind:actual_height={table_height}
741
740
  bind:table_scrollbar_width={scrollbar_width}
@@ -4,7 +4,6 @@
4
4
 
5
5
  export let items: any[][] = [];
6
6
 
7
- export let table_width: number;
8
7
  export let max_height: number;
9
8
  export let actual_height: number;
10
9
  export let table_scrollbar_width: number;
@@ -25,12 +24,15 @@
25
24
  let viewport: HTMLTableElement;
26
25
  let viewport_height = 0;
27
26
  let visible: { index: number; data: any[] }[] = [];
27
+ let viewport_box: DOMRectReadOnly;
28
+
29
+ $: viewport_height = viewport_box?.height || 0;
28
30
 
29
31
  $: if (mounted) requestAnimationFrame(() => refresh_height_map(sortedItems));
30
32
 
31
33
  let content_height = 0;
32
34
  async function refresh_height_map(_items: typeof items): Promise<void> {
33
- if (viewport_height === 0 || table_width === 0) {
35
+ if (viewport_height === 0) {
34
36
  return;
35
37
  }
36
38
  const { scrollTop } = viewport;
@@ -83,6 +85,7 @@
83
85
  }
84
86
 
85
87
  $: scroll_and_render(selected);
88
+
86
89
  async function scroll_and_render(n: number | false): Promise<void> {
87
90
  requestAnimationFrame(async () => {
88
91
  if (typeof n !== "number") return;
@@ -244,7 +247,7 @@
244
247
  <table
245
248
  class="table"
246
249
  bind:this={viewport}
247
- bind:offsetHeight={viewport_height}
250
+ bind:contentRect={viewport_box}
248
251
  on:scroll={handle_scroll}
249
252
  style="height: {height}; --bw-svt-p-top: {top}px; --bw-svt-p-bottom: {bottom}px; --bw-svt-head-height: {head_height}px; --bw-svt-foot-height: {foot_height}px; --bw-svt-avg-row-height: {average_height}px"
250
253
  >