form: fix popover, improve form types

This commit is contained in:
dswbx
2025-02-08 15:43:02 +01:00
parent 3fa682bfe1
commit f7e6928dba
9 changed files with 56 additions and 49 deletions

View File

@@ -30,7 +30,7 @@ const schema2 = {
}
},
required: ["age"]
};
} as const satisfies JSONSchema;
export default function JsonSchemaForm3() {
const { schema: _schema, config } = useBknd();
@@ -46,7 +46,9 @@ export default function JsonSchemaForm3() {
return (
<Scrollable>
<div className="flex flex-col p-3">
{/*<Form
<Form
onChange={(data) => console.log("change", data)}
onSubmit={(data) => console.log("submit", data)}
schema={{
type: "object",
properties: {
@@ -59,12 +61,14 @@ export default function JsonSchemaForm3() {
}
}
},
required: ["age"]
required: ["age"],
additionalProperties: false
}}
initialValues={{ name: "Peter", age: 20, deep: { nested: "hello" } }}
className="flex flex-col gap-3"
validateOn="change"
/>*/}
options={{ debug: true }}
/>
{/*<Form
schema={{
@@ -245,12 +249,12 @@ export default function JsonSchemaForm3() {
</Form>*/}
{/*<CustomMediaForm />*/}
<Form
{/*<Form
schema={schema.media}
initialValues={config.media as any}
onSubmit={console.log}
validateOn="change"
/>
/>*/}
{/*<Form
schema={removeKeyRecursively(schema.media, "pattern") as any}