-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #630 from appwrite/feat-messaging-create-message
Support creating email messages
- Loading branch information
Showing
17 changed files
with
1,000 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<script lang="ts"> | ||
import { onMount } from 'svelte'; | ||
import { FormItem, Helper, Label } from '.'; | ||
export let label: string; | ||
export let showLabel = true; | ||
export let optionalText: string | undefined = undefined; | ||
export let id: string; | ||
export let value = ''; | ||
export let required = false; | ||
export let min: string | number | undefined = undefined; | ||
export let max: string | number | undefined = undefined; | ||
export let disabled = false; | ||
export let readonly = false; | ||
export let autofocus = false; | ||
export let autocomplete = false; | ||
let element: HTMLInputElement; | ||
let error: string; | ||
onMount(() => { | ||
if (element && autofocus) { | ||
element.focus(); | ||
} | ||
}); | ||
function handleInvalid(event: Event) { | ||
event.preventDefault(); | ||
if (element.validity.valueMissing) { | ||
error = 'This field is required'; | ||
return; | ||
} | ||
error = element.validationMessage; | ||
} | ||
$: if (value) { | ||
error = null; | ||
} | ||
</script> | ||
|
||
<FormItem> | ||
<Label {required} {optionalText} hide={!showLabel} for={id}> | ||
{label} | ||
</Label> | ||
|
||
<div class="input-text-wrapper" style="--amount-of-buttons:1; --button-size: 1rem"> | ||
<input | ||
{id} | ||
{disabled} | ||
{readonly} | ||
{required} | ||
{min} | ||
{max} | ||
step="60" | ||
autocomplete={autocomplete ? 'on' : 'off'} | ||
type="time" | ||
class="input-text" | ||
bind:value | ||
bind:this={element} | ||
on:invalid={handleInvalid} /> | ||
</div> | ||
{#if error} | ||
<Helper type="warning">{error}</Helper> | ||
{/if} | ||
</FormItem> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.