working on address card editor

This commit is contained in:
2025-10-08 22:16:35 +02:00
parent 2f3a29d606
commit c888845191
14 changed files with 148 additions and 50 deletions

View File

@@ -1,18 +1,18 @@
<script>
import LineEditor from '../../Components/LineEditor.svelte';
import { fn } from '../../vcard.js';
import { t } from '../../translations.svelte';
import { t } from '../../translations.svelte';
let { code, patch = (from, to) => true } = $props();
let name = $derived(fn(code));
let value = $derived(fn(code));
function onSet(newVal){
const newCode = code.replace(name,newVal);
const newCode = code.replace(value,newVal);
return patch(code,newCode);
}
</script>
{#if name}
<LineEditor type="span" editable={true} value={name} {onSet} />
{#if value}
<LineEditor type="span" editable={true} {value} {onSet} title={t('formatted_name')}/>
{/if}