forked from tsai/budibase
8 changed files with 71 additions and 32 deletions
@ -1,25 +0,0 @@ |
|||||
<script> |
|
||||
import { Button, ActionButton, Drawer } from "@budibase/bbui" |
|
||||
import { createEventDispatcher } from "svelte" |
|
||||
import NavigationDrawer from "./NavigationDrawer.svelte" |
|
||||
import { cloneDeep } from "lodash/fp" |
|
||||
|
|
||||
export let value = [] |
|
||||
let drawer |
|
||||
let links = cloneDeep(value || []) |
|
||||
|
|
||||
const dispatch = createEventDispatcher() |
|
||||
const save = () => { |
|
||||
dispatch("change", links) |
|
||||
drawer.hide() |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<ActionButton on:click={drawer.show}>Configure links</ActionButton> |
|
||||
<Drawer bind:this={drawer} title={"Navigation Links"}> |
|
||||
<svelte:fragment slot="description"> |
|
||||
Configure the links in your navigation bar. |
|
||||
</svelte:fragment> |
|
||||
<Button cta slot="buttons" on:click={save}>Save</Button> |
|
||||
<NavigationDrawer slot="body" bind:links /> |
|
||||
</Drawer> |
|
||||
@ -0,0 +1,34 @@ |
|||||
|
<script> |
||||
|
import { Button, Drawer } from "@budibase/bbui" |
||||
|
import NavigationDrawer from "./NavigationDrawer.svelte" |
||||
|
import { cloneDeep } from "lodash/fp" |
||||
|
import { store } from "builderStore" |
||||
|
|
||||
|
let drawer |
||||
|
let links |
||||
|
|
||||
|
const openDrawer = () => { |
||||
|
links = cloneDeep($store.navigation.links || []) |
||||
|
drawer.show() |
||||
|
} |
||||
|
|
||||
|
const save = async () => { |
||||
|
let navigation = $store.navigation |
||||
|
navigation.links = links |
||||
|
await store.actions.navigation.save(navigation) |
||||
|
drawer.hide() |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<Button cta on:click={openDrawer}>Configure links</Button> |
||||
|
<Drawer |
||||
|
bind:this={drawer} |
||||
|
title={"Navigation Links"} |
||||
|
width="calc(100% - 334px)" |
||||
|
> |
||||
|
<svelte:fragment slot="description"> |
||||
|
Configure the links in your navigation bar. |
||||
|
</svelte:fragment> |
||||
|
<Button cta slot="buttons" on:click={save}>Save</Button> |
||||
|
<NavigationDrawer slot="body" bind:links /> |
||||
|
</Drawer> |
||||
@ -1,5 +1,18 @@ |
|||||
<script> |
<script> |
||||
import NavigationPanel from "components/design/navigation/NavigationPanel.svelte" |
import NavigationPanel from "components/design/navigation/NavigationPanel.svelte" |
||||
|
import { Body, Layout } from "@budibase/bbui" |
||||
|
import NavigationEditor from "./_components/NavigationEditor.svelte" |
||||
</script> |
</script> |
||||
|
|
||||
<NavigationPanel title="Navigation" /> |
<NavigationPanel title="Navigation"> |
||||
|
<Layout paddingX="L" paddingY="XL" gap="S"> |
||||
|
<Body size="S"> |
||||
|
Your navigation is configured for all the screens within your app |
||||
|
</Body> |
||||
|
<Body size="S"> |
||||
|
You can hide and show your navigation for each screen in the screen |
||||
|
settings |
||||
|
</Body> |
||||
|
<NavigationEditor /> |
||||
|
</Layout> |
||||
|
</NavigationPanel> |
||||
|
|||||
Loading…
Reference in new issue