MCPcopy
hub / github.com/xaboy/form-create / FormCreateFactory

Function FormCreateFactory

packages/core/src/frame/index.js:58–794  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

56
57//todo 表单嵌套
58export default function FormCreateFactory(config) {
59
60 const components = {
61 [fragment.name]: fragment
62 };
63 const parsers = {};
64 const directives = {};
65 const modelFields = {};
66 const drivers = {};
67 const useApps = [];
68 const listener = [];
69 const extendApiFn = [
70 config.extendApi
71 ];
72 const providers = {
73 ...$provider
74 };
75 const maker = makerFactory();
76 let globalConfig = {global: {}};
77 const isMobile = config.isMobile === true;
78 const loadData = reactive({
79 $mobile: isMobile,
80 });
81 const CreateNode = CreateNodeFactory();
82 const formulas = {};
83 const prototype = {};
84
85 exportAttrs(config.attrs || {});
86
87 function getApi(name) {
88 const val = instance[name];
89 if (Array.isArray(val)) {
90 return val.map(v => {
91 return v.api();
92 });
93 } else if (val) {
94 return val.api();
95 }
96 }
97
98 function useApp(fn) {
99 useApps.push(fn);
100 }
101
102 function directive() {
103 const data = nameProp(...arguments);
104 if (data.id && data.prop) directives[data.id] = data.prop;
105 }
106
107 function register() {
108 const data = nameProp(...arguments);
109 if (data.id && data.prop) providers[data.id] = is.Function(data.prop) ? data.prop : {
110 ...data.prop,
111 name: data.id
112 };
113 }
114
115 function componentAlias(alias) {

Callers 9

tinyVueFormCreateFunction · 0.85
arcoFormCreateFunction · 0.85
factoryFunction · 0.85
VantFormCreateFunction · 0.85
elmFormCreateFunction · 0.85
elmFormCreateFunction · 0.85
antdvNextFormCreateFunction · 0.85
naiveFormCreateFunction · 0.85
antdvFormCreateFunction · 0.85

Calls 12

CreateNodeFactoryFunction · 0.90
setPrototypeOfFunction · 0.90
makerFactoryFunction · 0.85
exportAttrsFunction · 0.85
extendFunction · 0.85
useAttrFunction · 0.85
useStaticFunction · 0.85
setDataDriverFunction · 0.85
useAppFunction · 0.85
parserFunction · 0.85
$formFunction · 0.85
useMethod · 0.80

Tested by

no test coverage detected