fix errors
This commit is contained in:
parent
0b624b1f53
commit
55763353be
1 changed files with 0 additions and 60 deletions
|
@ -1,5 +1,4 @@
|
||||||
---
|
---
|
||||||
import Code from 'astro/components/Code.astro';
|
|
||||||
import Layout from "../../layouts/Layout.astro";
|
import Layout from "../../layouts/Layout.astro";
|
||||||
import Footer from "../../components/Footer.astro";
|
import Footer from "../../components/Footer.astro";
|
||||||
import Back from "../../components/Back.astro";
|
import Back from "../../components/Back.astro";
|
||||||
|
@ -7,8 +6,6 @@ import Back from "../../components/Back.astro";
|
||||||
import Form, {ControlConfig, FormGroup} from '@astro-reactive/form';
|
import Form, {ControlConfig, FormGroup} from '@astro-reactive/form';
|
||||||
import { Validators } from "@astro-reactive/validator";
|
import { Validators } from "@astro-reactive/validator";
|
||||||
|
|
||||||
|
|
||||||
const simpleFormCode = `---
|
|
||||||
const simpleForm = new FormGroup([
|
const simpleForm = new FormGroup([
|
||||||
{
|
{
|
||||||
name: "simple-text",
|
name: "simple-text",
|
||||||
|
@ -21,63 +18,6 @@ const simpleForm = new FormGroup([
|
||||||
validators: [Validators.email]
|
validators: [Validators.email]
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
---
|
|
||||||
<Form showValidationHints={true} formGroups={simpleForm} />
|
|
||||||
`
|
|
||||||
|
|
||||||
const simpleForm = new FormGroup([
|
|
||||||
{
|
|
||||||
name: "simple-text",
|
|
||||||
label: "Simple Text Control",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'email',
|
|
||||||
label: 'Email',
|
|
||||||
value: 'invalid-email',
|
|
||||||
validators: [Validators.email]
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
|
|
||||||
const multipleFormGroupCode = `---
|
|
||||||
const name: ControlConfig[] = [
|
|
||||||
{
|
|
||||||
name: "first-name",
|
|
||||||
value: "Ayo",
|
|
||||||
label: "First Name",
|
|
||||||
validators: [Validators.required]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "last-name",
|
|
||||||
label: "Last Name",
|
|
||||||
validators: [Validators.required]
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const characteristics: ControlConfig[] = [
|
|
||||||
{
|
|
||||||
name: "is-good-looking",
|
|
||||||
type: "radio",
|
|
||||||
label: "Is Good Looking?",
|
|
||||||
value: [{value: "checked", label: "checked", checked: true}, {value: "not checked", label: "not checked", checked: false}],
|
|
||||||
},
|
|
||||||
{name: 'required', label: 'Required Field', placeholder: 'but empty 😔', validators: [Validators.required]},
|
|
||||||
{
|
|
||||||
name: "is-awesome",
|
|
||||||
type: "checkbox",
|
|
||||||
label: "Is Awesome?",
|
|
||||||
value: "checked",
|
|
||||||
labelPosition: "right",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const nameForm: FormGroup = new FormGroup(name, "Name");
|
|
||||||
const characteristicsForm: FormGroup = new FormGroup(
|
|
||||||
characteristics,
|
|
||||||
"Characteristics"
|
|
||||||
);
|
|
||||||
---
|
|
||||||
<Form showValidationHints={true} formGroups={[nameForm, characteristicsForm]} />
|
|
||||||
`
|
|
||||||
|
|
||||||
const name: ControlConfig[] = [
|
const name: ControlConfig[] = [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue