@byteluck-fe/model-driven-controls 7.0.0-props.102 → 7.0.0-props.104
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/dist/esm/baseControls/BarChart/designer.js +4 -4
- package/dist/esm/baseControls/BarChart/property.js +37 -23
- package/dist/esm/baseControls/LineChart/designer.js +4 -4
- package/dist/esm/baseControls/LineChart/property.js +37 -23
- package/dist/esm/baseControls/PieChart/designer.js +4 -4
- package/dist/esm/baseControls/PieChart/property.js +16 -20
- package/dist/esm/baseControls/utils.js +61 -0
- package/dist/index.umd.js +1 -1
- package/dist/types/baseControls/BarChart/property.d.ts +24 -17
- package/dist/types/baseControls/LineChart/property.d.ts +24 -17
- package/dist/types/baseControls/PieChart/property.d.ts +15 -16
- package/dist/types/baseControls/utils.d.ts +9 -0
- package/package.json +2 -2
|
@@ -149,6 +149,10 @@ _define_property(BarChartControl, "setting", [
|
|
|
149
149
|
],
|
|
150
150
|
visible: true
|
|
151
151
|
},
|
|
152
|
+
{
|
|
153
|
+
key: 'label-position',
|
|
154
|
+
visible: true
|
|
155
|
+
},
|
|
152
156
|
{
|
|
153
157
|
key: 'common-setting',
|
|
154
158
|
visible: true,
|
|
@@ -206,10 +210,6 @@ _define_property(BarChartControl, "setting", [
|
|
|
206
210
|
key: 'chart-setting',
|
|
207
211
|
visible: true
|
|
208
212
|
},
|
|
209
|
-
{
|
|
210
|
-
key: 'label-position',
|
|
211
|
-
visible: true
|
|
212
|
-
},
|
|
213
213
|
{
|
|
214
214
|
key: 'chart-data-bind',
|
|
215
215
|
visible: true
|
|
@@ -72,50 +72,64 @@ function _is_native_reflect_construct() {
|
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* name: rok_bar_chart
|
|
75
|
-
* description:
|
|
75
|
+
* description: 柱状图组件。用于展示静态或动态数据图表,支持模板选择和字段映射,适合统计分析与看板展示场景。
|
|
76
76
|
*/ import BarChartControl from './designer';
|
|
77
|
-
import { MultistageFillingItem, Property,
|
|
77
|
+
import { MultistageFillingItem, Property, PropertyRules, DataSourceBind } from '@byteluck-fe/model-driven-core';
|
|
78
78
|
import { FONT_WEIGHT } from '../../framework';
|
|
79
|
+
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
80
|
+
import { createChartAxisFieldRule, createChartSeriesConfigRule } from '../utils';
|
|
81
|
+
var BarChartPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
82
|
+
"use strict";
|
|
83
|
+
_inherits(BarChartPropertyRules, PropertyRules);
|
|
84
|
+
function BarChartPropertyRules(props) {
|
|
85
|
+
_class_call_check(this, BarChartPropertyRules);
|
|
86
|
+
var _this;
|
|
87
|
+
_this = _call_super(this, BarChartPropertyRules, [
|
|
88
|
+
props
|
|
89
|
+
]), _define_property(_this, "xField", void 0), _define_property(_this, "yField", void 0), _define_property(_this, "seriesConfig", createChartSeriesConfigRule(getLocaleText('CMD.pleaseSelectSeriesValueField', null, '请绑定系列值字段')));
|
|
90
|
+
_this.xField = createChartAxisFieldRule(props, 'xAxis', getLocaleText('CMD.pleaseSelectXAxisField', null, '请绑定 X 轴字段'));
|
|
91
|
+
_this.yField = createChartAxisFieldRule(props, 'yAxis', getLocaleText('CMD.pleaseSelectYAxisField', null, '请绑定 Y 轴字段'));
|
|
92
|
+
return _this;
|
|
93
|
+
}
|
|
94
|
+
return BarChartPropertyRules;
|
|
95
|
+
}(PropertyRules);
|
|
79
96
|
var BarChartProperty = /*#__PURE__*/ function(Property) {
|
|
80
97
|
"use strict";
|
|
81
98
|
_inherits(BarChartProperty, Property);
|
|
82
99
|
function BarChartProperty(props) {
|
|
83
100
|
_class_call_check(this, BarChartProperty);
|
|
84
101
|
var _this;
|
|
85
|
-
var _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14
|
|
102
|
+
var _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14;
|
|
86
103
|
var _props_multistageFilling;
|
|
87
104
|
_this = _call_super(this, BarChartProperty, [
|
|
88
105
|
props
|
|
89
|
-
]), _define_property(_this, "caption", void 0), _define_property(_this, "isHideCaption", void 0), _define_property(_this, "isShowCaptionTip", void 0), _define_property(_this, "
|
|
106
|
+
]), _define_property(_this, "caption", void 0), _define_property(_this, "isHideCaption", void 0), _define_property(_this, "isShowCaptionTip", void 0), _define_property(_this, "labelPosition", void 0), _define_property(_this, "captionTip", void 0), _define_property(_this, "captionSize", void 0), _define_property(_this, "captionColor", void 0), _define_property(_this, "isCaptionItalic", void 0), _define_property(_this, "captionFontWeight", void 0), _define_property(_this, "isHide", void 0), _define_property(_this, "template", void 0), _define_property(_this, "optionJson", void 0), _define_property(_this, "optionConfig", 'datasource'), _define_property(_this, "datasourceBind", void 0), _define_property(_this, "filterItemDatasourceBind", void 0), _define_property(_this, "multistageFilling", void 0), _define_property(_this, "defaultValue", void 0), _define_property(_this, "openMultistageFilling", void 0), _define_property(_this, "xField", void 0), _define_property(_this, "yField", void 0), _define_property(_this, "seriesConfig", void 0);
|
|
90
107
|
_this.caption = (_ref = props === null || props === void 0 ? void 0 : props.caption) !== null && _ref !== void 0 ? _ref : BarChartControl.controlName;
|
|
91
108
|
_this.isHideCaption = (_ref1 = props === null || props === void 0 ? void 0 : props.isHideCaption) !== null && _ref1 !== void 0 ? _ref1 : false;
|
|
92
109
|
_this.isShowCaptionTip = (_ref2 = props === null || props === void 0 ? void 0 : props.isShowCaptionTip) !== null && _ref2 !== void 0 ? _ref2 : false;
|
|
93
|
-
_this.
|
|
110
|
+
_this.labelPosition = (_ref3 = props === null || props === void 0 ? void 0 : props.labelPosition) !== null && _ref3 !== void 0 ? _ref3 : 'top';
|
|
111
|
+
_this.captionTip = (_ref4 = props === null || props === void 0 ? void 0 : props.captionTip) !== null && _ref4 !== void 0 ? _ref4 : '';
|
|
94
112
|
_this.captionColor = (props === null || props === void 0 ? void 0 : props.captionColor) || '';
|
|
95
113
|
_this.captionSize = (props === null || props === void 0 ? void 0 : props.captionSize) || '';
|
|
96
114
|
_this.isCaptionItalic = (props === null || props === void 0 ? void 0 : props.isCaptionItalic) || false;
|
|
97
|
-
_this.captionFontWeight = (
|
|
98
|
-
_this.isHide = (
|
|
99
|
-
_this.template = (
|
|
100
|
-
_this.dataMode = (_ref7 = props === null || props === void 0 ? void 0 : props.dataMode) !== null && _ref7 !== void 0 ? _ref7 : 'static';
|
|
115
|
+
_this.captionFontWeight = (_ref5 = props === null || props === void 0 ? void 0 : props.captionFontWeight) !== null && _ref5 !== void 0 ? _ref5 : FONT_WEIGHT.NORMAL;
|
|
116
|
+
_this.isHide = (_ref6 = props === null || props === void 0 ? void 0 : props.isHide) !== null && _ref6 !== void 0 ? _ref6 : false;
|
|
117
|
+
_this.template = (_ref7 = props === null || props === void 0 ? void 0 : props.template) !== null && _ref7 !== void 0 ? _ref7 : 'bar-basic';
|
|
101
118
|
_this.optionJson = (_ref8 = props === null || props === void 0 ? void 0 : props.optionJson) !== null && _ref8 !== void 0 ? _ref8 : '{}';
|
|
102
|
-
_this.datasourceBind = new
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
_this.filterItemDatasourceBind = new TreeDataSourceBind((_ref10 = props === null || props === void 0 ? void 0 : props.filterItemDatasourceBind) !== null && _ref10 !== void 0 ? _ref10 : {
|
|
106
|
-
attributes: BarChartControl.controlCustomAttributes
|
|
107
|
-
});
|
|
108
|
-
_this.multistageFilling = (_ref11 = props === null || props === void 0 ? void 0 : (_props_multistageFilling = props.multistageFilling) === null || _props_multistageFilling === void 0 ? void 0 : _props_multistageFilling.map(function(item) {
|
|
119
|
+
_this.datasourceBind = new DataSourceBind(props === null || props === void 0 ? void 0 : props.datasourceBind);
|
|
120
|
+
_this.filterItemDatasourceBind = new DataSourceBind(props === null || props === void 0 ? void 0 : props.filterItemDatasourceBind);
|
|
121
|
+
_this.multistageFilling = (_ref9 = props === null || props === void 0 ? void 0 : (_props_multistageFilling = props.multistageFilling) === null || _props_multistageFilling === void 0 ? void 0 : _props_multistageFilling.map(function(item) {
|
|
109
122
|
return new MultistageFillingItem(item);
|
|
110
|
-
})) !== null &&
|
|
111
|
-
_this.defaultValue = (
|
|
112
|
-
_this.openMultistageFilling = (
|
|
113
|
-
_this.xField = (
|
|
114
|
-
_this.yField = (
|
|
115
|
-
_this.seriesConfig = (
|
|
123
|
+
})) !== null && _ref9 !== void 0 ? _ref9 : [];
|
|
124
|
+
_this.defaultValue = (_ref10 = props === null || props === void 0 ? void 0 : props.defaultValue) !== null && _ref10 !== void 0 ? _ref10 : [];
|
|
125
|
+
_this.openMultistageFilling = (_ref11 = props === null || props === void 0 ? void 0 : props.openMultistageFilling) !== null && _ref11 !== void 0 ? _ref11 : false;
|
|
126
|
+
_this.xField = (_ref12 = props === null || props === void 0 ? void 0 : props.xField) !== null && _ref12 !== void 0 ? _ref12 : '';
|
|
127
|
+
_this.yField = (_ref13 = props === null || props === void 0 ? void 0 : props.yField) !== null && _ref13 !== void 0 ? _ref13 : '';
|
|
128
|
+
_this.seriesConfig = (_ref14 = props === null || props === void 0 ? void 0 : props.seriesConfig) !== null && _ref14 !== void 0 ? _ref14 : [];
|
|
116
129
|
return _this;
|
|
117
130
|
}
|
|
118
131
|
return BarChartProperty;
|
|
119
132
|
}(Property);
|
|
133
|
+
_define_property(BarChartProperty, "Rules", BarChartPropertyRules);
|
|
120
134
|
export default BarChartProperty;
|
|
121
|
-
export { BarChartProperty };
|
|
135
|
+
export { BarChartProperty, BarChartPropertyRules };
|
|
@@ -149,6 +149,10 @@ _define_property(LineChartControl, "setting", [
|
|
|
149
149
|
],
|
|
150
150
|
visible: true
|
|
151
151
|
},
|
|
152
|
+
{
|
|
153
|
+
key: 'label-position',
|
|
154
|
+
visible: true
|
|
155
|
+
},
|
|
152
156
|
{
|
|
153
157
|
key: 'common-setting',
|
|
154
158
|
visible: true,
|
|
@@ -190,10 +194,6 @@ _define_property(LineChartControl, "setting", [
|
|
|
190
194
|
key: 'chart-setting',
|
|
191
195
|
visible: true
|
|
192
196
|
},
|
|
193
|
-
{
|
|
194
|
-
key: 'label-position',
|
|
195
|
-
visible: true
|
|
196
|
-
},
|
|
197
197
|
{
|
|
198
198
|
key: 'chart-data-bind',
|
|
199
199
|
visible: true
|
|
@@ -72,10 +72,12 @@ function _is_native_reflect_construct() {
|
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* name: rok_line_chart
|
|
75
|
-
* description:
|
|
75
|
+
* description: 折线图组件。用于展示静态或动态趋势数据图表,支持模板选择和字段映射,适合趋势分析与看板展示场景。
|
|
76
76
|
*/ import LineChartControl from './designer';
|
|
77
|
-
import { MultistageFillingItem, Property,
|
|
77
|
+
import { MultistageFillingItem, Property, PropertyRules, DataSourceBind } from '@byteluck-fe/model-driven-core';
|
|
78
78
|
import { FONT_WEIGHT } from '../../framework';
|
|
79
|
+
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
80
|
+
import { createChartAxisFieldRule, createChartSeriesConfigRule } from '../utils';
|
|
79
81
|
var LineChartTemplate = /*#__PURE__*/ function(LineChartTemplate) {
|
|
80
82
|
LineChartTemplate["LINE_BASIC"] = "line-basic";
|
|
81
83
|
LineChartTemplate["LINE_SMOOTH"] = "line-smooth";
|
|
@@ -84,46 +86,58 @@ var LineChartTemplate = /*#__PURE__*/ function(LineChartTemplate) {
|
|
|
84
86
|
LineChartTemplate["LINE_STACKED_AREA"] = "line-stacked-area";
|
|
85
87
|
return LineChartTemplate;
|
|
86
88
|
}(LineChartTemplate || {});
|
|
89
|
+
var LineChartPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
90
|
+
"use strict";
|
|
91
|
+
_inherits(LineChartPropertyRules, PropertyRules);
|
|
92
|
+
function LineChartPropertyRules(props) {
|
|
93
|
+
_class_call_check(this, LineChartPropertyRules);
|
|
94
|
+
var _this;
|
|
95
|
+
_this = _call_super(this, LineChartPropertyRules, [
|
|
96
|
+
props
|
|
97
|
+
]), _define_property(_this, "xField", void 0), _define_property(_this, "yField", void 0), _define_property(_this, "seriesConfig", createChartSeriesConfigRule(getLocaleText('CMD.pleaseSelectSeriesValueField', null, '请绑定系列值字段')));
|
|
98
|
+
_this.xField = createChartAxisFieldRule(props, 'xAxis', getLocaleText('CMD.pleaseSelectXAxisField', null, '请绑定 X 轴字段'));
|
|
99
|
+
_this.yField = createChartAxisFieldRule(props, 'yAxis', getLocaleText('CMD.pleaseSelectYAxisField', null, '请绑定 Y 轴字段'));
|
|
100
|
+
return _this;
|
|
101
|
+
}
|
|
102
|
+
return LineChartPropertyRules;
|
|
103
|
+
}(PropertyRules);
|
|
87
104
|
var LineChartProperty = /*#__PURE__*/ function(Property) {
|
|
88
105
|
"use strict";
|
|
89
106
|
_inherits(LineChartProperty, Property);
|
|
90
107
|
function LineChartProperty(props) {
|
|
91
108
|
_class_call_check(this, LineChartProperty);
|
|
92
109
|
var _this;
|
|
93
|
-
var _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14
|
|
110
|
+
var _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14;
|
|
94
111
|
var _props_multistageFilling;
|
|
95
112
|
_this = _call_super(this, LineChartProperty, [
|
|
96
113
|
props
|
|
97
|
-
]), _define_property(_this, "caption", void 0), _define_property(_this, "isHideCaption", void 0), _define_property(_this, "isShowCaptionTip", void 0), _define_property(_this, "
|
|
114
|
+
]), _define_property(_this, "caption", void 0), _define_property(_this, "isHideCaption", void 0), _define_property(_this, "isShowCaptionTip", void 0), _define_property(_this, "labelPosition", void 0), _define_property(_this, "captionTip", void 0), _define_property(_this, "captionSize", void 0), _define_property(_this, "captionColor", void 0), _define_property(_this, "isCaptionItalic", void 0), _define_property(_this, "captionFontWeight", void 0), _define_property(_this, "isHide", void 0), _define_property(_this, "template", void 0), _define_property(_this, "optionJson", void 0), _define_property(_this, "optionConfig", 'datasource'), _define_property(_this, "datasourceBind", void 0), _define_property(_this, "filterItemDatasourceBind", void 0), _define_property(_this, "multistageFilling", void 0), _define_property(_this, "defaultValue", void 0), _define_property(_this, "openMultistageFilling", void 0), _define_property(_this, "xField", void 0), _define_property(_this, "yField", void 0), _define_property(_this, "seriesConfig", void 0);
|
|
98
115
|
_this.caption = (_ref = props === null || props === void 0 ? void 0 : props.caption) !== null && _ref !== void 0 ? _ref : LineChartControl.controlName;
|
|
99
116
|
_this.isHideCaption = (_ref1 = props === null || props === void 0 ? void 0 : props.isHideCaption) !== null && _ref1 !== void 0 ? _ref1 : false;
|
|
100
117
|
_this.isShowCaptionTip = (_ref2 = props === null || props === void 0 ? void 0 : props.isShowCaptionTip) !== null && _ref2 !== void 0 ? _ref2 : false;
|
|
101
|
-
_this.
|
|
118
|
+
_this.labelPosition = (_ref3 = props === null || props === void 0 ? void 0 : props.labelPosition) !== null && _ref3 !== void 0 ? _ref3 : 'top';
|
|
119
|
+
_this.captionTip = (_ref4 = props === null || props === void 0 ? void 0 : props.captionTip) !== null && _ref4 !== void 0 ? _ref4 : '';
|
|
102
120
|
_this.captionColor = (props === null || props === void 0 ? void 0 : props.captionColor) || '';
|
|
103
121
|
_this.captionSize = (props === null || props === void 0 ? void 0 : props.captionSize) || '';
|
|
104
122
|
_this.isCaptionItalic = (props === null || props === void 0 ? void 0 : props.isCaptionItalic) || false;
|
|
105
|
-
_this.captionFontWeight = (
|
|
106
|
-
_this.isHide = (
|
|
107
|
-
_this.template = (
|
|
108
|
-
_this.dataMode = (_ref7 = props === null || props === void 0 ? void 0 : props.dataMode) !== null && _ref7 !== void 0 ? _ref7 : 'static';
|
|
123
|
+
_this.captionFontWeight = (_ref5 = props === null || props === void 0 ? void 0 : props.captionFontWeight) !== null && _ref5 !== void 0 ? _ref5 : FONT_WEIGHT.NORMAL;
|
|
124
|
+
_this.isHide = (_ref6 = props === null || props === void 0 ? void 0 : props.isHide) !== null && _ref6 !== void 0 ? _ref6 : false;
|
|
125
|
+
_this.template = (_ref7 = props === null || props === void 0 ? void 0 : props.template) !== null && _ref7 !== void 0 ? _ref7 : "line-basic";
|
|
109
126
|
_this.optionJson = (_ref8 = props === null || props === void 0 ? void 0 : props.optionJson) !== null && _ref8 !== void 0 ? _ref8 : '{}';
|
|
110
|
-
_this.datasourceBind = new
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
_this.filterItemDatasourceBind = new TreeDataSourceBind((_ref10 = props === null || props === void 0 ? void 0 : props.filterItemDatasourceBind) !== null && _ref10 !== void 0 ? _ref10 : {
|
|
114
|
-
attributes: LineChartControl.controlCustomAttributes
|
|
115
|
-
});
|
|
116
|
-
_this.multistageFilling = (_ref11 = props === null || props === void 0 ? void 0 : (_props_multistageFilling = props.multistageFilling) === null || _props_multistageFilling === void 0 ? void 0 : _props_multistageFilling.map(function(item) {
|
|
127
|
+
_this.datasourceBind = new DataSourceBind(props === null || props === void 0 ? void 0 : props.datasourceBind);
|
|
128
|
+
_this.filterItemDatasourceBind = new DataSourceBind(props === null || props === void 0 ? void 0 : props.filterItemDatasourceBind);
|
|
129
|
+
_this.multistageFilling = (_ref9 = props === null || props === void 0 ? void 0 : (_props_multistageFilling = props.multistageFilling) === null || _props_multistageFilling === void 0 ? void 0 : _props_multistageFilling.map(function(item) {
|
|
117
130
|
return new MultistageFillingItem(item);
|
|
118
|
-
})) !== null &&
|
|
119
|
-
_this.defaultValue = (
|
|
120
|
-
_this.openMultistageFilling = (
|
|
121
|
-
_this.xField = (
|
|
122
|
-
_this.yField = (
|
|
123
|
-
_this.seriesConfig = (
|
|
131
|
+
})) !== null && _ref9 !== void 0 ? _ref9 : [];
|
|
132
|
+
_this.defaultValue = (_ref10 = props === null || props === void 0 ? void 0 : props.defaultValue) !== null && _ref10 !== void 0 ? _ref10 : [];
|
|
133
|
+
_this.openMultistageFilling = (_ref11 = props === null || props === void 0 ? void 0 : props.openMultistageFilling) !== null && _ref11 !== void 0 ? _ref11 : false;
|
|
134
|
+
_this.xField = (_ref12 = props === null || props === void 0 ? void 0 : props.xField) !== null && _ref12 !== void 0 ? _ref12 : '';
|
|
135
|
+
_this.yField = (_ref13 = props === null || props === void 0 ? void 0 : props.yField) !== null && _ref13 !== void 0 ? _ref13 : '';
|
|
136
|
+
_this.seriesConfig = (_ref14 = props === null || props === void 0 ? void 0 : props.seriesConfig) !== null && _ref14 !== void 0 ? _ref14 : [];
|
|
124
137
|
return _this;
|
|
125
138
|
}
|
|
126
139
|
return LineChartProperty;
|
|
127
140
|
}(Property);
|
|
141
|
+
_define_property(LineChartProperty, "Rules", LineChartPropertyRules);
|
|
128
142
|
export default LineChartProperty;
|
|
129
|
-
export { LineChartProperty, LineChartTemplate };
|
|
143
|
+
export { LineChartProperty, LineChartTemplate, LineChartPropertyRules };
|
|
@@ -149,6 +149,10 @@ _define_property(PieChartControl, "setting", [
|
|
|
149
149
|
],
|
|
150
150
|
visible: true
|
|
151
151
|
},
|
|
152
|
+
{
|
|
153
|
+
key: 'chart-setting',
|
|
154
|
+
visible: true
|
|
155
|
+
},
|
|
152
156
|
{
|
|
153
157
|
key: 'common-setting',
|
|
154
158
|
visible: true,
|
|
@@ -190,10 +194,6 @@ _define_property(PieChartControl, "setting", [
|
|
|
190
194
|
}
|
|
191
195
|
]
|
|
192
196
|
},
|
|
193
|
-
{
|
|
194
|
-
key: 'chart-setting',
|
|
195
|
-
visible: true
|
|
196
|
-
},
|
|
197
197
|
{
|
|
198
198
|
key: 'label-position',
|
|
199
199
|
visible: true
|
|
@@ -72,9 +72,9 @@ function _is_native_reflect_construct() {
|
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* name: rok_pie_chart
|
|
75
|
-
* description:
|
|
75
|
+
* description: 饼图组件。用于展示静态或动态数据图表,支持模板选择和字段映射,适合统计分析与看板展示场景。
|
|
76
76
|
*/ import PieChartControl from './designer';
|
|
77
|
-
import { MultistageFillingItem, Property,
|
|
77
|
+
import { MultistageFillingItem, Property, DataSourceBind } from '@byteluck-fe/model-driven-core';
|
|
78
78
|
import { FONT_WEIGHT } from '../../framework';
|
|
79
79
|
var PieChartProperty = /*#__PURE__*/ function(Property) {
|
|
80
80
|
"use strict";
|
|
@@ -82,35 +82,31 @@ var PieChartProperty = /*#__PURE__*/ function(Property) {
|
|
|
82
82
|
function PieChartProperty(props) {
|
|
83
83
|
_class_call_check(this, PieChartProperty);
|
|
84
84
|
var _this;
|
|
85
|
-
var _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12
|
|
85
|
+
var _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12;
|
|
86
86
|
var _props_multistageFilling;
|
|
87
87
|
_this = _call_super(this, PieChartProperty, [
|
|
88
88
|
props
|
|
89
|
-
]), _define_property(_this, "caption", void 0), _define_property(_this, "isHideCaption", void 0), _define_property(_this, "isShowCaptionTip", void 0), _define_property(_this, "
|
|
89
|
+
]), _define_property(_this, "caption", void 0), _define_property(_this, "isHideCaption", void 0), _define_property(_this, "isShowCaptionTip", void 0), _define_property(_this, "labelPosition", void 0), _define_property(_this, "captionTip", void 0), _define_property(_this, "captionSize", void 0), _define_property(_this, "captionColor", void 0), _define_property(_this, "isCaptionItalic", void 0), _define_property(_this, "captionFontWeight", void 0), _define_property(_this, "isHide", void 0), _define_property(_this, "template", void 0), _define_property(_this, "optionJson", void 0), _define_property(_this, "optionConfig", 'datasource'), _define_property(_this, "datasourceBind", void 0), _define_property(_this, "filterItemDatasourceBind", void 0), _define_property(_this, "multistageFilling", void 0), _define_property(_this, "defaultValue", void 0), _define_property(_this, "openMultistageFilling", void 0), _define_property(_this, "seriesConfig", void 0);
|
|
90
90
|
_this.caption = (_ref = props === null || props === void 0 ? void 0 : props.caption) !== null && _ref !== void 0 ? _ref : PieChartControl.controlName;
|
|
91
91
|
_this.isHideCaption = (_ref1 = props === null || props === void 0 ? void 0 : props.isHideCaption) !== null && _ref1 !== void 0 ? _ref1 : false;
|
|
92
92
|
_this.isShowCaptionTip = (_ref2 = props === null || props === void 0 ? void 0 : props.isShowCaptionTip) !== null && _ref2 !== void 0 ? _ref2 : false;
|
|
93
|
-
_this.
|
|
93
|
+
_this.labelPosition = (_ref3 = props === null || props === void 0 ? void 0 : props.labelPosition) !== null && _ref3 !== void 0 ? _ref3 : 'top';
|
|
94
|
+
_this.captionTip = (_ref4 = props === null || props === void 0 ? void 0 : props.captionTip) !== null && _ref4 !== void 0 ? _ref4 : '';
|
|
94
95
|
_this.captionColor = (props === null || props === void 0 ? void 0 : props.captionColor) || '';
|
|
95
96
|
_this.captionSize = (props === null || props === void 0 ? void 0 : props.captionSize) || '';
|
|
96
97
|
_this.isCaptionItalic = (props === null || props === void 0 ? void 0 : props.isCaptionItalic) || false;
|
|
97
|
-
_this.captionFontWeight = (
|
|
98
|
-
_this.isHide = (
|
|
99
|
-
_this.template = (
|
|
100
|
-
_this.dataMode = (_ref7 = props === null || props === void 0 ? void 0 : props.dataMode) !== null && _ref7 !== void 0 ? _ref7 : 'static';
|
|
98
|
+
_this.captionFontWeight = (_ref5 = props === null || props === void 0 ? void 0 : props.captionFontWeight) !== null && _ref5 !== void 0 ? _ref5 : FONT_WEIGHT.NORMAL;
|
|
99
|
+
_this.isHide = (_ref6 = props === null || props === void 0 ? void 0 : props.isHide) !== null && _ref6 !== void 0 ? _ref6 : false;
|
|
100
|
+
_this.template = (_ref7 = props === null || props === void 0 ? void 0 : props.template) !== null && _ref7 !== void 0 ? _ref7 : 'pie-rounded-ring';
|
|
101
101
|
_this.optionJson = (_ref8 = props === null || props === void 0 ? void 0 : props.optionJson) !== null && _ref8 !== void 0 ? _ref8 : '{}';
|
|
102
|
-
_this.datasourceBind = new
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
_this.filterItemDatasourceBind = new TreeDataSourceBind((_ref10 = props === null || props === void 0 ? void 0 : props.filterItemDatasourceBind) !== null && _ref10 !== void 0 ? _ref10 : {
|
|
106
|
-
attributes: PieChartControl.controlCustomAttributes
|
|
107
|
-
});
|
|
108
|
-
_this.multistageFilling = (_ref11 = props === null || props === void 0 ? void 0 : (_props_multistageFilling = props.multistageFilling) === null || _props_multistageFilling === void 0 ? void 0 : _props_multistageFilling.map(function(item) {
|
|
102
|
+
_this.datasourceBind = new DataSourceBind(props === null || props === void 0 ? void 0 : props.datasourceBind);
|
|
103
|
+
_this.filterItemDatasourceBind = new DataSourceBind(props === null || props === void 0 ? void 0 : props.filterItemDatasourceBind);
|
|
104
|
+
_this.multistageFilling = (_ref9 = props === null || props === void 0 ? void 0 : (_props_multistageFilling = props.multistageFilling) === null || _props_multistageFilling === void 0 ? void 0 : _props_multistageFilling.map(function(item) {
|
|
109
105
|
return new MultistageFillingItem(item);
|
|
110
|
-
})) !== null &&
|
|
111
|
-
_this.defaultValue = (
|
|
112
|
-
_this.openMultistageFilling = (
|
|
113
|
-
_this.seriesConfig = (
|
|
106
|
+
})) !== null && _ref9 !== void 0 ? _ref9 : [];
|
|
107
|
+
_this.defaultValue = (_ref10 = props === null || props === void 0 ? void 0 : props.defaultValue) !== null && _ref10 !== void 0 ? _ref10 : [];
|
|
108
|
+
_this.openMultistageFilling = (_ref11 = props === null || props === void 0 ? void 0 : props.openMultistageFilling) !== null && _ref11 !== void 0 ? _ref11 : false;
|
|
109
|
+
_this.seriesConfig = (_ref12 = props === null || props === void 0 ? void 0 : props.seriesConfig) !== null && _ref12 !== void 0 ? _ref12 : [];
|
|
114
110
|
return _this;
|
|
115
111
|
}
|
|
116
112
|
return PieChartProperty;
|
|
@@ -1,4 +1,65 @@
|
|
|
1
|
+
function _type_of(obj) {
|
|
2
|
+
"@swc/helpers - typeof";
|
|
3
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
4
|
+
}
|
|
1
5
|
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
6
|
+
function isObject(value) {
|
|
7
|
+
return value !== null && (typeof value === "undefined" ? "undefined" : _type_of(value)) === 'object' && !Array.isArray(value);
|
|
8
|
+
}
|
|
9
|
+
function parseChartOption(optionJson) {
|
|
10
|
+
if (!optionJson.trim()) {
|
|
11
|
+
return {};
|
|
12
|
+
}
|
|
13
|
+
try {
|
|
14
|
+
var option = JSON.parse(optionJson);
|
|
15
|
+
return isObject(option) ? option : {};
|
|
16
|
+
} catch (unused) {
|
|
17
|
+
return {};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function normalizeChartAxes(axis) {
|
|
21
|
+
if (Array.isArray(axis)) {
|
|
22
|
+
return axis;
|
|
23
|
+
}
|
|
24
|
+
return axis ? [
|
|
25
|
+
axis
|
|
26
|
+
] : [];
|
|
27
|
+
}
|
|
28
|
+
export function isBlankChartField(value) {
|
|
29
|
+
return typeof value !== 'string' || value.trim() === '';
|
|
30
|
+
}
|
|
31
|
+
export function isCategoryChartAxis(optionJson, axisKey) {
|
|
32
|
+
var option = parseChartOption(optionJson);
|
|
33
|
+
return normalizeChartAxes(option[axisKey]).some(function(axis) {
|
|
34
|
+
return axis.type === 'category';
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
export function createChartAxisFieldRule(props, axisKey, message) {
|
|
38
|
+
return {
|
|
39
|
+
type: 'string',
|
|
40
|
+
validator: function validator(rule, value, callback) {
|
|
41
|
+
if (isCategoryChartAxis(props.optionJson, axisKey) && isBlankChartField(value)) {
|
|
42
|
+
callback(message);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
callback();
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export function createChartSeriesConfigRule(message) {
|
|
50
|
+
return {
|
|
51
|
+
type: 'array',
|
|
52
|
+
validator: function validator(rule, value, callback) {
|
|
53
|
+
if (Array.isArray(value) && value.some(function(item) {
|
|
54
|
+
return isBlankChartField(item === null || item === void 0 ? void 0 : item.valueField);
|
|
55
|
+
})) {
|
|
56
|
+
callback(message);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
callback();
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
2
63
|
export function createFillBindRules() {
|
|
3
64
|
return {
|
|
4
65
|
dataCode: {
|