forked from tsai/budibase
60 changed files with 14330 additions and 18030 deletions
@ -1,15 +1,15 @@ |
|||||
export const rootComponent = window => { |
export const rootComponent = window => { |
||||
return function(opts) { |
return function(opts) { |
||||
const node = window.document.createElement("DIV") |
const node = window.document.createElement("DIV") |
||||
const $set = props => { |
const $set = props => { |
||||
props._bb.hydrateChildren(props._children, node) |
props._bb.attachChildren(node) |
||||
} |
|
||||
const $destroy = () => { |
|
||||
if (opts.target && node) opts.target.removeChild(node) |
|
||||
} |
|
||||
this.$set = $set |
|
||||
this.$set(opts.props) |
|
||||
this.$destroy = $destroy |
|
||||
opts.target.appendChild(node) |
|
||||
} |
} |
||||
} |
const $destroy = () => { |
||||
|
if (opts.target && node) opts.target.removeChild(node) |
||||
|
} |
||||
|
this.$set = $set |
||||
|
this.$set(opts.props) |
||||
|
this.$destroy = $destroy |
||||
|
opts.target.appendChild(node) |
||||
|
} |
||||
|
} |
||||
|
|||||
@ -1,2 +1,2 @@ |
|||||
window['##BUDIBASE_APPDEFINITION##'] = {"hierarchy":{"name":"root","type":"root","children":[{"name":"customer","type":"record","fields":[{"name":"name","type":"string","typeOptions":{"maxLength":1000,"values":null,"allowDeclaredValuesOnly":false},"label":"name","getInitialValue":"default","getUndefinedValue":"default"}],"children":[{"name":"invoiceyooo","type":"record","fields":[{"name":"amount","type":"number","typeOptions":{"minValue":99999999999,"maxValue":99999999999,"decimalPlaces":2},"label":"amount","getInitialValue":"default","getUndefinedValue":"default"}],"children":[],"validationRules":[],"nodeId":2,"indexes":[],"allidsShardFactor":1,"collectionName":"invoices","isSingle":false}],"validationRules":[],"nodeId":1,"indexes":[],"allidsShardFactor":64,"collectionName":"customers","isSingle":false}],"pathMaps":[],"indexes":[],"nodeId":0},"componentLibraries":[{"importPath":"/lib/customComponents/index.js","libName":"./customComponents"},{"importPath":"/lib/moreCustomComponents/index.js","libName":"./moreCustomComponents"}],"appRootPath":"","page":{"title":"Test App","favicon":"./_shared/favicon.png","stylesheets":["my-styles.css"],"componentLibraries":["./customComponents","./moreCustomComponents"],"props":{"_component":"@budibase/standard-components/div"}},"screens":[{"name":"screen1","description":"","props":{"_component":"@budibase/standard-components/div","className":""},"_css":"/css/d121e1ecc6cf44f433213222e9ff5d40.css"},{"name":"screen2","description":"","props":{"_component":"@budibase/standard-components/div","className":""},"_css":"/css/7b7c05b78e05c06eb8d69475caadfea3.css"}]}; |
window['##BUDIBASE_APPDEFINITION##'] = {"hierarchy":{"name":"root","type":"root","children":[{"name":"customer","type":"record","fields":[{"name":"name","type":"string","typeOptions":{"maxLength":1000,"values":null,"allowDeclaredValuesOnly":false},"label":"name","getInitialValue":"default","getUndefinedValue":"default"}],"children":[{"name":"invoiceyooo","type":"record","fields":[{"name":"amount","type":"number","typeOptions":{"minValue":99999999999,"maxValue":99999999999,"decimalPlaces":2},"label":"amount","getInitialValue":"default","getUndefinedValue":"default"}],"children":[],"validationRules":[],"nodeId":2,"indexes":[],"allidsShardFactor":1,"collectionName":"invoices","isSingle":false}],"validationRules":[],"nodeId":1,"indexes":[],"allidsShardFactor":64,"collectionName":"customers","isSingle":false}],"pathMaps":[],"indexes":[],"nodeId":0},"componentLibraries":[{"importPath":"/lib/customComponents/index.js","libName":"./customComponents"},{"importPath":"/lib/moreCustomComponents/index.js","libName":"./moreCustomComponents"}],"appRootPath":"","page":{"title":"Test App","favicon":"./_shared/favicon.png","stylesheets":["my-styles.css"],"componentLibraries":["./customComponents","./moreCustomComponents"],"props":{"_component":"@budibase/standard-components/container"}},"screens":[{"name":"screen1","description":"","props":{"_component":"@budibase/standard-components/container","className":""},"_css":"/css/d121e1ecc6cf44f433213222e9ff5d40.css"},{"name":"screen2","description":"","props":{"_component":"@budibase/standard-components/container","className":""},"_css":"/css/7b7c05b78e05c06eb8d69475caadfea3.css"}]}; |
||||
window['##BUDIBASE_UIFUNCTIONS##'] = {'1234':() => 'test return'} |
window['##BUDIBASE_UIFUNCTIONS##'] = {'1234':() => 'test return'} |
||||
@ -1,2 +1,2 @@ |
|||||
window['##BUDIBASE_FRONTEND_DEINITION##'] = {"componentLibraries":[{"importPath":"/lib/customComponents/index.js","libName":"./customComponents"},{"importPath":"/lib/moreCustomComponents/index.js","libName":"./moreCustomComponents"}],"appRootPath":"","page":{"title":"Test App","favicon":"./_shared/favicon.png","stylesheets":["my-styles.css"],"componentLibraries":["./customComponents","./moreCustomComponents"],"props":{"_component":"@budibase/standard-components/div"}},"screens":[{"name":"screen1","description":"","props":{"_component":"@budibase/standard-components/div","className":""},"_css":"/css/d121e1ecc6cf44f433213222e9ff5d40.css"},{"name":"screen2","description":"","props":{"_component":"@budibase/standard-components/div","className":""},"_css":"/css/7b7c05b78e05c06eb8d69475caadfea3.css"}]}; |
window['##BUDIBASE_FRONTEND_DEINITION##'] = {"componentLibraries":[{"importPath":"/lib/customComponents/index.js","libName":"./customComponents"},{"importPath":"/lib/moreCustomComponents/index.js","libName":"./moreCustomComponents"}],"appRootPath":"","page":{"title":"Test App","favicon":"./_shared/favicon.png","stylesheets":["my-styles.css"],"componentLibraries":["./customComponents","./moreCustomComponents"],"props":{"_component":"@budibase/standard-components/container"}},"screens":[{"name":"screen1","description":"","props":{"_component":"@budibase/standard-components/container","className":""},"_css":"/css/d121e1ecc6cf44f433213222e9ff5d40.css"},{"name":"screen2","description":"","props":{"_component":"@budibase/standard-components/container","className":""},"_css":"/css/7b7c05b78e05c06eb8d69475caadfea3.css"}]}; |
||||
window['##BUDIBASE_FRONTEND_FUNCTIONS##'] = {'1234':() => 'test return'} |
window['##BUDIBASE_FRONTEND_FUNCTIONS##'] = {'1234':() => 'test return'} |
||||
File diff suppressed because one or more lines are too long
@ -1,8 +1,7 @@ |
|||||
#current_component.svelte-uuhis1{height:100%;width:100%} |
#current_component.svelte-1u0yzf5{height:100%;width:100%} |
||||
.root.svelte-aihwli{height:100%;width:100%;grid-template-columns:[navbar] auto [content] 1fr;display:grid}.navbar.svelte-aihwli{grid-column:navbar;background:var(--navBarBackground);border:var(--navBarBorder);color:var(--navBarColor)}.navitem.svelte-aihwli{padding:10px 17px;cursor:pointer}.navitem.svelte-aihwli:hover{background:var(--itemHoverBackground);color:var(--itemHoverColor)}.navitem.selected.svelte-aihwli{background:var(--selectedItemBackground);border:var(--selectedItemBorder);color:var(--selectedItemColor)}.content.svelte-aihwli{grid-column:content} |
.root.svelte-x36wrk{height:100%;display:grid;grid-template-columns:[left] 1fr [middle] auto [right] 1fr;grid-template-rows:[top] 1fr [center] auto [bottom] 1fr}.content.svelte-x36wrk{grid-column-start:middle;grid-row-start:center;width:400px}.logo-container.svelte-x36wrk{margin-bottom:20px}.logo-container.svelte-x36wrk>img.svelte-x36wrk{max-width:100%}.login-button-container.svelte-x36wrk{text-align:right;margin-top:20px}.incorrect-details-panel.svelte-x36wrk{margin-top:30px;padding:10px;border-style:solid;border-width:1px;border-color:maroon;border-radius:1px;text-align:center;color:maroon;background-color:mistyrose}.form-root.svelte-x36wrk{display:grid;grid-template-columns:[label] auto [control] 1fr}.label.svelte-x36wrk{grid-column-start:label;padding:5px 10px;vertical-align:middle}.control.svelte-x36wrk{grid-column-start:control;padding:5px 10px}.default-input.svelte-x36wrk{font-family:inherit;font-size:inherit;padding:0.4em;margin:0 0 0.5em 0;box-sizing:border-box;border:1px solid #ccc;border-radius:2px;width:100%}.default-button.svelte-x36wrk{font-family:inherit;font-size:inherit;padding:0.4em;margin:0 0 0.5em 0;box-sizing:border-box;border:1px solid #ccc;border-radius:2px;color:#333;background-color:#f4f4f4;outline:none}.default-button.svelte-x36wrk:active{background-color:#ddd}.default-button.svelte-x36wrk:focus{border-color:#666} |
||||
.root.svelte-crnq0a{height:100%;display:grid;grid-template-columns:[left] 1fr [middle] auto [right] 1fr;grid-template-rows:[top] 1fr [center] auto [bottom] 1fr}.content.svelte-crnq0a{grid-column-start:middle;grid-row-start:center;width:400px}.logo-container.svelte-crnq0a{margin-bottom:20px |
.default.svelte-vmpdcw{font-family:inherit;font-size:inherit;padding:0.4em;margin:0 0 0.5em 0;box-sizing:border-box;border:1px solid #ccc;border-radius:2px;color:#333;background-color:#f4f4f4;outline:none}.default.svelte-vmpdcw:active{background-color:#ddd}.default.svelte-vmpdcw:focus{border-color:#666}.border.svelte-vmpdcw{border:var(--border)}.color.svelte-vmpdcw{color:var(--color)}.background.svelte-vmpdcw{background:var(--background)}.hoverBorder.svelte-vmpdcw:hover{border:var(--hoverBorder)}.hoverColor.svelte-vmpdcw:hover{color:var(--hoverColor)}.hoverBack.svelte-vmpdcw:hover{background:var(--hoverBackground)} |
||||
}.logo-container.svelte-crnq0a>img.svelte-crnq0a{max-width:100%}.login-button-container.svelte-crnq0a{text-align:right;margin-top:20px}.incorrect-details-panel.svelte-crnq0a{margin-top:30px;padding:10px;border-style:solid;border-width:1px;border-color:maroon;border-radius:1px;text-align:center;color:maroon;background-color:mistyrose}.form-root.svelte-crnq0a{display:grid;grid-template-columns:[label] auto [control] 1fr}.label.svelte-crnq0a{grid-column-start:label;padding:5px 10px;vertical-align:middle}.control.svelte-crnq0a{grid-column-start:control;padding:5px 10px}.default-input.svelte-crnq0a{font-family:inherit;font-size:inherit;padding:0.4em;margin:0 0 0.5em 0;box-sizing:border-box;border:1px solid #ccc;border-radius:2px;width:100%}.default-button.svelte-crnq0a{font-family:inherit;font-size:inherit;padding:0.4em;margin:0 0 0.5em 0;box-sizing:border-box;border:1px solid #ccc;border-radius:2px;color:#333;background-color:#f4f4f4;outline:none}.default-button.svelte-crnq0a:active{background-color:#ddd}.default-button.svelte-crnq0a:focus{border-color:#666} |
.root.svelte-gqjqs6{height:100%;width:100%;grid-template-columns:[navbar] auto [content] 1fr;display:grid}.navbar.svelte-gqjqs6{grid-column:navbar;background:var(--navBarBackground);border:var(--navBarBorder);color:var(--navBarColor)}.navitem.svelte-gqjqs6{padding:10px 17px;cursor:pointer}.navitem.svelte-gqjqs6:hover{background:var(--itemHoverBackground);color:var(--itemHoverColor)}.navitem.selected.svelte-gqjqs6{background:var(--selectedItemBackground);border:var(--selectedItemBorder);color:var(--selectedItemColor)}.content.svelte-gqjqs6{grid-column:content} |
||||
.default.svelte-1smqkrd{font-family:inherit;font-size:inherit;padding:0.4em;margin:0 0 0.5em 0;box-sizing:border-box;border:1px solid #ccc;border-radius:2px;color:#333;background-color:#f4f4f4;outline:none}.default.svelte-1smqkrd:active{background-color:#ddd}.default.svelte-1smqkrd:focus{border-color:#666}.border.svelte-1smqkrd{border:var(--border)}.color.svelte-1smqkrd{color:var(--color)}.background.svelte-1smqkrd{background:var(--background)}.hoverBorder.svelte-1smqkrd:hover{border:var(--hoverBorder)}.hoverColor.svelte-1smqkrd:hover{color:var(--hoverColor)}.hoverBack.svelte-1smqkrd:hover{background:var(--hoverBackground)} |
.table-default.svelte-1mfd3wk{width:100%;margin-bottom:1rem;color:#212529;border-collapse:collapse}.table-default.svelte-1mfd3wk .thead-default .th-default.svelte-1mfd3wk{vertical-align:bottom;border-bottom:2px solid #dee2e6;font-weight:bold}.table-default.svelte-1mfd3wk .th-default.svelte-1mfd3wk{padding:0.75rem;vertical-align:top;border-top:1px solid #dee2e6;font-weight:normal}.th-default.svelte-1mfd3wk{text-align:inherit}.table-default.svelte-1mfd3wk .tbody-default .tr-default.svelte-1mfd3wk:hover{color:#212529;background-color:rgba(0, 0, 0, 0.075);cursor:pointer} |
||||
.table-default.svelte-h8rqk6{width:100%;margin-bottom:1rem;color:#212529;border-collapse:collapse}.table-default.svelte-h8rqk6 .thead-default .th-default.svelte-h8rqk6{vertical-align:bottom;border-bottom:2px solid #dee2e6;font-weight:bold}.table-default.svelte-h8rqk6 .th-default.svelte-h8rqk6{padding:.75rem;vertical-align:top;border-top:1px solid #dee2e6;font-weight:normal}.th-default.svelte-h8rqk6{text-align:inherit}.table-default.svelte-h8rqk6 .tbody-default .tr-default.svelte-h8rqk6:hover{color:#212529;background-color:rgba(0,0,0,.075);cursor:pointer} |
|
||||
|
|
||||
/*# sourceMappingURL=bundle.css.map */ |
/*# sourceMappingURL=bundle.css.map */ |
||||
File diff suppressed because it is too large
File diff suppressed because one or more lines are too long
@ -0,0 +1,49 @@ |
|||||
|
<script> |
||||
|
export let className = "" |
||||
|
export let onLoad |
||||
|
export let type |
||||
|
export let _bb |
||||
|
|
||||
|
let containerElement |
||||
|
let hasLoaded; |
||||
|
let currentChildren; |
||||
|
|
||||
|
$: { |
||||
|
if(containerElement) { |
||||
|
_bb.attachChildren(containerElement) |
||||
|
if (!hasLoaded) { |
||||
|
_bb.call(onLoad) |
||||
|
hasLoaded = true |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
{#if type === "div"} |
||||
|
<div class={className} bind:this={containerElement} /> |
||||
|
{:else if type === "header"} |
||||
|
<header class={className} bind:this={containerElement} /> |
||||
|
{:else if type === "main"} |
||||
|
<main class={className} bind:this={containerElement} /> |
||||
|
{:else if type === "footer"} |
||||
|
<footer class={className} bind:this={containerElement} /> |
||||
|
{:else if type === "aside"} |
||||
|
<aside class={className} bind:this={containerElement} /> |
||||
|
{:else if type === "summary"} |
||||
|
<summary class={className} bind:this={containerElement} /> |
||||
|
{:else if type === "details"} |
||||
|
<details class={className} bind:this={containerElement} /> |
||||
|
{:else if type === "article"} |
||||
|
<article class={className} bind:this={containerElement} /> |
||||
|
{:else if type === "nav"} |
||||
|
<nav class={className} bind:this={containerElement} /> |
||||
|
{:else if type === "mark"} |
||||
|
<mark class={className} bind:this={containerElement} /> |
||||
|
{:else if type === "figure"} |
||||
|
<figure class={className} bind:this={containerElement} /> |
||||
|
{:else if type === "figcaption"} |
||||
|
<figcaption class={className} bind:this={containerElement} /> |
||||
|
{:else if type === "paragraph"} |
||||
|
<p class={className} bind:this={containerElement} /> |
||||
|
{/if} |
||||
@ -1,14 +0,0 @@ |
|||||
<script> |
|
||||
export let _children = [] |
|
||||
export let className = "" |
|
||||
export let onLoad |
|
||||
export let _bb |
|
||||
|
|
||||
let rootDiv |
|
||||
$: { |
|
||||
if (_bb && rootDiv && _children && _children.length) |
|
||||
_bb.hydrateChildren(_children, rootDiv) |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<div class={className} bind:this={rootDiv} /> |
|
||||
@ -1,8 +0,0 @@ |
|||||
<script> |
|
||||
export let text = "" |
|
||||
export let className = "" |
|
||||
|
|
||||
export let _bb |
|
||||
</script> |
|
||||
|
|
||||
<h1 class={className}>{text}</h1> |
|
||||
@ -1,8 +0,0 @@ |
|||||
<script> |
|
||||
export let text = "" |
|
||||
export let className = "" |
|
||||
|
|
||||
export let _bb |
|
||||
</script> |
|
||||
|
|
||||
<h1 class={className}>{text}</h1> |
|
||||
@ -1,8 +0,0 @@ |
|||||
<script> |
|
||||
export let text = "" |
|
||||
export let className = "" |
|
||||
|
|
||||
export let _bb |
|
||||
</script> |
|
||||
|
|
||||
<h3 class={className}>{text}</h3> |
|
||||
@ -1,8 +0,0 @@ |
|||||
<script> |
|
||||
export let text = "" |
|
||||
export let className = "" |
|
||||
|
|
||||
export let _bb |
|
||||
</script> |
|
||||
|
|
||||
<h4 class={className}>{text}</h4> |
|
||||
@ -1,8 +0,0 @@ |
|||||
<script> |
|
||||
export let text = "" |
|
||||
export let className = "" |
|
||||
|
|
||||
export let _bb |
|
||||
</script> |
|
||||
|
|
||||
<h6 class={className}>{text}</h6> |
|
||||
@ -1,10 +0,0 @@ |
|||||
<script> |
|
||||
import { buildStyle } from "./buildStyle" |
|
||||
|
|
||||
export let text = "" |
|
||||
export let className = "" |
|
||||
|
|
||||
export let _bb |
|
||||
</script> |
|
||||
|
|
||||
<h1 class={className}>{text}</h1> |
|
||||
@ -0,0 +1,24 @@ |
|||||
|
<script> |
||||
|
export let className = "" |
||||
|
export let type |
||||
|
export let _bb |
||||
|
|
||||
|
let containerElement |
||||
|
|
||||
|
$: containerElement && _bb.attachChildren(containerElement) |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
{#if type === "h1"} |
||||
|
<h1 class={className} bind:this={containerElement}></h1> |
||||
|
{:else if type === "h2"} |
||||
|
<h2 class={className} bind:this={containerElement}></h2> |
||||
|
{:else if type === "h3"} |
||||
|
<h3 class={className} bind:this={containerElement}></h3> |
||||
|
{:else if type === "h4"} |
||||
|
<h4 class={className} bind:this={containerElement}></h4> |
||||
|
{:else if type === "h5"} |
||||
|
<h5 class={className} bind:this={containerElement}></h5> |
||||
|
{:else if type === "h6"} |
||||
|
<h6 class={className} bind:this={containerElement}></h6> |
||||
|
{/if} |
||||
@ -0,0 +1,14 @@ |
|||||
|
<script> |
||||
|
export let value = "" |
||||
|
export let text = "" |
||||
|
export let _bb |
||||
|
|
||||
|
let actualValue |
||||
|
let actualText |
||||
|
|
||||
|
$: actualValue = value || text || "" |
||||
|
$: actualText = text || value || "" |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<option value={actualValue}>{actualText}</option> |
||||
@ -1,40 +1,25 @@ |
|||||
import { writable } from "svelte/store" |
|
||||
import Login from "../Login.svelte" |
|
||||
import Input from "../Input.svelte" |
|
||||
import Text from "../Text.svelte" |
|
||||
import Nav from "../Nav.svelte" |
|
||||
import H1 from "../H1.svelte" |
|
||||
import Div from "../Div.svelte" |
|
||||
import Table from "../Table.svelte" |
|
||||
import Button from "../Button.svelte" |
|
||||
import { createApp } from "@budibase/client/src/createApp" |
import { createApp } from "@budibase/client/src/createApp" |
||||
|
import components from "./testComponents" |
||||
|
import packageJson from "../../package.json" |
||||
|
import { rootComponent } from "./rootComponent" |
||||
|
|
||||
export default async () => { |
export default async () => { |
||||
const componentLibraries = { |
delete components._lib |
||||
components: { |
const componentLibraries = {} |
||||
login: Login, |
componentLibraries[packageJson.name] = components |
||||
input: Input, |
componentLibraries["testcomponents"] = { |
||||
text: Text, |
rootComponent: rootComponent(window), |
||||
nav: Nav, |
|
||||
table: Table, |
|
||||
button: Button, |
|
||||
div: Div, |
|
||||
h1: H1, |
|
||||
}, |
|
||||
} |
} |
||||
|
|
||||
const appDef = { hierarchy: {}, actions: {} } |
const appDef = { hierarchy: {}, actions: {} } |
||||
const user = { name: "yeo", permissions: [] } |
const user = { name: "yeo", permissions: [] } |
||||
|
const { initialisePage } = createApp( |
||||
var app = createApp(componentLibraries, appDef, user) |
window.document, |
||||
app.store.update(s => { |
componentLibraries, |
||||
s.people = [ |
{ appRootPath: "" }, |
||||
{ name: "bob", address: "123 Main Street", status: "Open" }, |
appDef, |
||||
{ name: "poppy", address: "456 Side Road", status: "Closed" }, |
user, |
||||
{ name: "Oscar", address: "678 Dodgy Alley", status: "Open" }, |
{}, |
||||
] |
[] |
||||
return s |
) |
||||
}) |
return initialisePage |
||||
|
|
||||
return app |
|
||||
} |
} |
||||
|
|||||
@ -1,207 +1,59 @@ |
|||||
export const props = { |
export const form = { |
||||
divWithAFewControls: { |
_id: "1", |
||||
_component: "components/div", |
_component: "@budibase/standard-components/container", |
||||
_children: [ |
type: "main", |
||||
{ |
_children: [ |
||||
_component: "components/h1", |
{ |
||||
text: "This is an <h1> component", |
_component: "@budibase/standard-components/heading", |
||||
}, |
type: "h1", |
||||
{ |
_children: [ |
||||
_component: "components/text", |
{ |
||||
value: "Label for field", |
_component: "@budibase/standard-components/text", |
||||
}, |
text: "This is an H1 Heading", |
||||
{ |
}, |
||||
_component: "components/input", |
], |
||||
type: "text", |
|
||||
}, |
|
||||
{ |
|
||||
_component: "components/button", |
|
||||
_children: [ |
|
||||
{ |
|
||||
_component: "components/text", |
|
||||
value: "☢", |
|
||||
}, |
|
||||
{ |
|
||||
_component: "components/text", |
|
||||
value: "Click Me", |
|
||||
}, |
|
||||
], |
|
||||
}, |
|
||||
], |
|
||||
}, |
|
||||
|
|
||||
login: { _component: "components/login" }, |
|
||||
|
|
||||
form: { |
|
||||
_component: "components/form", |
|
||||
formControls: [ |
|
||||
{ |
|
||||
control: { |
|
||||
_component: "components/textbox", |
|
||||
}, |
|
||||
label: "First Name", |
|
||||
}, |
|
||||
{ |
|
||||
control: { |
|
||||
_component: "components/textbox", |
|
||||
}, |
|
||||
label: "Last Name", |
|
||||
}, |
|
||||
], |
|
||||
}, |
|
||||
|
|
||||
nav: { |
|
||||
_component: "components/nav", |
|
||||
navBarBackground: "red", |
|
||||
navBarBorder: "1px solid maroon", |
|
||||
navBarColor: "black", |
|
||||
selectedItemBackground: "maroon", |
|
||||
selectedItemColor: "white", |
|
||||
selectedItemBorder: "green", |
|
||||
itemHoverBackground: "yellow", |
|
||||
itemHoverColor: "pink", |
|
||||
items: [ |
|
||||
{ |
|
||||
title: "People", |
|
||||
component: { |
|
||||
_component: "components/panel", |
|
||||
text: "People Panel", |
|
||||
padding: "40px", |
|
||||
border: "2px solid pink", |
|
||||
background: "mistyrose", |
|
||||
}, |
|
||||
}, |
|
||||
{ |
|
||||
title: "Animals", |
|
||||
component: { |
|
||||
_component: "components/panel", |
|
||||
text: "Animals Panel", |
|
||||
padding: "40px", |
|
||||
border: "2px solid green", |
|
||||
background: "azure", |
|
||||
}, |
|
||||
}, |
|
||||
], |
|
||||
}, |
|
||||
|
|
||||
table: { |
|
||||
_component: "components/table", |
|
||||
columns: [ |
|
||||
{ |
|
||||
title: { |
|
||||
"##bbstate": "NameColumnName", |
|
||||
"##bbsource": "store", |
|
||||
"##bbstatefallback": "Name", |
|
||||
}, |
|
||||
value: { |
|
||||
"##bbstate": "name", |
|
||||
"##bbsource": "context", |
|
||||
}, |
|
||||
}, |
|
||||
{ |
|
||||
title: "Address", |
|
||||
value: { |
|
||||
"##bbstate": "address", |
|
||||
"##bbsource": "context", |
|
||||
}, |
|
||||
}, |
|
||||
{ |
|
||||
title: "Status", |
|
||||
value: { |
|
||||
"##bbstate": "status", |
|
||||
"##bbsource": "context", |
|
||||
}, |
|
||||
}, |
|
||||
], |
|
||||
data: { |
|
||||
"##bbstate": "people", |
|
||||
}, |
}, |
||||
onRowClick: [ |
{ |
||||
{ |
_component: "@budibase/standard-components/text", |
||||
"##eventHandlerType": "Set State", |
text: "This just some text", |
||||
parameters: { |
type: "strong", |
||||
path: "NameColumnName", |
}, |
||||
value: { |
{ |
||||
"##bbstate": "name", |
_component: "@budibase/standard-components/container", |
||||
"##bbsource": "context", |
type: "paragraph", |
||||
"##bbstatefallback": "balls to that", |
_children: [ |
||||
}, |
{ |
||||
}, |
_component: "@budibase/standard-components/text", |
||||
}, |
formattingTag: "<i>", |
||||
], |
text: "some iatlics in a paragraph", |
||||
tableClass: "table-default", |
}, |
||||
theadClass: "thead-default", |
], |
||||
tbodyClass: "tbody-default", |
}, |
||||
trClass: "tr-default", |
{ |
||||
thClass: "th-default", |
_component: "@budibase/standard-components/heading", |
||||
}, |
type: "h2", |
||||
|
_children: [ |
||||
hiddenNav: { |
{ |
||||
_component: "components/stackpanel", |
_component: "@budibase/standard-components/text", |
||||
children: [ |
text: "This is an H2 Heading", |
||||
{ |
}, |
||||
control: { |
], |
||||
_component: "components/button", |
}, |
||||
contentText: "Peep", |
{ |
||||
onClick: [ |
_component: "@budibase/standard-components/select", |
||||
{ |
value: "two", |
||||
"##eventHandlerType": "Set State", |
_children: [ |
||||
parameters: { |
{ |
||||
path: "selected", |
_component: "@budibase/standard-components/option", |
||||
value: "People", |
text: "number 1", |
||||
}, |
value: "one", |
||||
}, |
}, |
||||
], |
{ |
||||
}, |
_component: "@budibase/standard-components/option", |
||||
}, |
text: "number 2", |
||||
{ |
value: "two", |
||||
control: { |
}, |
||||
_component: "components/button", |
], |
||||
contentText: "Ani", |
}, |
||||
onClick: [ |
], |
||||
{ |
|
||||
"##eventHandlerType": "Set State", |
|
||||
parameters: { |
|
||||
path: "selected", |
|
||||
value: "Animals", |
|
||||
}, |
|
||||
}, |
|
||||
], |
|
||||
}, |
|
||||
}, |
|
||||
{ |
|
||||
control: { |
|
||||
_component: "components/nav", |
|
||||
hideNavBar: true, |
|
||||
selectedItem: { |
|
||||
"##bbstate": "selected", |
|
||||
"##bbsource": "store", |
|
||||
"##bbstatefallback": "Animals", |
|
||||
}, |
|
||||
items: [ |
|
||||
{ |
|
||||
title: "People", |
|
||||
component: { |
|
||||
_component: "components/panel", |
|
||||
text: "People Panel", |
|
||||
padding: "40px", |
|
||||
border: "2px solid pink", |
|
||||
background: "mistyrose", |
|
||||
}, |
|
||||
}, |
|
||||
{ |
|
||||
title: "Animals", |
|
||||
component: { |
|
||||
_component: "components/panel", |
|
||||
text: "Animals Panel", |
|
||||
padding: "40px", |
|
||||
border: "2px solid green", |
|
||||
background: "azure", |
|
||||
}, |
|
||||
}, |
|
||||
], |
|
||||
}, |
|
||||
}, |
|
||||
], |
|
||||
}, |
|
||||
} |
} |
||||
|
|||||
@ -0,0 +1,15 @@ |
|||||
|
export const rootComponent = window => { |
||||
|
return function(opts) { |
||||
|
const node = window.document.createElement("DIV") |
||||
|
const $set = props => { |
||||
|
props._bb.attachChildren(node) |
||||
|
} |
||||
|
const $destroy = () => { |
||||
|
if (opts.target && node) opts.target.removeChild(node) |
||||
|
} |
||||
|
this.$set = $set |
||||
|
this.$set(opts.props) |
||||
|
this.$destroy = $destroy |
||||
|
opts.target.appendChild(node) |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,3 @@ |
|||||
|
import { container, text, heading, input, select, option, button, login, nav, table } from "../index" |
||||
|
|
||||
|
export default { container, text, heading, input, select, option, button, login, nav, table } |
||||
@ -1,14 +1,8 @@ |
|||||
export { default as button } from "./Button.svelte" |
export { default as container } from "./Container.svelte" |
||||
export { default as div } from "./Div.svelte" |
export { default as text } from "./Text.svelte" |
||||
export { default as h1 } from "./H1.svelte" |
export { default as heading } from "./Heading.svelte" |
||||
export { default as h2 } from "./H2.svelte" |
|
||||
export { default as h3 } from "./H3.svelte" |
|
||||
export { default as h4 } from "./H4.svelte" |
|
||||
export { default as h5 } from "./H5.svelte" |
|
||||
export { default as h6 } from "./H6.svelte" |
|
||||
export { default as input } from "./Input.svelte" |
export { default as input } from "./Input.svelte" |
||||
export { default as login } from "./Login.svelte" |
|
||||
export { default as nav } from "./Nav.svelte" |
|
||||
export { default as select } from "./Select.svelte" |
export { default as select } from "./Select.svelte" |
||||
export { default as table } from "./Table.svelte" |
export { default as option } from "./Option.svelte" |
||||
export { default as text } from "./Text.svelte" |
export { default as button } from "./Button.svelte" |
||||
|
export { default as login } from "./Login.svelte" |
||||
|
|||||
Loading…
Reference in new issue