Type ComponentErrorState
This commit is contained in:
parent
566da4b2a3
commit
da1f1177db
|
@ -1,14 +1,17 @@
|
||||||
<script>
|
<script lang="ts">
|
||||||
import { getContext } from "svelte"
|
import { getContext } from "svelte"
|
||||||
import { Icon } from "@budibase/bbui"
|
import { Icon } from "@budibase/bbui"
|
||||||
import MissingRequiredSetting from "./MissingRequiredSetting.svelte"
|
import MissingRequiredSetting from "./MissingRequiredSetting.svelte"
|
||||||
import MissingRequiredAncestor from "./MissingRequiredAncestor.svelte"
|
import MissingRequiredAncestor from "./MissingRequiredAncestor.svelte"
|
||||||
|
import { Component, SDK } from "../../index"
|
||||||
|
|
||||||
export let missingRequiredSettings
|
export let missingRequiredSettings:
|
||||||
export let missingRequiredAncestors
|
| { key: string; label: string }[]
|
||||||
|
| undefined
|
||||||
|
export let missingRequiredAncestors: string[] | undefined
|
||||||
|
|
||||||
const component = getContext("component")
|
const component = getContext<Component>("component")
|
||||||
const { styleable, builderStore } = getContext("sdk")
|
const { styleable, builderStore } = getContext<SDK>("sdk")
|
||||||
|
|
||||||
$: styles = { ...$component.styles, normal: {}, custom: null, empty: true }
|
$: styles = { ...$component.styles, normal: {}, custom: null, empty: true }
|
||||||
$: requiredSetting = missingRequiredSettings?.[0]
|
$: requiredSetting = missingRequiredSettings?.[0]
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { APIClient } from "@budibase/frontend-core"
|
import { APIClient } from "@budibase/frontend-core"
|
||||||
import type { ActionTypes } from "./constants"
|
import type { ActionTypes } from "./constants"
|
||||||
import { Readable } from "svelte/store"
|
import { Readable, Writable } from "svelte/store"
|
||||||
|
|
||||||
export interface SDK {
|
export interface SDK {
|
||||||
API: APIClient
|
API: APIClient
|
||||||
|
@ -9,11 +9,15 @@ export interface SDK {
|
||||||
ActionTypes: typeof ActionTypes
|
ActionTypes: typeof ActionTypes
|
||||||
fetchDatasourceSchema: any
|
fetchDatasourceSchema: any
|
||||||
generateGoldenSample: any
|
generateGoldenSample: any
|
||||||
|
builderStore: Readable<{
|
||||||
|
inBuilder: boolean
|
||||||
|
}>
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Component = Readable<{
|
export type Component = Writable<{
|
||||||
id: string
|
id: string
|
||||||
styles: any
|
styles: any
|
||||||
|
errorState: string
|
||||||
}>
|
}>
|
||||||
|
|
||||||
export type Context = Readable<any>
|
export type Context = Readable<any>
|
||||||
|
|
Loading…
Reference in New Issue