forked from MapComplete/MapComplete
Merge master
This commit is contained in:
commit
f51b51c491
340 changed files with 15515 additions and 11114 deletions
|
@ -1,38 +1,43 @@
|
|||
<script lang="ts">
|
||||
import { createEventDispatcher, onMount } from "svelte";
|
||||
import { XCircleIcon } from "@rgossiaux/svelte-heroicons/solid";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
import { Utils } from "../../Utils";
|
||||
import { trapFocus } from 'trap-focus-svelte'
|
||||
import { createEventDispatcher } from "svelte"
|
||||
import { XCircleIcon } from "@rgossiaux/svelte-heroicons/solid"
|
||||
import { twMerge } from "tailwind-merge"
|
||||
import { trapFocus } from "trap-focus-svelte"
|
||||
|
||||
/**
|
||||
* The slotted element will be shown on top, with a lower-opacity border
|
||||
*/
|
||||
const dispatch = createEventDispatcher<{ close }>();
|
||||
|
||||
export let extraClasses = "p-4 md:p-6";
|
||||
const dispatch = createEventDispatcher<{ close }>()
|
||||
|
||||
export let extraClasses = "p-4 md:p-6"
|
||||
|
||||
</script>
|
||||
|
||||
<!-- Draw the background over the total screen -->
|
||||
<div class="w-screen h-screen absolute top-0 left-0" style="background-color: #00000088; z-index: 20" on:click={() => {
|
||||
<!-- Draw the background over the total screen -->
|
||||
<div
|
||||
class="absolute top-0 left-0 h-screen w-screen"
|
||||
on:click={() => {
|
||||
dispatch("close")
|
||||
}}>
|
||||
</div>
|
||||
}}
|
||||
style="background-color: #00000088; z-index: 20"
|
||||
/>
|
||||
<!-- draw a _second_ absolute div, placed using 'bottom' which will be above the navigation bar on mobile browsers -->
|
||||
<div
|
||||
class={twMerge("absolute bottom-0 right-0 h-full w-screen", extraClasses)}
|
||||
use:trapFocus
|
||||
style="z-index: 21"
|
||||
use:trapFocus
|
||||
>
|
||||
<div class="content normal-background" on:click|stopPropagation={() => {}}>
|
||||
<div
|
||||
class="content normal-background"
|
||||
on:click|stopPropagation={() => {}}
|
||||
>
|
||||
<div class="h-full rounded-xl">
|
||||
<slot />
|
||||
</div>
|
||||
<slot name="close-button">
|
||||
<!-- The close button is placed _after_ the default slot in order to always paint it on top -->
|
||||
<button
|
||||
class="absolute right-10 top-10 h-8 w-8 cursor-pointer p-0 border-none bg-white"
|
||||
class="absolute right-10 top-10 h-8 w-8 cursor-pointer border-none bg-white p-0"
|
||||
on:click={() => dispatch("close")}
|
||||
>
|
||||
<XCircleIcon />
|
||||
|
@ -41,8 +46,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
.content {
|
||||
height: 100%;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue