@nocobase/plugin-data-visualization 0.17.0-alpha.1 → 0.17.0-alpha.2

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 (31) hide show
  1. package/dist/client/block/ChartDataProvider.d.ts +15 -0
  2. package/dist/client/chart/chart.d.ts +1 -0
  3. package/dist/client/configure/ChartConfigProvider.d.ts +17 -0
  4. package/dist/client/configure/ChartConfigure.d.ts +0 -14
  5. package/dist/client/configure/index.d.ts +2 -0
  6. package/dist/client/filter/FilterActionInitializers.d.ts +15 -0
  7. package/dist/client/filter/FilterBlockDesigner.d.ts +2 -0
  8. package/dist/client/filter/FilterBlockInitializer.d.ts +3 -0
  9. package/dist/client/filter/FilterBlockProvider.d.ts +2 -0
  10. package/dist/client/filter/FilterCheckbox.d.ts +2 -0
  11. package/dist/client/filter/FilterForm.d.ts +2 -0
  12. package/dist/client/filter/FilterItemDesigner.d.ts +2 -0
  13. package/dist/client/filter/FilterItemInitializers.d.ts +7 -0
  14. package/dist/client/filter/FilterProvider.d.ts +31 -0
  15. package/dist/client/filter/FilterVariableInput.d.ts +2 -0
  16. package/dist/client/filter/index.d.ts +6 -0
  17. package/dist/client/filter/utils.d.ts +51 -0
  18. package/dist/client/hooks/filter.d.ts +42 -0
  19. package/dist/client/hooks/index.d.ts +1 -0
  20. package/dist/client/hooks/useDateVariable.d.ts +1 -2
  21. package/dist/client/hooks/useVariableOptions.d.ts +7 -3
  22. package/dist/client/index.d.ts +1 -1
  23. package/dist/client/index.js +59 -39
  24. package/dist/client/utils.d.ts +2 -0
  25. package/dist/externalVersion.js +10 -10
  26. package/dist/locale/en-US.d.ts +10 -0
  27. package/dist/locale/en-US.js +11 -1
  28. package/dist/locale/zh-CN.d.ts +11 -0
  29. package/dist/locale/zh-CN.js +12 -1
  30. package/dist/node_modules/koa-compose/package.json +1 -1
  31. package/package.json +2 -2
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ type ChartData = {
3
+ collection: string;
4
+ service: any;
5
+ query: any;
6
+ };
7
+ export declare const ChartDataContext: React.Context<{
8
+ charts: {
9
+ [uid: string]: ChartData;
10
+ };
11
+ addChart: (uid: string, chart: ChartData) => void;
12
+ removeChart: (uid: string) => void;
13
+ }>;
14
+ export declare const ChartDataProvider: React.FC;
15
+ export {};
@@ -12,6 +12,7 @@ export type RenderProps = {
12
12
  [field: string]: {
13
13
  label: string;
14
14
  transformer: Transformer;
15
+ interface: string;
15
16
  };
16
17
  };
17
18
  };
@@ -0,0 +1,17 @@
1
+ import { ISchema } from '@formily/react';
2
+ import React from 'react';
3
+ export type ChartConfigCurrent = {
4
+ schema: ISchema;
5
+ field: any;
6
+ collection: string;
7
+ service: any;
8
+ initialValues?: any;
9
+ data: any[];
10
+ };
11
+ export declare const ChartConfigContext: React.Context<{
12
+ visible: boolean;
13
+ setVisible?: (visible: boolean) => void;
14
+ current?: ChartConfigCurrent;
15
+ setCurrent?: (current: ChartConfigCurrent) => void;
16
+ }>;
17
+ export declare const ChartConfigProvider: React.FC;
@@ -1,23 +1,9 @@
1
1
  import { ISchema } from '@formily/react';
2
2
  import React from 'react';
3
- export type ChartConfigCurrent = {
4
- schema: ISchema;
5
- field: any;
6
- collection: string;
7
- service: any;
8
- initialValues?: any;
9
- data: any[];
10
- };
11
3
  export type SelectedField = {
12
4
  field: string | string[];
13
5
  alias?: string;
14
6
  };
