1
0
Fork 0
mirror of synced 2024-09-20 19:33:10 +12:00
budibase/packages/builder/src/components/userInterface/EditComponentProps.svelte

91 lines
1.7 KiB
Svelte
Raw Normal View History

2019-08-17 02:48:45 +12:00
<script>
2020-02-03 22:50:30 +13:00
import PropsView from "./PropsView.svelte"
import { store } from "../builderStore"
import Textbox from "../common/Textbox.svelte"
import Button from "../common/Button.svelte"
import { LayoutIcon, PaintIcon, TerminalIcon } from "../common/Icons/"
2020-02-03 22:50:30 +13:00
import { cloneDeep, join, split, last } from "lodash/fp"
import { assign } from "lodash"
$: component = $store.currentPreviewItem
2020-02-03 22:50:30 +13:00
$: componentInfo = $store.currentComponentInfo
$: components = $store.components
2020-02-03 22:50:30 +13:00
const updateComponent = doChange => doChange(cloneDeep(component))
2020-02-03 22:50:30 +13:00
const onPropsChanged = newProps => {
updateComponent(newComponent => assign(newComponent.props, newProps))
}
2019-08-17 02:48:45 +12:00
</script>
<div class="root">
2020-02-03 22:50:30 +13:00
<ul>
<li>
<button>
<PaintIcon />
</button>
</li>
<li>
<button>
<LayoutIcon />
</button>
</li>
<li>
<button>
<TerminalIcon />
</button>
</li>
</ul>
<div class="component-props-container">
<PropsView {componentInfo} {onPropsChanged} />
</div>
2019-08-17 02:48:45 +12:00
</div>
<style>
2020-02-03 22:50:30 +13:00
.root {
height: 100%;
display: flex;
flex-direction: column;
}
.title > div:nth-child(1) {
grid-column-start: name;
color: var(--secondary100);
}
.title > div:nth-child(2) {
grid-column-start: actions;
}
.component-props-container {
flex: 1 1 auto;
overflow-y: auto;
}
ul {
list-style: none;
display: flex;
padding: 0;
}
li {
margin-right: 20px;
background: none;
border-radius: 5px;
width: 45px;
height: 45px;
}
li button {
width: 100%;
height: 100%;
background: none;
border: none;
border-radius: 5px;
padding: 13px;
2020-02-03 22:50:30 +13:00
}
</style>