Skip to content

Commit

Permalink
Merge pull request #390 from appwrite/fix-nullable-inputs
Browse files Browse the repository at this point in the history
fix: inputs nullable
  • Loading branch information
TorstenDittmann authored Apr 11, 2023
2 parents ecefbf8 + 3d1fbf1 commit cfb6a45
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/lib/elements/forms/inputEmail.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
export let value = '';
export let placeholder = '';
export let required = false;
export let nullable = false;
export let disabled = false;
export let readonly = false;
export let autofocus = false;
Expand Down Expand Up @@ -70,7 +71,7 @@
bind:value
bind:this={element}
on:invalid={handleInvalid} />
{#if !required}
{#if nullable && !required}
<ul
class="buttons-list u-cross-center u-gap-8 u-position-absolute u-inset-block-start-8 u-inset-block-end-8 u-inset-inline-end-12">
<li class="buttons-list-item">
Expand Down
3 changes: 2 additions & 1 deletion src/lib/elements/forms/inputNumber.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
export let value: number = null;
export let placeholder = '';
export let required = false;
export let nullable = false;
export let disabled = false;
export let readonly = false;
export let autofocus = false;
Expand Down Expand Up @@ -86,7 +87,7 @@
style:--amount-of-buttons={required ? 0 : 1.75} />
<ul
class="buttons-list u-cross-center u-gap-8 u-position-absolute u-inset-block-start-8 u-inset-block-end-8 u-inset-inline-end-12">
{#if !required}
{#if nullable && !required}
<li class="buttons-list-item">
<NullCheckbox checked={value === null} on:change={handleNullChange} />
</li>
Expand Down
3 changes: 2 additions & 1 deletion src/lib/elements/forms/inputText.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
export let value = '';
export let placeholder = '';
export let required = false;
export let nullable = false;
export let disabled = false;
export let readonly = false;
export let autofocus = false;
Expand Down Expand Up @@ -81,7 +82,7 @@
<TextCounter max={maxlength} count={value?.length ?? 0} />
</li>
{/if}
{#if !required}
{#if nullable && !required}
<li class="buttons-list-item">
<NullCheckbox checked={value === null} on:change={handleNullChange} />
</li>
Expand Down
3 changes: 2 additions & 1 deletion src/lib/elements/forms/inputTextarea.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
export let value = '';
export let placeholder = '';
export let required = false;
export let nullable = false;
export let disabled = false;
export let readonly = false;
export let autofocus = false;
Expand Down Expand Up @@ -79,7 +80,7 @@
<TextCounter max={maxlength} count={value?.length ?? 0} />
</li>
{/if}
{#if !required}
{#if nullable && !required}
<li class="buttons-list-item">
<NullCheckbox checked={value === null} on:change={handleNullChange} />
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
{id}
{label}
{optionalText}
nullable
required={attribute.required}
min={attribute.min}
max={attribute.max}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<InputTextarea
{id}
{label}
nullable
placeholder="Enter string"
showLabel={!!label?.length}
required={attribute.required}
Expand All @@ -25,6 +26,7 @@
{id}
{label}
{optionalText}
nullable
placeholder="Enter string"
showLabel={!!label?.length}
required={attribute.required}
Expand Down

3 comments on commit cfb6a45

@vercel
Copy link

@vercel vercel bot commented on cfb6a45 Apr 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on cfb6a45 Apr 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

console-cloud – ./

console-cloud-git-main-appwrite.vercel.app
console-cloud.vercel.app
console-cloud-appwrite.vercel.app

@vercel
Copy link

@vercel vercel bot commented on cfb6a45 Apr 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.