diff --git a/src/pages/showcase/astro-reactive-form.astro b/src/pages/showcase/astro-reactive-form.astro index ecda63e..a10e704 100644 --- a/src/pages/showcase/astro-reactive-form.astro +++ b/src/pages/showcase/astro-reactive-form.astro @@ -1,5 +1,4 @@ --- -import Code from 'astro/components/Code.astro'; import Layout from "../../layouts/Layout.astro"; import Footer from "../../components/Footer.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 { Validators } from "@astro-reactive/validator"; - -const simpleFormCode = `--- const simpleForm = new FormGroup([ { name: "simple-text", @@ -21,63 +18,6 @@ const simpleForm = new FormGroup([ validators: [Validators.email] } ]); ---- -
-` - -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" -); ---- - -` const name: ControlConfig[] = [ {