@houaoran/designer 1.0.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/LICENSE +21 -0
- package/README.md +98 -0
- package/dist/components.es.js +11424 -0
- package/dist/components.umd.js +878 -0
- package/dist/index.es.js +39113 -0
- package/dist/index.umd.js +1187 -0
- package/package.json +96 -0
- package/src/components/DragBox.vue +49 -0
- package/src/components/DragTool.vue +235 -0
- package/src/components/EventConfig.vue +557 -0
- package/src/components/FcDesigner.vue +2569 -0
- package/src/components/FcTitle.vue +69 -0
- package/src/components/FetchConfig.vue +415 -0
- package/src/components/FieldInput.vue +371 -0
- package/src/components/FnConfig.vue +315 -0
- package/src/components/FnEditor.vue +327 -0
- package/src/components/FnInput.vue +103 -0
- package/src/components/FormLabel.vue +47 -0
- package/src/components/HtmlEditor.vue +125 -0
- package/src/components/JsonPreview.vue +146 -0
- package/src/components/OptionsTextInput.vue +151 -0
- package/src/components/PropsInput.vue +72 -0
- package/src/components/Required.vue +75 -0
- package/src/components/Row.vue +26 -0
- package/src/components/SignaturePad.vue +176 -0
- package/src/components/Struct.vue +153 -0
- package/src/components/StructEditor.vue +121 -0
- package/src/components/StructTree.vue +209 -0
- package/src/components/TableOptions.vue +164 -0
- package/src/components/TreeOptions.vue +167 -0
- package/src/components/TypeSelect.vue +144 -0
- package/src/components/Validate.vue +302 -0
- package/src/components/ValueInput.vue +89 -0
- package/src/components/Warning.vue +46 -0
- package/src/components/ai/AiPanel.vue +1122 -0
- package/src/components/ai/MarkdownRenderer.vue +548 -0
- package/src/components/language/LanguageConfig.vue +174 -0
- package/src/components/language/LanguageInput.vue +191 -0
- package/src/components/style/BackgroundInput.vue +315 -0
- package/src/components/style/BorderInput.vue +242 -0
- package/src/components/style/BoxSizeInput.vue +166 -0
- package/src/components/style/BoxSpaceInput.vue +269 -0
- package/src/components/style/ColorInput.vue +90 -0
- package/src/components/style/ConfigItem.vue +118 -0
- package/src/components/style/FontInput.vue +197 -0
- package/src/components/style/PositionInput.vue +146 -0
- package/src/components/style/RadiusInput.vue +164 -0
- package/src/components/style/ShadowContent.vue +335 -0
- package/src/components/style/ShadowInput.vue +91 -0
- package/src/components/style/SizeInput.vue +118 -0
- package/src/components/style/StyleConfig.vue +307 -0
- package/src/components/table/Table.vue +252 -0
- package/src/components/table/TableView.vue +1058 -0
- package/src/components/tableForm/TableForm.vue +471 -0
- package/src/components/tableForm/TableFormColumnView.vue +103 -0
- package/src/components/tableForm/TableFormView.vue +46 -0
- package/src/components/tree/FcTree.vue +713 -0
- package/src/components/tree/FcTreeNode.vue +216 -0
- package/src/config/base/field.js +43 -0
- package/src/config/base/form.js +132 -0
- package/src/config/base/style.js +26 -0
- package/src/config/base/validate.js +15 -0
- package/src/config/index.js +70 -0
- package/src/config/menu.js +24 -0
- package/src/config/rule/alert.js +45 -0
- package/src/config/rule/button.js +49 -0
- package/src/config/rule/card.js +40 -0
- package/src/config/rule/cascader.js +121 -0
- package/src/config/rule/checkbox.js +68 -0
- package/src/config/rule/col.js +86 -0
- package/src/config/rule/collapse.js +30 -0
- package/src/config/rule/collapseItem.js +36 -0
- package/src/config/rule/color.js +53 -0
- package/src/config/rule/date.js +66 -0
- package/src/config/rule/dateRange.js +60 -0
- package/src/config/rule/divider.js +31 -0
- package/src/config/rule/editor.js +31 -0
- package/src/config/rule/group.js +86 -0
- package/src/config/rule/html.js +43 -0
- package/src/config/rule/image.js +32 -0
- package/src/config/rule/input.js +62 -0
- package/src/config/rule/number.js +49 -0
- package/src/config/rule/password.js +52 -0
- package/src/config/rule/radio.js +43 -0
- package/src/config/rule/rate.js +44 -0
- package/src/config/rule/row.js +46 -0
- package/src/config/rule/select.js +70 -0
- package/src/config/rule/signaturePad.js +59 -0
- package/src/config/rule/slider.js +53 -0
- package/src/config/rule/space.js +44 -0
- package/src/config/rule/subForm.js +47 -0
- package/src/config/rule/switch.js +46 -0
- package/src/config/rule/tabPane.js +29 -0
- package/src/config/rule/table.js +37 -0
- package/src/config/rule/tableForm.js +115 -0
- package/src/config/rule/tableFormColumn.js +55 -0
- package/src/config/rule/tabs.js +38 -0
- package/src/config/rule/tag.js +69 -0
- package/src/config/rule/text.js +41 -0
- package/src/config/rule/textarea.js +63 -0
- package/src/config/rule/time.js +58 -0
- package/src/config/rule/timeRange.js +49 -0
- package/src/config/rule/title.js +37 -0
- package/src/config/rule/transfer.js +59 -0
- package/src/config/rule/tree.js +70 -0
- package/src/config/rule/treeSelect.js +77 -0
- package/src/config/rule/upload.js +107 -0
- package/src/form/index.js +19 -0
- package/src/index.js +173 -0
- package/src/locale/en.js +981 -0
- package/src/locale/zh-cn.js +983 -0
- package/src/style/fonts/fc-icons.woff +0 -0
- package/src/style/icon.css +1052 -0
- package/src/style/index.css +836 -0
- package/src/utils/form.js +9 -0
- package/src/utils/highlight/highlight.min.js +307 -0
- package/src/utils/highlight/javascript.min.js +80 -0
- package/src/utils/highlight/style.css +1 -0
- package/src/utils/highlight/xml.min.js +29 -0
- package/src/utils/hintStubs.js +120 -0
- package/src/utils/index.js +544 -0
- package/src/utils/jsonDiff.js +173 -0
- package/src/utils/locale.js +23 -0
- package/src/utils/message.js +19 -0
- package/src/utils/template.js +105 -0
- package/types/index.d.ts +575 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import uniqueId from '@form-create/utils/lib/unique';
|
|
2
|
+
import {localeProps, makeTreeOptions, makeTreeOptionsRule} from '../../utils';
|
|
3
|
+
|
|
4
|
+
const label = '穿梭框';
|
|
5
|
+
const name = 'elTransfer';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
menu: 'main',
|
|
9
|
+
icon: 'icon-transfer',
|
|
10
|
+
label,
|
|
11
|
+
name,
|
|
12
|
+
input: true,
|
|
13
|
+
event: ['change', 'leftCheckChange', 'rightCheckChange'],
|
|
14
|
+
validate: ['string', 'number', 'array'],
|
|
15
|
+
rule({t}) {
|
|
16
|
+
return {
|
|
17
|
+
type: name,
|
|
18
|
+
field: uniqueId(),
|
|
19
|
+
title: t('com.elTransfer.name'),
|
|
20
|
+
info: '',
|
|
21
|
+
$required: false,
|
|
22
|
+
props: {
|
|
23
|
+
data: makeTreeOptions(t('props.option'), {label: 'label', value: 'key'}, 1)
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
props(_, {t}) {
|
|
28
|
+
return localeProps(t, name + '.props', [
|
|
29
|
+
makeTreeOptionsRule(t, 'props.data', 'label', 'key'),
|
|
30
|
+
{type: 'switch', field: 'filterable'}, {
|
|
31
|
+
type: 'input',
|
|
32
|
+
field: 'filterPlaceholder'
|
|
33
|
+
}, {
|
|
34
|
+
type: 'select',
|
|
35
|
+
field: 'targetOrder',
|
|
36
|
+
warning: t('com.elTransfer.props.targetOrderInfo'),
|
|
37
|
+
options: [{label: 'original', value: 'original'}, {
|
|
38
|
+
label: 'push',
|
|
39
|
+
value: 'push'
|
|
40
|
+
}, {label: 'unshift', value: 'unshift'}]
|
|
41
|
+
}, {
|
|
42
|
+
type: 'TableOptions',
|
|
43
|
+
field: 'titles',
|
|
44
|
+
props: {
|
|
45
|
+
column: [{label: t('props.value'), key: 'value'}],
|
|
46
|
+
valueType: 'string',
|
|
47
|
+
max: 2,
|
|
48
|
+
}
|
|
49
|
+
}, {
|
|
50
|
+
type: 'TableOptions',
|
|
51
|
+
field: 'buttonTexts',
|
|
52
|
+
props: {
|
|
53
|
+
column: [{label: t('props.value'), key: 'value'}],
|
|
54
|
+
valueType: 'string',
|
|
55
|
+
max: 2,
|
|
56
|
+
}
|
|
57
|
+
}]);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import uniqueId from '@form-create/utils/lib/unique';
|
|
2
|
+
import {localeProps, makeTreeOptions, makeTreeOptionsRule} from '../../utils/index';
|
|
3
|
+
|
|
4
|
+
const label = '树形控件';
|
|
5
|
+
const name = 'tree';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
menu: 'main',
|
|
9
|
+
icon: 'icon-tree',
|
|
10
|
+
label,
|
|
11
|
+
name,
|
|
12
|
+
input: true,
|
|
13
|
+
event: ['nodeClick', 'nodeContextmenu', 'checkChange', 'check', 'currentChange', 'nodeExpand', 'nodeCollapse', 'nodeDragStart', 'nodeDragEnter', 'nodeDragLeave', 'nodeDragOver', 'nodeDragEnd', 'nodeDrop'],
|
|
14
|
+
validate: ['string', 'number', 'array'],
|
|
15
|
+
rule({t}) {
|
|
16
|
+
return {
|
|
17
|
+
type: name,
|
|
18
|
+
field: uniqueId(),
|
|
19
|
+
title: t('com.tree.name'),
|
|
20
|
+
info: '',
|
|
21
|
+
effect: {
|
|
22
|
+
fetch: ''
|
|
23
|
+
},
|
|
24
|
+
$required: false,
|
|
25
|
+
props: {
|
|
26
|
+
props: {
|
|
27
|
+
label: 'label',
|
|
28
|
+
},
|
|
29
|
+
showCheckbox: true,
|
|
30
|
+
nodeKey: 'id',
|
|
31
|
+
data: makeTreeOptions(t('props.option'), {label: 'label', value: 'id'}, 3),
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
props(_, {t}) {
|
|
36
|
+
return localeProps(t, name + '.props', [
|
|
37
|
+
makeTreeOptionsRule(t, 'props.data', 'label', 'id'),
|
|
38
|
+
{type: 'input', field: 'emptyText'}, {
|
|
39
|
+
type: 'TableOptions',
|
|
40
|
+
field: 'props',
|
|
41
|
+
props: {
|
|
42
|
+
column: [{label: t('props.key'), key: 'label'}, {label: t('props.value'), key: 'value'}],
|
|
43
|
+
valueType: 'object'
|
|
44
|
+
}
|
|
45
|
+
}, {
|
|
46
|
+
type: 'switch',
|
|
47
|
+
field: 'renderAfterExpand',
|
|
48
|
+
value: true
|
|
49
|
+
}, {
|
|
50
|
+
type: 'switch',
|
|
51
|
+
field: 'defaultExpandAll',
|
|
52
|
+
}, {
|
|
53
|
+
type: 'switch',
|
|
54
|
+
field: 'expandOnClickNode',
|
|
55
|
+
value: true
|
|
56
|
+
}, {
|
|
57
|
+
type: 'switch',
|
|
58
|
+
field: 'checkOnClickNode'
|
|
59
|
+
}, {type: 'switch', field: 'autoExpandParent', value: true}, {
|
|
60
|
+
type: 'switch',
|
|
61
|
+
field: 'checkStrictly'
|
|
62
|
+
}, {type: 'switch', field: 'accordion'}, {
|
|
63
|
+
type: 'inputNumber',
|
|
64
|
+
field: 'indent'
|
|
65
|
+
}, {
|
|
66
|
+
type: 'input',
|
|
67
|
+
field: 'nodeKey'
|
|
68
|
+
}]);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import uniqueId from '@form-create/utils/lib/unique';
|
|
2
|
+
import {localeProps, makeTreeOptions, makeTreeOptionsRule} from '../../utils/index';
|
|
3
|
+
|
|
4
|
+
const label = '树形选择';
|
|
5
|
+
const name = 'elTreeSelect';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
menu: 'main',
|
|
9
|
+
icon: 'icon-tree-select',
|
|
10
|
+
label,
|
|
11
|
+
name,
|
|
12
|
+
input: true,
|
|
13
|
+
event: ['change', 'visibleChange', 'removeTag', 'clear', 'blur', 'focus'],
|
|
14
|
+
validate: ['string', 'number', 'array'],
|
|
15
|
+
rule({t}) {
|
|
16
|
+
return {
|
|
17
|
+
type: name,
|
|
18
|
+
field: uniqueId(),
|
|
19
|
+
title: t('com.elTreeSelect.name'),
|
|
20
|
+
info: '',
|
|
21
|
+
effect: {
|
|
22
|
+
fetch: ''
|
|
23
|
+
},
|
|
24
|
+
$required: false,
|
|
25
|
+
props: {
|
|
26
|
+
nodeKey: 'value',
|
|
27
|
+
showCheckbox: true,
|
|
28
|
+
data: makeTreeOptions(t('props.option'), {label: 'label', value: 'value'}, 3),
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
watch: {
|
|
33
|
+
multiple({rule}) {
|
|
34
|
+
rule.key = uniqueId();
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
props(_, {t}) {
|
|
38
|
+
return localeProps(t, name + '.props', [
|
|
39
|
+
makeTreeOptionsRule(t, 'props.data', 'label', 'value'),
|
|
40
|
+
{type: 'switch', field: 'multiple'}, {
|
|
41
|
+
type: 'switch',
|
|
42
|
+
field: 'disabled'
|
|
43
|
+
}, {type: 'switch', field: 'clearable'}, {
|
|
44
|
+
type: 'switch',
|
|
45
|
+
field: 'collapseTags'
|
|
46
|
+
}, {
|
|
47
|
+
type: 'inputNumber',
|
|
48
|
+
field: 'multipleLimit',
|
|
49
|
+
props: {min: 0}
|
|
50
|
+
}, {type: 'input', field: 'placeholder'},
|
|
51
|
+
{
|
|
52
|
+
type: 'TableOptions',
|
|
53
|
+
field: 'props',
|
|
54
|
+
props: {
|
|
55
|
+
column: [{label: t('props.key'), key: 'label'}, {label: t('props.value'), key: 'value'}],
|
|
56
|
+
valueType: 'object'
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
59
|
+
type: 'switch',
|
|
60
|
+
field: 'renderAfterExpand',
|
|
61
|
+
value: true
|
|
62
|
+
}, {
|
|
63
|
+
type: 'switch',
|
|
64
|
+
field: 'defaultExpandAll',
|
|
65
|
+
}, {
|
|
66
|
+
type: 'switch',
|
|
67
|
+
field: 'expandOnClickNode',
|
|
68
|
+
value: true
|
|
69
|
+
}, {
|
|
70
|
+
type: 'switch',
|
|
71
|
+
field: 'checkOnClickNode'
|
|
72
|
+
}, {
|
|
73
|
+
type: 'input',
|
|
74
|
+
field: 'nodeKey'
|
|
75
|
+
}]);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import uniqueId from '@form-create/utils/lib/unique';
|
|
2
|
+
import {getInjectArg, localeOptions, localeProps} from '../../utils';
|
|
3
|
+
|
|
4
|
+
const label = '上传';
|
|
5
|
+
const name = 'upload';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
menu: 'main',
|
|
9
|
+
icon: 'icon-upload',
|
|
10
|
+
label,
|
|
11
|
+
name,
|
|
12
|
+
input: true,
|
|
13
|
+
event: ['change', 'remove', 'preview', 'error', 'progress', 'exceed'],
|
|
14
|
+
languageKey: ['clickToUpload'],
|
|
15
|
+
validate: ['array'],
|
|
16
|
+
rule({t}) {
|
|
17
|
+
return {
|
|
18
|
+
type: name,
|
|
19
|
+
field: uniqueId(),
|
|
20
|
+
title: t('com.upload.name'),
|
|
21
|
+
info: '',
|
|
22
|
+
$required: false,
|
|
23
|
+
props: {
|
|
24
|
+
action: '/',
|
|
25
|
+
onSuccess: '$FNX:const res = $inject.args[0];\nconst file = $inject.args[1];\n\nfile.url = res.data.url;'
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
props(_, {t}) {
|
|
30
|
+
return localeProps(t, name + '.props', [{
|
|
31
|
+
type: 'switch',
|
|
32
|
+
field: 'disabled'
|
|
33
|
+
}, {
|
|
34
|
+
type: 'select',
|
|
35
|
+
field: 'listType',
|
|
36
|
+
options: localeOptions(t, [{label: 'text', value: 'text'}, {
|
|
37
|
+
label: 'picture',
|
|
38
|
+
value: 'picture'
|
|
39
|
+
}, {
|
|
40
|
+
label: 'picture-card',
|
|
41
|
+
value: 'picture-card'
|
|
42
|
+
}]),
|
|
43
|
+
}, {type: 'switch', field: 'multiple'}, {
|
|
44
|
+
type: 'input',
|
|
45
|
+
field: 'action'
|
|
46
|
+
}, {
|
|
47
|
+
type: 'input',
|
|
48
|
+
field: 'accept'
|
|
49
|
+
}, {
|
|
50
|
+
type: 'FnInput',
|
|
51
|
+
field: 'beforeUpload',
|
|
52
|
+
props: {
|
|
53
|
+
body: true,
|
|
54
|
+
button: true,
|
|
55
|
+
fnx: true,
|
|
56
|
+
args: [getInjectArg(t)],
|
|
57
|
+
name: 'beforeUpload',
|
|
58
|
+
}
|
|
59
|
+
}, {
|
|
60
|
+
type: 'FnInput',
|
|
61
|
+
field: 'beforeRemove',
|
|
62
|
+
props: {
|
|
63
|
+
body: true,
|
|
64
|
+
button: true,
|
|
65
|
+
fnx: true,
|
|
66
|
+
args: [getInjectArg(t)],
|
|
67
|
+
name: 'beforeRemove',
|
|
68
|
+
}
|
|
69
|
+
}, {
|
|
70
|
+
type: 'FnInput',
|
|
71
|
+
field: 'onSuccess',
|
|
72
|
+
warning: t('com.upload.info'),
|
|
73
|
+
props: {
|
|
74
|
+
body: true,
|
|
75
|
+
button: true,
|
|
76
|
+
fnx: true,
|
|
77
|
+
args: [getInjectArg(t)],
|
|
78
|
+
name: 'onSuccess',
|
|
79
|
+
}
|
|
80
|
+
}, {
|
|
81
|
+
type: 'TableOptions',
|
|
82
|
+
field: 'headers',
|
|
83
|
+
props: {
|
|
84
|
+
column: [{label: t('props.key'), key: 'label'}, {label: t('props.value'), key: 'value'}],
|
|
85
|
+
valueType: 'object'
|
|
86
|
+
}
|
|
87
|
+
}, {
|
|
88
|
+
type: 'TableOptions',
|
|
89
|
+
field: 'data',
|
|
90
|
+
props: {
|
|
91
|
+
column: [{label: t('props.key'), key: 'label'}, {label: t('props.value'), key: 'value'}],
|
|
92
|
+
valueType: 'object'
|
|
93
|
+
}
|
|
94
|
+
}, {
|
|
95
|
+
type: 'switch',
|
|
96
|
+
field: 'withCredentials'
|
|
97
|
+
}, {
|
|
98
|
+
type: 'switch',
|
|
99
|
+
field: 'autoUpload',
|
|
100
|
+
value: true
|
|
101
|
+
}, {
|
|
102
|
+
type: 'inputNumber',
|
|
103
|
+
field: 'limit',
|
|
104
|
+
props: {min: 0},
|
|
105
|
+
}]);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import formCreate from '@form-create/element-ui';
|
|
2
|
+
import FcEditor from '@form-create/component-wangeditor';
|
|
3
|
+
import FcTitle from '../components/FcTitle.vue';
|
|
4
|
+
import SignaturePad from '../components/SignaturePad.vue';
|
|
5
|
+
import TableForm from '../components/tableForm/TableForm.vue';
|
|
6
|
+
import Table from '../components/table/Table.vue';
|
|
7
|
+
import '../style/icon.css';
|
|
8
|
+
|
|
9
|
+
const install = (formCreate) => {
|
|
10
|
+
formCreate.component('FcEditor', FcEditor);
|
|
11
|
+
formCreate.component('FcTitle', FcTitle);
|
|
12
|
+
formCreate.component('SignaturePad', SignaturePad);
|
|
13
|
+
formCreate.component('TableForm', TableForm);
|
|
14
|
+
formCreate.component('FcTable', Table);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
install(formCreate);
|
|
18
|
+
|
|
19
|
+
export default install;
|
package/src/index.js
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import FcDesigner from './components/FcDesigner.vue';
|
|
2
|
+
import DragTool from './components/DragTool.vue';
|
|
3
|
+
import Struct from './components/Struct.vue';
|
|
4
|
+
import OptionTextInput from './components/OptionsTextInput.vue';
|
|
5
|
+
import Row from './components/Row.vue';
|
|
6
|
+
import HtmlEditor from './components/HtmlEditor.vue';
|
|
7
|
+
import FnEditor from './components/FnEditor.vue';
|
|
8
|
+
import FnInput from './components/FnInput.vue';
|
|
9
|
+
import FetchConfig from './components/FetchConfig.vue';
|
|
10
|
+
import ConfigItem from './components/style/ConfigItem.vue';
|
|
11
|
+
import FieldInput from './components/FieldInput.vue';
|
|
12
|
+
import EventConfig from './components/EventConfig.vue';
|
|
13
|
+
import FnConfig from './components/FnConfig.vue';
|
|
14
|
+
import TableView from './components/table/TableView.vue';
|
|
15
|
+
import Table from './components/table/Table.vue';
|
|
16
|
+
import Validate from './components/Validate.vue';
|
|
17
|
+
import DragBox from './components/DragBox.vue';
|
|
18
|
+
import Required from './components/Required.vue';
|
|
19
|
+
import TableOptions from './components/TableOptions.vue';
|
|
20
|
+
import TreeOptions from './components/TreeOptions.vue';
|
|
21
|
+
import TableFormView from './components/tableForm/TableFormView.vue';
|
|
22
|
+
import TableForm from './components/tableForm/TableForm.vue';
|
|
23
|
+
import SignaturePad from './components/SignaturePad.vue';
|
|
24
|
+
import FcTitle from './components/FcTitle.vue';
|
|
25
|
+
import TableFormColumnView from './components/tableForm/TableFormColumnView.vue';
|
|
26
|
+
import SizeInput from './components/style/SizeInput.vue';
|
|
27
|
+
import ColorInput from './components/style/ColorInput.vue';
|
|
28
|
+
import StyleConfig from './components/style/StyleConfig.vue';
|
|
29
|
+
import LanguageInput from './components/language/LanguageInput.vue';
|
|
30
|
+
import ValueInput from './components/ValueInput.vue';
|
|
31
|
+
import formCreate, {designerForm} from './utils/form';
|
|
32
|
+
import FcEditor from '@form-create/component-wangeditor';
|
|
33
|
+
import draggable from 'vuedraggable/src/vuedraggable';
|
|
34
|
+
import {
|
|
35
|
+
compareVersion,
|
|
36
|
+
copyTextToClipboard,
|
|
37
|
+
getInjectArg,
|
|
38
|
+
localeOptions,
|
|
39
|
+
localeProps,
|
|
40
|
+
makeOptionsRule,
|
|
41
|
+
makeRequiredRule,
|
|
42
|
+
makeTreeOptions,
|
|
43
|
+
makeTreeOptionsRule,
|
|
44
|
+
toJSON
|
|
45
|
+
} from './utils/index';
|
|
46
|
+
import globalUseLocale, {t} from './utils/locale';
|
|
47
|
+
import './style/index.css';
|
|
48
|
+
import './style/icon.css';
|
|
49
|
+
import './utils/highlight/style.css';
|
|
50
|
+
import menus from './config/menu';
|
|
51
|
+
import dragRuleList from './config/index';
|
|
52
|
+
|
|
53
|
+
const addComponent = (id, component, previewComponent) => {
|
|
54
|
+
designerForm.component(id, previewComponent || component);
|
|
55
|
+
formCreate.component(id, component);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
designerForm.component('draggable', draggable);
|
|
59
|
+
designerForm.component('DragTool', DragTool);
|
|
60
|
+
designerForm.component('DragBox', DragBox);
|
|
61
|
+
designerForm.component('Validate', Validate);
|
|
62
|
+
designerForm.component('Struct', Struct);
|
|
63
|
+
designerForm.component('OptionTextInput', OptionTextInput);
|
|
64
|
+
designerForm.component('HtmlEditor', HtmlEditor);
|
|
65
|
+
designerForm.component('FetchConfig', FetchConfig);
|
|
66
|
+
designerForm.component('FnEditor', FnEditor);
|
|
67
|
+
designerForm.component('FnInput', FnInput);
|
|
68
|
+
designerForm.component('Required', Required);
|
|
69
|
+
designerForm.component('TableOptions', TableOptions);
|
|
70
|
+
designerForm.component('TreeOptions', TreeOptions);
|
|
71
|
+
designerForm.component('TableFormColumn', TableFormColumnView);
|
|
72
|
+
designerForm.component('EventConfig', EventConfig);
|
|
73
|
+
designerForm.component('ColorInput', ColorInput);
|
|
74
|
+
designerForm.component('SizeInput', SizeInput);
|
|
75
|
+
designerForm.component('StyleConfig', StyleConfig);
|
|
76
|
+
designerForm.component('LanguageInput', LanguageInput);
|
|
77
|
+
designerForm.component('ConfigItem', ConfigItem);
|
|
78
|
+
designerForm.component('FieldInput', FieldInput);
|
|
79
|
+
designerForm.component('FnConfig', FnConfig);
|
|
80
|
+
designerForm.component('FcRow', Row);
|
|
81
|
+
designerForm.component('ValueInput', ValueInput);
|
|
82
|
+
addComponent('FcEditor', FcEditor);
|
|
83
|
+
addComponent('FcTitle', FcTitle);
|
|
84
|
+
addComponent('SignaturePad', SignaturePad);
|
|
85
|
+
addComponent('TableForm', TableForm, TableFormView);
|
|
86
|
+
addComponent('FcTable', Table, TableView);
|
|
87
|
+
|
|
88
|
+
const install = function (Vue) {
|
|
89
|
+
Vue.component('FcDesigner', FcDesigner);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const addMenu = function (menu, before) {
|
|
93
|
+
if (!Array.isArray(menu)) {
|
|
94
|
+
menu = [menu];
|
|
95
|
+
}
|
|
96
|
+
if (before) {
|
|
97
|
+
menus.unshift(...menu);
|
|
98
|
+
} else {
|
|
99
|
+
menus.push(...menu);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const addDragRule = function (dragRule, before) {
|
|
104
|
+
if (!Array.isArray(dragRule)) {
|
|
105
|
+
dragRule = [dragRule];
|
|
106
|
+
}
|
|
107
|
+
if (before) {
|
|
108
|
+
dragRuleList.unshift(...dragRule);
|
|
109
|
+
} else {
|
|
110
|
+
dragRuleList.push(...dragRule);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
FcDesigner.install = install;
|
|
115
|
+
FcDesigner.makeOptionsRule = makeOptionsRule;
|
|
116
|
+
FcDesigner.copyTextToClipboard = copyTextToClipboard;
|
|
117
|
+
FcDesigner.getInjectArg = getInjectArg;
|
|
118
|
+
FcDesigner.localeOptions = localeOptions;
|
|
119
|
+
FcDesigner.localeProps = localeProps;
|
|
120
|
+
FcDesigner.makeRequiredRule = makeRequiredRule;
|
|
121
|
+
FcDesigner.makeTreeOptions = makeTreeOptions;
|
|
122
|
+
FcDesigner.makeTreeOptionsRule = makeTreeOptionsRule;
|
|
123
|
+
FcDesigner.toJSON = toJSON;
|
|
124
|
+
FcDesigner.formCreate = formCreate;
|
|
125
|
+
FcDesigner.designerForm = designerForm;
|
|
126
|
+
FcDesigner.component = addComponent;
|
|
127
|
+
FcDesigner.useLocale = globalUseLocale;
|
|
128
|
+
FcDesigner.addMenu = addMenu;
|
|
129
|
+
FcDesigner.addDragRule = addDragRule;
|
|
130
|
+
FcDesigner.t = t;
|
|
131
|
+
|
|
132
|
+
FcDesigner.utils = {
|
|
133
|
+
copyTextToClipboard,
|
|
134
|
+
getInjectArg,
|
|
135
|
+
localeOptions,
|
|
136
|
+
localeProps,
|
|
137
|
+
makeOptionsRule,
|
|
138
|
+
makeRequiredRule,
|
|
139
|
+
makeTreeOptions,
|
|
140
|
+
makeTreeOptionsRule,
|
|
141
|
+
toJSON
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const minVersion = '3.2.24';
|
|
145
|
+
|
|
146
|
+
if (compareVersion(minVersion, formCreate.version) === 1) {
|
|
147
|
+
console.warn('Please use FormCreate version ' + minVersion + ' or greater, see https://github.com/xaboy/form-create.');
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
FcDesigner.version = '3.5.0';
|
|
151
|
+
|
|
152
|
+
if (typeof window !== 'undefined') {
|
|
153
|
+
window.FcDesigner = FcDesigner;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export default FcDesigner;
|
|
157
|
+
|
|
158
|
+
export {
|
|
159
|
+
formCreate,
|
|
160
|
+
designerForm,
|
|
161
|
+
install,
|
|
162
|
+
copyTextToClipboard,
|
|
163
|
+
getInjectArg,
|
|
164
|
+
localeOptions,
|
|
165
|
+
localeProps,
|
|
166
|
+
makeOptionsRule,
|
|
167
|
+
makeRequiredRule,
|
|
168
|
+
makeTreeOptions,
|
|
169
|
+
makeTreeOptionsRule,
|
|
170
|
+
addDragRule,
|
|
171
|
+
addMenu,
|
|
172
|
+
toJSON
|
|
173
|
+
};
|