@nocobase/plugin-data-visualization 2.0.0-alpha.9 → 2.1.0-alpha.1
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/2ba6e739852f8f86.js +10 -0
- package/dist/client/8795975cb8946be4.js +10 -0
- package/dist/client/924c5f5607998e1c.js +10 -0
- package/dist/client/fc43d8506e8af37e.js +47 -0
- package/dist/client/flow/components/AntdFilterSelector.d.ts +35 -0
- package/dist/client/flow/{models/FormItemLite.d.ts → components/DaraButton.d.ts} +5 -4
- package/dist/client/flow/models/Chart.d.ts +1 -0
- package/dist/client/flow/models/ChartBlockModel.d.ts +2 -1
- package/dist/client/flow/models/ChartOptionsBuilder.service.d.ts +15 -5
- package/dist/client/flow/models/ChartOptionsPanel.d.ts +1 -0
- package/dist/client/flow/models/QueryBuilder.d.ts +7 -1
- package/dist/client/flow/models/QueryBuilder.service.d.ts +20 -0
- package/dist/client/flow/resources/ChartResource.d.ts +1 -4
- package/dist/client/flow/utils.d.ts +8 -0
- package/dist/client/index.js +1 -1
- package/dist/client/utils.d.ts +11 -11
- package/dist/externalVersion.js +10 -9
- package/dist/locale/de-DE.json +122 -79
- package/dist/locale/en-US.json +122 -91
- package/dist/locale/es-ES.json +145 -0
- package/dist/locale/fr-FR.json +145 -0
- package/dist/locale/hu-HU.json +145 -0
- package/dist/locale/id-ID.json +145 -0
- package/dist/locale/it-IT.json +122 -79
- package/dist/locale/ja-JP.json +130 -78
- package/dist/locale/ko-KR.json +140 -70
- package/dist/locale/nl-NL.json +149 -99
- package/dist/locale/pt-BR.json +145 -0
- package/dist/locale/ru-RU.json +145 -0
- package/dist/locale/tr-TR.json +145 -0
- package/dist/locale/uk-UA.json +145 -0
- package/dist/locale/vi-VN.json +145 -0
- package/dist/locale/zh-CN.json +122 -92
- package/dist/locale/zh-TW.json +145 -0
- package/dist/node_modules/koa-compose/package.json +1 -1
- package/dist/node_modules/moment-timezone/package.json +1 -1
- package/dist/server/actions/query.js +20 -2
- package/package.json +8 -4
- package/dist/client/33f0f13fb9c8b63c.js +0 -10
- package/dist/client/8ebfbee9a8f41422.js +0 -47
- package/dist/client/d5982ab2df5b1822.js +0 -10
- package/dist/client/e5eee84a69b5014e.js +0 -10
- package/dist/client/flow/models/queryBuilder.logic.d.ts +0 -25
|
@@ -0,0 +1,35 @@
|
|
|
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 type { CSSProperties } from 'react';
|
|
11
|
+
import type { VariableFilterItemValue } from '@nocobase/client';
|
|
12
|
+
import type { FlowModel } from '@nocobase/flow-engine';
|
|
13
|
+
type LogicOp = '$and' | '$or';
|
|
14
|
+
export type FilterCondition = VariableFilterItemValue;
|
|
15
|
+
export type FilterGroupValue = {
|
|
16
|
+
logic: LogicOp;
|
|
17
|
+
items: Array<FilterCondition | FilterGroupValue>;
|
|
18
|
+
};
|
|
19
|
+
export interface AntdFilterSelectorProps {
|
|
20
|
+
value?: FilterGroupValue;
|
|
21
|
+
onChange?: (next: FilterGroupValue) => void;
|
|
22
|
+
model: FlowModel;
|
|
23
|
+
rightAsVariable?: boolean;
|
|
24
|
+
collectionPath?: string[];
|
|
25
|
+
className?: string;
|
|
26
|
+
style?: CSSProperties;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* AntdFilterSelector
|
|
30
|
+
* - antd Form.Item 子组件
|
|
31
|
+
* - 内部用响应式对象驱动 FilterGroup/VariableFilterItem
|
|
32
|
+
* - reaction 桥接所有深层变更为 antd 的 onChange
|
|
33
|
+
*/
|
|
34
|
+
export declare const AntdFilterSelector: React.FC<AntdFilterSelectorProps>;
|
|
35
|
+
export default AntdFilterSelector;
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import {
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
import type { FlowSettingsContext } from '@nocobase/flow-engine';
|
|
11
|
+
export declare const DaraButton: React.FC<{
|
|
12
|
+
ctx: FlowSettingsContext<any>;
|
|
13
|
+
}>;
|
|
14
|
+
export default DaraButton;
|
|
@@ -26,9 +26,10 @@ export declare class ChartBlockModel extends DataBlockModel<ChartBlockModelStruc
|
|
|
26
26
|
_previousStepParams: any;
|
|
27
27
|
get resource(): ChartResource<any> | SQLResource<any>;
|
|
28
28
|
private __onResourceRefresh;
|
|
29
|
+
onActive(): void;
|
|
29
30
|
initResource(mode?: string): void;
|
|
30
31
|
getResourceSettingsInitParams(): any;
|
|
31
|
-
onInit(options: any): void
|
|
32
|
+
onInit(options: any): Promise<void>;
|
|
32
33
|
renderComponent(): React.JSX.Element;
|
|
33
34
|
getFilterFields(): Promise<{
|
|
34
35
|
name: string;
|
|
@@ -6,22 +6,32 @@
|
|
|
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' | 'scatter';
|
|
9
|
+
export type ChartTypeKey = 'line' | 'bar' | 'barHorizontal' | 'pie' | 'doughnut' | 'scatter' | 'area' | 'funnel';
|
|
10
10
|
export declare function getChartFormSpec(type: ChartTypeKey): ({
|
|
11
11
|
kind: string;
|
|
12
12
|
name: any;
|
|
13
|
-
|
|
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;
|
|
14
24
|
required: boolean;
|
|
15
25
|
allowClear: boolean;
|
|
16
26
|
placeholderKey: string;
|
|
17
|
-
|
|
27
|
+
options?: undefined;
|
|
18
28
|
min?: undefined;
|
|
19
29
|
max?: undefined;
|
|
20
30
|
} | {
|
|
21
31
|
kind: string;
|
|
22
32
|
name: any;
|
|
23
33
|
labelKey: any;
|
|
24
|
-
|
|
34
|
+
options?: undefined;
|
|
25
35
|
required?: undefined;
|
|
26
36
|
allowClear?: undefined;
|
|
27
37
|
placeholderKey?: undefined;
|
|
@@ -33,7 +43,7 @@ export declare function getChartFormSpec(type: ChartTypeKey): ({
|
|
|
33
43
|
labelKey: any;
|
|
34
44
|
min: any;
|
|
35
45
|
max: any;
|
|
36
|
-
|
|
46
|
+
options?: undefined;
|
|
37
47
|
required?: undefined;
|
|
38
48
|
allowClear?: undefined;
|
|
39
49
|
placeholderKey?: undefined;
|
|
@@ -7,4 +7,5 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
|
+
export declare const chartOptionDefaultValue = "return {\n dataset: { source: ctx.data.objects || [] },\n xAxis: { type: 'category' },\n yAxis: {},\n series: [\n {\n type: 'line',\n smooth: true,\n showSymbol: false,\n },\n ],\n}\n";
|
|
10
11
|
export declare const ChartOptionsPanel: React.FC;
|
|
@@ -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,20 @@
|
|
|
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 buildOrderFieldOptions(fieldOptions?: any[], dimensionsValue?: any[], measuresValue?: any[]): any[];
|
|
12
|
+
export declare function getFormatterOptionsByField(dm: any, collectionPath: string[] | undefined, dimField: any): {
|
|
13
|
+
label: string;
|
|
14
|
+
value: string;
|
|
15
|
+
}[];
|
|
16
|
+
export declare function getCollectionOptions(dm: any, compile: (v: any) => string): any;
|
|
17
|
+
export declare function validateQuery(query: Record<string, any>): {
|
|
18
|
+
success: boolean;
|
|
19
|
+
message: string;
|
|
20
|
+
};
|
|
@@ -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
|
};
|
|
@@ -17,6 +17,11 @@ export declare function convertDatasetFormats(data: Record<string, any>[]): {
|
|
|
17
17
|
rows: string[][];
|
|
18
18
|
columns: any[][];
|
|
19
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* Normalize ECharts option for dataset-based pie charts.
|
|
22
|
+
* Fixes `{c}` showing `[object Object]` when `dataset.source` is an array of objects by rewriting `{c}` to `{@<valueField>}`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function normalizeEChartsOption(option: any): any;
|
|
20
25
|
export declare const formatters: {
|
|
21
26
|
datetime: {
|
|
22
27
|
label: string;
|
|
@@ -32,3 +37,6 @@ export declare const formatters: {
|
|
|
32
37
|
}[];
|
|
33
38
|
};
|
|
34
39
|
export declare function sleep(ms: number): Promise<void>;
|
|
40
|
+
export declare function appendColon(label: string, lang?: string): string;
|
|
41
|
+
export declare const isDebugEnabled: () => boolean;
|
|
42
|
+
export declare const debugLog: (...args: any[]) => void;
|