Add `title` prop to forms (hides title if none entered)

This commit is contained in:
Michael Shanks 2020-07-06 10:17:23 +01:00
parent 3c557b3b3f
commit ec594234d8
4 changed files with 22 additions and 8 deletions

View File

@ -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,
},
],
},
},

View File

@ -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": {

View File

@ -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}

View File

@ -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}