@easyv/config 1.1.7 → 1.1.10
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/.babelrc +9 -9
- package/CHANGELOG.md +17 -17
- package/index.js +3 -3
- package/lib/animation.js +2 -3
- package/lib/axes.js +2 -2
- package/lib/baseLine.js +80 -43
- package/lib/interaction.js +2 -2
- package/lib/label.js +2 -2
- package/lib/legend.js +2 -2
- package/lib/mutiColor.js +51 -51
- package/lib/pie.js +2 -2
- package/lib/sc.js +8 -3
- package/lib/unit.js +2 -2
- package/package.json +30 -30
- package/src/animation.js +256 -257
- package/src/axes.js +162 -162
- package/src/axisLine.js +39 -39
- package/src/baseLine.js +216 -177
- package/src/brush.js +90 -90
- package/src/dimension.js +49 -49
- package/src/extent.js +29 -29
- package/src/font.js +23 -23
- package/src/gridLine.js +49 -49
- package/src/index.js +99 -99
- package/src/interaction.js +121 -121
- package/src/label.js +722 -722
- package/src/legend.js +982 -982
- package/src/mapping.js +26 -26
- package/src/margin.js +58 -58
- package/src/multiColor.js +30 -30
- package/src/pie.js +1035 -1035
- package/src/sc.js +11 -8
- package/src/series.js +824 -824
- package/src/shadow.js +17 -17
- package/src/show.js +11 -11
- package/src/textOverflow.js +34 -34
- package/src/tickLine.js +51 -51
- package/src/tooltip.js +425 -425
- package/src/translate.js +27 -27
- package/src/unit.js +67 -67
package/src/extent.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
const extent = {
|
|
2
|
-
min: '0',
|
|
3
|
-
max: '',
|
|
4
|
-
};
|
|
5
|
-
export default ({ min = extent.min, max = extent.max } = extent) => ({
|
|
6
|
-
name: 'extent',
|
|
7
|
-
displayName: '数值范围',
|
|
8
|
-
value: [
|
|
9
|
-
{
|
|
10
|
-
name: 'min',
|
|
11
|
-
displayName: '最小值',
|
|
12
|
-
value: min,
|
|
13
|
-
type: 'input',
|
|
14
|
-
config: {
|
|
15
|
-
span: 12,
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
name: 'max',
|
|
20
|
-
displayName: '最大值',
|
|
21
|
-
value: max,
|
|
22
|
-
type: 'input',
|
|
23
|
-
config: {
|
|
24
|
-
span: 12,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
],
|
|
28
|
-
type: 'group',
|
|
29
|
-
});
|
|
1
|
+
const extent = {
|
|
2
|
+
min: '0',
|
|
3
|
+
max: '',
|
|
4
|
+
};
|
|
5
|
+
export default ({ min = extent.min, max = extent.max } = extent) => ({
|
|
6
|
+
name: 'extent',
|
|
7
|
+
displayName: '数值范围',
|
|
8
|
+
value: [
|
|
9
|
+
{
|
|
10
|
+
name: 'min',
|
|
11
|
+
displayName: '最小值',
|
|
12
|
+
value: min,
|
|
13
|
+
type: 'input',
|
|
14
|
+
config: {
|
|
15
|
+
span: 12,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'max',
|
|
20
|
+
displayName: '最大值',
|
|
21
|
+
value: max,
|
|
22
|
+
type: 'input',
|
|
23
|
+
config: {
|
|
24
|
+
span: 12,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
type: 'group',
|
|
29
|
+
});
|
package/src/font.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
const defaultFont = {
|
|
2
|
-
fontFamily: 'Mircosoft Yahei',
|
|
3
|
-
fontSize: 12,
|
|
4
|
-
color: 'rgba(230,247,255,0.7)',
|
|
5
|
-
bold: false,
|
|
6
|
-
italic: false,
|
|
7
|
-
letterSpacing: 0,
|
|
8
|
-
};
|
|
9
|
-
export default ({
|
|
10
|
-
fontFamily = defaultFont.fontFamily,
|
|
11
|
-
fontSize = defaultFont.fontSize,
|
|
12
|
-
color = defaultFont.color,
|
|
13
|
-
bold = defaultFont.bold,
|
|
14
|
-
italic = defaultFont.italic,
|
|
15
|
-
letterSpacing = defaultFont.letterSpacing,
|
|
16
|
-
} = defaultFont) => ({
|
|
17
|
-
fontFamily,
|
|
18
|
-
fontSize,
|
|
19
|
-
color,
|
|
20
|
-
bold,
|
|
21
|
-
italic,
|
|
22
|
-
letterSpacing,
|
|
23
|
-
});
|
|
1
|
+
const defaultFont = {
|
|
2
|
+
fontFamily: 'Mircosoft Yahei',
|
|
3
|
+
fontSize: 12,
|
|
4
|
+
color: 'rgba(230,247,255,0.7)',
|
|
5
|
+
bold: false,
|
|
6
|
+
italic: false,
|
|
7
|
+
letterSpacing: 0,
|
|
8
|
+
};
|
|
9
|
+
export default ({
|
|
10
|
+
fontFamily = defaultFont.fontFamily,
|
|
11
|
+
fontSize = defaultFont.fontSize,
|
|
12
|
+
color = defaultFont.color,
|
|
13
|
+
bold = defaultFont.bold,
|
|
14
|
+
italic = defaultFont.italic,
|
|
15
|
+
letterSpacing = defaultFont.letterSpacing,
|
|
16
|
+
} = defaultFont) => ({
|
|
17
|
+
fontFamily,
|
|
18
|
+
fontSize,
|
|
19
|
+
color,
|
|
20
|
+
bold,
|
|
21
|
+
italic,
|
|
22
|
+
letterSpacing,
|
|
23
|
+
});
|
package/src/gridLine.js
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
const gridLine = {
|
|
2
|
-
show: false,
|
|
3
|
-
strokeDasharray: '3,3',
|
|
4
|
-
color: 'rgba(230, 247, 255, 0.2)',
|
|
5
|
-
lineWidth: 1,
|
|
6
|
-
};
|
|
7
|
-
export default ({
|
|
8
|
-
show = gridLine.show,
|
|
9
|
-
strokeDasharray = gridLine.strokeDasharray,
|
|
10
|
-
color = gridLine.color,
|
|
11
|
-
lineWidth = gridLine.lineWidth,
|
|
12
|
-
} = gridLine) => ({
|
|
13
|
-
name: 'gridLine',
|
|
14
|
-
displayName: '网格线',
|
|
15
|
-
value: [
|
|
16
|
-
{
|
|
17
|
-
name: 'show',
|
|
18
|
-
displayName: '显示',
|
|
19
|
-
value: show,
|
|
20
|
-
type: 'boolean',
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
rule: [['show', '$eq', true]],
|
|
24
|
-
name: 'strokeDasharray',
|
|
25
|
-
displayName: '虚线样式',
|
|
26
|
-
value: strokeDasharray,
|
|
27
|
-
type: 'input',
|
|
28
|
-
tip: '格式使用半角字符,如2,2',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
rule: [['show', '$eq', true]],
|
|
32
|
-
name: 'color',
|
|
33
|
-
displayName: '颜色',
|
|
34
|
-
value: color,
|
|
35
|
-
type: 'color',
|
|
36
|
-
markColorType: 'gridColor',
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
rule: [['show', '$eq', true]],
|
|
40
|
-
name: 'lineWidth',
|
|
41
|
-
displayName: '粗细',
|
|
42
|
-
value: lineWidth,
|
|
43
|
-
type: 'number',
|
|
44
|
-
config: {
|
|
45
|
-
suffix: 'px',
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
],
|
|
49
|
-
});
|
|
1
|
+
const gridLine = {
|
|
2
|
+
show: false,
|
|
3
|
+
strokeDasharray: '3,3',
|
|
4
|
+
color: 'rgba(230, 247, 255, 0.2)',
|
|
5
|
+
lineWidth: 1,
|
|
6
|
+
};
|
|
7
|
+
export default ({
|
|
8
|
+
show = gridLine.show,
|
|
9
|
+
strokeDasharray = gridLine.strokeDasharray,
|
|
10
|
+
color = gridLine.color,
|
|
11
|
+
lineWidth = gridLine.lineWidth,
|
|
12
|
+
} = gridLine) => ({
|
|
13
|
+
name: 'gridLine',
|
|
14
|
+
displayName: '网格线',
|
|
15
|
+
value: [
|
|
16
|
+
{
|
|
17
|
+
name: 'show',
|
|
18
|
+
displayName: '显示',
|
|
19
|
+
value: show,
|
|
20
|
+
type: 'boolean',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
rule: [['show', '$eq', true]],
|
|
24
|
+
name: 'strokeDasharray',
|
|
25
|
+
displayName: '虚线样式',
|
|
26
|
+
value: strokeDasharray,
|
|
27
|
+
type: 'input',
|
|
28
|
+
tip: '格式使用半角字符,如2,2',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
rule: [['show', '$eq', true]],
|
|
32
|
+
name: 'color',
|
|
33
|
+
displayName: '颜色',
|
|
34
|
+
value: color,
|
|
35
|
+
type: 'color',
|
|
36
|
+
markColorType: 'gridColor',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
rule: [['show', '$eq', true]],
|
|
40
|
+
name: 'lineWidth',
|
|
41
|
+
displayName: '粗细',
|
|
42
|
+
value: lineWidth,
|
|
43
|
+
type: 'number',
|
|
44
|
+
config: {
|
|
45
|
+
suffix: 'px',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
});
|
package/src/index.js
CHANGED
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
import show, { showRule } from './show';
|
|
2
|
-
import font from './font';
|
|
3
|
-
import translate from './translate';
|
|
4
|
-
import gridLine from './gridLine';
|
|
5
|
-
import tickLine from './tickLine';
|
|
6
|
-
import axisLine from './axisLine';
|
|
7
|
-
import extent from './extent';
|
|
8
|
-
import unit from './unit';
|
|
9
|
-
import margin from './margin';
|
|
10
|
-
import multiColor from './multiColor';
|
|
11
|
-
import animation, {
|
|
12
|
-
dataAnimation,
|
|
13
|
-
animationOfPie,
|
|
14
|
-
animationOfCarousel,
|
|
15
|
-
} from './animation';
|
|
16
|
-
import dimension from './dimension';
|
|
17
|
-
import label, {
|
|
18
|
-
labelOfPie,
|
|
19
|
-
labelOfRose,
|
|
20
|
-
axisLabel,
|
|
21
|
-
valueAsixLabel,
|
|
22
|
-
} from './label';
|
|
23
|
-
import legend, { legendOfPie, legendOfRose, legendOfDoublePie } from './legend';
|
|
24
|
-
import tooltip from './tooltip';
|
|
25
|
-
import axes, { valueAxis, categoryAxis } from './axes';
|
|
26
|
-
import mapping from './mapping';
|
|
27
|
-
import {
|
|
28
|
-
bandSeries,
|
|
29
|
-
lineSeries,
|
|
30
|
-
areaSeries,
|
|
31
|
-
pieSeries,
|
|
32
|
-
purePieSeries,
|
|
33
|
-
} from './series';
|
|
34
|
-
import pie, {
|
|
35
|
-
rosePie,
|
|
36
|
-
rosePieDecorate,
|
|
37
|
-
donut,
|
|
38
|
-
carouselDonut,
|
|
39
|
-
nestRosePie,
|
|
40
|
-
carouselDonut2,
|
|
41
|
-
current as pieCurrent,
|
|
42
|
-
} from './pie';
|
|
43
|
-
import brush from './brush';
|
|
44
|
-
import interaction from './interaction';
|
|
45
|
-
import sc from './sc';
|
|
46
|
-
import shadow from './shadow';
|
|
47
|
-
import textOverflow from './textOverflow';
|
|
48
|
-
import baseLine from './baseLine';
|
|
49
|
-
export {
|
|
50
|
-
show,
|
|
51
|
-
showRule,
|
|
52
|
-
font,
|
|
53
|
-
tooltip,
|
|
54
|
-
translate,
|
|
55
|
-
textOverflow,
|
|
56
|
-
extent,
|
|
57
|
-
unit,
|
|
58
|
-
margin,
|
|
59
|
-
multiColor,
|
|
60
|
-
animation,
|
|
61
|
-
dataAnimation,
|
|
62
|
-
animationOfPie,
|
|
63
|
-
animationOfCarousel,
|
|
64
|
-
dimension,
|
|
65
|
-
gridLine,
|
|
66
|
-
tickLine,
|
|
67
|
-
axisLine,
|
|
68
|
-
valueAxis,
|
|
69
|
-
categoryAxis,
|
|
70
|
-
axes,
|
|
71
|
-
mapping,
|
|
72
|
-
bandSeries,
|
|
73
|
-
lineSeries,
|
|
74
|
-
areaSeries,
|
|
75
|
-
pieSeries,
|
|
76
|
-
purePieSeries,
|
|
77
|
-
brush,
|
|
78
|
-
interaction,
|
|
79
|
-
legend,
|
|
80
|
-
legendOfPie,
|
|
81
|
-
legendOfRose,
|
|
82
|
-
legendOfDoublePie,
|
|
83
|
-
label,
|
|
84
|
-
labelOfPie,
|
|
85
|
-
labelOfRose,
|
|
86
|
-
axisLabel,
|
|
87
|
-
valueAsixLabel,
|
|
88
|
-
pie,
|
|
89
|
-
rosePie,
|
|
90
|
-
nestRosePie,
|
|
91
|
-
rosePieDecorate,
|
|
92
|
-
donut,
|
|
93
|
-
carouselDonut,
|
|
94
|
-
carouselDonut2,
|
|
95
|
-
pieCurrent,
|
|
96
|
-
sc,
|
|
97
|
-
shadow,
|
|
98
|
-
baseLine
|
|
99
|
-
};
|
|
1
|
+
import show, { showRule } from './show';
|
|
2
|
+
import font from './font';
|
|
3
|
+
import translate from './translate';
|
|
4
|
+
import gridLine from './gridLine';
|
|
5
|
+
import tickLine from './tickLine';
|
|
6
|
+
import axisLine from './axisLine';
|
|
7
|
+
import extent from './extent';
|
|
8
|
+
import unit from './unit';
|
|
9
|
+
import margin from './margin';
|
|
10
|
+
import multiColor from './multiColor';
|
|
11
|
+
import animation, {
|
|
12
|
+
dataAnimation,
|
|
13
|
+
animationOfPie,
|
|
14
|
+
animationOfCarousel,
|
|
15
|
+
} from './animation';
|
|
16
|
+
import dimension from './dimension';
|
|
17
|
+
import label, {
|
|
18
|
+
labelOfPie,
|
|
19
|
+
labelOfRose,
|
|
20
|
+
axisLabel,
|
|
21
|
+
valueAsixLabel,
|
|
22
|
+
} from './label';
|
|
23
|
+
import legend, { legendOfPie, legendOfRose, legendOfDoublePie } from './legend';
|
|
24
|
+
import tooltip from './tooltip';
|
|
25
|
+
import axes, { valueAxis, categoryAxis } from './axes';
|
|
26
|
+
import mapping from './mapping';
|
|
27
|
+
import {
|
|
28
|
+
bandSeries,
|
|
29
|
+
lineSeries,
|
|
30
|
+
areaSeries,
|
|
31
|
+
pieSeries,
|
|
32
|
+
purePieSeries,
|
|
33
|
+
} from './series';
|
|
34
|
+
import pie, {
|
|
35
|
+
rosePie,
|
|
36
|
+
rosePieDecorate,
|
|
37
|
+
donut,
|
|
38
|
+
carouselDonut,
|
|
39
|
+
nestRosePie,
|
|
40
|
+
carouselDonut2,
|
|
41
|
+
current as pieCurrent,
|
|
42
|
+
} from './pie';
|
|
43
|
+
import brush from './brush';
|
|
44
|
+
import interaction from './interaction';
|
|
45
|
+
import sc from './sc';
|
|
46
|
+
import shadow from './shadow';
|
|
47
|
+
import textOverflow from './textOverflow';
|
|
48
|
+
import baseLine from './baseLine';
|
|
49
|
+
export {
|
|
50
|
+
show,
|
|
51
|
+
showRule,
|
|
52
|
+
font,
|
|
53
|
+
tooltip,
|
|
54
|
+
translate,
|
|
55
|
+
textOverflow,
|
|
56
|
+
extent,
|
|
57
|
+
unit,
|
|
58
|
+
margin,
|
|
59
|
+
multiColor,
|
|
60
|
+
animation,
|
|
61
|
+
dataAnimation,
|
|
62
|
+
animationOfPie,
|
|
63
|
+
animationOfCarousel,
|
|
64
|
+
dimension,
|
|
65
|
+
gridLine,
|
|
66
|
+
tickLine,
|
|
67
|
+
axisLine,
|
|
68
|
+
valueAxis,
|
|
69
|
+
categoryAxis,
|
|
70
|
+
axes,
|
|
71
|
+
mapping,
|
|
72
|
+
bandSeries,
|
|
73
|
+
lineSeries,
|
|
74
|
+
areaSeries,
|
|
75
|
+
pieSeries,
|
|
76
|
+
purePieSeries,
|
|
77
|
+
brush,
|
|
78
|
+
interaction,
|
|
79
|
+
legend,
|
|
80
|
+
legendOfPie,
|
|
81
|
+
legendOfRose,
|
|
82
|
+
legendOfDoublePie,
|
|
83
|
+
label,
|
|
84
|
+
labelOfPie,
|
|
85
|
+
labelOfRose,
|
|
86
|
+
axisLabel,
|
|
87
|
+
valueAsixLabel,
|
|
88
|
+
pie,
|
|
89
|
+
rosePie,
|
|
90
|
+
nestRosePie,
|
|
91
|
+
rosePieDecorate,
|
|
92
|
+
donut,
|
|
93
|
+
carouselDonut,
|
|
94
|
+
carouselDonut2,
|
|
95
|
+
pieCurrent,
|
|
96
|
+
sc,
|
|
97
|
+
shadow,
|
|
98
|
+
baseLine
|
|
99
|
+
};
|
package/src/interaction.js
CHANGED
|
@@ -1,121 +1,121 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TODO:有个触发回调的类型
|
|
3
|
-
*/
|
|
4
|
-
const defaultAction = 'click';
|
|
5
|
-
const defaultCallback = {
|
|
6
|
-
actions: [{ name: '鼠标点击', value: defaultAction }],
|
|
7
|
-
extraInput: [],
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export default ({ callback, remoteControl }) => ({
|
|
11
|
-
name: 'interaction',
|
|
12
|
-
displayName: '交互',
|
|
13
|
-
value:
|
|
14
|
-
callback || remoteControl
|
|
15
|
-
? [
|
|
16
|
-
callback &&
|
|
17
|
-
Array.isArray(callback.callback) && {
|
|
18
|
-
name: 'callback',
|
|
19
|
-
displayName: '回调参数',
|
|
20
|
-
type: 'array',
|
|
21
|
-
value: callback.callback.map(({ origin, target }, index) => ({
|
|
22
|
-
name: 'callback_' + index,
|
|
23
|
-
displayName: '回调',
|
|
24
|
-
type: 'object',
|
|
25
|
-
value: [
|
|
26
|
-
{
|
|
27
|
-
name: 'action',
|
|
28
|
-
displayName: '匹配动作',
|
|
29
|
-
type: 'select',
|
|
30
|
-
value: callback.value || defaultAction,
|
|
31
|
-
config: {
|
|
32
|
-
options: callback.actions
|
|
33
|
-
? callback.actions
|
|
34
|
-
: defaultCallback.actions,
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
name: 'origin',
|
|
39
|
-
displayName: '字段值',
|
|
40
|
-
type: 'input',
|
|
41
|
-
value: origin,
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
name: 'target',
|
|
45
|
-
displayName: '变量名',
|
|
46
|
-
type: 'input',
|
|
47
|
-
value: target,
|
|
48
|
-
},
|
|
49
|
-
...(callback.extraInput
|
|
50
|
-
? callback.extraInput
|
|
51
|
-
: defaultCallback.extraInput),
|
|
52
|
-
],
|
|
53
|
-
})),
|
|
54
|
-
config: {
|
|
55
|
-
template: [
|
|
56
|
-
{
|
|
57
|
-
name: 'callback',
|
|
58
|
-
displayName: '回调',
|
|
59
|
-
type: 'object',
|
|
60
|
-
value: [
|
|
61
|
-
{
|
|
62
|
-
name: 'actions',
|
|
63
|
-
displayName: '匹配动作',
|
|
64
|
-
type: 'select',
|
|
65
|
-
value: callback.value || defaultAction,
|
|
66
|
-
config: {
|
|
67
|
-
options: callback.actions
|
|
68
|
-
? callback.actions
|
|
69
|
-
: defaultCallback.actions,
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
name: 'origin',
|
|
74
|
-
displayName: '字段值',
|
|
75
|
-
type: 'input',
|
|
76
|
-
value: '',
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
name: 'target',
|
|
80
|
-
displayName: '变量名',
|
|
81
|
-
type: 'input',
|
|
82
|
-
value: '',
|
|
83
|
-
config:{
|
|
84
|
-
callback:true
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
...(callback.extraInput
|
|
88
|
-
? callback.extraInput
|
|
89
|
-
: defaultCallback.extraInput),
|
|
90
|
-
],
|
|
91
|
-
},
|
|
92
|
-
],
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
remoteControl &&
|
|
96
|
-
Array.isArray(remoteControl) && {
|
|
97
|
-
name: 'remoteControl',
|
|
98
|
-
displayName: '远程控制',
|
|
99
|
-
type: 'array',
|
|
100
|
-
value: [],
|
|
101
|
-
config: {
|
|
102
|
-
template: [
|
|
103
|
-
{
|
|
104
|
-
name: 'controls',
|
|
105
|
-
displayName: '控制',
|
|
106
|
-
type: 'object',
|
|
107
|
-
value: [
|
|
108
|
-
{
|
|
109
|
-
name: 'control',
|
|
110
|
-
displayName: '控制',
|
|
111
|
-
type: 'remoteOptions',
|
|
112
|
-
value: '{}',
|
|
113
|
-
},
|
|
114
|
-
],
|
|
115
|
-
},
|
|
116
|
-
],
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
].filter((item) => !!item)
|
|
120
|
-
: [],
|
|
121
|
-
});
|
|
1
|
+
/**
|
|
2
|
+
* TODO:有个触发回调的类型
|
|
3
|
+
*/
|
|
4
|
+
const defaultAction = 'click';
|
|
5
|
+
const defaultCallback = {
|
|
6
|
+
actions: [{ name: '鼠标点击', value: defaultAction }],
|
|
7
|
+
extraInput: [],
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default ({ callback, remoteControl }) => ({
|
|
11
|
+
name: 'interaction',
|
|
12
|
+
displayName: '交互',
|
|
13
|
+
value:
|
|
14
|
+
callback || remoteControl
|
|
15
|
+
? [
|
|
16
|
+
callback &&
|
|
17
|
+
Array.isArray(callback.callback) && {
|
|
18
|
+
name: 'callback',
|
|
19
|
+
displayName: '回调参数',
|
|
20
|
+
type: 'array',
|
|
21
|
+
value: callback.callback.map(({ origin, target }, index) => ({
|
|
22
|
+
name: 'callback_' + index,
|
|
23
|
+
displayName: '回调',
|
|
24
|
+
type: 'object',
|
|
25
|
+
value: [
|
|
26
|
+
{
|
|
27
|
+
name: 'action',
|
|
28
|
+
displayName: '匹配动作',
|
|
29
|
+
type: 'select',
|
|
30
|
+
value: callback.value || defaultAction,
|
|
31
|
+
config: {
|
|
32
|
+
options: callback.actions
|
|
33
|
+
? callback.actions
|
|
34
|
+
: defaultCallback.actions,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'origin',
|
|
39
|
+
displayName: '字段值',
|
|
40
|
+
type: 'input',
|
|
41
|
+
value: origin,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'target',
|
|
45
|
+
displayName: '变量名',
|
|
46
|
+
type: 'input',
|
|
47
|
+
value: target,
|
|
48
|
+
},
|
|
49
|
+
...(callback.extraInput
|
|
50
|
+
? callback.extraInput
|
|
51
|
+
: defaultCallback.extraInput),
|
|
52
|
+
],
|
|
53
|
+
})),
|
|
54
|
+
config: {
|
|
55
|
+
template: [
|
|
56
|
+
{
|
|
57
|
+
name: 'callback',
|
|
58
|
+
displayName: '回调',
|
|
59
|
+
type: 'object',
|
|
60
|
+
value: [
|
|
61
|
+
{
|
|
62
|
+
name: 'actions',
|
|
63
|
+
displayName: '匹配动作',
|
|
64
|
+
type: 'select',
|
|
65
|
+
value: callback.value || defaultAction,
|
|
66
|
+
config: {
|
|
67
|
+
options: callback.actions
|
|
68
|
+
? callback.actions
|
|
69
|
+
: defaultCallback.actions,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'origin',
|
|
74
|
+
displayName: '字段值',
|
|
75
|
+
type: 'input',
|
|
76
|
+
value: '',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'target',
|
|
80
|
+
displayName: '变量名',
|
|
81
|
+
type: 'input',
|
|
82
|
+
value: '',
|
|
83
|
+
config:{
|
|
84
|
+
callback:true
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
...(callback.extraInput
|
|
88
|
+
? callback.extraInput
|
|
89
|
+
: defaultCallback.extraInput),
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
remoteControl &&
|
|
96
|
+
Array.isArray(remoteControl) && {
|
|
97
|
+
name: 'remoteControl',
|
|
98
|
+
displayName: '远程控制',
|
|
99
|
+
type: 'array',
|
|
100
|
+
value: [],
|
|
101
|
+
config: {
|
|
102
|
+
template: [
|
|
103
|
+
{
|
|
104
|
+
name: 'controls',
|
|
105
|
+
displayName: '控制',
|
|
106
|
+
type: 'object',
|
|
107
|
+
value: [
|
|
108
|
+
{
|
|
109
|
+
name: 'control',
|
|
110
|
+
displayName: '控制',
|
|
111
|
+
type: 'remoteOptions',
|
|
112
|
+
value: '{}',
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
].filter((item) => !!item)
|
|
120
|
+
: [],
|
|
121
|
+
});
|