mirror of https://github.com/Budibase/budibase.git
94 changed files with 3245 additions and 32785 deletions
@ -0,0 +1,193 @@ |
|||
.svench-content { |
|||
color: #666; |
|||
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, "Roboto", |
|||
Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; |
|||
} |
|||
|
|||
h1.svench-content { |
|||
font-size: 2em; |
|||
} |
|||
h2.svench-content { |
|||
font-size: 1.66em; |
|||
} |
|||
h3.svench-content { |
|||
font-size: 1.33em; |
|||
} |
|||
h4.svench-content { |
|||
font-size: 1.33em; |
|||
font-weight: normal; |
|||
} |
|||
h5.svench-content { |
|||
font-size: 1em; |
|||
font-weight: bold; |
|||
} |
|||
h6.svench-content { |
|||
font-size: 1em; |
|||
font-weight: normal; |
|||
font-style: italic; |
|||
} |
|||
|
|||
:root { |
|||
--background: #ffffff; |
|||
--ink: #000000; |
|||
|
|||
--grey-1: #fafafa; |
|||
--grey-2: #f5f5f5; |
|||
--grey-3: #eeeeee; |
|||
--grey-4: #e0e0e0; |
|||
--grey-5: #bdbdbd; |
|||
--grey-6: #9e9e9e; |
|||
--grey-7: #757575; |
|||
--grey-8: #616161; |
|||
--grey-9: #424242; |
|||
|
|||
--blue-light: #f1f4fc; |
|||
--blue: #4285f4; |
|||
--blue-dark: #2f4c9b; |
|||
|
|||
--red-light: #ffe6e6; |
|||
--red: #e26d69; |
|||
--red-dark: #800400; |
|||
|
|||
--yellow-light: #fff7e6; |
|||
--yellow: #ffd26a; |
|||
--yellow-dark: #805900; |
|||
|
|||
--orange-light: #fff0e6; |
|||
--orange: #f0955a; |
|||
--orange-dark: #803300; |
|||
|
|||
--green-light: #e6ffeb; |
|||
--green: #84c991; |
|||
--green-dark: #008017; |
|||
|
|||
--purple-light: #e9e6ff; |
|||
--purple: #806fde; |
|||
--purple-dark: #130080; |
|||
|
|||
--rounded-small: 4px; |
|||
--rounded-medium: 8px; |
|||
--rounded-large: 16px; |
|||
|
|||
--font-normal: "Inter"; |
|||
--font-black: "Inter Black"; |
|||
--font-bold: "Inter Bold"; |
|||
--font-medium: "Inter Medium"; |
|||
--font-light: "Inter Light"; |
|||
--font-sans: Inter, -apple-system, BlinkMacSystemFont, Segoe UI, "Inter", |
|||
"Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", |
|||
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; |
|||
--font-serif: "Georgia", Cambria, Times New Roman, Times, serif; |
|||
--font-mono: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", |
|||
monospace; |
|||
|
|||
font-size: 16px; |
|||
--font-size-xs: 0.75rem; |
|||
--font-size-s: 0.875rem; |
|||
--font-size-m: 1rem; |
|||
--font-size-l: 1.15rem; |
|||
--font-size-xl: 1.3rem; |
|||
|
|||
--heading-font-size-xs: 0.875rem; |
|||
--heading-font-size-s: 1.12rem; |
|||
--heading-font-size-m: 1.5rem; |
|||
--heading-font-size-l: 2.6rem; |
|||
--heading-font-size-xl: 3rem; |
|||
|
|||
--font-render: optimizeLegibility; |
|||
--font-smooth: antialiased; |
|||
|
|||
--spacing-xs: 0.25rem; |
|||
--spacing-s: 0.5rem; |
|||
--spacing-m: 0.75rem; |
|||
--spacing-l: 1rem; |
|||
--spacing-xl: 1.25rem; |
|||
|
|||
--layout-xs: 1.25rem; |
|||
--layout-s: 1.5rem; |
|||
--layout-m: 2rem; |
|||
--layout-l: 3rem; |
|||
--layout-xl: 4rem; |
|||
|
|||
--border-radius-xs: 0.125rem; |
|||
--border-radius-s: 0.35rem; |
|||
--border-radius-m: 0.5rem; |
|||
--border-radius-l: 1rem; |
|||
--border-radius-xl: 100rem; |
|||
|
|||
--border-black: 2px var(--ink) solid; |
|||
--border-dark: 2px var(--grey-7) solid; |
|||
--border-grey: 1px var(--grey-4) solid; |
|||
--border-grey-2: 2px var(--grey-4) solid; |
|||
--border-light: 1px var(--grey-3) solid; |
|||
--border-light-2: 2px var(--grey-3) solid; |
|||
--border-blue: 2px var(--blue) solid; |
|||
--border-transparent: 2px transparent solid; |
|||
} |
|||
|
|||
h1 { |
|||
font-size: 3rem; |
|||
font-family: var(--font-sans); |
|||
font-weight: 700; |
|||
text-rendering: var(--text-render); |
|||
-webkit-font-smoothing: var(--text-smooth); |
|||
color: var(--ink); |
|||
} |
|||
|
|||
h2 { |
|||
font-size: 2.25rem; |
|||
font-family: var(--font-sans); |
|||
font-weight: 600; |
|||
text-rendering: var(--text-render); |
|||
-webkit-font-smoothing: var(--text-smooth); |
|||
color: var(--ink); |
|||
} |
|||
|
|||
h3 { |
|||
font-size: 1.7rem; |
|||
font-family: var(--font-sans); |
|||
font-weight: 600; |
|||
text-rendering: var(--text-render); |
|||
-webkit-font-smoothing: var(--text-smooth); |
|||
color: var(--ink); |
|||
} |
|||
|
|||
h4 { |
|||
font-size: var(--font-size-xl); |
|||
font-family: var(--font-sans); |
|||
font-weight: 500; |
|||
text-rendering: var(--text-render); |
|||
-webkit-font-smoothing: var(--text-smooth); |
|||
color: var(--ink); |
|||
} |
|||
|
|||
h5 { |
|||
font-size: var(--font-size-l); |
|||
font-family: var(--font-sans); |
|||
font-weight: 500; |
|||
text-rendering: var(--text-render); |
|||
-webkit-font-smoothing: var(--text-smooth); |
|||
color: var(--ink); |
|||
} |
|||
|
|||
h6 { |
|||
font-size: var(--font-size-m); |
|||
font-family: var(--font-sans); |
|||
font-weight: 500; |
|||
text-rendering: var(--text-render); |
|||
-webkit-font-smoothing: var(--text-smooth); |
|||
color: var(--ink); |
|||
} |
|||
|
|||
p { |
|||
font-size: var(--font-size); |
|||
font-family: var(--font-sans); |
|||
font-weight: 400; |
|||
text-rendering: var(--text-render); |
|||
-webkit-font-smoothing: var(--text-smooth); |
|||
color: var(--ink); |
|||
} |
|||
|
|||
a { |
|||
text-decoration: none; |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
<!doctype html> |
|||
<html> |
|||
<head> |
|||
<meta charset='utf8'> |
|||
<meta name='viewport' content='width=device-width'> |
|||
<title>Budibase Builder</title> |
|||
<link rel='icon' type='image/png' href='./src/favicon.png'> |
|||
</head> |
|||
<body id="app"> |
|||
<script type="module" src='/src/main.js'></script> |
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,4 @@ |
|||
module.exports = { |
|||
routifyDir: ".routify", |
|||
dynamicImports: false, |
|||
} |
|||
@ -1,22 +0,0 @@ |
|||
<!doctype html> |
|||
<html> |
|||
|
|||
<head> |
|||
<meta charset='utf8'> |
|||
<meta name='viewport' content='width=device-width'> |
|||
|
|||
<title>Budibase Builder</title> |
|||
|
|||
<link rel='icon' type='image/png' href='/_builder/favicon.png'> |
|||
<link rel='stylesheet' href='/_builder/bbui.css'> |
|||
<link rel='stylesheet' href='/_builder/bundle.css'> |
|||
<link rel='stylesheet' href='/_builder/external.css'> |
|||
</head> |
|||
|
|||
<body id="app"> |
|||
|
|||
<script src='/_builder/bundle.js'></script> |
|||
|
|||
</body> |
|||
|
|||
</html> |
|||
@ -1,20 +1,12 @@ |
|||
import "@budibase/bbui/dist/bbui.css" |
|||
import "remixicon/fonts/remixicon.css" |
|||
import "./global.css" |
|||
import "./fonts.css" |
|||
import "./budibase.css" |
|||
import "./fonts.css" |
|||
import "/assets/Inter-Regular" |
|||
import "/assets/Inter-Medium" |
|||
import "/assets/Inter-SemiBold" |
|||
import "/assets/Inter-Bold" |
|||
import "/assets/Inter-ExtraBold" |
|||
import "/assets/Inter-Black" |
|||
import "/_builder/assets/budibase-logo.png" |
|||
import "/_builder/assets/budibase-logo-only.png" |
|||
import "remixicon/fonts/remixicon.css" |
|||
|
|||
import App from "./App.svelte" |
|||
|
|||
/* eslint-disable */ |
|||
const app = new App({ |
|||
export default new App({ |
|||
target: document.getElementById("app"), |
|||
}) |
|||
|
|||
@ -1,18 +0,0 @@ |
|||
<script> |
|||
import { backendUiStore } from "builderStore" |
|||
import { goto, leftover } from "@sveltech/routify" |
|||
import { onMount } from "svelte" |
|||
|
|||
onMount(async () => { |
|||
// navigate to first datasource in list, if not already selected |
|||
if ( |
|||
!$leftover && |
|||
$backendUiStore.datasources.length > 0 && |
|||
!$backendUiStore.selectedDatasourceId |
|||
) { |
|||
$goto(`./${$backendUiStore.datasources[0]._id}`) |
|||
} |
|||
}) |
|||
</script> |
|||
|
|||
<slot /> |
|||
@ -1,6 +1,6 @@ |
|||
<script> |
|||
import { goto } from "@sveltech/routify" |
|||
$goto("../table") |
|||
import { goto } from "@roxi/routify" |
|||
$goto("./table") |
|||
</script> |
|||
|
|||
<!-- routify:options index=false --> |
|||
|
|||
@ -1,19 +0,0 @@ |
|||
<script> |
|||
import { backendUiStore } from "builderStore" |
|||
import { goto, leftover } from "@sveltech/routify" |
|||
import { onMount } from "svelte" |
|||
|
|||
onMount(async () => { |
|||
// navigate to first table in list, if not already selected |
|||
// and this is the final url (i.e. no selectedTable) |
|||
if ( |
|||
!$leftover && |
|||
$backendUiStore.tables.length > 0 && |
|||
(!$backendUiStore.selectedTable || !$backendUiStore.selectedTable._id) |
|||
) { |
|||
$goto(`./${$backendUiStore.tables[0]._id}`) |
|||
} |
|||
}) |
|||
</script> |
|||
|
|||
<slot /> |
|||
@ -0,0 +1,2 @@ |
|||
<!-- routify:options index=1 --> |
|||
<slot /> |
|||
@ -1,8 +1,8 @@ |
|||
<script> |
|||
import { goto } from "@sveltech/routify" |
|||
import { goto } from "@roxi/routify" |
|||
import { FrontendTypes } from "constants" |
|||
|
|||
$goto(`../${FrontendTypes.SCREEN}`) |
|||
$goto(`./${FrontendTypes.SCREEN}`) |
|||
</script> |
|||
|
|||
<!-- routify:options index=1 --> |
|||
|
|||
@ -1,6 +1,6 @@ |
|||
<script> |
|||
import { goto } from "@sveltech/routify" |
|||
$goto("../data") |
|||
import { goto } from "@roxi/routify" |
|||
$goto("./data") |
|||
</script> |
|||
|
|||
<!-- routify:options index=false --> |
|||
|
|||
@ -0,0 +1,51 @@ |
|||
import svelte from "@sveltejs/vite-plugin-svelte" |
|||
import html from "rollup-plugin-html" |
|||
import replace from "@rollup/plugin-replace" |
|||
|
|||
import path from "path" |
|||
|
|||
export default ({ mode }) => { |
|||
const isProduction = mode === "production" |
|||
return { |
|||
build: { |
|||
minify: isProduction, |
|||
}, |
|||
plugins: [ |
|||
svelte(), |
|||
replace({ |
|||
preventAssignment: true, |
|||
"process.env.NODE_ENV": JSON.stringify( |
|||
isProduction ? "production" : "development" |
|||
), |
|||
"process.env.POSTHOG_TOKEN": JSON.stringify(process.env.POSTHOG_TOKEN), |
|||
"process.env.POSTHOG_URL": JSON.stringify(process.env.POSTHOG_URL), |
|||
"process.env.SENTRY_DSN": JSON.stringify(process.env.SENTRY_DSN), |
|||
}), |
|||
html(), |
|||
], |
|||
optimizeDeps: { |
|||
exclude: ["@roxi/routify"], |
|||
}, |
|||
resolve: { |
|||
dedupe: ["@roxi/routify"], |
|||
alias: [ |
|||
{ |
|||
find: "components", |
|||
replacement: path.resolve("./src/components"), |
|||
}, |
|||
{ |
|||
find: "builderStore", |
|||
replacement: path.resolve("./src/builderStore"), |
|||
}, |
|||
{ |
|||
find: "constants", |
|||
replacement: path.resolve("./src/constants"), |
|||
}, |
|||
{ |
|||
find: "analytics", |
|||
replacement: path.resolve("./src/analytics"), |
|||
}, |
|||
], |
|||
}, |
|||
} |
|||
} |
|||
File diff suppressed because it is too large
@ -0,0 +1,23 @@ |
|||
import svelte from "@sveltejs/vite-plugin-svelte" |
|||
const path = require("path") |
|||
|
|||
export default ({ mode }) => { |
|||
const isProduction = mode === "production" |
|||
return { |
|||
build: { |
|||
lib: { |
|||
entry: path.resolve(__dirname, "src/index.js"), |
|||
name: "client", |
|||
formats: ["es"], |
|||
}, |
|||
minify: isProduction, |
|||
}, |
|||
plugins: [svelte()], |
|||
resolve: { |
|||
dedupe: ["svelte", "svelte/internal"], |
|||
}, |
|||
rollupOptions: { |
|||
external: ["svelte", "svelte/internal"], |
|||
}, |
|||
} |
|||
} |
|||
File diff suppressed because it is too large
|
Before Width: | Height: | Size: 12 KiB |
@ -1,7 +0,0 @@ |
|||
#current_component.svelte-1u0yzf5{height:100%;width:100%} |
|||
.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} |
|||
.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)} |
|||
.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} |
|||
.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} |
|||
|
|||
/*# sourceMappingURL=bundle.css.map */ |
|||
@ -1,20 +0,0 @@ |
|||
{ |
|||
"version": 3, |
|||
"file": "bundle.css", |
|||
"sources": [ |
|||
"..\\src\\Test\\TestApp.svelte", |
|||
"..\\src\\Login.svelte", |
|||
"..\\src\\Button.svelte", |
|||
"..\\src\\Nav.svelte", |
|||
"..\\src\\Table.svelte" |
|||
], |
|||
"sourcesContent": [ |
|||
"<script>\r\n import createApp from \"./createApp\"\r\n import { form } from \"./props\"\r\n let _bb\r\n let currentComponent\r\n let _appPromise\r\n\r\nconst autoAssignIds = (props, count = 0) => {\r\n if (!props._id) {\r\n props._id = `auto_id_${count}`\r\n }\r\n if (props._children) {\r\n for (let child of props._children) {\r\n count += 1\r\n autoAssignIds(child, count)\r\n }\r\n }\r\n}\r\n\r\n $: {\r\n if (currentComponent) {\r\n const _appPromise = createApp()\r\n const page = {\r\n props: form,\r\n }\r\n\r\n autoAssignIds(page.props)\r\n\r\n _appPromise.then(initialise => {\r\n initialise(page, currentComponent, \"\")\r\n })\r\n }\r\n }\r\n</script>\r\n\r\n{#await _appPromise}\r\n loading\r\n{:then _bb}\r\n <div id=\"current_component\" bind:this={currentComponent} />\r\n{/await}\r\n\r\n<style>\r\n #current_component {\r\n height: 100%;\r\n width: 100%;\r\n }\r\n</style>\r\n", |
|||
"<script>\r\n import Button from \"./Button.svelte\"\r\n\r\n export let usernameLabel = \"Username\"\r\n export let passwordLabel = \"Password\"\r\n export let loginButtonLabel = \"Login\"\r\n export let loginRedirect = \"\"\r\n export let logo = \"\"\r\n export let buttonClass = \"\"\r\n export let inputClass = \"\"\r\n\r\n export let _bb\r\n\r\n let username = \"\"\r\n let password = \"\"\r\n let busy = false\r\n let incorrect = false\r\n let _logo = \"\"\r\n let _buttonClass = \"\"\r\n let _inputClass = \"\"\r\n\r\n $: {\r\n _logo = _bb.relativeUrl(logo)\r\n _buttonClass = buttonClass || \"default-button\"\r\n _inputClass = inputClass || \"default-input\"\r\n }\r\n\r\n const login = () => {\r\n busy = true\r\n _bb.api\r\n .post(\"/api/authenticate\", { username, password })\r\n .then(r => {\r\n busy = false\r\n if (r.status === 200) {\r\n return r.json()\r\n } else {\r\n incorrect = true\r\n return\r\n }\r\n })\r\n .then(user => {\r\n if (user) {\r\n localStorage.setItem(\"budibase:user\", JSON.stringify(user))\r\n location.reload()\r\n }\r\n })\r\n }\r\n</script>\r\n\r\n<div class=\"root\">\r\n\r\n <div class=\"content\">\r\n\r\n {#if _logo}\r\n <div class=\"logo-container\">\r\n <img src={_logo} alt=\"logo\" />\r\n </div>\r\n {/if}\r\n\r\n <div class=\"form-root\">\r\n <div class=\"label\">{usernameLabel}</div>\r\n <div class=\"control\">\r\n <input bind:value={username} type=\"text\" class={_inputClass} />\r\n </div>\r\n <div class=\"label\">{passwordLabel}</div>\r\n <div class=\"control\">\r\n <input bind:value={password} type=\"password\" class={_inputClass} />\r\n </div>\r\n </div>\r\n\r\n <div class=\"login-button-container\">\r\n <button disabled={busy} on:click={login} class={_buttonClass}>\r\n {loginButtonLabel}\r\n </button>\r\n </div>\r\n\r\n {#if incorrect}\r\n <div class=\"incorrect-details-panel\">Incorrect username or password</div>\r\n {/if}\r\n\r\n </div>\r\n\r\n</div>\r\n\r\n<style>\r\n .root {\r\n height: 100%;\r\n display: grid;\r\n grid-template-columns: [left] 1fr [middle] auto [right] 1fr;\r\n grid-template-rows: [top] 1fr [center] auto [bottom] 1fr;\r\n }\r\n\r\n .content {\r\n grid-column-start: middle;\r\n grid-row-start: center;\r\n width: 400px;\r\n }\r\n\r\n .logo-container {\r\n margin-bottom: 20px;\r\n }\r\n\r\n .logo-container > img {\r\n max-width: 100%;\r\n }\r\n\r\n .login-button-container {\r\n text-align: right;\r\n margin-top: 20px;\r\n }\r\n\r\n .incorrect-details-panel {\r\n margin-top: 30px;\r\n padding: 10px;\r\n border-style: solid;\r\n border-width: 1px;\r\n border-color: maroon;\r\n border-radius: 1px;\r\n text-align: center;\r\n color: maroon;\r\n background-color: mistyrose;\r\n }\r\n\r\n .form-root {\r\n display: grid;\r\n grid-template-columns: [label] auto [control] 1fr; /* [overflow] auto;*/\r\n }\r\n\r\n .label {\r\n grid-column-start: label;\r\n padding: 5px 10px;\r\n vertical-align: middle;\r\n }\r\n .control {\r\n grid-column-start: control;\r\n padding: 5px 10px;\r\n }\r\n\r\n .default-input {\r\n font-family: inherit;\r\n font-size: inherit;\r\n padding: 0.4em;\r\n margin: 0 0 0.5em 0;\r\n box-sizing: border-box;\r\n border: 1px solid #ccc;\r\n border-radius: 2px;\r\n width: 100%;\r\n }\r\n\r\n .default-button {\r\n font-family: inherit;\r\n font-size: inherit;\r\n padding: 0.4em;\r\n margin: 0 0 0.5em 0;\r\n box-sizing: border-box;\r\n border: 1px solid #ccc;\r\n border-radius: 2px;\r\n color: #333;\r\n background-color: #f4f4f4;\r\n outline: none;\r\n }\r\n\r\n .default-button:active {\r\n background-color: #ddd;\r\n }\r\n\r\n .default-button:focus {\r\n border-color: #666;\r\n }\r\n</style>\r\n", |
|||
"<script>\r\n import cssVars from \"./cssVars\"\r\n import { buildStyle } from \"./buildStyle\"\r\n export let className = \"default\"\r\n export let disabled = false\r\n export let contentText\r\n export let onClick\r\n export let background\r\n export let color\r\n export let border\r\n export let padding\r\n export let hoverColor\r\n export let hoverBackground\r\n export let hoverBorder\r\n\r\n export let _bb\r\n let theButton\r\n let cssVariables\r\n let buttonStyles\r\n\r\n let customHoverColorClass\r\n let customHoverBorderClass\r\n let customHoverBackClass\r\n\r\n let customClasses = \"\"\r\n\r\n const createClasses = classes => {\r\n let all = \"\"\r\n for (let cls in classes) {\r\n if (classes[cls]) {\r\n all = all + \" \" + cls\r\n }\r\n }\r\n return all\r\n }\r\n\r\n $: if(_bb.props._children.length > 0) theButton && _bb.attachChildren(theButton)\r\n\r\n $: {\r\n cssVariables = {\r\n hoverColor,\r\n hoverBorder,\r\n hoverBackground,\r\n background,\r\n color,\r\n border,\r\n }\r\n\r\n buttonStyles = buildStyle({\r\n padding,\r\n })\r\n\r\n customClasses = createClasses({\r\n hoverColor,\r\n hoverBorder,\r\n hoverBackground,\r\n background,\r\n border,\r\n color,\r\n })\r\n }\r\n\r\n const clickHandler = () => {\r\n _bb.call(onClick)\r\n }\r\n</script>\r\n\r\n<button\r\n bind:this={theButton}\r\n use:cssVars={cssVariables}\r\n class=\"{className}\r\n {customClasses}\"\r\n disabled={disabled || false}\r\n on:click={clickHandler}\r\n style={buttonStyles}>\r\n {#if _bb.props_children.length === 0}{contentText}{/if}\r\n</button>\r\n\r\n<style>\r\n .default {\r\n font-family: inherit;\r\n font-size: inherit;\r\n padding: 0.4em;\r\n margin: 0 0 0.5em 0;\r\n box-sizing: border-box;\r\n border: 1px solid #ccc;\r\n border-radius: 2px;\r\n color: #333;\r\n background-color: #f4f4f4;\r\n outline: none;\r\n }\r\n\r\n .default:active {\r\n background-color: #ddd;\r\n }\r\n\r\n .default:focus {\r\n border-color: #666;\r\n }\r\n\r\n .border {\r\n border: var(--border);\r\n }\r\n\r\n .color {\r\n color: var(--color);\r\n }\r\n\r\n .background {\r\n background: var(--background);\r\n }\r\n\r\n .hoverBorder:hover {\r\n border: var(--hoverBorder);\r\n }\r\n\r\n .hoverColor:hover {\r\n color: var(--hoverColor);\r\n }\r\n\r\n .hoverBack:hover {\r\n background: var(--hoverBackground);\r\n }\r\n</style>\r\n", |
|||
"<script>\r\n import cssVars from \"./cssVars\"\r\n\r\n export let navBarBackground = \"\"\r\n export let navBarBorder = \"\"\r\n export let navBarColor = \"\"\r\n export let selectedItemBackground = \"\"\r\n export let selectedItemColor = \"\"\r\n export let selectedItemBorder = \"\"\r\n export let itemHoverBackground = \"\"\r\n export let itemHoverColor = \"\"\r\n export let hideNavBar = false\r\n export let selectedItem = \"\"\r\n\r\n export let _children\r\n export let _bb\r\n\r\n let selectedIndex = -1\r\n let styleVars = {}\r\n let components = {}\r\n let componentElements = {}\r\n\r\n const hasComponentElements = () =>\r\n Object.getOwnPropertyNames(componentElements).length > 0\r\n\r\n $: {\r\n styleVars = {\r\n navBarBackground,\r\n navBarBorder,\r\n navBarColor,\r\n selectedItemBackground,\r\n selectedItemColor,\r\n selectedItemBorder,\r\n itemHoverBackground,\r\n itemHoverColor,\r\n }\r\n\r\n if (_children && _children.length > 0 && hasComponentElements()) {\r\n const currentSelectedItem =\r\n selectedIndex > 0 ? _children[selectedIndex].title : \"\"\r\n if (selectedItem && currentSelectedItem !== selectedItem) {\r\n let i = 0\r\n for (let child of _children) {\r\n if (child.title === selectedItem) {\r\n onSelectItem(i)()\r\n }\r\n i++\r\n }\r\n } else if (!currentSelectedItem) {\r\n onSelectItem(0)\r\n }\r\n }\r\n }\r\n\r\n const onSelectItem = index => () => {\r\n selectedIndex = index\r\n if (!components[index]) {\r\n const comp = _bb.attachChildren(\r\n componentElements[index]\r\n )\r\n components[index] = comp\r\n }\r\n }\r\n</script>\r\n\r\n<div class=\"root\" use:cssVars={styleVars}>\r\n {#if !hideNavBar}\r\n <div class=\"navbar\">\r\n {#each _children as navItem, index}\r\n <div\r\n class=\"navitem\"\r\n on:click={onSelectItem(index)}\r\n class:selected={selectedIndex === index}>\r\n {navItem.title}\r\n </div>\r\n {/each}\r\n </div>\r\n {/if}\r\n {#each _children as navItem, index}\r\n <div class=\"content\" bind:this={componentElements[index]} />\r\n {/each}\r\n</div>\r\n\r\n<style>\r\n .root {\r\n height: 100%;\r\n width: 100%;\r\n grid-template-columns: [navbar] auto [content] 1fr;\r\n display: grid;\r\n }\r\n\r\n .navbar {\r\n grid-column: navbar;\r\n background: var(--navBarBackground);\r\n border: var(--navBarBorder);\r\n color: var(--navBarColor);\r\n }\r\n\r\n .navitem {\r\n padding: 10px 17px;\r\n cursor: pointer;\r\n }\r\n\r\n .navitem:hover {\r\n background: var(--itemHoverBackground);\r\n color: var(--itemHoverColor);\r\n }\r\n\r\n .navitem.selected {\r\n background: var(--selectedItemBackground);\r\n border: var(--selectedItemBorder);\r\n color: var(--selectedItemColor);\r\n }\r\n\r\n .content {\r\n grid-column: content;\r\n }\r\n</style>\r\n", |
|||
"<script>\r\n export let columns = []\r\n export let data = \"\"\r\n export let tableClass = \"\"\r\n export let theadClass = \"\"\r\n export let tbodyClass = \"\"\r\n export let trClass = \"\"\r\n export let thClass = \"\"\r\n export let onRowClick\r\n\r\n export let _bb\r\n\r\n const rowClickHandler = row => () => {\r\n _bb.call(onRowClick, row)\r\n }\r\n\r\n const cellValue = (colIndex, row) => {\r\n const val = _bb.getStateOrValue(_bb.props.columns[colIndex].value, row)\r\n return val\r\n }\r\n</script>\r\n\r\n<table class={tableClass}>\r\n <thead class={theadClass}>\r\n <tr class={trClass}>\r\n {#each columns as col}\r\n <th class={thClass}>{col.title}</th>\r\n {/each}\r\n </tr>\r\n </thead>\r\n <tbody class={tbodyClass}>\r\n {#if data}\r\n {#each data as row}\r\n <tr class={trClass} on:click={rowClickHandler(row)}>\r\n {#each columns as col, index}\r\n <th class={thClass}>{cellValue(index, row)}</th>\r\n {/each}\r\n </tr>\r\n {/each}\r\n {/if}\r\n </tbody>\r\n</table>\r\n\r\n<style>\r\n .table-default {\r\n width: 100%;\r\n margin-bottom: 1rem;\r\n color: #212529;\r\n border-collapse: collapse;\r\n }\r\n\r\n .table-default .thead-default .th-default {\r\n vertical-align: bottom;\r\n border-bottom: 2px solid #dee2e6;\r\n font-weight: bold;\r\n }\r\n\r\n .table-default .th-default {\r\n padding: 0.75rem;\r\n vertical-align: top;\r\n border-top: 1px solid #dee2e6;\r\n font-weight: normal;\r\n }\r\n\r\n .th-default {\r\n text-align: inherit;\r\n }\r\n\r\n .table-default .tbody-default .tr-default:hover {\r\n color: #212529;\r\n background-color: rgba(0, 0, 0, 0.075);\r\n cursor: pointer;\r\n }\r\n</style>\r\n" |
|||
], |
|||
"names": [], |
|||
"mappings": "AA0CE,kBAAkB,eAAC,CAAC,AAClB,MAAM,CAAE,IAAI,CACZ,KAAK,CAAE,IAAI,AACb,CAAC;ACwCD,KAAK,cAAC,CAAC,AACL,MAAM,CAAE,IAAI,CACZ,OAAO,CAAE,IAAI,CACb,qBAAqB,CAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAC3D,kBAAkB,CAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,AAC1D,CAAC,AAED,QAAQ,cAAC,CAAC,AACR,iBAAiB,CAAE,MAAM,CACzB,cAAc,CAAE,MAAM,CACtB,KAAK,CAAE,KAAK,AACd,CAAC,AAED,eAAe,cAAC,CAAC,AACf,aAAa,CAAE,IAAI,AACrB,CAAC,AAED,6BAAe,CAAG,GAAG,cAAC,CAAC,AACrB,SAAS,CAAE,IAAI,AACjB,CAAC,AAED,uBAAu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cAAc,CAAC,0BAAW,MAAM,AAAC,CAAC,AAC/C,KAAK,CAAE,OAAO,CACd,gBAAgB,CAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CACtC,MAAM,CAAE,OAAO,AACjB,CAAC" |
|||
} |
|||
File diff suppressed because it is too large
File diff suppressed because one or more lines are too long
@ -1,102 +0,0 @@ |
|||
window["##BUDIBASE_APPDEFINITION##"] = { |
|||
hierarchy: { |
|||
name: "root", |
|||
type: "root", |
|||
children: [ |
|||
{ |
|||
name: "customer", |
|||
type: "row", |
|||
fields: [ |
|||
{ |
|||
name: "name", |
|||
type: "string", |
|||
typeOptions: { |
|||
maxLength: 1000, |
|||
values: null, |
|||
allowDeclaredValuesOnly: false, |
|||
}, |
|||
label: "name", |
|||
getInitialValue: "default", |
|||
getUndefinedValue: "default", |
|||
}, |
|||
], |
|||
children: [ |
|||
{ |
|||
name: "invoiceyooo", |
|||
type: "row", |
|||
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 {...row};", |
|||
filter: "", |
|||
indexType: "ancestor", |
|||
getShardName: "", |
|||
getSortKey: "row.id", |
|||
aggregateGroups: [], |
|||
allowedTableNodeIds: [2], |
|||
nodeId: 5, |
|||
}, |
|||
], |
|||
allidsShardFactor: 64, |
|||
collectionName: "customers", |
|||
isSingle: false, |
|||
}, |
|||
], |
|||
pathMaps: [], |
|||
indexes: [ |
|||
{ |
|||
name: "Yeo index", |
|||
type: "index", |
|||
map: "return {...row};", |
|||
filter: "", |
|||
indexType: "ancestor", |
|||
getShardName: "", |
|||
getSortKey: "row.id", |
|||
aggregateGroups: [], |
|||
allowedTableNodeIds: [1], |
|||
nodeId: 4, |
|||
}, |
|||
{ |
|||
name: "everyones_invoices", |
|||
type: "index", |
|||
map: "return {...row};", |
|||
filter: "", |
|||
indexType: "ancestor", |
|||
getShardName: "", |
|||
getSortKey: "row.id", |
|||
aggregateGroups: [], |
|||
allowedTableNodeIds: [2], |
|||
nodeId: 6, |
|||
}, |
|||
], |
|||
nodeId: 0, |
|||
}, |
|||
componentLibraries: ["budibase-standard-components"], |
|||
props: {}, |
|||
} |
|||
|
Before Width: | Height: | Size: 3.1 KiB |
@ -1,69 +0,0 @@ |
|||
html, body { |
|||
position: relative; |
|||
width: 100%; |
|||
height: 100%; |
|||
} |
|||
|
|||
body { |
|||
color: #000000; |
|||
margin: 0; |
|||
padding: 0; |
|||
box-sizing: border-box; |
|||
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; |
|||
} |
|||
|
|||
h4 { |
|||
color: #000000; |
|||
font-size: 24px; |
|||
box-sizing: border-box; |
|||
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; |
|||
} |
|||
|
|||
a { |
|||
color: rgb(0,100,200); |
|||
text-decoration: none; |
|||
} |
|||
|
|||
a:hover { |
|||
text-decoration: underline; |
|||
} |
|||
|
|||
a:visited { |
|||
color: rgb(0,80,160); |
|||
} |
|||
|
|||
label { |
|||
display: block; |
|||
} |
|||
|
|||
input, button, select, textarea { |
|||
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; |
|||
} |
|||
|
|||
input:disabled { |
|||
color: #ccc; |
|||
} |
|||
|
|||
input[type="range"] { |
|||
height: 0; |
|||
} |
|||
|
|||
button { |
|||
color: #333; |
|||
background-color: #f4f4f4; |
|||
outline: none; |
|||
} |
|||
|
|||
button:active { |
|||
background-color: #ddd; |
|||
} |
|||
|
|||
button:focus { |
|||
border-color: #666; |
|||
} |
|||
@ -1,19 +0,0 @@ |
|||
<!doctype html> |
|||
<html> |
|||
<head> |
|||
<meta charset='utf8'> |
|||
<meta name='viewport' content='width=device-width'> |
|||
|
|||
<title>Svelte app</title> |
|||
|
|||
<link rel='icon' type='image/png' href='/favicon.png'> |
|||
<link rel='stylesheet' href='/global.css'> |
|||
<link rel='stylesheet' href='/bundle.css'> |
|||
|
|||
</head> |
|||
|
|||
<body> |
|||
<script src='/bundle.js'></script> |
|||
</body> |
|||
|
|||
</html> |
|||
@ -1,39 +0,0 @@ |
|||
import commonjs from "@rollup/plugin-commonjs" |
|||
import resolve from "@rollup/plugin-node-resolve" |
|||
import svelte from "rollup-plugin-svelte" |
|||
import postcss from "rollup-plugin-postcss" |
|||
import json from "@rollup/plugin-json" |
|||
import { terser } from "rollup-plugin-terser" |
|||
import svg from "rollup-plugin-svg" |
|||
|
|||
import builtins from "rollup-plugin-node-builtins" |
|||
|
|||
const production = !process.env.ROLLUP_WATCH |
|||
const externals = ["svelte", "svelte/internal"] |
|||
|
|||
export default { |
|||
external: externals, |
|||
input: "src/index.js", |
|||
output: [ |
|||
{ |
|||
file: "dist/index.js", |
|||
format: "esm", |
|||
sourcemap: false, |
|||
}, |
|||
], |
|||
plugins: [ |
|||
builtins(), |
|||
production && terser(), |
|||
postcss(), |
|||
svelte({ |
|||
dev: !production, |
|||
}), |
|||
resolve({ |
|||
browser: true, |
|||
skip: externals, |
|||
}), |
|||
commonjs(), |
|||
json(), |
|||
svg(), |
|||
], |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
import svelte from "@sveltejs/vite-plugin-svelte" |
|||
const path = require("path") |
|||
|
|||
export default ({ mode }) => { |
|||
const isProduction = mode === "production" |
|||
return { |
|||
build: { |
|||
lib: { |
|||
entry: path.resolve(__dirname, "src/index.js"), |
|||
name: "standard-components", |
|||
formats: ["es"], |
|||
}, |
|||
minify: isProduction, |
|||
}, |
|||
plugins: [svelte()], |
|||
resolve: { |
|||
dedupe: ["svelte", "svelte/internal"], |
|||
}, |
|||
rollupOptions: { |
|||
external: ["svelte", "svelte/internal"], |
|||
}, |
|||
} |
|||
} |
|||
File diff suppressed because it is too large
@ -1,32 +1,40 @@ |
|||
import commonjs from "@rollup/plugin-commonjs" |
|||
import resolve from "rollup-plugin-node-resolve" |
|||
import builtins from "rollup-plugin-node-builtins" |
|||
import globals from "rollup-plugin-node-globals" |
|||
import json from "@rollup/plugin-json" |
|||
import { terser } from "rollup-plugin-terser" |
|||
import nodePolyfills from "rollup-plugin-polyfill-node" |
|||
|
|||
const production = !process.env.ROLLUP_WATCH |
|||
export default { |
|||
input: "src/esIndex.js", |
|||
output: [ |
|||
{ |
|||
sourcemap: true, |
|||
|
|||
const plugins = [ |
|||
resolve({ |
|||
browser: true, |
|||
preferBuiltins: true, |
|||
}), |
|||
commonjs(), |
|||
nodePolyfills(), |
|||
production && terser(), |
|||
json(), |
|||
] |
|||
|
|||
export default [ |
|||
{ |
|||
input: "src/index.mjs", |
|||
output: { |
|||
sourcemap: !production, |
|||
format: "esm", |
|||
file: "./dist/bundle.js", |
|||
name: "templates", |
|||
file: "./dist/bundle.mjs", |
|||
}, |
|||
plugins, |
|||
}, |
|||
{ |
|||
input: "src/index.cjs", |
|||
output: { |
|||
sourcemap: !production, |
|||
format: "cjs", |
|||
file: "./dist/bundle.cjs", |
|||
exports: "named", |
|||
}, |
|||
], |
|||
plugins: [ |
|||
resolve({ |
|||
mainFields: ["module", "main"], |
|||
preferBuiltins: true, |
|||
browser: true, |
|||
}), |
|||
commonjs(), |
|||
globals(), |
|||
builtins(), |
|||
production && terser(), |
|||
json(), |
|||
], |
|||
} |
|||
plugins, |
|||
}, |
|||
] |
|||
|
|||
@ -1,4 +1,4 @@ |
|||
import templates from "./index" |
|||
import templates from "./index.cjs" |
|||
|
|||
/** |
|||
* This file is simply an entrypoint for rollup - makes a lot of cjs problems go away |
|||
Loading…
Reference in new issue