1
0
Fork 0
mirror of synced 2024-09-20 19:33:10 +12:00

Merge branch 'master' of github.com:Budibase/budibase into new-data-ui

This commit is contained in:
Andrew Kingston 2024-09-06 08:57:08 +01:00
commit 7121a0f157
No known key found for this signature in database
3 changed files with 6 additions and 12 deletions

View file

@ -201,7 +201,7 @@
// Metadata to pass into grid action to apply CSS
const checkGrid = x =>
x?._component.endsWith("/container") && x?.layout === "grid"
x?._component?.endsWith("/container") && x?.layout === "grid"
$: insideGrid = checkGrid(parent)
$: isGrid = checkGrid(instance)
$: gridMetadata = {

View file

@ -14,7 +14,6 @@
// Get the screen definition for the current route
$: screen = $screenStore.activeScreen
$: screenDefinition = { ...screen?.props, addEmptyRows: true }
$: onLoadActions.set(screen?.onLoad)
$: runOnLoadActions($onLoadActions, params)
@ -42,10 +41,10 @@
</script>
<!-- Ensure to fully remount when screen changes -->
{#if $routeStore.routerLoaded}
{#key screenDefinition?._id}
{#if $routeStore.routerLoaded && screen?.props}
{#key screen.props._id}
<Provider key="url" data={params}>
<Component isRoot instance={screenDefinition} />
<Component isRoot instance={screen.props} />
</Provider>
{/key}
{/if}

View file

@ -4,8 +4,6 @@
import { GridRowHeight, GridColumns } from "constants"
import { memo } from "@budibase/frontend-core"
export let addEmptyRows = false
const component = getContext("component")
const { styleable, builderStore } = getContext("sdk")
const context = getContext("context")
@ -18,11 +16,8 @@
let styles = memo({})
$: inBuilder = $builderStore.inBuilder
$: requiredRows = calculateRequiredRows(
$children,
mobile,
addEmptyRows && inBuilder
)
$: addEmptyRows = $component.isRoot && inBuilder
$: requiredRows = calculateRequiredRows($children, mobile, addEmptyRows)
$: requiredHeight = requiredRows * GridRowHeight
$: availableRows = Math.floor(height / GridRowHeight)
$: rows = Math.max(requiredRows, availableRows)