2023-10-06 18:47:50 +03:00
|
|
|
<script>
|
|
|
|
|
import { getErrorMessage } from "./errorMessage";
|
|
|
|
|
export let field;
|
|
|
|
|
export let value;
|
|
|
|
|
export let isCreateMode;
|
|
|
|
|
export let validationErrors;
|
|
|
|
|
let thisEl;
|
|
|
|
|
$: errorMessage = getErrorMessage(validationErrors, field.name);
|
|
|
|
|
export let id;
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<div class="mb-0">
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
{id}
|
|
|
|
|
class="form-control"
|
|
|
|
|
class:is-invalid={errorMessage}
|
|
|
|
|
bind:value
|
|
|
|
|
autocomplete="off"
|
|
|
|
|
readonly={field.readonly && !isCreateMode}
|
|
|
|
|
/>
|
2024-08-17 19:23:19 +03:00
|
|
|
<div class="system-help-text light-text">
|
2024-08-16 21:11:01 +03:00
|
|
|
Leave this empty to autogenerate from <i>{field.source}</i>
|
|
|
|
|
</div>
|
2023-10-06 18:47:50 +03:00
|
|
|
{#if errorMessage}
|
|
|
|
|
<div class="invalid-feedback d-block">
|
|
|
|
|
{errorMessage}
|
|
|
|
|
</div>
|
|
|
|
|
{/if}
|
|
|
|
|
</div>
|
|
|
|
|
|