chore: automated housekeeping...

This commit is contained in:
Pieter Vander Vennet 2024-09-02 12:48:15 +02:00
parent c10fecb7e8
commit f5d7686c98
234 changed files with 3493 additions and 2482 deletions

View file

@ -3,28 +3,27 @@
import { sineIn } from "svelte/easing"
import { UIEventSource } from "../../Logic/UIEventSource.js"
export let shown: UIEventSource<boolean>;
export let shown: UIEventSource<boolean>
let transitionParams = {
x: -320,
duration: 200,
easing: sineIn
};
easing: sineIn,
}
let hidden = !shown.data
$: {
shown.setData(!hidden)
}
shown.addCallback(sh => {
shown.addCallback((sh) => {
hidden = !sh
})
</script>
<Drawer placement="left"
transitionType="fly" {transitionParams}
divClass = "overflow-y-auto z-50 "
bind:hidden={hidden}>
<slot>
CONTENTS
</slot>
<Drawer
placement="left"
transitionType="fly"
{transitionParams}
divClass="overflow-y-auto z-50 "
bind:hidden
>
<slot>CONTENTS</slot>
</Drawer>

View file

@ -30,7 +30,7 @@
}}
>
<div
class="content relative normal-background pointer-events-auto h-full"
class="content normal-background pointer-events-auto relative h-full"
on:click|stopPropagation={() => {}}
>
<div class="h-full rounded-xl">
@ -39,20 +39,16 @@
<slot name="close-button">
<!-- The close button is placed _after_ the default slot in order to always paint it on top -->
<div class="absolute top-0 right-0">
<CloseButton class="normal-background mt-2 mr-2"
on:click={() => dispatch("close")}
/>
<CloseButton class="normal-background mt-2 mr-2" on:click={() => dispatch("close")} />
</div>
</slot>
</div>
</div>
<style>
.content {
border-radius: 0.5rem;
overflow-x: hidden;
box-shadow: 0 0 1rem #00000088;
}
.content {
border-radius: 0.5rem;
overflow-x: hidden;
box-shadow: 0 0 1rem #00000088;
}
</style>

View file

@ -4,7 +4,6 @@
export let text: string
export let href: string
export let classnames: string = undefined
export let download: string = undefined
export let ariaLabel: string = undefined
@ -13,7 +12,7 @@
</script>
<a
href={Utils.prepareHref(href) }
href={Utils.prepareHref(href)}
aria-label={ariaLabel}
title={ariaLabel}
target={newTab ? "_blank" : undefined}

View file

@ -14,6 +14,6 @@
osmConnection.LogOut()
}}
>
<ArrowRightOnRectangle class="h-6 w-6 max-h-full" />
<ArrowRightOnRectangle class="h-6 max-h-full w-6" />
<Tr t={Translations.t.general.logout} />
</button>

View file

@ -14,7 +14,6 @@
export let arialabel: Translation = undefined
export let arialabelDynamic: Store<Translation> = new ImmutableStore(arialabel)
let arialabelString = arialabelDynamic.bind((tr) => tr?.current)
</script>
<button

View file

@ -6,12 +6,13 @@
export let shown: UIEventSource<boolean>
let _shown = false
export let onlyLink: boolean = false
shown.addCallbackAndRun(sh => {
shown.addCallbackAndRun((sh) => {
_shown = sh
})
export let fullscreen: boolean = false
const shared = "in-page normal-background dark:bg-gray-800 rounded-lg border-gray-200 dark:border-gray-700 border-gray-200 dark:border-gray-700 divide-gray-200 dark:divide-gray-700 shadow-md"
const shared =
"in-page normal-background dark:bg-gray-800 rounded-lg border-gray-200 dark:border-gray-700 border-gray-200 dark:border-gray-700 divide-gray-200 dark:divide-gray-700 shadow-md"
let defaultClass = "relative flex flex-col mx-auto w-full divide-y " + shared
if (fullscreen) {
defaultClass = shared
@ -21,14 +22,21 @@
dialogClass += " h-full-child"
}
let bodyClass = "h-full p-4 md:p-5 space-y-4 flex-1 overflow-y-auto overscroll-contain"
let headerClass = "flex justify-between items-center p-2 px-4 md:px-5 rounded-t-lg";
let headerClass = "flex justify-between items-center p-2 px-4 md:px-5 rounded-t-lg"
</script>
{#if !onlyLink}
<Modal open={_shown} on:close={() => shown.set(false)} outsideclose
size="xl"
{defaultClass} {bodyClass} {dialogClass} {headerClass}
color="none">
<Modal
open={_shown}
on:close={() => shown.set(false)}
outsideclose
size="xl"
{defaultClass}
{bodyClass}
{dialogClass}
{headerClass}
color="none"
>
<h1 slot="header" class="page-header w-full">
<slot name="header" />
</h1>
@ -40,20 +48,20 @@
{:else}
<button class="as-link sidebar-button" on:click={() => shown.setData(true)}>
<slot name="link">
<slot name="header" />
<slot name="header" />
</slot>
</button>
{/if}
<style>
:global(.page-header) {
display: flex;
align-items: center;
}
:global(.page-header) {
display: flex;
align-items: center;
}
:global(.page-header svg) {
width: 2rem;
height: 2rem;
margin-right: 0.75rem;
width: 2rem;
height: 2rem;
margin-right: 0.75rem;
}
</style>

View file

@ -9,35 +9,30 @@
export let value: UIEventSource<string>
let _value = value.data ?? ""
value.addCallbackD(v => {
value.addCallbackD((v) => {
_value = v
})
$: value.set(_value)
const dispatch = createEventDispatcher<{ search }>()
export let placeholder: Translation = Translations.t.general.search.search
export let placeholder: Translation = Translations.t.general.search.search
</script>
<form
class="flex justify-center"
on:submit|preventDefault={() => dispatch("search")}
>
<form class="flex justify-center" on:submit|preventDefault={() => dispatch("search")}>
<label
class="neutral-label my-2 flex w-full items-center rounded-full border-2 border-black sm:w-1/2 box-shadow"
class="neutral-label box-shadow my-2 flex w-full items-center rounded-full border-2 border-black sm:w-1/2"
>
<input
type="search"
style=" --tw-ring-color: rgb(0 0 0 / 0) !important;"
class="ml-4 pl-1 w-full outline-none border-none"
class="ml-4 w-full border-none pl-1 outline-none"
on:keypress={(keypr) => {
return keypr.key === "Enter" ? dispatch("search") : undefined
}}
return keypr.key === "Enter" ? dispatch("search") : undefined
}}
bind:value={_value}
use:set_placeholder={placeholder}
use:ariaLabel={Translations.t.general.search.search}
/>
<SearchIcon aria-hidden="true" class="h-8 w-8 mx-2" />
<SearchIcon aria-hidden="true" class="mx-2 h-8 w-8" />
</label>
</form>

View file

@ -7,6 +7,5 @@
<slot />
</div>
<slot class="border-t-gray-300 mt-1" name="footer" />
<slot class="mt-1 border-t-gray-300" name="footer" />
</div>