|
373 | 373 | <div class="flex flex-none gap-2 items-center"> |
374 | 374 | <FilteredCount coordinator={coordinator} filter={crossFilter} table={data.table} /> |
375 | 375 | <div class="flex flex-row gap-1 items-center"> |
376 | | - <button |
377 | | - class="flex px-2.5 mr-1 select-none items-center justify-center text-slate-500 dark:text-slate-300 rounded-full bg-white dark:bg-slate-900 border border-slate-300 dark:border-slate-600 focus-visible:outline-2 outline-blue-600 -outline-offset-1" |
378 | | - onclick={resetFilter} |
379 | | - title="Clear filters" |
380 | | - > |
381 | | - Clear |
382 | | - </button> |
| 376 | + <Button label="Clear" title="Clear filters" onClick={resetFilter} /> |
| 377 | + |
| 378 | + {#if onExportSelection} |
| 379 | + <PopupButton label="Export" title="Export Selection"> |
| 380 | + <div class="min-w-[420px] flex flex-col gap-2"> |
| 381 | + <div class="flex flex-row gap-2"> |
| 382 | + <ActionButton |
| 383 | + icon={IconExport} |
| 384 | + label="Export Selection" |
| 385 | + title="Export the selected points" |
| 386 | + class="w-48" |
| 387 | + onClick={() => onExportSelection(currentPredicate(), exportFormat)} |
| 388 | + /> |
| 389 | + <Select |
| 390 | + label="Format" |
| 391 | + value={exportFormat} |
| 392 | + onChange={(v) => (exportFormat = v)} |
| 393 | + options={[ |
| 394 | + { value: "parquet", label: "Parquet" }, |
| 395 | + { value: "jsonl", label: "JSONL" }, |
| 396 | + { value: "json", label: "JSON" }, |
| 397 | + { value: "csv", label: "CSV" }, |
| 398 | + ]} |
| 399 | + /> |
| 400 | + </div> |
| 401 | + </div> |
| 402 | + </PopupButton> |
| 403 | + {/if} |
383 | 404 | </div> |
384 | 405 | </div> |
| 406 | + |
385 | 407 | <div class="flex flex-none flex-row gap-2"> |
386 | 408 | <div class="grid grid-cols-1 grid-rows-1 justify-items-end items-center"> |
387 | 409 | {#key layout} |
|
429 | 451 | }} |
430 | 452 | /> |
431 | 453 | {/if} |
432 | | - <!-- Export --> |
433 | | - {#if onExportSelection || onExportApplication} |
| 454 | + <!-- Export Application --> |
| 455 | + {#if onExportApplication} |
434 | 456 | <h4 class="text-slate-500 dark:text-slate-400 select-none">Export</h4> |
435 | 457 | <div class="flex flex-col gap-2"> |
436 | | - {#if onExportSelection} |
437 | | - <div class="flex flex-row gap-2"> |
438 | | - <ActionButton |
439 | | - icon={IconExport} |
440 | | - label="Export Selection" |
441 | | - title="Export the selected points" |
442 | | - class="w-48" |
443 | | - onClick={() => onExportSelection(currentPredicate(), exportFormat)} |
444 | | - /> |
445 | | - <Select |
446 | | - label="Format" |
447 | | - value={exportFormat} |
448 | | - onChange={(v) => (exportFormat = v)} |
449 | | - options={[ |
450 | | - { value: "parquet", label: "Parquet" }, |
451 | | - { value: "jsonl", label: "JSONL" }, |
452 | | - { value: "json", label: "JSON" }, |
453 | | - { value: "csv", label: "CSV" }, |
454 | | - ]} |
455 | | - /> |
456 | | - </div> |
457 | | - {/if} |
458 | | - {#if onExportApplication} |
459 | | - <ActionButton |
460 | | - icon={IconDownload} |
461 | | - label="Export Application" |
462 | | - title="Download a self-contained static web application" |
463 | | - class="w-48" |
464 | | - onClick={onExportApplication} |
465 | | - /> |
466 | | - {/if} |
| 458 | + <ActionButton |
| 459 | + icon={IconDownload} |
| 460 | + label="Export Application" |
| 461 | + title="Download a self-contained static web application" |
| 462 | + class="w-48" |
| 463 | + onClick={onExportApplication} |
| 464 | + /> |
467 | 465 | </div> |
468 | 466 | {/if} |
469 | 467 | <h4 class="text-slate-500 dark:text-slate-400 select-none">About</h4> |
|
0 commit comments