Merge Commit

This commit is contained in:
Dean 2023-08-21 12:50:16 +01:00
parent 6edad5d375
commit cad624a9a4
2 changed files with 11 additions and 11 deletions

View File

@ -4,6 +4,8 @@
import Body from "../Typography/Body.svelte"
import Heading from "../Typography/Heading.svelte"
import { setContext } from "svelte"
import { createEventDispatcher } from "svelte"
import { generate } from "shortid"
export let title
export let fillWidth
@ -11,13 +13,17 @@
export let width = "calc(100% - 626px)"
export let headless = false
const dispatch = createEventDispatcher()
let visible = false
let drawerId = generate()
export function show() {
if (visible) {
return
}
visible = true
dispatch("drawerShow", drawerId)
}
export function hide() {
@ -25,6 +31,7 @@
return
}
visible = false
dispatch("drawerHide", drawerId)
}
setContext("drawer-actions", {

View File

@ -2,8 +2,8 @@
import "@spectrum-css/inputgroup/dist/index-vars.css"
import "@spectrum-css/popover/dist/index-vars.css"
import "@spectrum-css/menu/dist/index-vars.css"
import { fly } from "svelte/transition"
import { createEventDispatcher } from "svelte"
import clickOutside from "../../Actions/click_outside"
export let value = null
export let id = null
@ -80,10 +80,11 @@
</svg>
</button>
{#if open}
<div class="overlay" on:mousedown|self={() => (open = false)} />
<div
transition:fly|local={{ y: -20, duration: 200 }}
class="spectrum-Popover spectrum-Popover--bottom is-open"
use:clickOutside={() => {
open = false
}}
>
<ul class="spectrum-Menu" role="listbox">
{#if options && Array.isArray(options)}
@ -125,14 +126,6 @@
.spectrum-Textfield-input {
width: 0;
}
.overlay {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 999;
}
.spectrum-Popover {
max-height: 240px;
width: 100%;