@nocobase/plugin-data-visualization 2.1.0-alpha.4 → 2.1.0-alpha.45

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.
Files changed (98) hide show
  1. package/LICENSE +201 -661
  2. package/README.md +79 -10
  3. package/client-v2.d.ts +2 -0
  4. package/client-v2.js +1 -0
  5. package/dist/client/102.ae672a174b9de2c5.js +47 -0
  6. package/dist/client/176.0b68fc9582cfe5a3.js +10 -0
  7. package/dist/client/214.6dda3ffed1dca904.js +10 -0
  8. package/dist/client/680.c3725300a5f4414b.js +10 -0
  9. package/dist/client/index.js +1 -1
  10. package/dist/client-v2/176.8068b95175599050.js +10 -0
  11. package/dist/client-v2/214.a999212f348c0092.js +10 -0
  12. package/dist/client-v2/468.95cb9025bce70a9c.js +10 -0
  13. package/dist/client-v2/568.5b6cd8eb09c264ba.js +10 -0
  14. package/dist/client-v2/680.a2c2838809485d36.js +10 -0
  15. package/dist/client-v2/chart/ChartGroup.d.ts +44 -0
  16. package/dist/client-v2/chart/configs.d.ts +290 -0
  17. package/dist/client-v2/chart/index.d.ts +11 -0
  18. package/dist/client-v2/chart/types.d.ts +102 -0
  19. package/dist/{client → client-v2}/flow/models/Chart.d.ts +2 -0
  20. package/dist/{client → client-v2}/flow/models/ChartBlockModel.d.ts +16 -1
  21. package/dist/{client → client-v2}/flow/models/ChartOptionsBuilder.d.ts +9 -0
  22. package/dist/{client → client-v2}/flow/models/ECharts.d.ts +2 -0
  23. package/dist/client-v2/flow/models/EventsEditor.d.ts +14 -0
  24. package/dist/{client → client-v2}/flow/models/QueryBuilder.d.ts +15 -2
  25. package/dist/{client/flow/components/DaraButton.d.ts → client-v2/flow/models/SQLEditor.d.ts} +5 -4
  26. package/dist/{client → client-v2}/flow/models/config-store.d.ts +6 -2
  27. package/dist/{client → client-v2}/flow/resources/ChartResource.d.ts +1 -0
  28. package/dist/{client → client-v2}/flow/utils.d.ts +8 -0
  29. package/dist/client-v2/hooks/index.d.ts +9 -0
  30. package/dist/{client/flow/models/EventsEditor.d.ts → client-v2/hooks/useSetChartSize.d.ts} +11 -2
  31. package/dist/client-v2/index.d.ts +12 -0
  32. package/dist/client-v2/index.js +10 -0
  33. package/dist/client-v2/locale.d.ts +15 -0
  34. package/dist/client-v2/plugin.d.ts +23 -0
  35. package/dist/externalVersion.js +14 -13
  36. package/dist/node_modules/koa-compose/index.js +1 -1
  37. package/dist/node_modules/koa-compose/package.json +1 -1
  38. package/dist/server/actions/query.d.ts +2 -4
  39. package/dist/server/actions/query.js +48 -183
  40. package/dist/server/plugin.js +2 -2
  41. package/dist/server/types.d.ts +3 -0
  42. package/package.json +7 -3
  43. package/dist/client/2ba6e739852f8f86.js +0 -10
  44. package/dist/client/4ce1d9627d8d9325.js +0 -47
  45. package/dist/client/8795975cb8946be4.js +0 -10
  46. package/dist/client/924c5f5607998e1c.js +0 -10
  47. package/dist/client/flow/components/AntdFilterSelector.d.ts +0 -35
  48. package/dist/client/flow/models/SQLEditor.d.ts +0 -10
  49. package/dist/node_modules/moment-timezone/LICENSE +0 -20
  50. package/dist/node_modules/moment-timezone/builds/moment-timezone-with-data-10-year-range.js +0 -1548
  51. package/dist/node_modules/moment-timezone/builds/moment-timezone-with-data-10-year-range.min.js +0 -1
  52. package/dist/node_modules/moment-timezone/builds/moment-timezone-with-data-1970-2030.js +0 -1548
  53. package/dist/node_modules/moment-timezone/builds/moment-timezone-with-data-1970-2030.min.js +0 -1
  54. package/dist/node_modules/moment-timezone/builds/moment-timezone-with-data-2012-2022.js +0 -1560
  55. package/dist/node_modules/moment-timezone/builds/moment-timezone-with-data-2012-2022.min.js +0 -1
  56. package/dist/node_modules/moment-timezone/builds/moment-timezone-with-data.js +0 -1548
  57. package/dist/node_modules/moment-timezone/builds/moment-timezone-with-data.min.js +0 -1
  58. package/dist/node_modules/moment-timezone/builds/moment-timezone.min.js +0 -1
  59. package/dist/node_modules/moment-timezone/composer.json +0 -43
  60. package/dist/node_modules/moment-timezone/data/meta/latest.json +0 -5889
  61. package/dist/node_modules/moment-timezone/data/packed/latest.json +0 -852
  62. package/dist/node_modules/moment-timezone/index.d.ts +0 -78
  63. package/dist/node_modules/moment-timezone/index.js +0 -15
  64. package/dist/node_modules/moment-timezone/moment-timezone-utils.d.ts +0 -70
  65. package/dist/node_modules/moment-timezone/moment-timezone-utils.js +0 -339
  66. package/dist/node_modules/moment-timezone/moment-timezone.js +0 -696
  67. package/dist/node_modules/moment-timezone/package.json +0 -1
  68. package/dist/server/formatter/formatter.d.ts +0 -27
  69. package/dist/server/formatter/formatter.js +0 -85
  70. package/dist/server/formatter/mysql-formatter.d.ts +0 -14
  71. package/dist/server/formatter/mysql-formatter.js +0 -93
  72. package/dist/server/formatter/oracle-formatter.d.ts +0 -14
  73. package/dist/server/formatter/oracle-formatter.js +0 -74
  74. package/dist/server/formatter/postgres-formatter.d.ts +0 -14
  75. package/dist/server/formatter/postgres-formatter.js +0 -74
  76. package/dist/server/formatter/sqlite-formatter.d.ts +0 -15
  77. package/dist/server/formatter/sqlite-formatter.js +0 -83
  78. package/dist/server/query-parser/index.d.ts +0 -11
  79. package/dist/server/query-parser/index.js +0 -56
  80. package/dist/server/query-parser/mysql-query-parser.d.ts +0 -15
  81. package/dist/server/query-parser/mysql-query-parser.js +0 -43
  82. package/dist/server/query-parser/oracle-query-parser.d.ts +0 -18
  83. package/dist/server/query-parser/oracle-query-parser.js +0 -60
  84. package/dist/server/query-parser/postgres-query-parser.d.ts +0 -15
  85. package/dist/server/query-parser/postgres-query-parser.js +0 -43
  86. package/dist/server/query-parser/query-parser.d.ts +0 -31
  87. package/dist/server/query-parser/query-parser.js +0 -146
  88. package/dist/server/query-parser/sqlite-query-parser.d.ts +0 -15
  89. package/dist/server/query-parser/sqlite-query-parser.js +0 -43
  90. /package/dist/{client → client-v2}/flow/components/CodeEditor.d.ts +0 -0
  91. /package/dist/{client → client-v2}/flow/models/ChartOptionsBuilder.service.d.ts +0 -0
  92. /package/dist/{client → client-v2}/flow/models/ChartOptionsEditor.d.ts +0 -0
  93. /package/dist/{client → client-v2}/flow/models/ChartOptionsPanel.d.ts +0 -0
  94. /package/dist/{client → client-v2}/flow/models/ConfigPanel.d.ts +0 -0
  95. /package/dist/{client → client-v2}/flow/models/EventsPanel.d.ts +0 -0
  96. /package/dist/{client → client-v2}/flow/models/QueryBuilder.service.d.ts +0 -0
  97. /package/dist/{client → client-v2}/flow/models/QueryPanel.d.ts +0 -0
  98. /package/dist/{client → client-v2}/flow/models/ResultPanel.d.ts +0 -0
