This commit is contained in:
Andrew Kingston 2024-08-12 14:01:33 +01:00
parent 51db5ac9a9
commit 47e4c668ec
No known key found for this signature in database
3 changed files with 6 additions and 4 deletions

View File

@ -5,7 +5,7 @@
import { memo } from "@budibase/frontend-core"
const component = getContext("component")
const { styleable, builderStore } = getContext("sdk")
const { styleable } = getContext("sdk")
const context = getContext("context")
let width
@ -127,7 +127,7 @@
data-cols={GridColumns}
data-col-size={colSize}
>
{#if $builderStore.inBuilder}
{#if inBuilder}
<div class="underlay">
{#each { length: GridColumns * rows } as _, idx}
<div class="placeholder" class:first-col={idx % GridColumns === 0} />

View File

@ -14,6 +14,7 @@
// Offset = 6 (clip-root padding) - 1 (half the border thickness)
const config = memo($$props)
const errorColor = "var(--spectrum-global-color-static-red-600)"
const observer = new MutationObserver(() => debouncedUpdate())
const defaultState = () => ({
// Cached props
componentId,
@ -54,8 +55,6 @@
// Observe style changes
$: observeChanges(componentId)
const observer = new MutationObserver(() => debouncedUpdate())
const observeChanges = id => {
observer.disconnect()
observing = false

View File

@ -135,6 +135,9 @@ export const gridLayout = (node, metadata) => {
addDataTag("gridMobileHAlign", Devices.Mobile, GridParams.HAlign)
addDataTag("gridDesktopVAlign", Devices.Desktop, GridParams.VAlign)
addDataTag("gridMobileVAlign", Devices.Mobile, GridParams.VAlign)
if (node.dataset.insideGrid !== true) {
node.dataset.insideGrid = true
}
// Apply all CSS variables to the wrapper
node.style = buildStyleString(vars)