@easyv/config 1.1.35 → 1.1.37
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/lib/control.js +38 -8
- package/lib/index.js +7 -1
- package/lib/translate.js +41 -2
- package/package.json +1 -1
- package/src/control.js +33 -8
- package/src/index.js +2 -1
- package/src/translate.js +39 -0
package/lib/control.js
CHANGED
|
@@ -4,19 +4,48 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.control = void 0;
|
|
7
|
+
var defaultControl = {
|
|
8
|
+
height: 20,
|
|
9
|
+
color: "rgba(20, 95, 255, 0.1)",
|
|
10
|
+
margin: {
|
|
11
|
+
left: 40,
|
|
12
|
+
right: 40
|
|
13
|
+
},
|
|
14
|
+
drag: {
|
|
15
|
+
width: 30,
|
|
16
|
+
color: "RGBA(255, 255, 255, .3)"
|
|
17
|
+
}
|
|
18
|
+
};
|
|
7
19
|
var control = function control() {
|
|
20
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultControl,
|
|
21
|
+
_ref$height = _ref.height,
|
|
22
|
+
height = _ref$height === void 0 ? defaultControl.height : _ref$height,
|
|
23
|
+
_ref$color = _ref.color,
|
|
24
|
+
color = _ref$color === void 0 ? defaultControl.color : _ref$color,
|
|
25
|
+
_ref$margin = _ref.margin;
|
|
26
|
+
_ref$margin = _ref$margin === void 0 ? defaultControl.margin : _ref$margin;
|
|
27
|
+
var _ref$margin$left = _ref$margin.left,
|
|
28
|
+
left = _ref$margin$left === void 0 ? defaultControl.margin.left : _ref$margin$left,
|
|
29
|
+
_ref$margin$right = _ref$margin.right,
|
|
30
|
+
right = _ref$margin$right === void 0 ? defaultControl.margin.right : _ref$margin$right,
|
|
31
|
+
_ref$drag = _ref.drag;
|
|
32
|
+
_ref$drag = _ref$drag === void 0 ? defaultControl.drag : _ref$drag;
|
|
33
|
+
var _ref$drag$width = _ref$drag.width,
|
|
34
|
+
width = _ref$drag$width === void 0 ? defaultControl.drag.width : _ref$drag$width,
|
|
35
|
+
_ref$drag$color = _ref$drag.color,
|
|
36
|
+
dragColor = _ref$drag$color === void 0 ? defaultControl.drag.color : _ref$drag$color;
|
|
8
37
|
return {
|
|
9
38
|
name: "control",
|
|
10
39
|
displayName: "控制条",
|
|
11
40
|
value: [{
|
|
12
41
|
name: "height",
|
|
13
42
|
displayName: "高度",
|
|
14
|
-
value:
|
|
43
|
+
value: height,
|
|
15
44
|
type: "number"
|
|
16
45
|
}, {
|
|
17
46
|
name: "color",
|
|
18
47
|
displayName: "背景颜色",
|
|
19
|
-
value:
|
|
48
|
+
value: color,
|
|
20
49
|
type: "color"
|
|
21
50
|
}, {
|
|
22
51
|
type: "group",
|
|
@@ -25,7 +54,7 @@ var control = function control() {
|
|
|
25
54
|
value: [{
|
|
26
55
|
name: "left",
|
|
27
56
|
displayName: "左边距",
|
|
28
|
-
value:
|
|
57
|
+
value: left,
|
|
29
58
|
type: "number",
|
|
30
59
|
config: {
|
|
31
60
|
span: 12
|
|
@@ -33,7 +62,7 @@ var control = function control() {
|
|
|
33
62
|
}, {
|
|
34
63
|
name: "right",
|
|
35
64
|
displayName: "右边距",
|
|
36
|
-
value:
|
|
65
|
+
value: right,
|
|
37
66
|
type: "number",
|
|
38
67
|
config: {
|
|
39
68
|
span: 12
|
|
@@ -45,16 +74,17 @@ var control = function control() {
|
|
|
45
74
|
value: [{
|
|
46
75
|
name: "width",
|
|
47
76
|
displayName: "宽度",
|
|
48
|
-
value:
|
|
49
|
-
type: "
|
|
77
|
+
value: width,
|
|
78
|
+
type: "range",
|
|
50
79
|
config: {
|
|
51
80
|
suffix: "%",
|
|
52
|
-
min: 1
|
|
81
|
+
min: 1,
|
|
82
|
+
max: 100
|
|
53
83
|
}
|
|
54
84
|
}, {
|
|
55
85
|
name: "color",
|
|
56
86
|
displayName: "颜色",
|
|
57
|
-
value:
|
|
87
|
+
value: dragColor,
|
|
58
88
|
type: "color"
|
|
59
89
|
}]
|
|
60
90
|
}]
|
package/lib/index.js
CHANGED
|
@@ -299,6 +299,12 @@ Object.defineProperty(exports, "translate", {
|
|
|
299
299
|
return _translate["default"];
|
|
300
300
|
}
|
|
301
301
|
});
|
|
302
|
+
Object.defineProperty(exports, "translate3d", {
|
|
303
|
+
enumerable: true,
|
|
304
|
+
get: function get() {
|
|
305
|
+
return _translate.translate3d;
|
|
306
|
+
}
|
|
307
|
+
});
|
|
302
308
|
Object.defineProperty(exports, "unit", {
|
|
303
309
|
enumerable: true,
|
|
304
310
|
get: function get() {
|
|
@@ -319,7 +325,7 @@ Object.defineProperty(exports, "valueAxis", {
|
|
|
319
325
|
});
|
|
320
326
|
var _show = _interopRequireWildcard(require("./show"));
|
|
321
327
|
var _font = _interopRequireDefault(require("./font"));
|
|
322
|
-
var _translate =
|
|
328
|
+
var _translate = _interopRequireWildcard(require("./translate"));
|
|
323
329
|
var _gridLine = _interopRequireDefault(require("./gridLine"));
|
|
324
330
|
var _tickLine = _interopRequireDefault(require("./tickLine"));
|
|
325
331
|
var _axisLine = _interopRequireDefault(require("./axisLine"));
|
package/lib/translate.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports["default"] = void 0;
|
|
6
|
+
exports.translate3d = exports["default"] = void 0;
|
|
7
7
|
var _default = function _default() {
|
|
8
8
|
var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
9
9
|
var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
@@ -32,4 +32,43 @@ var _default = function _default() {
|
|
|
32
32
|
type: 'group'
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
|
-
exports["default"] = _default;
|
|
35
|
+
exports["default"] = _default;
|
|
36
|
+
var translate3d = function translate3d() {
|
|
37
|
+
var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
38
|
+
var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
39
|
+
var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
40
|
+
return {
|
|
41
|
+
name: 'translate3d',
|
|
42
|
+
displayName: '偏移',
|
|
43
|
+
value: [{
|
|
44
|
+
name: 'x',
|
|
45
|
+
displayName: 'X',
|
|
46
|
+
value: x,
|
|
47
|
+
type: 'number',
|
|
48
|
+
config: {
|
|
49
|
+
suffix: 'px',
|
|
50
|
+
span: 12
|
|
51
|
+
}
|
|
52
|
+
}, {
|
|
53
|
+
name: 'y',
|
|
54
|
+
displayName: 'Y',
|
|
55
|
+
value: y,
|
|
56
|
+
type: 'number',
|
|
57
|
+
config: {
|
|
58
|
+
suffix: 'px',
|
|
59
|
+
span: 12
|
|
60
|
+
}
|
|
61
|
+
}, {
|
|
62
|
+
name: 'z',
|
|
63
|
+
displayName: 'Z',
|
|
64
|
+
value: z,
|
|
65
|
+
type: 'number',
|
|
66
|
+
config: {
|
|
67
|
+
suffix: 'px',
|
|
68
|
+
span: 12
|
|
69
|
+
}
|
|
70
|
+
}],
|
|
71
|
+
type: 'group'
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
exports.translate3d = translate3d;
|
package/package.json
CHANGED
package/src/control.js
CHANGED
|
@@ -1,4 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
const defaultControl={
|
|
2
|
+
height:20,
|
|
3
|
+
color:"rgba(20, 95, 255, 0.1)",
|
|
4
|
+
margin:{
|
|
5
|
+
left:40,
|
|
6
|
+
right:40
|
|
7
|
+
},
|
|
8
|
+
drag:{
|
|
9
|
+
width:30,
|
|
10
|
+
color:"RGBA(255, 255, 255, .3)"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const control = ({
|
|
15
|
+
height = defaultControl.height,
|
|
16
|
+
color = defaultControl.color,
|
|
17
|
+
margin:{
|
|
18
|
+
left = defaultControl.margin.left,
|
|
19
|
+
right = defaultControl.margin.right
|
|
20
|
+
} = defaultControl.margin,
|
|
21
|
+
drag:{
|
|
22
|
+
width = defaultControl.drag.width,
|
|
23
|
+
color:dragColor = defaultControl.drag.color
|
|
24
|
+
} = defaultControl.drag
|
|
25
|
+
} = defaultControl) => {
|
|
2
26
|
return {
|
|
3
27
|
name: "control",
|
|
4
28
|
displayName: "控制条",
|
|
@@ -6,13 +30,13 @@ export const control = () => {
|
|
|
6
30
|
{
|
|
7
31
|
name: "height",
|
|
8
32
|
displayName: "高度",
|
|
9
|
-
value:
|
|
33
|
+
value: height,
|
|
10
34
|
type: "number",
|
|
11
35
|
},
|
|
12
36
|
{
|
|
13
37
|
name: "color",
|
|
14
38
|
displayName: "背景颜色",
|
|
15
|
-
value:
|
|
39
|
+
value: color,
|
|
16
40
|
type: "color",
|
|
17
41
|
},
|
|
18
42
|
{
|
|
@@ -23,7 +47,7 @@ export const control = () => {
|
|
|
23
47
|
{
|
|
24
48
|
name: "left",
|
|
25
49
|
displayName: "左边距",
|
|
26
|
-
value:
|
|
50
|
+
value: left,
|
|
27
51
|
type: "number",
|
|
28
52
|
config: {
|
|
29
53
|
span: 12,
|
|
@@ -32,7 +56,7 @@ export const control = () => {
|
|
|
32
56
|
{
|
|
33
57
|
name: "right",
|
|
34
58
|
displayName: "右边距",
|
|
35
|
-
value:
|
|
59
|
+
value: right,
|
|
36
60
|
type: "number",
|
|
37
61
|
config: {
|
|
38
62
|
span: 12,
|
|
@@ -47,17 +71,18 @@ export const control = () => {
|
|
|
47
71
|
{
|
|
48
72
|
name: "width",
|
|
49
73
|
displayName: "宽度",
|
|
50
|
-
value:
|
|
51
|
-
type: "
|
|
74
|
+
value: width,
|
|
75
|
+
type: "range",
|
|
52
76
|
config: {
|
|
53
77
|
suffix: "%",
|
|
54
78
|
min: 1,
|
|
79
|
+
max:100
|
|
55
80
|
},
|
|
56
81
|
},
|
|
57
82
|
{
|
|
58
83
|
name: "color",
|
|
59
84
|
displayName: "颜色",
|
|
60
|
-
value:
|
|
85
|
+
value: dragColor,
|
|
61
86
|
type: "color",
|
|
62
87
|
},
|
|
63
88
|
],
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import show, { showRule } from './show';
|
|
2
2
|
import font from './font';
|
|
3
|
-
import translate from './translate';
|
|
3
|
+
import translate, { translate3d } from './translate';
|
|
4
4
|
import gridLine from './gridLine';
|
|
5
5
|
import tickLine from './tickLine';
|
|
6
6
|
import axisLine from './axisLine';
|
|
@@ -57,6 +57,7 @@ export {
|
|
|
57
57
|
font,
|
|
58
58
|
tooltip,
|
|
59
59
|
translate,
|
|
60
|
+
translate3d,
|
|
60
61
|
textOverflow,
|
|
61
62
|
extent,
|
|
62
63
|
unit,
|
package/src/translate.js
CHANGED
|
@@ -25,3 +25,42 @@ export default (x = 0, y = 0) => ({
|
|
|
25
25
|
],
|
|
26
26
|
type: 'group',
|
|
27
27
|
});
|
|
28
|
+
|
|
29
|
+
export const translate3d = (x = 0, y = 0, z=0) => ({
|
|
30
|
+
name: 'translate3d',
|
|
31
|
+
displayName: '偏移',
|
|
32
|
+
value: [
|
|
33
|
+
{
|
|
34
|
+
name: 'x',
|
|
35
|
+
displayName: 'X',
|
|
36
|
+
value: x,
|
|
37
|
+
type: 'number',
|
|
38
|
+
config: {
|
|
39
|
+
suffix: 'px',
|
|
40
|
+
span: 12,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'y',
|
|
45
|
+
displayName: 'Y',
|
|
46
|
+
value: y,
|
|
47
|
+
type: 'number',
|
|
48
|
+
config: {
|
|
49
|
+
suffix: 'px',
|
|
50
|
+
span: 12,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'z',
|
|
55
|
+
displayName: 'Z',
|
|
56
|
+
value: z,
|
|
57
|
+
type: 'number',
|
|
58
|
+
config: {
|
|
59
|
+
suffix: 'px',
|
|
60
|
+
span: 12
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
type: 'group',
|
|
65
|
+
});
|
|
66
|
+
|