Add `title` prop to forms (hides title if none entered)
This commit is contained in:
parent
3c557b3b3f
commit
ec594234d8
|
@ -335,6 +335,11 @@ export default {
|
|||
key: "model",
|
||||
control: ModelSelect,
|
||||
},
|
||||
{
|
||||
label: "Title",
|
||||
key: "title",
|
||||
control: Input,
|
||||
},
|
||||
],
|
||||
},
|
||||
template: {
|
||||
|
@ -355,6 +360,11 @@ export default {
|
|||
key: "model",
|
||||
control: ModelSelect,
|
||||
},
|
||||
{
|
||||
label: "Title",
|
||||
key: "title",
|
||||
control: Input,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
|
|
@ -206,14 +206,16 @@
|
|||
"description": "an HTML table that fetches data from a table or view and displays it.",
|
||||
"data": true,
|
||||
"props": {
|
||||
"model": "models"
|
||||
"model": "models",
|
||||
"title": "string"
|
||||
}
|
||||
},
|
||||
"dataformwide": {
|
||||
"description": "an HTML table that fetches data from a table or view and displays it.",
|
||||
"data": true,
|
||||
"props": {
|
||||
"model": "models"
|
||||
"model": "models",
|
||||
"title": "string"
|
||||
}
|
||||
},
|
||||
"datalist": {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
export let _bb
|
||||
export let model
|
||||
export let title
|
||||
|
||||
const TYPE_MAP = {
|
||||
string: "text",
|
||||
|
@ -10,8 +11,6 @@
|
|||
number: "number",
|
||||
}
|
||||
|
||||
let username
|
||||
let password
|
||||
let newModel = {
|
||||
modelId: model,
|
||||
}
|
||||
|
@ -64,7 +63,9 @@
|
|||
</script>
|
||||
|
||||
<form class="form" on:submit|preventDefault>
|
||||
<h1>{modelDef.name} Form</h1>
|
||||
{#if title}
|
||||
<h1>{title}</h1>
|
||||
{/if}
|
||||
<hr />
|
||||
<div class="form-content">
|
||||
{#each fields as field}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
import { onMount } from "svelte"
|
||||
export let _bb
|
||||
export let model
|
||||
export let title
|
||||
|
||||
const TYPE_MAP = {
|
||||
string: "text",
|
||||
|
@ -9,8 +10,6 @@
|
|||
number: "number",
|
||||
}
|
||||
|
||||
let username
|
||||
let password
|
||||
let newModel = {
|
||||
modelId: model,
|
||||
}
|
||||
|
@ -54,7 +53,9 @@
|
|||
</script>
|
||||
|
||||
<form class="form" on:submit|preventDefault>
|
||||
<h1>{modelDef.name} Form</h1>
|
||||
{#if title}
|
||||
<h1>{title}</h1>
|
||||
{/if}
|
||||
<hr />
|
||||
<div class="form-content">
|
||||
{#each fields as field}
|
||||
|
|
Loading…
Reference in New Issue