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

@ -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>