popover styles

This commit is contained in:
Victoria Sloan 2020-09-06 23:50:11 +01:00
parent 3bd3d71e1f
commit 6ed3407a4f
1 changed files with 43 additions and 15 deletions

View File

@ -12,14 +12,14 @@
regenerateCssForCurrentScreen, regenerateCssForCurrentScreen,
} from "builderStore/storeUtils" } from "builderStore/storeUtils"
import { uuid } from "builderStore/uuid" import { uuid } from "builderStore/uuid"
import { Popover } from "@budibase/bbui" import { DropdownMenu } from "@budibase/bbui"
export let component export let component
let confirmDeleteDialog let confirmDeleteDialog
let dropdown let dropdown
let anchor
console.log("hisisis")
$: noChildrenAllowed = $: noChildrenAllowed =
!component || !getComponentDefinition($store, component._component).children !component || !getComponentDefinition($store, component._component).children
$: noPaste = !$store.componentToPaste $: noPaste = !$store.componentToPaste
@ -108,16 +108,19 @@
} }
</script> </script>
<div class="root boundary" on:click|stopPropagation={() => {}}> <div bind:this={anchor} on:click|stopPropagation={() => {}}>
<button> <button on:click={dropdown.show}>
<MoreIcon /> <MoreIcon />
</button> </button>
</div>
<Popover <DropdownMenu
class="menu" class="menu"
bind:this={dropdown} bind:this={dropdown}
on:click={hideDropdown} on:click={hideDropdown}
align="left"> width="170px"
{anchor}
align="left">
<ul>
<li class="item" on:click={() => confirmDeleteDialog.show()}> <li class="item" on:click={() => confirmDeleteDialog.show()}>
<i class="icon ri-delete-bin-2-line" /> <i class="icon ri-delete-bin-2-line" />
Delete Delete
@ -164,8 +167,8 @@
<i class="icon ri-insert-column-right" /> <i class="icon ri-insert-column-right" />
Paste inside Paste inside
</li> </li>
</Popover> </ul>
</div> </DropdownMenu>
<ConfirmDialog <ConfirmDialog
bind:this={confirmDeleteDialog} bind:this={confirmDeleteDialog}
@ -175,12 +178,12 @@
onOk={deleteComponent} /> onOk={deleteComponent} />
<style> <style>
.root { /* .root {
overflow: hidden; overflow: hidden;
z-index: 9; z-index: 9;
} } */
.root button { /* .root button {
border-style: none; border-style: none;
border-radius: 2px; border-radius: 2px;
padding: 5px; padding: 5px;
@ -188,6 +191,31 @@
cursor: pointer; cursor: pointer;
color: var(--ink); color: var(--ink);
outline: none; outline: none;
} */
ul {
list-style: none;
padding: 0;
margin: 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;
}
li:hover {
background-color: var(--grey-2);
}
li:active {
color: var(--blue);
} }
.item { .item {