|
39 | 39 | import SecretVariableModal from './secretVariableModal.svelte'; |
40 | 40 | import { Confirm } from '$lib/components'; |
41 | 41 | import { resolveRoute, withPath } from '$lib/stores/navigation'; |
| 42 | + import { isSmallViewport } from '$lib/stores/viewport'; |
42 | 43 |
|
43 | 44 | export let project: Models.Project; |
44 | 45 | export let variableList: Models.VariableList; |
|
266 | 267 | }); |
267 | 268 | }) |
268 | 269 | : false; |
| 270 | +
|
| 271 | + $: variableColumns = $isSmallViewport |
| 272 | + ? [ |
| 273 | + { id: 'key', width: { min: 380, max: 520 } }, |
| 274 | + { id: 'value', width: { min: 200, max: 320 } }, |
| 275 | + { id: 'actions', width: 50 } |
| 276 | + ] |
| 277 | + : [ |
| 278 | + { id: 'key', width: { min: 280, max: 420 } }, |
| 279 | + { id: 'value', width: { min: 200, max: 400 } }, |
| 280 | + { id: 'actions', width: 50 } |
| 281 | + ]; |
269 | 282 | </script> |
270 | 283 |
|
271 | 284 | <CardGrid> |
|
288 | 301 | {/if} |
289 | 302 | <svelte:fragment slot="aside"> |
290 | 303 | <Layout.Stack gap="l"> |
291 | | - <Layout.Stack direction="row"> |
292 | | - <Layout.Stack direction="row" gap="s"> |
| 304 | + <Layout.Stack direction="row" gap="s" wrap={$isSmallViewport ? 'wrap' : 'nowrap'}> |
| 305 | + <Layout.Stack direction="row" gap="s" wrap={$isSmallViewport ? 'wrap' : 'nowrap'}> |
293 | 306 | <Button |
294 | 307 | secondary |
295 | 308 | on:mousedown={() => { |
|
345 | 358 | </p> |
346 | 359 | </Alert.Inline> |
347 | 360 | {/if} |
348 | | - <Table.Root |
349 | | - columns={[ |
350 | | - { id: 'key', width: { min: 200, max: 400 } }, |
351 | | - { id: 'value', width: { min: 200, max: 400 } }, |
352 | | - { id: 'actions', width: 50 } |
353 | | - ]} |
354 | | - let:root> |
| 361 | + <Table.Root class="responsive-table" columns={variableColumns} let:root> |
355 | 362 | <svelte:fragment slot="header" let:root> |
356 | 363 | <Table.Header.Cell column="key" {root}>Key</Table.Header.Cell> |
357 | 364 | <Table.Header.Cell column="value" {root}>Value</Table.Header.Cell> |
|
366 | 373 | ) !== undefined |
367 | 374 | : false} |
368 | 375 |
|
369 | | - <Layout.Stack gap="xxs" alignItems="center" direction="row"> |
| 376 | + <Layout.Stack |
| 377 | + gap="xxs" |
| 378 | + alignItems="center" |
| 379 | + direction="row" |
| 380 | + class="variable-key-cell"> |
370 | 381 | {#if isConflicting && hasConflictOnPage} |
371 | 382 | <span |
372 | 383 | class="icon-exclamation u-color-text-warning" |
|
526 | 537 | <p>Are you sure you want to delete this variable? This action is irreversible.</p> |
527 | 538 | </Confirm> |
528 | 539 | {/if} |
| 540 | + |
| 541 | +<style> |
| 542 | + :global(.variable-key-cell) { |
| 543 | + min-width: 0; |
| 544 | + } |
| 545 | +
|
| 546 | + :global(.variable-key-cell > :last-child) { |
| 547 | + min-width: 0; |
| 548 | + overflow: hidden; |
| 549 | + text-overflow: ellipsis; |
| 550 | + white-space: nowrap; |
| 551 | + } |
| 552 | +</style> |
0 commit comments