refactoring branch, tatort page-svelte, Datenaktualisierung durch api, page.ts, choose better names
This commit is contained in:
@@ -1,3 +1,31 @@
|
||||
<script lang="ts">
|
||||
export let href = null;
|
||||
export let type = 'button';
|
||||
export let size = 'md';
|
||||
export let variant = 'primary';
|
||||
export let fullWidth = false;
|
||||
export let align = 'center';
|
||||
export let disabled = false;
|
||||
let classNames = '';
|
||||
export { classNames as class };
|
||||
</script>
|
||||
|
||||
{#if href}
|
||||
<a on:click {href} class:w-full={fullWidth} class="button {variant} {size} {classNames} {align}"
|
||||
><slot />
|
||||
</a>
|
||||
{:else}
|
||||
<button
|
||||
on:click
|
||||
{type}
|
||||
{disabled}
|
||||
class:w-full={fullWidth}
|
||||
class="button {variant} {size} {classNames} {align}"
|
||||
>
|
||||
<slot />
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
.button {
|
||||
@apply inline-flex;
|
||||
@@ -172,31 +200,3 @@
|
||||
@apply justify-end;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script lang="ts">
|
||||
export let href = null;
|
||||
export let type = 'button';
|
||||
export let size = 'md';
|
||||
export let variant = 'primary';
|
||||
export let fullWidth = false;
|
||||
export let align = 'center';
|
||||
export let disabled = false;
|
||||
let classNames = '';
|
||||
export { classNames as class };
|
||||
</script>
|
||||
|
||||
{#if href}
|
||||
<a on:click {href} class:w-full={fullWidth} class="button {variant} {size} {classNames} {align}"
|
||||
><slot />
|
||||
</a>
|
||||
{:else}
|
||||
<button
|
||||
on:click
|
||||
{type}
|
||||
{disabled}
|
||||
class:w-full={fullWidth}
|
||||
class="button {variant} {size} {classNames} {align}"
|
||||
>
|
||||
<slot />
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
onDelete = () => {}
|
||||
} = $props();
|
||||
|
||||
let names = list.map((l: ListItem) => l.name);
|
||||
let localName = $state(currentName);
|
||||
let wasCancelled = $state(false);
|
||||
|
||||
@@ -46,6 +45,8 @@
|
||||
function commitIfValid() {
|
||||
if (!error && !wasCancelled && localName != currentName) {
|
||||
editedName = localName.trim();
|
||||
inputRef?.blur();
|
||||
isEditing = false;
|
||||
onSave(editedName, currentName);
|
||||
} else {
|
||||
localName = currentName;
|
||||
|
||||
Reference in New Issue
Block a user