@@ -0,0 +1,290 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export type FieldConfigProps = Partial<{
10
+ name: string;
11
+ title: string;
12
+ required: boolean;
13
+ defaultValue: any;
14
+ description: string;
15
+ options: {
16
+ label: string;
17
+ value: any;
18
+ }[];
19
+ componentProps: Record<string, any>;
20
+ }>;
21
+ export type AnySchema = Record<string, any>;
22
+ export type AnySchemaProperties = Record<string, AnySchema>;
23
+ export type ConfigType = (FieldConfigProps & {
24
+ configType?: string;
25
+ }) | ((props?: FieldConfigProps) => AnySchemaProperties) | AnySchemaProperties;
26
+ export type Config = string | ConfigType;
27
+ declare const _default: {
28
+ field: ({ name, title, required, defaultValue, description }: Partial<{
29
+ name: string;
30
+ title: string;
31
+ required: boolean;
32
+ defaultValue: any;
33
+ description: string;
34
+ options: {
35
+ label: string;
36
+ value: any;
37
+ }[];
38
+ componentProps: Record<string, any>;
39
+ }>) => {
40
+ [x: string]: {
41
+ title: string;
42
+ type: string;
43
+ 'x-decorator': string;
44
+ 'x-component': string;
45
+ 'x-reactions': string;
46
+ required: boolean;
47
+ description: string;
48
+ default: any;
49
+ };
50
+ };
51
+ input: ({ name, title, required, defaultValue, description }: Partial<{
52
+ name: string;
53
+ title: string;
54
+ required: boolean;
55
+ defaultValue: any;
56
+ description: string;
57
+ options: {
58
+ label: string;
59
+ value: any;
60
+ }[];
61
+ componentProps: Record<string, any>;
62
+ }>) => {
63
+ [x: string]: {
64
+ title: string;
65
+ type: string;
66
+ 'x-decorator': string;
67
+ 'x-component': string;
68
+ required: boolean;
69
+ default: any;
70
+ description: string;
71
+ };
72
+ };
73
+ boolean: ({ name, title, defaultValue, description }: Partial<{
74
+ name: string;
75
+ title: string;
76
+ required: boolean;
77
+ defaultValue: any;
78
+ description: string;
79
+ options: {
80
+ label: string;
81
+ value: any;
82
+ }[];
83
+ componentProps: Record<string, any>;
84
+ }>) => {
85
+ [x: string]: {
86
+ 'x-content': string;
87
+ type: string;
88
+ 'x-decorator': string;
89
+ 'x-component': string;
90
+ default: any;
91
+ description: string;
92
+ };
93
+ };
94
+ select: ({ name, title, required, defaultValue, options, description }: Partial<{
95
+ name: string;
96
+ title: string;
97
+ required: boolean;
98
+ defaultValue: any;
99
+ description: string;
100
+ options: {
101
+ label: string;
102
+ value: any;
103
+ }[];
104
+ componentProps: Record<string, any>;
105
+ }>) => {
106
+ [x: string]: {
107
+ title: string;
108
+ type: string;
109
+ 'x-decorator': string;
110
+ 'x-component': string;
111
+ required: boolean;
112
+ default: any;
113
+ description: string;
114
+ enum: {
115
+ label: string;
116
+ value: any;
117
+ }[];
118
+ };
119
+ };
120
+ radio: ({ name, title, defaultValue, options, description, componentProps }: Partial<{
121
+ name: string;
122
+ title: string;
123
+ required: boolean;
124
+ defaultValue: any;
125
+ description: string;
126
+ options: {
127
+ label: string;
128
+ value: any;
129
+ }[];
130
+ componentProps: Record<string, any>;
131
+ }>) => {
132
+ [x: string]: {
133
+ title: string;
134
+ type: string;
135
+ 'x-decorator': string;
136
+ 'x-component': string;
137
+ 'x-component-props': {
138
+ [x: string]: any;
139
+ };
140
+ default: any;
141
+ description: string;
142
+ enum: {
143
+ label: string;
144
+ value: any;
145
+ }[];
146
+ };
147
+ };
148
+ percent: ({ name, title, defaultValue, description }: Partial<{
149
+ name: string;
150
+ title: string;
151
+ required: boolean;
152
+ defaultValue: any;
153
+ description: string;
154
+ options: {
155
+ label: string;
156
+ value: any;
157
+ }[];
158
+ componentProps: Record<string, any>;
159
+ }>) => {
160
+ [x: string]: {
161
+ title: string;
162
+ type: string;
163
+ 'x-decorator': string;
164
+ 'x-component': string;
165
+ default: any;
166
+ description: string;
167
+ 'x-component-props': {
168
+ suffix: string;
169
+ };
170
+ };
171
+ };
172
+ xField: {
173
+ configType: string;
174
+ name: string;
175
+ title: string;
176
+ required: boolean;
177
+ };
178
+ yField: {
179
+ configType: string;
180
+ name: string;
181
+ title: string;
182
+ required: boolean;
183
+ };
184
+ seriesField: {
185
+ configType: string;
186
+ name: string;
187
+ title: string;
188
+ };
189
+ colorField: {
190
+ configType: string;
191
+ name: string;
192
+ title: string;
193
+ required: boolean;
194
+ };
195
+ isStack: {
196
+ configType: string;
197
+ name: string;
198
+ title: string;
199
+ };
200
+ smooth: {
201
+ configType: string;
202
+ name: string;
203
+ title: string;
204
+ };
205
+ isPercent: {
206
+ configType: string;
207
+ name: string;
208
+ title: string;
209
+ };
210
+ isGroup: {
211
+ configType: string;
212
+ name: string;
213
+ title: string;
214
+ };
215
+ size: () => {
216
+ size: {
217
+ title: string;
218
+ type: string;
219
+ 'x-decorator': string;
220
+ 'x-component': string;
221
+ properties: {
222
+ type: {
223
+ 'x-component': string;
224
+ 'x-component-props': {
225
+ allowClear: boolean;
226
+ };
227
+ default: string;
228
+ enum: {
229
+ label: string;
230
+ value: string;
231
+ }[];
232
+ };
233
+ fixed: {
234
+ type: string;
235
+ 'x-component': string;
236
+ 'x-component-props': {
237
+ min: number;
238
+ addonAfter: string;
239
+ };
240
+ 'x-reactions': {
241
+ dependencies: string[];
242
+ fulfill: {
243
+ state: {
244
+ visible: string;
245
+ };
246
+ };
247
+ }[];
248
+ };
249
+ ratio: {
250
+ type: string;
251
+ 'x-component': string;
252
+ 'x-reactions': {
253
+ dependencies: string[];
254
+ fulfill: {
255
+ state: {
256
+ visible: string;
257
+ };
258
+ };
259
+ }[];
260
+ properties: {
261
+ width: {
262
+ type: string;
263
+ 'x-component': string;
264
+ 'x-component-props': {
265
+ placeholder: string;
266
+ min: number;
267
+ };
268
+ };
269
+ colon: {
270
+ type: string;
271
+ 'x-component': string;
272
+ 'x-component-props': {
273
+ children: string;
274
+ };
275
+ };
276
+ height: {
277
+ type: string;
278
+ 'x-component': string;
279
+ 'x-component-props': {
280
+ placeholder: string;
281
+ min: number;
282
+ };
283
+ };
284
+ };
285
+ };
286
+ };
287
+ };
288
+ };
289
+ };
290
+ export default _default;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export * from './ChartGroup';
10
+ export * from './types';
11
+ export * from './configs';
@@ -0,0 +1,102 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ import { AnySchema, Config, ConfigType } from './configs';
11
+ export type FieldOption = {
12
+ value: string;
13
+ label: string;
14
+ key: string;
15
+ alias?: string;
16
+ name?: string;
17
+ type?: string;
18
+ interface?: string;
19
+ uiSchema?: AnySchema;
20
+ target?: string;
21
+ targetFields?: FieldOption[];
22
+ };
23
+ export type MeasureProps = {
24
+ field: string | string[];
25
+ aggregation?: string;
26
+ alias?: string;
27
+ };
28
+ export type DimensionProps = {
29
+ field: string | string[];
30
+ alias?: string;
31
+ format?: string;
32
+ };
33
+ export type Transformer = (val: any, ...args: any[]) => string | number;
34
+ export type FieldRenderProps = {
35
+ label: string;
36
+ interface?: string;
37
+ transformer?: Transformer;
38
+ };
39
+ export type RenderProps = {
40
+ data: Record<string, any>[];
41
+ general: any;
42
+ advanced: any;
43
+ fieldProps: {
44
+ [field: string]: FieldRenderProps;
45
+ };
46
+ };
47
+ export interface ChartType {
48
+ name: string;
49
+ title: string;
50
+ enableAdvancedConfig?: boolean;
51
+ Component: React.FC<any>;
52
+ schema: AnySchema;
53
+ init?: (fields: FieldOption[], query: {
54
+ measures?: MeasureProps[];
55
+ dimensions?: DimensionProps[];
56
+ }) => {
57
+ general?: any;
58
+ advanced?: any;
59
+ };
60
+ getProps(props: RenderProps): any;
61
+ getReference?: () => {
62
+ title: string;
63
+ link: string;
64
+ };
65
+ }
66
+ export type ChartProps = {
67
+ name: string;
68
+ title: string;
69
+ enableAdvancedConfig?: boolean;
70
+ Component: React.FC<any>;
71
+ config?: Config[];
72
+ };
73
+ export declare class Chart implements ChartType {
74
+ name: string;
75
+ title: string;
76
+ enableAdvancedConfig: boolean;
77
+ Component: React.FC<any>;
78
+ config: Config[];
79
+ configTypes: Map<string, ConfigType>;
80
+ constructor({ name, title, enableAdvancedConfig, Component, config }: ChartProps);
81
+ get schema(): {
82
+ type?: undefined;
83
+ properties?: undefined;
84
+ } | {
85
+ type: string;
86
+ properties: any;
87
+ };
88
+ addConfigTypes(configs: {
89
+ [key: string]: ConfigType;
90
+ }): void;
91
+ infer(fields: FieldOption[], { measures, dimensions, }: {
92
+ measures?: MeasureProps[];
93
+ dimensions?: DimensionProps[];
94
+ }): {
95
+ xField: FieldOption;
96
+ yField: FieldOption;
97
+ seriesField: FieldOption;
98
+ colorField: FieldOption;
99
+ yFields: FieldOption[];
100
+ };
101
+ getProps(props: RenderProps): any;
102
+ }
@@ -10,8 +10,10 @@ import React from 'react';
10
10
  import { EChartsOption, EChartsType } from 'echarts';
