mirror of https://github.com/Budibase/budibase.git
72 changed files with 4328 additions and 1364 deletions
@ -0,0 +1,189 @@ |
|||||
|
<script> |
||||
|
import { |
||||
|
isRootComponent |
||||
|
} from "./pagesParsing/searchComponents" |
||||
|
import { splitName } from "./pagesParsing/splitRootComponentName.js" |
||||
|
import { store } from "../builderStore"; |
||||
|
import { |
||||
|
groupBy, keys, find, sortBy |
||||
|
} from "lodash/fp"; |
||||
|
import { pipe } from "../common/core"; |
||||
|
|
||||
|
export let onComponentChosen; |
||||
|
export let onGeneratorChosen; |
||||
|
|
||||
|
let derivedComponents=[]; |
||||
|
let componentLibraries=[]; |
||||
|
|
||||
|
const addRootComponent = (c, all, isGenerator) => { |
||||
|
const { libName } = splitName(c.name); |
||||
|
let group = find(r => r.libName === libName)(all); |
||||
|
|
||||
|
if(!group) { |
||||
|
group = { |
||||
|
libName, |
||||
|
components: [], |
||||
|
generators: [] |
||||
|
}; |
||||
|
|
||||
|
all.push(group); |
||||
|
} |
||||
|
|
||||
|
if(isGenerator) { |
||||
|
group.generators.push(c) |
||||
|
} else { |
||||
|
group.components.push(c) |
||||
|
} |
||||
|
|
||||
|
}; |
||||
|
|
||||
|
store.subscribe(s => { |
||||
|
|
||||
|
const newComponentLibraries = []; |
||||
|
const newDerivedComponents = []; |
||||
|
|
||||
|
for(let comp of sortBy(["name"])(s.allComponents)) { |
||||
|
if(isRootComponent(comp)) { |
||||
|
addRootComponent( |
||||
|
comp, |
||||
|
newComponentLibraries, |
||||
|
false); |
||||
|
} else { |
||||
|
newDerivedComponents.push(comp); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
for(let generator of s.generators) { |
||||
|
addRootComponent( |
||||
|
generator, |
||||
|
newComponentLibraries, |
||||
|
true); |
||||
|
} |
||||
|
|
||||
|
derivedComponents = sortBy(["name"])(newDerivedComponents); |
||||
|
componentLibraries = newComponentLibraries; |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
{#each componentLibraries as lib} |
||||
|
<div class="library-header"> |
||||
|
{lib.libName} |
||||
|
</div> |
||||
|
|
||||
|
<div class="library-container"> |
||||
|
|
||||
|
<div class="inner-header"> |
||||
|
Generators |
||||
|
</div> |
||||
|
|
||||
|
{#each lib.generators as generator} |
||||
|
|
||||
|
<div class="component" |
||||
|
on:click={() => onGeneratorChosen(generator)}> |
||||
|
<div class="name"> |
||||
|
{splitName(generator.name).componentName} |
||||
|
</div> |
||||
|
<div class="description"> |
||||
|
{generator.description} |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
{/each} |
||||
|
|
||||
|
<div class="inner-header"> |
||||
|
Components |
||||
|
</div> |
||||
|
|
||||
|
{#each lib.components as component} |
||||
|
|
||||
|
<div class="component" |
||||
|
on:click={() => onComponentChosen(component)}> |
||||
|
<div class="name"> |
||||
|
{splitName(component.name).componentName} |
||||
|
</div> |
||||
|
<div class="description"> |
||||
|
{component.description} |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
{/each} |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
{/each} |
||||
|
|
||||
|
|
||||
|
<div class="library-header"> |
||||
|
My Components |
||||
|
</div> |
||||
|
|
||||
|
<div class="library-container"> |
||||
|
|
||||
|
{#each derivedComponents as component} |
||||
|
|
||||
|
<div class="component" |
||||
|
on:click={() => onComponentChosen(component)}> |
||||
|
<div class="name"> |
||||
|
{component.name} |
||||
|
</div> |
||||
|
<div class="description"> |
||||
|
{component.description} |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
{/each} |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<style> |
||||
|
|
||||
|
.library-header { |
||||
|
font-size: 1.1em; |
||||
|
border-color: var(--primary25); |
||||
|
border-width: 1px 0px; |
||||
|
border-style: solid; |
||||
|
background-color: var(--primary10); |
||||
|
padding: 5px 0; |
||||
|
} |
||||
|
|
||||
|
.library-container { |
||||
|
padding: 0 0 10px 10px; |
||||
|
} |
||||
|
|
||||
|
.inner-header { |
||||
|
font-size: 0.9em; |
||||
|
font-weight: bold; |
||||
|
margin-top: 7px; |
||||
|
margin-bottom: 3px; |
||||
|
} |
||||
|
|
||||
|
.component { |
||||
|
padding: 2px 0px; |
||||
|
cursor: pointer; |
||||
|
} |
||||
|
|
||||
|
.component:hover { |
||||
|
background-color: var(--lightslate); |
||||
|
} |
||||
|
|
||||
|
.component > .name { |
||||
|
color: var(--secondary100); |
||||
|
display: inline-block; |
||||
|
} |
||||
|
|
||||
|
.component > .description { |
||||
|
font-size: 0.8em; |
||||
|
color: var(--secondary75); |
||||
|
display: inline-block; |
||||
|
margin-left: 10px; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,159 @@ |
|||||
|
<script> |
||||
|
import { store } from "../builderStore"; |
||||
|
import { splitName } from "./pagesParsing/splitRootComponentName"; |
||||
|
import { |
||||
|
getIndexNodes, getRecordNodes, getIndexSchema |
||||
|
} from "../common/core"; |
||||
|
import { |
||||
|
map, some, filter |
||||
|
} from "lodash/fp"; |
||||
|
import Button from "../common/Button.svelte"; |
||||
|
import { componentDependencies } from "./pagesParsing/findDependencies"; |
||||
|
import { rename } from "./pagesParsing/renameComponent"; |
||||
|
import { getExactComponent } from "./pagesParsing/searchComponents"; |
||||
|
export let generator; |
||||
|
export let onConfirmGenerate; |
||||
|
|
||||
|
let libName; |
||||
|
let componentName; |
||||
|
let libs; |
||||
|
let existingComponents; |
||||
|
let _generator; |
||||
|
let components; |
||||
|
let generateParameter; |
||||
|
let allGeneratedComponents; |
||||
|
let selectedComponents = []; |
||||
|
|
||||
|
store.subscribe(s => { |
||||
|
libs = s.generatorLibraries; |
||||
|
generateParameter = { |
||||
|
indexes: getIndexNodes(s.hierarchy), |
||||
|
records: getRecordNodes(s.hierarchy), |
||||
|
helpers: { |
||||
|
indexSchema: getIndexSchema(s.hierarchy) |
||||
|
} |
||||
|
} |
||||
|
existingComponents = s.allComponents; |
||||
|
}); |
||||
|
|
||||
|
const componentExists = name => |
||||
|
getExactComponent(existingComponents, name); |
||||
|
|
||||
|
const componentsWithDependencies = () => { |
||||
|
|
||||
|
const cmp = map(c => { |
||||
|
const dependants = componentDependencies( |
||||
|
{}, selectedComponents, c); |
||||
|
return { |
||||
|
dependants: dependants.dependantComponents, |
||||
|
component:c, |
||||
|
error: componentExists(c.name) ? "a component by this name already exists" : "" |
||||
|
}; |
||||
|
})(allGeneratedComponents); |
||||
|
components = cmp; |
||||
|
} |
||||
|
|
||||
|
$ : { |
||||
|
if(generator && generator !== _generator) { |
||||
|
_generator = generator; |
||||
|
|
||||
|
const sp = splitName(generator.name); |
||||
|
libName = sp.libName; |
||||
|
componentName = sp.componentName; |
||||
|
|
||||
|
allGeneratedComponents = libs[libName][componentName](generateParameter); |
||||
|
selectedComponents = [...allGeneratedComponents]; |
||||
|
componentsWithDependencies(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
const onSelectedChanged = component => ev => { |
||||
|
const newselectedComponents = filter(c => c.name !== component.component.name)( |
||||
|
selectedComponents); |
||||
|
if(ev.target.checked) { |
||||
|
newselectedComponents.push(component.component); |
||||
|
} |
||||
|
|
||||
|
selectedComponents = newselectedComponents; |
||||
|
componentsWithDependencies(); |
||||
|
} |
||||
|
|
||||
|
const onNameChanged = component => ev => { |
||||
|
const newname = ev.target.value; |
||||
|
const oldname = component.component.name; |
||||
|
const result = rename({}, allGeneratedComponents, oldname, newname); |
||||
|
component.error = result.error || ""; |
||||
|
allGeneratedComponents = [...result.allComponents]; |
||||
|
selectedComponents = map(s => { |
||||
|
if(s.name === oldname) s.name = newname; |
||||
|
return s; |
||||
|
})(selectedComponents); |
||||
|
componentsWithDependencies(); |
||||
|
} |
||||
|
|
||||
|
const isComponentSelected = component => |
||||
|
some(c => c.name === component.component.name)(selectedComponents); |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
{#each components as c} |
||||
|
|
||||
|
<div class="component"> |
||||
|
|
||||
|
<div class="uk-inline"> |
||||
|
<input type="checkbox" |
||||
|
disabled={c.dependants.length > 0} |
||||
|
class="uk-checkbox" |
||||
|
checked={isComponentSelected(c)} |
||||
|
on:change={onSelectedChanged(c)}> |
||||
|
<input type="text" |
||||
|
value={c.component.name} |
||||
|
on:change={onNameChanged(c)} |
||||
|
class="uk-input title {c.error ? 'uk-form-danger' : ''}"> |
||||
|
{#if isComponentSelected(c)} |
||||
|
<span class="error">{c.error}</span> |
||||
|
{/if} |
||||
|
</div> |
||||
|
|
||||
|
<div class="description"> |
||||
|
{c.component.description} |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
{/each} |
||||
|
|
||||
|
<div class="button-container"> |
||||
|
<Button on:click={() => onConfirmGenerate(selectedComponents)}>Add Components</Button> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
<style> |
||||
|
|
||||
|
.component { |
||||
|
padding: 5px 0; |
||||
|
} |
||||
|
|
||||
|
.component .title { |
||||
|
width: 300px |
||||
|
} |
||||
|
|
||||
|
.component > .description { |
||||
|
font-size: 0.8em; |
||||
|
color: var(--secondary75); |
||||
|
} |
||||
|
|
||||
|
.button-container { |
||||
|
text-align: right; |
||||
|
margin-top: 20px; |
||||
|
} |
||||
|
|
||||
|
.error { |
||||
|
font-size: 10pt; |
||||
|
color: red; |
||||
|
} |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,64 @@ |
|||||
|
import { |
||||
|
searchAllComponents, |
||||
|
getExactComponent, |
||||
|
getAncestorProps |
||||
|
} from "../src/userInterface/pagesParsing/searchComponents"; |
||||
|
import { |
||||
|
componentDependencies |
||||
|
} from "../src/userInterface/pagesParsing/findDependencies"; |
||||
|
import { allComponents } from "./testData"; |
||||
|
import { some, find } from "lodash/fp" |
||||
|
|
||||
|
describe("component dependencies", () => { |
||||
|
|
||||
|
const contains = (result, name) => |
||||
|
some(c => c.name === name)(result); |
||||
|
|
||||
|
const get = (all, name) => |
||||
|
find(c => c.name === name)(all); |
||||
|
|
||||
|
it("should include component that inheirts", () => { |
||||
|
|
||||
|
const components = allComponents(); |
||||
|
|
||||
|
const result = componentDependencies( |
||||
|
{}, components, get(components, "budibase-components/TextBox")); |
||||
|
|
||||
|
expect(contains(result.dependantComponents, "common/SmallTextbox")).toBe(true); |
||||
|
|
||||
|
}); |
||||
|
|
||||
|
it("should include component that nests", () => { |
||||
|
const components = allComponents(); |
||||
|
|
||||
|
const result = componentDependencies( |
||||
|
{}, components, get(components, "PrimaryButton")); |
||||
|
|
||||
|
expect(contains(result.dependantComponents, "ButtonGroup")).toBe(true); |
||||
|
|
||||
|
}); |
||||
|
|
||||
|
it("shouldinclude component that nests inside arrays", () => { |
||||
|
const components = allComponents(); |
||||
|
|
||||
|
const result = componentDependencies( |
||||
|
{}, components, get(components, "common/PasswordBox")); |
||||
|
|
||||
|
expect(contains(result.dependantComponents, "ButtonGroup")).toBe(true); |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
it("should include components n page apbody", () => { |
||||
|
const components = allComponents(); |
||||
|
const pages = { |
||||
|
main: { |
||||
|
appBody: "PrimaryButton" |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
const result = componentDependencies( |
||||
|
pages, components, get(components, "PrimaryButton")); |
||||
|
|
||||
|
expect(result.dependantPages).toEqual(["main"]); |
||||
|
}); |
||||
|
}) |
||||
@ -0,0 +1,228 @@ |
|||||
|
{ |
||||
|
"name": "Main View Switcher", |
||||
|
"description": "", |
||||
|
"inherits": "@budibase/standard-components/nav", |
||||
|
"props": { |
||||
|
"items": [ |
||||
|
{ |
||||
|
"_component": "#items#array_element", |
||||
|
"title": "Apps List", |
||||
|
"component": { |
||||
|
"_component": "apps/Apps List", |
||||
|
"direction": "horizontal", |
||||
|
"children": [ |
||||
|
{ |
||||
|
"_component": "#children#array_element", |
||||
|
"control": { |
||||
|
"_component": "apps/Create App List Item", |
||||
|
"text": "Create New", |
||||
|
"component": { |
||||
|
"_component": "" |
||||
|
}, |
||||
|
"containerClass": "", |
||||
|
"background": "", |
||||
|
"border": "1px solid black", |
||||
|
"borderRadius": "2px", |
||||
|
"font": "", |
||||
|
"color": "", |
||||
|
"padding": "10px", |
||||
|
"margin": "20px", |
||||
|
"hoverColor": "", |
||||
|
"hoverBackground": "gainsboro", |
||||
|
"height": "100px", |
||||
|
"width": "100px", |
||||
|
"onClick": [ |
||||
|
{ |
||||
|
"##eventHandlerType": "Get New Record", |
||||
|
"parameters": { |
||||
|
"collectionKey": "/applications", |
||||
|
"childRecordType": "application", |
||||
|
"statePath": "currentApplication" |
||||
|
} |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
} |
||||
|
], |
||||
|
"width": "auto", |
||||
|
"height": "auto", |
||||
|
"containerClass": "", |
||||
|
"itemContainerClass": "", |
||||
|
"data": { |
||||
|
"##bbstate": "allApplications", |
||||
|
"##bbsource": "store" |
||||
|
}, |
||||
|
"dataItemComponent": { |
||||
|
"_component": "apps/Application List Item", |
||||
|
"text": "", |
||||
|
"component": { |
||||
|
"_component": "@budibase/standard-components/stackpanel", |
||||
|
"children": [ |
||||
|
{ |
||||
|
"_component": "#children#array_element", |
||||
|
"control": { |
||||
|
"_component": "@budibase/standard-components/text", |
||||
|
"value": "", |
||||
|
"containerClass": "", |
||||
|
"font": "", |
||||
|
"color": "", |
||||
|
"textAlign": "inline", |
||||
|
"verticalAlign": "inline", |
||||
|
"display": "inline" |
||||
|
} |
||||
|
} |
||||
|
], |
||||
|
"width": "auto", |
||||
|
"height": "auto", |
||||
|
"containerClass": "", |
||||
|
"itemContainerClass": "", |
||||
|
"data": { |
||||
|
"##bbstate": "" |
||||
|
}, |
||||
|
"dataItemComponent": { |
||||
|
"_component": "" |
||||
|
}, |
||||
|
"onLoad": [] |
||||
|
}, |
||||
|
"containerClass": "", |
||||
|
"background": "", |
||||
|
"border": "1px solid dimgray", |
||||
|
"borderRadius": "2px", |
||||
|
"font": "", |
||||
|
"color": "black", |
||||
|
"padding": "10px", |
||||
|
"margin": "20px", |
||||
|
"hoverColor": "", |
||||
|
"hoverBackground": "", |
||||
|
"height": "", |
||||
|
"width": "", |
||||
|
"onClick": [ |
||||
|
{ |
||||
|
"##eventHandlerType": "Load Record", |
||||
|
"parameters": { |
||||
|
"recordKey": { |
||||
|
"##bbstate": "key", |
||||
|
"##bbsource": "context" |
||||
|
}, |
||||
|
"statePath": "currentApp" |
||||
|
} |
||||
|
} |
||||
|
], |
||||
|
"display": "inline" |
||||
|
}, |
||||
|
"onLoad": [ |
||||
|
{ |
||||
|
"##eventHandlerType": "List Records", |
||||
|
"parameters": { |
||||
|
"indexKey": "/all_applications", |
||||
|
"statePath": "allApplications" |
||||
|
} |
||||
|
} |
||||
|
], |
||||
|
"component": { |
||||
|
"_component": "@budibase/standard-components/stackpanel", |
||||
|
"direction": "horizontal", |
||||
|
"children": [ |
||||
|
{ |
||||
|
"_component": "#children#array_element", |
||||
|
"control": { |
||||
|
"_component": "@budibase/standard-components/text", |
||||
|
"value": "", |
||||
|
"containerClass": "", |
||||
|
"font": "", |
||||
|
"color": "", |
||||
|
"textAlign": "inline", |
||||
|
"verticalAlign": "inline", |
||||
|
"display": "inline" |
||||
|
} |
||||
|
} |
||||
|
], |
||||
|
"width": "auto", |
||||
|
"height": "auto", |
||||
|
"containerClass": "", |
||||
|
"itemContainerClass": "", |
||||
|
"data": { |
||||
|
"##bbstate": "allApplications", |
||||
|
"##bbsource": "store" |
||||
|
}, |
||||
|
"dataItemComponent": { |
||||
|
"_component": "apps/Application List Item", |
||||
|
"text": { |
||||
|
"##bbstate": "name", |
||||
|
"##bbstatefallback": "My App Name", |
||||
|
"##bbsource": "context" |
||||
|
}, |
||||
|
"component": { |
||||
|
"_component": "@budibase/standard-components/stackpanel", |
||||
|
"direction": "horizontal", |
||||
|
"children": [ |
||||
|
{ |
||||
|
"_component": "#children#array_element", |
||||
|
"control": { |
||||
|
"_component": "@budibase/standard-components/text", |
||||
|
"value": "", |
||||
|
"containerClass": "", |
||||
|
"font": "", |
||||
|
"color": "", |
||||
|
"textAlign": "inline", |
||||
|
"verticalAlign": "inline", |
||||
|
"display": "inline" |
||||
|
} |
||||
|
} |
||||
|
], |
||||
|
"width": "auto", |
||||
|
"height": "auto", |
||||
|
"containerClass": "", |
||||
|
"itemContainerClass": "", |
||||
|
"data": { |
||||
|
"##bbstate": "allApplications", |
||||
|
"##bbsource": "store" |
||||
|
}, |
||||
|
"dataItemComponent": { |
||||
|
"_component": "" |
||||
|
}, |
||||
|
"onLoad": [] |
||||
|
}, |
||||
|
"containerClass": "", |
||||
|
"background": "", |
||||
|
"border": "1px solid dimgray", |
||||
|
"borderRadius": "2px", |
||||
|
"font": "", |
||||
|
"color": "black", |
||||
|
"padding": "10px", |
||||
|
"margin": "20px", |
||||
|
"hoverColor": "", |
||||
|
"hoverBackground": "", |
||||
|
"height": "", |
||||
|
"width": "", |
||||
|
"onClick": [ |
||||
|
{ |
||||
|
"##eventHandlerType": "Load Record", |
||||
|
"parameters": { |
||||
|
"recordKey": { |
||||
|
"##bbstate": "key", |
||||
|
"##bbsource": "context" |
||||
|
}, |
||||
|
"statePath": "currentApplication" |
||||
|
} |
||||
|
} |
||||
|
], |
||||
|
"display": "" |
||||
|
}, |
||||
|
"onLoad": [] |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
], |
||||
|
"selectedItem": { |
||||
|
"##bbstate": "currentView", |
||||
|
"##bbstatefallback": "Apps List", |
||||
|
"##bbsource": "store" |
||||
|
} |
||||
|
}, |
||||
|
"tags": [ |
||||
|
"nav", |
||||
|
"navigation", |
||||
|
"sidebar" |
||||
|
] |
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
{ |
||||
|
"name": "apps/App Form", |
||||
|
"description": "", |
||||
|
"inherits": "@budibase/standard-components/form", |
||||
|
"props": { |
||||
|
"formControls": [ |
||||
|
{ |
||||
|
"_component": "#formControls#array_element", |
||||
|
"label": "Name", |
||||
|
"control": { |
||||
|
"_component": "@budibase/standard-components/textbox", |
||||
|
"value": { |
||||
|
"##bbstate": "currentApplication.name", |
||||
|
"##bbsource": "store" |
||||
|
}, |
||||
|
"hideValue": false, |
||||
|
"className": "default" |
||||
|
} |
||||
|
} |
||||
|
] |
||||
|
}, |
||||
|
"tags": [ |
||||
|
"form" |
||||
|
] |
||||
|
} |
||||
@ -0,0 +1,37 @@ |
|||||
|
{ |
||||
|
"name": "apps/Edit App ", |
||||
|
"description": "", |
||||
|
"inherits": "@budibase/standard-components/stackpanel", |
||||
|
"props": { |
||||
|
"children": [ |
||||
|
{ |
||||
|
"_component": "#children#array_element", |
||||
|
"control": { |
||||
|
"_component": "apps/App Form", |
||||
|
"containerClass": "", |
||||
|
"formControls": [ |
||||
|
{ |
||||
|
"_component": "#formControls#array_element", |
||||
|
"label": "Name", |
||||
|
"control": { |
||||
|
"_component": "@budibase/standard-components/textbox", |
||||
|
"value": { |
||||
|
"##bbstate": "currentApplication.name", |
||||
|
"##bbsource": "store" |
||||
|
}, |
||||
|
"hideValue": false, |
||||
|
"className": "default" |
||||
|
} |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
} |
||||
|
] |
||||
|
}, |
||||
|
"tags": [ |
||||
|
"div", |
||||
|
"container", |
||||
|
"layout", |
||||
|
"panel" |
||||
|
] |
||||
|
} |
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,72 +1,75 @@ |
|||||
[ |
{ |
||||
{ |
"version": 0, |
||||
"name": "owner", |
"levels": [ |
||||
"permissions": [ |
{ |
||||
{ |
"name": "owner", |
||||
"type": "create record", |
"permissions": [ |
||||
"nodeKey": "/customers/1-{id}" |
{ |
||||
}, |
"type": "create record", |
||||
{ |
"nodeKey": "/customers/1-{id}" |
||||
"type": "delete record", |
}, |
||||
"nodeKey": "/customers/1-{id}" |
{ |
||||
}, |
"type": "delete record", |
||||
{ |
"nodeKey": "/customers/1-{id}" |
||||
"type": "update record", |
}, |
||||
"nodeKey": "/customers/1-{id}" |
{ |
||||
}, |
"type": "update record", |
||||
{ |
"nodeKey": "/customers/1-{id}" |
||||
"type": "read record", |
}, |
||||
"nodeKey": "/customers/1-{id}" |
{ |
||||
}, |
"type": "read record", |
||||
{ |
"nodeKey": "/customers/1-{id}" |
||||
"type": "create record", |
}, |
||||
"nodeKey": "/customers/1-{id}/invoices/2-{id}" |
{ |
||||
}, |
"type": "create record", |
||||
{ |
"nodeKey": "/customers/1-{id}/invoices/2-{id}" |
||||
"type": "update record", |
}, |
||||
"nodeKey": "/customers/1-{id}/invoices/2-{id}" |
{ |
||||
}, |
"type": "update record", |
||||
{ |
"nodeKey": "/customers/1-{id}/invoices/2-{id}" |
||||
"type": "delete record", |
}, |
||||
"nodeKey": "/customers/1-{id}/invoices/2-{id}" |
{ |
||||
}, |
"type": "delete record", |
||||
{ |
"nodeKey": "/customers/1-{id}/invoices/2-{id}" |
||||
"type": "read record", |
}, |
||||
"nodeKey": "/customers/1-{id}/invoices/2-{id}" |
{ |
||||
}, |
"type": "read record", |
||||
{ |
"nodeKey": "/customers/1-{id}/invoices/2-{id}" |
||||
"type": "write templates" |
}, |
||||
}, |
{ |
||||
{ |
"type": "write templates" |
||||
"type": "create user" |
}, |
||||
}, |
{ |
||||
{ |
"type": "create user" |
||||
"type": "set password" |
}, |
||||
}, |
{ |
||||
{ |
"type": "set password" |
||||
"type": "create temporary access" |
}, |
||||
}, |
{ |
||||
{ |
"type": "create temporary access" |
||||
"type": "enable or disable user" |
}, |
||||
}, |
{ |
||||
{ |
"type": "enable or disable user" |
||||
"type": "write access levels" |
}, |
||||
}, |
{ |
||||
{ |
"type": "write access levels" |
||||
"type": "list users" |
}, |
||||
}, |
{ |
||||
{ |
"type": "list users" |
||||
"type": "list access levels" |
}, |
||||
}, |
{ |
||||
{ |
"type": "list access levels" |
||||
"type": "manage index" |
}, |
||||
}, |
{ |
||||
{ |
"type": "manage index" |
||||
"type": "set user access levels" |
}, |
||||
}, |
{ |
||||
{ |
"type": "set user access levels" |
||||
"type": "manage collection" |
}, |
||||
} |
{ |
||||
] |
"type": "manage collection" |
||||
} |
} |
||||
] |
] |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
|||||
@ -1,29 +0,0 @@ |
|||||
{ |
|
||||
"name": "Primary Button", |
|
||||
"description": "", |
|
||||
"inherits": "@budibase/standard-components/button", |
|
||||
"props": { |
|
||||
"onClick": [ |
|
||||
{ |
|
||||
"##eventHandlerType": "Load Record", |
|
||||
"parameters": { |
|
||||
"recordKey": "waa", |
|
||||
"statePath": "yea" |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
"##eventHandlerType": "Load Record", |
|
||||
"parameters": { |
|
||||
"recordKey": "ttt", |
|
||||
"statePath": "eee" |
|
||||
} |
|
||||
} |
|
||||
], |
|
||||
"contentText": { |
|
||||
"##bbstate": "yea" |
|
||||
} |
|
||||
}, |
|
||||
"tags": [ |
|
||||
"button" |
|
||||
] |
|
||||
} |
|
||||
@ -0,0 +1,13 @@ |
|||||
|
{ |
||||
|
"name": "common/Prim Button", |
||||
|
"description": "a styled button", |
||||
|
"inherits": "@budibase/standard-components/button", |
||||
|
"props": { |
||||
|
"padding": "5px 7px", |
||||
|
"border": "1px solid #EEE", |
||||
|
"color": "#5F6368", |
||||
|
"background": "##f2f2f2", |
||||
|
"hoverColor": "black", |
||||
|
"hoverBackground": "#cccccc" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
{ |
||||
|
"name": "common/Primary Button", |
||||
|
"description": "a styled button", |
||||
|
"inherits": "@budibase/standard-components/button", |
||||
|
"props": { |
||||
|
"padding": "5px 7px", |
||||
|
"border": "1px solid #EEE", |
||||
|
"color": "#5F6368", |
||||
|
"background": "##f2f2f2", |
||||
|
"hoverColor": "black", |
||||
|
"hoverBackground": "#cccccc" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
{ |
||||
|
"name": "common/Secondary Button", |
||||
|
"description": "a styled button", |
||||
|
"inherits": "@budibase/standard-components/button", |
||||
|
"props": { |
||||
|
"padding": "5px 7px", |
||||
|
"border": "1px solid #EEE", |
||||
|
"color": "#5F6368", |
||||
|
"background": "##f2f2f2", |
||||
|
"hoverColor": "black", |
||||
|
"hoverBackground": "#cccccc" |
||||
|
} |
||||
|
} |
||||
@ -1,15 +0,0 @@ |
|||||
{ |
|
||||
"name": "containers/two_columns_yes", |
|
||||
"description": "", |
|
||||
"inherits": "@budibase/standard-components/grid", |
|
||||
"props": { |
|
||||
"gridTemplateColumns": "[left] 1fr [right] 1fr" |
|
||||
}, |
|
||||
"tags": [ |
|
||||
"div", |
|
||||
"container", |
|
||||
"layout", |
|
||||
"panel", |
|
||||
"grid" |
|
||||
] |
|
||||
} |
|
||||
@ -1,65 +0,0 @@ |
|||||
{ |
|
||||
"name": "mike", |
|
||||
"description": "", |
|
||||
"inherits": "containers_eh/two_columns_yes", |
|
||||
"props": { |
|
||||
"children": [ |
|
||||
{ |
|
||||
"_component": "#children#array_element", |
|
||||
"control": { |
|
||||
"_component": "@budibase/standard-components/button", |
|
||||
"contentText": "Click Me", |
|
||||
"contentComponent": { |
|
||||
"_component": "" |
|
||||
}, |
|
||||
"className": "default", |
|
||||
"disabled": false, |
|
||||
"onClick": [ |
|
||||
{ |
|
||||
"##eventHandlerType": "Set State", |
|
||||
"parameters": { |
|
||||
"path": "SomeText", |
|
||||
"value": "hello !" |
|
||||
} |
|
||||
} |
|
||||
] |
|
||||
}, |
|
||||
"gridColumn": "left", |
|
||||
"gridRow": "", |
|
||||
"gridColumnStart": "", |
|
||||
"gridColumnEnd": "", |
|
||||
"gridRowStart": "", |
|
||||
"gridRowEnd": "" |
|
||||
}, |
|
||||
{ |
|
||||
"_component": "#children#array_element", |
|
||||
"control": { |
|
||||
"_component": "@budibase/standard-components/button", |
|
||||
"contentText": { |
|
||||
"##bbstate": "SomeText", |
|
||||
"##bbstatefallback": "(none)" |
|
||||
}, |
|
||||
"contentComponent": { |
|
||||
"_component": "" |
|
||||
}, |
|
||||
"className": "default", |
|
||||
"disabled": false, |
|
||||
"onClick": [] |
|
||||
}, |
|
||||
"gridColumn": "", |
|
||||
"gridRow": "", |
|
||||
"gridColumnStart": "", |
|
||||
"gridColumnEnd": "", |
|
||||
"gridRowStart": "", |
|
||||
"gridRowEnd": "" |
|
||||
} |
|
||||
] |
|
||||
}, |
|
||||
"tags": [ |
|
||||
"div", |
|
||||
"container", |
|
||||
"layout", |
|
||||
"panel", |
|
||||
"grid" |
|
||||
] |
|
||||
} |
|
||||
File diff suppressed because one or more lines are too long
@ -1 +1 @@ |
|||||
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":[{"name":"customer_invoices","type":"index","map":"return {...record};","filter":"","indexType":"ancestor","getShardName":"","getSortKey":"record.id","aggregateGroups":[],"allowedRecordNodeIds":[2],"nodeId":5}],"allidsShardFactor":64,"collectionName":"customers","isSingle":false}],"pathMaps":[],"indexes":[{"name":"Yeo index","type":"index","map":"return {...record};","filter":"","indexType":"ancestor","getShardName":"","getSortKey":"record.id","aggregateGroups":[],"allowedRecordNodeIds":[1],"nodeId":4},{"name":"everyones_invoices","type":"index","map":"return {...record};","filter":"","indexType":"ancestor","getShardName":"","getSortKey":"record.id","aggregateGroups":[],"allowedRecordNodeIds":[2],"nodeId":6}],"nodeId":0},"componentLibraries":[{"importPath":"/lib/node_modules/@budibase/standard-components/dist/index.js","libName":"@budibase/standard-components"}],"appRootPath":"/testApp2","props":{"_component":"@budibase/standard-components/grid","gridTemplateRows":"","gridTemplateColumns":"[left] 1fr [right] 1fr","children":[{"_component":"children#array_element#","control":{"_component":"@budibase/standard-components/button","contentText":"Click Me","contentComponent":{"_component":""},"className":"default","disabled":false,"onClick":[{"##eventHandlerType":"Set State","parameters":{"path":"SomeText","value":"hello !"}}]},"gridColumn":"left","gridRow":"","gridColumnStart":"","gridColumnEnd":"","gridRowStart":"","gridRowEnd":""},{"_component":"children#array_element#","control":{"_component":"@budibase/standard-components/button","contentText":{"##bbstate":"SomeText","##bbstatefallback":"(none)"},"contentComponent":{"_component":""},"className":"default","disabled":false,"onClick":[]},"gridColumn":"","gridRow":"","gridColumnStart":"","gridColumnEnd":"","gridRowStart":"","gridRowEnd":""}],"width":"auto","height":"auto","containerClass":"","itemContainerClass":""}} |
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":[{"name":"customer_invoices","type":"index","map":"return {...record};","filter":"","indexType":"ancestor","getShardName":"","getSortKey":"record.id","aggregateGroups":[],"allowedRecordNodeIds":[2],"nodeId":5}],"allidsShardFactor":64,"collectionName":"customers","isSingle":false}],"pathMaps":[],"indexes":[{"name":"Yeo index","type":"index","map":"return {...record};","filter":"","indexType":"ancestor","getShardName":"","getSortKey":"record.id","aggregateGroups":[],"allowedRecordNodeIds":[1],"nodeId":4},{"name":"everyones_invoices","type":"index","map":"return {...record};","filter":"","indexType":"ancestor","getShardName":"","getSortKey":"record.id","aggregateGroups":[],"allowedRecordNodeIds":[2],"nodeId":6}],"nodeId":0},"componentLibraries":[{"importPath":"/lib/node_modules/@budibase/standard-components/dist/index.js","libName":"@budibase/standard-components"}],"appRootPath":"/testApp2","props":{"_component":"@budibase/standard-components/button","contentText":"Button","contentComponent":{"_component":""},"className":"default","disabled":false,"onClick":[],"background":"##f2f2f2","color":"#5F6368","border":"1px solid #EEE","padding":"5px 7px","hoverColor":"black","hoverBackground":"#cccccc","hoverBorder":""}} |
||||
File diff suppressed because one or more lines are too long
@ -1 +1 @@ |
|||||
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":[{"name":"customer_invoices","type":"index","map":"return {...record};","filter":"","indexType":"ancestor","getShardName":"","getSortKey":"record.id","aggregateGroups":[],"allowedRecordNodeIds":[2],"nodeId":5}],"allidsShardFactor":64,"collectionName":"customers","isSingle":false}],"pathMaps":[],"indexes":[{"name":"Yeo index","type":"index","map":"return {...record};","filter":"","indexType":"ancestor","getShardName":"","getSortKey":"record.id","aggregateGroups":[],"allowedRecordNodeIds":[1],"nodeId":4},{"name":"everyones_invoices","type":"index","map":"return {...record};","filter":"","indexType":"ancestor","getShardName":"","getSortKey":"record.id","aggregateGroups":[],"allowedRecordNodeIds":[2],"nodeId":6}],"nodeId":0},"componentLibraries":[{"importPath":"/lib/node_modules/@budibase/standard-components/dist/index.js","libName":"@budibase/standard-components"}],"appRootPath":"/testApp2","props":{"_component":"@budibase/standard-components/grid","gridTemplateRows":"","gridTemplateColumns":"[left] 1fr [right] 1fr","children":[],"width":"auto","height":"auto","containerClass":"","itemContainerClass":""}} |
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":[{"name":"customer_invoices","type":"index","map":"return {...record};","filter":"","indexType":"ancestor","getShardName":"","getSortKey":"record.id","aggregateGroups":[],"allowedRecordNodeIds":[2],"nodeId":5}],"allidsShardFactor":64,"collectionName":"customers","isSingle":false}],"pathMaps":[],"indexes":[{"name":"Yeo index","type":"index","map":"return {...record};","filter":"","indexType":"ancestor","getShardName":"","getSortKey":"record.id","aggregateGroups":[],"allowedRecordNodeIds":[1],"nodeId":4},{"name":"everyones_invoices","type":"index","map":"return {...record};","filter":"","indexType":"ancestor","getShardName":"","getSortKey":"record.id","aggregateGroups":[],"allowedRecordNodeIds":[2],"nodeId":6}],"nodeId":0},"componentLibraries":[{"importPath":"/lib/node_modules/@budibase/standard-components/dist/index.js","libName":"@budibase/standard-components"}],"appRootPath":"/testApp2","props":{"_component":"@budibase/standard-components/button","contentText":"Button","contentComponent":{"_component":""},"className":"default","disabled":false,"onClick":[],"background":"##f2f2f2","color":"#5F6368","border":"1px solid #EEE","padding":"5px 7px","hoverColor":"black","hoverBackground":"#cccccc","hoverBorder":""}} |
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,13 +1,13 @@ |
|||||
#current_component.svelte-1xqz9vm{height:100%;width:100%} |
#current_component.svelte-1xqz9vm{height:100%;width:100%} |
||||
.form-root.svelte-m9d6ue{display:grid;grid-template-columns:[label] auto [control] 1fr}.label.svelte-m9d6ue{grid-column-start:label;padding:5px 10px;vertical-align:middle}.control.svelte-m9d6ue{grid-column-start:control;padding:5px 10px}.overflow.svelte-m9d6ue{grid-column-start:overflow}.full-width.svelte-m9d6ue{width:100%} |
.root.svelte-10kw8to{display:grid} |
||||
.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 |
.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 |
||||
}.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} |
}.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-10kw8to{display:grid} |
.form-root.svelte-m9d6ue{display:grid;grid-template-columns:[label] auto [control] 1fr}.label.svelte-m9d6ue{grid-column-start:label;padding:5px 10px;vertical-align:middle}.control.svelte-m9d6ue{grid-column-start:control;padding:5px 10px}.overflow.svelte-m9d6ue{grid-column-start:overflow}.full-width.svelte-m9d6ue{width:100%} |
||||
.default.svelte-1ec4wqj{width:100%;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.svelte-1ec4wqj:disabled{color:#ccc} |
|
||||
.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} |
|
||||
.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-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} |
||||
.horizontal.svelte-osi0db{display:inline-block}.vertical.svelte-osi0db{display:block} |
.default.svelte-1ec4wqj{width:100%;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.svelte-1ec4wqj:disabled{color:#ccc} |
||||
.panel.svelte-6yfcjx:hover{background:var(--hoverBackground);color:var(--hoverColor)} |
.panel.svelte-6yfcjx:hover{background:var(--hoverBackground);color:var(--hoverColor)} |
||||
|
.horizontal.svelte-osi0db{display:inline-block}.vertical.svelte-osi0db{display:block} |
||||
|
.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} |
||||
.default.svelte-1q8lga0{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-1q8lga0:active{background-color:#ddd}.default.svelte-1q8lga0:focus{border-color:#666} |
.default.svelte-1q8lga0{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-1q8lga0:active{background-color:#ddd}.default.svelte-1q8lga0:focus{border-color:#666} |
||||
|
|
||||
/*# sourceMappingURL=bundle.css.map */ |
/*# sourceMappingURL=bundle.css.map */ |
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,16 @@ |
|||||
|
import resolve from 'rollup-plugin-node-resolve'; |
||||
|
|
||||
|
export default { |
||||
|
input: 'src/generators.js', |
||||
|
output: [ |
||||
|
{ |
||||
|
file: "dist/generators.js", |
||||
|
format: 'esm', |
||||
|
name:"budibaseStandardComponents", |
||||
|
sourcemap: "inline" |
||||
|
} |
||||
|
], |
||||
|
plugins: [ |
||||
|
resolve() |
||||
|
] |
||||
|
}; |
||||
@ -0,0 +1,6 @@ |
|||||
|
export { app } from "./generators/appGenerator"; |
||||
|
export { forms } from "./generators/formsGenerator"; |
||||
|
export { buttons } from "./generators/buttonsGenerator"; |
||||
|
export { headers } from "./generators/headersGenerator"; |
||||
|
export { nav } from "./generators/navGenerator"; |
||||
|
export { indexTables } from "./generators/indexTablesGenerator"; |
||||
@ -0,0 +1,11 @@ |
|||||
|
import { forms } from "./formsGenerator"; |
||||
|
import { nav } from "./navGenerator"; |
||||
|
|
||||
|
export const app = (params) => { |
||||
|
|
||||
|
return [ |
||||
|
...nav(params), |
||||
|
...forms(params) |
||||
|
]; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,28 @@ |
|||||
|
export const buttons = () => [ |
||||
|
{ |
||||
|
name: "common/Primary Button", |
||||
|
description: "a styled button", |
||||
|
inherits: "@budibase/standard-components/button", |
||||
|
props: { |
||||
|
padding: "5px 7px", |
||||
|
border: "1px solid #EEE", |
||||
|
color: "#5F6368", |
||||
|
background: "##f2f2f2", |
||||
|
hoverColor: "black", |
||||
|
hoverBackground: "#cccccc" |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
name: "common/Secondary Button", |
||||
|
description: "a styled button", |
||||
|
inherits: "@budibase/standard-components/button", |
||||
|
props: { |
||||
|
padding: "5px 7px", |
||||
|
border: "1px solid #EEE", |
||||
|
color: "#5F6368", |
||||
|
background: "##f2f2f2", |
||||
|
hoverColor: "black", |
||||
|
hoverBackground: "#cccccc" |
||||
|
} |
||||
|
} |
||||
|
] |
||||
@ -0,0 +1,73 @@ |
|||||
|
export const forms = ({records}) => |
||||
|
records.map(root); |
||||
|
|
||||
|
const root = record => ({ |
||||
|
name: `${record.name} Form`, |
||||
|
description: `All fields on record '${record.nodeKey()}' `, |
||||
|
inherits: "@budibase/standard-components/stackpanel", |
||||
|
props: { |
||||
|
direction: "vertical", |
||||
|
children: [ |
||||
|
{ |
||||
|
_component: "common/Header 1", |
||||
|
value: `Edit ${record.name}`, |
||||
|
}, |
||||
|
form(record), |
||||
|
saveCancelButtons(record) |
||||
|
] |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
const form = record => ({ |
||||
|
_component: "@budibase/standard-components/form", |
||||
|
formControls: [ |
||||
|
record.fields.map(f => ({ |
||||
|
label: f.label, |
||||
|
control: { |
||||
|
_component: "@budibase/standard-components/textbox", |
||||
|
value: { |
||||
|
"##bbstate":`current${record.name}.${f.name}`, |
||||
|
"##bbsource":"store" |
||||
|
} |
||||
|
} |
||||
|
})) |
||||
|
] |
||||
|
}) |
||||
|
|
||||
|
const saveCancelButtons = (record) => ({ |
||||
|
_component: "@budibase/standard-components/stackpanel", |
||||
|
direction: "horizontal", |
||||
|
children: [ |
||||
|
paddedPanelForButton({ |
||||
|
_component: "common/Primary Button", |
||||
|
contentText: `Save ${record.name}`, |
||||
|
onClick: [ |
||||
|
{ |
||||
|
"##eventHandlerType": "Save Record", |
||||
|
parameters: { |
||||
|
statePath: `current${record.name}`, |
||||
|
} |
||||
|
} |
||||
|
] |
||||
|
}), |
||||
|
paddedPanelForButton({ |
||||
|
_component: "common/Secondary Button", |
||||
|
contentText: `Cancel`, |
||||
|
onClick: [ |
||||
|
{ |
||||
|
"##eventHandlerType": "Save Record", |
||||
|
parameters: { |
||||
|
statePath: `current${record.name}`, |
||||
|
} |
||||
|
} |
||||
|
] |
||||
|
}) |
||||
|
] |
||||
|
}) |
||||
|
|
||||
|
const paddedPanelForButton = (button) => ({ |
||||
|
_component: "@budibase/standard-components/panel", |
||||
|
padding: "20px", |
||||
|
component: button |
||||
|
}); |
||||
|
|
||||
@ -0,0 +1,34 @@ |
|||||
|
export const headers = () => [ |
||||
|
{ |
||||
|
name: "common/H1", |
||||
|
description: "Header 1", |
||||
|
inherits: "@budibase/standard-components/text", |
||||
|
props: { |
||||
|
font: "20pt", |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
name: "common/H2", |
||||
|
description: "Header 2", |
||||
|
inherits: "@budibase/standard-components/text", |
||||
|
props: { |
||||
|
font: "15pt", |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
name: "common/H3", |
||||
|
description: "Header 3", |
||||
|
inherits: "@budibase/standard-components/text", |
||||
|
props: { |
||||
|
font: "12pt bold", |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
name: "common/H4", |
||||
|
description: "Header 4", |
||||
|
inherits: "@budibase/standard-components/text", |
||||
|
props: { |
||||
|
font: "10pt bold", |
||||
|
} |
||||
|
} |
||||
|
] |
||||
@ -0,0 +1,25 @@ |
|||||
|
export const indexTables = ({indexes, helpers}) => |
||||
|
indexes.filter(i => i.parent().type === "root") |
||||
|
.map(i => indexTable(i, helpers)); |
||||
|
|
||||
|
export const indexTableProps = (index, helpers) => ({ |
||||
|
data: { |
||||
|
"##bbstate":index.nodeKey(), |
||||
|
"##bbsource":"store" |
||||
|
}, |
||||
|
columns: helpers.indexSchema(index).map(column) |
||||
|
}); |
||||
|
|
||||
|
const indexTable = (index, helpers) => ({ |
||||
|
name: `tables/${index.name} Table`, |
||||
|
inherits: "@budibase/standard-components/table", |
||||
|
props: indexTableProps(index, helpers) |
||||
|
}); |
||||
|
|
||||
|
const column = (col) => ({ |
||||
|
title: col.name, |
||||
|
value: { |
||||
|
"##bbstate": col.name, |
||||
|
"##bbsource":"context" |
||||
|
} |
||||
|
}) |
||||
@ -0,0 +1,21 @@ |
|||||
|
import {indexTables} from "./indexTablesGenerator"; |
||||
|
|
||||
|
export const nav = ({records, indexes, helpers}) => [ |
||||
|
{ |
||||
|
name: "Application Root", |
||||
|
inherits: "@budibase/standard-components/nav", |
||||
|
props: { |
||||
|
items: index.map(navItem) |
||||
|
} |
||||
|
}, |
||||
|
...indexTables({records, indexes, helpers}) |
||||
|
] |
||||
|
|
||||
|
|
||||
|
export const navItem = (index) => ({ |
||||
|
title: index.name, |
||||
|
component : { |
||||
|
_component: `tables/${index.name} Table` |
||||
|
} |
||||
|
}) |
||||
|
|
||||
Loading…
Reference in new issue