forked from tsai/budibase
19 changed files with 265 additions and 25277 deletions
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,20 +1,37 @@ |
|||||
import svelte from 'rollup-plugin-svelte'; |
import svelte from "rollup-plugin-svelte"; |
||||
import resolve from 'rollup-plugin-node-resolve'; |
import postcss from "rollup-plugin-postcss"; |
||||
|
import resolve from "rollup-plugin-node-resolve"; |
||||
|
import path from "path"; |
||||
|
|
||||
|
const postcssOptions = () => ({ |
||||
|
extensions: [".scss", ".sass"], |
||||
|
extract: false, |
||||
|
minimize: true, |
||||
|
use: [ |
||||
|
[ |
||||
|
"sass", |
||||
|
{ |
||||
|
includePaths: ["./node_modules"] |
||||
|
} |
||||
|
] |
||||
|
] |
||||
|
}); |
||||
|
|
||||
export default { |
export default { |
||||
input: 'src/index.js', |
input: "src/index.js", |
||||
output: [ |
output: [ |
||||
{ |
{ |
||||
file: "dist/index.js", |
file: "dist/index.js", |
||||
format: 'esm', |
format: "esm", |
||||
name:"budibaseStandardComponents", |
name: "budibaseStandardComponents", |
||||
sourcemap: "inline" |
sourcemap: "inline" |
||||
} |
} |
||||
], |
], |
||||
plugins: [ |
plugins: [ |
||||
svelte({ |
svelte({ |
||||
hydratable:true |
hydratable: true |
||||
}), |
}), |
||||
resolve() |
resolve(), |
||||
|
postcss(postcssOptions()) |
||||
] |
] |
||||
}; |
}; |
||||
|
|||||
@ -0,0 +1,14 @@ |
|||||
|
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,12 @@ |
|||||
|
<script> |
||||
|
import "@material/button/mdc-button.scss"; |
||||
|
export let raised = false; |
||||
|
|
||||
|
let c = raised ? "mdc-button mdc-button--raised" : "mdc-button"; |
||||
|
</script> |
||||
|
|
||||
|
<button class={c}> |
||||
|
<div class="mdc-button__ripple" /> |
||||
|
|
||||
|
<span class="mdc-button__label">Button</span> |
||||
|
</button> |
||||
@ -1,40 +1,35 @@ |
|||||
<script> |
<script> |
||||
import createApp from "./createApp"; |
import createApp from "./createApp"; |
||||
import { props } from "./props"; |
import { props } from "./props"; |
||||
|
|
||||
let _bb; |
let _bb; |
||||
|
|
||||
const _appPromise = createApp(); |
const _appPromise = createApp(); |
||||
_appPromise.then(a => _bb = a); |
_appPromise.then(a => (_bb = a)); |
||||
|
|
||||
const testProps = props.justAnH1; |
const testProps = props.justAnH1; |
||||
|
const button = props.button; |
||||
|
|
||||
let currentComponent; |
let currentComponent; |
||||
|
|
||||
$: { |
$: { |
||||
if(_bb && currentComponent) { |
if (_bb && currentComponent) { |
||||
_bb.hydrateChildren([testProps], currentComponent); |
_bb.hydrateChildren([testProps, button], currentComponent); |
||||
|
} |
||||
} |
} |
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
</script> |
</script> |
||||
|
|
||||
{#await _appPromise} |
|
||||
loading |
|
||||
{:then _bb} |
|
||||
|
|
||||
<div id="current_component" bind:this={currentComponent}> |
|
||||
</div> |
|
||||
|
|
||||
{/await} |
|
||||
|
|
||||
|
|
||||
<style> |
<style> |
||||
#current_component { |
#current_component { |
||||
height: 100%; |
height: 100%; |
||||
width: 100%; |
width: 100%; |
||||
} |
} |
||||
</style> |
</style> |
||||
|
|
||||
|
{#await _appPromise} |
||||
|
loading |
||||
|
{:then _bb} |
||||
|
|
||||
|
<div id="current_component" bind:this={currentComponent} /> |
||||
|
|
||||
|
{/await} |
||||
|
|||||
@ -1,10 +1,12 @@ |
|||||
|
|
||||
export const props = { |
export const props = { |
||||
|
justAnH1: { |
||||
justAnH1 : { |
_component: "@budibase/materialdesign-components/h1", |
||||
_component:"@budibase/materialdesign-components/h1", |
|
||||
_children: [], |
_children: [], |
||||
text: "This is a Header" |
text: "This is a Header" |
||||
|
}, |
||||
|
button: { |
||||
|
_component: "@budibase/materialdesign-components/button", |
||||
|
_children: [], |
||||
|
raised: true |
||||
} |
} |
||||
|
}; |
||||
} |
|
||||
|
|||||
@ -1,3 +1,4 @@ |
|||||
import h1 from "../H1.svelte"; |
import h1 from "../H1.svelte"; |
||||
|
import { button } from "@BBMD"; |
||||
|
|
||||
export default {h1}; |
export default { h1, button }; |
||||
|
|||||
@ -1,2 +1,3 @@ |
|||||
export {default as h1} from "./H1.svelte"; |
export { default as h1 } from "./H1.svelte"; |
||||
|
export { default as button } from "./Button.svelte"; |
||||
|
|
||||
|
|||||
Loading…
Reference in new issue