@mc20230601/keep-up 1.0.18 → 1.0.23
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/es/components/codeEditor/index.d.ts +3 -3
- package/es/{packages/components → components}/codeEditor/index.mjs +3 -3
- package/es/components/codeEditor/index.mjs.map +1 -0
- package/es/components/commonDrawer/index.mjs.map +1 -0
- package/es/components/commonLocations/constants.d.ts +28 -0
- package/es/components/commonLocations/constants.mjs +18 -0
- package/es/components/commonLocations/constants.mjs.map +1 -0
- package/es/components/commonLocations/index.d.ts +40 -0
- package/es/components/commonLocations/index.mjs +94 -0
- package/es/components/commonLocations/index.mjs.map +1 -0
- package/es/components/commonLocations/index.module.mjs +4 -0
- package/es/components/commonLocations/index.module.mjs.map +1 -0
- package/es/components/commonLocations/interfaces.d.ts +100 -0
- package/es/components/commonLocations/interfaces.mjs +2 -0
- package/es/components/commonLocations/interfaces.mjs.map +1 -0
- package/es/components/commonLocations/useLocations.d.ts +2 -0
- package/es/components/commonLocations/useLocations.mjs +151 -0
- package/es/components/commonLocations/useLocations.mjs.map +1 -0
- package/es/components/commonLocations/utils.d.ts +14 -0
- package/es/components/commonLocations/utils.mjs +73 -0
- package/es/components/commonLocations/utils.mjs.map +1 -0
- package/es/components/formilyCmps/formTab/index.d.ts +83 -0
- package/es/components/formilyCmps/formTab/index.mjs +146 -0
- package/es/components/formilyCmps/formTab/index.mjs.map +1 -0
- package/es/components/formilyCmps/formilyForm/constants.d.ts +39 -0
- package/es/components/formilyCmps/formilyForm/constants.mjs +41 -0
- package/es/components/formilyCmps/formilyForm/constants.mjs.map +1 -0
- package/es/components/formilyCmps/formilyForm/index.d.ts +131 -0
- package/es/components/formilyCmps/formilyForm/index.mjs +148 -0
- package/es/components/formilyCmps/formilyForm/index.mjs.map +1 -0
- package/es/components/formilyCmps/formilyForm/index.module.mjs +4 -0
- package/es/components/formilyCmps/formilyForm/index.module.mjs.map +1 -0
- package/es/components/formilyCmps/formilyForm/interfaces.d.ts +28 -0
- package/es/components/formilyCmps/formilyForm/interfaces.mjs +2 -0
- package/es/components/formilyCmps/formilyForm/interfaces.mjs.map +1 -0
- package/es/components/formilyCmps/formilyForm/utils.d.ts +3 -0
- package/es/components/formilyCmps/formilyForm/utils.mjs +14 -0
- package/es/components/formilyCmps/formilyForm/utils.mjs.map +1 -0
- package/es/components/formilyCmps/index.d.ts +3 -0
- package/es/components/formilyCmps/index.mjs +3 -0
- package/es/components/formilyCmps/sectionTitle/index.d.ts +28 -0
- package/es/components/formilyCmps/sectionTitle/index.mjs +30 -0
- package/es/components/formilyCmps/sectionTitle/index.mjs.map +1 -0
- package/es/components/formilyCmps/sectionTitle/index.module.mjs +4 -0
- package/es/components/formilyCmps/sectionTitle/index.module.mjs.map +1 -0
- package/es/components/index.d.ts +3 -0
- package/es/components/index.mjs +7 -0
- package/es/{packages/interfaces → components}/index.mjs.map +1 -1
- package/es/components/radioGroup/constants.d.ts +371 -0
- package/es/components/radioGroup/constants.mjs +11 -0
- package/es/components/radioGroup/constants.mjs.map +1 -0
- package/es/components/radioGroup/index.d.ts +203 -0
- package/es/components/radioGroup/index.mjs +60 -0
- package/es/components/radioGroup/index.mjs.map +1 -0
- package/es/components/radioGroup/interfaces.d.ts +7 -0
- package/es/components/radioGroup/interfaces.mjs +2 -0
- package/es/components/radioGroup/interfaces.mjs.map +1 -0
- package/es/components/space/index.d.ts +61 -0
- package/es/components/space/index.mjs +59 -0
- package/es/components/space/index.mjs.map +1 -0
- package/es/constants/common.d.ts +1 -1
- package/es/constants/common.mjs.map +1 -0
- package/es/index.d.ts +5 -1
- package/es/index.mjs +6 -2
- package/es/index.mjs.map +1 -1
- package/es/styles/index.css +52 -0
- package/es/utils/common.d.ts +1 -1
- package/es/utils/common.mjs.map +1 -0
- package/es/{packages/utils → utils}/emitter.mjs +1 -1
- package/es/utils/emitter.mjs.map +1 -0
- package/es/utils/shared.mjs.map +1 -0
- package/es/utils/storage.mjs.map +1 -0
- package/package.json +1 -2
- package/es/_virtual/ace.mjs +0 -4
- package/es/_virtual/ace.mjs.map +0 -1
- package/es/_virtual/mode-javascript.mjs +0 -4
- package/es/_virtual/mode-javascript.mjs.map +0 -1
- package/es/_virtual/theme-monokai.mjs +0 -4
- package/es/_virtual/theme-monokai.mjs.map +0 -1
- package/es/constants/index.d.ts +0 -0
- package/es/node_modules/.pnpm/ace-builds@1.43.5/node_modules/ace-builds/src-noconflict/ace.mjs +0 -21889
- package/es/node_modules/.pnpm/ace-builds@1.43.5/node_modules/ace-builds/src-noconflict/ace.mjs.map +0 -1
- package/es/node_modules/.pnpm/ace-builds@1.43.5/node_modules/ace-builds/src-noconflict/mode-javascript.mjs +0 -1186
- package/es/node_modules/.pnpm/ace-builds@1.43.5/node_modules/ace-builds/src-noconflict/mode-javascript.mjs.map +0 -1
- package/es/node_modules/.pnpm/ace-builds@1.43.5/node_modules/ace-builds/src-noconflict/theme-monokai.mjs +0 -22
- package/es/node_modules/.pnpm/ace-builds@1.43.5/node_modules/ace-builds/src-noconflict/theme-monokai.mjs.map +0 -1
- package/es/node_modules/.pnpm/mitt@3.0.1/node_modules/mitt/dist/mitt.mjs +0 -4
- package/es/node_modules/.pnpm/mitt@3.0.1/node_modules/mitt/dist/mitt.mjs.map +0 -1
- package/es/packages/components/codeEditor/index.mjs.map +0 -1
- package/es/packages/components/commonDrawer/index.mjs.map +0 -1
- package/es/packages/components/index.mjs +0 -3
- package/es/packages/constants/common.mjs.map +0 -1
- package/es/packages/interfaces/index.mjs +0 -2
- package/es/packages/utils/common.mjs.map +0 -1
- package/es/packages/utils/emitter.mjs.map +0 -1
- package/es/packages/utils/shared.mjs.map +0 -1
- package/es/packages/utils/storage.mjs.map +0 -1
- /package/es/{packages/components → components}/commonDrawer/index.mjs +0 -0
- /package/es/{packages/components → components}/commonDrawer/index.module.mjs +0 -0
- /package/es/{packages/components → components}/commonDrawer/index.module.mjs.map +0 -0
- /package/es/{packages/components → components}/commonDrawer/interfaces.mjs +0 -0
- /package/es/{packages/components → components}/commonDrawer/interfaces.mjs.map +0 -0
- /package/es/{packages/components → components/formilyCmps}/index.mjs.map +0 -0
- /package/es/{packages/constants → constants}/common.mjs +0 -0
- /package/es/{packages/interfaces → interfaces}/common.mjs +0 -0
- /package/es/{packages/interfaces → interfaces}/common.mjs.map +0 -0
- /package/es/{packages/interfaces → interfaces}/commonPage.mjs +0 -0
- /package/es/{packages/interfaces → interfaces}/commonPage.mjs.map +0 -0
- /package/es/{packages/constants → interfaces}/index.mjs +0 -0
- /package/es/{packages/constants → interfaces}/index.mjs.map +0 -0
- /package/es/{packages/utils → utils}/common.mjs +0 -0
- /package/es/{packages/utils → utils}/index.mjs +0 -0
- /package/es/{packages/utils → utils}/index.mjs.map +0 -0
- /package/es/{packages/utils → utils}/shared.mjs +0 -0
- /package/es/{packages/utils → utils}/storage.mjs +0 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { defineComponent, ref, onUnmounted, createVNode } from 'vue';
|
|
2
|
+
import { createForm } from '@formily/core';
|
|
3
|
+
import { createSchemaField, FormProvider } from '@formily/vue';
|
|
4
|
+
import { Form, FormItem, FormDrawer, FormStep, FormCollapse, FormGrid, FormLayout, Space, Input, InputNumber, Password, PreviewText, Radio, Select, Cascader, Checkbox, DatePicker, Switch, TimePicker, Transfer, Upload, ArrayCards, ArrayCollapse, ArrayItems, ArrayTable, ArrayTabs, FormButtonGroup, Submit } from '@formily/element-plus';
|
|
5
|
+
import { ElTree, ElButton } from 'element-plus';
|
|
6
|
+
import { formEffectsMap, fieldEffectsMap } from './constants.mjs';
|
|
7
|
+
import { fetchOptions } from './utils.mjs';
|
|
8
|
+
import stylus from './index.module.mjs';
|
|
9
|
+
|
|
10
|
+
const props = {
|
|
11
|
+
/** schema配置 */
|
|
12
|
+
config: {
|
|
13
|
+
type: Object,
|
|
14
|
+
default: () => ({})
|
|
15
|
+
},
|
|
16
|
+
/** 初始值 */
|
|
17
|
+
initialValues: {
|
|
18
|
+
type: Object,
|
|
19
|
+
default: () => ({})
|
|
20
|
+
},
|
|
21
|
+
/** effectHooks */
|
|
22
|
+
effectHooks: {
|
|
23
|
+
type: Object,
|
|
24
|
+
default: () => ({})
|
|
25
|
+
},
|
|
26
|
+
/** effects 原生effects,满足高阶场景 */
|
|
27
|
+
effects: {
|
|
28
|
+
type: Function,
|
|
29
|
+
default: void 0
|
|
30
|
+
},
|
|
31
|
+
/** 需要注册的组件 */
|
|
32
|
+
components: {
|
|
33
|
+
type: Object,
|
|
34
|
+
default: () => ({})
|
|
35
|
+
},
|
|
36
|
+
/** 额外能力 */
|
|
37
|
+
scope: {
|
|
38
|
+
type: Object,
|
|
39
|
+
default: () => ({})
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var index = defineComponent({
|
|
43
|
+
name: "FormilyForm",
|
|
44
|
+
inheritAttrs: true,
|
|
45
|
+
props,
|
|
46
|
+
setup(props2, {
|
|
47
|
+
expose,
|
|
48
|
+
slots
|
|
49
|
+
}) {
|
|
50
|
+
const containerRef = ref();
|
|
51
|
+
const commonEffects = (effect) => {
|
|
52
|
+
return effect;
|
|
53
|
+
};
|
|
54
|
+
const wrapEffects = (form) => {
|
|
55
|
+
if (props2.effects && typeof props2.effects === "function") {
|
|
56
|
+
props2.effects(form);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const {
|
|
60
|
+
formEffects = {},
|
|
61
|
+
fieldEffects = {}
|
|
62
|
+
} = props2.effectHooks;
|
|
63
|
+
Object.entries(formEffects).forEach(([k, fn]) => {
|
|
64
|
+
var _a, _b;
|
|
65
|
+
(_b = (_a = formEffectsMap)[k]) == null ? void 0 : _b.call(_a, commonEffects(fn));
|
|
66
|
+
});
|
|
67
|
+
Object.entries(fieldEffects).forEach(([k, v]) => {
|
|
68
|
+
Object.entries(v).forEach(([effectKey, fn]) => {
|
|
69
|
+
var _a, _b;
|
|
70
|
+
(_b = (_a = fieldEffectsMap)[effectKey]) == null ? void 0 : _b.call(_a, k, commonEffects(fn));
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
const formRef = createForm({
|
|
75
|
+
initialValues: props2.initialValues,
|
|
76
|
+
effects: wrapEffects
|
|
77
|
+
});
|
|
78
|
+
const {
|
|
79
|
+
SchemaField
|
|
80
|
+
} = createSchemaField({
|
|
81
|
+
scope: props2.scope,
|
|
82
|
+
components: {
|
|
83
|
+
Form,
|
|
84
|
+
FormItem,
|
|
85
|
+
FormDrawer,
|
|
86
|
+
FormStep,
|
|
87
|
+
FormCollapse,
|
|
88
|
+
FormGrid,
|
|
89
|
+
FormLayout,
|
|
90
|
+
Space,
|
|
91
|
+
Input,
|
|
92
|
+
InputNumber,
|
|
93
|
+
Password,
|
|
94
|
+
PreviewText,
|
|
95
|
+
Radio,
|
|
96
|
+
Select,
|
|
97
|
+
ElTree,
|
|
98
|
+
Cascader,
|
|
99
|
+
Checkbox,
|
|
100
|
+
DatePicker,
|
|
101
|
+
Switch,
|
|
102
|
+
TimePicker,
|
|
103
|
+
Transfer,
|
|
104
|
+
Upload,
|
|
105
|
+
ArrayCards,
|
|
106
|
+
ArrayCollapse,
|
|
107
|
+
ArrayItems,
|
|
108
|
+
ArrayTable,
|
|
109
|
+
ArrayTabs,
|
|
110
|
+
FormButtonGroup,
|
|
111
|
+
Submit,
|
|
112
|
+
ElButton,
|
|
113
|
+
...props2.components
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
onUnmounted(() => {
|
|
117
|
+
formRef == null ? void 0 : formRef.onUnmount();
|
|
118
|
+
});
|
|
119
|
+
expose({
|
|
120
|
+
formRef,
|
|
121
|
+
getContainerRef: () => containerRef.value
|
|
122
|
+
});
|
|
123
|
+
return () => createVNode("div", {
|
|
124
|
+
"ref": containerRef,
|
|
125
|
+
"class": stylus.container
|
|
126
|
+
}, [createVNode(FormProvider, {
|
|
127
|
+
"form": formRef
|
|
128
|
+
}, {
|
|
129
|
+
default: () => [createVNode(PreviewText.Placeholder, {
|
|
130
|
+
"value": "-"
|
|
131
|
+
}, {
|
|
132
|
+
default: () => {
|
|
133
|
+
var _a;
|
|
134
|
+
return [createVNode(SchemaField, {
|
|
135
|
+
"schema": props2.config,
|
|
136
|
+
"scope": {
|
|
137
|
+
...props2.scope,
|
|
138
|
+
fetchOptions
|
|
139
|
+
}
|
|
140
|
+
}, null), (_a = slots == null ? void 0 : slots.btnGroup) == null ? void 0 : _a.call(slots)];
|
|
141
|
+
}
|
|
142
|
+
})]
|
|
143
|
+
})]);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
export { index as default };
|
|
148
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/formilyCmps/formilyForm/index.tsx"],"sourcesContent":["import { defineComponent, ref, onUnmounted } from 'vue'\nimport { createForm } from '@formily/core'\nimport { createSchemaField, FormProvider } from '@formily/vue'\nimport {\n Form,\n FormItem,\n FormDrawer,\n FormStep,\n FormCollapse,\n FormGrid,\n FormLayout,\n Space,\n Input,\n InputNumber,\n Password,\n PreviewText,\n Radio,\n Select,\n Cascader,\n Checkbox,\n DatePicker,\n Switch,\n TimePicker,\n Transfer,\n Upload,\n ArrayCards,\n ArrayCollapse,\n ArrayItems,\n ArrayTable,\n ArrayTabs,\n FormButtonGroup,\n Submit,\n} from '@formily/element-plus'\nimport { ElButton, ElTree } from 'element-plus'\nimport { formEffectsMap, fieldEffectsMap } from './constants'\nimport { fetchOptions } from './utils'\nimport stylus from './index.module.scss'\n\nimport type { PropType } from 'vue'\nimport type { Form as IForm } from '@formily/core'\nimport type { ISchema } from '@formily/vue'\nimport type { IEffectHooks } from './interfaces'\n\nconst props = {\n /** schema配置 */\n config: {\n type: Object as PropType<ISchema>,\n default: () => ({}),\n },\n /** 初始值 */\n initialValues: {\n type: Object,\n default: () => ({}),\n },\n /** effectHooks */\n effectHooks: {\n type: Object as PropType<IEffectHooks>,\n default: () => ({}),\n },\n /** effects 原生effects,满足高阶场景 */\n effects: {\n type: Function,\n default: undefined,\n },\n /** 需要注册的组件 */\n components: {\n type: Object,\n default: () => ({}),\n },\n /** 额外能力 */\n scope: {\n type: Object,\n default: () => ({}),\n },\n}\n\nexport type * from './interfaces'\nexport default defineComponent({\n name: 'FormilyForm',\n inheritAttrs: true,\n props,\n setup(props, { expose, slots }) {\n const containerRef = ref()\n const commonEffects = (effect: Function | undefined) => {\n // 其他逻辑\n return effect\n }\n const wrapEffects = (form: IForm) => {\n if (props.effects && typeof props.effects === 'function') {\n props.effects(form)\n return\n }\n const { formEffects = {}, fieldEffects = {} } = props.effectHooks\n Object.entries(formEffects).forEach(([k, fn]) => {\n formEffectsMap[k]?.(commonEffects(fn))\n })\n Object.entries(fieldEffects).forEach(([k, v]) => {\n Object.entries(v).forEach(([effectKey, fn]) => {\n fieldEffectsMap[effectKey]?.(k, commonEffects(fn))\n })\n })\n }\n const formRef = createForm({\n initialValues: props.initialValues,\n effects: wrapEffects,\n })\n const { SchemaField } = createSchemaField({\n scope: props.scope,\n components: {\n Form,\n FormItem,\n FormDrawer,\n FormStep,\n FormCollapse,\n FormGrid,\n FormLayout,\n Space,\n Input,\n InputNumber,\n Password,\n PreviewText,\n Radio,\n Select,\n ElTree,\n Cascader,\n Checkbox,\n DatePicker,\n Switch,\n TimePicker,\n Transfer,\n Upload,\n ArrayCards,\n ArrayCollapse,\n ArrayItems,\n ArrayTable,\n ArrayTabs,\n FormButtonGroup,\n Submit,\n ElButton,\n ...props.components,\n },\n })\n onUnmounted(() => {\n formRef?.onUnmount()\n })\n expose({ formRef, getContainerRef: () => containerRef.value })\n return () => (\n <div ref={containerRef} class={stylus.container}>\n <FormProvider form={formRef}>\n <PreviewText.Placeholder value='-'>\n <SchemaField\n schema={props.config}\n scope={{\n ...props.scope,\n fetchOptions,\n }}\n />\n {slots?.btnGroup?.()}\n </PreviewText.Placeholder>\n </FormProvider>\n </div>\n )\n },\n})\n"],"names":["props","config","type","Object","default","initialValues","effectHooks","effects","Function","undefined","components","scope","defineComponent","name","inheritAttrs","setup","expose","slots","containerRef","ref","commonEffects","effect","wrapEffects","form","formEffects","fieldEffects","entries","forEach","k","fn","formEffectsMap","v","effectKey","fieldEffectsMap","formRef","createForm","SchemaField","createSchemaField","Form","FormItem","FormDrawer","FormStep","FormCollapse","FormGrid","FormLayout","Space","Input","InputNumber","Password","PreviewText","Radio","Select","ElTree","Cascader","Checkbox","DatePicker","Switch","TimePicker","Transfer","Upload","ArrayCards","ArrayCollapse","ArrayItems","ArrayTable","ArrayTabs","FormButtonGroup","Submit","ElButton","onUnmounted","onUnmount","getContainerRef","value","_createVNode","stylus","container","FormProvider","Placeholder","fetchOptions","btnGroup"],"mappings":";;;;;;;;;AA2CA,MAAMA,KAAQ,GAAA;AAAA;AAAA,EAEZC,MAAQ,EAAA;AAAA,IACNC,IAAMC,EAAAA,MAAAA;AAAAA,IACNC,OAAAA,EAASA,OAAO,EAAC,CAAA;AAAA,GACnB;AAAA;AAAA,EAEAC,aAAe,EAAA;AAAA,IACbH,IAAMC,EAAAA,MAAAA;AAAAA,IACNC,OAAAA,EAASA,OAAO,EAAC,CAAA;AAAA,GACnB;AAAA;AAAA,EAEAE,WAAa,EAAA;AAAA,IACXJ,IAAMC,EAAAA,MAAAA;AAAAA,IACNC,OAAAA,EAASA,OAAO,EAAC,CAAA;AAAA,GACnB;AAAA;AAAA,EAEAG,OAAS,EAAA;AAAA,IACPL,IAAMM,EAAAA,QAAAA;AAAAA,IACNJ,OAASK,EAAAA,KAAAA,CAAAA;AAAAA,GACX;AAAA;AAAA,EAEAC,UAAY,EAAA;AAAA,IACVR,IAAMC,EAAAA,MAAAA;AAAAA,IACNC,OAAAA,EAASA,OAAO,EAAC,CAAA;AAAA,GACnB;AAAA;AAAA,EAEAO,KAAO,EAAA;AAAA,IACLT,IAAMC,EAAAA,MAAAA;AAAAA,IACNC,OAAAA,EAASA,OAAO,EAAC,CAAA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AO6D,aAAP7D,IAAmB,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,KAAA,CAAA,CAAA,CAAA;AAAA,SAAA;AAAA,OAAA,CAAA,CAAA;AAAA,KAI3B,CAAA,CAAA,CAAA,CAAA;AAAA,GACH;AACF,CAAC,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.module.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { formEffectsMap, fieldEffectsMap } from './constants';
|
|
2
|
+
import type { Form } from '@formily/core';
|
|
3
|
+
/** formilyFormExpose */
|
|
4
|
+
export type IFormilyFormExpose = {
|
|
5
|
+
/** form实例 */
|
|
6
|
+
formRef: Form;
|
|
7
|
+
/** 获取container容器 */
|
|
8
|
+
getContainerRef: () => HTMLElement;
|
|
9
|
+
};
|
|
10
|
+
/** formEffectsMap【formily api】 */
|
|
11
|
+
export type IFormEffects = {
|
|
12
|
+
[K in keyof typeof formEffectsMap]?: typeof formEffectsMap[K];
|
|
13
|
+
};
|
|
14
|
+
/** fieldEffectsMap【formily api】 */
|
|
15
|
+
export type IFieldEffect = {
|
|
16
|
+
[K in keyof typeof fieldEffectsMap]?: typeof fieldEffectsMap[K];
|
|
17
|
+
};
|
|
18
|
+
/** IFieldEffectHooks【组件自定义】 */
|
|
19
|
+
export interface IFieldEffects {
|
|
20
|
+
[K: string]: IFieldEffect;
|
|
21
|
+
}
|
|
22
|
+
/** effectHooks【组件自定义】 */
|
|
23
|
+
export interface IEffectHooks {
|
|
24
|
+
/** IFormEffectHooks */
|
|
25
|
+
formEffects?: IFormEffects;
|
|
26
|
+
/** IFieldEffectHooks */
|
|
27
|
+
fieldEffects?: IFieldEffects;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const fetchOptions = async (field) => {
|
|
2
|
+
var _a;
|
|
3
|
+
try {
|
|
4
|
+
const { api, params: curParams, formatter, remote } = ((_a = field.componentProps) == null ? void 0 : _a.fetchConfig) || {};
|
|
5
|
+
const params = typeof curParams === "function" ? await curParams() : curParams;
|
|
6
|
+
const res = await (api == null ? void 0 : api(params));
|
|
7
|
+
field.dataSource = typeof formatter === "function" ? formatter(res) : res;
|
|
8
|
+
} catch (error) {
|
|
9
|
+
console.error(`\u83B7\u53D6options\u5931\u8D25\uFF0C\u5931\u8D25\u539F\u56E0\uFF1A${error}`);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { fetchOptions };
|
|
14
|
+
//# sourceMappingURL=utils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.mjs","sources":["../../../../../../packages/components/formilyCmps/formilyForm/utils.ts"],"sourcesContent":["import type { Field } from \"@formily/core\"\n\n/** 获取options */\nexport const fetchOptions = async (field: Field) => {\n try {\n const { api, params: curParams, formatter, remote } = field.componentProps?.fetchConfig || {} // TODO: 缺少实时获取数据功能\n const params = typeof curParams === 'function' ? await curParams() : curParams\n const res = await api?.(params)\n field.dataSource = typeof formatter === 'function' ? formatter(res) : res\n } catch (error: any) {\n console.error(`获取options失败,失败原因:${error}`)\n }\n}\n"],"names":[],"mappings":"AAGa,MAAA,YAAA,GAAe,OAAO,KAAiB,KAAA;AAHpD,EAAA,IAAA,EAAA,CAAA;AAIE,EAAI,IAAA;AACF,IAAM,MAAA,EAAE,GAAK,EAAA,MAAA,EAAQ,SAAW,EAAA,SAAA,EAAW,MAAO,EAAA,GAAA,CAAA,CAAI,EAAM,GAAA,KAAA,CAAA,cAAA,KAAN,IAAsB,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,WAAA,KAAe,EAAC,CAAA;AAC5F,IAAA,MAAM,SAAS,OAAO,SAAA,KAAc,UAAa,GAAA,MAAM,WAAc,GAAA,SAAA,CAAA;AACrE,IAAM,MAAA,GAAA,GAAM,OAAM,GAAM,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,GAAA,CAAA,MAAA,CAAA,CAAA,CAAA;AACxB,IAAA,KAAA,CAAM,aAAa,OAAO,SAAA,KAAc,UAAa,GAAA,SAAA,CAAU,GAAG,CAAI,GAAA,GAAA,CAAA;AAAA,WAC/D,KAAY,EAAA;AACnB,IAAQ,OAAA,CAAA,KAAA,CAAM,CAAoB,mEAAA,EAAA,KAAK,CAAE,CAAA,CAAA,CAAA;AAAA,GAC3C;AACF;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
/** 标题 */
|
|
4
|
+
title: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
/** 类型 */
|
|
9
|
+
type: {
|
|
10
|
+
type: PropType<"primary" | "danger">;
|
|
11
|
+
default: string;
|
|
12
|
+
};
|
|
13
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
14
|
+
/** 标题 */
|
|
15
|
+
title: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
/** 类型 */
|
|
20
|
+
type: {
|
|
21
|
+
type: PropType<"primary" | "danger">;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
}>> & Readonly<{}>, {
|
|
25
|
+
title: string;
|
|
26
|
+
type: "primary" | "danger";
|
|
27
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
28
|
+
export default _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineComponent, createVNode } from 'vue';
|
|
2
|
+
import styles from './index.module.mjs';
|
|
3
|
+
|
|
4
|
+
const props = {
|
|
5
|
+
/** 标题 */
|
|
6
|
+
title: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: ""
|
|
9
|
+
},
|
|
10
|
+
/** 类型 */
|
|
11
|
+
type: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: "primary"
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
var index = defineComponent({
|
|
17
|
+
name: "SectionTitle",
|
|
18
|
+
props,
|
|
19
|
+
setup(props2) {
|
|
20
|
+
return () => createVNode("div", {
|
|
21
|
+
"class": [styles.wrapper, {
|
|
22
|
+
[styles.primary]: props2.type === "primary",
|
|
23
|
+
[styles.danger]: props2.type === "danger"
|
|
24
|
+
}]
|
|
25
|
+
}, [props2.title]);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export { index as default };
|
|
30
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/formilyCmps/sectionTitle/index.tsx"],"sourcesContent":["import { defineComponent } from 'vue'\nimport styles from './index.module.scss'\n\nimport type { PropType } from 'vue'\n\nconst props = {\n /** 标题 */\n title: {\n type: String,\n default: '',\n },\n /** 类型 */\n type: {\n type: String as PropType<'primary' | 'danger'>,\n default: 'primary',\n },\n}\n\nexport default defineComponent({\n name: 'SectionTitle',\n props,\n setup(props) {\n return () => (\n <div\n class={[\n styles.wrapper,\n {\n [styles.primary]: props.type === 'primary',\n [styles.danger]: props.type === 'danger',\n },\n ]}\n >{props.title}</div>\n )\n },\n})\n"],"names":["props","title","type","String","default","defineComponent","name","setup","_createVNode","styles","wrapper","primary","danger"],"mappings":";;;AAKA,MAAMA,KAAQ,GAAA;AAAA;AAAA,EAEZC,KAAO,EAAA;AAAA,IACLC,IAAMC,EAAAA,MAAAA;AAAAA,IACNC,OAAS,EAAA,EAAA;AAAA,GACX;AAAA;AAAA,EAEAF,IAAM,EAAA;AAAA,IACJA,IAAMC,EAAAA,MAAAA;AAAAA,IACNC,OAAS,EAAA,SAAA;AAAA,GACX;AACF,CAAA,CAAA;AAEA,YAAeC,eAAgB,CAAA;AAAA,EAC7BC,IAAM,EAAA,cAAA;AAAA,EACNN,KAAAA;AAAAA,EACAO,MAAMP,MAAO,EAAA;AACX,IAAO,OAAA,MAAAQ,YAAA,KAAA,EAAA;AAAA,MAAA,OAAA,EAEI,CACLC,MAAAA,CAAOC,OACP,EAAA;AAAA,QACE,CAACD,MAAAA,CAAOE,OAAO,GAAGX,OAAME,IAAS,KAAA,SAAA;AAAA,QACjC,CAACO,MAAAA,CAAOG,MAAM,GAAGZ,OAAME,IAAS,KAAA,QAAA;AAAA,OACjC,CAAA;AAAA,KAEHF,EAAAA,CAAAA,MAAMC,CAAAA,KAAK,CACd,CAAA,CAAA;AAAA,GACH;AACF,CAAC,CAAA;;;;"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var styles = {"menuText":"#41464f","menuActiveText":"#007dff","subMenuActiveText":"#007dff","menuBg":"#f0f3f7","menuHover":"rgba(0, 125, 255, 0.1019607843)","subMenuBg":"#fff","subMenuHover":"#e6edfa","sideBarWidth":"220px","primaryColor":"#007dff","mainHorizontalPadding":"20px","wrapper":"index-module_wrapper__o-ooH","primary":"index-module_primary__-O491","danger":"index-module_danger__8-OdG"};
|
|
2
|
+
|
|
3
|
+
export { styles as default };
|
|
4
|
+
//# sourceMappingURL=index.module.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.module.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/es/components/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
export { default as CommonDrawer } from './commonDrawer';
|
|
2
2
|
export * from './commonDrawer';
|
|
3
|
+
export * from './formilyCmps';
|
|
3
4
|
export { default as CodeEditor } from './codeEditor';
|
|
5
|
+
export { default as RadioGroup } from './radioGroup';
|
|
6
|
+
export { default as Space } from './space';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as CommonDrawer } from './commonDrawer/index.mjs';
|
|
2
|
+
export { default as FormilyForm } from './formilyCmps/formilyForm/index.mjs';
|
|
3
|
+
export { composeFormTab as FormTab, composeFormTab } from './formilyCmps/formTab/index.mjs';
|
|
4
|
+
export { default as CodeEditor } from './codeEditor/index.mjs';
|
|
5
|
+
export { default as RadioGroup } from './radioGroup/index.mjs';
|
|
6
|
+
export { default as Space } from './space/index.mjs';
|
|
7
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|