11
11
  export interface ChartOptions {
12
12
  option: EChartsOption;
13
+ Component?: React.FC<any>;
13
14
  dataSource: any;
14
15
  onRefReady?: (chart: EChartsType) => void;
15
16
  loading?: boolean;
17
+ heightMode?: string;
16
18
  }
17
19
  export declare const Chart: React.ForwardRefExoticComponent<ChartOptions & React.RefAttributes<EChartsType>>;
@@ -6,11 +6,12 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- import { ChildPageModel, DataBlockModel } from '@nocobase/client';
9
+ import { ChildPageModel, DataBlockModel } from '@nocobase/client-v2';
10
10
  import { SQLResource } from '@nocobase/flow-engine';
11
11
  import React from 'react';
12
12
  import { ChartOptions } from './Chart';
13
13
  import { ChartResource } from '../resources/ChartResource';
14
+ import PluginDataVisualizationClient from '../../plugin';
14
15
  type ChartBlockModelStructure = {
15
16
  subModels: {
16
17
  page: ChildPageModel;
@@ -19,6 +20,7 @@ type ChartBlockModelStructure = {
19
20
  type ChartProps = {
20
21
  chart: ChartOptions & {
21
22
  optionRaw?: string;
23
+ Component?: React.FC<any>;
22
24
  };
23
25
  };
24
26
  export declare class ChartBlockModel extends DataBlockModel<ChartBlockModelStructure> {
@@ -30,6 +32,7 @@ export declare class ChartBlockModel extends DataBlockModel<ChartBlockModelStruc
30
32
  refresh(): Promise<void>;
31
33
  initResource(mode?: string): void;
32
34
  getResourceSettingsInitParams(): any;
35
+ buildQueryRequest(query: any): Promise<any>;
33
36
  onInit(options: any): Promise<void>;
34
37
  renderComponent(): React.JSX.Element;
35
38
  getFilterFields(): Promise<{
@@ -52,7 +55,19 @@ export declare class ChartBlockModel extends DataBlockModel<ChartBlockModelStruc
52
55
  mode: 'basic' | 'custom';
53
56
  builder?: any;
54
57
  raw?: string;
58
+ query?: any;
55
59
  }): Promise<void>;
60
+ getRegisteredChart(type?: string): import("../..").ChartType;
61
+ getV2DataVisualizationPlugin(): PluginDataVisualizationClient;
62
+ getDataVisualizationPlugin(): PluginDataVisualizationClient;
63
+ getRegisteredChartGeneral(builder?: any): any;
64
+ getRegisteredChartFieldProps(query: any, data?: Record<string, any>[]): Record<string, any>;
65
+ formatRegisteredChartData(data?: Record<string, any>[], fieldProps?: Record<string, any>): {
66
+ [x: string]: any;
67
+ }[];
68
+ getRegisteredChartDisplayFieldProps(fieldProps?: Record<string, any>): {};
69
+ getRegisteredChartFieldTransformer(field?: any, item?: any): (value: any) => any;
70
+ getCollectionFieldByPath(query: any, field: string | string[] | undefined): any;
56
71
  applyEvents(raw?: string): Promise<void>;
57
72
  renderChart(): void;
58
73
  onPreview(params: {
@@ -7,8 +7,17 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import React from 'react';
10
+ import { type FieldOption } from '../../chart';
11
+ type BuilderFieldOption = Partial<FieldOption> & {
12
+ label: string;
13
+ value: string;
14
+ key?: string;
15
+ };
10
16
  export declare const ChartOptionsBuilder: React.FC<{
11
17
  columns?: string[];
18
+ fieldOptions?: BuilderFieldOption[];
19
+ query?: any;
12
20
  initialValues: any;
13
21
  onChange: (next: any) => void;
14
22
  }>;
23
+ export {};
@@ -9,12 +9,14 @@
9
9
  import React from 'react';
10
10
  import * as echarts from 'echarts';
11
11
  import type { EChartsType, EChartsOption } from 'echarts';
12
+ import './chartBlock.css';
12
13
  interface Props {
13
14
  option: EChartsOption;
14
15
  style?: React.CSSProperties;
15
16
  className?: string;
16
17
  theme?: string;
17
18
  onRefReady?: (chart: EChartsType) => void;
19
+ fillHeight?: boolean;
18
20
  }
19
21
  declare const ECharts: React.ForwardRefExoticComponent<Props & React.RefAttributes<echarts.ECharts>>;
20
22
  export default ECharts;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ declare const EventsEditor: React.FC<{
11
+ value?: string;
12
+ onChange?: (value: string) => void;
13
+ }>;
14
+ export default EventsEditor;
@@ -10,7 +10,20 @@ import React from 'react';
10
10
  export type QueryBuilderRef = {
11
11
  validate: () => Promise<any>;
12
12
  };
13
+ type QueryValue = {
14
+ collectionPath?: string[];
15
+ measures?: any[];
16
+ dimensions?: any[];
17
+ filter?: {
18
+ logic: '$and' | '$or';
19
+ items: any[];
20
+ };
21
+ orders?: any[];
22
+ limit?: number;
23
+ offset?: number;
24
+ };
13
25
  export declare const QueryBuilder: React.ForwardRefExoticComponent<{
14
- initialValues?: any;
15
- onChange?: (v: any) => void;
26
+ value?: QueryValue;
27
+ onChange?: (value: QueryValue) => void;
16
28
  } & React.RefAttributes<QueryBuilderRef>>;
29
+ export {};
@@ -7,8 +7,9 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import React from 'react';
10
- import type { FlowSettingsContext } from '@nocobase/flow-engine';
11
- export declare const DaraButton: React.FC<{
12
- ctx: FlowSettingsContext<any>;
10
+ export declare const SQLEditor: React.FC<{
11
+ value?: string;
12
+ onChange?: (value: string) => void;
13
+ dataSource?: string;
14
+ onDataSourceChange?: (value: string) => void;
13
15
  }>;
14
- export default DaraButton;
@@ -14,7 +14,11 @@ interface ConfigState {
14
14
  };
15
15
  };
16
16
  setResult: (uid: string, result: any) => void;
17
- setError?: (uid: string, error: string) => void;
17
+ setError: (uid: string, error: string) => void;
18
18
  }
19
- export declare const configStore: ConfigState;
19
+ type ConfigStore = ConfigState & {
20
+ version: number;
21
+ subscribe: (listener: () => void) => () => void;
22
+ };
23
+ export declare const configStore: ConfigStore;
20
24
  export {};
@@ -30,6 +30,7 @@ export declare class ChartResource<TData = any> extends BaseRecordResource<TData
30
30
  orders: any;
31
31
  limit: any;
32
32
  offset: any;
33
+ contextParams: any;
33
34
  };
34
35
  run(): Promise<any>;
35
36
  refresh(): Promise<void>;
@@ -40,3 +40,11 @@ export declare function sleep(ms: number): Promise<void>;
40
40
  export declare function appendColon(label: string, lang?: string): string;
41
41
  export declare const isDebugEnabled: () => boolean;
42
42
  export declare const debugLog: (...args: any[]) => void;
43
+ export declare const useCompile: () => (source: any) => any;
44
+ export declare const parseField: (field: string | string[]) => {
45
+ target: string;
46
+ name: string;
47
+ alias: string;
48
+ };
49
+ export declare const removeUnparsableFilter: (filter: any) => any;
50
+ export declare const isEmptyFilterObject: (filter: any) => boolean;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export * from './useSetChartSize';
@@ -7,5 +7,14 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  /// <reference types="react" />
10
- declare const EventsEditor: import("react").ForwardRefExoticComponent<Omit<Partial<import("../components/CodeEditor").CodeEditorProps & import("react").RefAttributes<import("../components/CodeEditor").CodeEditorHandle>>, "ref"> & import("react").RefAttributes<unknown>>;
11
- export default EventsEditor;
10
+ export declare const useSetChartSize: (size?: {
11
+ type?: 'fixed' | 'ratio';
12
+ ratio?: {
13
+ width: number;
14
+ height: number;
15
+ };
16
+ fixed?: number;
17
+ }, fixedHeight?: number) => {
18
+ chartRef: import("react").MutableRefObject<HTMLDivElement>;
19
+ chartHeight: number;
20
+ };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export { default } from './plugin';
10
+ export * from './plugin';
11
+ export * from './chart';
12
+ export * from './hooks';