9 changed files with 66 additions and 9 deletions
@ -1,17 +1,34 @@ |
|||||||
<script> |
<script> |
||||||
|
import { t } from '../../translations.svelte'; |
||||||
|
|
||||||
import Address from './Address.svelte'; |
import Address from './Address.svelte'; |
||||||
|
import Email from './Email.svelte'; |
||||||
|
import ExtraField from './ExtraField.svelte'; |
||||||
import FN from './FN.svelte'; |
import FN from './FN.svelte'; |
||||||
import Name from './Name.svelte'; |
import Name from './Name.svelte'; |
||||||
import Org from './Org.svelte'; |
import Org from './Org.svelte'; |
||||||
|
|
||||||
let { contact } = $props(); |
let { contact } = $props(); |
||||||
|
|
||||||
|
let addresses = $derived(contact.vcard.match(/^ADR.*:.+$/gm)); |
||||||
|
let emails = $derived(contact.vcard.match(/^EMAIL.*:.+$/gm)); |
||||||
|
let extra_fields = $derived(contact.vcard.match(/^X-.*:.+/gm)); |
||||||
</script> |
</script> |
||||||
|
|
||||||
<div> |
<fieldset> |
||||||
|
<legend>{t('contact_number',{number:contact.id})}</legend> |
||||||
<FN vcard={contact.vcard} /> |
<FN vcard={contact.vcard} /> |
||||||
<Org vcard={contact.vcard} /> |
<Org vcard={contact.vcard} /> |
||||||
<Name vcard={contact.vcard} /> |
<Name vcard={contact.vcard} /> |
||||||
<Address vcard={contact.vcard} /> |
{#each addresses as code} |
||||||
|
<Address {code} /> |
||||||
|
{/each} |
||||||
|
{#each emails as code} |
||||||
|
<Email {code} /> |
||||||
|
{/each} |
||||||
|
{#each extra_fields as code} |
||||||
|
<ExtraField {code} /> |
||||||
|
{/each} |
||||||
<hr/> |
<hr/> |
||||||
<pre>{contact.vcard}</pre> |
<pre>{contact.vcard}</pre> |
||||||
</div> |
</fieldset> |
||||||
@ -0,0 +1,9 @@ |
|||||||
|
<script> |
||||||
|
import { email } from '../../vcard.js'; |
||||||
|
|
||||||
|
let { code } = $props(); |
||||||
|
|
||||||
|
let adr = $derived(email(code)); |
||||||
|
</script> |
||||||
|
|
||||||
|
<span class="email">{adr}</span> |
||||||
@ -0,0 +1,14 @@ |
|||||||
|
<script> |
||||||
|
import { extra } from '../../vcard.js'; |
||||||
|
|
||||||
|
let { code } = $props(); |
||||||
|
|
||||||
|
let field = $derived(extra(code)); |
||||||
|
|
||||||
|
</script> |
||||||
|
|
||||||
|
{#if field} |
||||||
|
<span class={field.name}> |
||||||
|
{field.value} |
||||||
|
</span> |
||||||
|
{/if} |
||||||
@ -1,9 +1,12 @@ |
|||||||
<script> |
<script> |
||||||
import { fn } from '../../vcard.js'; |
import { fn } from '../../vcard.js'; |
||||||
|
import { t } from '../../translations.svelte'; |
||||||
|
|
||||||
let { vcard } = $props(); |
let { vcard } = $props(); |
||||||
|
|
||||||
let name = $derived(fn(vcard)); |
let name = $derived(fn(vcard)); |
||||||
</script> |
</script> |
||||||
|
|
||||||
<span class="formatted name">{name}</span> |
{#if name} |
||||||
|
<span class="formatted name"><span>{t('formatted name')}: </span>{name}</span> |
||||||
|
{/if} |
||||||
@ -1,9 +1,12 @@ |
|||||||
<script> |
<script> |
||||||
import { org } from '../../vcard.js'; |
import { org } from '../../vcard.js'; |
||||||
|
import { t } from '../../translations.svelte'; |
||||||
|
|
||||||
let { vcard } = $props(); |
let { vcard } = $props(); |
||||||
|
|
||||||
let o = $derived(org(vcard)); |
let o = $derived(org(vcard)); |
||||||
</script> |
</script> |
||||||
|
|
||||||
<span class="organization">{o}</span> |
{#if o} |
||||||
|
<span class="organization"><span>{t('organization')}: </span>{o}</span> |
||||||
|
{/if} |
||||||
Loading…
Reference in new issue