1
0
Fork 0
mirror of synced 2024-07-06 15:00:49 +12:00

PR feedback

This commit is contained in:
Dean 2024-01-22 09:44:57 +00:00
parent f0feed9cd9
commit 64951d6f29
2 changed files with 6 additions and 7 deletions

View file

@ -2,6 +2,7 @@
import { getContext } from "svelte"
import Placeholder from "./Placeholder.svelte"
import Container from "./Container.svelte"
import { ContextScopes } from "constants"
export let dataProvider
export let noRowsMessage
@ -9,9 +10,9 @@
export let hAlign
export let vAlign
export let gap
export let nested = false
export let scope = ContextScopes.Local
const { Provider, ContextScopes } = getContext("sdk")
const { Provider } = getContext("sdk")
const component = getContext("component")
$: rows = dataProvider?.rows ?? []
@ -23,10 +24,7 @@
<Placeholder />
{:else if rows.length > 0}
{#each rows as row, index}
<Provider
data={{ ...row, index }}
scope={nested ? ContextScopes.Global : ContextScopes.Local}
>
<Provider data={{ ...row, index }} {scope}>
<slot />
</Provider>
{/each}

View file

@ -10,6 +10,7 @@
export let noRowsMessage
const component = getContext("component")
const { ContextScopes } = getContext("sdk")
$: providerId = `${$component.id}-provider`
$: dataProvider = `{{ literal ${safe(providerId)} }}`
@ -55,7 +56,7 @@
noRowsMessage: noRowsMessage || "We couldn't find a row to display",
direction: "column",
hAlign: "center",
nested: true,
scope: ContextScopes.Global,
}}
>
<slot />