Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/lib/elements/forms/inputText.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
export let maxlength: number = null;
export let tooltip: string = null;
export let isMultiple = false;
export let isPopoverDefined = true;

let element: HTMLInputElement;
let error: string;
Expand Down Expand Up @@ -73,10 +74,10 @@
$: wrapper = isMultiple ? FormItemPart : FormItem;
</script>

<svelte:component this={wrapper} {fullWidth}>
<svelte:component this={wrapper} {fullWidth} >
{#if label}
<Label {required} {hideRequired} {tooltip} {optionalText} hide={!showLabel} for={id}>
{label}{#if $$slots.popover}
{label}{#if $$slots.popover && isPopoverDefined}
<Drop bind:show display="inline-block">
<!-- TODO: make unclicked icon greyed out and hover and clicked filled -->
&nbsp;<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type ProvidersMap = {
configure: {
label: string;
name: string;
type: 'text' | 'phone' | 'email' | 'domain' | 'file' | 'switch';
type: 'text' | 'password' | 'phone' | 'email' | 'domain' | 'file' | 'switch';
placeholder?: string;
description?: string;
popover?: string[];
Expand Down Expand Up @@ -338,7 +338,7 @@ export const providers: ProvidersMap = {
{
label: 'Password',
name: 'password',
type: 'text',
type: 'password',
placeholder: 'Enter password'
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
InputEmail,
InputFile,
InputSwitch,
InputText
InputText,
InputPassword
} from '$lib/elements/forms';
import InputPhone from '$lib/elements/forms/inputPhone.svelte';
import { WizardStep } from '$lib/layout';
Expand Down Expand Up @@ -52,15 +53,26 @@
<FormList>
{#each inputs as input}
{#if input.type === 'text'}
<InputText
<InputText
id={input.name}
label={input.label}
placeholder={input.placeholder}
isPopoverDefined={input.popover !== undefined}
bind:value={$providerParams[$provider][input.name]}>
<svelte:fragment slot="popover">
{@html input.popover?.join('<br/><br/>')}
</svelte:fragment>
</InputText>
{:else if input.type === 'password'}
<InputPassword
id={input.name}
label={input.label}
placeholder={input.placeholder}
bind:value={$providerParams[$provider][input.name]}>
<svelte:fragment slot="popover">
{@html input.popover?.join('<br/><br/>')}
</svelte:fragment>
</InputText>
</InputPassword>
{:else if input.type === 'email'}
<InputEmail
id={input.name}
Expand Down