Migrate plotgrid, adapt parent components with new snippets

This commit is contained in:
Christoph Kluge
2025-06-25 18:19:24 +02:00
parent 79a6c9e90d
commit db5f6c7540
7 changed files with 96 additions and 92 deletions

View File

@@ -12,26 +12,19 @@
Col,
} from "@sveltestrap/sveltestrap";
export let itemsPerRow
export let items
/* Migtation Notes
* Requirements
* - Parent Components must be already Migrated
* - TODO: Job.root.svelte, Node.root.svelte
* - DONE: Analysis, Status, User
*
* How-To
* - Define "Plot-Slotcode" as SV5 Snippet with argument "item" in parent (!)
* - Pass new snippet as argument/prop to here
* - @render snippet in items-loop with argument == item
*/
/* Svelte 5 Props */
let {
items,
itemsPerRow,
gridContent
} = $props();
</script>
<Row cols={{ xs: 1, sm: 2, md: 3, lg: itemsPerRow}}>
{#each items as item}
<Col class="px-1">
<slot {item}/>
<!-- Note: Ignore '@' Error in IDE -->
{@render gridContent(item)}
</Col>
{/each}
</Row>

View File

@@ -182,6 +182,6 @@
</script>
<div class="cc-plot">
<canvas bind:this={canvasElement} width="{width}" height="{height}"></canvas>
<div class="cc-plot" bind:clientWidth={width}>
<canvas bind:this={canvasElement} {width} {height}></canvas>
</div>