@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/lib/extent.js CHANGED
@@ -8,7 +8,8 @@ var extent = {
8
8
  min: "0",
9
9
  max: "",
10
10
  customDisplayName: "数值范围",
11
- customName: "extent"
11
+ customName: "extent",
12
+ customSuffix: ""
12
13
  };
13
14
  var _default = function _default() {
14
15
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : extent,
@@ -19,7 +20,9 @@ var _default = function _default() {
19
20
  _ref$customDisplayNam = _ref.customDisplayName,
20
21
  customDisplayName = _ref$customDisplayNam === void 0 ? extent.customDisplayName : _ref$customDisplayNam,
21
22
  _ref$customName = _ref.customName,
22
- customName = _ref$customName === void 0 ? extent.customName : _ref$customName;
23
+ customName = _ref$customName === void 0 ? extent.customName : _ref$customName,
24
+ _ref$customSuffix = _ref.customSuffix,
25
+ customSuffix = _ref$customSuffix === void 0 ? extent.customSuffix : _ref$customSuffix;
23
26
  return {
24
27
  name: customName,
25
28
  displayName: customDisplayName,
@@ -29,7 +32,8 @@ var _default = function _default() {
29
32
  value: min,
30
33
  type: "input",
31
34
  config: {
32
- span: 12
35
+ span: 12,
36
+ suffix: customSuffix
33
37
  }
34
38
  }, {
35
39
  name: "max",
@@ -37,7 +41,8 @@ var _default = function _default() {
37
41
  value: max,
38
42
  type: "input",
39
43
  config: {
40
- span: 12
44
+ span: 12,
45
+ suffix: customSuffix
41
46
  }
42
47
  }],
43
48
  type: "group"
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports["default"] = void 0;
8
8
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
- /**
10
- * TODO:有个触发回调的类型
9
+ /**
10
+ * TODO:有个触发回调的类型
11
11
  */
12
12
  var defaultAction = 'click';
13
13
  var defaultCallback = {
package/lib/label.js CHANGED
@@ -684,8 +684,13 @@ var defaultValueAxisLabel = {
684
684
  min: "0",
685
685
  max: ""
686
686
  },
687
+ percentageExtent: {
688
+ min: 80,
689
+ max: 120
690
+ },
687
691
  auto: false,
688
692
  mode: "count",
693
+ numericalRangeModel: "percentage",
689
694
  count: 3,
690
695
  step: 100,
691
696
  decimal: 0,
@@ -773,7 +778,7 @@ var valueCilpAsixLabel = function valueCilpAsixLabel() {
773
778
  displayName: "断轴模式",
774
779
  value: "manual",
775
780
  type: "radio",
776
- tip: '手动模式需要指定断轴值,如果断轴值在数据范围内,就会执行断轴,自动模式设置断轴阈值,当数据离散程度超过阈值的时候执行断轴',
781
+ tip: "手动模式需要指定断轴值,如果断轴值在数据范围内,就会执行断轴,自动模式设置断轴阈值,当数据离散程度超过阈值的时候执行断轴",
777
782
  config: {
778
783
  options: [{
779
784
  name: "手动模式",
@@ -792,7 +797,7 @@ var valueCilpAsixLabel = function valueCilpAsixLabel() {
792
797
  }, {
793
798
  name: "clipDifferenceValue",
794
799
  displayName: "断轴差值",
795
- tip: '差值越高,代表需要更大的数据离散程度才能触发断轴,反之同理',
800
+ tip: "差值越高,代表需要更大的数据离散程度才能触发断轴,反之同理",
796
801
  type: "number",
797
802
  value: 100,
798
803
  config: {
@@ -880,10 +885,18 @@ var valueAsixLabel = function valueAsixLabel() {
880
885
  min = _ref6$extent$min === void 0 ? defaultValueAxisLabel.extent.min : _ref6$extent$min,
881
886
  _ref6$extent$max = _ref6$extent.max,
882
887
  max = _ref6$extent$max === void 0 ? defaultValueAxisLabel.extent.max : _ref6$extent$max,
888
+ _ref6$percentageExten = _ref6.percentageExtent;
889
+ _ref6$percentageExten = _ref6$percentageExten === void 0 ? defaultValueAxisLabel.percentageExtent : _ref6$percentageExten;
890
+ var _ref6$percentageExten2 = _ref6$percentageExten.min,
891
+ percentMin = _ref6$percentageExten2 === void 0 ? defaultValueAxisLabel.percentageExtent.min : _ref6$percentageExten2,
892
+ _ref6$percentageExten3 = _ref6$percentageExten.max,
893
+ percentMax = _ref6$percentageExten3 === void 0 ? defaultValueAxisLabel.percentageExtent.max : _ref6$percentageExten3,
883
894
  _ref6$auto = _ref6.auto,
884
895
  auto = _ref6$auto === void 0 ? defaultValueAxisLabel.auto : _ref6$auto,
885
896
  _ref6$mode = _ref6.mode,
886
897
  mode = _ref6$mode === void 0 ? defaultValueAxisLabel.mode : _ref6$mode,
898
+ _ref6$numericalRangeM = _ref6.numericalRangeModel,
899
+ numericalRangeModel = _ref6$numericalRangeM === void 0 ? defaultValueAxisLabel.numericalRangeModel : _ref6$numericalRangeM,
887
900
  _ref6$count = _ref6.count,
888
901
  count = _ref6$count === void 0 ? defaultValueAxisLabel.count : _ref6$count,
889
902
  _ref6$step = _ref6.step,
@@ -908,11 +921,34 @@ var valueAsixLabel = function valueAsixLabel() {
908
921
  displayName: "显示",
909
922
  value: showLabel,
910
923
  type: "boolean"
924
+ }, {
925
+ rule: [["show", "$eq", true]],
926
+ name: "numericalRangeModel",
927
+ displayName: "范围模式",
928
+ value: numericalRangeModel,
929
+ type: "radio",
930
+ tip: "真实值模式会取填入的值来作为轴的最大最小值,而百分比模式会取数据中最小值乘上数值范围中的最小值百分比作为作为轴的最小值,最大值同理",
931
+ config: {
932
+ options: [{
933
+ name: "真实值",
934
+ value: "value"
935
+ }, {
936
+ name: "百分比",
937
+ value: "percentage"
938
+ }]
939
+ }
911
940
  }, _objectSpread({
912
- rule: [["show", "$eq", true]]
941
+ rule: [["show", "$eq", true], ["numericalRangeModel", "$eq", "value"]]
913
942
  }, (0, _.extent)({
914
943
  min: min,
915
944
  max: max
945
+ })), _objectSpread({
946
+ rule: [["show", "$eq", true], ["numericalRangeModel", "$eq", "percentage"]]
947
+ }, (0, _.extent)({
948
+ min: percentMin,
949
+ max: percentMax,
950
+ customSuffix: '%',
951
+ customName: 'percentageExtent'
916
952
  })), {
917
953
  rule: [["show", "$eq", true]],
918
954
  name: "auto",
package/lib/pie.js CHANGED
@@ -176,6 +176,7 @@ var gridLine = function gridLine() {
176
176
  };
177
177
  var defaultRoseAxis = {
178
178
  axis: {
179
+ layout: "ring",
179
180
  count: 6,
180
181
  textStyle: (0, _.font)(),
181
182
  gap: 10,
@@ -195,7 +196,9 @@ var roseCategoryAxis = function roseCategoryAxis() {
195
196
  var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultRoseAxis,
196
197
  _ref4$axis = _ref4.axis;
197
198
  _ref4$axis = _ref4$axis === void 0 ? defaultRoseAxis.axis : _ref4$axis;
198
- var _ref4$axis$textStyle = _ref4$axis.textStyle,
199
+ var _ref4$axis$layout = _ref4$axis.layout,
200
+ layout = _ref4$axis$layout === void 0 ? defaultRoseAxis.axis.layout : _ref4$axis$layout,
201
+ _ref4$axis$textStyle = _ref4$axis.textStyle,
199
202
  textStyle = _ref4$axis$textStyle === void 0 ? defaultRoseAxis.axis.textStyle : _ref4$axis$textStyle,
200
203
  _ref4$axis$gap = _ref4$axis.gap,
201
204
  gap = _ref4$axis$gap === void 0 ? defaultRoseAxis.axis.gap : _ref4$axis$gap,
@@ -206,7 +209,15 @@ var roseCategoryAxis = function roseCategoryAxis() {
206
209
  return {
207
210
  name: 'categoryAxis',
208
211
  displayName: '类目轴',
209
- value: [{
212
+ value: [(0, _.sc)("layout", "布局", "radio", layout, {
213
+ options: [{
214
+ name: "环形",
215
+ value: 'ring'
216
+ }, {
217
+ name: "横排",
218
+ value: "line"
219
+ }]
220
+ }), {
210
221
  name: 'textStyle',
211
222
  displayName: '标签文本',
212
223
  value: (0, _.font)(textStyle),
package/package.json CHANGED
@@ -1,31 +1,31 @@
1
- {
2
- "name": "@easyv/config",
3
- "version": "1.2.6",
4
- "description": "",
5
- "main": "index.js",
6
- "scripts": {
7
- "make": "babel src -d lib",
8
- "release": "standard-version"
9
- },
10
- "keywords": [],
11
- "author": "",
12
- "license": "ISC",
13
- "devDependencies": {
14
- "@babel/cli": "^7.6.0",
15
- "@babel/core": "^7.11.5",
16
- "@babel/plugin-proposal-class-properties": "^7.10.4",
17
- "@babel/plugin-proposal-export-default-from": "^7.10.4",
18
- "@babel/plugin-transform-runtime": "^7.11.5",
19
- "@babel/preset-env": "^7.11.5",
20
- "@babel/preset-react": "^7.10.4",
21
- "@babel/runtime": "^7.17.7",
22
- "babel-plugin-transform-import-styles": "0.0.11",
23
- "babel-preset-env": "^1.7.0",
24
- "standard-version": "^9.3.2"
25
- },
26
- "standard-version": {
27
- "skip": {
28
- "commit": true
29
- }
30
- }
1
+ {
2
+ "name": "@easyv/config",
3
+ "version": "1.2.8",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "make": "babel src -d lib",
8
+ "release": "standard-version"
9
+ },
10
+ "keywords": [],
11
+ "author": "",
12
+ "license": "ISC",
13
+ "devDependencies": {
14
+ "@babel/cli": "^7.6.0",
15
+ "@babel/core": "^7.11.5",
16
+ "@babel/plugin-proposal-class-properties": "^7.10.4",
17
+ "@babel/plugin-proposal-export-default-from": "^7.10.4",
18
+ "@babel/plugin-transform-runtime": "^7.11.5",
19
+ "@babel/preset-env": "^7.11.5",
20
+ "@babel/preset-react": "^7.10.4",
21
+ "@babel/runtime": "^7.17.7",
22
+ "babel-plugin-transform-import-styles": "0.0.11",
23
+ "babel-preset-env": "^1.7.0",
24
+ "standard-version": "^9.3.2"
25
+ },
26
+ "standard-version": {
27
+ "skip": {
28
+ "commit": true
29
+ }
30
+ }
31
31
  }
package/src/control.js CHANGED
@@ -1,104 +1,104 @@
1
- const defaultControl={
2
- height:20,
3
- color:"rgba(20, 95, 255, 0.1)",
4
- margin:{
5
- left:40,
6
- right:40
7
- },
8
- gap:20,
9
- drag:{
10
- width:30,
11
- color:"RGBA(255, 255, 255, .3)"
12
- }
13
- }
14
-
15
- export const control = ({
16
- height = defaultControl.height,
17
- color = defaultControl.color,
18
- margin:{
19
- left = defaultControl.margin.left,
20
- right = defaultControl.margin.right
21
- } = defaultControl.margin,
22
- gap = defaultControl.gap,
23
- drag:{
24
- width = defaultControl.drag.width,
25
- color:dragColor = defaultControl.drag.color
26
- } = defaultControl.drag
27
- } = defaultControl) => {
28
- return {
29
- name: "control",
30
- displayName: "控制条",
31
- value: [
32
- {
33
- name: "height",
34
- displayName: "高度",
35
- value: height,
36
- type: "number",
37
- },
38
- {
39
- name: "color",
40
- displayName: "背景颜色",
41
- value: color,
42
- type: "color",
43
- },
44
- {
45
- type: "group",
46
- name: "margin",
47
- displayName: "边距",
48
- value: [
49
- {
50
- name: "left",
51
- displayName: "左边距",
52
- value: left,
53
- type: "number",
54
- config: {
55
- span: 12,
56
- },
57
- },
58
- {
59
- name: "right",
60
- displayName: "右边距",
61
- value: right,
62
- type: "number",
63
- config: {
64
- span: 12,
65
- },
66
- },
67
- ],
68
- },
69
- {
70
- name:"gap",
71
- displayName:"上间距",
72
- type:"number",
73
- value:gap,
74
- config:{
75
- suffix:"px"
76
- },
77
- tip:"与X轴的距离"
78
- },
79
- {
80
- name: "drag",
81
- displayName: "详情区域",
82
- value: [
83
- {
84
- name: "width",
85
- displayName: "宽度",
86
- value: width,
87
- type: "range",
88
- config: {
89
- suffix: "%",
90
- min: 1,
91
- max:100
92
- },
93
- },
94
- {
95
- name: "color",
96
- displayName: "颜色",
97
- value: dragColor,
98
- type: "color",
99
- },
100
- ],
101
- },
102
- ],
103
- };
104
- };
1
+ const defaultControl={
2
+ height:20,
3
+ color:"rgba(20, 95, 255, 0.1)",
4
+ margin:{
5
+ left:40,
6
+ right:40
7
+ },
8
+ gap:20,
9
+ drag:{
10
+ width:30,
11
+ color:"RGBA(255, 255, 255, .3)"
12
+ }
13
+ }
14
+
15
+ export const control = ({
16
+ height = defaultControl.height,
17
+ color = defaultControl.color,
18
+ margin:{
19
+ left = defaultControl.margin.left,
20
+ right = defaultControl.margin.right
21
+ } = defaultControl.margin,
22
+ gap = defaultControl.gap,
23
+ drag:{
24
+ width = defaultControl.drag.width,
25
+ color:dragColor = defaultControl.drag.color
26
+ } = defaultControl.drag
27
+ } = defaultControl) => {
28
+ return {
29
+ name: "control",
30
+ displayName: "控制条",
31
+ value: [
32
+ {
33
+ name: "height",
34
+ displayName: "高度",
35
+ value: height,
36
+ type: "number",
37
+ },
38
+ {
39
+ name: "color",
40
+ displayName: "背景颜色",
41
+ value: color,
42
+ type: "color",
43
+ },
44
+ {
45
+ type: "group",
46
+ name: "margin",
47
+ displayName: "边距",
48
+ value: [
49
+ {
50
+ name: "left",
51
+ displayName: "左边距",
52
+ value: left,
53
+ type: "number",
54
+ config: {
55
+ span: 12,
56
+ },
57
+ },
58
+ {
59
+ name: "right",
60
+ displayName: "右边距",
61
+ value: right,
62
+ type: "number",
63
+ config: {
64
+ span: 12,
65
+ },
66
+ },
67
+ ],
68
+ },
69
+ {
70
+ name:"gap",
71
+ displayName:"上间距",
72
+ type:"number",
73
+ value:gap,
74
+ config:{
75
+ suffix:"px"
76
+ },
77
+ tip:"与X轴的距离"
78
+ },
79
+ {
80
+ name: "drag",
81
+ displayName: "详情区域",
82
+ value: [
83
+ {
84
+ name: "width",
85
+ displayName: "宽度",
86
+ value: width,
87
+ type: "range",
88
+ config: {
89
+ suffix: "%",
90
+ min: 1,
91
+ max:100
92
+ },
93
+ },
94
+ {
95
+ name: "color",
96
+ displayName: "颜色",
97
+ value: dragColor,
98
+ type: "color",
99
+ },
100
+ ],
101
+ },
102
+ ],
103
+ };
104
+ };
package/src/extent.js CHANGED
@@ -1,36 +1,42 @@
1
- const extent = {
2
- min: "0",
3
- max: "",
4
- customDisplayName: "数值范围",
5
- customName: "extent",
6
- };
7
- export default ({
8
- min = extent.min,
9
- max = extent.max,
10
- customDisplayName = extent.customDisplayName,
11
- customName = extent.customName,
12
- } = extent) => ({
13
- name: customName,
14
- displayName: customDisplayName,
15
- value: [
16
- {
17
- name: "min",
18
- displayName: "最小值",
19
- value: min,
20
- type: "input",
21
- config: {
22
- span: 12,
23
- },
24
- },
25
- {
26
- name: "max",
27
- displayName: "最大值",
28
- value: max,
29
- type: "input",
30
- config: {
31
- span: 12,
32
- },
33
- },
34
- ],
35
- type: "group",
36
- });
1
+ const extent = {
2
+ min: "0",
3
+ max: "",
4
+ customDisplayName: "数值范围",
5
+ customName: "extent",
6
+ customSuffix: "",
7
+ };
8
+ export default ({
9
+ min = extent.min,
10
+ max = extent.max,
11
+ customDisplayName = extent.customDisplayName,
12
+ customName = extent.customName,
13
+ customSuffix = extent.customSuffix,
14
+ } = extent) => {
15
+ return {
16
+ name: customName,
17
+ displayName: customDisplayName,
18
+ value: [
19
+ {
20
+ name: "min",
21
+ displayName: "最小值",
22
+ value: min,
23
+ type: "input",
24
+ config: {
25
+ span: 12,
26
+ suffix: customSuffix,
27
+ },
28
+ },
29
+ {
30
+ name: "max",
31
+ displayName: "最大值",
32
+ value: max,
33
+ type: "input",
34
+ config: {
35
+ span: 12,
36
+ suffix: customSuffix,
37
+ },
38
+ },
39
+ ],
40
+ type: "group",
41
+ };
42
+ };