UX: add close buttons to OH picker (fix #2482), fix crash

This commit is contained in:
Pieter Vander Vennet 2025-08-03 15:03:17 +02:00
parent 61b1288531
commit e849c017eb
3 changed files with 19 additions and 1 deletions

View file

@ -1351,6 +1351,10 @@ input[type="range"].range-lg::-moz-range-thumb {
float: left;
}
.-m-4 {
margin: -1rem;
}
.m-0 {
margin: 0px;
}

View file

@ -34,7 +34,7 @@
<div class="flex h-full w-full flex-grow flex-col">
<!-- Title element and title icons-->
<h3 class="m-0">
<a href={`#${$tags.id}`}>
<a href={`#${$tags?.id}`}>
{#if layer.title}
<TagRenderingAnswer config={layer.title} {selectedElement} {state} {tags} {layer} />
{/if}

View file

@ -10,6 +10,9 @@
import Tr from "../../Base/Tr.svelte"
import Translations from "../../i18n/Translations"
import Check from "@babeard/svelte-heroicons/mini/Check"
import { CloseButton } from "flowbite-svelte"
import Cross from "../../../assets/svg/Cross.svelte"
import XMark from "@babeard/svelte-heroicons/mini/XMark"
export let value: UIEventSource<string>
export let args: string
@ -31,16 +34,27 @@
const state = new OpeningHoursState(value, prefix, postfix)
let expanded = new UIEventSource(false)
function abort(){
expanded.set(false)
}
</script>
<Popup bodyPadding="p-0" shown={expanded}>
<OHTable value={state.normalOhs} />
<div class="absolute flex w-full justify-center" style="bottom: -3rem">
<button on:click={() => abort()}>
<XMark class="m-0 h-6 w-6"/>
<Tr t={Translations.t.general.cancel} />
</button>
<button class=" primary" on:click={() => expanded.set(false)}>
<Check class="m-0 h-6 w-6 shrink-0 p-0" color="white" />
<Tr t={Translations.t.general.confirm} />
</button>
</div>
<CloseButton class="absolute top-0 right-0 z-10" style="margin-top: -1.0rem" on:click={() => abort()} />
</Popup>
<button on:click={() => expanded.set(true)}>Pick opening hours</button>