pdyform 2.0.2 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +98 -74
- package/package.json +9 -3
- package/packages/core/dist/chunk-6F4PWJZI.js +0 -0
- package/packages/core/dist/chunk-KA6QUMVR.js +158 -0
- package/packages/core/dist/chunk-REHKL5VH.js +76 -0
- package/packages/core/dist/formState.cjs +132 -78
- package/packages/core/dist/formState.d.cts +14 -10
- package/packages/core/dist/formState.d.ts +14 -10
- package/packages/core/dist/formState.js +4 -12
- package/packages/core/dist/index.cjs +138 -78
- package/packages/core/dist/index.d.cts +4 -3
- package/packages/core/dist/index.d.ts +4 -3
- package/packages/core/dist/index.js +11 -12
- package/packages/core/dist/types.d.cts +17 -5
- package/packages/core/dist/types.d.ts +17 -5
- package/packages/core/dist/types.js +1 -0
- package/packages/core/dist/utils.cjs +78 -19
- package/packages/core/dist/utils.d.cts +17 -5
- package/packages/core/dist/utils.d.ts +17 -5
- package/packages/core/dist/utils.js +7 -1
- package/packages/react/dist/index.cjs +1 -461
- package/packages/react/dist/index.d.cts +33 -2
- package/packages/react/dist/index.d.ts +33 -2
- package/packages/react/dist/index.js +1 -411
- package/packages/vue/dist/index.d.ts +51 -39
- package/packages/vue/dist/index.js +1 -28
- package/packages/vue/dist/index.mjs +630 -6527
- package/eslint.config.mjs +0 -53
- package/example/README.md +0 -36
- package/example/react-demo/index.html +0 -12
- package/example/react-demo/node_modules/.bin/browserslist +0 -17
- package/example/react-demo/node_modules/.bin/tsc +0 -17
- package/example/react-demo/node_modules/.bin/tsserver +0 -17
- package/example/react-demo/node_modules/.bin/vite +0 -17
- package/example/react-demo/node_modules/.vite/deps/@radix-ui_react-checkbox.js +0 -300
- package/example/react-demo/node_modules/.vite/deps/@radix-ui_react-checkbox.js.map +0 -7
- package/example/react-demo/node_modules/.vite/deps/@radix-ui_react-label.js +0 -194
- package/example/react-demo/node_modules/.vite/deps/@radix-ui_react-label.js.map +0 -7
- package/example/react-demo/node_modules/.vite/deps/@radix-ui_react-radio-group.js +0 -530
- package/example/react-demo/node_modules/.vite/deps/@radix-ui_react-radio-group.js.map +0 -7
- package/example/react-demo/node_modules/.vite/deps/@radix-ui_react-select.js +0 -4808
- package/example/react-demo/node_modules/.vite/deps/@radix-ui_react-select.js.map +0 -7
- package/example/react-demo/node_modules/.vite/deps/_metadata.json +0 -115
- package/example/react-demo/node_modules/.vite/deps/chunk-3D5PZ6F6.js +0 -49
- package/example/react-demo/node_modules/.vite/deps/chunk-3D5PZ6F6.js.map +0 -7
- package/example/react-demo/node_modules/.vite/deps/chunk-5Q2RBQLA.js +0 -127
- package/example/react-demo/node_modules/.vite/deps/chunk-5Q2RBQLA.js.map +0 -7
- package/example/react-demo/node_modules/.vite/deps/chunk-G3PMV62Z.js +0 -36
- package/example/react-demo/node_modules/.vite/deps/chunk-G3PMV62Z.js.map +0 -7
- package/example/react-demo/node_modules/.vite/deps/chunk-GX7YZ5KV.js +0 -370
- package/example/react-demo/node_modules/.vite/deps/chunk-GX7YZ5KV.js.map +0 -7
- package/example/react-demo/node_modules/.vite/deps/chunk-PUFJGYAC.js +0 -928
- package/example/react-demo/node_modules/.vite/deps/chunk-PUFJGYAC.js.map +0 -7
- package/example/react-demo/node_modules/.vite/deps/chunk-SIU35MPB.js +0 -21
- package/example/react-demo/node_modules/.vite/deps/chunk-SIU35MPB.js.map +0 -7
- package/example/react-demo/node_modules/.vite/deps/chunk-TOMGVNQP.js +0 -1906
- package/example/react-demo/node_modules/.vite/deps/chunk-TOMGVNQP.js.map +0 -7
- package/example/react-demo/node_modules/.vite/deps/chunk-YYN6DZAU.js +0 -21628
- package/example/react-demo/node_modules/.vite/deps/chunk-YYN6DZAU.js.map +0 -7
- package/example/react-demo/node_modules/.vite/deps/chunk-ZE5VSJFE.js +0 -144
- package/example/react-demo/node_modules/.vite/deps/chunk-ZE5VSJFE.js.map +0 -7
- package/example/react-demo/node_modules/.vite/deps/class-variance-authority.js +0 -51
- package/example/react-demo/node_modules/.vite/deps/class-variance-authority.js.map +0 -7
- package/example/react-demo/node_modules/.vite/deps/clsx.js +0 -10
- package/example/react-demo/node_modules/.vite/deps/clsx.js.map +0 -7
- package/example/react-demo/node_modules/.vite/deps/lucide-react.js +0 -29725
- package/example/react-demo/node_modules/.vite/deps/lucide-react.js.map +0 -7
- package/example/react-demo/node_modules/.vite/deps/package.json +0 -3
- package/example/react-demo/node_modules/.vite/deps/react-dom.js +0 -7
- package/example/react-demo/node_modules/.vite/deps/react-dom.js.map +0 -7
- package/example/react-demo/node_modules/.vite/deps/react-dom_client.js +0 -39
- package/example/react-demo/node_modules/.vite/deps/react-dom_client.js.map +0 -7
- package/example/react-demo/node_modules/.vite/deps/react.js +0 -6
- package/example/react-demo/node_modules/.vite/deps/react.js.map +0 -7
- package/example/react-demo/node_modules/.vite/deps/react_jsx-dev-runtime.js +0 -913
- package/example/react-demo/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +0 -7
- package/example/react-demo/node_modules/.vite/deps/react_jsx-runtime.js +0 -7
- package/example/react-demo/node_modules/.vite/deps/react_jsx-runtime.js.map +0 -7
- package/example/react-demo/node_modules/.vite/deps/tailwind-merge.js +0 -2534
- package/example/react-demo/node_modules/.vite/deps/tailwind-merge.js.map +0 -7
- package/example/react-demo/package.json +0 -23
- package/example/react-demo/postcss.config.mjs +0 -6
- package/example/react-demo/src/App.tsx +0 -64
- package/example/react-demo/src/main.tsx +0 -10
- package/example/react-demo/src/styles.css +0 -102
- package/example/react-demo/tailwind.config.mjs +0 -50
- package/example/react-demo/tsconfig.json +0 -16
- package/example/react-demo/vite.config.ts +0 -14
- package/example/shared/defaultSchema.ts +0 -68
- package/example/vue-demo/index.html +0 -12
- package/example/vue-demo/node_modules/.bin/tsc +0 -17
- package/example/vue-demo/node_modules/.bin/tsserver +0 -17
- package/example/vue-demo/node_modules/.bin/vite +0 -17
- package/example/vue-demo/node_modules/.vite/deps/_metadata.json +0 -46
- package/example/vue-demo/node_modules/.vite/deps/chunk-PZ5AY32C.js +0 -10
- package/example/vue-demo/node_modules/.vite/deps/chunk-PZ5AY32C.js.map +0 -7
- package/example/vue-demo/node_modules/.vite/deps/chunk-TCXBSQ4M.js +0 -12877
- package/example/vue-demo/node_modules/.vite/deps/chunk-TCXBSQ4M.js.map +0 -7
- package/example/vue-demo/node_modules/.vite/deps/clsx.js +0 -22
- package/example/vue-demo/node_modules/.vite/deps/clsx.js.map +0 -7
- package/example/vue-demo/node_modules/.vite/deps/lucide-vue-next.js +0 -29720
- package/example/vue-demo/node_modules/.vite/deps/lucide-vue-next.js.map +0 -7
- package/example/vue-demo/node_modules/.vite/deps/package.json +0 -3
- package/example/vue-demo/node_modules/.vite/deps/radix-vue.js +0 -24321
- package/example/vue-demo/node_modules/.vite/deps/radix-vue.js.map +0 -7
- package/example/vue-demo/node_modules/.vite/deps/tailwind-merge.js +0 -2534
- package/example/vue-demo/node_modules/.vite/deps/tailwind-merge.js.map +0 -7
- package/example/vue-demo/node_modules/.vite/deps/vue.js +0 -348
- package/example/vue-demo/node_modules/.vite/deps/vue.js.map +0 -7
- package/example/vue-demo/package.json +0 -20
- package/example/vue-demo/postcss.config.mjs +0 -6
- package/example/vue-demo/src/App.vue +0 -61
- package/example/vue-demo/src/env.d.ts +0 -1
- package/example/vue-demo/src/main.ts +0 -5
- package/example/vue-demo/src/style.css +0 -102
- package/example/vue-demo/tailwind.config.mjs +0 -50
- package/example/vue-demo/tsconfig.json +0 -15
- package/example/vue-demo/vite.config.ts +0 -14
- package/packages/core/dist/chunk-TP3IHKWV.js +0 -69
- package/packages/core/dist/chunk-WEDHXOHH.js +0 -102
- package/packages/core/node_modules/.bin/api-extractor +0 -17
- package/packages/core/node_modules/.bin/esbuild +0 -14
- package/packages/core/node_modules/.bin/jiti +0 -17
- package/packages/core/node_modules/.bin/tsc +0 -17
- package/packages/core/node_modules/.bin/tsserver +0 -17
- package/packages/core/node_modules/.bin/tsup +0 -17
- package/packages/core/node_modules/.bin/tsup-node +0 -17
- package/packages/core/node_modules/.bin/vitest +0 -17
- package/packages/core/node_modules/.vite/vitest/results.json +0 -1
- package/packages/core/package.json +0 -37
- package/packages/core/src/formState.ts +0 -79
- package/packages/core/src/index.ts +0 -3
- package/packages/core/src/types.ts +0 -42
- package/packages/core/src/utils.ts +0 -104
- package/packages/core/test/formState.test.ts +0 -71
- package/packages/core/test/utils.test.ts +0 -178
- package/packages/core/tsconfig.json +0 -15
- package/packages/core/tsup.config.ts +0 -9
- package/packages/react/node_modules/.bin/api-extractor +0 -17
- package/packages/react/node_modules/.bin/browserslist +0 -17
- package/packages/react/node_modules/.bin/esbuild +0 -14
- package/packages/react/node_modules/.bin/jiti +0 -17
- package/packages/react/node_modules/.bin/tsc +0 -17
- package/packages/react/node_modules/.bin/tsserver +0 -17
- package/packages/react/node_modules/.bin/tsup +0 -17
- package/packages/react/node_modules/.bin/tsup-node +0 -17
- package/packages/react/node_modules/.bin/vite +0 -17
- package/packages/react/node_modules/.bin/vitest +0 -17
- package/packages/react/node_modules/.vite/vitest/results.json +0 -1
- package/packages/react/package.json +0 -57
- package/packages/react/postcss.config.mjs +0 -6
- package/packages/react/src/DynamicForm.tsx +0 -69
- package/packages/react/src/FormFieldRenderer.tsx +0 -50
- package/packages/react/src/components/Checkbox.tsx +0 -28
- package/packages/react/src/components/CheckboxRenderer.tsx +0 -37
- package/packages/react/src/components/Input.tsx +0 -24
- package/packages/react/src/components/InputRenderer.tsx +0 -25
- package/packages/react/src/components/Label.tsx +0 -24
- package/packages/react/src/components/RadioGroup.tsx +0 -42
- package/packages/react/src/components/RadioRenderer.tsx +0 -29
- package/packages/react/src/components/Select.tsx +0 -93
- package/packages/react/src/components/SelectRenderer.tsx +0 -27
- package/packages/react/src/components/Textarea.tsx +0 -23
- package/packages/react/src/components/TextareaRenderer.tsx +0 -17
- package/packages/react/src/components/index.ts +0 -55
- package/packages/react/src/components/types.ts +0 -17
- package/packages/react/src/index.tsx +0 -3
- package/packages/react/src/utils.ts +0 -7
- package/packages/react/tailwind.config.mjs +0 -10
- package/packages/react/test/DynamicForm.test.tsx +0 -25
- package/packages/react/test/FormFieldRenderer.test.tsx +0 -127
- package/packages/react/tsconfig.json +0 -15
- package/packages/react/vitest.config.ts +0 -16
- package/packages/vue/node_modules/.bin/rollup +0 -17
- package/packages/vue/node_modules/.bin/tsc +0 -17
- package/packages/vue/node_modules/.bin/tsserver +0 -17
- package/packages/vue/node_modules/.bin/vite +0 -17
- package/packages/vue/node_modules/.bin/vitest +0 -17
- package/packages/vue/node_modules/.bin/vue-tsc +0 -17
- package/packages/vue/node_modules/.vite/vitest/results.json +0 -1
- package/packages/vue/node_modules/.vue-global-types/vue_3.5_0_0_0.d.ts +0 -118
- package/packages/vue/node_modules/.vue-global-types/vue_3.5_false.d.ts +0 -128
- package/packages/vue/package.json +0 -53
- package/packages/vue/postcss.config.mjs +0 -6
- package/packages/vue/src/DynamicForm.vue +0 -63
- package/packages/vue/src/FormFieldRenderer.vue +0 -70
- package/packages/vue/src/components/Checkbox.vue +0 -28
- package/packages/vue/src/components/CheckboxRenderer.vue +0 -35
- package/packages/vue/src/components/Input.vue +0 -21
- package/packages/vue/src/components/InputRenderer.vue +0 -24
- package/packages/vue/src/components/Label.vue +0 -21
- package/packages/vue/src/components/RadioGroup.vue +0 -30
- package/packages/vue/src/components/RadioGroupItem.vue +0 -26
- package/packages/vue/src/components/RadioRenderer.vue +0 -24
- package/packages/vue/src/components/Select.vue +0 -40
- package/packages/vue/src/components/SelectContent.vue +0 -38
- package/packages/vue/src/components/SelectItem.vue +0 -43
- package/packages/vue/src/components/SelectRenderer.vue +0 -30
- package/packages/vue/src/components/SelectTrigger.vue +0 -27
- package/packages/vue/src/components/Textarea.vue +0 -19
- package/packages/vue/src/components/TextareaRenderer.vue +0 -18
- package/packages/vue/src/components/index.ts +0 -24
- package/packages/vue/src/env.d.ts +0 -7
- package/packages/vue/src/fieldComponentMap.ts +0 -34
- package/packages/vue/src/index.ts +0 -4
- package/packages/vue/src/utils.ts +0 -6
- package/packages/vue/tailwind.config.mjs +0 -10
- package/packages/vue/test/DynamicForm.test.ts +0 -19
- package/packages/vue/test/FormFieldRenderer.test.ts +0 -133
- package/packages/vue/tsconfig.json +0 -16
- package/packages/vue/vite.config.ts +0 -29
- package/packages/vue/vitest.config.ts +0 -16
- package/pnpm-workspace.yaml +0 -4
- package/tsconfig.json +0 -21
- package/turbo.json +0 -25
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
-
esac
|
|
7
|
-
|
|
8
|
-
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/node_modules"
|
|
10
|
-
else
|
|
11
|
-
export NODE_PATH="/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
-
fi
|
|
13
|
-
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
|
|
15
|
-
else
|
|
16
|
-
exec node "$basedir/../typescript/bin/tsc" "$@"
|
|
17
|
-
fi
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
-
esac
|
|
7
|
-
|
|
8
|
-
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/node_modules"
|
|
10
|
-
else
|
|
11
|
-
export NODE_PATH="/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
-
fi
|
|
13
|
-
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
|
|
15
|
-
else
|
|
16
|
-
exec node "$basedir/../typescript/bin/tsserver" "$@"
|
|
17
|
-
fi
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
-
esac
|
|
7
|
-
|
|
8
|
-
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/vite@5.4.21_@types+node@20.19.35/node_modules/vite/bin/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/vite@5.4.21_@types+node@20.19.35/node_modules/vite/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/vite@5.4.21_@types+node@20.19.35/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/node_modules"
|
|
10
|
-
else
|
|
11
|
-
export NODE_PATH="/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/vite@5.4.21_@types+node@20.19.35/node_modules/vite/bin/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/vite@5.4.21_@types+node@20.19.35/node_modules/vite/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/vite@5.4.21_@types+node@20.19.35/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
-
fi
|
|
13
|
-
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../vite/bin/vite.js" "$@"
|
|
15
|
-
else
|
|
16
|
-
exec node "$basedir/../vite/bin/vite.js" "$@"
|
|
17
|
-
fi
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
-
esac
|
|
7
|
-
|
|
8
|
-
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/vitest@1.6.1_@types+node@20.19.35_jsdom@22.1.0/node_modules/vitest/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/vitest@1.6.1_@types+node@20.19.35_jsdom@22.1.0/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/node_modules"
|
|
10
|
-
else
|
|
11
|
-
export NODE_PATH="/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/vitest@1.6.1_@types+node@20.19.35_jsdom@22.1.0/node_modules/vitest/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/vitest@1.6.1_@types+node@20.19.35_jsdom@22.1.0/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
-
fi
|
|
13
|
-
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../vitest/vitest.mjs" "$@"
|
|
15
|
-
else
|
|
16
|
-
exec node "$basedir/../vitest/vitest.mjs" "$@"
|
|
17
|
-
fi
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
-
esac
|
|
7
|
-
|
|
8
|
-
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/vue-tsc@2.2.12_typescript@5.9.3/node_modules/vue-tsc/bin/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/vue-tsc@2.2.12_typescript@5.9.3/node_modules/vue-tsc/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/vue-tsc@2.2.12_typescript@5.9.3/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/node_modules"
|
|
10
|
-
else
|
|
11
|
-
export NODE_PATH="/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/vue-tsc@2.2.12_typescript@5.9.3/node_modules/vue-tsc/bin/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/vue-tsc@2.2.12_typescript@5.9.3/node_modules/vue-tsc/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/vue-tsc@2.2.12_typescript@5.9.3/node_modules:/Users/pidan/Work/Learn/dynamic-form/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
-
fi
|
|
13
|
-
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../vue-tsc/bin/vue-tsc.js" "$@"
|
|
15
|
-
else
|
|
16
|
-
exec node "$basedir/../vue-tsc/bin/vue-tsc.js" "$@"
|
|
17
|
-
fi
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":"1.6.1","results":[[":test/DynamicForm.test.ts",{"duration":19,"failed":false}],[":test/FormFieldRenderer.test.ts",{"duration":77,"failed":false}]]}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
export {};
|
|
3
|
-
|
|
4
|
-
; declare global {
|
|
5
|
-
const __VLS_intrinsicElements: __VLS_IntrinsicElements;
|
|
6
|
-
const __VLS_directiveBindingRestFields: { instance: null, oldValue: null, modifiers: any, dir: any };
|
|
7
|
-
const __VLS_unref: typeof import('vue').unref;
|
|
8
|
-
const __VLS_placeholder: any;
|
|
9
|
-
|
|
10
|
-
type __VLS_NativeElements = __VLS_SpreadMerge<SVGElementTagNameMap, HTMLElementTagNameMap>;
|
|
11
|
-
type __VLS_IntrinsicElements = import('vue/jsx-runtime').JSX.IntrinsicElements;
|
|
12
|
-
type __VLS_Element = import('vue/jsx-runtime').JSX.Element;
|
|
13
|
-
type __VLS_GlobalComponents = import('vue').GlobalComponents;
|
|
14
|
-
type __VLS_GlobalDirectives = import('vue').GlobalDirectives;
|
|
15
|
-
type __VLS_IsAny<T> = 0 extends 1 & T ? true : false;
|
|
16
|
-
type __VLS_PickNotAny<A, B> = __VLS_IsAny<A> extends true ? B : A;
|
|
17
|
-
type __VLS_SpreadMerge<A, B> = Omit<A, keyof B> & B;
|
|
18
|
-
type __VLS_WithComponent<N0 extends string, LocalComponents, Self, N1 extends string, N2 extends string, N3 extends string> =
|
|
19
|
-
N1 extends keyof LocalComponents ? N1 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : { [K in N0]: LocalComponents[N1] } :
|
|
20
|
-
N2 extends keyof LocalComponents ? N2 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : { [K in N0]: LocalComponents[N2] } :
|
|
21
|
-
N3 extends keyof LocalComponents ? N3 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : { [K in N0]: LocalComponents[N3] } :
|
|
22
|
-
Self extends object ? { [K in N0]: Self } :
|
|
23
|
-
N1 extends keyof __VLS_GlobalComponents ? N1 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : { [K in N0]: __VLS_GlobalComponents[N1] } :
|
|
24
|
-
N2 extends keyof __VLS_GlobalComponents ? N2 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : { [K in N0]: __VLS_GlobalComponents[N2] } :
|
|
25
|
-
N3 extends keyof __VLS_GlobalComponents ? N3 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : { [K in N0]: __VLS_GlobalComponents[N3] } :
|
|
26
|
-
{ [K in N0]: unknown };
|
|
27
|
-
type __VLS_FunctionalComponentProps<T, K> =
|
|
28
|
-
'__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends { __ctx?: { props?: infer P } } ? NonNullable<P> : never
|
|
29
|
-
: T extends (props: infer P, ...args: any) => any ? P :
|
|
30
|
-
{};
|
|
31
|
-
type __VLS_IsFunction<T, K> = K extends keyof T
|
|
32
|
-
? __VLS_IsAny<T[K]> extends false
|
|
33
|
-
? unknown extends T[K]
|
|
34
|
-
? false
|
|
35
|
-
: true
|
|
36
|
-
: false
|
|
37
|
-
: false;
|
|
38
|
-
type __VLS_NormalizeComponentEvent<Props, Events, onEvent extends keyof Props, Event extends keyof Events, CamelizedEvent extends keyof Events> = (
|
|
39
|
-
__VLS_IsFunction<Props, onEvent> extends true
|
|
40
|
-
? Props
|
|
41
|
-
: __VLS_IsFunction<Events, Event> extends true
|
|
42
|
-
? { [K in onEvent]?: Events[Event] }
|
|
43
|
-
: __VLS_IsFunction<Events, CamelizedEvent> extends true
|
|
44
|
-
? { [K in onEvent]?: Events[CamelizedEvent] }
|
|
45
|
-
: Props
|
|
46
|
-
) & Record<string, unknown>;
|
|
47
|
-
// fix https://github.com/vuejs/language-tools/issues/926
|
|
48
|
-
type __VLS_UnionToIntersection<U> = (U extends unknown ? (arg: U) => unknown : never) extends ((arg: infer P) => unknown) ? P : never;
|
|
49
|
-
type __VLS_OverloadUnionInner<T, U = unknown> = U & T extends (...args: infer A) => infer R
|
|
50
|
-
? U extends T
|
|
51
|
-
? never
|
|
52
|
-
: __VLS_OverloadUnionInner<T, Pick<T, keyof T> & U & ((...args: A) => R)> | ((...args: A) => R)
|
|
53
|
-
: never;
|
|
54
|
-
type __VLS_OverloadUnion<T> = Exclude<
|
|
55
|
-
__VLS_OverloadUnionInner<(() => never) & T>,
|
|
56
|
-
T extends () => never ? never : () => never
|
|
57
|
-
>;
|
|
58
|
-
type __VLS_ConstructorOverloads<T> = __VLS_OverloadUnion<T> extends infer F
|
|
59
|
-
? F extends (event: infer E, ...args: infer A) => any
|
|
60
|
-
? { [K in E & string]: (...args: A) => void; }
|
|
61
|
-
: never
|
|
62
|
-
: never;
|
|
63
|
-
type __VLS_NormalizeEmits<T> = __VLS_PrettifyGlobal<
|
|
64
|
-
__VLS_UnionToIntersection<
|
|
65
|
-
__VLS_ConstructorOverloads<T> & {
|
|
66
|
-
[K in keyof T]: T[K] extends any[] ? { (...args: T[K]): void } : never
|
|
67
|
-
}
|
|
68
|
-
>
|
|
69
|
-
>;
|
|
70
|
-
type __VLS_PrettifyGlobal<T> = { [K in keyof T]: T[K]; } & {};
|
|
71
|
-
type __VLS_PickFunctionalComponentCtx<T, K> = NonNullable<__VLS_PickNotAny<
|
|
72
|
-
'__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends { __ctx?: infer Ctx } ? Ctx : never : any
|
|
73
|
-
, T extends (props: any, ctx: infer Ctx) => any ? Ctx : any
|
|
74
|
-
>>;
|
|
75
|
-
type __VLS_UseTemplateRef<T> = Readonly<import('vue').ShallowRef<T | null>>;
|
|
76
|
-
|
|
77
|
-
function __VLS_getVForSourceType<T extends number | string | any[] | Iterable<any>>(source: T): [
|
|
78
|
-
item: T extends number ? number
|
|
79
|
-
: T extends string ? string
|
|
80
|
-
: T extends any[] ? T[number]
|
|
81
|
-
: T extends Iterable<infer T1> ? T1
|
|
82
|
-
: any,
|
|
83
|
-
index: number,
|
|
84
|
-
][];
|
|
85
|
-
function __VLS_getVForSourceType<T>(source: T): [
|
|
86
|
-
item: T[keyof T],
|
|
87
|
-
key: keyof T,
|
|
88
|
-
index: number,
|
|
89
|
-
][];
|
|
90
|
-
// @ts-ignore
|
|
91
|
-
function __VLS_getSlotParams<T>(slot: T): Parameters<__VLS_PickNotAny<NonNullable<T>, (...args: any[]) => any>>;
|
|
92
|
-
// @ts-ignore
|
|
93
|
-
function __VLS_getSlotParam<T>(slot: T): Parameters<__VLS_PickNotAny<NonNullable<T>, (...args: any[]) => any>>[0];
|
|
94
|
-
function __VLS_asFunctionalDirective<T>(dir: T): T extends import('vue').ObjectDirective
|
|
95
|
-
? NonNullable<T['created' | 'beforeMount' | 'mounted' | 'beforeUpdate' | 'updated' | 'beforeUnmount' | 'unmounted']>
|
|
96
|
-
: T extends (...args: any) => any
|
|
97
|
-
? T
|
|
98
|
-
: (arg1: unknown, arg2: unknown, arg3: unknown, arg4: unknown) => void;
|
|
99
|
-
function __VLS_makeOptional<T>(t: T): { [K in keyof T]?: T[K] };
|
|
100
|
-
function __VLS_asFunctionalComponent<T, K = T extends new (...args: any) => any ? InstanceType<T> : unknown>(t: T, instance?: K):
|
|
101
|
-
T extends new (...args: any) => any
|
|
102
|
-
? (props: (K extends { $props: infer Props } ? Props : any) & Record<string, unknown>, ctx?: any) => __VLS_Element & {
|
|
103
|
-
__ctx?: {
|
|
104
|
-
attrs?: any;
|
|
105
|
-
slots?: K extends { $slots: infer Slots } ? Slots : any;
|
|
106
|
-
emit?: K extends { $emit: infer Emit } ? Emit : any;
|
|
107
|
-
expose?(exposed: K): void;
|
|
108
|
-
props?: (K extends { $props: infer Props } ? Props : any) & Record<string, unknown>;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
: T extends () => any ? (props: {}, ctx?: any) => ReturnType<T>
|
|
112
|
-
: T extends (...args: any) => any ? T
|
|
113
|
-
: (_: {} & Record<string, unknown>, ctx?: any) => { __ctx?: { attrs?: any, expose?: any, slots?: any, emit?: any, props?: {} & Record<string, unknown> } };
|
|
114
|
-
function __VLS_functionalComponentArgsRest<T extends (...args: any) => any>(t: T): 2 extends Parameters<T>['length'] ? [any] : [];
|
|
115
|
-
function __VLS_asFunctionalElement<T>(tag: T, endTag?: T): (attrs: T & Record<string, unknown>) => void;
|
|
116
|
-
function __VLS_asFunctionalSlot<S>(slot: S): S extends () => infer R ? (props: {}) => R : NonNullable<S>;
|
|
117
|
-
function __VLS_tryAsConstant<const T>(t: T): T;
|
|
118
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
export {};
|
|
3
|
-
|
|
4
|
-
; declare global {
|
|
5
|
-
const __VLS_intrinsicElements: __VLS_IntrinsicElements;
|
|
6
|
-
const __VLS_directiveBindingRestFields: { instance: null, oldValue: null, modifiers: any, dir: any };
|
|
7
|
-
const __VLS_unref: typeof import('vue').unref;
|
|
8
|
-
const __VLS_placeholder: any;
|
|
9
|
-
|
|
10
|
-
const __VLS_nativeElements = {
|
|
11
|
-
...{} as SVGElementTagNameMap,
|
|
12
|
-
...{} as HTMLElementTagNameMap,
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
type __VLS_IntrinsicElements = import('vue/jsx-runtime').JSX.IntrinsicElements;
|
|
16
|
-
type __VLS_Element = import('vue/jsx-runtime').JSX.Element;
|
|
17
|
-
type __VLS_GlobalComponents = import('vue').GlobalComponents;
|
|
18
|
-
type __VLS_GlobalDirectives = import('vue').GlobalDirectives;
|
|
19
|
-
type __VLS_IsAny<T> = 0 extends 1 & T ? true : false;
|
|
20
|
-
type __VLS_PickNotAny<A, B> = __VLS_IsAny<A> extends true ? B : A;
|
|
21
|
-
type __VLS_unknownDirective = (arg1: unknown, arg2: unknown, arg3: unknown, arg4: unknown) => void;
|
|
22
|
-
type __VLS_WithComponent<N0 extends string, LocalComponents, N1 extends string, N2 extends string, N3 extends string> =
|
|
23
|
-
N1 extends keyof LocalComponents ? N1 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : { [K in N0]: LocalComponents[N1] } :
|
|
24
|
-
N2 extends keyof LocalComponents ? N2 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : { [K in N0]: LocalComponents[N2] } :
|
|
25
|
-
N3 extends keyof LocalComponents ? N3 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : { [K in N0]: LocalComponents[N3] } :
|
|
26
|
-
N1 extends keyof __VLS_GlobalComponents ? N1 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : { [K in N0]: __VLS_GlobalComponents[N1] } :
|
|
27
|
-
N2 extends keyof __VLS_GlobalComponents ? N2 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : { [K in N0]: __VLS_GlobalComponents[N2] } :
|
|
28
|
-
N3 extends keyof __VLS_GlobalComponents ? N3 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : { [K in N0]: __VLS_GlobalComponents[N3] } :
|
|
29
|
-
{ [K in N0]: unknown };
|
|
30
|
-
type __VLS_FunctionalComponentProps<T, K> =
|
|
31
|
-
'__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends { __ctx?: { props?: infer P } } ? NonNullable<P> : never
|
|
32
|
-
: T extends (props: infer P, ...args: any) => any ? P :
|
|
33
|
-
{};
|
|
34
|
-
type __VLS_IsFunction<T, K> = K extends keyof T
|
|
35
|
-
? __VLS_IsAny<T[K]> extends false
|
|
36
|
-
? unknown extends T[K]
|
|
37
|
-
? false
|
|
38
|
-
: true
|
|
39
|
-
: false
|
|
40
|
-
: false;
|
|
41
|
-
type __VLS_NormalizeComponentEvent<Props, Events, onEvent extends keyof Props, Event extends keyof Events, CamelizedEvent extends keyof Events> = (
|
|
42
|
-
__VLS_IsFunction<Props, onEvent> extends true
|
|
43
|
-
? Props
|
|
44
|
-
: __VLS_IsFunction<Events, Event> extends true
|
|
45
|
-
? { [K in onEvent]?: Events[Event] }
|
|
46
|
-
: __VLS_IsFunction<Events, CamelizedEvent> extends true
|
|
47
|
-
? { [K in onEvent]?: Events[CamelizedEvent] }
|
|
48
|
-
: Props
|
|
49
|
-
) & Record<string, unknown>;
|
|
50
|
-
// fix https://github.com/vuejs/language-tools/issues/926
|
|
51
|
-
type __VLS_UnionToIntersection<U> = (U extends unknown ? (arg: U) => unknown : never) extends ((arg: infer P) => unknown) ? P : never;
|
|
52
|
-
type __VLS_OverloadUnionInner<T, U = unknown> = U & T extends (...args: infer A) => infer R
|
|
53
|
-
? U extends T
|
|
54
|
-
? never
|
|
55
|
-
: __VLS_OverloadUnionInner<T, Pick<T, keyof T> & U & ((...args: A) => R)> | ((...args: A) => R)
|
|
56
|
-
: never;
|
|
57
|
-
type __VLS_OverloadUnion<T> = Exclude<
|
|
58
|
-
__VLS_OverloadUnionInner<(() => never) & T>,
|
|
59
|
-
T extends () => never ? never : () => never
|
|
60
|
-
>;
|
|
61
|
-
type __VLS_ConstructorOverloads<T> = __VLS_OverloadUnion<T> extends infer F
|
|
62
|
-
? F extends (event: infer E, ...args: infer A) => any
|
|
63
|
-
? { [K in E & string]: (...args: A) => void; }
|
|
64
|
-
: never
|
|
65
|
-
: never;
|
|
66
|
-
type __VLS_NormalizeEmits<T> = __VLS_PrettifyGlobal<
|
|
67
|
-
__VLS_UnionToIntersection<
|
|
68
|
-
__VLS_ConstructorOverloads<T> & {
|
|
69
|
-
[K in keyof T]: T[K] extends any[] ? { (...args: T[K]): void } : never
|
|
70
|
-
}
|
|
71
|
-
>
|
|
72
|
-
>;
|
|
73
|
-
type __VLS_PrettifyGlobal<T> = { [K in keyof T]: T[K]; } & {};
|
|
74
|
-
type __VLS_PickFunctionalComponentCtx<T, K> = NonNullable<__VLS_PickNotAny<
|
|
75
|
-
'__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends { __ctx?: infer Ctx } ? Ctx : never : any
|
|
76
|
-
, T extends (props: any, ctx: infer Ctx) => any ? Ctx : any
|
|
77
|
-
>>;
|
|
78
|
-
type __VLS_UseTemplateRef<T> = Readonly<import('vue').ShallowRef<T | null>>;
|
|
79
|
-
|
|
80
|
-
function __VLS_getVForSourceType(source: number): [number, number, number][];
|
|
81
|
-
function __VLS_getVForSourceType(source: string): [string, number, number][];
|
|
82
|
-
function __VLS_getVForSourceType<T extends any[]>(source: T): [
|
|
83
|
-
item: T[number],
|
|
84
|
-
key: number,
|
|
85
|
-
index: number,
|
|
86
|
-
][];
|
|
87
|
-
function __VLS_getVForSourceType<T extends { [Symbol.iterator](): Iterator<any> }>(source: T): [
|
|
88
|
-
item: T extends { [Symbol.iterator](): Iterator<infer T1> } ? T1 : never,
|
|
89
|
-
key: number,
|
|
90
|
-
index: undefined,
|
|
91
|
-
][];
|
|
92
|
-
// #3845
|
|
93
|
-
function __VLS_getVForSourceType<T extends number | { [Symbol.iterator](): Iterator<any> }>(source: T): [
|
|
94
|
-
item: number | (Exclude<T, number> extends { [Symbol.iterator](): Iterator<infer T1> } ? T1 : never),
|
|
95
|
-
key: number,
|
|
96
|
-
index: undefined,
|
|
97
|
-
][];
|
|
98
|
-
function __VLS_getVForSourceType<T>(source: T): [
|
|
99
|
-
item: T[keyof T],
|
|
100
|
-
key: keyof T,
|
|
101
|
-
index: number,
|
|
102
|
-
][];
|
|
103
|
-
// @ts-ignore
|
|
104
|
-
function __VLS_getSlotParams<T>(slot: T): Parameters<__VLS_PickNotAny<NonNullable<T>, (...args: any[]) => any>>;
|
|
105
|
-
// @ts-ignore
|
|
106
|
-
function __VLS_getSlotParam<T>(slot: T): Parameters<__VLS_PickNotAny<NonNullable<T>, (...args: any[]) => any>>[0];
|
|
107
|
-
function __VLS_asFunctionalDirective<T>(dir: T): T extends import('vue').ObjectDirective
|
|
108
|
-
? NonNullable<T['created' | 'beforeMount' | 'mounted' | 'beforeUpdate' | 'updated' | 'beforeUnmount' | 'unmounted']>
|
|
109
|
-
: T extends (...args: any) => any
|
|
110
|
-
? T
|
|
111
|
-
: __VLS_unknownDirective;
|
|
112
|
-
function __VLS_withScope<T, K>(ctx: T, scope: K): ctx is T & K;
|
|
113
|
-
function __VLS_makeOptional<T>(t: T): { [K in keyof T]?: T[K] };
|
|
114
|
-
function __VLS_asFunctionalComponent<T, K = T extends new (...args: any) => any ? InstanceType<T> : unknown>(t: T, instance?: K):
|
|
115
|
-
T extends new (...args: any) => any
|
|
116
|
-
? (props: (K extends { $props: infer Props } ? Props : any) & Record<string, unknown>, ctx?: any) => __VLS_Element & { __ctx?: {
|
|
117
|
-
attrs?: any,
|
|
118
|
-
slots?: K extends { $slots: infer Slots } ? Slots : any,
|
|
119
|
-
emit?: K extends { $emit: infer Emit } ? Emit : any
|
|
120
|
-
} & { props?: (K extends { $props: infer Props } ? Props : any) & Record<string, unknown>; expose?(exposed: K): void; } }
|
|
121
|
-
: T extends () => any ? (props: {}, ctx?: any) => ReturnType<T>
|
|
122
|
-
: T extends (...args: any) => any ? T
|
|
123
|
-
: (_: {} & Record<string, unknown>, ctx?: any) => { __ctx?: { attrs?: any, expose?: any, slots?: any, emit?: any, props?: {} & Record<string, unknown> } };
|
|
124
|
-
function __VLS_elementAsFunction<T>(tag: T, endTag?: T): (_: T & Record<string, unknown>) => void;
|
|
125
|
-
function __VLS_functionalComponentArgsRest<T extends (...args: any) => any>(t: T): 2 extends Parameters<T>['length'] ? [any] : [];
|
|
126
|
-
function __VLS_normalizeSlot<S>(s: S): S extends () => infer R ? (props: {}) => R : S;
|
|
127
|
-
function __VLS_tryAsConstant<const T>(t: T): T;
|
|
128
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "pdyform-vue",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "Vue components for pdyform based on Shadcn-vue.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"dynamic-form",
|
|
7
|
-
"schema-form",
|
|
8
|
-
"vue",
|
|
9
|
-
"shadcn-vue"
|
|
10
|
-
],
|
|
11
|
-
"type": "module",
|
|
12
|
-
"main": "./dist/index.js",
|
|
13
|
-
"module": "./dist/index.mjs",
|
|
14
|
-
"types": "./dist/index.d.ts",
|
|
15
|
-
"files": [
|
|
16
|
-
"dist"
|
|
17
|
-
],
|
|
18
|
-
"homepage": "https://github.com/LaoChen1994/pdyform",
|
|
19
|
-
"repository": {
|
|
20
|
-
"type": "git",
|
|
21
|
-
"url": "https://github.com/LaoChen1994/pdyform"
|
|
22
|
-
},
|
|
23
|
-
"scripts": {
|
|
24
|
-
"build": "vite build && vue-tsc -p tsconfig.json --declaration --emitDeclarationOnly --outDir dist",
|
|
25
|
-
"dev": "vite",
|
|
26
|
-
"test": "vitest run",
|
|
27
|
-
"lint": "eslint src/**/*.{ts,vue} --no-error-on-unmatched-pattern"
|
|
28
|
-
},
|
|
29
|
-
"dependencies": {
|
|
30
|
-
"class-variance-authority": "^0.7.1",
|
|
31
|
-
"clsx": "^2.1.1",
|
|
32
|
-
"lucide-vue-next": "^0.300.0",
|
|
33
|
-
"pdyform": "workspace:*",
|
|
34
|
-
"radix-vue": "^1.9.17",
|
|
35
|
-
"tailwind-merge": "^2.6.1"
|
|
36
|
-
},
|
|
37
|
-
"peerDependencies": {
|
|
38
|
-
"vue": "^3.5.0"
|
|
39
|
-
},
|
|
40
|
-
"devDependencies": {
|
|
41
|
-
"@types/node": "^20.0.0",
|
|
42
|
-
"@vitejs/plugin-vue": "^5.0.0",
|
|
43
|
-
"@vue/test-utils": "^2.4.6",
|
|
44
|
-
"@vue/tsconfig": "^0.5.0",
|
|
45
|
-
"jsdom": "^22.1.0",
|
|
46
|
-
"typescript": "^5.0.0",
|
|
47
|
-
"vite": "^5.0.0",
|
|
48
|
-
"vite-plugin-dts": "^4.5.4",
|
|
49
|
-
"vitest": "^1.0.0",
|
|
50
|
-
"vue": "^3.5.0",
|
|
51
|
-
"vue-tsc": "^2.0.0"
|
|
52
|
-
}
|
|
53
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { ref } from 'vue';
|
|
3
|
-
import type { FormSchema, FormRuntimeState } from 'pdyform/core';
|
|
4
|
-
import {
|
|
5
|
-
createFormRuntimeState,
|
|
6
|
-
applyFieldChange,
|
|
7
|
-
runSubmitValidation,
|
|
8
|
-
setSubmitting,
|
|
9
|
-
} from 'pdyform/core';
|
|
10
|
-
import FormFieldRenderer from './FormFieldRenderer.vue';
|
|
11
|
-
|
|
12
|
-
const props = defineProps<{
|
|
13
|
-
schema: FormSchema;
|
|
14
|
-
className?: string;
|
|
15
|
-
}>();
|
|
16
|
-
|
|
17
|
-
const emit = defineEmits(['submit']);
|
|
18
|
-
|
|
19
|
-
const formState = ref<FormRuntimeState>(createFormRuntimeState(props.schema.fields));
|
|
20
|
-
|
|
21
|
-
const handleFieldChange = (name: string, value: any) => {
|
|
22
|
-
formState.value = applyFieldChange(props.schema.fields, formState.value, name, value);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const handleSubmit = () => {
|
|
26
|
-
const submittingState = setSubmitting(formState.value, true);
|
|
27
|
-
const { state: validatedState, hasError } = runSubmitValidation(props.schema.fields, submittingState);
|
|
28
|
-
formState.value = validatedState;
|
|
29
|
-
|
|
30
|
-
if (!hasError) {
|
|
31
|
-
emit('submit', { ...validatedState.values });
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
</script>
|
|
35
|
-
|
|
36
|
-
<template>
|
|
37
|
-
<form :class="['space-y-6', className]" @submit.prevent="handleSubmit">
|
|
38
|
-
<div v-if="schema.title || schema.description" class="space-y-1">
|
|
39
|
-
<h2 v-if="schema.title" class="text-2xl font-bold tracking-tight">{{ schema.title }}</h2>
|
|
40
|
-
<p v-if="schema.description" class="text-muted-foreground">{{ schema.description }}</p>
|
|
41
|
-
</div>
|
|
42
|
-
|
|
43
|
-
<div class="space-y-4">
|
|
44
|
-
<template v-for="field in schema.fields" :key="field.id">
|
|
45
|
-
<FormFieldRenderer
|
|
46
|
-
v-if="!field.hidden"
|
|
47
|
-
:field="field"
|
|
48
|
-
:model-value="formState.values[field.name]"
|
|
49
|
-
:error="formState.errors[field.name]"
|
|
50
|
-
@update:model-value="(val: any) => handleFieldChange(field.name, val)"
|
|
51
|
-
/>
|
|
52
|
-
</template>
|
|
53
|
-
</div>
|
|
54
|
-
|
|
55
|
-
<button
|
|
56
|
-
type="submit"
|
|
57
|
-
:disabled="formState.isSubmitting"
|
|
58
|
-
class="inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-primary text-primary-foreground hover:bg-primary/90 h-10 px-4 py-2 w-full"
|
|
59
|
-
>
|
|
60
|
-
{{ formState.isSubmitting ? 'Submitting...' : (schema.submitButtonText || 'Submit') }}
|
|
61
|
-
</button>
|
|
62
|
-
</form>
|
|
63
|
-
</template>
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { FormField } from 'pdyform/core';
|
|
3
|
-
import type { Component } from 'vue';
|
|
4
|
-
import { computed } from 'vue';
|
|
5
|
-
import { defaultComponentMap, type FieldComponentMap } from './fieldComponentMap';
|
|
6
|
-
import Label from './components/Label.vue';
|
|
7
|
-
import InputRenderer from './components/InputRenderer.vue';
|
|
8
|
-
|
|
9
|
-
const props = defineProps<{
|
|
10
|
-
field: FormField;
|
|
11
|
-
modelValue: any;
|
|
12
|
-
error?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Custom component map.
|
|
15
|
-
* Entries here are merged with the default map, so you can override
|
|
16
|
-
* specific types or add entirely new ones.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```ts
|
|
20
|
-
* import { defaultComponentMap } from 'pdyform-vue';
|
|
21
|
-
* const myMap = {
|
|
22
|
-
* ...defaultComponentMap,
|
|
23
|
-
* text: MyCustomInput, // overrides built-in text input
|
|
24
|
-
* rating: StarRatingField, // adds a new field type
|
|
25
|
-
* };
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
componentMap?: FieldComponentMap;
|
|
29
|
-
}>();
|
|
30
|
-
|
|
31
|
-
const emit = defineEmits(['update:modelValue']);
|
|
32
|
-
|
|
33
|
-
const fieldId = computed(() => `field-${props.field.name}`);
|
|
34
|
-
|
|
35
|
-
// Merge external map over defaults — external wins
|
|
36
|
-
const resolvedMap = computed<FieldComponentMap>(() =>
|
|
37
|
-
props.componentMap
|
|
38
|
-
? { ...defaultComponentMap, ...props.componentMap }
|
|
39
|
-
: defaultComponentMap
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
// Resolve a component or fall back to InputRenderer
|
|
43
|
-
const ResolvedFieldComponent = computed<Component>(
|
|
44
|
-
() => resolvedMap.value[props.field.type] ?? InputRenderer
|
|
45
|
-
);
|
|
46
|
-
</script>
|
|
47
|
-
|
|
48
|
-
<template>
|
|
49
|
-
<div :class="['space-y-2', field.className]">
|
|
50
|
-
<Label v-if="field.label" :for="fieldId">
|
|
51
|
-
{{ field.label }}
|
|
52
|
-
</Label>
|
|
53
|
-
|
|
54
|
-
<!-- All field rendering is delegated to the resolved component -->
|
|
55
|
-
<component
|
|
56
|
-
:is="ResolvedFieldComponent"
|
|
57
|
-
:field="field"
|
|
58
|
-
:fieldId="fieldId"
|
|
59
|
-
:modelValue="modelValue"
|
|
60
|
-
@update:modelValue="emit('update:modelValue', $event)"
|
|
61
|
-
/>
|
|
62
|
-
|
|
63
|
-
<p v-if="field.description" class="text-[0.8rem] text-muted-foreground">
|
|
64
|
-
{{ field.description }}
|
|
65
|
-
</p>
|
|
66
|
-
<p v-if="error" class="text-[0.8rem] font-medium text-destructive">
|
|
67
|
-
{{ error }}
|
|
68
|
-
</p>
|
|
69
|
-
</div>
|
|
70
|
-
</template>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
3
|
-
import { CheckboxIndicator, CheckboxRoot, type CheckboxRootEmits, type CheckboxRootProps, useForwardPropsEmits } from 'radix-vue'
|
|
4
|
-
import { Check } from 'lucide-vue-next'
|
|
5
|
-
import { cn } from '../utils'
|
|
6
|
-
|
|
7
|
-
const props = defineProps<CheckboxRootProps & { class?: any }>()
|
|
8
|
-
const emits = defineEmits<CheckboxRootEmits & { blur: [] }>()
|
|
9
|
-
|
|
10
|
-
const delegatedProps = computed(() => {
|
|
11
|
-
const { class: _, ...delegated } = props
|
|
12
|
-
return delegated
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
<template>
|
|
19
|
-
<CheckboxRoot
|
|
20
|
-
v-bind="forwarded"
|
|
21
|
-
:class="cn('peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground', props.class)"
|
|
22
|
-
@blur="emits('blur')"
|
|
23
|
-
>
|
|
24
|
-
<CheckboxIndicator class="flex h-full w-full items-center justify-center text-current">
|
|
25
|
-
<Check class="h-4 w-4" />
|
|
26
|
-
</CheckboxIndicator>
|
|
27
|
-
</CheckboxRoot>
|
|
28
|
-
</template>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { FieldRendererProps } from '../fieldComponentMap';
|
|
3
|
-
import Checkbox from '../components/Checkbox.vue';
|
|
4
|
-
import Label from '../components/Label.vue';
|
|
5
|
-
|
|
6
|
-
const props = defineProps<FieldRendererProps>();
|
|
7
|
-
const emit = defineEmits<{ 'update:modelValue': [value: any] }>();
|
|
8
|
-
|
|
9
|
-
const handleChange = (optValue: any, checked: boolean) => {
|
|
10
|
-
const current = Array.isArray(props.modelValue) ? [...props.modelValue] : [];
|
|
11
|
-
if (checked) {
|
|
12
|
-
current.push(optValue);
|
|
13
|
-
} else {
|
|
14
|
-
const idx = current.indexOf(optValue);
|
|
15
|
-
if (idx > -1) current.splice(idx, 1);
|
|
16
|
-
}
|
|
17
|
-
emit('update:modelValue', current);
|
|
18
|
-
};
|
|
19
|
-
</script>
|
|
20
|
-
|
|
21
|
-
<template>
|
|
22
|
-
<div class="flex flex-wrap gap-4">
|
|
23
|
-
<div v-for="opt in field.options" :key="opt.value" class="flex items-center space-x-2">
|
|
24
|
-
<Checkbox
|
|
25
|
-
:id="`checkbox-${field.name}-${opt.value}`"
|
|
26
|
-
:disabled="field.disabled"
|
|
27
|
-
:checked="Array.isArray(modelValue) && modelValue.includes(opt.value)"
|
|
28
|
-
@update:checked="(checked) => handleChange(opt.value, !!checked)"
|
|
29
|
-
/>
|
|
30
|
-
<Label :for="`checkbox-${field.name}-${opt.value}`" class="font-normal">
|
|
31
|
-
{{ opt.label }}
|
|
32
|
-
</Label>
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
</template>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { cn } from '../utils'
|
|
3
|
-
|
|
4
|
-
const props = defineProps<{
|
|
5
|
-
class?: any
|
|
6
|
-
type?: string
|
|
7
|
-
modelValue?: any
|
|
8
|
-
}>()
|
|
9
|
-
|
|
10
|
-
const emit = defineEmits(['update:modelValue', 'blur'])
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<template>
|
|
14
|
-
<input
|
|
15
|
-
:type="type"
|
|
16
|
-
:class="cn('flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50', props.class)"
|
|
17
|
-
:value="modelValue"
|
|
18
|
-
@input="emit('update:modelValue', ($event.target as HTMLInputElement).value)"
|
|
19
|
-
@blur="emit('blur', $event)"
|
|
20
|
-
/>
|
|
21
|
-
</template>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { normalizeFieldValue } from 'pdyform/core';
|
|
3
|
-
import type { FieldRendererProps } from '../fieldComponentMap';
|
|
4
|
-
import Input from '../components/Input.vue';
|
|
5
|
-
|
|
6
|
-
const props = defineProps<FieldRendererProps>();
|
|
7
|
-
const emit = defineEmits<{ 'update:modelValue': [value: any] }>();
|
|
8
|
-
|
|
9
|
-
const handleInput = (nextValue: any) => {
|
|
10
|
-
emit('update:modelValue', normalizeFieldValue(props.field, nextValue));
|
|
11
|
-
};
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<template>
|
|
15
|
-
<Input
|
|
16
|
-
:id="fieldId"
|
|
17
|
-
:type="field.type"
|
|
18
|
-
:placeholder="field.placeholder"
|
|
19
|
-
:disabled="field.disabled"
|
|
20
|
-
:name="field.name"
|
|
21
|
-
:modelValue="modelValue ?? ''"
|
|
22
|
-
@update:modelValue="handleInput"
|
|
23
|
-
/>
|
|
24
|
-
</template>
|