forked from tsai/budibase
44 changed files with 231 additions and 148 deletions
@ -1,3 +1,5 @@ |
|||||
import { initialise } from "./initialise"; |
import { initialise } from "./initialise"; |
||||
|
|
||||
initialise(); |
const appDefinition = window["##BUDIBASE_APPDEFINITION##"]; |
||||
|
|
||||
|
initialise(appDefinition); |
||||
Binary file not shown.
@ -0,0 +1,11 @@ |
|||||
|
{ |
||||
|
"name": "Joes Button", |
||||
|
"description": "", |
||||
|
"inherits": "./standard-components/button", |
||||
|
"props": { |
||||
|
"className": "btn btn-danger" |
||||
|
}, |
||||
|
"tags": [ |
||||
|
"button" |
||||
|
] |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
{ |
||||
|
"name": "another noubtbtk", |
||||
|
"description": "", |
||||
|
"inherits": "./standard-components/button", |
||||
|
"props": { |
||||
|
"contentText": "Mike" |
||||
|
}, |
||||
|
"tags": [ |
||||
|
"button" |
||||
|
] |
||||
|
} |
||||
@ -0,0 +1,41 @@ |
|||||
|
{ |
||||
|
"name": "listofstuff", |
||||
|
"description": "", |
||||
|
"inherits": "./standard-components/stackpanel", |
||||
|
"props": { |
||||
|
"children": [ |
||||
|
{ |
||||
|
"_component": "listofstuff:children", |
||||
|
"control": { |
||||
|
"_component": "Primary Button", |
||||
|
"contentText": "Button", |
||||
|
"contentComponent": { |
||||
|
"_component": "" |
||||
|
}, |
||||
|
"className": "btn btn-primary", |
||||
|
"disabled": false |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
"_component": "listofstuff:children", |
||||
|
"control": { |
||||
|
"_component": "Joes Button", |
||||
|
"contentText": "Button", |
||||
|
"contentComponent": { |
||||
|
"_component": "" |
||||
|
}, |
||||
|
"className": "btn btn-danger", |
||||
|
"disabled": false |
||||
|
} |
||||
|
} |
||||
|
], |
||||
|
"_component": "listofstuff", |
||||
|
"direction": "vertical" |
||||
|
}, |
||||
|
"tags": [ |
||||
|
"div", |
||||
|
"container", |
||||
|
"layout", |
||||
|
"panel" |
||||
|
] |
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
{ |
||||
|
"name": "login2", |
||||
|
"description": "", |
||||
|
"inherits": "./standard-components/login", |
||||
|
"props": { |
||||
|
"usernameLabel": "User" |
||||
|
}, |
||||
|
"tags": [ |
||||
|
"login", |
||||
|
"credentials", |
||||
|
"password", |
||||
|
"logon" |
||||
|
] |
||||
|
} |
||||
@ -0,0 +1,15 @@ |
|||||
|
{ |
||||
|
"name": "testapp2", |
||||
|
"version": "1.0.0", |
||||
|
"description": "", |
||||
|
"main": "plugins.js", |
||||
|
"scripts": { |
||||
|
"test": "echo \"Error: no test specified\" && exit 1" |
||||
|
}, |
||||
|
"author": "", |
||||
|
"license": "ISC", |
||||
|
"dependencies": { |
||||
|
"budibase-client": "file:../../../client/dist", |
||||
|
"budibase-standard-components": "file:../../../standard-components/dist" |
||||
|
} |
||||
|
} |
||||
@ -1,20 +1,12 @@ |
|||||
{ |
{ |
||||
"main": { |
"main": { |
||||
"index": { |
"index": {}, |
||||
"title": "yyyaaa" |
"appBody": "" |
||||
}, |
|
||||
"appBody": "Random Button" |
|
||||
}, |
}, |
||||
"unauthenticated": { |
"unauthenticated": { |
||||
"index": { |
"index": {}, |
||||
"title": "Test App 1 - Login" |
"appBody": "" |
||||
}, |
|
||||
"appBody": "login_screen" |
|
||||
}, |
}, |
||||
"componentLibraries": [ |
"componentLibraries": [], |
||||
"./standard-components" |
"stylesheets": [] |
||||
], |
|
||||
"stylesheets": [ |
|
||||
"https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" |
|
||||
] |
|
||||
} |
} |
||||
|
|||||
@ -1,53 +0,0 @@ |
|||||
<script> |
|
||||
export let className = "default"; |
|
||||
export let disabled = false; |
|
||||
export let contentText; |
|
||||
export let contentComponent; |
|
||||
|
|
||||
export let _app; |
|
||||
let contentComponentContainer; |
|
||||
|
|
||||
$:{ |
|
||||
if(_app && contentComponentContainer) |
|
||||
_app.initialiseComponent(contentComponent, contentComponentContainer); |
|
||||
} |
|
||||
|
|
||||
</script> |
|
||||
|
|
||||
|
|
||||
<button class={className} {disabled} on:click> |
|
||||
{#if contentComponent && contentComponent._component} |
|
||||
<div bind:this={contentComponentContainer}> |
|
||||
</div> |
|
||||
{:else if contentText} |
|
||||
{contentText} |
|
||||
{:else} |
|
||||
<slot /> |
|
||||
{/if} |
|
||||
</button> |
|
||||
|
|
||||
|
|
||||
<style> |
|
||||
|
|
||||
.default { |
|
||||
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:active { |
|
||||
background-color: #ddd; |
|
||||
} |
|
||||
|
|
||||
.default:focus { |
|
||||
border-color: #666; |
|
||||
} |
|
||||
|
|
||||
</style> |
|
||||
@ -0,0 +1,9 @@ |
|||||
|
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. |
||||
|
# yarn lockfile v1 |
||||
|
|
||||
|
|
||||
|
"budibase-client@file:../../../client/dist": |
||||
|
version "0.0.1" |
||||
|
|
||||
|
"budibase-standard-components@file:../../../standard-components/dist": |
||||
|
version "1.0.0" |
||||
@ -0,0 +1,25 @@ |
|||||
|
const { appPackageFolder } = require("../createAppPackage"); |
||||
|
const { writeJSON } = require("fs-extra"); |
||||
|
const buildApp = require("./buildApp"); |
||||
|
|
||||
|
module.exports = async (config, appname, pkg) => { |
||||
|
const appPath = appPackageFolder(config, appname); |
||||
|
await writeJSON( |
||||
|
`${appPath}/appDefinition.json`, |
||||
|
pkg.appDefinition, |
||||
|
{spaces:2}); |
||||
|
|
||||
|
await writeJSON( |
||||
|
`${appPath}/access_levels.json`, |
||||
|
pkg.accessLevels, |
||||
|
{spaces:2}); |
||||
|
|
||||
|
await writeJSON( |
||||
|
`${appPath}/pages.json`, |
||||
|
pkg.pages, |
||||
|
{spaces:2}); |
||||
|
|
||||
|
await buildApp( |
||||
|
config, appname, |
||||
|
pkg.pages, pkg.appDefinition); |
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
{ |
||||
|
"name": "budibase-standard-components", |
||||
|
"svelte": "src/index.svelte", |
||||
|
"main": "index.js", |
||||
|
"devDependencies": {}, |
||||
|
"keywords": [ |
||||
|
"budibase" |
||||
|
], |
||||
|
"files": [ |
||||
|
"dist" |
||||
|
], |
||||
|
"version": "1.0.0", |
||||
|
"license": "MPL-2.0" |
||||
|
} |
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
@ -0,0 +1,6 @@ |
|||||
|
export {default as button} from "./Button.svelte"; |
||||
|
export {default as login} from "./Login.svelte"; |
||||
|
export {default as form} from "./Form.svelte"; |
||||
|
export {default as formControl} from "./FormControl.svelte"; |
||||
|
export {default as textbox} from "./Textbox.svelte"; |
||||
|
export {default as stackpanel} from "./StackPanel.svelte"; |
||||
Loading…
Reference in new issue