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" import { memo } from "@budibase/frontend-core"
const component = getContext("component") const component = getContext("component")
const { styleable, builderStore } = getContext("sdk") const { styleable } = getContext("sdk")
const context = getContext("context") const context = getContext("context")
let width let width
@ -127,7 +127,7 @@
data-cols={GridColumns} data-cols={GridColumns}
data-col-size={colSize} data-col-size={colSize}
> >
{#if $builderStore.inBuilder} {#if inBuilder}
<div class="underlay"> <div class="underlay">
{#each { length: GridColumns * rows } as _, idx} {#each { length: GridColumns * rows } as _, idx}
<div class="placeholder" class:first-col={idx % GridColumns === 0} /> <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) // Offset = 6 (clip-root padding) - 1 (half the border thickness)
const config = memo($$props) const config = memo($$props)
const errorColor = "var(--spectrum-global-color-static-red-600)" const errorColor = "var(--spectrum-global-color-static-red-600)"
const observer = new MutationObserver(() => debouncedUpdate())
const defaultState = () => ({ const defaultState = () => ({
// Cached props // Cached props
componentId, componentId,
@ -54,8 +55,6 @@
// Observe style changes // Observe style changes
$: observeChanges(componentId) $: observeChanges(componentId)
const observer = new MutationObserver(() => debouncedUpdate())
const observeChanges = id => { const observeChanges = id => {
observer.disconnect() observer.disconnect()
observing = false observing = false

View File

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