|
20 | 20 | import Spinner from "./widgets/Spinner.svelte"; |
21 | 21 |
|
22 | 22 | import { |
| 23 | + IconClose, |
23 | 24 | IconDarkMode, |
24 | 25 | IconDashboardLayout, |
25 | 26 | IconDownload, |
|
370 | 371 | {/if} |
371 | 372 | </div> |
372 | 373 | <!-- Right side --> |
373 | | - <div class="flex flex-none gap-2 items-center"> |
| 374 | + <div |
| 375 | + class="flex flex-none gap-2 items-center pl-2 rounded-md border border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-900" |
| 376 | + > |
374 | 377 | <FilteredCount coordinator={coordinator} filter={crossFilter} table={data.table} /> |
375 | | - <div class="flex flex-row gap-1 items-center"> |
| 378 | + <div class="flex flex-row items-center"> |
376 | 379 | <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 | 380 | title="Clear filters" |
| 381 | + onclick={resetFilter} |
| 382 | + class="rounded-md flex select-none items-center p-1.5 text-slate-400 dark:text-slate-500 focus-visible:outline-2 outline-blue-600 -outline-offset-1" |
380 | 383 | > |
381 | | - Clear |
| 384 | + <IconClose class="w-5 h-5" /> |
382 | 385 | </button> |
| 386 | + |
| 387 | + {#if onExportSelection} |
| 388 | + <PopupButton title="Export Selection"> |
| 389 | + {#snippet button({ visible, toggle })} |
| 390 | + <button |
| 391 | + title="Export Selection" |
| 392 | + onclick={toggle} |
| 393 | + class="rounded-md px-1.5 py-1.5 flex select-none items-center focus-visible:outline-2 outline-blue-600 -outline-offset-1" |
| 394 | + class:text-slate-400={!visible} |
| 395 | + class:dark:text-slate-500={!visible} |
| 396 | + > |
| 397 | + <IconExport class="w-5 h-5" /> |
| 398 | + </button> |
| 399 | + {/snippet} |
| 400 | + <div class="min-w-[420px] flex flex-col gap-2"> |
| 401 | + <div class="flex flex-row gap-2"> |
| 402 | + <ActionButton |
| 403 | + icon={IconExport} |
| 404 | + label="Export Selection" |
| 405 | + title="Export the selected points" |
| 406 | + class="w-48" |
| 407 | + onClick={() => onExportSelection(currentPredicate(), exportFormat)} |
| 408 | + /> |
| 409 | + <Select |
| 410 | + label="Format" |
| 411 | + value={exportFormat} |
| 412 | + onChange={(v) => (exportFormat = v)} |
| 413 | + options={[ |
| 414 | + { value: "parquet", label: "Parquet" }, |
| 415 | + { value: "jsonl", label: "JSONL" }, |
| 416 | + { value: "json", label: "JSON" }, |
| 417 | + { value: "csv", label: "CSV" }, |
| 418 | + ]} |
| 419 | + /> |
| 420 | + </div> |
| 421 | + </div> |
| 422 | + </PopupButton> |
| 423 | + {/if} |
383 | 424 | </div> |
384 | 425 | </div> |
385 | | - <div class="flex flex-none flex-row gap-0.5"> |
| 426 | + |
| 427 | + <div class="flex flex-none flex-row gap-2"> |
386 | 428 | <div class="grid grid-cols-1 grid-rows-1 justify-items-end items-center"> |
387 | 429 | {#key layout} |
388 | 430 | <div transition:scale class="col-start-1 row-start-1"> |
|
429 | 471 | }} |
430 | 472 | /> |
431 | 473 | {/if} |
432 | | - <!-- Export --> |
433 | | - {#if onExportSelection || onExportApplication} |
| 474 | + <!-- Export Application --> |
| 475 | + {#if onExportApplication} |
434 | 476 | <h4 class="text-slate-500 dark:text-slate-400 select-none">Export</h4> |
435 | 477 | <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} |
| 478 | + <ActionButton |
| 479 | + icon={IconDownload} |
| 480 | + label="Export Application" |
| 481 | + title="Download a self-contained static web application" |
| 482 | + class="w-48" |
| 483 | + onClick={onExportApplication} |
| 484 | + /> |
467 | 485 | </div> |
468 | 486 | {/if} |
469 | 487 | <h4 class="text-slate-500 dark:text-slate-400 select-none">About</h4> |
|
0 commit comments