@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.
@@ -1,6 +1,6 @@
1
- import { MultistageFillingItem, Property, PropertyInterface, TreeDataSourceBind } from '@byteluck-fe/model-driven-core';
1
+ import { MultistageFillingItem, Property, PropertyInterface, PropertyRules, DataSourceBind } from '@byteluck-fe/model-driven-core';
2
2
  import { FONT_WEIGHT } from '../../framework';
3
- type BarChartDataMode = 'static' | 'dynamic';
3
+ import { RuleItem } from 'async-validator';
4
4
  interface BarChartYFieldItem {
5
5
  field: string;
6
6
  name: string;
@@ -11,6 +11,12 @@ interface BarChartSeriesConfigItem {
11
11
  */
12
12
  valueField?: string;
13
13
  }
14
+ declare class BarChartPropertyRules extends PropertyRules {
15
+ xField: RuleItem;
16
+ yField: RuleItem;
17
+ seriesConfig: RuleItem;
18
+ constructor(props: BarChartProperty);
19
+ }
14
20
  interface BarChartPropertyInterface extends PropertyInterface {
15
21
  /**
16
22
  * 标题
@@ -30,6 +36,12 @@ interface BarChartPropertyInterface extends PropertyInterface {
30
36
  * @public
31
37
  */
32
38
  isShowCaptionTip: boolean;
39
+ /**
40
+ * 标题布局;取值:top:上方;left:左侧;
41
+ * @defaultValue 'top'
42
+ * @public
43
+ */
44
+ labelPosition: 'top' | 'left';
33
45
  /**
34
46
  * 气泡提示语
35
47
  * @defaultValue ''
@@ -72,12 +84,6 @@ interface BarChartPropertyInterface extends PropertyInterface {
72
84
  * @public
73
85
  */
74
86
  template: string;
75
- /**
76
- * 数据模式;取值:static:静态数据;dynamic:动态数据源;
77
- * @defaultValue 'static'
78
- * @public
79
- */
80
- dataMode: BarChartDataMode;
81
87
  /**
82
88
  * 图表 option JSON
83
89
  * @defaultValue '{}'
@@ -92,16 +98,16 @@ interface BarChartPropertyInterface extends PropertyInterface {
92
98
  optionConfig: 'datasource';
93
99
  /**
94
100
  * 数据源绑定
95
- * @defaultValue new TreeDataSourceBind({ attributes: BarChartControl.controlCustomAttributes })
101
+ * @defaultValue new DataSourceBind()
96
102
  * @public
97
103
  */
98
- datasourceBind: TreeDataSourceBind;
104
+ datasourceBind: DataSourceBind;
99
105
  /**
100
106
  * 筛选项数据源绑定
101
- * @defaultValue new TreeDataSourceBind({ attributes: BarChartControl.controlCustomAttributes })
107
+ * @defaultValue new DataSourceBind()
102
108
  * @public
103
109
  */
104
- filterItemDatasourceBind: TreeDataSourceBind;
110
+ filterItemDatasourceBind: DataSourceBind;
105
111
  /**
106
112
  * 多级填充
107
113
  * @defaultValue []
@@ -140,9 +146,11 @@ interface BarChartPropertyInterface extends PropertyInterface {
140
146
  seriesConfig: BarChartSeriesConfigItem[];
141
147
  }
142
148
  declare class BarChartProperty extends Property implements BarChartPropertyInterface {
149
+ static readonly Rules: typeof BarChartPropertyRules;
143
150
  caption: string;
144
151
  isHideCaption: boolean;
145
152
  isShowCaptionTip: boolean;
153
+ labelPosition: 'top' | 'left';
146
154
  captionTip: string;
147
155
  captionSize: string;
148
156
  captionColor: string;
@@ -150,11 +158,10 @@ declare class BarChartProperty extends Property implements BarChartPropertyInter
150
158
  captionFontWeight: FONT_WEIGHT;
151
159
  isHide: boolean;
152
160
  template: string;
153
- dataMode: BarChartDataMode;
154
161
  optionJson: string;
155
162
  optionConfig: 'datasource';
156
- datasourceBind: TreeDataSourceBind;
157
- filterItemDatasourceBind: TreeDataSourceBind;
163
+ datasourceBind: DataSourceBind;
164
+ filterItemDatasourceBind: DataSourceBind;
158
165
  multistageFilling: MultistageFillingItem[];
159
166
  defaultValue: string[];
160
167
  openMultistageFilling: boolean;
@@ -164,5 +171,5 @@ declare class BarChartProperty extends Property implements BarChartPropertyInter
164
171
  constructor(props?: Partial<BarChartProperty>);
165
172
  }
166
173
  export default BarChartProperty;
167
- export type { BarChartDataMode, BarChartSeriesConfigItem, BarChartPropertyInterface, BarChartYFieldItem, };
168
- export { BarChartProperty };
174
+ export type { BarChartSeriesConfigItem, BarChartPropertyInterface, BarChartYFieldItem, };
175
+ export { BarChartProperty, BarChartPropertyRules };
@@ -1,6 +1,6 @@
1
- import { MultistageFillingItem, Property, PropertyInterface, TreeDataSourceBind } from '@byteluck-fe/model-driven-core';
1
+ import { MultistageFillingItem, Property, PropertyInterface, PropertyRules, DataSourceBind } from '@byteluck-fe/model-driven-core';
2
2
  import { FONT_WEIGHT } from '../../framework';
3
- type LineChartDataMode = 'static' | 'dynamic';
3
+ import { RuleItem } from 'async-validator';
4
4
  declare enum LineChartTemplate {
5
5
  LINE_BASIC = "line-basic",
6
6
  LINE_SMOOTH = "line-smooth",
@@ -14,6 +14,12 @@ interface LineChartSeriesConfigItem {
14
14
  */
15
15
  valueField?: string;
16
16
  }
17
+ declare class LineChartPropertyRules extends PropertyRules {
18
+ xField: RuleItem;
19
+ yField: RuleItem;
20
+ seriesConfig: RuleItem;
21
+ constructor(props: LineChartProperty);
22
+ }
17
23
  interface LineChartPropertyInterface extends PropertyInterface {
18
24
  /**
19
25
  * 标题
@@ -33,6 +39,12 @@ interface LineChartPropertyInterface extends PropertyInterface {
33
39
  * @public
34
40
  */
35
41
  isShowCaptionTip: boolean;
42
+ /**
43
+ * 标题布局;取值:top:上方;left:左侧;
44
+ * @defaultValue 'top'
45
+ * @public
46
+ */
47
+ labelPosition: 'top' | 'left';
36
48
  /**
37
49
  * 气泡提示语
38
50
  * @defaultValue ''
@@ -75,12 +87,6 @@ interface LineChartPropertyInterface extends PropertyInterface {
75
87
  * @public
76
88
  */
77
89
  template: string;
78
- /**
79
- * 数据模式;取值:static:静态数据;dynamic:动态数据源;
80
- * @defaultValue 'static'
81
- * @public
82
- */
83
- dataMode: LineChartDataMode;
84
90
  /**
85
91
  * 图表 option JSON
86
92
  * @defaultValue '{}'
@@ -95,16 +101,16 @@ interface LineChartPropertyInterface extends PropertyInterface {
95
101
  optionConfig: 'datasource';
96
102
  /**
97
103
  * 数据源绑定
98
- * @defaultValue new TreeDataSourceBind({ attributes: LineChartControl.controlCustomAttributes })
104
+ * @defaultValue new DataSourceBind()
99
105
  * @public
100
106
  */
101
- datasourceBind: TreeDataSourceBind;
107
+ datasourceBind: DataSourceBind;
102
108
  /**
103
109
  * 筛选项数据源绑定
104
- * @defaultValue new TreeDataSourceBind({ attributes: LineChartControl.controlCustomAttributes })
110
+ * @defaultValue new DataSourceBind()
105
111
  * @public
106
112
  */
107
- filterItemDatasourceBind: TreeDataSourceBind;
113
+ filterItemDatasourceBind: DataSourceBind;
108
114
  /**
109
115
  * 多级填充
110
116
  * @defaultValue []
@@ -143,9 +149,11 @@ interface LineChartPropertyInterface extends PropertyInterface {
143
149
  seriesConfig: LineChartSeriesConfigItem[];
144
150
  }
145
151
  declare class LineChartProperty extends Property implements LineChartPropertyInterface {
152
+ static readonly Rules: typeof LineChartPropertyRules;
146
153
  caption: string;
147
154
  isHideCaption: boolean;
148
155
  isShowCaptionTip: boolean;
156
+ labelPosition: 'top' | 'left';
149
157
  captionTip: string;
150
158
  captionSize: string;
151
159
  captionColor: string;
@@ -153,11 +161,10 @@ declare class LineChartProperty extends Property implements LineChartPropertyInt
153
161
  captionFontWeight: FONT_WEIGHT;
154
162
  isHide: boolean;
155
163
  template: string;
156
- dataMode: LineChartDataMode;
157
164
  optionJson: string;
158
165
  optionConfig: 'datasource';
159
- datasourceBind: TreeDataSourceBind;
160
- filterItemDatasourceBind: TreeDataSourceBind;
166
+ datasourceBind: DataSourceBind;
167
+ filterItemDatasourceBind: DataSourceBind;
161
168
  multistageFilling: MultistageFillingItem[];
162
169
  defaultValue: string[];
163
170
  openMultistageFilling: boolean;
@@ -167,5 +174,5 @@ declare class LineChartProperty extends Property implements LineChartPropertyInt
167
174
  constructor(props?: Partial<LineChartProperty>);
168
175
  }
169
176
  export default LineChartProperty;
170
- export type { LineChartDataMode, LineChartSeriesConfigItem, LineChartPropertyInterface, };
171
- export { LineChartProperty, LineChartTemplate };
177
+ export type { LineChartSeriesConfigItem, LineChartPropertyInterface };
178
+ export { LineChartProperty, LineChartTemplate, LineChartPropertyRules };
@@ -1,6 +1,5 @@
1
- import { MultistageFillingItem, Property, PropertyInterface, TreeDataSourceBind } from '@byteluck-fe/model-driven-core';
1
+ import { MultistageFillingItem, Property, PropertyInterface, DataSourceBind } from '@byteluck-fe/model-driven-core';
2
2
  import { FONT_WEIGHT } from '../../framework';
3
- type PieChartDataMode = 'static' | 'dynamic';
4
3
  type PieSeriesDataConfig = {
5
4
  nameField?: string;
6
5
  valueField?: string;
@@ -24,6 +23,12 @@ interface PieChartPropertyInterface extends PropertyInterface {
24
23
  * @public
25
24
  */
26
25
  isShowCaptionTip: boolean;
26
+ /**
27
+ * 标题布局;取值:top:上方;left:左侧;
28
+ * @defaultValue 'top'
29
+ * @public
30
+ */
31
+ labelPosition: 'top' | 'left';
27
32
  /**
28
33
  * 气泡提示语
29
34
  * @defaultValue ''
@@ -66,12 +71,6 @@ interface PieChartPropertyInterface extends PropertyInterface {
66
71
  * @public
67
72
  */
68
73
  template: string;
69
- /**
70
- * 数据模式;取值:static:静态数据;dynamic:动态数据源;
71
- * @defaultValue 'static'
72
- * @public
73
- */
74
- dataMode: PieChartDataMode;
75
74
  /**
76
75
  * 图表 option JSON
77
76
  * @defaultValue '{}'
@@ -86,16 +85,16 @@ interface PieChartPropertyInterface extends PropertyInterface {
86
85
  optionConfig: 'datasource';
87
86
  /**
88
87
  * 数据源绑定
89
- * @defaultValue new TreeDataSourceBind({ attributes: PieChartControl.controlCustomAttributes })
88
+ * @defaultValue new DataSourceBind()
90
89
  * @public
91
90
  */
92
- datasourceBind: TreeDataSourceBind;
91
+ datasourceBind: DataSourceBind;
93
92
  /**
94
93
  * 筛选项数据源绑定
95
- * @defaultValue new TreeDataSourceBind({ attributes: PieChartControl.controlCustomAttributes })
94
+ * @defaultValue new DataSourceBind()
96
95
  * @public
97
96
  */
98
- filterItemDatasourceBind: TreeDataSourceBind;
97
+ filterItemDatasourceBind: DataSourceBind;
99
98
  /**
100
99
  * 多级填充
101
100
  * @defaultValue []
@@ -125,6 +124,7 @@ declare class PieChartProperty extends Property implements PieChartPropertyInter
125
124
  caption: string;
126
125
  isHideCaption: boolean;
127
126
  isShowCaptionTip: boolean;
127
+ labelPosition: 'top' | 'left';
128
128
  captionTip: string;
129
129
  captionSize: string;
130
130
  captionColor: string;
@@ -132,11 +132,10 @@ declare class PieChartProperty extends Property implements PieChartPropertyInter
132
132
  captionFontWeight: FONT_WEIGHT;
133
133
  isHide: boolean;
134
134
  template: string;
135
- dataMode: PieChartDataMode;
136
135
  optionJson: string;
137
136
  optionConfig: 'datasource';
138
- datasourceBind: TreeDataSourceBind;
139
- filterItemDatasourceBind: TreeDataSourceBind;
137
+ datasourceBind: DataSourceBind;
138
+ filterItemDatasourceBind: DataSourceBind;
140
139
  multistageFilling: MultistageFillingItem[];
141
140
  defaultValue: string[];
142
141
  openMultistageFilling: boolean;
@@ -144,5 +143,5 @@ declare class PieChartProperty extends Property implements PieChartPropertyInter
144
143
  constructor(props?: Partial<PieChartProperty>);
145
144
  }
146
145
  export default PieChartProperty;
147
- export type { PieChartDataMode, PieChartPropertyInterface, PieSeriesDataConfig, };
146
+ export type { PieChartPropertyInterface, PieSeriesDataConfig };
148
147
  export { PieChartProperty };
@@ -1,2 +1,11 @@
1
1
  import { RuleItem } from 'async-validator';
2
+ type ChartAxisKey = 'xAxis' | 'yAxis';
3
+ interface ChartOptionProps {
4
+ optionJson: string;
5
+ }
6
+ export declare function isBlankChartField(value: unknown): boolean;
7
+ export declare function isCategoryChartAxis(optionJson: string, axisKey: ChartAxisKey): boolean;
8
+ export declare function createChartAxisFieldRule(props: ChartOptionProps, axisKey: ChartAxisKey, message: string): RuleItem;
9
+ export declare function createChartSeriesConfigRule(message: string): RuleItem;
2
10
  export declare function createFillBindRules(): Record<string, RuleItem>;
11
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byteluck-fe/model-driven-controls",
3
- "version": "7.0.0-props.102",
3
+ "version": "7.0.0-props.104",
4
4
  "description": "> TODO: description",
5
5
  "author": "郝晨光 <2293885211@qq.com>",
6
6
  "homepage": "",
@@ -31,5 +31,5 @@
31
31
  "@byteluck-fe/model-driven-shared": "7.0.0-props.101",
32
32
  "async-validator": "3.5.1"
33
33
  },
34
- "gitHead": "e3215fe4f9d14e37be72eb9ea2e85e5a969595ce"
34
+ "gitHead": "96c6724eec770458f3536c12017e108e231a15fd"
35
35
  }