31 lines
852 B
Svelte
31 lines
852 B
Svelte
<script>
|
|
import { uniqueId } from "lodash";
|
|
import { getContext } from "svelte";
|
|
const channelurl = getContext("channelurl");
|
|
export let field;
|
|
export let value;
|
|
export let schema;
|
|
let id = uniqueId();
|
|
</script>
|
|
|
|
<div class="mb-0">
|
|
<div class="d-flex justify-content-between">
|
|
<label for={id} class="form-label">{field.label}</label>
|
|
<a
|
|
class="text-decoration-none"
|
|
href="{channelurl}/schemas/{schema.name}/fields/edit/{field.name}"
|
|
><code class="text-primary opacity-50">{field.name}</code></a
|
|
>
|
|
</div>
|
|
<input
|
|
type="url"
|
|
{id}
|
|
class="form-control"
|
|
bind:value
|
|
placeholder="https://www.example.com"
|
|
/>
|
|
{#if field.help}
|
|
<small class=" text-primary opacity-50">{field.help}</small>
|
|
{/if}
|
|
</div>
|