Add bold and code cell renderers

This commit is contained in:
Rory Powell 2021-12-21 14:08:09 -05:00
parent 6904e6a1df
commit 5890f5d4dc
4 changed files with 26 additions and 2 deletions

View File

@ -0,0 +1,11 @@
<script>
export let value
</script>
<div class="bold">{value}</div>
<style>
.bold {
font-weight: bold;
}
</style>

View File

@ -0,0 +1,5 @@
<script>
export let value
</script>
<code>{value}</code>

View File

@ -61,6 +61,10 @@ export { default as ColorPicker } from "./ColorPicker/ColorPicker.svelte"
export { default as InlineAlert } from "./InlineAlert/InlineAlert.svelte" export { default as InlineAlert } from "./InlineAlert/InlineAlert.svelte"
export { default as Banner } from "./Banner/Banner.svelte" export { default as Banner } from "./Banner/Banner.svelte"
// Renderers
export { default as BoldRenderer } from "./Table/BoldRenderer.svelte"
export { default as CodeRenderer } from "./Table/CodeRenderer.svelte"
// Typography // Typography
export { default as Body } from "./Typography/Body.svelte" export { default as Body } from "./Typography/Body.svelte"
export { default as Heading } from "./Typography/Heading.svelte" export { default as Heading } from "./Typography/Heading.svelte"

View File

@ -1,5 +1,5 @@
<script> <script>
import { Body, Table } from "@budibase/bbui" import { Body, Table, BoldRenderer, CodeRenderer } from "@budibase/bbui"
import { queries as queriesStore } from "stores/backend" import { queries as queriesStore } from "stores/backend"
import { goto } from "@roxi/routify" import { goto } from "@roxi/routify"
@ -12,8 +12,8 @@
const dynamicVariableSchema = { const dynamicVariableSchema = {
name: "", name: "",
value: "",
query: "", query: "",
value: "",
} }
const onClick = dynamicVariable => { const onClick = dynamicVariable => {
@ -43,5 +43,9 @@
allowEditColumns={false} allowEditColumns={false}
allowEditRows={false} allowEditRows={false}
allowSelectRows={false} allowSelectRows={false}
customRenderers={[
{ column: "name", component: BoldRenderer },
{ column: "value", component: CodeRenderer },
]}
/> />
<Body size="S" /> <Body size="S" />