@xrenders/schema-builder 1.0.0-alpha.2 → 1.0.0-alpha.20
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 +2 -2
- package/es/createIframe.js +1 -1
- package/es/main.d.ts +4 -6
- package/es/main.js +22 -9
- package/es/settings/index.d.ts +21 -0
- package/es/settings/index.js +24 -0
- package/es/settings/meta/card.d.ts +2 -0
- package/es/settings/meta/card.js +108 -0
- package/es/settings/meta/cardList.d.ts +2 -0
- package/es/settings/meta/cardList.js +203 -0
- package/es/settings/meta/checkbox.d.ts +2 -0
- package/es/settings/meta/checkbox.js +29 -0
- package/es/settings/meta/checkboxes.d.ts +2 -0
- package/es/settings/meta/checkboxes.js +66 -0
- package/es/settings/meta/color.d.ts +2 -0
- package/es/settings/meta/color.js +21 -0
- package/es/settings/meta/date.d.ts +2 -0
- package/es/settings/meta/date.js +28 -0
- package/es/settings/meta/dateRange.d.ts +2 -0
- package/es/settings/meta/dateRange.js +37 -0
- package/es/settings/meta/form.d.ts +2 -0
- package/es/settings/meta/form.js +115 -0
- package/es/settings/meta/imageInput.d.ts +2 -0
- package/es/settings/meta/imageInput.js +21 -0
- package/es/settings/meta/input.d.ts +2 -0
- package/es/settings/meta/input.js +62 -0
- package/es/settings/meta/number.d.ts +2 -0
- package/es/settings/meta/number.js +69 -0
- package/es/settings/meta/radio.d.ts +2 -0
- package/es/settings/meta/radio.js +65 -0
- package/es/settings/meta/rate.d.ts +2 -0
- package/es/settings/meta/rate.js +56 -0
- package/es/settings/meta/select.d.ts +2 -0
- package/es/settings/meta/select.js +58 -0
- package/es/settings/meta/slider.d.ts +2 -0
- package/es/settings/meta/slider.js +40 -0
- package/es/settings/meta/switch.d.ts +2 -0
- package/es/settings/meta/switch.js +48 -0
- package/es/settings/meta/textarea.d.ts +2 -0
- package/es/settings/meta/textarea.js +69 -0
- package/es/settings/meta/time.d.ts +2 -0
- package/es/settings/meta/time.js +29 -0
- package/es/settings/meta/timeRange.d.ts +2 -0
- package/es/settings/meta/timeRange.js +37 -0
- package/es/settings/meta/treeSelect.d.ts +2 -0
- package/es/settings/meta/treeSelect.js +85 -0
- package/es/settings/meta/urlInput.d.ts +2 -0
- package/es/settings/meta/urlInput.js +34 -0
- package/es/settings/utils.d.ts +110 -0
- package/es/settings/utils.js +251 -0
- package/es/type.d.ts +33 -0
- package/es/type.js +1 -0
- package/lib/createIframe.js +3 -4
- package/lib/index.js +1 -2
- package/lib/main.d.ts +4 -6
- package/lib/main.js +21 -9
- package/lib/settings/index.d.ts +21 -0
- package/lib/settings/index.js +153 -0
- package/lib/settings/meta/card.d.ts +2 -0
- package/lib/settings/meta/card.js +114 -0
- package/lib/settings/meta/cardList.d.ts +2 -0
- package/lib/settings/meta/cardList.js +209 -0
- package/lib/settings/meta/checkbox.d.ts +2 -0
- package/lib/settings/meta/checkbox.js +35 -0
- package/lib/settings/meta/checkboxes.d.ts +2 -0
- package/lib/settings/meta/checkboxes.js +72 -0
- package/lib/settings/meta/color.d.ts +2 -0
- package/lib/settings/meta/color.js +27 -0
- package/lib/settings/meta/date.d.ts +2 -0
- package/lib/settings/meta/date.js +34 -0
- package/lib/settings/meta/dateRange.d.ts +2 -0
- package/lib/settings/meta/dateRange.js +43 -0
- package/lib/settings/meta/form.d.ts +2 -0
- package/lib/settings/meta/form.js +121 -0
- package/lib/settings/meta/imageInput.d.ts +2 -0
- package/lib/settings/meta/imageInput.js +27 -0
- package/lib/settings/meta/input.d.ts +2 -0
- package/lib/settings/meta/input.js +68 -0
- package/lib/settings/meta/number.d.ts +2 -0
- package/lib/settings/meta/number.js +75 -0
- package/lib/settings/meta/radio.d.ts +2 -0
- package/lib/settings/meta/radio.js +71 -0
- package/lib/settings/meta/rate.d.ts +2 -0
- package/lib/settings/meta/rate.js +62 -0
- package/lib/settings/meta/select.d.ts +2 -0
- package/lib/settings/meta/select.js +64 -0
- package/lib/settings/meta/slider.d.ts +2 -0
- package/lib/settings/meta/slider.js +46 -0
- package/lib/settings/meta/switch.d.ts +2 -0
- package/lib/settings/meta/switch.js +54 -0
- package/lib/settings/meta/textarea.d.ts +2 -0
- package/lib/settings/meta/textarea.js +75 -0
- package/lib/settings/meta/time.d.ts +2 -0
- package/lib/settings/meta/time.js +35 -0
- package/lib/settings/meta/timeRange.d.ts +2 -0
- package/lib/settings/meta/timeRange.js +43 -0
- package/lib/settings/meta/treeSelect.d.ts +2 -0
- package/lib/settings/meta/treeSelect.js +91 -0
- package/lib/settings/meta/urlInput.d.ts +2 -0
- package/lib/settings/meta/urlInput.js +40 -0
- package/lib/settings/utils.d.ts +110 -0
- package/lib/settings/utils.js +258 -0
- package/lib/type.d.ts +33 -0
- package/lib/type.js +5 -0
- package/package.json +5 -5
- package/es/utils/createIconFont.d.ts +0 -3
- package/es/utils/createIconFont.js +0 -9
- package/lib/utils/createIconFont.d.ts +0 -3
- package/lib/utils/createIconFont.js +0 -18
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createMeta, getInputPropsBasic } from '../utils';
|
|
2
|
+
export default createMeta('TimePicker', {
|
|
3
|
+
title: '时间选择',
|
|
4
|
+
props: [{
|
|
5
|
+
title: '基础配置',
|
|
6
|
+
type: 'group',
|
|
7
|
+
display: 'accordion',
|
|
8
|
+
items: getInputPropsBasic({
|
|
9
|
+
name: 'defaultValue',
|
|
10
|
+
title: {
|
|
11
|
+
label: '默认值',
|
|
12
|
+
tip: 'default | 默认值'
|
|
13
|
+
},
|
|
14
|
+
setter: 'CustomTimeSetter'
|
|
15
|
+
})
|
|
16
|
+
}],
|
|
17
|
+
snippets: [{
|
|
18
|
+
title: '时间选择',
|
|
19
|
+
screenshot: 'icon-time',
|
|
20
|
+
schema: {
|
|
21
|
+
componentName: 'TimePicker',
|
|
22
|
+
props: {
|
|
23
|
+
title: '时间选择',
|
|
24
|
+
type: 'string',
|
|
25
|
+
format: 'time'
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}]
|
|
29
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createMeta, getInputPropsBasic } from '../utils';
|
|
2
|
+
export default createMeta('TimeRange', {
|
|
3
|
+
title: '时间区间选择',
|
|
4
|
+
props: [{
|
|
5
|
+
title: '基础配置',
|
|
6
|
+
type: 'group',
|
|
7
|
+
display: 'accordion',
|
|
8
|
+
items: getInputPropsBasic({
|
|
9
|
+
name: 'defaultValue',
|
|
10
|
+
title: {
|
|
11
|
+
label: '默认值',
|
|
12
|
+
tip: 'default | 默认值'
|
|
13
|
+
},
|
|
14
|
+
setter: 'CustomTimeRangeSetter'
|
|
15
|
+
}, {
|
|
16
|
+
name: 'props.placeholder',
|
|
17
|
+
title: {
|
|
18
|
+
label: '提示文字',
|
|
19
|
+
tip: 'placeholder | 输入框提示文字'
|
|
20
|
+
},
|
|
21
|
+
defaultValue: ['开始时间', '结束时间'],
|
|
22
|
+
setter: 'JsonSetter'
|
|
23
|
+
})
|
|
24
|
+
}],
|
|
25
|
+
snippets: [{
|
|
26
|
+
title: '时间区间选择',
|
|
27
|
+
screenshot: 'icon-time',
|
|
28
|
+
schema: {
|
|
29
|
+
componentName: 'TimeRange',
|
|
30
|
+
props: {
|
|
31
|
+
title: '时间区间',
|
|
32
|
+
type: 'range',
|
|
33
|
+
format: 'time'
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}]
|
|
37
|
+
});
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { createMeta, getInputPropsBasic } from '../utils';
|
|
2
|
+
export default createMeta('TreeSelect', {
|
|
3
|
+
title: '树选择',
|
|
4
|
+
category: '其他',
|
|
5
|
+
props: [{
|
|
6
|
+
title: '基础配置',
|
|
7
|
+
type: 'group',
|
|
8
|
+
display: 'accordion',
|
|
9
|
+
items: getInputPropsBasic({
|
|
10
|
+
name: 'defaultValue',
|
|
11
|
+
title: {
|
|
12
|
+
label: '默认值',
|
|
13
|
+
tip: 'defaultValue | 默认值'
|
|
14
|
+
},
|
|
15
|
+
setter: 'JsonSetter'
|
|
16
|
+
})
|
|
17
|
+
}, {
|
|
18
|
+
title: '其他配置',
|
|
19
|
+
display: 'accordion',
|
|
20
|
+
type: 'group',
|
|
21
|
+
items: [{
|
|
22
|
+
name: 'props.treeData',
|
|
23
|
+
title: {
|
|
24
|
+
label: '数据源',
|
|
25
|
+
tip: '数据源'
|
|
26
|
+
},
|
|
27
|
+
setter: 'JsonSetter'
|
|
28
|
+
}, {
|
|
29
|
+
name: 'props.multiple',
|
|
30
|
+
title: {
|
|
31
|
+
label: '支持多选',
|
|
32
|
+
tip: '支持多选(当设置 treeCheckable 时自动变为 true)'
|
|
33
|
+
},
|
|
34
|
+
setter: 'BoolSetter'
|
|
35
|
+
}, {
|
|
36
|
+
name: 'props.allowClear',
|
|
37
|
+
title: {
|
|
38
|
+
label: '支持清除',
|
|
39
|
+
tip: '是否允许清除'
|
|
40
|
+
},
|
|
41
|
+
setter: 'BoolSetter'
|
|
42
|
+
}, {
|
|
43
|
+
name: 'props.treeCheckable',
|
|
44
|
+
title: {
|
|
45
|
+
label: '显示勾选框',
|
|
46
|
+
tip: '显示勾选框'
|
|
47
|
+
},
|
|
48
|
+
setter: 'BoolSetter'
|
|
49
|
+
}, {
|
|
50
|
+
name: 'props.treeDefaultExpandAll',
|
|
51
|
+
title: {
|
|
52
|
+
label: '默认展开所有树节点',
|
|
53
|
+
tip: '默认展开所有树节点'
|
|
54
|
+
},
|
|
55
|
+
setter: 'BoolSetter'
|
|
56
|
+
}]
|
|
57
|
+
}],
|
|
58
|
+
snippets: [{
|
|
59
|
+
label: '树选择',
|
|
60
|
+
screenshot: 'icon-tree',
|
|
61
|
+
schema: {
|
|
62
|
+
componentName: 'TreeSelect',
|
|
63
|
+
props: {
|
|
64
|
+
title: '树选择',
|
|
65
|
+
props: {
|
|
66
|
+
treeData: [{
|
|
67
|
+
value: 'parent 1',
|
|
68
|
+
title: 'parent 1',
|
|
69
|
+
children: [{
|
|
70
|
+
value: 'parent 1-0',
|
|
71
|
+
title: 'parent 1-0',
|
|
72
|
+
children: [{
|
|
73
|
+
value: 'leaf1',
|
|
74
|
+
title: 'leaf1'
|
|
75
|
+
}, {
|
|
76
|
+
value: 'leaf2',
|
|
77
|
+
title: 'leaf2'
|
|
78
|
+
}]
|
|
79
|
+
}]
|
|
80
|
+
}]
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}]
|
|
85
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createMeta, inputPropsBasic } from '../utils';
|
|
2
|
+
export default createMeta('UrlInput', {
|
|
3
|
+
title: '链接输入框',
|
|
4
|
+
category: '其他',
|
|
5
|
+
props: [{
|
|
6
|
+
title: '基础配置',
|
|
7
|
+
type: 'group',
|
|
8
|
+
display: 'accordion',
|
|
9
|
+
items: inputPropsBasic
|
|
10
|
+
}, {
|
|
11
|
+
title: '其他配置',
|
|
12
|
+
display: 'accordion',
|
|
13
|
+
type: 'group',
|
|
14
|
+
items: [{
|
|
15
|
+
name: 'props.addonText',
|
|
16
|
+
title: {
|
|
17
|
+
label: '按钮文案',
|
|
18
|
+
tip: '跳转按钮的文案配置'
|
|
19
|
+
},
|
|
20
|
+
defaultValue: '测试链接',
|
|
21
|
+
setter: 'StringSetter'
|
|
22
|
+
}]
|
|
23
|
+
}],
|
|
24
|
+
snippets: [{
|
|
25
|
+
title: '链接输入框',
|
|
26
|
+
screenshot: 'icon-link',
|
|
27
|
+
schema: {
|
|
28
|
+
componentName: 'UrlInput',
|
|
29
|
+
props: {
|
|
30
|
+
title: '链接输入框'
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}]
|
|
34
|
+
});
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
export declare const inputPropsBasic: ({
|
|
2
|
+
name: string;
|
|
3
|
+
title: {
|
|
4
|
+
label: string;
|
|
5
|
+
tip: string;
|
|
6
|
+
};
|
|
7
|
+
setter: string;
|
|
8
|
+
condition?: undefined;
|
|
9
|
+
} | {
|
|
10
|
+
name: string;
|
|
11
|
+
title: {
|
|
12
|
+
label: string;
|
|
13
|
+
tip: string;
|
|
14
|
+
};
|
|
15
|
+
setter: string;
|
|
16
|
+
condition: (target: any) => boolean;
|
|
17
|
+
})[];
|
|
18
|
+
export declare const notInputPropsBasic: ({
|
|
19
|
+
name: string;
|
|
20
|
+
title: {
|
|
21
|
+
label: string;
|
|
22
|
+
tip: string;
|
|
23
|
+
};
|
|
24
|
+
setter: string;
|
|
25
|
+
condition?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
name: string;
|
|
28
|
+
title: {
|
|
29
|
+
label: string;
|
|
30
|
+
tip: string;
|
|
31
|
+
};
|
|
32
|
+
setter: string;
|
|
33
|
+
condition: (target: any) => boolean;
|
|
34
|
+
})[];
|
|
35
|
+
export declare const optionsProp: {
|
|
36
|
+
display: string;
|
|
37
|
+
name: string;
|
|
38
|
+
title: {
|
|
39
|
+
label: string;
|
|
40
|
+
tip: string;
|
|
41
|
+
};
|
|
42
|
+
setter: {
|
|
43
|
+
componentName: string;
|
|
44
|
+
props: {
|
|
45
|
+
itemSetter: {
|
|
46
|
+
componentName: string;
|
|
47
|
+
initialValue: () => {
|
|
48
|
+
label: string;
|
|
49
|
+
value: string;
|
|
50
|
+
};
|
|
51
|
+
props: {
|
|
52
|
+
config: {
|
|
53
|
+
items: ({
|
|
54
|
+
name: string;
|
|
55
|
+
title: string;
|
|
56
|
+
important: boolean;
|
|
57
|
+
setter: string;
|
|
58
|
+
} | {
|
|
59
|
+
name: string;
|
|
60
|
+
title: string;
|
|
61
|
+
setter: string[];
|
|
62
|
+
important: boolean;
|
|
63
|
+
} | {
|
|
64
|
+
name: string;
|
|
65
|
+
title: string;
|
|
66
|
+
setter: string;
|
|
67
|
+
important?: undefined;
|
|
68
|
+
})[];
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
export declare const getInputPropsBasic: (defaultValueProp: any, placeholder?: any) => ({
|
|
76
|
+
name: string;
|
|
77
|
+
title: {
|
|
78
|
+
label: string;
|
|
79
|
+
tip: string;
|
|
80
|
+
};
|
|
81
|
+
setter: string;
|
|
82
|
+
condition?: undefined;
|
|
83
|
+
} | {
|
|
84
|
+
name: string;
|
|
85
|
+
title: {
|
|
86
|
+
label: string;
|
|
87
|
+
tip: string;
|
|
88
|
+
};
|
|
89
|
+
setter: string;
|
|
90
|
+
condition: (target: any) => boolean;
|
|
91
|
+
})[];
|
|
92
|
+
export declare const getNotInputPropsBasic: (defaultValueProp: any) => ({
|
|
93
|
+
name: string;
|
|
94
|
+
title: {
|
|
95
|
+
label: string;
|
|
96
|
+
tip: string;
|
|
97
|
+
};
|
|
98
|
+
setter: string;
|
|
99
|
+
condition?: undefined;
|
|
100
|
+
} | {
|
|
101
|
+
name: string;
|
|
102
|
+
title: {
|
|
103
|
+
label: string;
|
|
104
|
+
tip: string;
|
|
105
|
+
};
|
|
106
|
+
setter: string;
|
|
107
|
+
condition: (target: any) => boolean;
|
|
108
|
+
})[];
|
|
109
|
+
export declare const uuid: () => string;
|
|
110
|
+
export declare const createMeta: (componentName: string, params: any) => any;
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
8
|
+
export var inputPropsBasic = [{
|
|
9
|
+
name: 'title',
|
|
10
|
+
title: {
|
|
11
|
+
label: '标题',
|
|
12
|
+
tip: 'title | 标题'
|
|
13
|
+
},
|
|
14
|
+
setter: 'StringSetter'
|
|
15
|
+
}, {
|
|
16
|
+
name: 'code',
|
|
17
|
+
title: {
|
|
18
|
+
label: '字段名',
|
|
19
|
+
tip: 'key | 字段名'
|
|
20
|
+
},
|
|
21
|
+
setter: 'StringSetter'
|
|
22
|
+
}, {
|
|
23
|
+
name: 'defaultValue',
|
|
24
|
+
title: {
|
|
25
|
+
label: '默认值',
|
|
26
|
+
tip: 'defaultValue | 默认值'
|
|
27
|
+
},
|
|
28
|
+
setter: 'StringSetter'
|
|
29
|
+
}, {
|
|
30
|
+
name: 'props.placeholder',
|
|
31
|
+
title: {
|
|
32
|
+
label: '提示文案',
|
|
33
|
+
tip: 'placeholder | 提示文案'
|
|
34
|
+
},
|
|
35
|
+
setter: 'StringSetter'
|
|
36
|
+
}, {
|
|
37
|
+
name: 'description',
|
|
38
|
+
title: {
|
|
39
|
+
label: '补充说明',
|
|
40
|
+
tip: 'description | 补充说明'
|
|
41
|
+
},
|
|
42
|
+
setter: 'StringSetter'
|
|
43
|
+
}, {
|
|
44
|
+
name: 'tooltip.title',
|
|
45
|
+
title: {
|
|
46
|
+
label: '气泡提示',
|
|
47
|
+
tip: 'tooltip.title | 气泡提示文案'
|
|
48
|
+
},
|
|
49
|
+
setter: 'StringSetter'
|
|
50
|
+
}, {
|
|
51
|
+
name: 'extra',
|
|
52
|
+
title: {
|
|
53
|
+
label: '额外提示',
|
|
54
|
+
tip: 'extra | 额外的提示信息'
|
|
55
|
+
},
|
|
56
|
+
setter: 'StringSetter'
|
|
57
|
+
}, {
|
|
58
|
+
name: 'disabled',
|
|
59
|
+
title: {
|
|
60
|
+
label: '禁用',
|
|
61
|
+
tip: 'disabled | 禁用'
|
|
62
|
+
},
|
|
63
|
+
setter: 'FrExpressionSetter'
|
|
64
|
+
}, {
|
|
65
|
+
name: 'hidden',
|
|
66
|
+
title: {
|
|
67
|
+
label: '隐藏',
|
|
68
|
+
tip: 'hidden | 隐藏'
|
|
69
|
+
},
|
|
70
|
+
setter: 'FrExpressionSetter'
|
|
71
|
+
}, {
|
|
72
|
+
name: 'readOnly',
|
|
73
|
+
title: {
|
|
74
|
+
label: '只读',
|
|
75
|
+
tip: 'readOnly | 只读'
|
|
76
|
+
},
|
|
77
|
+
setter: 'FrExpressionSetter'
|
|
78
|
+
}, {
|
|
79
|
+
name: 'readOnlyWidget',
|
|
80
|
+
title: {
|
|
81
|
+
label: '只读组件',
|
|
82
|
+
tip: 'readOnlyWidget | 只读组件'
|
|
83
|
+
},
|
|
84
|
+
setter: 'StringSetter',
|
|
85
|
+
condition: function condition(target) {
|
|
86
|
+
return !!target.getProps().getPropValue('readOnly');
|
|
87
|
+
}
|
|
88
|
+
}];
|
|
89
|
+
export var notInputPropsBasic = [{
|
|
90
|
+
name: 'title',
|
|
91
|
+
title: {
|
|
92
|
+
label: '标题',
|
|
93
|
+
tip: 'title | 标题'
|
|
94
|
+
},
|
|
95
|
+
setter: 'StringSetter'
|
|
96
|
+
}, {
|
|
97
|
+
name: 'code',
|
|
98
|
+
title: {
|
|
99
|
+
label: '字段名',
|
|
100
|
+
tip: 'key | 字段名'
|
|
101
|
+
},
|
|
102
|
+
setter: 'StringSetter'
|
|
103
|
+
}, {
|
|
104
|
+
name: 'defaultValue',
|
|
105
|
+
title: {
|
|
106
|
+
label: '默认值',
|
|
107
|
+
tip: 'defaultValue | 默认值'
|
|
108
|
+
},
|
|
109
|
+
setter: 'StringSetter'
|
|
110
|
+
}, {
|
|
111
|
+
name: 'description',
|
|
112
|
+
title: {
|
|
113
|
+
label: '补充说明',
|
|
114
|
+
tip: 'description | 补充说明'
|
|
115
|
+
},
|
|
116
|
+
setter: 'StringSetter'
|
|
117
|
+
}, {
|
|
118
|
+
name: 'tooltip',
|
|
119
|
+
title: {
|
|
120
|
+
label: '气泡提示',
|
|
121
|
+
tip: 'tooltip | 气泡提示文案'
|
|
122
|
+
},
|
|
123
|
+
setter: 'StringSetter'
|
|
124
|
+
}, {
|
|
125
|
+
name: 'extra',
|
|
126
|
+
title: {
|
|
127
|
+
label: '额外提示',
|
|
128
|
+
tip: 'extra | 额外的提示信息'
|
|
129
|
+
},
|
|
130
|
+
setter: 'StringSetter'
|
|
131
|
+
}, {
|
|
132
|
+
name: 'disabled',
|
|
133
|
+
title: {
|
|
134
|
+
label: '禁用',
|
|
135
|
+
tip: 'disabled | 禁用'
|
|
136
|
+
},
|
|
137
|
+
setter: 'FrExpressionSetter'
|
|
138
|
+
}, {
|
|
139
|
+
name: 'hidden',
|
|
140
|
+
title: {
|
|
141
|
+
label: '隐藏',
|
|
142
|
+
tip: 'hidden | 隐藏'
|
|
143
|
+
},
|
|
144
|
+
setter: 'FrExpressionSetter'
|
|
145
|
+
}, {
|
|
146
|
+
name: 'readOnly',
|
|
147
|
+
title: {
|
|
148
|
+
label: '只读',
|
|
149
|
+
tip: 'readOnly | 只读'
|
|
150
|
+
},
|
|
151
|
+
setter: 'FrExpressionSetter'
|
|
152
|
+
}, {
|
|
153
|
+
name: 'readOnlyWidget',
|
|
154
|
+
title: {
|
|
155
|
+
label: '只读组件',
|
|
156
|
+
tip: 'readOnlyWidget | 只读组件'
|
|
157
|
+
},
|
|
158
|
+
setter: 'StringSetter',
|
|
159
|
+
condition: function condition(target) {
|
|
160
|
+
return !!target.getProps().getPropValue('readOnly');
|
|
161
|
+
}
|
|
162
|
+
}];
|
|
163
|
+
export var optionsProp = {
|
|
164
|
+
display: 'accordion',
|
|
165
|
+
name: 'props.options',
|
|
166
|
+
title: {
|
|
167
|
+
label: '选项配置',
|
|
168
|
+
tip: 'options | 选项配置'
|
|
169
|
+
},
|
|
170
|
+
setter: {
|
|
171
|
+
componentName: 'ArraySetter',
|
|
172
|
+
props: {
|
|
173
|
+
itemSetter: {
|
|
174
|
+
componentName: 'ObjectSetter',
|
|
175
|
+
initialValue: function initialValue() {
|
|
176
|
+
return {
|
|
177
|
+
label: '选项名',
|
|
178
|
+
value: uuid()
|
|
179
|
+
};
|
|
180
|
+
},
|
|
181
|
+
props: {
|
|
182
|
+
config: {
|
|
183
|
+
items: [{
|
|
184
|
+
name: 'label',
|
|
185
|
+
title: '选项名',
|
|
186
|
+
important: true,
|
|
187
|
+
setter: 'StringSetter'
|
|
188
|
+
}, {
|
|
189
|
+
name: 'value',
|
|
190
|
+
title: '选项值',
|
|
191
|
+
setter: ['StringSetter', 'NumberSetter'],
|
|
192
|
+
important: true
|
|
193
|
+
}, {
|
|
194
|
+
name: 'disabled',
|
|
195
|
+
title: '禁用',
|
|
196
|
+
setter: 'JsonSetter'
|
|
197
|
+
}]
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
export var getInputPropsBasic = function getInputPropsBasic(defaultValueProp, placeholder) {
|
|
205
|
+
var result = cloneDeep(inputPropsBasic);
|
|
206
|
+
result.splice(2, 0, defaultValueProp);
|
|
207
|
+
if (placeholder) {
|
|
208
|
+
result.splice(3, 0, defaultValueProp);
|
|
209
|
+
}
|
|
210
|
+
return result;
|
|
211
|
+
};
|
|
212
|
+
export var getNotInputPropsBasic = function getNotInputPropsBasic(defaultValueProp) {
|
|
213
|
+
var result = cloneDeep(notInputPropsBasic);
|
|
214
|
+
result.splice(2, 0, defaultValueProp);
|
|
215
|
+
return result;
|
|
216
|
+
};
|
|
217
|
+
export var uuid = function uuid() {
|
|
218
|
+
return (Math.random() * 1e6 >> 0).toString(36);
|
|
219
|
+
};
|
|
220
|
+
export var createMeta = function createMeta(componentName, params) {
|
|
221
|
+
return _objectSpread({
|
|
222
|
+
componentName: componentName,
|
|
223
|
+
docUrl: '',
|
|
224
|
+
screenshot: '',
|
|
225
|
+
devMode: 'proCode',
|
|
226
|
+
npm: {
|
|
227
|
+
package: '@ali/form-render-material',
|
|
228
|
+
version: '1.0.0',
|
|
229
|
+
exportName: componentName,
|
|
230
|
+
main: 'src/index.tsx',
|
|
231
|
+
destructuring: true,
|
|
232
|
+
subName: ''
|
|
233
|
+
},
|
|
234
|
+
configure: {
|
|
235
|
+
supports: {
|
|
236
|
+
loop: false,
|
|
237
|
+
condition: false
|
|
238
|
+
},
|
|
239
|
+
component: {
|
|
240
|
+
isContainer: false,
|
|
241
|
+
isModal: false,
|
|
242
|
+
nestingRule: {
|
|
243
|
+
parentWhitelist: ['FormRender', 'Card', 'CardList', 'TableList']
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
group: '基础组件',
|
|
248
|
+
category: '常用',
|
|
249
|
+
icon: 'https://img.alicdn.com/imgextra/i4/O1CN01gxzRdT1hm9KXRbZkU_!!6000000004319-2-tps-200-200.png'
|
|
250
|
+
}, params);
|
|
251
|
+
};
|
package/es/type.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
interface TProperties {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
}
|
|
4
|
+
interface TLogo {
|
|
5
|
+
title?: string;
|
|
6
|
+
image?: string;
|
|
7
|
+
href?: string;
|
|
8
|
+
}
|
|
9
|
+
interface TSchema {
|
|
10
|
+
"type": "object";
|
|
11
|
+
"properties": TProperties;
|
|
12
|
+
}
|
|
13
|
+
interface TToolBtn {
|
|
14
|
+
text: string;
|
|
15
|
+
order: number;
|
|
16
|
+
onClick: (schema: TSchema) => void;
|
|
17
|
+
}
|
|
18
|
+
export interface TSchemaBuilder {
|
|
19
|
+
logo?: TLogo;
|
|
20
|
+
importBtn?: boolean;
|
|
21
|
+
exportBtn?: boolean;
|
|
22
|
+
clearBtn?: boolean | TToolBtn;
|
|
23
|
+
saveBtn?: boolean | TToolBtn;
|
|
24
|
+
pubBtn?: boolean | TToolBtn;
|
|
25
|
+
extraBtns?: TToolBtn[];
|
|
26
|
+
defaultValue?: TSchema;
|
|
27
|
+
widgets?: any;
|
|
28
|
+
settings?: any;
|
|
29
|
+
editorWidgets?: any;
|
|
30
|
+
onMount?: () => void;
|
|
31
|
+
[key: string]: any;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
package/es/type.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/createIframe.js
CHANGED
|
@@ -5,15 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var createIframeContent = function createIframeContent() {
|
|
8
|
-
var html = "\n <html>\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\" />\n <title>XRender</title>\n <link rel=\"icon\" href=\"https://img.alicdn.com/tfs/TB17UtINiLaK1RjSZFxXXamPFXa-606-643.png\">\n <link href=\"https://alifd.alicdn.com/npm/@alifd/theme-lowcode-light@0.2.1/variables.css\" rel=\"stylesheet\" />\n <link href=\"https://alifd.alicdn.com/npm/@alifd/theme-lowcode-light@0.2.1/dist/next.var.min.css\" rel=\"stylesheet\" />\n <link rel=\"stylesheet\" href=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.
|
|
8
|
+
var html = "\n <html>\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\" />\n <title>XRender</title>\n <link rel=\"icon\" href=\"https://img.alicdn.com/tfs/TB17UtINiLaK1RjSZFxXXamPFXa-606-643.png\">\n <link href=\"https://alifd.alicdn.com/npm/@alifd/theme-lowcode-light@0.2.1/variables.css\" rel=\"stylesheet\" />\n <link href=\"https://alifd.alicdn.com/npm/@alifd/theme-lowcode-light@0.2.1/dist/next.var.min.css\" rel=\"stylesheet\" />\n <link rel=\"stylesheet\" href=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.2.3/dist/css/engine-core.css\" />\n <link rel=\"stylesheet\" href=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine-ext/1.0.6/dist/css/engine-ext.css\" />\n <link rel=\"stylesheet\" href=\"https://g.alicdn.com/fone-lowcode/fr-generator/1.1.0/css/index.css\" />\n\n <script>\n window.React = window.parent.React;\n window.ReactDOM = window.parent.ReactDOM;\n </script>\n \n <script src=\"https://g.alicdn.com/code/lib/prop-types/15.7.2/prop-types.js\"></script>\n <script src=\"https://g.alicdn.com/platform/c/react15-polyfill/0.0.1/dist/index.js\"></script>\n <script src=\"https://g.alicdn.com/platform/c/lodash/4.6.1/lodash.min.js\"></script>\n <script src=\"https://g.alicdn.com/mylib/moment/2.24.0/min/moment.min.js\"></script>\n <script src=\"https://g.alicdn.com/code/lib/alifd__next/1.23.24/next.min.js\"></script>\n <script crossorigin=\"anonymous\" src=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.2.3/dist/js/engine-core.js\"></script>\n <script crossorigin=\"anonymous\" src=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine-ext/1.0.6/dist/js/engine-ext.js\"></script>\n </head>\n\n <body>\n <div id=\"lce-container\"></div>\n <script type=\"text/javascript\" src=\"https://g.alicdn.com/fone-lowcode/fr-generator/1.1.0/js/index.js\"></script>\n </body>\n </html>\n ";
|
|
9
9
|
return html;
|
|
10
10
|
};
|
|
11
|
-
var _default = function _default() {
|
|
11
|
+
var _default = exports.default = function _default() {
|
|
12
12
|
var iframe = document.createElement('iframe');
|
|
13
13
|
iframe.width = '100%';
|
|
14
14
|
iframe.height = '100%';
|
|
15
15
|
iframe.frameBorder = '0';
|
|
16
16
|
iframe.srcdoc = createIframeContent();
|
|
17
17
|
return iframe;
|
|
18
|
-
};
|
|
19
|
-
exports.default = _default;
|
|
18
|
+
};
|
package/lib/index.js
CHANGED
|
@@ -6,5 +6,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _main = _interopRequireDefault(require("./main"));
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
var _default = _main.default;
|
|
10
|
-
exports.default = _default;
|
|
9
|
+
var _default = exports.default = _main.default;
|
package/lib/main.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare const Design: (props: IProps) => JSX.Element;
|
|
6
|
-
export default Design;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TSchemaBuilder } from './type';
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<TSchemaBuilder, keyof TSchemaBuilder> & React.RefAttributes<unknown>>;
|
|
4
|
+
export default _default;
|