refac
This commit is contained in:
@@ -120,6 +120,7 @@
|
|||||||
let eventConfirmationInput = false;
|
let eventConfirmationInput = false;
|
||||||
let eventConfirmationInputPlaceholder = '';
|
let eventConfirmationInputPlaceholder = '';
|
||||||
let eventConfirmationInputValue = '';
|
let eventConfirmationInputValue = '';
|
||||||
|
let eventConfirmationInputType = '';
|
||||||
let eventCallback = null;
|
let eventCallback = null;
|
||||||
|
|
||||||
let chatIdUnsubscriber: Unsubscriber | undefined;
|
let chatIdUnsubscriber: Unsubscriber | undefined;
|
||||||
@@ -524,6 +525,7 @@
|
|||||||
eventConfirmationMessage = data.message;
|
eventConfirmationMessage = data.message;
|
||||||
eventConfirmationInputPlaceholder = data.placeholder;
|
eventConfirmationInputPlaceholder = data.placeholder;
|
||||||
eventConfirmationInputValue = data?.value ?? '';
|
eventConfirmationInputValue = data?.value ?? '';
|
||||||
|
eventConfirmationInputType = data?.type ?? '';
|
||||||
} else {
|
} else {
|
||||||
console.log('Unknown message type', data);
|
console.log('Unknown message type', data);
|
||||||
}
|
}
|
||||||
@@ -2537,6 +2539,7 @@
|
|||||||
input={eventConfirmationInput}
|
input={eventConfirmationInput}
|
||||||
inputPlaceholder={eventConfirmationInputPlaceholder}
|
inputPlaceholder={eventConfirmationInputPlaceholder}
|
||||||
inputValue={eventConfirmationInputValue}
|
inputValue={eventConfirmationInputValue}
|
||||||
|
inputType={eventConfirmationInputType}
|
||||||
on:confirm={(e) => {
|
on:confirm={(e) => {
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
eventCallback(e.detail);
|
eventCallback(e.detail);
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
import { fade } from 'svelte/transition';
|
import { fade } from 'svelte/transition';
|
||||||
import { flyAndScale } from '$lib/utils/transitions';
|
import { flyAndScale } from '$lib/utils/transitions';
|
||||||
import { marked } from 'marked';
|
import { marked } from 'marked';
|
||||||
|
import SensitiveInput from './SensitiveInput.svelte';
|
||||||
|
|
||||||
export let title = '';
|
export let title = '';
|
||||||
export let message = '';
|
export let message = '';
|
||||||
@@ -22,6 +23,7 @@
|
|||||||
export let input = false;
|
export let input = false;
|
||||||
export let inputPlaceholder = '';
|
export let inputPlaceholder = '';
|
||||||
export let inputValue = '';
|
export let inputValue = '';
|
||||||
|
export let inputType = '';
|
||||||
|
|
||||||
export let show = false;
|
export let show = false;
|
||||||
|
|
||||||
@@ -130,13 +132,26 @@
|
|||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if input}
|
{#if input}
|
||||||
<textarea
|
{#if inputType === 'password'}
|
||||||
bind:value={inputValue}
|
<div
|
||||||
placeholder={inputPlaceholder ? inputPlaceholder : $i18n.t('Enter your message')}
|
class="w-full mt-2 rounded-lg px-4 py-2 text-sm dark:text-gray-300 dark:bg-gray-900"
|
||||||
class="w-full mt-2 rounded-lg px-4 py-2 text-sm dark:text-gray-300 dark:bg-gray-900 outline-hidden resize-none"
|
>
|
||||||
rows="3"
|
<SensitiveInput
|
||||||
required
|
id="event-confirm-input"
|
||||||
/>
|
placeholder={inputPlaceholder ? inputPlaceholder : $i18n.t('Enter your message')}
|
||||||
|
bind:value={inputValue}
|
||||||
|
required={true}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
|
<textarea
|
||||||
|
bind:value={inputValue}
|
||||||
|
placeholder={inputPlaceholder ? inputPlaceholder : $i18n.t('Enter your message')}
|
||||||
|
class="w-full mt-2 rounded-lg px-4 py-2 text-sm dark:text-gray-300 dark:bg-gray-900 outline-hidden resize-none"
|
||||||
|
rows="3"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</slot>
|
</slot>
|
||||||
|
|||||||
Reference in New Issue
Block a user