init
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<script>
|
||||
import { uniqueId } from "lodash";
|
||||
export let label;
|
||||
export let value;
|
||||
let id = uniqueId();
|
||||
</script>
|
||||
|
||||
<div class="form-check">
|
||||
<input
|
||||
value=""
|
||||
class="form-check-input"
|
||||
type="checkbox"
|
||||
bind:checked={value}
|
||||
id={id}
|
||||
/>
|
||||
<label class="form-check-label" for={id}>
|
||||
{label}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
<script>
|
||||
import { uniqueId } from "lodash";
|
||||
export let label;
|
||||
export let value;
|
||||
let id = uniqueId();
|
||||
</script>
|
||||
|
||||
{#if label}
|
||||
<div class="d-flex justify-content-between">
|
||||
<label for={id} class="form-label">{label}</label>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="input-group ">
|
||||
<div style="width:64px;">
|
||||
<input
|
||||
type="color"
|
||||
class="form-control form-control-color"
|
||||
bind:value
|
||||
/>
|
||||
</div>
|
||||
<input type="text" {id} class="form-control" bind:value />
|
||||
</div>
|
||||
@@ -0,0 +1,38 @@
|
||||
<script>
|
||||
import { onMount } from "svelte";
|
||||
import flatpickr from "flatpickr";
|
||||
import "flatpickr/dist/flatpickr.css";
|
||||
import "flatpickr/dist/themes/light.css";
|
||||
|
||||
import { uniqueId } from "lodash";
|
||||
export let label;
|
||||
export let value;
|
||||
let pickerInput;
|
||||
let id = uniqueId();
|
||||
|
||||
let flatpickrOptions = {
|
||||
enableTime: false,
|
||||
allowInput: true,
|
||||
dateFormat: "Y-m-d",
|
||||
defaultDate: value,
|
||||
};
|
||||
|
||||
onMount(() => {
|
||||
flatpickr(pickerInput, flatpickrOptions);
|
||||
});
|
||||
</script>
|
||||
|
||||
{#if label}
|
||||
<div class="d-flex justify-content-between">
|
||||
<label for={id} class="form-label">{label}</label>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<input
|
||||
type="text"
|
||||
{id}
|
||||
class="form-control"
|
||||
bind:value
|
||||
bind:this={pickerInput}
|
||||
autocomplete="off"
|
||||
/>
|
||||
@@ -0,0 +1,26 @@
|
||||
<script>
|
||||
import { uniqueId } from "lodash";
|
||||
export let label;
|
||||
export let name;
|
||||
export let group;
|
||||
export let value;
|
||||
export let help;
|
||||
let id = uniqueId();
|
||||
</script>
|
||||
|
||||
<div class="form-check">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="radio"
|
||||
{value}
|
||||
{name}
|
||||
bind:group
|
||||
{id}
|
||||
/>
|
||||
<label class="form-check-label" for={id}>
|
||||
{label}
|
||||
</label>
|
||||
{#if help}
|
||||
<span class="text-muted">{help}</span>
|
||||
{/if}
|
||||
</div>
|
||||
Reference in New Issue
Block a user