PR feedback
This commit is contained in:
parent
f0feed9cd9
commit
64951d6f29
|
@ -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}
|
||||
|
|
|
@ -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 />
|
||||
|
|
Loading…
Reference in New Issue