Skip to content

Commit 32d7b9c

Browse files
authored
feat: Auto Form (#497)
* chore: initial poc * chore: cleanup, log on the docs * feat: add file component * feat: typing for nested config * feat: more props for form field * feat: export field component, expose more slotprops * feat: array, config label * feat: improve array * feat: support custom form state * chore: prevent schema props showing on attribute * feat: dependencies rendering * refactor: change name to fieldName to allow easier slotProps binding * feat: improve file upload * feat: expose custom auto form slot * chore: bump * chore: replicate to default styling * chore: build registry * fix: export component before init * chore: add examples * chore: add form api example * fix: warning in console * chore: bump package version * chore: update example, complete md * feat: allow zod description as label, allow custom component * docs: fix link * feat: show required field for object * chore: replace enumProps
1 parent 18e40cf commit 32d7b9c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+3958
-21
lines changed

apps/www/.vitepress/theme/components/Callout.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ defineProps<CalloutProps>()
1919
<AlertTitle v-if="title">
2020
{{ title }}
2121
</AlertTitle>
22-
<AlertDescription>
22+
<AlertDescription class="[&_a]:underline">
2323
<slot />
2424
</AlertDescription>
2525
</Alert>

apps/www/.vitepress/theme/config/docs.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export interface NavItem {
88
}
99

1010
export type SidebarNavItem = NavItem & {
11-
items: SidebarNavItem[]
11+
items?: SidebarNavItem[]
1212
}
1313

1414
export type NavItemWithChildren = NavItem & {
@@ -134,6 +134,16 @@ export const docsConfig: DocsConfig = {
134134
},
135135
],
136136
},
137+
{
138+
title: 'Extended',
139+
items: [
140+
{
141+
title: 'Auto Form',
142+
href: '/docs/components/auto-form',
143+
items: [],
144+
},
145+
],
146+
},
137147
{
138148
title: 'Components',
139149
items: [

apps/www/__registry__/index.ts

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,62 @@ export const Index = {
3838
component: () => import("../src/lib/registry/default/example/AspectRatioDemo.vue").then((m) => m.default),
3939
files: ["../src/lib/registry/default/example/AspectRatioDemo.vue"],
4040
},
41+
"AutoFormApi": {
42+
name: "AutoFormApi",
43+
type: "components:example",
44+
registryDependencies: ["button","toast","auto-form"],
45+
component: () => import("../src/lib/registry/default/example/AutoFormApi.vue").then((m) => m.default),
46+
files: ["../src/lib/registry/default/example/AutoFormApi.vue"],
47+
},
48+
"AutoFormArray": {
49+
name: "AutoFormArray",
50+
type: "components:example",
51+
registryDependencies: ["button","toast","auto-form"],
52+
component: () => import("../src/lib/registry/default/example/AutoFormArray.vue").then((m) => m.default),
53+
files: ["../src/lib/registry/default/example/AutoFormArray.vue"],
54+
},
55+
"AutoFormBasic": {
56+
name: "AutoFormBasic",
57+
type: "components:example",
58+
registryDependencies: ["button","toast","auto-form"],
59+
component: () => import("../src/lib/registry/default/example/AutoFormBasic.vue").then((m) => m.default),
60+
files: ["../src/lib/registry/default/example/AutoFormBasic.vue"],
61+
},
62+
"AutoFormConfirmPassword": {
63+
name: "AutoFormConfirmPassword",
64+
type: "components:example",
65+
registryDependencies: ["button","toast","auto-form"],
66+
component: () => import("../src/lib/registry/default/example/AutoFormConfirmPassword.vue").then((m) => m.default),
67+
files: ["../src/lib/registry/default/example/AutoFormConfirmPassword.vue"],
68+
},
69+
"AutoFormControlled": {
70+
name: "AutoFormControlled",
71+
type: "components:example",
72+
registryDependencies: ["button","toast","auto-form"],
73+
component: () => import("../src/lib/registry/default/example/AutoFormControlled.vue").then((m) => m.default),
74+
files: ["../src/lib/registry/default/example/AutoFormControlled.vue"],
75+
},
76+
"AutoFormDependencies": {
77+
name: "AutoFormDependencies",
78+
type: "components:example",
79+
registryDependencies: ["button","toast","auto-form"],
80+
component: () => import("../src/lib/registry/default/example/AutoFormDependencies.vue").then((m) => m.default),
81+
files: ["../src/lib/registry/default/example/AutoFormDependencies.vue"],
82+
},
83+
"AutoFormInputWithoutLabel": {
84+
name: "AutoFormInputWithoutLabel",
85+
type: "components:example",
86+
registryDependencies: ["button","toast","auto-form"],
87+
component: () => import("../src/lib/registry/default/example/AutoFormInputWithoutLabel.vue").then((m) => m.default),
88+
files: ["../src/lib/registry/default/example/AutoFormInputWithoutLabel.vue"],
89+
},
90+
"AutoFormSubObject": {
91+
name: "AutoFormSubObject",
92+
type: "components:example",
93+
registryDependencies: ["button","toast","auto-form"],
94+
component: () => import("../src/lib/registry/default/example/AutoFormSubObject.vue").then((m) => m.default),
95+
files: ["../src/lib/registry/default/example/AutoFormSubObject.vue"],
96+
},
4197
"AvatarDemo": {
4298
name: "AvatarDemo",
4399
type: "components:example",
@@ -1278,6 +1334,62 @@ export const Index = {
12781334
component: () => import("../src/lib/registry/new-york/example/AspectRatioDemo.vue").then((m) => m.default),
12791335
files: ["../src/lib/registry/new-york/example/AspectRatioDemo.vue"],
12801336
},
1337+
"AutoFormApi": {
1338+
name: "AutoFormApi",
1339+
type: "components:example",
1340+
registryDependencies: ["button","toast","auto-form"],
1341+
component: () => import("../src/lib/registry/new-york/example/AutoFormApi.vue").then((m) => m.default),
1342+
files: ["../src/lib/registry/new-york/example/AutoFormApi.vue"],
1343+
},
1344+
"AutoFormArray": {
1345+
name: "AutoFormArray",
1346+
type: "components:example",
1347+
registryDependencies: ["button","toast","auto-form"],
1348+
component: () => import("../src/lib/registry/new-york/example/AutoFormArray.vue").then((m) => m.default),
1349+
files: ["../src/lib/registry/new-york/example/AutoFormArray.vue"],
1350+
},
1351+
"AutoFormBasic": {
1352+
name: "AutoFormBasic",
1353+
type: "components:example",
1354+
registryDependencies: ["button","toast","auto-form"],
1355+
component: () => import("../src/lib/registry/new-york/example/AutoFormBasic.vue").then((m) => m.default),
1356+
files: ["../src/lib/registry/new-york/example/AutoFormBasic.vue"],
1357+
},
1358+
"AutoFormConfirmPassword": {
1359+
name: "AutoFormConfirmPassword",
1360+
type: "components:example",
1361+
registryDependencies: ["button","toast","auto-form"],
1362+
component: () => import("../src/lib/registry/new-york/example/AutoFormConfirmPassword.vue").then((m) => m.default),
1363+
files: ["../src/lib/registry/new-york/example/AutoFormConfirmPassword.vue"],
1364+
},
1365+
"AutoFormControlled": {
1366+
name: "AutoFormControlled",
1367+
type: "components:example",
1368+
registryDependencies: ["button","toast","auto-form"],
1369+
component: () => import("../src/lib/registry/new-york/example/AutoFormControlled.vue").then((m) => m.default),
1370+
files: ["../src/lib/registry/new-york/example/AutoFormControlled.vue"],
1371+
},
1372+
"AutoFormDependencies": {
1373+
name: "AutoFormDependencies",
1374+
type: "components:example",
1375+
registryDependencies: ["button","toast","auto-form"],
1376+
component: () => import("../src/lib/registry/new-york/example/AutoFormDependencies.vue").then((m) => m.default),
1377+
files: ["../src/lib/registry/new-york/example/AutoFormDependencies.vue"],
1378+
},
1379+
"AutoFormInputWithoutLabel": {
1380+
name: "AutoFormInputWithoutLabel",
1381+
type: "components:example",
1382+
registryDependencies: ["button","toast","auto-form"],
1383+
component: () => import("../src/lib/registry/new-york/example/AutoFormInputWithoutLabel.vue").then((m) => m.default),
1384+
files: ["../src/lib/registry/new-york/example/AutoFormInputWithoutLabel.vue"],
1385+
},
1386+
"AutoFormSubObject": {
1387+
name: "AutoFormSubObject",
1388+
type: "components:example",
1389+
registryDependencies: ["button","toast","auto-form"],
1390+
component: () => import("../src/lib/registry/new-york/example/AutoFormSubObject.vue").then((m) => m.default),
1391+
files: ["../src/lib/registry/new-york/example/AutoFormSubObject.vue"],
1392+
},
12811393
"AvatarDemo": {
12821394
name: "AvatarDemo",
12831395
type: "components:example",

apps/www/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"tailwindcss-animate": "^1.0.7",
3838
"v-calendar": "^3.1.2",
3939
"vaul-vue": "^0.1.0",
40-
"vee-validate": "4.12.5",
40+
"vee-validate": "4.12.6",
4141
"vue": "^3.4.24",
4242
"vue-sonner": "^1.1.2",
4343
"vue-wrap-balancer": "^1.1.3",

0 commit comments

Comments
 (0)