@byteluck-fe/model-driven-controls 7.0.0-props.103 → 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
  * 标题
@@ -78,12 +84,6 @@ interface BarChartPropertyInterface extends PropertyInterface {
78
84
  * @public
79
85
  */
80
86
  template: string;
81
- /**
82
- * 数据模式;取值:static:静态数据;dynamic:动态数据源;
83
- * @defaultValue 'static'
84
- * @public
85
- */
86
- dataMode: BarChartDataMode;
87
87
  /**
88
88
  * 图表 option JSON
89
89
  * @defaultValue '{}'
@@ -98,16 +98,16 @@ interface BarChartPropertyInterface extends PropertyInterface {
98
98
  optionConfig: 'datasource';
99
99
  /**
100
100
  * 数据源绑定
101
- * @defaultValue new TreeDataSourceBind({ attributes: BarChartControl.controlCustomAttributes })
101
+ * @defaultValue new DataSourceBind()
102
102
  * @public
103
103
  */
104
- datasourceBind: TreeDataSourceBind;
104
+ datasourceBind: DataSourceBind;
105
105
  /**
106
106
  * 筛选项数据源绑定
107
- * @defaultValue new TreeDataSourceBind({ attributes: BarChartControl.controlCustomAttributes })
107
+ * @defaultValue new DataSourceBind()
108
108
  * @public
109
109
  */
110
- filterItemDatasourceBind: TreeDataSourceBind;
110
+ filterItemDatasourceBind: DataSourceBind;
111
111
  /**
112
112
  * 多级填充
113
113
  * @defaultValue []
@@ -146,6 +146,7 @@ interface BarChartPropertyInterface extends PropertyInterface {
146
146
  seriesConfig: BarChartSeriesConfigItem[];
147
147
  }
148
148
  declare class BarChartProperty extends Property implements BarChartPropertyInterface {
149
+ static readonly Rules: typeof BarChartPropertyRules;
149
150
  caption: string;
150
151
  isHideCaption: boolean;
151
152
  isShowCaptionTip: boolean;
@@ -157,11 +158,10 @@ declare class BarChartProperty extends Property implements BarChartPropertyInter
157
158
  captionFontWeight: FONT_WEIGHT;
158
159
  isHide: boolean;
159
160
  template: string;
160
- dataMode: BarChartDataMode;
161
161
  optionJson: string;
162
162
  optionConfig: 'datasource';
163
- datasourceBind: TreeDataSourceBind;
164
- filterItemDatasourceBind: TreeDataSourceBind;
163
+ datasourceBind: DataSourceBind;
164
+ filterItemDatasourceBind: DataSourceBind;
165
165
  multistageFilling: MultistageFillingItem[];
166
166
  defaultValue: string[];
167
167
  openMultistageFilling: boolean;
@@ -171,5 +171,5 @@ declare class BarChartProperty extends Property implements BarChartPropertyInter
171
171
  constructor(props?: Partial<BarChartProperty>);
172
172
  }
173
173
  export default BarChartProperty;
174
- export type { BarChartDataMode, BarChartSeriesConfigItem, BarChartPropertyInterface, BarChartYFieldItem, };
175
- 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
  * 标题
@@ -81,12 +87,6 @@ interface LineChartPropertyInterface extends PropertyInterface {
81
87
  * @public
82
88
  */
83
89
  template: string;
84
- /**
85
- * 数据模式;取值:static:静态数据;dynamic:动态数据源;
86
- * @defaultValue 'static'
87
- * @public
88
- */
89
- dataMode: LineChartDataMode;
90
90
  /**
91
91
  * 图表 option JSON
92
92
  * @defaultValue '{}'
@@ -101,16 +101,16 @@ interface LineChartPropertyInterface extends PropertyInterface {
101
101
  optionConfig: 'datasource';
102
102
  /**
103
103
  * 数据源绑定
104
- * @defaultValue new TreeDataSourceBind({ attributes: LineChartControl.controlCustomAttributes })
104
+ * @defaultValue new DataSourceBind()
105
105
  * @public
106
106
  */
107
- datasourceBind: TreeDataSourceBind;
107
+ datasourceBind: DataSourceBind;
108
108
  /**
109
109
  * 筛选项数据源绑定
110
- * @defaultValue new TreeDataSourceBind({ attributes: LineChartControl.controlCustomAttributes })
110
+ * @defaultValue new DataSourceBind()
111
111
  * @public
112
112
  */
113
- filterItemDatasourceBind: TreeDataSourceBind;
113
+ filterItemDatasourceBind: DataSourceBind;
114
114
  /**
115
115
  * 多级填充
116
116
  * @defaultValue []
@@ -149,6 +149,7 @@ interface LineChartPropertyInterface extends PropertyInterface {
149
149
  seriesConfig: LineChartSeriesConfigItem[];
150
150
  }
151
151
  declare class LineChartProperty extends Property implements LineChartPropertyInterface {
152
+ static readonly Rules: typeof LineChartPropertyRules;
152
153
  caption: string;
153
154
  isHideCaption: boolean;
154
155
  isShowCaptionTip: boolean;
@@ -160,11 +161,10 @@ declare class LineChartProperty extends Property implements LineChartPropertyInt
160
161
  captionFontWeight: FONT_WEIGHT;
161
162
  isHide: boolean;
162
163
  template: string;
163
- dataMode: LineChartDataMode;
164
164
  optionJson: string;
165
165
  optionConfig: 'datasource';
166
- datasourceBind: TreeDataSourceBind;
167
- filterItemDatasourceBind: TreeDataSourceBind;
166
+ datasourceBind: DataSourceBind;
167
+ filterItemDatasourceBind: DataSourceBind;
168
168
  multistageFilling: MultistageFillingItem[];
169
169
  defaultValue: string[];
170
170
  openMultistageFilling: boolean;
@@ -174,5 +174,5 @@ declare class LineChartProperty extends Property implements LineChartPropertyInt
174
174
  constructor(props?: Partial<LineChartProperty>);
175
175
  }
176
176
  export default LineChartProperty;
177
- export type { LineChartDataMode, LineChartSeriesConfigItem, LineChartPropertyInterface, };
178
- 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;
@@ -72,12 +71,6 @@ interface PieChartPropertyInterface extends PropertyInterface {
72
71
  * @public
73
72
  */
74
73
  template: string;
75
- /**
76
- * 数据模式;取值:static:静态数据;dynamic:动态数据源;
77
- * @defaultValue 'static'
78
- * @public
79
- */
80
- dataMode: PieChartDataMode;
81
74
  /**
82
75
  * 图表 option JSON
83
76
  * @defaultValue '{}'
@@ -92,16 +85,16 @@ interface PieChartPropertyInterface extends PropertyInterface {
92
85
  optionConfig: 'datasource';
93
86
  /**
94
87
  * 数据源绑定
95
- * @defaultValue new TreeDataSourceBind({ attributes: PieChartControl.controlCustomAttributes })
88
+ * @defaultValue new DataSourceBind()
96
89
  * @public
97
90
  */
98
- datasourceBind: TreeDataSourceBind;
91
+ datasourceBind: DataSourceBind;
99
92
  /**
100
93
  * 筛选项数据源绑定
101
- * @defaultValue new TreeDataSourceBind({ attributes: PieChartControl.controlCustomAttributes })
94
+ * @defaultValue new DataSourceBind()
102
95
  * @public
103
96
  */
104
- filterItemDatasourceBind: TreeDataSourceBind;
97
+ filterItemDatasourceBind: DataSourceBind;
105
98
  /**
106
99
  * 多级填充
107
100
  * @defaultValue []
@@ -139,11 +132,10 @@ declare class PieChartProperty extends Property implements PieChartPropertyInter
139
132
  captionFontWeight: FONT_WEIGHT;
140
133
  isHide: boolean;
141
134
  template: string;
142
- dataMode: PieChartDataMode;
143
135
  optionJson: string;
144
136
  optionConfig: 'datasource';
145
- datasourceBind: TreeDataSourceBind;
146
- filterItemDatasourceBind: TreeDataSourceBind;
137
+ datasourceBind: DataSourceBind;
138
+ filterItemDatasourceBind: DataSourceBind;
147
139
  multistageFilling: MultistageFillingItem[];
148
140
  defaultValue: string[];
149
141
  openMultistageFilling: boolean;
@@ -151,5 +143,5 @@ declare class PieChartProperty extends Property implements PieChartPropertyInter
151
143
  constructor(props?: Partial<PieChartProperty>);
152
144
  }
153
145
  export default PieChartProperty;
154
- export type { PieChartDataMode, PieChartPropertyInterface, PieSeriesDataConfig, };
146
+ export type { PieChartPropertyInterface, PieSeriesDataConfig };
155
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.103",
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": "ef8434f5693d1f0ab169af4b47bafa5a89a6539f"
34
+ "gitHead": "96c6724eec770458f3536c12017e108e231a15fd"
35
35
  }