@nocobase/plugin-data-visualization 2.0.0-alpha.3 → 2.0.0-alpha.30
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/client/6e1cdfb2aece2692.js +47 -0
- package/dist/client/flow/models/ChartBlockModel.d.ts +19 -19
- package/dist/client/flow/models/ChartOptionsBuilder.d.ts +3 -5
- package/dist/client/flow/models/ChartOptionsBuilder.service.d.ts +45 -3
- package/dist/client/flow/models/{ChartEventsEditor.d.ts → EventsEditor.d.ts} +2 -1
- package/dist/client/flow/models/QueryBuilder.d.ts +7 -1
- package/dist/client/flow/models/QueryBuilder.service.d.ts +19 -0
- package/dist/client/flow/resources/ChartResource.d.ts +1 -4
- package/dist/client/flow/utils.d.ts +4 -0
- package/dist/client/index.js +1 -1
- package/dist/client/utils.d.ts +11 -11
- package/dist/externalVersion.js +9 -9
- package/dist/locale/en-US.json +36 -9
- package/dist/locale/zh-CN.json +33 -6
- package/dist/node_modules/koa-compose/package.json +1 -1
- package/dist/node_modules/moment-timezone/package.json +1 -1
- package/package.json +2 -2
- package/dist/client/0c07b8c8a2f69574.js +0 -47
- package/dist/client/flow/models/ChartPreviewer.d.ts +0 -10
- package/dist/client/flow/models/FormItemLite.d.ts +0 -13
- package/dist/client/flow/models/queryBuilder.logic.d.ts +0 -25
|
@@ -6,32 +6,19 @@
|
|
|
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 {
|
|
9
|
+
import { ChildPageModel, DataBlockModel } from '@nocobase/client';
|
|
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
14
|
type ChartBlockModelStructure = {
|
|
15
15
|
subModels: {
|
|
16
|
-
page:
|
|
16
|
+
page: ChildPageModel;
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
type ChartProps = {
|
|
20
|
-
query: {
|
|
21
|
-
mode: 'builder' | 'sql';
|
|
22
|
-
measure?: any;
|
|
23
|
-
dimension?: any;
|
|
24
|
-
filter?: any;
|
|
25
|
-
order?: any;
|
|
26
|
-
limit?: any;
|
|
27
|
-
offset?: any;
|
|
28
|
-
sql?: string;
|
|
29
|
-
};
|
|
30
20
|
chart: ChartOptions & {
|
|
31
21
|
optionRaw?: string;
|
|
32
|
-
mode: 'basic' | 'custom';
|
|
33
|
-
builder?: any;
|
|
34
|
-
raw?: string;
|
|
35
22
|
};
|
|
36
23
|
};
|
|
37
24
|
export declare class ChartBlockModel extends DataBlockModel<ChartBlockModelStructure> {
|
|
@@ -41,7 +28,7 @@ export declare class ChartBlockModel extends DataBlockModel<ChartBlockModelStruc
|
|
|
41
28
|
private __onResourceRefresh;
|
|
42
29
|
initResource(mode?: string): void;
|
|
43
30
|
getResourceSettingsInitParams(): any;
|
|
44
|
-
onInit(options: any): void
|
|
31
|
+
onInit(options: any): Promise<void>;
|
|
45
32
|
renderComponent(): React.JSX.Element;
|
|
46
33
|
getFilterFields(): Promise<{
|
|
47
34
|
name: string;
|
|
@@ -57,8 +44,21 @@ export declare class ChartBlockModel extends DataBlockModel<ChartBlockModelStruc
|
|
|
57
44
|
};
|
|
58
45
|
}[]>;
|
|
59
46
|
checkResource(query: any): void;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
47
|
+
applyQuery(query: any, options?: {
|
|
48
|
+
debug?: boolean;
|
|
49
|
+
}): void;
|
|
50
|
+
setDataResult(): void;
|
|
51
|
+
applyChartOptions(payload: {
|
|
52
|
+
mode: 'basic' | 'custom';
|
|
53
|
+
builder?: any;
|
|
54
|
+
raw?: string;
|
|
55
|
+
}): Promise<void>;
|
|
56
|
+
applyEvents(raw?: string): Promise<void>;
|
|
57
|
+
renderChart(): void;
|
|
58
|
+
onPreview(params: {
|
|
59
|
+
query: any;
|
|
60
|
+
chart: any;
|
|
61
|
+
}, needQueryData?: boolean): Promise<void>;
|
|
62
|
+
cancelPreview(): Promise<void>;
|
|
63
63
|
}
|
|
64
64
|
export {};
|
|
@@ -8,9 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
10
|
export declare const ChartOptionsBuilder: React.FC<{
|
|
11
|
-
columns
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
onChange?: (next: any) => void;
|
|
15
|
-
onRawChange?: (raw: string) => void;
|
|
11
|
+
columns?: string[];
|
|
12
|
+
initialValues: any;
|
|
13
|
+
onChange: (next: any) => void;
|
|
16
14
|
}>;
|
|
@@ -6,11 +6,53 @@
|
|
|
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
|
+
export type ChartTypeKey = 'line' | 'bar' | 'barHorizontal' | 'pie' | 'doughnut' | 'scatter' | 'area' | 'funnel';
|
|
10
|
+
export declare function getChartFormSpec(type: ChartTypeKey): ({
|
|
11
|
+
kind: string;
|
|
12
|
+
name: any;
|
|
13
|
+
labelKey: any;
|
|
14
|
+
options: any;
|
|
15
|
+
required?: undefined;
|
|
16
|
+
allowClear?: undefined;
|
|
17
|
+
placeholderKey?: undefined;
|
|
18
|
+
min?: undefined;
|
|
19
|
+
max?: undefined;
|
|
20
|
+
} | {
|
|
21
|
+
kind: string;
|
|
22
|
+
name: any;
|
|
23
|
+
labelKey: any;
|
|
24
|
+
required: boolean;
|
|
25
|
+
allowClear: boolean;
|
|
26
|
+
placeholderKey: string;
|
|
27
|
+
options?: undefined;
|
|
28
|
+
min?: undefined;
|
|
29
|
+
max?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
kind: string;
|
|
32
|
+
name: any;
|
|
33
|
+
labelKey: any;
|
|
34
|
+
options?: undefined;
|
|
35
|
+
required?: undefined;
|
|
36
|
+
allowClear?: undefined;
|
|
37
|
+
placeholderKey?: undefined;
|
|
38
|
+
min?: undefined;
|
|
39
|
+
max?: undefined;
|
|
40
|
+
} | {
|
|
41
|
+
kind: string;
|
|
42
|
+
name: any;
|
|
43
|
+
labelKey: any;
|
|
44
|
+
min: any;
|
|
45
|
+
max: any;
|
|
46
|
+
options?: undefined;
|
|
47
|
+
required?: undefined;
|
|
48
|
+
allowClear?: undefined;
|
|
49
|
+
placeholderKey?: undefined;
|
|
50
|
+
})[];
|
|
9
51
|
export declare function buildFieldOptions(columns?: string[]): {
|
|
10
52
|
label: string;
|
|
11
53
|
value: string;
|
|
12
54
|
}[];
|
|
13
|
-
export declare function stripInvalidColumns(builder?:
|
|
14
|
-
export declare function normalizeBuilder(builder
|
|
15
|
-
export declare function applyTypeChange(builder:
|
|
55
|
+
export declare function stripInvalidColumns(builder?: {}, columns?: string[]): any;
|
|
56
|
+
export declare function normalizeBuilder(builder: any, columns?: string[]): any;
|
|
57
|
+
export declare function applyTypeChange(builder: {}, nextType: ChartTypeKey, columns?: string[]): any;
|
|
16
58
|
export declare function genRawByBuilder(builder: any): string;
|
|
@@ -7,4 +7,5 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
/// <reference types="react" />
|
|
10
|
-
|
|
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;
|
|
@@ -7,4 +7,10 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
|
-
export
|
|
10
|
+
export type QueryBuilderRef = {
|
|
11
|
+
validate: () => Promise<any>;
|
|
12
|
+
};
|
|
13
|
+
export declare const QueryBuilder: React.ForwardRefExoticComponent<{
|
|
14
|
+
initialValues?: any;
|
|
15
|
+
onChange?: (v: any) => void;
|
|
16
|
+
} & React.RefAttributes<QueryBuilderRef>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
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 declare function getFieldOptions(dm: any, compile: (v: any) => string, collectionPath?: string[]): any;
|
|
10
|
+
export declare function aliasOf(val: any): string;
|
|
11
|
+
export declare function getFormatterOptionsByField(dm: any, collectionPath: string[] | undefined, dimField: any): {
|
|
12
|
+
label: string;
|
|
13
|
+
value: string;
|
|
14
|
+
}[];
|
|
15
|
+
export declare function getCollectionOptions(dm: any, compile: (v: any) => string): any;
|
|
16
|
+
export declare function validateQuery(query: Record<string, any>): {
|
|
17
|
+
success: boolean;
|
|
18
|
+
message: string;
|
|
19
|
+
};
|
|
@@ -19,10 +19,6 @@ export declare class ChartResource<TData = any> extends BaseRecordResource<TData
|
|
|
19
19
|
};
|
|
20
20
|
setQueryParams(query: Record<string, any>, mark?: string): this;
|
|
21
21
|
setFilter(filter: Record<string, any>): this;
|
|
22
|
-
validateQuery(query: Record<string, any>): {
|
|
23
|
-
success: boolean;
|
|
24
|
-
message: string;
|
|
25
|
-
};
|
|
26
22
|
parseQuery(query: Record<string, any>): {
|
|
27
23
|
mode: any;
|
|
28
24
|
sql: any;
|
|
@@ -31,6 +27,7 @@ export declare class ChartResource<TData = any> extends BaseRecordResource<TData
|
|
|
31
27
|
measures: any;
|
|
32
28
|
dimensions: any;
|
|
33
29
|
filter: any;
|
|
30
|
+
orders: any;
|
|
34
31
|
limit: any;
|
|
35
32
|
offset: any;
|
|
36
33
|
};
|
|
@@ -31,3 +31,7 @@ export declare const formatters: {
|
|
|
31
31
|
value: string;
|
|
32
32
|
}[];
|
|
33
33
|
};
|
|
34
|
+
export declare function sleep(ms: number): Promise<void>;
|
|
35
|
+
export declare function appendColon(label: string, lang?: string): string;
|
|
36
|
+
export declare const isDebugEnabled: () => boolean;
|
|
37
|
+
export declare const debugLog: (...args: any[]) => void;
|