1
0
Fork 0
mirror of synced 2024-09-21 03:43:21 +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 // Metadata to pass into grid action to apply CSS
const checkGrid = x => const checkGrid = x =>
x?._component.endsWith("/container") && x?.layout === "grid" x?._component?.endsWith("/container") && x?.layout === "grid"
$: insideGrid = checkGrid(parent) $: insideGrid = checkGrid(parent)
$: isGrid = checkGrid(instance) $: isGrid = checkGrid(instance)
$: gridMetadata = { $: gridMetadata = {

View file

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

View file

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