2021-05-22 12:32:32 +03:00
|
|
|
<script>
|
|
|
|
|
export let label;
|
|
|
|
|
export let value;
|
|
|
|
|
export let checked;
|
|
|
|
|
export let name;
|
2021-06-21 19:21:43 +03:00
|
|
|
export let isEditable = false;
|
2021-05-22 12:32:32 +03:00
|
|
|
</script>
|
|
|
|
|
|
2021-07-03 19:29:41 +00:00
|
|
|
<label class="inline-flex items-center w-full">
|
2021-05-22 12:32:32 +03:00
|
|
|
<input
|
|
|
|
|
type="checkbox"
|
|
|
|
|
class="rounded border-gray-300 text-indigo-600 shadow-sm focus:border-indigo-300 focus:ring focus:ring-offset-0 focus:ring-indigo-200 focus:ring-opacity-50"
|
|
|
|
|
{name}
|
|
|
|
|
{value}
|
2021-06-21 19:21:43 +03:00
|
|
|
disabled={isEditable}
|
2021-05-22 12:32:32 +03:00
|
|
|
bind:checked
|
|
|
|
|
/>
|
2021-06-21 19:21:43 +03:00
|
|
|
{#if isEditable}
|
|
|
|
|
<input
|
|
|
|
|
class="form-input p-2 mt-1 ml-1 block w-2/4 bg-gray-100 border-t-0 border-l-0 border-r-0 border-b-1"
|
|
|
|
|
type="text"
|
|
|
|
|
placeholder="Your option"
|
|
|
|
|
bind:value={label}
|
|
|
|
|
/>
|
|
|
|
|
{:else}
|
|
|
|
|
<span class="ml-2">{label}</span>
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
<slot name="iconbutton" />
|
2021-05-22 12:32:32 +03:00
|
|
|
</label>
|