initial commit
This commit is contained in:
parent
9a940c0df5
commit
3b525cf71b
|
@ -1,4 +1,4 @@
|
||||||
import { cloneDeep, difference } from "lodash"
|
import { cloneDeep, difference } from "lodash/fp"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* parameter for fetchBindableProperties function
|
* parameter for fetchBindableProperties function
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
<script>
|
||||||
|
import api from "builderStore/api"
|
||||||
|
|
||||||
|
import { store } from "builderStore"
|
||||||
|
import fetchBindableProperties from "builderStore/fetchBindableProperties"
|
||||||
|
export let value = "Something is wrong"
|
||||||
|
|
||||||
|
async function getBindableProperties() {
|
||||||
|
const modelResponse = await api.get(`/api/models/`)
|
||||||
|
const models = await modelResponse.json()
|
||||||
|
|
||||||
|
const result = fetchBindableProperties({
|
||||||
|
componentInstanceId: $store.currentComponentInfo._id,
|
||||||
|
components: $store.components,
|
||||||
|
screen: $store.currentPreviewItem,
|
||||||
|
models: [],
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log("Result: ", result)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">{value}</div>
|
||||||
|
<button on:click={getBindableProperties}>Get stuff!</button>
|
||||||
|
<ul>
|
||||||
|
<li>1</li>
|
||||||
|
<li>2</li>
|
||||||
|
<li>3</li>
|
||||||
|
<li>4</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
ul {
|
||||||
|
list-style: none;
|
||||||
|
padding-left: 0;
|
||||||
|
margin: 0;
|
||||||
|
padding: var(--spacing-s) 0;
|
||||||
|
}
|
||||||
|
li {
|
||||||
|
display: flex;
|
||||||
|
font-family: var(--font-sans);
|
||||||
|
font-size: var(--font-size-xs);
|
||||||
|
color: var(--ink);
|
||||||
|
padding: var(--spacing-s) var(--spacing-m);
|
||||||
|
margin: auto 0px;
|
||||||
|
align-items: center;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -1,4 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
|
import { DropdownMenu } from "@budibase/bbui"
|
||||||
|
import BindingDropdown from "components/userInterface/BindingDropdown.svelte"
|
||||||
import { onMount, getContext } from "svelte"
|
import { onMount, getContext } from "svelte"
|
||||||
|
|
||||||
export let label = ""
|
export let label = ""
|
||||||
|
@ -7,6 +9,8 @@
|
||||||
export let value
|
export let value
|
||||||
export let props = {}
|
export let props = {}
|
||||||
export let onChange = () => {}
|
export let onChange = () => {}
|
||||||
|
let anchor
|
||||||
|
let dropdown
|
||||||
|
|
||||||
function handleChange(key, v) {
|
function handleChange(key, v) {
|
||||||
let innerVal = v
|
let innerVal = v
|
||||||
|
@ -42,7 +46,13 @@
|
||||||
{...props}
|
{...props}
|
||||||
name={key} />
|
name={key} />
|
||||||
</div>
|
</div>
|
||||||
|
<div bind:this={anchor}>
|
||||||
|
<button on:click={dropdown.show}>Dropdown</button>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<DropdownMenu bind:this={dropdown} {anchor} align="right">
|
||||||
|
<BindingDropdown />
|
||||||
|
</DropdownMenu>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.property-control {
|
.property-control {
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -92,6 +92,7 @@
|
||||||
},
|
},
|
||||||
"input": {
|
"input": {
|
||||||
"name": "Input",
|
"name": "Input",
|
||||||
|
"bindable": "value",
|
||||||
"description": "An HTML input",
|
"description": "An HTML input",
|
||||||
"props": {
|
"props": {
|
||||||
"value": "string",
|
"value": "string",
|
||||||
|
@ -151,7 +152,10 @@
|
||||||
"children": false,
|
"children": false,
|
||||||
"props": {
|
"props": {
|
||||||
"text": "string",
|
"text": "string",
|
||||||
"type": {"type": "string", "default": "none"}
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "none"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"tags": [
|
"tags": [
|
||||||
"div",
|
"div",
|
||||||
|
|
Loading…
Reference in New Issue