@schemx/vue 0.2.1 → 0.2.2
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 +1059 -74
- package/dist/analyze.html +1 -1
- package/dist/components/FormGroup/index.d.ts.map +1 -1
- 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/provideFormConfigContext.d.ts +9 -1
- package/dist/hooks/provideFormConfigContext.d.ts.map +1 -1
- package/dist/hooks/useField.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +44 -24
- package/dist/index.mjs.map +1 -1
- package/dist/types/field.d.ts +2 -0
- package/dist/types/field.d.ts.map +1 -1
- package/dist/types/form.d.ts +3 -2
- package/dist/types/form.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +3 -3
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":"35805a52-1"},{"name":"utils","children":[{"uid":"35805a52-3","name":"rendererProvider.ts"},{"uid":"35805a52-5","name":"rulesProvider.ts"},{"uid":"35805a52-23","name":"equal.ts"},{"uid":"35805a52-29","name":"validation.ts"},{"uid":"35805a52-31","name":"slot.ts"},{"uid":"35805a52-37","name":"helpers.ts"}]},{"name":"hooks","children":[{"uid":"35805a52-7","name":"useForm.ts"},{"uid":"35805a52-9","name":"provideFormContext.ts"},{"uid":"35805a52-11","name":"useField.ts"},{"uid":"35805a52-13","name":"provideFieldContext.ts"},{"uid":"35805a52-15","name":"useWatch.ts"},{"uid":"35805a52-17","name":"useEffect.ts"},{"uid":"35805a52-19","name":"useDictionary.ts"},{"uid":"35805a52-21","name":"provideFormConfigContext.ts"},{"uid":"35805a52-25","name":"useStableRef.ts"},{"uid":"35805a52-27","name":"useViewSchemas.ts"}]},{"name":"components","children":[{"name":"FormGroup/index.tsx","uid":"35805a52-33"},{"name":"FormItem/index.tsx","uid":"35805a52-35"}]},{"uid":"35805a52-39","name":"form.vue?vue&type=script&setup=true&lang.ts"},{"uid":"35805a52-41","name":"form.ts"},{"name":"hocs/withRemoteOptions.ts","uid":"35805a52-43"},{"uid":"35805a52-45","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"35805a52-1":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"35805a52-0"},"35805a52-3":{"renderedLength":62,"gzipLength":69,"brotliLength":49,"metaUid":"35805a52-2"},"35805a52-5":{"renderedLength":58,"gzipLength":65,"brotliLength":49,"metaUid":"35805a52-4"},"35805a52-7":{"renderedLength":348,"gzipLength":194,"brotliLength":159,"metaUid":"35805a52-6"},"35805a52-9":{"renderedLength":468,"gzipLength":280,"brotliLength":223,"metaUid":"35805a52-8"},"35805a52-11":{"renderedLength":1583,"gzipLength":557,"brotliLength":486,"metaUid":"35805a52-10"},"35805a52-13":{"renderedLength":410,"gzipLength":249,"brotliLength":198,"metaUid":"35805a52-12"},"35805a52-15":{"renderedLength":551,"gzipLength":219,"brotliLength":186,"metaUid":"35805a52-14"},"35805a52-17":{"renderedLength":125,"gzipLength":112,"brotliLength":90,"metaUid":"35805a52-16"},"35805a52-19":{"renderedLength":2696,"gzipLength":879,"brotliLength":753,"metaUid":"35805a52-18"},"35805a52-21":{"renderedLength":479,"gzipLength":282,"brotliLength":237,"metaUid":"35805a52-20"},"35805a52-23":{"renderedLength":202,"gzipLength":154,"brotliLength":120,"metaUid":"35805a52-22"},"35805a52-25":{"renderedLength":240,"gzipLength":168,"brotliLength":143,"metaUid":"35805a52-24"},"35805a52-27":{"renderedLength":261,"gzipLength":162,"brotliLength":143,"metaUid":"35805a52-26"},"35805a52-29":{"renderedLength":768,"gzipLength":322,"brotliLength":262,"metaUid":"35805a52-28"},"35805a52-31":{"renderedLength":1262,"gzipLength":486,"brotliLength":401,"metaUid":"35805a52-30"},"35805a52-33":{"renderedLength":1849,"gzipLength":800,"brotliLength":674,"metaUid":"35805a52-32"},"35805a52-35":{"renderedLength":7348,"gzipLength":2417,"brotliLength":1981,"metaUid":"35805a52-34"},"35805a52-37":{"renderedLength":976,"gzipLength":385,"brotliLength":326,"metaUid":"35805a52-36"},"35805a52-39":{"renderedLength":3763,"gzipLength":1198,"brotliLength":1057,"metaUid":"35805a52-38"},"35805a52-41":{"renderedLength":281,"gzipLength":228,"brotliLength":174,"metaUid":"35805a52-40"},"35805a52-43":{"renderedLength":838,"gzipLength":382,"brotliLength":319,"metaUid":"35805a52-42"},"35805a52-45":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"35805a52-44"}},"nodeMetas":{"35805a52-0":{"id":"/src/styles/index.css","moduleParts":{"index.cjs":"35805a52-1"},"imported":[],"importedBy":[{"uid":"35805a52-44"},{"uid":"35805a52-38"}]},"35805a52-2":{"id":"/src/utils/rendererProvider.ts","moduleParts":{"index.cjs":"35805a52-3"},"imported":[{"uid":"35805a52-48"}],"importedBy":[{"uid":"35805a52-44"},{"uid":"35805a52-6"}]},"35805a52-4":{"id":"/src/utils/rulesProvider.ts","moduleParts":{"index.cjs":"35805a52-5"},"imported":[{"uid":"35805a52-48"}],"importedBy":[{"uid":"35805a52-44"},{"uid":"35805a52-6"}]},"35805a52-6":{"id":"/src/hooks/useForm.ts","moduleParts":{"index.cjs":"35805a52-7"},"imported":[{"uid":"35805a52-50"},{"uid":"35805a52-48"},{"uid":"35805a52-2"},{"uid":"35805a52-4"}],"importedBy":[{"uid":"35805a52-46"}]},"35805a52-8":{"id":"/src/hooks/provideFormContext.ts","moduleParts":{"index.cjs":"35805a52-9"},"imported":[{"uid":"35805a52-50"}],"importedBy":[{"uid":"35805a52-46"},{"uid":"35805a52-10"},{"uid":"35805a52-14"},{"uid":"35805a52-18"},{"uid":"35805a52-38"}]},"35805a52-10":{"id":"/src/hooks/useField.ts","moduleParts":{"index.cjs":"35805a52-11"},"imported":[{"uid":"35805a52-50"},{"uid":"35805a52-48"},{"uid":"35805a52-8"}],"importedBy":[{"uid":"35805a52-46"}]},"35805a52-12":{"id":"/src/hooks/provideFieldContext.ts","moduleParts":{"index.cjs":"35805a52-13"},"imported":[{"uid":"35805a52-50"}],"importedBy":[{"uid":"35805a52-46"}]},"35805a52-14":{"id":"/src/hooks/useWatch.ts","moduleParts":{"index.cjs":"35805a52-15"},"imported":[{"uid":"35805a52-50"},{"uid":"35805a52-48"},{"uid":"35805a52-8"}],"importedBy":[{"uid":"35805a52-46"},{"uid":"35805a52-18"}]},"35805a52-16":{"id":"/src/hooks/useEffect.ts","moduleParts":{"index.cjs":"35805a52-17"},"imported":[{"uid":"35805a52-50"},{"uid":"35805a52-48"}],"importedBy":[{"uid":"35805a52-46"}]},"35805a52-18":{"id":"/src/hooks/useDictionary.ts","moduleParts":{"index.cjs":"35805a52-19"},"imported":[{"uid":"35805a52-50"},{"uid":"35805a52-8"},{"uid":"35805a52-14"}],"importedBy":[{"uid":"35805a52-46"},{"uid":"35805a52-42"}]},"35805a52-20":{"id":"/src/hooks/provideFormConfigContext.ts","moduleParts":{"index.cjs":"35805a52-21"},"imported":[{"uid":"35805a52-50"}],"importedBy":[{"uid":"35805a52-46"}]},"35805a52-22":{"id":"/src/utils/equal.ts","moduleParts":{"index.cjs":"35805a52-23"},"imported":[],"importedBy":[{"uid":"35805a52-24"}]},"35805a52-24":{"id":"/src/hooks/useStableRef.ts","moduleParts":{"index.cjs":"35805a52-25"},"imported":[{"uid":"35805a52-50"},{"uid":"35805a52-22"}],"importedBy":[{"uid":"35805a52-46"}]},"35805a52-26":{"id":"/src/hooks/useViewSchemas.ts","moduleParts":{"index.cjs":"35805a52-27"},"imported":[{"uid":"35805a52-50"}],"importedBy":[{"uid":"35805a52-46"}]},"35805a52-28":{"id":"/src/utils/validation.ts","moduleParts":{"index.cjs":"35805a52-29"},"imported":[],"importedBy":[{"uid":"35805a52-52"}]},"35805a52-30":{"id":"/src/utils/slot.ts","moduleParts":{"index.cjs":"35805a52-31"},"imported":[],"importedBy":[{"uid":"35805a52-52"}]},"35805a52-32":{"id":"/src/components/FormGroup/index.tsx","moduleParts":{"index.cjs":"35805a52-33"},"imported":[{"uid":"35805a52-50"},{"uid":"35805a52-51"},{"uid":"35805a52-34"}],"importedBy":[{"uid":"35805a52-44"},{"uid":"35805a52-34"}]},"35805a52-34":{"id":"/src/components/FormItem/index.tsx","moduleParts":{"index.cjs":"35805a52-35"},"imported":[{"uid":"35805a52-50"},{"uid":"35805a52-51"},{"uid":"35805a52-46"},{"uid":"35805a52-52"},{"uid":"35805a52-32"}],"importedBy":[{"uid":"35805a52-44"},{"uid":"35805a52-40"},{"uid":"35805a52-32"},{"uid":"35805a52-38"}]},"35805a52-36":{"id":"/src/utils/helpers.ts","moduleParts":{"index.cjs":"35805a52-37"},"imported":[],"importedBy":[{"uid":"35805a52-38"}]},"35805a52-38":{"id":"/src/form.vue?vue&type=script&setup=true&lang.ts","moduleParts":{"index.cjs":"35805a52-39"},"imported":[{"uid":"35805a52-50"},{"uid":"35805a52-56"},{"uid":"35805a52-34"},{"uid":"35805a52-46"},{"uid":"35805a52-36"},{"uid":"35805a52-0"},{"uid":"35805a52-8"}],"importedBy":[{"uid":"35805a52-53"}]},"35805a52-40":{"id":"/src/form.ts","moduleParts":{"index.cjs":"35805a52-41"},"imported":[{"uid":"35805a52-34"},{"uid":"35805a52-49"}],"importedBy":[{"uid":"35805a52-44"}]},"35805a52-42":{"id":"/src/hocs/withRemoteOptions.ts","moduleParts":{"index.cjs":"35805a52-43"},"imported":[{"uid":"35805a52-50"},{"uid":"35805a52-18"}],"importedBy":[{"uid":"35805a52-47"}]},"35805a52-44":{"id":"/src/index.ts","moduleParts":{"index.cjs":"35805a52-45"},"imported":[{"uid":"35805a52-0"},{"uid":"35805a52-40"},{"uid":"35805a52-2"},{"uid":"35805a52-4"},{"uid":"35805a52-46"},{"uid":"35805a52-47"},{"uid":"35805a52-34"},{"uid":"35805a52-32"},{"uid":"35805a52-48"}],"importedBy":[],"isEntry":true},"35805a52-46":{"id":"/src/hooks/index.ts","moduleParts":{},"imported":[{"uid":"35805a52-6"},{"uid":"35805a52-8"},{"uid":"35805a52-10"},{"uid":"35805a52-12"},{"uid":"35805a52-14"},{"uid":"35805a52-16"},{"uid":"35805a52-18"},{"uid":"35805a52-20"},{"uid":"35805a52-24"},{"uid":"35805a52-26"}],"importedBy":[{"uid":"35805a52-44"},{"uid":"35805a52-34"},{"uid":"35805a52-38"}]},"35805a52-47":{"id":"/src/hocs/index.ts","moduleParts":{},"imported":[{"uid":"35805a52-42"}],"importedBy":[{"uid":"35805a52-44"}]},"35805a52-48":{"id":"@schemx/core","moduleParts":{},"imported":[],"importedBy":[{"uid":"35805a52-44"},{"uid":"35805a52-2"},{"uid":"35805a52-4"},{"uid":"35805a52-6"},{"uid":"35805a52-10"},{"uid":"35805a52-14"},{"uid":"35805a52-16"}],"isExternal":true},"35805a52-49":{"id":"/src/formRuntime.js","moduleParts":{},"imported":[{"uid":"35805a52-53"}],"importedBy":[{"uid":"35805a52-40"}]},"35805a52-50":{"id":"vue","moduleParts":{},"imported":[],"importedBy":[{"uid":"35805a52-34"},{"uid":"35805a52-32"},{"uid":"35805a52-6"},{"uid":"35805a52-8"},{"uid":"35805a52-10"},{"uid":"35805a52-12"},{"uid":"35805a52-14"},{"uid":"35805a52-16"},{"uid":"35805a52-18"},{"uid":"35805a52-20"},{"uid":"35805a52-24"},{"uid":"35805a52-26"},{"uid":"35805a52-42"},{"uid":"35805a52-38"}],"isExternal":true},"35805a52-51":{"id":"classnames","moduleParts":{},"imported":[],"importedBy":[{"uid":"35805a52-34"},{"uid":"35805a52-32"}],"isExternal":true},"35805a52-52":{"id":"/src/utils/index.ts","moduleParts":{},"imported":[{"uid":"35805a52-54"},{"uid":"35805a52-28"},{"uid":"35805a52-30"},{"uid":"35805a52-55"}],"importedBy":[{"uid":"35805a52-34"}]},"35805a52-53":{"id":"/src/form.vue","moduleParts":{},"imported":[{"uid":"35805a52-38"}],"importedBy":[{"uid":"35805a52-49"}]},"35805a52-54":{"id":"/src/utils/dynamic.ts","moduleParts":{},"imported":[{"uid":"35805a52-56"}],"importedBy":[{"uid":"35805a52-52"}]},"35805a52-55":{"id":"/src/utils/diff.ts","moduleParts":{},"imported":[{"uid":"35805a52-57"}],"importedBy":[{"uid":"35805a52-52"}]},"35805a52-56":{"id":"es-toolkit","moduleParts":{},"imported":[],"importedBy":[{"uid":"35805a52-54"},{"uid":"35805a52-38"}],"isExternal":true},"35805a52-57":{"id":"es-toolkit/compat","moduleParts":{},"imported":[],"importedBy":[{"uid":"35805a52-55"}],"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":"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}};
|
|
4933
4933
|
|
|
4934
4934
|
const run = () => {
|
|
4935
4935
|
const width = window.innerWidth;
|
|
@@ -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,CAAC,SAAS,MAAM,GAAG,MAAM;IACzD,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAA;CACjC;AAED,QAAA,MAAM,SAAS;;;;
|
|
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,CAAC,SAAS,MAAM,GAAG,MAAM;IACzD,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAA;CACjC;AAED,QAAA,MAAM,SAAS;;;;kCA0Ed,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withRemoteOptions.d.ts","sourceRoot":"","sources":["../../src/hocs/withRemoteOptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,SAAS,EAAgC,QAAQ,EAAgB,MAAM,KAAK,CAAA;AAErF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"withRemoteOptions.d.ts","sourceRoot":"","sources":["../../src/hocs/withRemoteOptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,SAAS,EAAgC,QAAQ,EAAgB,MAAM,KAAK,CAAA;AAErF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAK1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAG5C;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,cAAc;IACd,OAAO,EAAE,GAAG,EAAE,CAAA;IACd,WAAW;IACX,OAAO,EAAE,OAAO,CAAA;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,iBAAiB,CAAC,gBAAgB,EAAE,SAAS;;cAMrC,QAAQ,CAAC,gBAAgB,CAAC;;;;cAIjB,QAAQ,CAAC,QAAQ,CAAC;;;;;;;cAJ3B,QAAQ,CAAC,gBAAgB,CAAC;;;;cAIjB,QAAQ,CAAC,QAAQ,CAAC;;;;;;6EAuBlD;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
|
|
19
|
+
export { useDictionary, type UseDictionaryReturn, } from './useDictionary';
|
|
20
20
|
/** useFormConfigContext - 表单上下文注入与消费 */
|
|
21
|
-
export { createFormConfigContext, useFormConfigContext, type FormContextProps, } from './provideFormConfigContext';
|
|
21
|
+
export { createFormConfigContext, useFormConfigContext, formConfigContextOmitKey, type FormConfigContextOmitKey, 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,EACL,aAAa,EACb,KAAK,
|
|
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,EACL,aAAa,EACb,KAAK,mBAAmB,GACzB,MAAM,iBAAiB,CAAA;AAExB,wCAAwC;AACxC,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,wBAAwB,EACxB,KAAK,wBAAwB,EAC7B,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"}
|
|
@@ -4,6 +4,14 @@ import { Values } from '@schemx/core';
|
|
|
4
4
|
|
|
5
5
|
/** 表单级展示配置在 Vue provide/inject 中使用的注入 key。 */
|
|
6
6
|
export declare const SCHEMX_FORM_CONFIG_KEY: InjectionKey<FormContextProps<Values>>;
|
|
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];
|
|
7
15
|
/**
|
|
8
16
|
* 表单级默认配置。
|
|
9
17
|
*
|
|
@@ -12,7 +20,7 @@ export declare const SCHEMX_FORM_CONFIG_KEY: InjectionKey<FormContextProps<Value
|
|
|
12
20
|
*
|
|
13
21
|
* @typeParam TValues - 表单值类型
|
|
14
22
|
*/
|
|
15
|
-
export interface FormContextProps<TValues extends Values = Values> extends Omit<SchemxFormProps<TValues>,
|
|
23
|
+
export interface FormContextProps<TValues extends Values = Values> extends Omit<SchemxFormProps<TValues>, FormConfigContextOmitKey> {
|
|
16
24
|
}
|
|
17
25
|
/**
|
|
18
26
|
* 创建并注入表单级配置上下文。
|
|
@@ -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,eAAe,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C,8CAA8C;AAC9C,eAAO,MAAM,sBAAsB,EAAmC,YAAY,CAChF,gBAAgB,CAAC,MAAM,CAAC,CACzB,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,IAAI,CAC7E,eAAe,CAAC,OAAO,CAAC,
|
|
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,eAAe,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C,8CAA8C;AAC9C,eAAO,MAAM,sBAAsB,EAAmC,YAAY,CAChF,gBAAgB,CAAC,MAAM,CAAC,CACzB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB,mKAU3B,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEhF;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,IAAI,CAC7E,eAAe,CAAC,OAAO,CAAC,EACxB,wBAAwB,CACzB;CAAG;AAEJ;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB,GAAI,OAAO,SAAS,MAAM,GAAG,MAAM,EACrE,OAAO,gBAAgB,CAAC,OAAO,CAAC,KAC/B,IAEF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAXc,OAAO,SAAS,MAAM,kBACrD,gBAAgB,CAAC,OAAO,CAAC,KAC/B,IASiD,CAAA;AAEpD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,IAAI,gBAAgB,CAWvD;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,6BAAuB,CAAA"}
|
|
@@ -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;AAqEpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("classnames"),r=require("@schemx/core"),n=require("es-toolkit"),o=r.createRendererRegistry("input"),s=r.createValidatorsRegistry();function a(t={}){const n={...t,rendererRegistry:t.rendererRegistry??o,validatorRegistry:t.validatorRegistry??s},a=r.createForm(n);return e.onScopeDispose(()=>{a.destroy()}),a}const l=Symbol("schemx:instance");function i(t){e.provide(l,t)}function c(){const t=e.inject(l,null);if(!t)throw new Error("[schemx] useFormContext() must be called inside a <SchemxForm> descendant. Ensure createFormContext(form) is called synchronously during setup().");return t}const u=new WeakMap;const d=t=>{const n=c(),o=t;let s=u.get(n);s||(s=new Map,u.set(n,s));const a=s.get(o);let l;if(a)a.refCount++,l=a;else{const{result:a,dispose:i}=function(t,n){const o=r.createField(t,n),s=e.shallowRef(o.getValue()),a=e.shallowRef(o.getError()),l=e.shallowRef(o.isPending()),i=o.effect(()=>{s.value=o.getValue(),a.value=o.getError(),l.value=o.isPending()}),c=e.computed(()=>a.value),u=e.computed(()=>(s.value,o.isTouched())),d=e.computed(()=>l.value);return{result:{value:s,error:c,dirty:u,pending:d,...o,getValue:()=>s.value},dispose:i}}(n,t);l={refCount:1,result:a,dispose:i},s.set(o,l)}return e.onUnmounted(()=>{--l.refCount<=0&&(l.dispose(),s.delete(o))}),l.result},m=Symbol("schemx:field");function p(t){e.provide(m,t)}function h(t,n,o){const s=c(),a=r.createWatch(s,t,n,o);return e.onUnmounted(a),a}function f(e,t,r){return h(e,t,r)}function v(e){return e instanceof Error?e:new Error(String(e))}const y=(t,r)=>{var n;const o=c(),s=e.ref([]),a=e.ref(!1),l=e.ref(void 0);let i=0;const u=async()=>{try{const e=o.getFieldsValue();if("function"==typeof t.shouldFetch&&!t.shouldFetch(e))return s.value=[],void(a.value=!1);a.value=!0,l.value=void 0;const r=++i,n=await(async e=>{const r=t.retryCount??0,n=t.retryInterval??1e3;let s=new Error("Unknown error");for(let l=0;l<=r;l++)try{return await t.api(e,o)}catch(a){s=v(a),l<r&&await new Promise(e=>setTimeout(e,n))}throw s})(e);if(r!==i)return;const c=await(async e=>"function"==typeof(null==t?void 0:t.formatter)?await t.formatter(e,o):e)(n);if(r!==i)return;s.value=c,l.value=void 0,"function"==typeof t.onSuccess&&t.onSuccess(c,o),a.value=!1}catch(e){const r=v(e);l.value=r,s.value=[],a.value=!1,"function"==typeof t.onError&&t.onError(r,o)}};(null==(n=t.dependsOn)?void 0:n.length)&&f(t.dependsOn,(e,n)=>{"function"==typeof t.onDepsChange&&t.onDepsChange(n,o),t.resetOnDepsChange&&r&&o.setFieldValue(r,void 0),u()});const d=t.immediate??!0;return e.onMounted(()=>{d&&u()}),{list:s,loading:a,error:l,loadDict:u,refresh:()=>u(),mutate:e=>{s.value=e}}},g=Symbol("schemx:form-config"),x=t=>{e.provide(g,t)};function b(){const t=e.inject(g);if(!t)throw new Error("[schemx] useFormConfigContext() must be called inside a <SchemxForm> descendant. Ensure createFormConfigContext(props) is called synchronously during setup().");return t}function F(t){const r=e.shallowRef({});return e.watchEffect(()=>{const e=t();((e,t)=>{const r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every(r=>e[r]===t[r])})(r.value,e)||(r.value=e)}),r}function C(t){const r=e.shallowRef(t.getViewSchemas()),n=t.subscribeViewSchemas(e=>{r.value=e});return e.onScopeDispose(n),r}function w(e){return void 0!==e&&(!Array.isArray(e)||0!==e.length)}function V(e,t){if(!t)return!1;return(Array.isArray(t)?t:[t]).some(t=>function(e){return{onBlur:"blur",onChange:"change",onSubmit:"submit",blur:"blur",change:"change",submit:"submit"}[e]??"submit"}(t)===e)}const R=e=>/[A-Z]/.test(e),S=e=>e.includes("-"),_=e=>e.replace(/([A-Z])/g,"-$1").toLowerCase(),k=e=>e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()),E=(e,t)=>{if(e[t])return e[t];const r=R(t)?_(t):S(t)?k(t):void 0;return r&&e[r]?e[r]:void 0},A=(e,t)=>{const r={},n=(o=String(e),(S(o)?k(o):o)+":");var o;const s=(e=>R(e)?_(e):e)(String(e))+":";for(const[a,l]of Object.entries(t))a.startsWith(n)?r[a.slice(n.length)]=l:a.startsWith(s)&&s!==n&&(r[a.slice(s.length)]=l);return r},O=e.defineComponent((r,{slots:n})=>{const o=e.ref(Boolean(r.schema.defaultCollapsed)),s=()=>{r.schema.collapsible&&(o.value=!o.value)};return()=>{const a=r.schema,l=Boolean(a.collapsible);return e.createVNode("div",{class:t("schemx-group",{"schemx-group--collapsed":o.value},a.class),"data-key":a.key},[a.label&&e.createVNode("div",{role:l?"button":void 0,tabindex:l?0:void 0,class:t("schemx-group__header",{"schemx-group__header--clickable":l}),onClick:s,onKeydown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),s())}},[e.createVNode("span",{class:"schemx-group__title"},[a.label]),l&&e.createVNode("span",{class:t("schemx-group__arrow",{"schemx-group__arrow--down":!o.value})},null)]),!o.value&&e.createVNode("div",{class:"schemx-group__body"},[a.children.map(t=>e.createVNode(N,{key:t.key,schema:t},n))])])}},{name:"SchemxGroup",props:{schema:{type:Object,required:!0}}}),N=e.defineComponent({name:"SchemxItem",props:{schema:{type:Object,required:!0}},setup:(t,{slots:r})=>()=>{const n=t.schema;return B(n)?e.h(O,{schema:n},r):e.h(j,{schema:n},r)}}),j=e.defineComponent({name:"SchemxFieldItem",props:{schema:{type:Object,required:!0}},setup(r,{slots:n}){const o=e.toRef(r,"schema"),s=c(),a=b(),l=()=>o.value,i=d(l().name);p(i);const u=e.computed(()=>{return e=l().validationTrigger,t=a.validationTrigger,r="onChange",w(e)?e:w(t)?t:r;var e,t,r}),m=e.computed(()=>{const e=l().visible&&!l().readonly&&!l().disabled,t=l().rules,r=Array.isArray(t)?(null==t?void 0:t.length)>0:!!l().rules;return e&&r}),h=e=>{var t,r;i.setValue(e),null==(r=null==(t=l().componentProps)?void 0:t.onChange)||r.call(t,e),m.value&&V("change",u.value)&&i.validate()},f=()=>{m.value&&V("blur",u.value)&&i.validate()},v=F(()=>{const e=l();return{...e.componentProps,readonly:e.readonly,disabled:e.disabled,placeholder:e.placeholder,formItemProps:e,value:i.getValue(),onChange:h,onBlur:f,"onUpdate:value":e=>i.setValue(e)}}),y=()=>{const t=E(n,`${l().name}Label`);if(t)return t(l());const r=l().labelAlign||a.labelAlign,o=l().labelWidth||a.labelWidth,s=l().colon??a.colon;return e.createVNode("label",{class:"schemx-item__label",style:{width:o,textAlign:r}},[!l().required||l().disabled||l().readonly?null:e.createVNode("span",{class:"schemx-item__required"},[e.createTextVNode("*")]),e.createVNode("span",{class:"schemx-item__label-text"},[l().label,s?":":""])])},g=()=>{const t=s.getRenderer(l().componentType);if(!t)throw new Error(`[schemx] Can not find component renderer of "${l().componentType}".`);const r=A(T(l().name),n),o=e.h(t,v.value,r),a=E(n,`${l().name}Content`);return a?a({...l(),columnElement:o}):e.createVNode("div",{class:"schemx-item__control"},[o])},x=()=>{const t=E(n,`${l().name}Error`);return t?t({...l(),errors:i.error.value}):Array.isArray(i.error.value)&&0!==i.error.value.length?e.createVNode("div",{class:"schemx-item__error"},[i.error.value[0]]):null};return()=>{if(!l().visible)return null;const r=E(n,T(l().name));if(r)return r(l());const o=l().labelPosition||a.labelPosition;return e.createVNode("div",{class:t("schemx-item-wrapper")},[e.createVNode("div",{class:t("schemx-item",`schemx-item--label-${o}`,l().class,{"is-readonly":l().readonly,"is-disabled":l().disabled}),style:{...l().style??{}}},[y(),e.createVNode("div",{class:"schemx-item__content"},[g(),x()])])])}}}),B=e=>"group"===e.componentType,T=e=>Array.isArray(e)?e.map(e=>String(e)).join("."):String(e);function P(e){return!(!e||"group"===e.componentType||"visible"in e&&!1===e.visible)}function W(e,t,r){for(let n=t+r;n>=0&&n<e.length;n+=r)if(P(e[n]))return e[n]}const q=e.defineComponent({name:"SchemxForm",__name:"form",props:{class:{default:""},style:{default:()=>({})},required:{type:Boolean},readonly:{type:Boolean},disabled:{type:Boolean},visible:{type:Boolean},labelIcon:{},labelAlign:{},labelPosition:{},labelWidth:{},contentAlign:{},validationTrigger:{},colon:{type:Boolean},modelValue:{default:()=>({})},initialValues:{default:()=>({})},schemas:{default:()=>[]},form:{default:void 0},rendererRegistry:{default:void 0},defaultRendererType:{},validatorRegistry:{default:void 0},onFinish:{type:Function,default:void 0},onFinishFailed:{type:Function,default:void 0},onValuesChange:{type:Function,default:void 0},onFieldsChange:{type:Function,default:void 0}},emits:["update:modelValue"],setup(t,{expose:r,emit:o}){const s=t,l=o;x(n.omit(s,["form","modelValue","rendererRegistry","defaultRendererType","validatorRegistry","onFinish","onFinishFailed","onValuesChange","onFieldsChange"]));const c=s.form?s.form:a({schemas:s.schemas,initialValues:s.initialValues,rendererRegistry:s.rendererRegistry,defaultRendererType:s.defaultRendererType,validatorRegistry:s.validatorRegistry,readonly:s.readonly,disabled:s.disabled,onFinish:async e=>{var t;null==(t=s.onFinish)||t.call(s,e)},onFinishFailed:async e=>{var t;null==(t=s.onFinishFailed)||t.call(s,e)},onValuesChange:(e,t)=>{var r;l("update:modelValue",t),null==(r=s.onValuesChange)||r.call(s,e,t)},onFieldsChange:(e,t)=>{var r;null==(r=s.onFieldsChange)||r.call(s,e,t)}});i(c),e.watch(()=>s.schemas,e=>{c.setSchemas(e)},{deep:!1,immediate:!!s.form});const u=C(c),d=e=>{const{isFirst:t,isLast:r}=function(e,t){const r=e.findIndex(e=>e.key===t);return-1===r?{found:!1,isFirst:!1,isLast:!1}:P(e[r])?{found:!0,isFirst:!W(e,r,-1),isLast:!W(e,r,1)}:{found:!0,isFirst:!1,isLast:!1}}(u.value,e.key);return{"schemx-item-wrapper--first":t,"schemx-item-wrapper--last":r}};return e.watchEffect(()=>{c.updateDefaultProps(s)}),r({...c}),(t,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["schemx",s.class])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),r=>(e.openBlock(),e.createBlock(e.unref(N),{key:r.key,schema:r,class:e.normalizeClass(d(r))},e.createSlots({_:2},[e.renderList(t.$slots,(r,n)=>({name:n,fn:e.withCtx(r=>[e.renderSlot(t.$slots,n,e.mergeProps({ref_for:!0},r??{}))])}))]),1032,["schema","class"]))),128))],2))}});const D=($=q,I={install(e,t){e.component("SchemxForm",q)},FormItem:N},Object.assign($,I));var $,I;exports.FormGroup=O,exports.FormItem=N,exports.WithRemoteOptions=function(t){return e.defineComponent({name:`WithRemoteOptions(${t.name||"Anonymous"})`,inheritAttrs:!1,props:{dict:{type:Object,default:void 0},fieldName:{type:[String,Array],default:void 0}},setup(r,{attrs:n,slots:o}){const s=r.dict?y(r.dict,r.fieldName):null,a=e.computed(()=>({...n,dict:r.dict,options:r.dict?null==s?void 0:s.list.value:n.options,loading:r.dict?null==s?void 0:s.loading.value:n.loading}));return()=>e.h(t,a.value,o)}})},exports.createFieldContext=p,exports.createFormConfigContext=x,exports.createFormContext=i,exports.default=D,exports.rendererRegistry=o,exports.schemxForm=D,exports.useDictionary=y,exports.useEffect=function(t){const n=r.createEffect(t);return e.onUnmounted(n),n},exports.useField=d,exports.useFieldContext=function(){const t=e.inject(m);if(!t)throw new Error("[schemx] useFieldContext() must be called inside a component tree where createFieldContext(field) has been called.");return t},exports.useForm=a,exports.useFormConfigContext=b,exports.useFormContext=c,exports.useStableRef=F,exports.useViewSchemas=C,exports.useWatch=h,exports.useWatchAll=function(e,t){return h(e,t)},exports.useWatchField=function(e,t,r){return h(e,t,r)},exports.useWatchFields=f,exports.validatorRegistry=s,Object.keys(r).forEach(e=>{"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>r[e]})});
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("classnames"),r=require("@schemx/core"),n=require("es-toolkit"),o=r.createRendererRegistry("input"),s=r.createValidatorsRegistry();function l(t={}){const n={...t,rendererRegistry:t.rendererRegistry??o,validatorRegistry:t.validatorRegistry??s},l=r.createForm(n);return e.onScopeDispose(()=>{l.destroy()}),l}const a=Symbol("schemx:instance");function i(t){e.provide(a,t)}function c(){const t=e.inject(a,null);if(!t)throw new Error("[schemx] useFormContext() must be called inside a <SchemxForm> descendant. Ensure createFormContext(form) is called synchronously during setup().");return t}const u=new WeakMap;const d=t=>{const n=c(),o=t;let s=u.get(n);s||(s=new Map,u.set(n,s));const l=s.get(o);let a;if(l)l.refCount++,a=l;else{const{result:l,dispose:i}=function(t,n){const o=r.createField(t,n),s=e.shallowRef(o.getValue()),l=e.shallowRef(o.getError()),a=e.shallowRef(o.isPending()),i=o.effect(()=>{s.value=o.getValue(),l.value=o.getError(),a.value=o.isPending()}),c=e.computed(()=>l.value),u=e.computed(()=>(s.value,o.isTouched())),d=e.computed(()=>a.value);return{result:{name:n,value:s,error:c,dirty:u,pending:d,...o,getValue:()=>s.value},dispose:i}}(n,t);a={refCount:1,result:l,dispose:i},s.set(o,a)}return e.onUnmounted(()=>{--a.refCount<=0&&(a.dispose(),s.delete(o))}),a.result},m=Symbol("schemx:field");function p(t){e.provide(m,t)}function h(){const t=e.inject(m);if(!t)throw new Error("[schemx] useFieldContext() must be called inside a component tree where createFieldContext(field) has been called.");return t}function f(t,n,o){const s=c(),l=r.createWatch(s,t,n,o);return e.onUnmounted(l),l}function y(e,t,r){return f(e,t,r)}function v(e){return e instanceof Error?e:new Error(String(e))}const g=(t,r)=>{var n;const o=c(),s=e.ref([]),l=e.ref(!1),a=e.ref(void 0);let i=0;const u=async()=>{try{const e=o.getFieldsValue();if("function"==typeof t.shouldFetch&&!t.shouldFetch(e))return s.value=[],void(l.value=!1);l.value=!0,a.value=void 0;const r=++i,n=await(async e=>{const r=t.retryCount??0,n=t.retryInterval??1e3;let s=new Error("Unknown error");for(let a=0;a<=r;a++)try{return await t.api(e,o)}catch(l){s=v(l),a<r&&await new Promise(e=>setTimeout(e,n))}throw s})(e);if(r!==i)return;const c=await(async e=>"function"==typeof(null==t?void 0:t.formatter)?await t.formatter(e,o):e)(n);if(r!==i)return;s.value=c,a.value=void 0,"function"==typeof t.onSuccess&&t.onSuccess(c,o),l.value=!1}catch(e){const r=v(e);a.value=r,s.value=[],l.value=!1,"function"==typeof t.onError&&t.onError(r,o)}};(null==(n=t.dependsOn)?void 0:n.length)&&y(t.dependsOn,(e,n)=>{"function"==typeof t.onDepsChange&&t.onDepsChange(e,o),t.resetOnDepsChange&&r&&o.setFieldValue(r,void 0),u()});const d=t.immediate??!0;return e.onMounted(()=>{d&&u()}),{list:s,loading:l,error:a,loadDict:u,refresh:()=>u(),mutate:e=>{s.value=e}}},x=Symbol("schemx:form-config"),b=["form","modelValue","rendererRegistry","validatorRegistry","defaultRendererType","onFinish","onFinishFailed","onValuesChange","onFieldsChange"],F=t=>{e.provide(x,t)};function C(){const t=e.inject(x);if(!t)throw new Error("[schemx] useFormConfigContext() must be called inside a <SchemxForm> descendant. Ensure createFormConfigContext(props) is called synchronously during setup().");return t}function w(t){const r=e.shallowRef({});return e.watchEffect(()=>{const e=t();((e,t)=>{const r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every(r=>e[r]===t[r])})(r.value,e)||(r.value=e)}),r}function V(t){const r=e.shallowRef(t.getViewSchemas()),n=t.subscribeViewSchemas(e=>{r.value=e});return e.onScopeDispose(n),r}function S(e){return void 0!==e&&(!Array.isArray(e)||0!==e.length)}function R(e,t){if(!t)return!1;return(Array.isArray(t)?t:[t]).some(t=>function(e){return{onBlur:"blur",onChange:"change",onSubmit:"submit",blur:"blur",change:"change",submit:"submit"}[e]??"submit"}(t)===e)}const _=e=>/[A-Z]/.test(e),k=e=>e.includes("-"),E=e=>e.replace(/([A-Z])/g,"-$1").toLowerCase(),A=e=>e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()),O=(e,t)=>{if(e[t])return e[t];const r=_(t)?E(t):k(t)?A(t):void 0;return r&&e[r]?e[r]:void 0},j=(e,t)=>{const r={},n=(o=String(e),(k(o)?A(o):o)+":");var o;const s=(e=>_(e)?E(e):e)(String(e))+":";for(const[l,a]of Object.entries(t))l.startsWith(n)?r[l.slice(n.length)]=a:l.startsWith(s)&&s!==n&&(r[l.slice(s.length)]=a);return r},B=e.defineComponent((r,{slots:n})=>{const o=e.ref(Boolean(r.schema.defaultCollapsed)),s=()=>{r.schema.collapsible&&(o.value=!o.value)};return()=>{const l=r.schema,a=Boolean(l.collapsible);return e.createVNode("div",{class:t("schemx-group",{"schemx-group--collapsed":o.value},l.class),style:l.style,"data-key":l.key},[l.label&&e.createVNode("div",{role:a?"button":void 0,tabindex:a?0:void 0,class:t("schemx-group__header",{"schemx-group__header--clickable":a}),onClick:s,onKeydown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),s())}},[e.createVNode("span",{class:"schemx-group__title"},[l.label]),a&&e.createVNode("span",{class:t("schemx-group__arrow",{"schemx-group__arrow--down":!o.value})},null)]),!o.value&&e.createVNode("div",{class:"schemx-group__body"},[l.children.map(t=>e.createVNode(N,{key:t.key,schema:t},n))])])}},{name:"SchemxGroup",props:{schema:{type:Object,required:!0}}}),N=e.defineComponent({name:"SchemxItem",props:{schema:{type:Object,required:!0}},setup:(t,{slots:r})=>()=>{const n=t.schema;return T(n)?e.h(B,{schema:n},r):e.h(P,{schema:n},r)}}),P=e.defineComponent({name:"SchemxFieldItem",props:{schema:{type:Object,required:!0}},setup(r,{slots:n}){const o=e.toRef(r,"schema"),s=c(),l=C(),a=()=>o.value,i=d(a().name);p(i);const u=e.computed(()=>{return e=a().validationTrigger,t=l.validationTrigger,r="onChange",S(e)?e:S(t)?t:r;var e,t,r}),m=e.computed(()=>{const e=a().visible&&!a().readonly&&!a().disabled,t=a().rules,r=Array.isArray(t)?(null==t?void 0:t.length)>0:!!a().rules;return e&&r}),h=e=>{var t,r;i.setValue(e),null==(r=null==(t=a().componentProps)?void 0:t.onChange)||r.call(t,e),m.value&&R("change",u.value)&&i.validate()},f=e=>{var t,r;null==(r=null==(t=a().componentProps)?void 0:t.onBlur)||r.call(t,e),m.value&&R("blur",u.value)&&i.validate()},y=w(()=>{const e=a();return{...e.componentProps,readonly:e.readonly,disabled:e.disabled,placeholder:e.placeholder,formItemProps:e,value:i.getValue(),onChange:h,onBlur:f,"onUpdate:value":e=>i.setValue(e)}}),v=()=>{const t=O(n,`${a().name}Label`);if(t)return t(a());const r=a().labelAlign||l.labelAlign,o=a().labelWidth||l.labelWidth,s=a().colon??l.colon;return e.createVNode("label",{class:"schemx-item__label",style:{width:o,textAlign:r}},[!a().required||a().disabled||a().readonly?null:e.createVNode("span",{class:"schemx-item__required"},[e.createTextVNode("*")]),e.createVNode("span",{class:"schemx-item__label-text"},[a().label,s?":":""])])},g=()=>{const t=s.getRenderer(a().componentType);if(!t)throw new Error(`[schemx] Can not find component renderer of "${a().componentType}".`);const r=j(W(a().name),n),o=e.h(t,y.value,r),l=O(n,`${a().name}Content`);return l?l({...a(),columnElement:o}):e.createVNode("div",{class:"schemx-item__control"},[o])},x=()=>{const t=O(n,`${a().name}Error`);return t?t({...a(),errors:i.error.value}):Array.isArray(i.error.value)&&0!==i.error.value.length?e.createVNode("div",{class:"schemx-item__error"},[i.error.value[0]]):null};return()=>{if(!a().visible)return null;const r=O(n,W(a().name));if(r)return r(a());const o=a().labelPosition||l.labelPosition;return e.createVNode("div",{class:t("schemx-item-wrapper"),style:a().style},[e.createVNode("div",{class:t("schemx-item",`schemx-item--label-${o}`,a().class,{"is-readonly":a().readonly,"is-disabled":a().disabled}),style:{...a().style??{}}},[v(),e.createVNode("div",{class:"schemx-item__content"},[g(),x()])])])}}}),T=e=>"group"===e.componentType,W=e=>Array.isArray(e)?e.map(e=>String(e)).join("."):String(e);function q(e){return!(!e||"group"===e.componentType||"visible"in e&&!1===e.visible)}function D(e,t,r){for(let n=t+r;n>=0&&n<e.length;n+=r)if(q(e[n]))return e[n]}const $=e.defineComponent({name:"SchemxForm",__name:"form",props:{class:{default:""},style:{type:[Boolean,null,String,Object,Array],default:()=>({})},required:{type:Boolean},readonly:{type:Boolean},disabled:{type:Boolean},visible:{type:Boolean,default:!0},labelIcon:{},labelAlign:{},labelPosition:{},labelWidth:{},contentAlign:{},validationTrigger:{},colon:{type:Boolean},modelValue:{default:()=>({})},initialValues:{default:()=>({})},schemas:{default:()=>[]},form:{default:void 0},rendererRegistry:{default:void 0},defaultRendererType:{},validatorRegistry:{default:void 0},onFinish:{type:Function,default:void 0},onFinishFailed:{type:Function,default:void 0},onValuesChange:{type:Function,default:void 0},onFieldsChange:{type:Function,default:void 0}},emits:["update:modelValue"],setup(t,{expose:o,emit:s}){const a=t,c=s;F(n.omit(a,b));const u=a.form?a.form:l({schemas:a.schemas,initialValues:Object.keys(a.modelValue).length>0?a.modelValue:a.initialValues,rendererRegistry:a.rendererRegistry,defaultRendererType:a.defaultRendererType,validatorRegistry:a.validatorRegistry,readonly:a.readonly,disabled:a.disabled,onFinish:async e=>{var t;null==(t=a.onFinish)||t.call(a,e)},onFinishFailed:async e=>{var t;null==(t=a.onFinishFailed)||t.call(a,e)},onValuesChange:(e,t)=>{var r;null==(r=a.onValuesChange)||r.call(a,e,t)},onFieldsChange:(e,t)=>{var r;null==(r=a.onFieldsChange)||r.call(a,e,t)}});i(u);let d=!1;e.watch(()=>a.modelValue,e=>{d=!0,u.setFieldsValue(e),d=!1});const m=r.createWatch(u,e=>{d||c("update:modelValue",e)});e.onUnmounted(m),e.watch(()=>a.schemas,e=>{u.setSchemas(e)},{deep:!1,immediate:!!a.form});const p=V(u),h=e=>{const{isFirst:t,isLast:r}=function(e,t){const r=e.findIndex(e=>e.key===t);return-1===r?{found:!1,isFirst:!1,isLast:!1}:q(e[r])?{found:!0,isFirst:!D(e,r,-1),isLast:!D(e,r,1)}:{found:!0,isFirst:!1,isLast:!1}}(p.value,e.key);return{"schemx-item-wrapper--first":t,"schemx-item-wrapper--last":r}};return e.watchEffect(()=>{u.updateDefaultProps(a)}),o({...u}),(t,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["schemx",a.class]),style:e.normalizeStyle(a.style)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(p),r=>(e.openBlock(),e.createBlock(e.unref(N),{key:r.key,schema:r,class:e.normalizeClass(h(r))},e.createSlots({_:2},[e.renderList(t.$slots,(r,n)=>({name:n,fn:e.withCtx(r=>[e.renderSlot(t.$slots,n,e.mergeProps({ref_for:!0},r??{}))])}))]),1032,["schema","class"]))),128))],6))}});const I=(L=$,U={install(e,t){e.component("SchemxForm",$)},FormItem:N},Object.assign(L,U));var L,U;exports.FormGroup=B,exports.FormItem=N,exports.WithRemoteOptions=function(t){return e.defineComponent({name:`WithRemoteOptions(${t.name||"Anonymous"})`,inheritAttrs:!1,props:{dict:{type:Object,default:void 0},fieldName:{type:[String,Array],default:void 0}},setup(r,{attrs:n,slots:o}){const s=r.fieldName??(r.dict?h().name:void 0),l=r.dict?g(r.dict,s):null,a=e.computed(()=>({...n,dict:r.dict,options:r.dict?null==l?void 0:l.list.value:n.options,loading:r.dict?null==l?void 0:l.loading.value:n.loading}));return()=>e.h(t,a.value,o)}})},exports.createFieldContext=p,exports.createFormConfigContext=F,exports.createFormContext=i,exports.default=I,exports.formConfigContextOmitKey=b,exports.rendererRegistry=o,exports.schemxForm=I,exports.useDictionary=g,exports.useEffect=function(t){const n=r.createEffect(t);return e.onUnmounted(n),n},exports.useField=d,exports.useFieldContext=h,exports.useForm=l,exports.useFormConfigContext=C,exports.useFormContext=c,exports.useStableRef=w,exports.useViewSchemas=V,exports.useWatch=f,exports.useWatchAll=function(e,t){return f(e,t)},exports.useWatchField=function(e,t,r){return f(e,t,r)},exports.useWatchFields=y,exports.validatorRegistry=s,Object.keys(r).forEach(e=>{"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>r[e]})});
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|