@gradio/dataframe 0.21.2 → 0.21.4
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 +36 -0
- package/Dataframe.stories.svelte +179 -65
- package/Standalone.stories.svelte +84 -72
- package/dist/shared/Table.svelte.d.ts +1 -1
- package/dist/shared/Toolbar.svelte +1 -1
- package/dist/shared/Toolbar.svelte.d.ts +1 -1
- package/dist/shared/icons/SortIcon.svelte +2 -2
- package/package.json +11 -11
- package/shared/Toolbar.svelte +1 -1
- package/shared/icons/SortIcon.svelte +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @gradio/dataframe
|
|
2
2
|
|
|
3
|
+
## 0.21.4
|
|
4
|
+
|
|
5
|
+
### Dependency updates
|
|
6
|
+
|
|
7
|
+
- @gradio/atoms@0.21.0
|
|
8
|
+
- @gradio/client@2.0.4
|
|
9
|
+
- @gradio/statustracker@0.12.3
|
|
10
|
+
- @gradio/upload@0.17.5
|
|
11
|
+
- @gradio/checkbox@0.6.2
|
|
12
|
+
|
|
13
|
+
## 0.21.3
|
|
14
|
+
|
|
15
|
+
### Fixes
|
|
16
|
+
|
|
17
|
+
- [#12779](https://github.com/gradio-app/gradio/pull/12779) [`ea2d3e9`](https://github.com/gradio-app/gradio/commit/ea2d3e985a8b42d188e551f517c5825c00790628) - Migrate Audio + Upload + Atoms to Svelte 5. Thanks @dawoodkhan82!
|
|
18
|
+
|
|
19
|
+
### Dependency updates
|
|
20
|
+
|
|
21
|
+
- @gradio/button@0.6.3
|
|
22
|
+
- @gradio/statustracker@0.12.2
|
|
23
|
+
- @gradio/atoms@0.20.1
|
|
24
|
+
- @gradio/utils@0.11.2
|
|
25
|
+
- @gradio/icons@0.15.1
|
|
26
|
+
- @gradio/upload@0.17.4
|
|
27
|
+
- @gradio/client@2.0.3
|
|
28
|
+
- @gradio/markdown-code@0.6.1
|
|
29
|
+
- @gradio/checkbox@0.6.1
|
|
30
|
+
|
|
31
|
+
## 0.21.2
|
|
32
|
+
|
|
33
|
+
### Dependency updates
|
|
34
|
+
|
|
35
|
+
- @gradio/utils@0.11.1
|
|
36
|
+
- @gradio/button@0.6.2
|
|
37
|
+
- @gradio/client@2.0.2
|
|
38
|
+
|
|
3
39
|
## 0.21.2
|
|
4
40
|
|
|
5
41
|
### Fixes
|
package/Dataframe.stories.svelte
CHANGED
|
@@ -1,45 +1,41 @@
|
|
|
1
|
-
<script lang="ts">
|
|
1
|
+
<script module lang="ts">
|
|
2
2
|
// @ts-nocheck
|
|
3
|
-
import {
|
|
3
|
+
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
4
4
|
import Table from "./shared/Table.svelte";
|
|
5
5
|
import { within } from "@testing-library/dom";
|
|
6
|
-
import { userEvent } from "
|
|
6
|
+
import { userEvent } from "storybook/test";
|
|
7
7
|
import { get } from "svelte/store";
|
|
8
8
|
import { format } from "svelte-i18n";
|
|
9
9
|
import Image from "@gradio/image";
|
|
10
|
-
</script>
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}}
|
|
20
|
-
argTypes={{
|
|
21
|
-
editable: {
|
|
22
|
-
control: [true, false],
|
|
23
|
-
description: "Whether the DataFrame is editable",
|
|
24
|
-
name: "interactive",
|
|
25
|
-
value: true
|
|
11
|
+
const { Story } = defineMeta({
|
|
12
|
+
title: "Components/DataFrame",
|
|
13
|
+
component: Table,
|
|
14
|
+
parameters: {
|
|
15
|
+
test: {
|
|
16
|
+
dangerouslyIgnoreUnhandledErrors: true // ignore fullscreen permission error
|
|
17
|
+
}
|
|
26
18
|
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
19
|
+
argTypes: {
|
|
20
|
+
editable: {
|
|
21
|
+
control: [true, false],
|
|
22
|
+
description: "Whether the DataFrame is editable",
|
|
23
|
+
name: "interactive",
|
|
24
|
+
value: true
|
|
25
|
+
},
|
|
26
|
+
wrap: {
|
|
27
|
+
control: "boolean",
|
|
28
|
+
description: "Whether text should wrap or truncate with ellipsis",
|
|
29
|
+
defaultValue: false
|
|
30
|
+
},
|
|
31
|
+
column_widths: {
|
|
32
|
+
control: "object",
|
|
33
|
+
description: "Width of each column (px, %, or auto)",
|
|
34
|
+
defaultValue: ["200px", "200px", "200px"]
|
|
35
|
+
}
|
|
36
36
|
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<Template let:args>
|
|
41
|
-
<Table {...args} i18n={get(format)} />
|
|
42
|
-
</Template>
|
|
37
|
+
});
|
|
38
|
+
</script>
|
|
43
39
|
|
|
44
40
|
<Story
|
|
45
41
|
name="Interactive dataframe"
|
|
@@ -54,7 +50,11 @@
|
|
|
54
50
|
col_count: [2, "dynamic"],
|
|
55
51
|
row_count: [3, "dynamic"]
|
|
56
52
|
}}
|
|
57
|
-
|
|
53
|
+
>
|
|
54
|
+
{#snippet template(args)}
|
|
55
|
+
<Table {...args} i18n={get(format)} />
|
|
56
|
+
{/snippet}
|
|
57
|
+
</Story>
|
|
58
58
|
|
|
59
59
|
<Story
|
|
60
60
|
name="Interactive dataframe with label"
|
|
@@ -71,7 +71,11 @@
|
|
|
71
71
|
col_count: [2, "dynamic"],
|
|
72
72
|
row_count: [3, "dynamic"]
|
|
73
73
|
}}
|
|
74
|
-
|
|
74
|
+
>
|
|
75
|
+
{#snippet template(args)}
|
|
76
|
+
<Table {...args} i18n={get(format)} />
|
|
77
|
+
{/snippet}
|
|
78
|
+
</Story>
|
|
75
79
|
|
|
76
80
|
<Story
|
|
77
81
|
name="Interactive dataframe no label"
|
|
@@ -88,7 +92,11 @@
|
|
|
88
92
|
col_count: [2, "dynamic"],
|
|
89
93
|
row_count: [3, "dynamic"]
|
|
90
94
|
}}
|
|
91
|
-
|
|
95
|
+
>
|
|
96
|
+
{#snippet template(args)}
|
|
97
|
+
<Table {...args} i18n={get(format)} />
|
|
98
|
+
{/snippet}
|
|
99
|
+
</Story>
|
|
92
100
|
|
|
93
101
|
<Story
|
|
94
102
|
name="Static dataframe"
|
|
@@ -107,7 +115,6 @@
|
|
|
107
115
|
}}
|
|
108
116
|
play={async ({ canvasElement }) => {
|
|
109
117
|
// tests that the cell is not editable
|
|
110
|
-
|
|
111
118
|
const canvas = within(canvasElement);
|
|
112
119
|
const cells = canvas.getAllByRole("cell");
|
|
113
120
|
const initial_value = cells[0].textContent;
|
|
@@ -124,7 +131,11 @@
|
|
|
124
131
|
throw new Error("Input field appeared when table should be non-editable");
|
|
125
132
|
}
|
|
126
133
|
}}
|
|
127
|
-
|
|
134
|
+
>
|
|
135
|
+
{#snippet template(args)}
|
|
136
|
+
<Table {...args} i18n={get(format)} />
|
|
137
|
+
{/snippet}
|
|
138
|
+
</Story>
|
|
128
139
|
|
|
129
140
|
<Story
|
|
130
141
|
name="Dataframe with different precisions"
|
|
@@ -143,7 +154,11 @@
|
|
|
143
154
|
row_count: [2, "dynamic"],
|
|
144
155
|
editable: false
|
|
145
156
|
}}
|
|
146
|
-
|
|
157
|
+
>
|
|
158
|
+
{#snippet template(args)}
|
|
159
|
+
<Table {...args} i18n={get(format)} />
|
|
160
|
+
{/snippet}
|
|
161
|
+
</Story>
|
|
147
162
|
|
|
148
163
|
<Story
|
|
149
164
|
name="Dataframe with markdown and math"
|
|
@@ -161,7 +176,11 @@
|
|
|
161
176
|
row_count: [3, "dynamic"],
|
|
162
177
|
editable: false
|
|
163
178
|
}}
|
|
164
|
-
|
|
179
|
+
>
|
|
180
|
+
{#snippet template(args)}
|
|
181
|
+
<Table {...args} i18n={get(format)} />
|
|
182
|
+
{/snippet}
|
|
183
|
+
</Story>
|
|
165
184
|
|
|
166
185
|
<Story
|
|
167
186
|
name="Dataframe without a label"
|
|
@@ -176,7 +195,11 @@
|
|
|
176
195
|
row_count: [2, "dynamic"],
|
|
177
196
|
editable: false
|
|
178
197
|
}}
|
|
179
|
-
|
|
198
|
+
>
|
|
199
|
+
{#snippet template(args)}
|
|
200
|
+
<Table {...args} i18n={get(format)} />
|
|
201
|
+
{/snippet}
|
|
202
|
+
</Story>
|
|
180
203
|
|
|
181
204
|
<Story
|
|
182
205
|
name="Dataframe with different colors"
|
|
@@ -186,7 +209,6 @@
|
|
|
186
209
|
[200, 800, 700]
|
|
187
210
|
],
|
|
188
211
|
headers: ["Math", "Reading", "Writing"],
|
|
189
|
-
|
|
190
212
|
styling: [
|
|
191
213
|
[
|
|
192
214
|
"background-color:teal; color: white",
|
|
@@ -200,7 +222,11 @@
|
|
|
200
222
|
row_count: [2, "dynamic"],
|
|
201
223
|
editable: false
|
|
202
224
|
}}
|
|
203
|
-
|
|
225
|
+
>
|
|
226
|
+
{#snippet template(args)}
|
|
227
|
+
<Table {...args} i18n={get(format)} />
|
|
228
|
+
{/snippet}
|
|
229
|
+
</Story>
|
|
204
230
|
|
|
205
231
|
<Story
|
|
206
232
|
name="Dataframe with column widths"
|
|
@@ -216,7 +242,11 @@
|
|
|
216
242
|
column_widths: ["20%", "30%", "50%"],
|
|
217
243
|
editable: false
|
|
218
244
|
}}
|
|
219
|
-
|
|
245
|
+
>
|
|
246
|
+
{#snippet template(args)}
|
|
247
|
+
<Table {...args} i18n={get(format)} />
|
|
248
|
+
{/snippet}
|
|
249
|
+
</Story>
|
|
220
250
|
|
|
221
251
|
<Story
|
|
222
252
|
name="Dataframe with zero row count"
|
|
@@ -228,7 +258,11 @@
|
|
|
228
258
|
row_count: [0, "dynamic"],
|
|
229
259
|
editable: false
|
|
230
260
|
}}
|
|
231
|
-
|
|
261
|
+
>
|
|
262
|
+
{#snippet template(args)}
|
|
263
|
+
<Table {...args} i18n={get(format)} />
|
|
264
|
+
{/snippet}
|
|
265
|
+
</Story>
|
|
232
266
|
|
|
233
267
|
<Story
|
|
234
268
|
name="Interactive dataframe with zero row count"
|
|
@@ -240,7 +274,11 @@
|
|
|
240
274
|
row_count: [0, "dynamic"],
|
|
241
275
|
editable: true
|
|
242
276
|
}}
|
|
243
|
-
|
|
277
|
+
>
|
|
278
|
+
{#snippet template(args)}
|
|
279
|
+
<Table {...args} i18n={get(format)} />
|
|
280
|
+
{/snippet}
|
|
281
|
+
</Story>
|
|
244
282
|
|
|
245
283
|
<Story
|
|
246
284
|
name="Dataframe with link"
|
|
@@ -252,7 +290,11 @@
|
|
|
252
290
|
col_count: [1, "dynamic"],
|
|
253
291
|
row_count: [1, "dynamic"]
|
|
254
292
|
}}
|
|
255
|
-
|
|
293
|
+
>
|
|
294
|
+
{#snippet template(args)}
|
|
295
|
+
<Table {...args} i18n={get(format)} />
|
|
296
|
+
{/snippet}
|
|
297
|
+
</Story>
|
|
256
298
|
|
|
257
299
|
<Story
|
|
258
300
|
name="Dataframe with dialog interactions"
|
|
@@ -282,7 +324,11 @@
|
|
|
282
324
|
const new_cell = canvas.getAllByRole("cell")[9];
|
|
283
325
|
userEvent.click(new_cell);
|
|
284
326
|
}}
|
|
285
|
-
|
|
327
|
+
>
|
|
328
|
+
{#snippet template(args)}
|
|
329
|
+
<Table {...args} i18n={get(format)} />
|
|
330
|
+
{/snippet}
|
|
331
|
+
</Story>
|
|
286
332
|
|
|
287
333
|
<Story
|
|
288
334
|
name="Dataframe with fullscreen button and label and search"
|
|
@@ -300,7 +346,11 @@
|
|
|
300
346
|
show_search: "search",
|
|
301
347
|
label: "Test scores"
|
|
302
348
|
}}
|
|
303
|
-
|
|
349
|
+
>
|
|
350
|
+
{#snippet template(args)}
|
|
351
|
+
<Table {...args} i18n={get(format)} />
|
|
352
|
+
{/snippet}
|
|
353
|
+
</Story>
|
|
304
354
|
|
|
305
355
|
<Story
|
|
306
356
|
name="Dataframe with multiple selection interactions"
|
|
@@ -340,7 +390,11 @@
|
|
|
340
390
|
// verify cells were cleared by clicking one
|
|
341
391
|
await user.click(cells[2]);
|
|
342
392
|
}}
|
|
343
|
-
|
|
393
|
+
>
|
|
394
|
+
{#snippet template(args)}
|
|
395
|
+
<Table {...args} i18n={get(format)} />
|
|
396
|
+
{/snippet}
|
|
397
|
+
</Story>
|
|
344
398
|
|
|
345
399
|
<Story
|
|
346
400
|
name="Dataframe toolbar interactions"
|
|
@@ -370,7 +424,11 @@
|
|
|
370
424
|
|
|
371
425
|
await userEvent.click(fullscreen_button);
|
|
372
426
|
}}
|
|
373
|
-
|
|
427
|
+
>
|
|
428
|
+
{#snippet template(args)}
|
|
429
|
+
<Table {...args} i18n={get(format)} />
|
|
430
|
+
{/snippet}
|
|
431
|
+
</Story>
|
|
374
432
|
|
|
375
433
|
<Story
|
|
376
434
|
name="Dataframe with row numbers"
|
|
@@ -389,7 +447,11 @@
|
|
|
389
447
|
show_row_numbers: true,
|
|
390
448
|
editable: false
|
|
391
449
|
}}
|
|
392
|
-
|
|
450
|
+
>
|
|
451
|
+
{#snippet template(args)}
|
|
452
|
+
<Table {...args} i18n={get(format)} />
|
|
453
|
+
{/snippet}
|
|
454
|
+
</Story>
|
|
393
455
|
|
|
394
456
|
<Story
|
|
395
457
|
name="Dataframe with truncated text"
|
|
@@ -417,7 +479,11 @@
|
|
|
417
479
|
col_count: [3, "dynamic"],
|
|
418
480
|
row_count: [3, "dynamic"]
|
|
419
481
|
}}
|
|
420
|
-
|
|
482
|
+
>
|
|
483
|
+
{#snippet template(args)}
|
|
484
|
+
<Table {...args} i18n={get(format)} />
|
|
485
|
+
{/snippet}
|
|
486
|
+
</Story>
|
|
421
487
|
|
|
422
488
|
<Story
|
|
423
489
|
name="Dataframe with multiline headers"
|
|
@@ -437,7 +503,11 @@
|
|
|
437
503
|
row_count: [3, "dynamic"],
|
|
438
504
|
editable: false
|
|
439
505
|
}}
|
|
440
|
-
|
|
506
|
+
>
|
|
507
|
+
{#snippet template(args)}
|
|
508
|
+
<Table {...args} i18n={get(format)} />
|
|
509
|
+
{/snippet}
|
|
510
|
+
</Story>
|
|
441
511
|
|
|
442
512
|
<Story
|
|
443
513
|
name="Dataframe with row and column selection"
|
|
@@ -477,7 +547,11 @@
|
|
|
477
547
|
|
|
478
548
|
await user.keyboard("{Delete}");
|
|
479
549
|
}}
|
|
480
|
-
|
|
550
|
+
>
|
|
551
|
+
{#snippet template(args)}
|
|
552
|
+
<Table {...args} i18n={get(format)} />
|
|
553
|
+
{/snippet}
|
|
554
|
+
</Story>
|
|
481
555
|
|
|
482
556
|
<Story
|
|
483
557
|
name="Dataframe with lots of values"
|
|
@@ -513,7 +587,11 @@
|
|
|
513
587
|
row_count: [10, "dynamic"],
|
|
514
588
|
max_height: 700
|
|
515
589
|
}}
|
|
516
|
-
|
|
590
|
+
>
|
|
591
|
+
{#snippet template(args)}
|
|
592
|
+
<Table {...args} i18n={get(format)} />
|
|
593
|
+
{/snippet}
|
|
594
|
+
</Story>
|
|
517
595
|
|
|
518
596
|
<Story
|
|
519
597
|
name="Dataframe with search and filter"
|
|
@@ -548,7 +626,11 @@
|
|
|
548
626
|
|
|
549
627
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
550
628
|
}}
|
|
551
|
-
|
|
629
|
+
>
|
|
630
|
+
{#snippet template(args)}
|
|
631
|
+
<Table {...args} i18n={get(format)} />
|
|
632
|
+
{/snippet}
|
|
633
|
+
</Story>
|
|
552
634
|
|
|
553
635
|
<Story
|
|
554
636
|
name="Dataframe with pinned columns"
|
|
@@ -569,7 +651,11 @@
|
|
|
569
651
|
show_row_numbers: true,
|
|
570
652
|
editable: false
|
|
571
653
|
}}
|
|
572
|
-
|
|
654
|
+
>
|
|
655
|
+
{#snippet template(args)}
|
|
656
|
+
<Table {...args} i18n={get(format)} />
|
|
657
|
+
{/snippet}
|
|
658
|
+
</Story>
|
|
573
659
|
|
|
574
660
|
<Story
|
|
575
661
|
name="Dataframe with pixel and percentage column widths set"
|
|
@@ -583,7 +669,11 @@
|
|
|
583
669
|
row_count: [2, "dynamic"],
|
|
584
670
|
column_widths: ["10%", "50%", "40%", "100px", "100px"]
|
|
585
671
|
}}
|
|
586
|
-
|
|
672
|
+
>
|
|
673
|
+
{#snippet template(args)}
|
|
674
|
+
<Table {...args} i18n={get(format)} />
|
|
675
|
+
{/snippet}
|
|
676
|
+
</Story>
|
|
587
677
|
|
|
588
678
|
<Story
|
|
589
679
|
name="Dataframe with drag selection"
|
|
@@ -658,7 +748,11 @@
|
|
|
658
748
|
|
|
659
749
|
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
660
750
|
}}
|
|
661
|
-
|
|
751
|
+
>
|
|
752
|
+
{#snippet template(args)}
|
|
753
|
+
<Table {...args} i18n={get(format)} />
|
|
754
|
+
{/snippet}
|
|
755
|
+
</Story>
|
|
662
756
|
|
|
663
757
|
<Story
|
|
664
758
|
name="Non-interactive dataframe with sorting by multiple columns"
|
|
@@ -725,7 +819,11 @@
|
|
|
725
819
|
await userEvent.click(cell_menu_button_3);
|
|
726
820
|
await userEvent.click(canvas.getByText("Clear sort"));
|
|
727
821
|
}}
|
|
728
|
-
|
|
822
|
+
>
|
|
823
|
+
{#snippet template(args)}
|
|
824
|
+
<Table {...args} i18n={get(format)} />
|
|
825
|
+
{/snippet}
|
|
826
|
+
</Story>
|
|
729
827
|
|
|
730
828
|
<Story
|
|
731
829
|
name="Dataframe with display values"
|
|
@@ -753,7 +851,11 @@
|
|
|
753
851
|
show_row_numbers: true,
|
|
754
852
|
editable: false
|
|
755
853
|
}}
|
|
756
|
-
|
|
854
|
+
>
|
|
855
|
+
{#snippet template(args)}
|
|
856
|
+
<Table {...args} i18n={get(format)} />
|
|
857
|
+
{/snippet}
|
|
858
|
+
</Story>
|
|
757
859
|
|
|
758
860
|
<Story
|
|
759
861
|
name="Dataframe with text wrapping, no max chars"
|
|
@@ -782,7 +884,11 @@
|
|
|
782
884
|
wrap: true,
|
|
783
885
|
column_widths: ["33%", "33%", "33%"]
|
|
784
886
|
}}
|
|
785
|
-
|
|
887
|
+
>
|
|
888
|
+
{#snippet template(args)}
|
|
889
|
+
<Table {...args} i18n={get(format)} />
|
|
890
|
+
{/snippet}
|
|
891
|
+
</Story>
|
|
786
892
|
|
|
787
893
|
<Story
|
|
788
894
|
name="Dataframe text truncation and wrapping"
|
|
@@ -813,7 +919,11 @@
|
|
|
813
919
|
editable: false,
|
|
814
920
|
column_widths: ["200px", "200px", "200px"]
|
|
815
921
|
}}
|
|
816
|
-
|
|
922
|
+
>
|
|
923
|
+
{#snippet template(args)}
|
|
924
|
+
<Table {...args} i18n={get(format)} />
|
|
925
|
+
{/snippet}
|
|
926
|
+
</Story>
|
|
817
927
|
|
|
818
928
|
<Story
|
|
819
929
|
name="Dataframe column addition test"
|
|
@@ -847,4 +957,8 @@
|
|
|
847
957
|
await user.type(input, "New Column");
|
|
848
958
|
await user.keyboard("{Enter}");
|
|
849
959
|
}}
|
|
850
|
-
|
|
960
|
+
>
|
|
961
|
+
{#snippet template(args)}
|
|
962
|
+
<Table {...args} i18n={get(format)} />
|
|
963
|
+
{/snippet}
|
|
964
|
+
</Story>
|
|
@@ -1,77 +1,71 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import {
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
3
3
|
import StandaloneDataframe from "./standalone/Index.svelte";
|
|
4
|
-
</script>
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
const { Story } = defineMeta({
|
|
6
|
+
title: "Components/Standalone Dataframe",
|
|
7
|
+
component: StandaloneDataframe,
|
|
8
|
+
parameters: {
|
|
9
|
+
test: {
|
|
10
|
+
dangerouslyIgnoreUnhandledErrors: true
|
|
11
|
+
},
|
|
12
|
+
docs: {
|
|
13
|
+
description: {
|
|
14
|
+
component:
|
|
15
|
+
"Standalone DataFrame component that can be used independently outside of Gradio apps. Includes comprehensive CSS variables for theming and dark mode support. Use the dark mode toggle in the toolbar to test dark mode variables."
|
|
16
|
+
}
|
|
17
17
|
}
|
|
18
|
-
}
|
|
19
|
-
}}
|
|
20
|
-
argTypes={{
|
|
21
|
-
interactive: {
|
|
22
|
-
control: "boolean",
|
|
23
|
-
description: "Whether the DataFrame is editable",
|
|
24
|
-
defaultValue: true
|
|
25
|
-
},
|
|
26
|
-
show_label: {
|
|
27
|
-
control: "boolean",
|
|
28
|
-
description: "Whether to show the label",
|
|
29
|
-
defaultValue: true
|
|
30
|
-
},
|
|
31
|
-
label: {
|
|
32
|
-
control: "text",
|
|
33
|
-
description: "Label for the DataFrame",
|
|
34
|
-
defaultValue: "DataFrame"
|
|
35
|
-
},
|
|
36
|
-
max_height: {
|
|
37
|
-
control: "number",
|
|
38
|
-
description: "Maximum height in pixels",
|
|
39
|
-
defaultValue: 500
|
|
40
|
-
},
|
|
41
|
-
show_search: {
|
|
42
|
-
control: "select",
|
|
43
|
-
options: ["none", "search", "filter"],
|
|
44
|
-
description: "Type of search/filter to show",
|
|
45
|
-
defaultValue: "none"
|
|
46
18
|
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
19
|
+
argTypes: {
|
|
20
|
+
interactive: {
|
|
21
|
+
control: "boolean",
|
|
22
|
+
description: "Whether the DataFrame is editable",
|
|
23
|
+
defaultValue: true
|
|
24
|
+
},
|
|
25
|
+
show_label: {
|
|
26
|
+
control: "boolean",
|
|
27
|
+
description: "Whether to show the label",
|
|
28
|
+
defaultValue: true
|
|
29
|
+
},
|
|
30
|
+
label: {
|
|
31
|
+
control: "text",
|
|
32
|
+
description: "Label for the DataFrame",
|
|
33
|
+
defaultValue: "DataFrame"
|
|
34
|
+
},
|
|
35
|
+
max_height: {
|
|
36
|
+
control: "number",
|
|
37
|
+
description: "Maximum height in pixels",
|
|
38
|
+
defaultValue: 500
|
|
39
|
+
},
|
|
40
|
+
show_search: {
|
|
41
|
+
control: "select",
|
|
42
|
+
options: ["none", "search", "filter"],
|
|
43
|
+
description: "Type of search/filter to show",
|
|
44
|
+
defaultValue: "none"
|
|
45
|
+
},
|
|
46
|
+
show_copy_button: {
|
|
47
|
+
control: "boolean",
|
|
48
|
+
description: "Whether to show the copy button",
|
|
49
|
+
defaultValue: false
|
|
50
|
+
},
|
|
51
|
+
show_fullscreen_button: {
|
|
52
|
+
control: "boolean",
|
|
53
|
+
description: "Whether to show the fullscreen button",
|
|
54
|
+
defaultValue: false
|
|
55
|
+
},
|
|
56
|
+
show_row_numbers: {
|
|
57
|
+
control: "boolean",
|
|
58
|
+
description: "Whether to show row numbers",
|
|
59
|
+
defaultValue: false
|
|
60
|
+
},
|
|
61
|
+
wrap: {
|
|
62
|
+
control: "boolean",
|
|
63
|
+
description: "Whether text should wrap or truncate with ellipsis",
|
|
64
|
+
defaultValue: false
|
|
65
|
+
}
|
|
66
66
|
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<Template let:args>
|
|
71
|
-
<div class="standalone-container">
|
|
72
|
-
<StandaloneDataframe {...args} />
|
|
73
|
-
</div>
|
|
74
|
-
</Template>
|
|
67
|
+
});
|
|
68
|
+
</script>
|
|
75
69
|
|
|
76
70
|
<Story
|
|
77
71
|
name="Basic Standalone"
|
|
@@ -96,7 +90,13 @@
|
|
|
96
90
|
show_copy_button: true,
|
|
97
91
|
show_fullscreen_button: true
|
|
98
92
|
}}
|
|
99
|
-
|
|
93
|
+
>
|
|
94
|
+
{#snippet template(args)}
|
|
95
|
+
<div class="standalone-container">
|
|
96
|
+
<StandaloneDataframe {...args} />
|
|
97
|
+
</div>
|
|
98
|
+
{/snippet}
|
|
99
|
+
</Story>
|
|
100
100
|
|
|
101
101
|
<Story
|
|
102
102
|
name="Large Dataset Performance"
|
|
@@ -124,7 +124,13 @@
|
|
|
124
124
|
show_row_numbers: true,
|
|
125
125
|
column_widths: ["120px", "60px", "100px", "80px", "70px", "100px", "70px"]
|
|
126
126
|
}}
|
|
127
|
-
|
|
127
|
+
>
|
|
128
|
+
{#snippet template(args)}
|
|
129
|
+
<div class="standalone-container">
|
|
130
|
+
<StandaloneDataframe {...args} />
|
|
131
|
+
</div>
|
|
132
|
+
{/snippet}
|
|
133
|
+
</Story>
|
|
128
134
|
|
|
129
135
|
<Story
|
|
130
136
|
name="Styled with Custom Colors"
|
|
@@ -165,4 +171,10 @@
|
|
|
165
171
|
max_height: 250,
|
|
166
172
|
show_row_numbers: true
|
|
167
173
|
}}
|
|
168
|
-
|
|
174
|
+
>
|
|
175
|
+
{#snippet template(args)}
|
|
176
|
+
<div class="standalone-container">
|
|
177
|
+
<StandaloneDataframe {...args} />
|
|
178
|
+
</div>
|
|
179
|
+
{/snippet}
|
|
180
|
+
</Story>
|
|
@@ -51,7 +51,7 @@ declare const Table: $$__sveltets_2_IsomorphicComponent<{
|
|
|
51
51
|
styling?: string[][] | null;
|
|
52
52
|
reset_sort_state?: () => void;
|
|
53
53
|
}, {
|
|
54
|
-
fullscreen:
|
|
54
|
+
fullscreen: any;
|
|
55
55
|
change: CustomEvent<DataframeValue>;
|
|
56
56
|
input: CustomEvent<undefined>;
|
|
57
57
|
select: CustomEvent<SelectData>;
|
|
@@ -20,7 +20,7 @@ declare const Toolbar: $$__sveltets_2_IsomorphicComponent<{
|
|
|
20
20
|
on_commit_filter: () => void;
|
|
21
21
|
current_search_query?: string | null;
|
|
22
22
|
}, {
|
|
23
|
-
fullscreen:
|
|
23
|
+
fullscreen: any;
|
|
24
24
|
search: CustomEvent<string | null>;
|
|
25
25
|
} & {
|
|
26
26
|
[evt: string]: CustomEvent<any>;
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
label={i18n("dataframe.sort_ascending")}
|
|
24
24
|
Icon={SortButtonUp}
|
|
25
25
|
highlight={direction === "asc"}
|
|
26
|
-
|
|
26
|
+
onclick={(event) => {
|
|
27
27
|
event.stopPropagation();
|
|
28
28
|
dispatch("sort", "asc");
|
|
29
29
|
}}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
label={i18n("dataframe.sort_descending")}
|
|
34
34
|
Icon={SortButtonDown}
|
|
35
35
|
highlight={direction === "desc"}
|
|
36
|
-
|
|
36
|
+
onclick={(event) => {
|
|
37
37
|
event.stopPropagation();
|
|
38
38
|
dispatch("sort", "desc");
|
|
39
39
|
}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/dataframe",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.4",
|
|
4
4
|
"description": "Gradio UI packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "",
|
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
"@types/katex": "^0.16.7",
|
|
14
14
|
"d3-dsv": "^3.0.1",
|
|
15
15
|
"dequal": "^2.0.3",
|
|
16
|
-
"@gradio/atoms": "^0.
|
|
17
|
-
"@gradio/
|
|
18
|
-
"@gradio/
|
|
19
|
-
"@gradio/client": "^2.0.
|
|
20
|
-
"@gradio/icons": "^0.15.
|
|
21
|
-
"@gradio/statustracker": "^0.12.
|
|
22
|
-
"@gradio/
|
|
23
|
-
"@gradio/
|
|
24
|
-
"@gradio/utils": "^0.11.
|
|
16
|
+
"@gradio/atoms": "^0.21.0",
|
|
17
|
+
"@gradio/button": "^0.6.3",
|
|
18
|
+
"@gradio/checkbox": "^0.6.2",
|
|
19
|
+
"@gradio/client": "^2.0.4",
|
|
20
|
+
"@gradio/icons": "^0.15.1",
|
|
21
|
+
"@gradio/statustracker": "^0.12.3",
|
|
22
|
+
"@gradio/upload": "^0.17.5",
|
|
23
|
+
"@gradio/markdown-code": "^0.6.1",
|
|
24
|
+
"@gradio/utils": "^0.11.2"
|
|
25
25
|
},
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"svelte": ">=5.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@gradio/preview": "^0.15.
|
|
43
|
+
"@gradio/preview": "^0.15.2",
|
|
44
44
|
"@gradio/dataframe-interim": "^0.21.0"
|
|
45
45
|
},
|
|
46
46
|
"repository": {
|
package/shared/Toolbar.svelte
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
label={i18n("dataframe.sort_ascending")}
|
|
24
24
|
Icon={SortButtonUp}
|
|
25
25
|
highlight={direction === "asc"}
|
|
26
|
-
|
|
26
|
+
onclick={(event) => {
|
|
27
27
|
event.stopPropagation();
|
|
28
28
|
dispatch("sort", "asc");
|
|
29
29
|
}}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
label={i18n("dataframe.sort_descending")}
|
|
34
34
|
Icon={SortButtonDown}
|
|
35
35
|
highlight={direction === "desc"}
|
|
36
|
-
|
|
36
|
+
onclick={(event) => {
|
|
37
37
|
event.stopPropagation();
|
|
38
38
|
dispatch("sort", "desc");
|
|
39
39
|
}}
|