mirror of https://github.com/Budibase/budibase.git
committed by
GitHub
125 changed files with 32968 additions and 23423 deletions
@ -0,0 +1,5 @@ |
|||||
|
packages/builder/src/userInterface/CurrentItemPreview.svelte |
||||
|
public |
||||
|
dist |
||||
|
packages/server/builder |
||||
|
**/*.spec.js |
||||
@ -1,27 +1,28 @@ |
|||||
/** |
/** |
||||
* buildStateOrigins |
* buildStateOrigins |
||||
* |
* |
||||
* Builds an object that details all the bound state in the application, and what updates it. |
* Builds an object that details all the bound state in the application, and what updates it. |
||||
* |
* |
||||
* @param screenDefinition - the screen definition metadata. |
* @param screenDefinition - the screen definition metadata. |
||||
* @returns {Object} an object with the client state values and how they are managed. |
* @returns {Object} an object with the client state values and how they are managed. |
||||
*/ |
*/ |
||||
export const buildStateOrigins = screenDefinition => { |
export const buildStateOrigins = screenDefinition => { |
||||
const origins = {}; |
const origins = {} |
||||
|
|
||||
function traverse(propValue) { |
function traverse(propValue) { |
||||
for (let key in propValue) { |
for (let key in propValue) { |
||||
if (!Array.isArray(propValue[key])) continue; |
if (!Array.isArray(propValue[key])) continue |
||||
|
|
||||
if (key === "_children") propValue[key].forEach(traverse); |
if (key === "_children") propValue[key].forEach(traverse) |
||||
|
|
||||
for (let element of propValue[key]) { |
for (let element of propValue[key]) { |
||||
if (element["##eventHandlerType"] === "Set State") origins[element.parameters.path] = element; |
if (element["##eventHandlerType"] === "Set State") |
||||
} |
origins[element.parameters.path] = element |
||||
} |
} |
||||
} |
} |
||||
|
} |
||||
|
|
||||
traverse(screenDefinition.props); |
traverse(screenDefinition.props) |
||||
|
|
||||
return origins; |
return origins |
||||
}; |
} |
||||
|
|||||
@ -1 +1 @@ |
|||||
export { default } from "./PropertyCascader.svelte" |
export { default } from "./PropertyCascader.svelte" |
||||
|
|||||
@ -1,30 +1,32 @@ |
|||||
import { buildStateOrigins } from "../src/builderStore/buildStateOrigins"; |
import { buildStateOrigins } from "../src/builderStore/buildStateOrigins" |
||||
|
|
||||
it("builds the correct stateOrigins object from a screen definition with handlers", () => { |
it("builds the correct stateOrigins object from a screen definition with handlers", () => { |
||||
expect(buildStateOrigins({ |
expect( |
||||
"name": "screen1", |
buildStateOrigins({ |
||||
"description": "", |
name: "screen1", |
||||
"props": { |
description: "", |
||||
"_component": "@budibase/standard-components/container", |
props: { |
||||
"className": "", |
_component: "@budibase/standard-components/container", |
||||
"type": "div", |
className: "", |
||||
"onClick": [ |
type: "div", |
||||
{ |
onClick: [ |
||||
"##eventHandlerType": "Set State", |
{ |
||||
"parameters": { |
"##eventHandlerType": "Set State", |
||||
"path": "testKey", |
parameters: { |
||||
"value": "value" |
path: "testKey", |
||||
} |
value: "value", |
||||
} |
}, |
||||
] |
}, |
||||
} |
], |
||||
})).toEqual({ |
}, |
||||
"testKey": { |
}) |
||||
|
).toEqual({ |
||||
|
testKey: { |
||||
"##eventHandlerType": "Set State", |
"##eventHandlerType": "Set State", |
||||
"parameters": { |
parameters: { |
||||
"path": "testKey", |
path: "testKey", |
||||
"value": "value" |
value: "value", |
||||
} |
}, |
||||
} |
}, |
||||
}); |
}) |
||||
}); |
}) |
||||
|
|||||
@ -1 +1 @@ |
|||||
module.exports = config => ({}) |
module.exports = () => ({}) |
||||
|
|||||
@ -1,4 +1,3 @@ |
|||||
import "./_style.scss"; |
import "./_style.scss" |
||||
export { default as Checkbox } from "./Checkbox.svelte"; |
export { default as Checkbox } from "./Checkbox.svelte" |
||||
export { default as Checkboxgroup } from "./CheckboxGroup.svelte"; |
export { default as Checkboxgroup } from "./CheckboxGroup.svelte" |
||||
|
|
||||
|
|||||
@ -1,19 +1,19 @@ |
|||||
import { writable } from "svelte/store"; |
import { writable } from "svelte/store" |
||||
|
|
||||
function store() { |
function store() { |
||||
const { set, update, subscribe } = writable({}); |
const { set, update, subscribe } = writable({}) |
||||
|
|
||||
function setInput(inp) { |
function setInput(inp) { |
||||
update(n => { |
update(n => { |
||||
n.input = inp; |
n.input = inp |
||||
}); |
}) |
||||
} |
} |
||||
|
|
||||
return { |
return { |
||||
subscribe, |
subscribe, |
||||
set, |
set, |
||||
setInput |
setInput, |
||||
}; |
} |
||||
} |
} |
||||
|
|
||||
export const fieldStore = store(); |
export const fieldStore = store() |
||||
|
|||||
@ -1,12 +1,12 @@ |
|||||
<script> |
<script> |
||||
import { getContext } from "svelte"; |
import { getContext } from "svelte" |
||||
|
|
||||
export let icon = ""; |
export let icon = "" |
||||
|
|
||||
let iconContext = getContext("BBMD:icon:context"); |
let iconContext = getContext("BBMD:icon:context") |
||||
let cls = iconContext |
let cls = iconContext |
||||
? `material-icons mdc-${iconContext}__icon` |
? `material-icons mdc-${iconContext}__icon` |
||||
: "material-icons"; |
: "material-icons" |
||||
</script> |
</script> |
||||
|
|
||||
<i class={cls}>{icon}</i> |
<i class={cls}>{icon}</i> |
||||
|
|||||
@ -1,14 +1,13 @@ |
|||||
<script> |
<script> |
||||
import { getContext } from "svelte" |
import { getContext } from "svelte" |
||||
|
|
||||
export let _bb |
export let _bb |
||||
|
|
||||
const cb = _bb.getContext("BBMD:data-table:cb") |
const cb = _bb.getContext("BBMD:data-table:cb") |
||||
|
|
||||
let tbody |
let tbody |
||||
|
|
||||
$: tbody && _bb.attachChildren(tbody) |
|
||||
|
|
||||
|
$: tbody && _bb.attachChildren(tbody) |
||||
</script> |
</script> |
||||
|
|
||||
<tbody bind:this={tbody} class={cb.elem`content`}></tbody> |
<tbody bind:this={tbody} class={cb.elem`content`} /> |
||||
|
|||||
@ -1,13 +1,11 @@ |
|||||
<script> |
<script> |
||||
|
export let _bb |
||||
|
|
||||
export let _bb |
const cb = _bb.getContext("BBMD:data-table:cb") |
||||
|
|
||||
const cb = _bb.getContext("BBMD:data-table:cb") |
let thead |
||||
|
|
||||
let thead |
|
||||
|
|
||||
$: thead && _bb.attachChildren(thead) |
|
||||
|
|
||||
|
$: thead && _bb.attachChildren(thead) |
||||
</script> |
</script> |
||||
|
|
||||
<thead bind:this={thead} class=className></thead> |
<thead bind:this={thead} class="className" /> |
||||
|
|||||
@ -1,2 +1,2 @@ |
|||||
import "./_styles.scss"; |
import "./_styles.scss" |
||||
export { default as Menu } from "./Menu.svelte"; |
export { default as Menu } from "./Menu.svelte" |
||||
|
|||||
@ -1,3 +1,3 @@ |
|||||
import "./_style.scss"; |
import "./_style.scss" |
||||
export { default as Radiobutton } from "./Radiobutton.svelte"; |
export { default as Radiobutton } from "./Radiobutton.svelte" |
||||
export { default as Radiobuttongroup } from "./RadiobuttonGroup.svelte"; |
export { default as Radiobuttongroup } from "./RadiobuttonGroup.svelte" |
||||
|
|||||
@ -1,2 +1,2 @@ |
|||||
import "./_index.scss" |
import "./_index.scss" |
||||
export { default as Textfield } from "./Textfield.svelte" |
export { default as Textfield } from "./Textfield.svelte" |
||||
|
|||||
@ -1,13 +1,13 @@ |
|||||
import "./_style.scss"; |
import "./_style.scss" |
||||
export { default as Body1 } from "./Body1.svelte"; |
export { default as Body1 } from "./Body1.svelte" |
||||
export { default as Body2 } from "./Body2.svelte"; |
export { default as Body2 } from "./Body2.svelte" |
||||
export { default as Caption } from "./Caption.svelte"; |
export { default as Caption } from "./Caption.svelte" |
||||
export { default as H1 } from "./H1.svelte"; |
export { default as H1 } from "./H1.svelte" |
||||
export { default as H2 } from "./H2.svelte"; |
export { default as H2 } from "./H2.svelte" |
||||
export { default as H3 } from "./H3.svelte"; |
export { default as H3 } from "./H3.svelte" |
||||
export { default as H4 } from "./H4.svelte"; |
export { default as H4 } from "./H4.svelte" |
||||
export { default as H5 } from "./H5.svelte"; |
export { default as H5 } from "./H5.svelte" |
||||
export { default as H6 } from "./H6.svelte"; |
export { default as H6 } from "./H6.svelte" |
||||
export { default as Overline } from "./Overline.svelte"; |
export { default as Overline } from "./Overline.svelte" |
||||
export { default as Sub1 } from "./Sub1.svelte"; |
export { default as Sub1 } from "./Sub1.svelte" |
||||
export { default as Sub2 } from "./Sub2.svelte"; |
export { default as Sub2 } from "./Sub2.svelte" |
||||
|
|||||
File diff suppressed because it is too large
File diff suppressed because one or more lines are too long
@ -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/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_DEFINITION##'] = {"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","type":"div"}},"screens":[{"name":"screen1","description":"","props":{"_component":"@budibase/standard-components/container","className":"","type":"div"},"_css":"/css/d121e1ecc6cf44f433213222e9ff5d40.css"},{"name":"screen2","description":"","props":{"_component":"@budibase/standard-components/container","className":"","type":"div"},"_css":"/css/7b7c05b78e05c06eb8d69475caadfea3.css"}]}; |
||||
window['##BUDIBASE_FRONTEND_FUNCTIONS##'] = {'1234':() => 'test return'} |
window['##BUDIBASE_FRONTEND_FUNCTIONS##'] = {'1234':() => 'test return'} |
||||
@ -1 +1 @@ |
|||||
module.exports = config => ({}) |
module.exports = () => ({}) |
||||
|
|||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue