@easyv/config 1.1.33 → 1.1.35

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/src/pieTooltip.js CHANGED
@@ -1,333 +1,331 @@
1
- import { translate, margin } from ".";
2
- const defaultTooltip = {
3
- manual: true,
4
- tip: {
5
- translate: { x: 0, y: 0 },
6
- image: "",
7
- size: { width: 120, height: 40 },
8
- margin: {
9
- marginTop: 10,
10
- marginBottom: 10,
11
- marginLeft: 10,
12
- marginRight: 10,
13
- },
14
- data: {
15
- lineHeight: 18,
16
- iconSize: 10,
17
- num: "",
18
- name: {
19
- fontFamily: "Mircosoft Yahei",
20
- fontSize: 12,
21
- color: "#C8E7FF",
22
- bold: false,
23
- italic: false,
24
- letterSpacing: 0,
25
- },
26
- value: {
27
- font: {
28
- fontFamily: "Mircosoft Yahei",
29
- fontSize: 12,
30
- color: "#D4EFFC",
31
- bold: false,
32
- italic: false,
33
- letterSpacing: 0,
34
- },
35
- },
36
- percentage: {
37
- font: {
38
- fontFamily: "Mircosoft Yahei",
39
- fontSize: 12,
40
- color: "#D4EFFC",
41
- bold: false,
42
- italic: false,
43
- letterSpacing: 0,
44
- },
45
- },
46
- suffix: {
47
- font: {
48
- fontFamily: "Mircosoft Yahei",
49
- fontSize: 12,
50
- color: "#D4EFFC",
51
- bold: false,
52
- italic: false,
53
- letterSpacing: 0,
54
- },
55
- translate: { x: 0, y: 0 },
56
- },
57
- },
58
- },
59
- };
60
- export default ({
61
- manual = defaultTooltip.manual,
62
- tip: {
63
- translate: {
64
- x: tipTranslateX = defaultTooltip.tip.translate.x,
65
- y: tipTranslateY = defaultTooltip.tip.translate.y,
66
- } = defaultTooltip.tip.translate,
67
- image = defaultTooltip.tip.image,
68
- size: {
69
- width: tipWidth = defaultTooltip.tip.size.width,
70
- height: tipHeight = defaultTooltip.tip.size.height,
71
- } = defaultTooltip.tip.size,
72
- margin: {
73
- marginTop = defaultTooltip.tip.margin.marginTop,
74
- marginBottom = defaultTooltip.tip.margin.marginBottom,
75
- marginLeft = defaultTooltip.tip.margin.marginLeft,
76
- marginRight = defaultTooltip.tip.margin.marginRight,
77
- } = defaultTooltip.tip.margin,
78
- data: {
79
- lineHeight = defaultTooltip.tip.data.lineHeight,
80
- iconSize = defaultTooltip.tip.data.iconSize,
81
- num = defaultTooltip.tip.data.num,
82
- name: {
83
- fontFamily: nameFontFamily,
84
- fontSize: nameFontSize,
85
- color: nameColor,
86
- bold: nameBold,
87
- italic: nameItalic,
88
- letterSpacing: nameLetterSpacing,
89
- } = defaultTooltip.tip.data.name,
90
- value: {
91
- font: {
92
- fontFamily: valueFontFamily,
93
- fontSize: valueFontSize,
94
- color: valueFontColor,
95
- bold: valueFontBold,
96
- italic: valueFontItalic,
97
- letterSpacing: valueFontLetterSpacing,
98
- },
99
- } = defaultTooltip.tip.data.value,
100
- percentage: {
101
- font: {
102
- fontFamily: percentageFontFamily,
103
- fontSize: percentageFontSize,
104
- color: percentageFontColor,
105
- bold: percentageFontBold,
106
- italic: percentageFontItalic,
107
- letterSpacing: percentageFontLetterSpacing,
108
- },
109
- } = defaultTooltip.tip.data.percentage,
110
- suffix: {
111
- font: {
112
- fontFamily: suffixFontFamily,
113
- fontSize: suffixFontSize,
114
- color: suffixColor,
115
- bold: suffixBold,
116
- italic: suffixItalic,
117
- letterSpacing: suffixLetterSpacing,
118
- } = defaultTooltip.tip.data.suffix.font,
119
- } = defaultTooltip.tip.data.suffix,
120
- },
121
- } = defaultTooltip.tip,
122
- } = defaultTooltip) => ({
123
- name: "tooltip",
124
- displayName: "提示框",
125
- value: [
126
- {
127
- name: "manual",
128
- displayName: "悬停触发",
129
- value: manual,
130
- type: "boolean",
131
- },
132
- {
133
- name: "tip",
134
- displayName: "提示框",
135
- value: [
136
- translate(tipTranslateX, tipTranslateY),
137
- {
138
- type: "uploadImage",
139
- name: "image",
140
- displayName: "背景",
141
- value: image,
142
- },
143
- {
144
- name: "size",
145
- displayName: "尺寸",
146
- value: [
147
- {
148
- name: "width",
149
- displayName: "宽度",
150
- value: tipWidth,
151
- config: {
152
- span: 12,
153
- suffix: "W",
154
- },
155
- },
156
- {
157
- name: "height",
158
- displayName: "高度",
159
- value: tipHeight,
160
- config: {
161
- span: 12,
162
- suffix: "H",
163
- },
164
- },
165
- ],
166
- type: "group",
167
- },
168
- margin({
169
- marginTop,
170
- marginRight,
171
- marginBottom,
172
- marginLeft,
173
- }),
174
- {
175
- displayName: "数据",
176
- name: "data",
177
- value: [
178
- {
179
- displayName: "行间距",
180
- type: "number",
181
- value: lineHeight,
182
- name: "lineHeight",
183
- },
184
- {
185
- displayName: "图标尺寸",
186
- type: "number",
187
- value: iconSize,
188
- name: "iconSize",
189
- },
190
- {
191
- displayName: "保留小数",
192
- type: "input",
193
- value: num,
194
- name: "num",
195
- },
196
- {
197
- name: "name",
198
- displayName: "系列名称",
199
- value: {
200
- fontFamily: nameFontFamily,
201
- fontSize: nameFontSize,
202
- color: nameColor,
203
- bold: nameBold,
204
- italic: nameItalic,
205
- letterSpacing: nameLetterSpacing,
206
- },
207
- type: "textStyle",
208
- markColorType: "textColor",
209
- },
210
- {
211
- name: "value",
212
- displayName: "系列值",
213
- value: [
214
- {
215
- name: "show",
216
- displayName: "显示",
217
- value: true,
218
- type: "boolean",
219
- },
220
- {
221
- name: "fontStyle",
222
- displayName: "文本样式",
223
- value: {
224
- fontFamily: valueFontFamily,
225
- fontSize: valueFontSize,
226
- color: valueFontColor,
227
- bold: valueFontBold,
228
- italic: valueFontItalic,
229
- letterSpacing: valueFontLetterSpacing,
230
- },
231
- type: "textStyle",
232
- markColorType: "textColor",
233
- },
234
- {
235
- name: "suffix",
236
- displayName: "后缀",
237
- value: [
238
- {
239
- name: "show",
240
- displayName: "显示",
241
- value: false,
242
- type: "boolean",
243
- },
244
- {
245
- name: "content",
246
- displayName: "内容",
247
- type: "input",
248
- value: "$",
249
- },
250
- {
251
- name: "font",
252
- displayName: "文本样式",
253
- value: {
254
- fontFamily: suffixFontFamily,
255
- fontSize: suffixFontSize,
256
- color: suffixColor,
257
- bold: suffixBold,
258
- italic: suffixItalic,
259
- letterSpacing: suffixLetterSpacing,
260
- },
261
- type: "textStyle",
262
- markColorType: "textColor",
263
- },
264
- translate(0, 0),
265
- ],
266
- },
267
- ],
268
- },
269
- {
270
- name: "percentage",
271
- displayName: "百分比",
272
- value: [
273
- {
274
- name: "show",
275
- displayName: "显示",
276
- value: true,
277
- type: "boolean",
278
- },
279
- {
280
- name: "fontStyle",
281
- displayName: "文本样式",
282
- value: {
283
- fontFamily: percentageFontFamily,
284
- fontSize: percentageFontSize,
285
- color: percentageFontColor,
286
- bold: percentageFontBold,
287
- italic: percentageFontItalic,
288
- letterSpacing: percentageFontLetterSpacing,
289
- },
290
- type: "textStyle",
291
- markColorType: "textColor",
292
- },
293
- {
294
- name: "suffix",
295
- displayName: "后缀",
296
- value: [
297
- {
298
- name: "show",
299
- displayName: "显示",
300
- value: true,
301
- type: "boolean",
302
- },
303
- {
304
- name: "content",
305
- displayName: "内容",
306
- type: "input",
307
- value: "%",
308
- },
309
- {
310
- name: "font",
311
- displayName: "文本样式",
312
- value: {
313
- fontFamily: suffixFontFamily,
314
- fontSize: suffixFontSize,
315
- color: suffixColor,
316
- bold: suffixBold,
317
- italic: suffixItalic,
318
- letterSpacing: suffixLetterSpacing,
319
- },
320
- type: "textStyle",
321
- markColorType: "textColor",
322
- },
323
- translate(0, 0),
324
- ],
325
- },
326
- ],
327
- },
328
- ],
329
- },
330
- ],
331
- },
332
- ],
333
- });
1
+ import { translate, margin } from ".";
2
+ const defaultTooltip = {
3
+ manual: true,
4
+ tip: {
5
+ translate: { x: 0, y: 0 },
6
+ image: "",
7
+ size: { width: 120, height: 40 },
8
+ margin: {
9
+ marginTop: 10,
10
+ marginBottom: 10,
11
+ marginLeft: 10,
12
+ marginRight: 10,
13
+ },
14
+ data: {
15
+ lineHeight: 18,
16
+ iconSize: 10,
17
+ num: "",
18
+ name: {
19
+ fontFamily: "Mircosoft Yahei",
20
+ fontSize: 12,
21
+ color: "#C8E7FF",
22
+ bold: false,
23
+ italic: false,
24
+ letterSpacing: 0,
25
+ },
26
+ value: {
27
+ font: {
28
+ fontFamily: "Mircosoft Yahei",
29
+ fontSize: 12,
30
+ color: "#D4EFFC",
31
+ bold: false,
32
+ italic: false,
33
+ letterSpacing: 0,
34
+ },
35
+ },
36
+ percentage: {
37
+ font: {
38
+ fontFamily: "Mircosoft Yahei",
39
+ fontSize: 12,
40
+ color: "#D4EFFC",
41
+ bold: false,
42
+ italic: false,
43
+ letterSpacing: 0,
44
+ },
45
+ },
46
+ suffix: {
47
+ font: {
48
+ fontFamily: "Mircosoft Yahei",
49
+ fontSize: 12,
50
+ color: "#D4EFFC",
51
+ bold: false,
52
+ italic: false,
53
+ letterSpacing: 0,
54
+ },
55
+ translate: { x: 0, y: 0 },
56
+ },
57
+ },
58
+ },
59
+ };
60
+ export default ({
61
+ manual = defaultTooltip.manual,
62
+ tip: {
63
+ translate: {
64
+ x: tipTranslateX = defaultTooltip.tip.translate.x,
65
+ y: tipTranslateY = defaultTooltip.tip.translate.y,
66
+ } = defaultTooltip.tip.translate,
67
+ image = defaultTooltip.tip.image,
68
+ size: {
69
+ width: tipWidth = defaultTooltip.tip.size.width,
70
+ height: tipHeight = defaultTooltip.tip.size.height,
71
+ } = defaultTooltip.tip.size,
72
+ margin: {
73
+ marginTop = defaultTooltip.tip.margin.marginTop,
74
+ marginBottom = defaultTooltip.tip.margin.marginBottom,
75
+ marginLeft = defaultTooltip.tip.margin.marginLeft,
76
+ marginRight = defaultTooltip.tip.margin.marginRight,
77
+ } = defaultTooltip.tip.margin,
78
+ data: {
79
+ lineHeight = defaultTooltip.tip.data.lineHeight,
80
+ iconSize = defaultTooltip.tip.data.iconSize,
81
+ num = defaultTooltip.tip.data.num,
82
+ name: {
83
+ fontFamily: nameFontFamily,
84
+ fontSize: nameFontSize,
85
+ color: nameColor,
86
+ bold: nameBold,
87
+ italic: nameItalic,
88
+ letterSpacing: nameLetterSpacing,
89
+ } = defaultTooltip.tip.data.name,
90
+ value: {
91
+ font: {
92
+ fontFamily: valueFontFamily,
93
+ fontSize: valueFontSize,
94
+ color: valueFontColor,
95
+ bold: valueFontBold,
96
+ italic: valueFontItalic,
97
+ letterSpacing: valueFontLetterSpacing,
98
+ },
99
+ } = defaultTooltip.tip.data.value,
100
+ percentage: {
101
+ font: {
102
+ fontFamily: percentageFontFamily,
103
+ fontSize: percentageFontSize,
104
+ color: percentageFontColor,
105
+ bold: percentageFontBold,
106
+ italic: percentageFontItalic,
107
+ letterSpacing: percentageFontLetterSpacing,
108
+ },
109
+ } = defaultTooltip.tip.data.percentage,
110
+ suffix: {
111
+ font: {
112
+ fontFamily: suffixFontFamily,
113
+ fontSize: suffixFontSize,
114
+ color: suffixColor,
115
+ bold: suffixBold,
116
+ italic: suffixItalic,
117
+ letterSpacing: suffixLetterSpacing,
118
+ } = defaultTooltip.tip.data.suffix.font,
119
+ } = defaultTooltip.tip.data.suffix,
120
+ },
121
+ } = defaultTooltip.tip,
122
+ } = defaultTooltip) => ({
123
+ name: "tooltip",
124
+ displayName: "提示框",
125
+ value: [
126
+ {
127
+ name: "manual",
128
+ displayName: "悬停触发",
129
+ value: manual,
130
+ type: "boolean",
131
+ },
132
+ {
133
+ name: "tip",
134
+ displayName: "提示框",
135
+ value: [
136
+ translate(tipTranslateX, tipTranslateY),
137
+ {
138
+ type: "uploadImage",
139
+ name: "image",
140
+ displayName: "背景",
141
+ value: image,
142
+ },
143
+ {
144
+ name: "size",
145
+ displayName: "尺寸",
146
+ value: [
147
+ {
148
+ name: "width",
149
+ displayName: "宽度",
150
+ value: tipWidth,
151
+ config: {
152
+ span: 12,
153
+ suffix: "W",
154
+ },
155
+ },
156
+ {
157
+ name: "height",
158
+ displayName: "高度",
159
+ value: tipHeight,
160
+ config: {
161
+ span: 12,
162
+ suffix: "H",
163
+ },
164
+ },
165
+ ],
166
+ type: "group",
167
+ },
168
+ margin({
169
+ marginTop,
170
+ marginRight,
171
+ marginBottom,
172
+ marginLeft,
173
+ }),
174
+ {
175
+ displayName: "数据",
176
+ name: "data",
177
+ value: [
178
+ {
179
+ displayName: "图标尺寸",
180
+ type: "number",
181
+ value: iconSize,
182
+ name: "iconSize",
183
+ },
184
+ {
185
+ name: "name",
186
+ displayName: "系列名称",
187
+ value: {
188
+ fontFamily: nameFontFamily,
189
+ fontSize: nameFontSize,
190
+ color: nameColor,
191
+ bold: nameBold,
192
+ italic: nameItalic,
193
+ letterSpacing: nameLetterSpacing,
194
+ },
195
+ type: "textStyle",
196
+ markColorType: "textColor",
197
+ },
198
+ {
199
+ name: "value",
200
+ displayName: "系列值",
201
+ value: [
202
+ {
203
+ name: "show",
204
+ displayName: "显示",
205
+ value: true,
206
+ type: "boolean",
207
+ },
208
+ {
209
+ name: "fontStyle",
210
+ displayName: "文本样式",
211
+ value: {
212
+ fontFamily: valueFontFamily,
213
+ fontSize: valueFontSize,
214
+ color: valueFontColor,
215
+ bold: valueFontBold,
216
+ italic: valueFontItalic,
217
+ letterSpacing: valueFontLetterSpacing,
218
+ },
219
+ type: "textStyle",
220
+ markColorType: "textColor",
221
+ },
222
+ {
223
+ name: "suffix",
224
+ displayName: "后缀",
225
+ value: [
226
+ {
227
+ name: "show",
228
+ displayName: "显示",
229
+ value: false,
230
+ type: "boolean",
231
+ },
232
+ {
233
+ name: "content",
234
+ displayName: "内容",
235
+ type: "input",
236
+ value: "$",
237
+ },
238
+ {
239
+ name: "font",
240
+ displayName: "文本样式",
241
+ value: {
242
+ fontFamily: suffixFontFamily,
243
+ fontSize: suffixFontSize,
244
+ color: suffixColor,
245
+ bold: suffixBold,
246
+ italic: suffixItalic,
247
+ letterSpacing: suffixLetterSpacing,
248
+ },
249
+ type: "textStyle",
250
+ markColorType: "textColor",
251
+ },
252
+ translate(0, 0),
253
+ ],
254
+ },
255
+ ],
256
+ },
257
+ {
258
+ name: "percentage",
259
+ displayName: "百分比",
260
+ value: [
261
+ {
262
+ name: "show",
263
+ displayName: "显示",
264
+ value: true,
265
+ type: "boolean",
266
+ },
267
+ {
268
+ name:'precision',
269
+ displayName:'小数位数',
270
+ value:0,
271
+ type:'input',
272
+ config:{
273
+ min:0,
274
+ step:1
275
+ }
276
+ },
277
+ {
278
+ name: "fontStyle",
279
+ displayName: "文本样式",
280
+ value: {
281
+ fontFamily: percentageFontFamily,
282
+ fontSize: percentageFontSize,
283
+ color: percentageFontColor,
284
+ bold: percentageFontBold,
285
+ italic: percentageFontItalic,
286
+ letterSpacing: percentageFontLetterSpacing,
287
+ },
288
+ type: "textStyle",
289
+ markColorType: "textColor",
290
+ },
291
+ {
292
+ name: "suffix",
293
+ displayName: "后缀",
294
+ value: [
295
+ {
296
+ name: "show",
297
+ displayName: "显示",
298
+ value: true,
299
+ type: "boolean",
300
+ },
301
+ {
302
+ name: "content",
303
+ displayName: "内容",
304
+ type: "input",
305
+ value: "%",
306
+ },
307
+ {
308
+ name: "font",
309
+ displayName: "文本样式",
310
+ value: {
311
+ fontFamily: suffixFontFamily,
312
+ fontSize: suffixFontSize,
313
+ color: suffixColor,
314
+ bold: suffixBold,
315
+ italic: suffixItalic,
316
+ letterSpacing: suffixLetterSpacing,
317
+ },
318
+ type: "textStyle",
319
+ markColorType: "textColor",
320
+ },
321
+ translate(0, 0),
322
+ ],
323
+ },
324
+ ],
325
+ },
326
+ ],
327
+ },
328
+ ],
329
+ },
330
+ ],
331
+ });