2020-10-16 16:16:29 +02:00
|
|
|
<script>
|
|
|
|
import { DataList } from "@budibase/bbui"
|
|
|
|
import { createEventDispatcher } from "svelte"
|
2020-11-05 18:47:27 +01:00
|
|
|
import { allScreens } from "builderStore"
|
2020-10-16 16:16:29 +02:00
|
|
|
|
|
|
|
const dispatch = createEventDispatcher()
|
|
|
|
|
|
|
|
export let value = ""
|
|
|
|
|
|
|
|
$: urls = getUrls()
|
|
|
|
|
|
|
|
const handleBlur = () => dispatch("change", value)
|
|
|
|
|
|
|
|
const getUrls = () => {
|
|
|
|
return [
|
2020-11-05 18:47:27 +01:00
|
|
|
...$allScreens
|
2020-10-16 16:16:29 +02:00
|
|
|
.filter(
|
2020-10-27 16:28:13 +01:00
|
|
|
screen =>
|
2020-10-16 16:16:29 +02:00
|
|
|
screen.props._component.endsWith("/rowdetail") ||
|
|
|
|
screen.route.endsWith(":id")
|
|
|
|
)
|
2020-10-27 16:28:13 +01:00
|
|
|
.map(screen => ({
|
2020-10-16 16:16:29 +02:00
|
|
|
name: screen.props._instanceName,
|
|
|
|
url: screen.route,
|
|
|
|
sort: screen.props._component,
|
|
|
|
})),
|
|
|
|
]
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<div>
|
2020-10-23 11:34:14 +02:00
|
|
|
<DataList
|
|
|
|
editable
|
|
|
|
secondary
|
|
|
|
extraThin
|
|
|
|
on:blur={handleBlur}
|
|
|
|
on:change
|
|
|
|
bind:value>
|
2020-10-16 16:16:29 +02:00
|
|
|
<option value="" />
|
|
|
|
{#each urls as url}
|
|
|
|
<option value={url.url}>{url.name}</option>
|
|
|
|
{/each}
|
|
|
|
</DataList>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
div {
|
|
|
|
flex: 1 1 auto;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
}
|
|
|
|
div :global(> div) {
|
|
|
|
flex: 1 1 auto;
|
|
|
|
}
|
|
|
|
</style>
|