15
- export declare const ChartConfigContext: React.Context<{
16
- visible: boolean;
17
- setVisible?: (visible: boolean) => void;
18
- current?: ChartConfigCurrent;
19
- setCurrent?: (current: ChartConfigCurrent) => void;
20
- }>;
21
7
  export declare const ChartConfigure: React.FC<{
22
8
  insert: (s: ISchema, options: {
23
9
  onSuccess: () => void;
@@ -0,0 +1,2 @@
1
+ export * from './ChartConfigure';
2
+ export * from './ChartConfigProvider';
@@ -0,0 +1,15 @@
1
+ import { SchemaInitializer } from '@nocobase/client';
2
+ import React from 'react';
3
+ export declare const useChartFilterActionProps: () => {
4
+ onClick: () => Promise<void>;
5
+ };
6
+ export declare const useChartFilterResetProps: () => {
7
+ onClick: () => Promise<void>;
8
+ };
9
+ export declare const useChartFilterCollapseProps: () => {
10
+ onClick: () => void;
11
+ title: React.JSX.Element;
12
+ };
13
+ export declare const ChartFilterCollapseDesigner: React.FC;
14
+ export declare const ChartFilterActionDesigner: React.FC;
15
+ export declare const chartFilterActionInitializers: SchemaInitializer<import("antd").ButtonProps, {}>;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const ChartFilterBlockDesigner: React.FC;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const ChartFilterGrid: React.FC;
3
+ export declare const FilterBlockInitializer: React.FC;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const ChartFilterBlockProvider: React.FC;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const ChartFilterCheckbox: React.ForwardRefExoticComponent<Omit<Partial<any>, "ref"> & React.RefAttributes<unknown>>;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const ChartFilterForm: React.FC;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const ChartFilterItemDesigner: React.FC;
@@ -0,0 +1,7 @@
1
+ import { SchemaInitializer } from '@nocobase/client';
2
+ import React from 'react';
3
+ export declare const ChartFilterFormItem: React.MemoExoticComponent<import("@formily/react").ReactFC<Omit<any, "ref">>>;
4
+ export declare const ChartFilterCustomItemInitializer: React.FC<{
5
+ insert?: any;
6
+ }>;
7
+ export declare const chartFilterItemInitializers: SchemaInitializer<import("antd").ButtonProps, {}>;
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ export declare const ChartFilterContext: React.Context<{
3
+ ready: boolean;
4
+ enabled: boolean;
5
+ setEnabled: (enabled: boolean) => void;
6
+ fields: {
7
+ [name: string]: {
8
+ title: string;
9
+ operator?: {
10
+ value: string;
11
+ noValue?: boolean;
12
+ };
13
+ };
14
+ };
15
+ setField: (name: string, field: {
16
+ title?: string;
17
+ operator?: string;
18
+ }) => void;
19
+ removeField: (name: string) => void;
20
+ collapse: {
21
+ collapsed: boolean;
22
+ row: number;
23
+ };
24
+ setCollapse: (opts: {
25
+ collapsed?: boolean;
26
+ row?: number;
27
+ }) => void;
28
+ form: any;
29
+ setForm: (form: any) => void;
30
+ }>;
31
+ export declare const ChartFilterProvider: React.FC;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const ChartFilterVariableInput: React.FC<any>;
@@ -0,0 +1,6 @@
1
+ export * from './FilterBlockDesigner';
2
+ export * from './FilterBlockInitializer';
3
+ export * from './FilterItemInitializers';
4
+ export * from './FilterActionInitializers';
5
+ export * from './FilterItemDesigner';
6
+ export * from './FilterBlockProvider';
@@ -0,0 +1,51 @@
1
+ export declare const getOptionsSchema: () => {
2
+ title: string;
3
+ type: string;
4
+ 'x-decorator': string;
5
+ 'x-component': string;
6
+ items: {
7
+ type: string;
8
+ 'x-decorator': string;
9
+ properties: {
10
+ space: {
11
+ type: string;
12
+ 'x-component': string;
13
+ properties: {
14
+ label: {
15
+ type: string;
16
+ 'x-decorator': string;
17
+ 'x-component': string;
18
+ 'x-component-props': {
19
+ placeholder: string;
20
+ };
21
+ required: boolean;
22
+ };
23
+ value: {
24
+ type: string;
25
+ 'x-decorator': string;
26
+ 'x-component': string;
27
+ 'x-component-props': {
28
+ placeholder: string;
29
+ };
30
+ required: boolean;
31
+ };
32
+ remove: {
33
+ type: string;
34
+ 'x-decorator': string;
35
+ 'x-component': string;
36
+ };
37
+ };
38
+ };
39
+ };
40
+ };
41
+ properties: {
42
+ add: {
43
+ type: string;
44
+ title: string;
45
+ 'x-component': string;
46
+ };
47
+ };
48
+ };
49
+ export declare const getPropsSchemaByComponent: (component: string) => any;
50
+ export declare const transformValue: (value: any, props: any) => any;
51
+ export declare const setDefaultValue: (field: any, variables: any) => Promise<void>;
@@ -0,0 +1,42 @@
1
+ import { SchemaInitializerItemType } from '@nocobase/client';
2
+ import { CollectionOptions } from '@nocobase/database';
3
+ export declare const useCustomFieldInterface: () => {
4
+ getSchemaByInterface: (fieldInterface: string) => any;
5
+ };
6
+ export declare const useChartData: () => {
7
+ getChartCollections: () => string[];
8
+ };
9
+ export declare const useChartFilter: () => {
10
+ filter: () => Promise<void>;
11
+ refresh: () => Promise<void>;
12
+ getChartFilterFields: (collection: CollectionOptions) => SchemaInitializerItemType[];
13
+ getFilter: () => {};
14
+ hasFilter: (chart: {
15
+ collection: string;
16
+ query: any;
17
+ }, filterValues: any) => any;
18
+ appendFilter: (chart: {
19
+ collection: string;
20
+ query: any;
21
+ }, filterValues: any) => any;
22
+ getTranslatedTitle: (title: string) => string;
23
+ };
24
+ export declare const useFilterVariable: () => {
25
+ label: string;
26
+ value: string;
27
+ key: string;
28
+ children: {
29
+ key: string;
30
+ value: string;
31
+ label: string;
32
+ }[];
33
+ };
34
+ export declare const useChartFilterSourceFields: () => any[];
35
+ export declare const useFieldComponents: () => {
36
+ options: {
37
+ label: string;
38
+ value: string;
39
+ }[];
40
+ values: string[];
41
+ };
42
+ export declare const useCollectionJoinFieldTitle: (name: string) => any;
@@ -1,3 +1,4 @@
1
1
  export * from './query';
2
2
  export * from './transformer';
3
3
  export * from './useVariableOptions';
4
+ export * from './filter';
@@ -1,5 +1,4 @@
1
- export declare const useDateVariable: ({ operator, schema }: {
2
- operator: any;
1
+ export declare const useDateVariable: ({ schema }: {
3
2
  schema: any;
4
3
  }) => {
5
4
  label: string;
@@ -1,6 +1,10 @@
1
- export declare const useVariableOptions: () => {
1
+ export declare const useVariableOptions: () => ({
2
2
  label: string;
3
3
  value: string;
4
4
  key: string;
5
- children: any;
6
- }[];
5
+ children: {
6
+ key: string;
7
+ value: string;
8
+ label: string;
9
+ }[];
10
+ } | import("@nocobase/client/es/schema-settings/VariableInput/type").Option)[];
@@ -7,6 +7,6 @@ declare class DataVisualizationPlugin extends Plugin {
7
7
  export default DataVisualizationPlugin;
8
8
  export { Chart } from './chart/chart';
9
9
  export type { ChartProps, ChartType, RenderProps } from './chart/chart';
10
- export { ChartConfigContext } from './configure/ChartConfigure';
11
10
  export type { FieldOption } from './hooks';
12
11
  export type { QueryProps } from './renderer';
12
+ export { ChartConfigContext } from './configure';