@schemx/vue 0.2.3 → 1.0.0-next.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 +290 -229
- package/dist/analyze.html +1 -1
- package/dist/components/FormGroup/index.d.ts +3 -4
- package/dist/components/FormGroup/index.d.ts.map +1 -1
- package/dist/components/FormItem/index.d.ts +3 -4
- package/dist/components/FormItem/index.d.ts.map +1 -1
- package/dist/config/appConfig.d.ts +19 -0
- package/dist/config/appConfig.d.ts.map +1 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/form.d.ts +11 -8
- package/dist/form.d.ts.map +1 -1
- package/dist/hocs/withRemoteOptions.d.ts +3 -29
- package/dist/hocs/withRemoteOptions.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/provideFieldContext.d.ts +1 -2
- package/dist/hooks/provideFormConfigContext.d.ts +24 -19
- package/dist/hooks/provideFormConfigContext.d.ts.map +1 -1
- package/dist/hooks/provideFormContext.d.ts +0 -1
- package/dist/hooks/useDictionary.d.ts +13 -8
- package/dist/hooks/useDictionary.d.ts.map +1 -1
- package/dist/hooks/useEffect.d.ts +0 -1
- package/dist/hooks/useField.d.ts +1 -2
- package/dist/hooks/useField.d.ts.map +1 -1
- package/dist/hooks/useForm.d.ts +2 -3
- package/dist/hooks/useForm.d.ts.map +1 -1
- package/dist/hooks/useStableRef.d.ts +2 -3
- package/dist/hooks/useStableRef.d.ts.map +1 -1
- package/dist/hooks/useViewSchemas.d.ts +16 -2
- package/dist/hooks/useViewSchemas.d.ts.map +1 -1
- package/dist/hooks/useWatch.d.ts +64 -13
- package/dist/hooks/useWatch.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +195 -82
- package/dist/index.mjs.map +1 -1
- package/dist/types/dictionary.d.ts +18 -18
- package/dist/types/dictionary.d.ts.map +1 -1
- package/dist/types/field.d.ts +20 -11
- package/dist/types/field.d.ts.map +1 -1
- package/dist/types/form.d.ts +41 -4
- package/dist/types/form.d.ts.map +1 -1
- package/dist/types/index.d.ts +15 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/diff.d.ts +2 -2
- package/dist/utils/diff.d.ts.map +1 -1
- package/dist/utils/dynamic.d.ts +13 -14
- package/dist/utils/dynamic.d.ts.map +1 -1
- package/dist/utils/equal.d.ts.map +1 -1
- package/dist/utils/helpers.d.ts +5 -6
- package/dist/utils/helpers.d.ts.map +1 -1
- package/dist/utils/rendererProvider.d.ts +2 -3
- package/dist/utils/rendererProvider.d.ts.map +1 -1
- package/dist/utils/rulesProvider.d.ts +5 -6
- package/dist/utils/rulesProvider.d.ts.map +1 -1
- package/dist/utils/slot.d.ts.map +1 -1
- package/dist/utils/validation.d.ts +0 -1
- package/package.json +6 -5
package/dist/analyze.html
CHANGED
|
@@ -4929,7 +4929,7 @@ var drawChart = (function (exports) {
|
|
|
4929
4929
|
</script>
|
|
4930
4930
|
<script>
|
|
4931
4931
|
/*<!--*/
|
|
4932
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.cjs","children":[{"name":"src","children":[{"name":"styles/index.css","uid":"abc5935a-1"},{"name":"utils","children":[{"uid":"abc5935a-3","name":"rendererProvider.ts"},{"uid":"abc5935a-5","name":"rulesProvider.ts"},{"uid":"abc5935a-23","name":"equal.ts"},{"uid":"abc5935a-29","name":"validation.ts"},{"uid":"abc5935a-31","name":"slot.ts"},{"uid":"abc5935a-37","name":"helpers.ts"}]},{"name":"hooks","children":[{"uid":"abc5935a-7","name":"useForm.ts"},{"uid":"abc5935a-9","name":"provideFormContext.ts"},{"uid":"abc5935a-11","name":"useField.ts"},{"uid":"abc5935a-13","name":"provideFieldContext.ts"},{"uid":"abc5935a-15","name":"useWatch.ts"},{"uid":"abc5935a-17","name":"useEffect.ts"},{"uid":"abc5935a-19","name":"useDictionary.ts"},{"uid":"abc5935a-21","name":"provideFormConfigContext.ts"},{"uid":"abc5935a-25","name":"useStableRef.ts"},{"uid":"abc5935a-27","name":"useViewSchemas.ts"}]},{"name":"components","children":[{"name":"FormGroup/index.tsx","uid":"abc5935a-33"},{"name":"FormItem/index.tsx","uid":"abc5935a-35"}]},{"uid":"abc5935a-39","name":"form.vue?vue&type=script&setup=true&lang.ts"},{"uid":"abc5935a-41","name":"form.ts"},{"name":"hocs/withRemoteOptions.ts","uid":"abc5935a-43"},{"uid":"abc5935a-45","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"abc5935a-1":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"abc5935a-0"},"abc5935a-3":{"renderedLength":62,"gzipLength":69,"brotliLength":49,"metaUid":"abc5935a-2"},"abc5935a-5":{"renderedLength":58,"gzipLength":65,"brotliLength":49,"metaUid":"abc5935a-4"},"abc5935a-7":{"renderedLength":348,"gzipLength":194,"brotliLength":159,"metaUid":"abc5935a-6"},"abc5935a-9":{"renderedLength":468,"gzipLength":280,"brotliLength":223,"metaUid":"abc5935a-8"},"abc5935a-11":{"renderedLength":1593,"gzipLength":561,"brotliLength":491,"metaUid":"abc5935a-10"},"abc5935a-13":{"renderedLength":410,"gzipLength":249,"brotliLength":198,"metaUid":"abc5935a-12"},"abc5935a-15":{"renderedLength":551,"gzipLength":219,"brotliLength":186,"metaUid":"abc5935a-14"},"abc5935a-17":{"renderedLength":125,"gzipLength":112,"brotliLength":90,"metaUid":"abc5935a-16"},"abc5935a-19":{"renderedLength":2696,"gzipLength":878,"brotliLength":752,"metaUid":"abc5935a-18"},"abc5935a-21":{"renderedLength":686,"gzipLength":371,"brotliLength":314,"metaUid":"abc5935a-20"},"abc5935a-23":{"renderedLength":202,"gzipLength":154,"brotliLength":120,"metaUid":"abc5935a-22"},"abc5935a-25":{"renderedLength":240,"gzipLength":168,"brotliLength":143,"metaUid":"abc5935a-24"},"abc5935a-27":{"renderedLength":261,"gzipLength":162,"brotliLength":143,"metaUid":"abc5935a-26"},"abc5935a-29":{"renderedLength":768,"gzipLength":322,"brotliLength":262,"metaUid":"abc5935a-28"},"abc5935a-31":{"renderedLength":1262,"gzipLength":486,"brotliLength":401,"metaUid":"abc5935a-30"},"abc5935a-33":{"renderedLength":1878,"gzipLength":806,"brotliLength":656,"metaUid":"abc5935a-32"},"abc5935a-35":{"renderedLength":7378,"gzipLength":2416,"brotliLength":1981,"metaUid":"abc5935a-34"},"abc5935a-37":{"renderedLength":976,"gzipLength":385,"brotliLength":326,"metaUid":"abc5935a-36"},"abc5935a-39":{"renderedLength":4079,"gzipLength":1328,"brotliLength":1163,"metaUid":"abc5935a-38"},"abc5935a-41":{"renderedLength":281,"gzipLength":228,"brotliLength":174,"metaUid":"abc5935a-40"},"abc5935a-43":{"renderedLength":923,"gzipLength":408,"brotliLength":349,"metaUid":"abc5935a-42"},"abc5935a-45":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"abc5935a-44"}},"nodeMetas":{"abc5935a-0":{"id":"/src/styles/index.css","moduleParts":{"index.cjs":"abc5935a-1"},"imported":[],"importedBy":[{"uid":"abc5935a-44"},{"uid":"abc5935a-38"}]},"abc5935a-2":{"id":"/src/utils/rendererProvider.ts","moduleParts":{"index.cjs":"abc5935a-3"},"imported":[{"uid":"abc5935a-48"}],"importedBy":[{"uid":"abc5935a-44"},{"uid":"abc5935a-6"}]},"abc5935a-4":{"id":"/src/utils/rulesProvider.ts","moduleParts":{"index.cjs":"abc5935a-5"},"imported":[{"uid":"abc5935a-48"}],"importedBy":[{"uid":"abc5935a-44"},{"uid":"abc5935a-6"}]},"abc5935a-6":{"id":"/src/hooks/useForm.ts","moduleParts":{"index.cjs":"abc5935a-7"},"imported":[{"uid":"abc5935a-51"},{"uid":"abc5935a-48"},{"uid":"abc5935a-2"},{"uid":"abc5935a-4"}],"importedBy":[{"uid":"abc5935a-46"}]},"abc5935a-8":{"id":"/src/hooks/provideFormContext.ts","moduleParts":{"index.cjs":"abc5935a-9"},"imported":[{"uid":"abc5935a-51"}],"importedBy":[{"uid":"abc5935a-46"},{"uid":"abc5935a-10"},{"uid":"abc5935a-14"},{"uid":"abc5935a-18"}]},"abc5935a-10":{"id":"/src/hooks/useField.ts","moduleParts":{"index.cjs":"abc5935a-11"},"imported":[{"uid":"abc5935a-51"},{"uid":"abc5935a-48"},{"uid":"abc5935a-8"}],"importedBy":[{"uid":"abc5935a-46"}]},"abc5935a-12":{"id":"/src/hooks/provideFieldContext.ts","moduleParts":{"index.cjs":"abc5935a-13"},"imported":[{"uid":"abc5935a-51"}],"importedBy":[{"uid":"abc5935a-46"},{"uid":"abc5935a-42"}]},"abc5935a-14":{"id":"/src/hooks/useWatch.ts","moduleParts":{"index.cjs":"abc5935a-15"},"imported":[{"uid":"abc5935a-51"},{"uid":"abc5935a-48"},{"uid":"abc5935a-8"}],"importedBy":[{"uid":"abc5935a-46"},{"uid":"abc5935a-18"}]},"abc5935a-16":{"id":"/src/hooks/useEffect.ts","moduleParts":{"index.cjs":"abc5935a-17"},"imported":[{"uid":"abc5935a-51"},{"uid":"abc5935a-48"}],"importedBy":[{"uid":"abc5935a-46"}]},"abc5935a-18":{"id":"/src/hooks/useDictionary.ts","moduleParts":{"index.cjs":"abc5935a-19"},"imported":[{"uid":"abc5935a-51"},{"uid":"abc5935a-8"},{"uid":"abc5935a-14"}],"importedBy":[{"uid":"abc5935a-46"},{"uid":"abc5935a-42"}]},"abc5935a-20":{"id":"/src/hooks/provideFormConfigContext.ts","moduleParts":{"index.cjs":"abc5935a-21"},"imported":[{"uid":"abc5935a-51"}],"importedBy":[{"uid":"abc5935a-46"}]},"abc5935a-22":{"id":"/src/utils/equal.ts","moduleParts":{"index.cjs":"abc5935a-23"},"imported":[],"importedBy":[{"uid":"abc5935a-24"}]},"abc5935a-24":{"id":"/src/hooks/useStableRef.ts","moduleParts":{"index.cjs":"abc5935a-25"},"imported":[{"uid":"abc5935a-51"},{"uid":"abc5935a-22"}],"importedBy":[{"uid":"abc5935a-46"}]},"abc5935a-26":{"id":"/src/hooks/useViewSchemas.ts","moduleParts":{"index.cjs":"abc5935a-27"},"imported":[{"uid":"abc5935a-51"}],"importedBy":[{"uid":"abc5935a-46"}]},"abc5935a-28":{"id":"/src/utils/validation.ts","moduleParts":{"index.cjs":"abc5935a-29"},"imported":[],"importedBy":[{"uid":"abc5935a-53"}]},"abc5935a-30":{"id":"/src/utils/slot.ts","moduleParts":{"index.cjs":"abc5935a-31"},"imported":[],"importedBy":[{"uid":"abc5935a-53"}]},"abc5935a-32":{"id":"/src/components/FormGroup/index.tsx","moduleParts":{"index.cjs":"abc5935a-33"},"imported":[{"uid":"abc5935a-51"},{"uid":"abc5935a-52"},{"uid":"abc5935a-34"}],"importedBy":[{"uid":"abc5935a-44"},{"uid":"abc5935a-34"}]},"abc5935a-34":{"id":"/src/components/FormItem/index.tsx","moduleParts":{"index.cjs":"abc5935a-35"},"imported":[{"uid":"abc5935a-51"},{"uid":"abc5935a-52"},{"uid":"abc5935a-46"},{"uid":"abc5935a-53"},{"uid":"abc5935a-32"}],"importedBy":[{"uid":"abc5935a-44"},{"uid":"abc5935a-40"},{"uid":"abc5935a-32"},{"uid":"abc5935a-38"}]},"abc5935a-36":{"id":"/src/utils/helpers.ts","moduleParts":{"index.cjs":"abc5935a-37"},"imported":[],"importedBy":[{"uid":"abc5935a-38"}]},"abc5935a-38":{"id":"/src/form.vue?vue&type=script&setup=true&lang.ts","moduleParts":{"index.cjs":"abc5935a-39"},"imported":[{"uid":"abc5935a-51"},{"uid":"abc5935a-60"},{"uid":"abc5935a-48"},{"uid":"abc5935a-34"},{"uid":"abc5935a-46"},{"uid":"abc5935a-36"},{"uid":"abc5935a-0"}],"importedBy":[{"uid":"abc5935a-57"}]},"abc5935a-40":{"id":"/src/form.ts","moduleParts":{"index.cjs":"abc5935a-41"},"imported":[{"uid":"abc5935a-34"},{"uid":"abc5935a-50"}],"importedBy":[{"uid":"abc5935a-44"}]},"abc5935a-42":{"id":"/src/hocs/withRemoteOptions.ts","moduleParts":{"index.cjs":"abc5935a-43"},"imported":[{"uid":"abc5935a-51"},{"uid":"abc5935a-18"},{"uid":"abc5935a-12"}],"importedBy":[{"uid":"abc5935a-47"}]},"abc5935a-44":{"id":"/src/index.ts","moduleParts":{"index.cjs":"abc5935a-45"},"imported":[{"uid":"abc5935a-0"},{"uid":"abc5935a-40"},{"uid":"abc5935a-2"},{"uid":"abc5935a-4"},{"uid":"abc5935a-46"},{"uid":"abc5935a-47"},{"uid":"abc5935a-34"},{"uid":"abc5935a-32"},{"uid":"abc5935a-48"},{"uid":"abc5935a-49"}],"importedBy":[],"isEntry":true},"abc5935a-46":{"id":"/src/hooks/index.ts","moduleParts":{},"imported":[{"uid":"abc5935a-6"},{"uid":"abc5935a-8"},{"uid":"abc5935a-10"},{"uid":"abc5935a-12"},{"uid":"abc5935a-14"},{"uid":"abc5935a-16"},{"uid":"abc5935a-18"},{"uid":"abc5935a-20"},{"uid":"abc5935a-24"},{"uid":"abc5935a-26"}],"importedBy":[{"uid":"abc5935a-44"},{"uid":"abc5935a-34"},{"uid":"abc5935a-38"}]},"abc5935a-47":{"id":"/src/hocs/index.ts","moduleParts":{},"imported":[{"uid":"abc5935a-42"}],"importedBy":[{"uid":"abc5935a-44"}]},"abc5935a-48":{"id":"@schemx/core","moduleParts":{},"imported":[],"importedBy":[{"uid":"abc5935a-44"},{"uid":"abc5935a-2"},{"uid":"abc5935a-4"},{"uid":"abc5935a-6"},{"uid":"abc5935a-10"},{"uid":"abc5935a-14"},{"uid":"abc5935a-16"},{"uid":"abc5935a-38"}],"isExternal":true},"abc5935a-49":{"id":"/src/types/index.ts","moduleParts":{},"imported":[{"uid":"abc5935a-54"},{"uid":"abc5935a-55"},{"uid":"abc5935a-56"}],"importedBy":[{"uid":"abc5935a-44"}]},"abc5935a-50":{"id":"/src/formRuntime.js","moduleParts":{},"imported":[{"uid":"abc5935a-57"}],"importedBy":[{"uid":"abc5935a-40"}]},"abc5935a-51":{"id":"vue","moduleParts":{},"imported":[],"importedBy":[{"uid":"abc5935a-34"},{"uid":"abc5935a-32"},{"uid":"abc5935a-6"},{"uid":"abc5935a-8"},{"uid":"abc5935a-10"},{"uid":"abc5935a-12"},{"uid":"abc5935a-14"},{"uid":"abc5935a-16"},{"uid":"abc5935a-18"},{"uid":"abc5935a-20"},{"uid":"abc5935a-24"},{"uid":"abc5935a-26"},{"uid":"abc5935a-42"},{"uid":"abc5935a-38"}],"isExternal":true},"abc5935a-52":{"id":"classnames","moduleParts":{},"imported":[],"importedBy":[{"uid":"abc5935a-34"},{"uid":"abc5935a-32"}],"isExternal":true},"abc5935a-53":{"id":"/src/utils/index.ts","moduleParts":{},"imported":[{"uid":"abc5935a-58"},{"uid":"abc5935a-28"},{"uid":"abc5935a-30"},{"uid":"abc5935a-59"}],"importedBy":[{"uid":"abc5935a-34"}]},"abc5935a-54":{"id":"/src/types/dictionary.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"abc5935a-49"}]},"abc5935a-55":{"id":"/src/types/form.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"abc5935a-49"}]},"abc5935a-56":{"id":"/src/types/field.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"abc5935a-49"}]},"abc5935a-57":{"id":"/src/form.vue","moduleParts":{},"imported":[{"uid":"abc5935a-38"}],"importedBy":[{"uid":"abc5935a-50"}]},"abc5935a-58":{"id":"/src/utils/dynamic.ts","moduleParts":{},"imported":[{"uid":"abc5935a-60"}],"importedBy":[{"uid":"abc5935a-53"}]},"abc5935a-59":{"id":"/src/utils/diff.ts","moduleParts":{},"imported":[{"uid":"abc5935a-61"}],"importedBy":[{"uid":"abc5935a-53"}]},"abc5935a-60":{"id":"es-toolkit","moduleParts":{},"imported":[],"importedBy":[{"uid":"abc5935a-58"},{"uid":"abc5935a-38"}],"isExternal":true},"abc5935a-61":{"id":"es-toolkit/compat","moduleParts":{},"imported":[],"importedBy":[{"uid":"abc5935a-59"}],"isExternal":true}},"env":{"rollup":"4.62.2"},"options":{"gzip":true,"brotli":true,"sourcemap":false}};
|
|
4932
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.cjs","children":[{"name":"src","children":[{"name":"styles/index.css","uid":"ad488fe2-1"},{"name":"config/appConfig.ts","uid":"ad488fe2-3"},{"name":"utils","children":[{"uid":"ad488fe2-5","name":"rendererProvider.ts"},{"uid":"ad488fe2-7","name":"rulesProvider.ts"},{"uid":"ad488fe2-25","name":"equal.ts"},{"uid":"ad488fe2-31","name":"validation.ts"},{"uid":"ad488fe2-33","name":"slot.ts"},{"uid":"ad488fe2-39","name":"helpers.ts"}]},{"name":"hooks","children":[{"uid":"ad488fe2-9","name":"useForm.ts"},{"uid":"ad488fe2-11","name":"provideFormContext.ts"},{"uid":"ad488fe2-13","name":"useField.ts"},{"uid":"ad488fe2-15","name":"provideFieldContext.ts"},{"uid":"ad488fe2-17","name":"useWatch.ts"},{"uid":"ad488fe2-19","name":"useEffect.ts"},{"uid":"ad488fe2-21","name":"useDictionary.ts"},{"uid":"ad488fe2-23","name":"provideFormConfigContext.ts"},{"uid":"ad488fe2-27","name":"useStableRef.ts"},{"uid":"ad488fe2-29","name":"useViewSchemas.ts"}]},{"name":"components","children":[{"name":"FormGroup/index.tsx","uid":"ad488fe2-35"},{"name":"FormItem/index.tsx","uid":"ad488fe2-37"}]},{"uid":"ad488fe2-41","name":"form.vue?vue&type=script&setup=true&lang.ts"},{"uid":"ad488fe2-43","name":"form.ts"},{"name":"hocs/withRemoteOptions.ts","uid":"ad488fe2-45"},{"uid":"ad488fe2-47","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"ad488fe2-1":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"ad488fe2-0"},"ad488fe2-3":{"renderedLength":957,"gzipLength":384,"brotliLength":326,"metaUid":"ad488fe2-2"},"ad488fe2-5":{"renderedLength":62,"gzipLength":69,"brotliLength":49,"metaUid":"ad488fe2-4"},"ad488fe2-7":{"renderedLength":67,"gzipLength":68,"brotliLength":53,"metaUid":"ad488fe2-6"},"ad488fe2-9":{"renderedLength":828,"gzipLength":327,"brotliLength":291,"metaUid":"ad488fe2-8"},"ad488fe2-11":{"renderedLength":468,"gzipLength":280,"brotliLength":223,"metaUid":"ad488fe2-10"},"ad488fe2-13":{"renderedLength":1600,"gzipLength":561,"brotliLength":498,"metaUid":"ad488fe2-12"},"ad488fe2-15":{"renderedLength":410,"gzipLength":249,"brotliLength":198,"metaUid":"ad488fe2-14"},"ad488fe2-17":{"renderedLength":551,"gzipLength":219,"brotliLength":186,"metaUid":"ad488fe2-16"},"ad488fe2-19":{"renderedLength":125,"gzipLength":112,"brotliLength":90,"metaUid":"ad488fe2-18"},"ad488fe2-21":{"renderedLength":2859,"gzipLength":951,"brotliLength":813,"metaUid":"ad488fe2-20"},"ad488fe2-23":{"renderedLength":483,"gzipLength":288,"brotliLength":239,"metaUid":"ad488fe2-22"},"ad488fe2-25":{"renderedLength":202,"gzipLength":154,"brotliLength":120,"metaUid":"ad488fe2-24"},"ad488fe2-27":{"renderedLength":240,"gzipLength":168,"brotliLength":143,"metaUid":"ad488fe2-26"},"ad488fe2-29":{"renderedLength":269,"gzipLength":168,"brotliLength":140,"metaUid":"ad488fe2-28"},"ad488fe2-31":{"renderedLength":768,"gzipLength":322,"brotliLength":262,"metaUid":"ad488fe2-30"},"ad488fe2-33":{"renderedLength":1262,"gzipLength":486,"brotliLength":401,"metaUid":"ad488fe2-32"},"ad488fe2-35":{"renderedLength":3693,"gzipLength":1322,"brotliLength":1121,"metaUid":"ad488fe2-34"},"ad488fe2-37":{"renderedLength":7570,"gzipLength":2469,"brotliLength":2052,"metaUid":"ad488fe2-36"},"ad488fe2-39":{"renderedLength":1118,"gzipLength":397,"brotliLength":337,"metaUid":"ad488fe2-38"},"ad488fe2-41":{"renderedLength":4580,"gzipLength":1471,"brotliLength":1291,"metaUid":"ad488fe2-40"},"ad488fe2-43":{"renderedLength":327,"gzipLength":254,"brotliLength":193,"metaUid":"ad488fe2-42"},"ad488fe2-45":{"renderedLength":923,"gzipLength":408,"brotliLength":349,"metaUid":"ad488fe2-44"},"ad488fe2-47":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"ad488fe2-46"}},"nodeMetas":{"ad488fe2-0":{"id":"/src/styles/index.css","moduleParts":{"index.cjs":"ad488fe2-1"},"imported":[],"importedBy":[{"uid":"ad488fe2-46"},{"uid":"ad488fe2-40"}]},"ad488fe2-2":{"id":"/src/config/appConfig.ts","moduleParts":{"index.cjs":"ad488fe2-3"},"imported":[{"uid":"ad488fe2-54"}],"importedBy":[{"uid":"ad488fe2-53"}]},"ad488fe2-4":{"id":"/src/utils/rendererProvider.ts","moduleParts":{"index.cjs":"ad488fe2-5"},"imported":[{"uid":"ad488fe2-50"}],"importedBy":[{"uid":"ad488fe2-46"},{"uid":"ad488fe2-8"}]},"ad488fe2-6":{"id":"/src/utils/rulesProvider.ts","moduleParts":{"index.cjs":"ad488fe2-7"},"imported":[{"uid":"ad488fe2-50"}],"importedBy":[{"uid":"ad488fe2-46"},{"uid":"ad488fe2-8"}]},"ad488fe2-8":{"id":"/src/hooks/useForm.ts","moduleParts":{"index.cjs":"ad488fe2-9"},"imported":[{"uid":"ad488fe2-54"},{"uid":"ad488fe2-50"},{"uid":"ad488fe2-53"},{"uid":"ad488fe2-4"},{"uid":"ad488fe2-6"}],"importedBy":[{"uid":"ad488fe2-48"}]},"ad488fe2-10":{"id":"/src/hooks/provideFormContext.ts","moduleParts":{"index.cjs":"ad488fe2-11"},"imported":[{"uid":"ad488fe2-54"}],"importedBy":[{"uid":"ad488fe2-48"},{"uid":"ad488fe2-12"},{"uid":"ad488fe2-16"},{"uid":"ad488fe2-20"}]},"ad488fe2-12":{"id":"/src/hooks/useField.ts","moduleParts":{"index.cjs":"ad488fe2-13"},"imported":[{"uid":"ad488fe2-54"},{"uid":"ad488fe2-50"},{"uid":"ad488fe2-10"}],"importedBy":[{"uid":"ad488fe2-48"}]},"ad488fe2-14":{"id":"/src/hooks/provideFieldContext.ts","moduleParts":{"index.cjs":"ad488fe2-15"},"imported":[{"uid":"ad488fe2-54"}],"importedBy":[{"uid":"ad488fe2-48"},{"uid":"ad488fe2-44"}]},"ad488fe2-16":{"id":"/src/hooks/useWatch.ts","moduleParts":{"index.cjs":"ad488fe2-17"},"imported":[{"uid":"ad488fe2-54"},{"uid":"ad488fe2-50"},{"uid":"ad488fe2-10"}],"importedBy":[{"uid":"ad488fe2-48"},{"uid":"ad488fe2-20"}]},"ad488fe2-18":{"id":"/src/hooks/useEffect.ts","moduleParts":{"index.cjs":"ad488fe2-19"},"imported":[{"uid":"ad488fe2-54"},{"uid":"ad488fe2-50"}],"importedBy":[{"uid":"ad488fe2-48"}]},"ad488fe2-20":{"id":"/src/hooks/useDictionary.ts","moduleParts":{"index.cjs":"ad488fe2-21"},"imported":[{"uid":"ad488fe2-54"},{"uid":"ad488fe2-10"},{"uid":"ad488fe2-16"}],"importedBy":[{"uid":"ad488fe2-48"},{"uid":"ad488fe2-44"}]},"ad488fe2-22":{"id":"/src/hooks/provideFormConfigContext.ts","moduleParts":{"index.cjs":"ad488fe2-23"},"imported":[{"uid":"ad488fe2-54"}],"importedBy":[{"uid":"ad488fe2-48"}]},"ad488fe2-24":{"id":"/src/utils/equal.ts","moduleParts":{"index.cjs":"ad488fe2-25"},"imported":[],"importedBy":[{"uid":"ad488fe2-26"}]},"ad488fe2-26":{"id":"/src/hooks/useStableRef.ts","moduleParts":{"index.cjs":"ad488fe2-27"},"imported":[{"uid":"ad488fe2-54"},{"uid":"ad488fe2-24"}],"importedBy":[{"uid":"ad488fe2-48"}]},"ad488fe2-28":{"id":"/src/hooks/useViewSchemas.ts","moduleParts":{"index.cjs":"ad488fe2-29"},"imported":[{"uid":"ad488fe2-54"}],"importedBy":[{"uid":"ad488fe2-48"}]},"ad488fe2-30":{"id":"/src/utils/validation.ts","moduleParts":{"index.cjs":"ad488fe2-31"},"imported":[],"importedBy":[{"uid":"ad488fe2-56"}]},"ad488fe2-32":{"id":"/src/utils/slot.ts","moduleParts":{"index.cjs":"ad488fe2-33"},"imported":[],"importedBy":[{"uid":"ad488fe2-56"}]},"ad488fe2-34":{"id":"/src/components/FormGroup/index.tsx","moduleParts":{"index.cjs":"ad488fe2-35"},"imported":[{"uid":"ad488fe2-54"},{"uid":"ad488fe2-55"},{"uid":"ad488fe2-36"}],"importedBy":[{"uid":"ad488fe2-46"},{"uid":"ad488fe2-36"}]},"ad488fe2-36":{"id":"/src/components/FormItem/index.tsx","moduleParts":{"index.cjs":"ad488fe2-37"},"imported":[{"uid":"ad488fe2-54"},{"uid":"ad488fe2-55"},{"uid":"ad488fe2-48"},{"uid":"ad488fe2-56"},{"uid":"ad488fe2-34"}],"importedBy":[{"uid":"ad488fe2-46"},{"uid":"ad488fe2-42"},{"uid":"ad488fe2-34"},{"uid":"ad488fe2-40"}]},"ad488fe2-38":{"id":"/src/utils/helpers.ts","moduleParts":{"index.cjs":"ad488fe2-39"},"imported":[],"importedBy":[{"uid":"ad488fe2-40"}]},"ad488fe2-40":{"id":"/src/form.vue?vue&type=script&setup=true&lang.ts","moduleParts":{"index.cjs":"ad488fe2-41"},"imported":[{"uid":"ad488fe2-54"},{"uid":"ad488fe2-50"},{"uid":"ad488fe2-63"},{"uid":"ad488fe2-36"},{"uid":"ad488fe2-48"},{"uid":"ad488fe2-38"},{"uid":"ad488fe2-0"}],"importedBy":[{"uid":"ad488fe2-60"}]},"ad488fe2-42":{"id":"/src/form.ts","moduleParts":{"index.cjs":"ad488fe2-43"},"imported":[{"uid":"ad488fe2-36"},{"uid":"ad488fe2-52"},{"uid":"ad488fe2-53"}],"importedBy":[{"uid":"ad488fe2-46"}]},"ad488fe2-44":{"id":"/src/hocs/withRemoteOptions.ts","moduleParts":{"index.cjs":"ad488fe2-45"},"imported":[{"uid":"ad488fe2-54"},{"uid":"ad488fe2-14"},{"uid":"ad488fe2-20"}],"importedBy":[{"uid":"ad488fe2-49"}]},"ad488fe2-46":{"id":"/src/index.ts","moduleParts":{"index.cjs":"ad488fe2-47"},"imported":[{"uid":"ad488fe2-0"},{"uid":"ad488fe2-42"},{"uid":"ad488fe2-4"},{"uid":"ad488fe2-6"},{"uid":"ad488fe2-48"},{"uid":"ad488fe2-49"},{"uid":"ad488fe2-36"},{"uid":"ad488fe2-34"},{"uid":"ad488fe2-50"},{"uid":"ad488fe2-51"}],"importedBy":[],"isEntry":true},"ad488fe2-48":{"id":"/src/hooks/index.ts","moduleParts":{},"imported":[{"uid":"ad488fe2-8"},{"uid":"ad488fe2-10"},{"uid":"ad488fe2-12"},{"uid":"ad488fe2-14"},{"uid":"ad488fe2-16"},{"uid":"ad488fe2-18"},{"uid":"ad488fe2-20"},{"uid":"ad488fe2-22"},{"uid":"ad488fe2-26"},{"uid":"ad488fe2-28"}],"importedBy":[{"uid":"ad488fe2-46"},{"uid":"ad488fe2-36"},{"uid":"ad488fe2-40"}]},"ad488fe2-49":{"id":"/src/hocs/index.ts","moduleParts":{},"imported":[{"uid":"ad488fe2-44"}],"importedBy":[{"uid":"ad488fe2-46"}]},"ad488fe2-50":{"id":"@schemx/core","moduleParts":{},"imported":[],"importedBy":[{"uid":"ad488fe2-46"},{"uid":"ad488fe2-4"},{"uid":"ad488fe2-6"},{"uid":"ad488fe2-8"},{"uid":"ad488fe2-12"},{"uid":"ad488fe2-16"},{"uid":"ad488fe2-18"},{"uid":"ad488fe2-40"}],"isExternal":true},"ad488fe2-51":{"id":"/src/types/index.ts","moduleParts":{},"imported":[{"uid":"ad488fe2-57"},{"uid":"ad488fe2-58"},{"uid":"ad488fe2-59"}],"importedBy":[{"uid":"ad488fe2-46"}]},"ad488fe2-52":{"id":"/src/formRuntime.js","moduleParts":{},"imported":[{"uid":"ad488fe2-60"}],"importedBy":[{"uid":"ad488fe2-42"}]},"ad488fe2-53":{"id":"/src/config/index.ts","moduleParts":{},"imported":[{"uid":"ad488fe2-2"}],"importedBy":[{"uid":"ad488fe2-42"},{"uid":"ad488fe2-8"}]},"ad488fe2-54":{"id":"vue","moduleParts":{},"imported":[],"importedBy":[{"uid":"ad488fe2-36"},{"uid":"ad488fe2-34"},{"uid":"ad488fe2-8"},{"uid":"ad488fe2-10"},{"uid":"ad488fe2-12"},{"uid":"ad488fe2-14"},{"uid":"ad488fe2-16"},{"uid":"ad488fe2-18"},{"uid":"ad488fe2-20"},{"uid":"ad488fe2-22"},{"uid":"ad488fe2-26"},{"uid":"ad488fe2-28"},{"uid":"ad488fe2-44"},{"uid":"ad488fe2-2"},{"uid":"ad488fe2-40"}],"isExternal":true},"ad488fe2-55":{"id":"classnames","moduleParts":{},"imported":[],"importedBy":[{"uid":"ad488fe2-36"},{"uid":"ad488fe2-34"}],"isExternal":true},"ad488fe2-56":{"id":"/src/utils/index.ts","moduleParts":{},"imported":[{"uid":"ad488fe2-61"},{"uid":"ad488fe2-30"},{"uid":"ad488fe2-32"},{"uid":"ad488fe2-62"}],"importedBy":[{"uid":"ad488fe2-36"}]},"ad488fe2-57":{"id":"/src/types/dictionary.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"ad488fe2-51"}]},"ad488fe2-58":{"id":"/src/types/form.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"ad488fe2-51"}]},"ad488fe2-59":{"id":"/src/types/field.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"ad488fe2-51"}]},"ad488fe2-60":{"id":"/src/form.vue","moduleParts":{},"imported":[{"uid":"ad488fe2-40"}],"importedBy":[{"uid":"ad488fe2-52"}]},"ad488fe2-61":{"id":"/src/utils/dynamic.ts","moduleParts":{},"imported":[{"uid":"ad488fe2-63"}],"importedBy":[{"uid":"ad488fe2-56"}]},"ad488fe2-62":{"id":"/src/utils/diff.ts","moduleParts":{},"imported":[{"uid":"ad488fe2-64"}],"importedBy":[{"uid":"ad488fe2-56"}]},"ad488fe2-63":{"id":"es-toolkit","moduleParts":{},"imported":[],"importedBy":[{"uid":"ad488fe2-61"},{"uid":"ad488fe2-40"}],"isExternal":true},"ad488fe2-64":{"id":"es-toolkit/compat","moduleParts":{},"imported":[],"importedBy":[{"uid":"ad488fe2-62"}],"isExternal":true}},"env":{"rollup":"4.62.2"},"options":{"gzip":true,"brotli":true,"sourcemap":false}};
|
|
4933
4933
|
|
|
4934
4934
|
const run = () => {
|
|
4935
4935
|
const width = window.innerWidth;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { SchemxViewGroupSchema, Values } from '@schemx/core';
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* FormGroup Props
|
|
5
4
|
*
|
|
6
|
-
* @typeParam
|
|
5
|
+
* @typeParam TValues - 表单值类型
|
|
7
6
|
*/
|
|
8
|
-
export interface SchemxGroupProps<
|
|
9
|
-
schema: SchemxViewGroupSchema<
|
|
7
|
+
export interface SchemxGroupProps<TValues extends Values = Values> {
|
|
8
|
+
schema: SchemxViewGroupSchema<TValues>;
|
|
10
9
|
}
|
|
11
10
|
declare const FormGroup: import('vue').DefineSetupFnComponent<{
|
|
12
11
|
schema: SchemxViewGroupSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FormGroup/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AASH,OAAO,KAAK,EAAE,qBAAqB,EAAoB,MAAM,EAAE,MAAM,cAAc,CAAA;AAEnF;;;;GAIG;AACH,MAAM,WAAW,gBAAgB,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FormGroup/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AASH,OAAO,KAAK,EAAE,qBAAqB,EAAoB,MAAM,EAAE,MAAM,cAAc,CAAA;AAEnF;;;;GAIG;AACH,MAAM,WAAW,gBAAgB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM;IAC/D,MAAM,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAA;CACvC;AAED,QAAA,MAAM,SAAS;;;;kCAuId,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { PropType, VNodeChild } from 'vue';
|
|
2
2
|
import { SchemxViewSchema, Values } from '@schemx/core';
|
|
3
|
-
|
|
4
3
|
/**
|
|
5
4
|
* FormItem 属性。
|
|
6
5
|
*
|
|
7
|
-
* @typeParam
|
|
6
|
+
* @typeParam TValues - 表单值类型
|
|
8
7
|
*/
|
|
9
|
-
export interface SchemxItemProps<
|
|
10
|
-
schema: SchemxViewSchema<
|
|
8
|
+
export interface SchemxItemProps<TValues extends Values = Values> {
|
|
9
|
+
schema: SchemxViewSchema<TValues>;
|
|
11
10
|
}
|
|
12
11
|
declare const FormItem: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
13
12
|
schema: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FormItem/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FormItem/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAgC,QAAQ,EAAS,MAAM,KAAK,CAAA;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAqBrC,OAAO,KAAK,EAMV,gBAAgB,EAChB,MAAM,EACP,MAAM,cAAc,CAAA;AAErB;;;;GAIG;AACH,MAAM,WAAW,eAAe,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM;IAC9D,MAAM,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;CAClC;AAED,QAAA,MAAM,QAAQ;;cAKQ,QAAQ,CAAC,gBAAgB,CAAC;;;UAMjC,UAAU;;cANH,QAAQ,CAAC,gBAAgB,CAAC;;;iGAgB9C,CAAA;AAkPF,eAAe,QAAQ,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { SchemxConfig } from '@schemx/core';
|
|
3
|
+
/**
|
|
4
|
+
* 将 Schemx 安装配置绑定到指定 Vue App。
|
|
5
|
+
*
|
|
6
|
+
* @param app - 要安装 Schemx 的 Vue App 实例。
|
|
7
|
+
* @param config - 当前 App 的默认配置。
|
|
8
|
+
*/
|
|
9
|
+
export declare function provideSchemxAppConfig(app: App, config?: SchemxConfig): void;
|
|
10
|
+
/**
|
|
11
|
+
* 读取当前组件所属 Vue App 的 Schemx 安装配置。
|
|
12
|
+
*
|
|
13
|
+
* 在组件 setup() 之外调用时,Vue 没有可用的注入上下文;此时返回空配置,
|
|
14
|
+
* 使 `useForm()` 仍可在独立 effect scope 中使用 Vue 模块级 Registry。
|
|
15
|
+
*
|
|
16
|
+
* @returns 当前 App 的安装配置,或无 App 上下文时的空配置。
|
|
17
|
+
*/
|
|
18
|
+
export declare function getSchemxAppConfig(): SchemxConfig;
|
|
19
|
+
//# sourceMappingURL=appConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appConfig.d.ts","sourceRoot":"","sources":["../../src/config/appConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,GAAG,EAAiD,MAAM,KAAK,CAAA;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAoChD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,GAAE,YAAiB,GAAG,IAAI,CAKhF;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,IAAI,YAAY,CAQjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA"}
|
package/dist/form.d.ts
CHANGED
|
@@ -1,31 +1,34 @@
|
|
|
1
|
-
import { App
|
|
1
|
+
import { App } from 'vue';
|
|
2
2
|
import { default as FormItem } from './components/FormItem';
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { default as SchemxForm } from './formRuntime.js';
|
|
4
|
+
import { SchemxConfig } from '@schemx/core';
|
|
5
5
|
/**
|
|
6
6
|
* SchemxForm 插件安装选项
|
|
7
7
|
*
|
|
8
|
-
* 在 `app.use(SchemxForm, options)`
|
|
8
|
+
* 在 `app.use(SchemxForm, options)` 时传入,用于配置当前 Vue App 的默认行为。
|
|
9
|
+
* 安装配置不会写入 Core 的模块级全局配置,因此多个 Vue App 可以彼此隔离。
|
|
9
10
|
*
|
|
10
11
|
* @example
|
|
11
12
|
* ```ts
|
|
12
13
|
* import SchemxForm from '@schemx/vue'
|
|
13
14
|
*
|
|
14
15
|
* app.use(SchemxForm, {
|
|
15
|
-
*
|
|
16
|
+
* schemaConfig: { readonly: true },
|
|
16
17
|
* })
|
|
17
18
|
* ```
|
|
18
19
|
*/
|
|
19
|
-
export interface SchemxInstallOptions {
|
|
20
|
+
export interface SchemxInstallOptions extends SchemxConfig {
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
23
|
* 为组件挂载静态属性并保留原始类型
|
|
23
24
|
*
|
|
24
25
|
* @param comp - 原始组件
|
|
25
26
|
* @param extra - 要挂载的静态属性
|
|
27
|
+
* @typeParam TComponent - 原始组件类型。
|
|
28
|
+
* @typeParam TExtras - 待挂载的静态属性类型。
|
|
26
29
|
*/
|
|
27
|
-
export declare function withInstall<
|
|
28
|
-
export type SchemxFormPlugin =
|
|
30
|
+
export declare function withInstall<TComponent extends object, TExtras extends Record<string, unknown>>(comp: TComponent, extra: TExtras): TComponent & TExtras;
|
|
31
|
+
export type SchemxFormPlugin = typeof SchemxForm & {
|
|
29
32
|
install: (app: App, options?: SchemxInstallOptions) => void;
|
|
30
33
|
FormItem: typeof FormItem;
|
|
31
34
|
};
|
package/dist/form.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../src/form.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../src/form.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE9B,OAAO,QAAQ,MAAM,uBAAuB,CAAA;AAC5C,OAAO,UAAU,MAAM,kBAAkB,CAAA;AAGzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAEhD;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,oBAAqB,SAAQ,YAAY;CAAG;AAE7D;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,UAAU,SAAS,MAAM,EACzB,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,GACK,UAAU,GAAG,OAAO,CAC1D;AAED,MAAM,MAAM,gBAAgB,GAAG,OAAO,UAAU,GAAG;IACjD,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,oBAAoB,KAAK,IAAI,CAAA;IAC3D,QAAQ,EAAE,OAAO,QAAQ,CAAA;CAC1B,CAAA;AAED,QAAA,MAAM,gBAAgB,EAQL,gBAAgB,CAAA;AAEjC,eAAe,gBAAgB,CAAA"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { Component
|
|
2
|
-
import { SchemxDictionary } from '../types/dictionary';
|
|
3
|
-
import { NamePath } from '@schemx/core';
|
|
4
|
-
|
|
1
|
+
import { Component } from 'vue';
|
|
5
2
|
/**
|
|
6
3
|
* WithRemoteOptions 注入给被包装组件的额外 Props
|
|
7
4
|
*/
|
|
8
5
|
export interface RemoteOptionsInjectedProps {
|
|
9
6
|
/** 加载的选项列表 */
|
|
10
|
-
options:
|
|
7
|
+
options: unknown[];
|
|
11
8
|
/** 加载状态 */
|
|
12
9
|
loading: boolean;
|
|
13
10
|
}
|
|
@@ -46,29 +43,6 @@ export interface RemoteOptionsInjectedProps {
|
|
|
46
43
|
* }
|
|
47
44
|
* ```
|
|
48
45
|
*/
|
|
49
|
-
export declare function WithRemoteOptions(WrappedComponent: Component):
|
|
50
|
-
dict: {
|
|
51
|
-
type: PropType<SchemxDictionary>;
|
|
52
|
-
default: undefined;
|
|
53
|
-
};
|
|
54
|
-
fieldName: {
|
|
55
|
-
type: PropType<NamePath>;
|
|
56
|
-
default: undefined;
|
|
57
|
-
};
|
|
58
|
-
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
59
|
-
[key: string]: any;
|
|
60
|
-
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
61
|
-
dict: {
|
|
62
|
-
type: PropType<SchemxDictionary>;
|
|
63
|
-
default: undefined;
|
|
64
|
-
};
|
|
65
|
-
fieldName: {
|
|
66
|
-
type: PropType<NamePath>;
|
|
67
|
-
default: undefined;
|
|
68
|
-
};
|
|
69
|
-
}>> & Readonly<{}>, {
|
|
70
|
-
dict: SchemxDictionary<import('@schemx/core').Values, any>;
|
|
71
|
-
fieldName: string;
|
|
72
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
46
|
+
export declare function WithRemoteOptions(WrappedComponent: Component): Component;
|
|
73
47
|
export default WithRemoteOptions;
|
|
74
48
|
//# sourceMappingURL=withRemoteOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withRemoteOptions.d.ts","sourceRoot":"","sources":["../../src/hocs/withRemoteOptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"withRemoteOptions.d.ts","sourceRoot":"","sources":["../../src/hocs/withRemoteOptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,SAAS,EAAwD,MAAM,KAAK,CAAA;AASrF;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,cAAc;IACd,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,WAAW;IACX,OAAO,EAAE,OAAO,CAAA;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,iBAAiB,CAAC,gBAAgB,EAAE,SAAS,GAAG,SAAS,CAkCxE;AAED,eAAe,iBAAiB,CAAA"}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -16,9 +16,9 @@ export { useWatch, useWatchField, useWatchFields, useWatchAll } from './useWatch
|
|
|
16
16
|
/** useEffect - 通用 Signal effect */
|
|
17
17
|
export { useEffect } from './useEffect';
|
|
18
18
|
/** useDictionary - 字典选项加载 */
|
|
19
|
-
export { useDictionary, type UseDictionaryReturn
|
|
19
|
+
export { useDictionary, type UseDictionaryReturn } from './useDictionary';
|
|
20
20
|
/** useFormConfigContext - 表单上下文注入与消费 */
|
|
21
|
-
export { createFormConfigContext, useFormConfigContext,
|
|
21
|
+
export { createFormConfigContext, useFormConfigContext, type FormContextProps, } from './provideFormConfigContext';
|
|
22
22
|
/** useStableRef - 引用稳定化的 shallowRef */
|
|
23
23
|
export { useStableRef } from './useStableRef';
|
|
24
24
|
/** useViewSchemas - ViewSchemas Vue 桥接 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,uBAAuB;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,qCAAqC;AACrC,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAExE,uBAAuB;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,sCAAsC;AACtC,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAE3E,wBAAwB;AACxB,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAEjF,mCAAmC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,6BAA6B;AAC7B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,uBAAuB;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,qCAAqC;AACrC,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAExE,uBAAuB;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,sCAAsC;AACtC,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAE3E,wBAAwB;AACxB,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAEjF,mCAAmC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,6BAA6B;AAC7B,OAAO,EAAE,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAEzE,wCAAwC;AACxC,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,KAAK,gBAAgB,GACtB,MAAM,4BAA4B,CAAA;AAEnC,uCAAuC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,0CAA0C;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FieldInstance } from '../types/field';
|
|
2
2
|
import { Values } from '@schemx/core';
|
|
3
|
-
|
|
4
3
|
/**
|
|
5
4
|
* 向后代组件提供当前字段实例。
|
|
6
5
|
*
|
|
@@ -33,7 +32,7 @@ export declare function createFieldContext<TValues extends Values = Values>(fiel
|
|
|
33
32
|
* @example
|
|
34
33
|
* ```ts
|
|
35
34
|
* const field = useFieldContext()
|
|
36
|
-
* field.
|
|
35
|
+
* field.errors.value // readonly string[]
|
|
37
36
|
* field.getValue() // 当前字段值
|
|
38
37
|
* ```
|
|
39
38
|
*/
|
|
@@ -1,26 +1,16 @@
|
|
|
1
1
|
import { InjectionKey } from 'vue';
|
|
2
|
-
import {
|
|
3
|
-
import { Values } from '@schemx/core';
|
|
4
|
-
|
|
2
|
+
import { SchemxSchemaConfig, Values } from '@schemx/core';
|
|
5
3
|
/** 表单级展示配置在 Vue provide/inject 中使用的注入 key。 */
|
|
6
|
-
export declare const SCHEMX_FORM_CONFIG_KEY: InjectionKey<FormContextProps
|
|
7
|
-
/**
|
|
8
|
-
* formContextProps 类型排除值
|
|
9
|
-
*/
|
|
10
|
-
export declare const formConfigContextOmitKey: readonly ["form", "modelValue", "rendererRegistry", "validatorRegistry", "defaultRendererType", "onFinish", "onFinishFailed", "onValuesChange", "onFieldsChange"];
|
|
11
|
-
/**
|
|
12
|
-
* formContextProps 类型排除值 - 类型
|
|
13
|
-
*/
|
|
14
|
-
export type FormConfigContextOmitKey = (typeof formConfigContextOmitKey)[number];
|
|
4
|
+
export declare const SCHEMX_FORM_CONFIG_KEY: InjectionKey<FormContextProps>;
|
|
15
5
|
/**
|
|
16
6
|
* 表单级默认配置。
|
|
17
7
|
*
|
|
18
|
-
*
|
|
19
|
-
* 表单数据和回调等运行时处理属性,供字段组件读取默认展示行为。
|
|
8
|
+
* 该类型只描述 Schema 通用配置,不包含表单实例、表单数据、回调、样式或 Registry。
|
|
20
9
|
*
|
|
21
10
|
* @typeParam TValues - 表单值类型
|
|
22
11
|
*/
|
|
23
|
-
export interface FormContextProps
|
|
12
|
+
export interface FormContextProps {
|
|
13
|
+
schemaConfig: Partial<SchemxSchemaConfig>;
|
|
24
14
|
}
|
|
25
15
|
/**
|
|
26
16
|
* 创建并注入表单级配置上下文。
|
|
@@ -29,18 +19,28 @@ export interface FormContextProps<TValues extends Values = Values> extends Omit<
|
|
|
29
19
|
* 使后代字段组件能够读取 readonly、disabled、labelAlign 等默认配置。
|
|
30
20
|
*
|
|
31
21
|
* @typeParam TValues - 表单值类型
|
|
32
|
-
* @param props -
|
|
22
|
+
* @param props - 要提供给后代组件的 Schema 配置
|
|
33
23
|
*
|
|
34
24
|
* @remarks
|
|
35
25
|
* 该函数只注册上下文,不创建或销毁表单实例,也不改变传入配置的所有权。
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* createFormConfigContext({ schemaConfig: { readonly: true, labelAlign: "right" } })
|
|
30
|
+
* ```
|
|
36
31
|
*/
|
|
37
|
-
export declare const createFormConfigContext: <TValues extends Values = Values>(props: FormContextProps
|
|
32
|
+
export declare const createFormConfigContext: <TValues extends Values = Values>(props: FormContextProps) => void;
|
|
38
33
|
/**
|
|
39
34
|
* `createFormConfigContext` 的兼容别名。
|
|
40
35
|
*
|
|
41
36
|
* @deprecated 请使用 createFormConfigContext。
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* createContext({ schemaConfig: { disabled: true } })
|
|
41
|
+
* ```
|
|
42
42
|
*/
|
|
43
|
-
export declare const createContext: <TValues extends Values = Values>(props: FormContextProps
|
|
43
|
+
export declare const createContext: <TValues extends Values = Values>(props: FormContextProps) => void;
|
|
44
44
|
/**
|
|
45
45
|
* 获取最近祖先组件提供的表单级配置。
|
|
46
46
|
*
|
|
@@ -54,7 +54,7 @@ export declare const createContext: <TValues extends Values = Values>(props: For
|
|
|
54
54
|
* @example
|
|
55
55
|
* ```ts
|
|
56
56
|
* const context = useFormConfigContext()
|
|
57
|
-
* console.log(context.readonly, context.disabled)
|
|
57
|
+
* console.log(context.schemaConfig.readonly, context.schemaConfig.disabled)
|
|
58
58
|
* ```
|
|
59
59
|
*/
|
|
60
60
|
export declare function useFormConfigContext(): FormContextProps;
|
|
@@ -62,6 +62,11 @@ export declare function useFormConfigContext(): FormContextProps;
|
|
|
62
62
|
* `useFormConfigContext` 的兼容别名。
|
|
63
63
|
*
|
|
64
64
|
* @deprecated 请使用 useFormConfigContext。
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const context = useContext()
|
|
69
|
+
* ```
|
|
65
70
|
*/
|
|
66
71
|
export declare const useContext: typeof useFormConfigContext;
|
|
67
72
|
//# sourceMappingURL=provideFormConfigContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provideFormConfigContext.d.ts","sourceRoot":"","sources":["../../src/hooks/provideFormConfigContext.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAU,KAAK,YAAY,EAAW,MAAM,KAAK,CAAA;AAExD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"provideFormConfigContext.d.ts","sourceRoot":"","sources":["../../src/hooks/provideFormConfigContext.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAU,KAAK,YAAY,EAAW,MAAM,KAAK,CAAA;AAExD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE9D,8CAA8C;AAC9C,eAAO,MAAM,sBAAsB,EAE9B,YAAY,CAAC,gBAAgB,CAAC,CAAA;AAEnC;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAA;CAC1C;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,uBAAuB,GAAI,OAAO,SAAS,MAAM,GAAG,MAAM,EACrE,OAAO,gBAAgB,KACtB,IAEF,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,GAhBc,OAAO,SAAS,MAAM,kBACrD,gBAAgB,KACtB,IAciD,CAAA;AAEpD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,IAAI,gBAAgB,CAWvD;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,6BAAuB,CAAA"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { SchemxDictionary } from '../types/dictionary';
|
|
3
3
|
import { NamePath, Values } from '@schemx/core';
|
|
4
|
-
|
|
5
4
|
export type { SchemxDictionary, SchemxWithDictionary } from '../types/dictionary';
|
|
6
5
|
/**
|
|
7
6
|
* useDictionary 返回值
|
|
8
7
|
*/
|
|
9
|
-
export interface UseDictionaryReturn {
|
|
8
|
+
export interface UseDictionaryReturn<TOption = unknown> {
|
|
10
9
|
/** 远程加载的字典选项列表(响应式) */
|
|
11
|
-
list: Ref<
|
|
10
|
+
list: Ref<TOption[]>;
|
|
12
11
|
/** 请求加载状态(响应式) */
|
|
13
12
|
loading: Ref<boolean>;
|
|
14
13
|
/** 请求错误信息(响应式) */
|
|
@@ -18,14 +17,14 @@ export interface UseDictionaryReturn {
|
|
|
18
17
|
/** 使用当前配置重新执行 api */
|
|
19
18
|
refresh: () => Promise<void>;
|
|
20
19
|
/** 直接修改 list 的值,不触发 api 调用 */
|
|
21
|
-
mutate: (data:
|
|
20
|
+
mutate: (data: TOption[]) => void;
|
|
22
21
|
}
|
|
23
22
|
/**
|
|
24
23
|
* @deprecated
|
|
25
24
|
*
|
|
26
25
|
* 已弃用,请使用 **UseDictionaryReturn**
|
|
27
26
|
*/
|
|
28
|
-
export type UseDictOptionsReturn = UseDictionaryReturn
|
|
27
|
+
export type UseDictOptionsReturn<TOption = unknown> = UseDictionaryReturn<TOption>;
|
|
29
28
|
/**
|
|
30
29
|
* 将未知抛出值规范化为 `Error` 实例
|
|
31
30
|
*
|
|
@@ -43,18 +42,24 @@ export declare function normalizeError(err: unknown): Error;
|
|
|
43
42
|
* @typeParam TValues - 表单值类型
|
|
44
43
|
* @param options - 字典配置选项
|
|
45
44
|
* @param fieldName - 当前字段名,用于 resetOnDepsChange 时清空字段值
|
|
46
|
-
* @returns
|
|
45
|
+
* @returns `{ list, loading, error, loadDict, refresh, mutate }`:响应式选项、
|
|
46
|
+
* 加载与错误状态,以及加载、刷新和本地更新方法
|
|
47
47
|
*
|
|
48
48
|
* @example
|
|
49
49
|
* ```ts
|
|
50
50
|
* // 基础用法
|
|
51
|
-
* const { list } = useDictionary({
|
|
51
|
+
* const { list, loading, error, loadDict, refresh, mutate } = useDictionary({
|
|
52
52
|
* api: async () => {
|
|
53
53
|
* const res = await fetch('/api/options')
|
|
54
54
|
* return res.json()
|
|
55
55
|
* },
|
|
56
56
|
* })
|
|
57
57
|
*
|
|
58
|
+
* await loadDict() // 主动加载
|
|
59
|
+
* await refresh() // 使用当前配置重新加载
|
|
60
|
+
* mutate([{ label: "手动选项", value: "manual" }])
|
|
61
|
+
* console.log(list.value, loading.value, error.value)
|
|
62
|
+
*
|
|
58
63
|
* // 依赖联动(带泛型)
|
|
59
64
|
* const { list } = useDictionary<MyFormValues>({
|
|
60
65
|
* api: async (values) => fetchCities(values.province),
|
|
@@ -65,6 +70,6 @@ export declare function normalizeError(err: unknown): Error;
|
|
|
65
70
|
* }, 'city')
|
|
66
71
|
* ```
|
|
67
72
|
*/
|
|
68
|
-
export declare const useDictionary: <TValues extends Values = Values, TName extends NamePath<TValues> = NamePath<TValues
|
|
73
|
+
export declare const useDictionary: <TValues extends Values = Values, TName extends NamePath<TValues> = NamePath<TValues>, TResponse = unknown, TOption = unknown>(options: SchemxDictionary<TValues, TResponse, TOption>, fieldName?: TName) => UseDictionaryReturn<TOption>;
|
|
69
74
|
export default useDictionary;
|
|
70
75
|
//# sourceMappingURL=useDictionary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionary.d.ts","sourceRoot":"","sources":["../../src/hooks/useDictionary.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAa,GAAG,
|
|
1
|
+
{"version":3,"file":"useDictionary.d.ts","sourceRoot":"","sources":["../../src/hooks/useDictionary.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAa,GAAG,EAAmB,MAAM,KAAK,CAAA;AAErD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAK1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAEpD,YAAY,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAEhF;;GAEG;AACH,MAAM,WAAW,mBAAmB,CAAC,OAAO,GAAG,OAAO;IACpD,uBAAuB;IACvB,IAAI,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAA;IACpB,kBAAkB;IAClB,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IACrB,kBAAkB;IAClB,KAAK,EAAE,GAAG,CAAC,KAAK,GAAG,SAAS,CAAC,CAAA;IAC7B,eAAe;IACf,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC7B,qBAAqB;IACrB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5B,8BAA8B;IAC9B,MAAM,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAA;CAClC;AAED;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,CAAC,OAAO,GAAG,OAAO,IAAI,mBAAmB,CAAC,OAAO,CAAC,CAAA;AAElF;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,KAAK,CAIlD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,eAAO,MAAM,aAAa,GACxB,OAAO,SAAS,MAAM,GAAG,MAAM,EAC/B,KAAK,SAAS,QAAQ,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,EACnD,SAAS,GAAG,OAAO,EACnB,OAAO,GAAG,OAAO,EAEjB,SAAS,gBAAgB,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,EACtD,YAAY,KAAK,KAChB,mBAAmB,CAAC,OAAO,CA6I7B,CAAA;AAED,eAAe,aAAa,CAAA"}
|
package/dist/hooks/useField.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FieldInstance } from '../types/field';
|
|
2
2
|
import { NamePath, Values } from '@schemx/core';
|
|
3
|
-
|
|
4
3
|
/**
|
|
5
4
|
* 获取单个字段的控制能力
|
|
6
5
|
*
|
|
@@ -18,7 +17,7 @@ import { NamePath, Values } from '@schemx/core';
|
|
|
18
17
|
* field.getValue()
|
|
19
18
|
*
|
|
20
19
|
* // 响应式错误
|
|
21
|
-
* field.
|
|
20
|
+
* field.errors.value // readonly string[]
|
|
22
21
|
*
|
|
23
22
|
* // 响应式脏状态
|
|
24
23
|
* field.dirty.value // boolean
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useField.d.ts","sourceRoot":"","sources":["../../src/hooks/useField.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAI9C,OAAO,KAAK,EAAE,QAAQ,EAAkB,MAAM,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"useField.d.ts","sourceRoot":"","sources":["../../src/hooks/useField.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAI9C,OAAO,KAAK,EAAE,QAAQ,EAAkB,MAAM,EAAE,MAAM,cAAc,CAAA;AAuEpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,SAAS,MAAM,GAAG,MAAM,EACtD,MAAM,QAAQ,CAAC,OAAO,CAAC,KACtB,aAAa,CAAC,OAAO,CAuCvB,CAAA;AAED,eAAe,QAAQ,CAAA"}
|
package/dist/hooks/useForm.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { CreateFormOptions, NamePath, SchemxInstance, Values } from '@schemx/core';
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* useForm 配置选项。
|
|
5
4
|
*
|
|
6
5
|
* 当前与 core 层 CreateFormOptions 保持一致,并在 Vue 层自动补充默认的
|
|
7
|
-
* rendererRegistry 和
|
|
6
|
+
* rendererRegistry 和 validationRuleRegistry。保留独立类型用于后续扩展
|
|
8
7
|
* Vue 专属配置,而不污染 core 层接口。
|
|
9
8
|
*
|
|
10
9
|
* @typeParam TValues - 表单值类型
|
|
@@ -15,7 +14,7 @@ export interface UseFormOptions<TValues extends Values> extends CreateFormOption
|
|
|
15
14
|
* 创建由当前 Vue effect scope 持有的表单实例。
|
|
16
15
|
*
|
|
17
16
|
* useForm 只负责以下职责:
|
|
18
|
-
* 1.
|
|
17
|
+
* 1. 合并表单显式、App 安装和 Vue 层默认配置;
|
|
19
18
|
* 2. 同步创建 SchemxInstance;
|
|
20
19
|
* 3. 在当前 effect scope 销毁时调用 instance.destroy()。
|
|
21
20
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../../src/hooks/useForm.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../../src/hooks/useForm.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAEvF;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc,CAAC,OAAO,SAAS,MAAM,CAAE,SAAQ,iBAAiB,CAC/E,OAAO,EACP,QAAQ,CAAC,OAAO,CAAC,CAClB;CAAG;AAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,OAAO,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,EACrD,OAAO,GAAE,cAAc,CAAC,OAAO,CAAM,GACpC,cAAc,CAAC,OAAO,CAAC,CA0BzB"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { ShallowRef } from 'vue';
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* 创建一个引用稳定的 shallowRef。
|
|
5
4
|
*
|
|
6
5
|
* 在 watchEffect 中执行工厂函数,自动追踪响应式依赖。
|
|
7
6
|
* 仅当新旧值浅比较不相等时才替换 `.value`,保持引用稳定。
|
|
8
7
|
*
|
|
9
|
-
* @typeParam
|
|
8
|
+
* @typeParam TValue - 需要保持引用稳定的对象类型
|
|
10
9
|
*
|
|
11
10
|
* @param factory - 返回目标对象的工厂函数,在 watchEffect 内执行
|
|
12
11
|
*
|
|
@@ -23,6 +22,6 @@ import { ShallowRef } from 'vue';
|
|
|
23
22
|
* h(Component, props.value)
|
|
24
23
|
* ```
|
|
25
24
|
*/
|
|
26
|
-
export declare function useStableRef<
|
|
25
|
+
export declare function useStableRef<TValue extends Record<string, any>>(factory: () => TValue): Readonly<ShallowRef<TValue>>;
|
|
27
26
|
export default useStableRef;
|
|
28
27
|
//# sourceMappingURL=useStableRef.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStableRef.d.ts","sourceRoot":"","sources":["../../src/hooks/useStableRef.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,KAAK,UAAU,EAA2B,MAAM,KAAK,CAAA;AAI9D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"useStableRef.d.ts","sourceRoot":"","sources":["../../src/hooks/useStableRef.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,KAAK,UAAU,EAA2B,MAAM,KAAK,CAAA;AAI9D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,YAAY,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7D,OAAO,EAAE,MAAM,MAAM,GACpB,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAY9B;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { ShallowRef } from 'vue';
|
|
2
2
|
import { SchemxInstance, SchemxViewSchema, Values } from '@schemx/core';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* 将表单 ViewSchema 映射为 Vue 响应式引用,并在当前作用域销毁时自动取消订阅。
|
|
5
|
+
*
|
|
6
|
+
* @typeParam TValues - 表单值类型。
|
|
7
|
+
* @param form - 要订阅的表单实例。
|
|
8
|
+
* @returns 当前 ViewSchema 列表的只读浅引用。
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const form = useForm()
|
|
13
|
+
* const viewSchemas = useViewSchemas(form)
|
|
14
|
+
*
|
|
15
|
+
* watchEffect(() => console.log(viewSchemas.value))
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function useViewSchemas<TValues extends Values = Values>(form: SchemxInstance<TValues>): ShallowRef<readonly SchemxViewSchema<TValues>[]>;
|
|
5
19
|
export default useViewSchemas;
|
|
6
20
|
//# sourceMappingURL=useViewSchemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useViewSchemas.d.ts","sourceRoot":"","sources":["../../src/hooks/useViewSchemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAErC,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE5E,wBAAgB,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"useViewSchemas.d.ts","sourceRoot":"","sources":["../../src/hooks/useViewSchemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAErC,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE5E;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,EAC5D,IAAI,EAAE,cAAc,CAAC,OAAO,CAAC,GAC5B,UAAU,CAAC,SAAS,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAC,CAYlD;AAED,eAAe,cAAc,CAAA"}
|