@easyv/config 1.2.6 → 1.2.8

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,331 +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: 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
- });
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
+ });