bi-sdk-react 0.0.25 → 0.0.26
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/es/js/bi-sdk.es.js +90 -38
- package/dist/types/components/PageDesigner.d.ts +2 -1
- package/dist/types/components/context/PageContext.d.ts +3 -2
- package/dist/types/components/dnd/DropContainer.d.ts +1 -0
- package/dist/types/components/hooks/datasource.d.ts +2 -1
- package/dist/types/components/layout/PageItem.d.ts +1 -0
- package/dist/types/components/plugins/@antd/items/CardRender.d.ts +2 -1
- package/dist/types/components/plugins/@antd/items/ColRender.d.ts +2 -1
- package/dist/types/components/plugins/@antd/items/PageHeaderRender.d.ts +2 -1
- package/dist/types/components/plugins/@antd/items/RowRender.d.ts +2 -1
- package/dist/types/components/plugins/@antd/items/SpaceRender.d.ts +2 -1
- package/dist/types/components/typing.d.ts +1 -0
- package/dist/umd/js/bi-sdk.umd.min.js +90 -38
- package/package.json +1 -1
- package/src/components/PageDesigner.tsx +16 -8
- package/src/components/context/PageContext.tsx +8 -4
- package/src/components/dnd/DropContainer.tsx +7 -4
- package/src/components/hooks/datasource.ts +2 -1
- package/src/components/layout/PageCanvas.tsx +3 -3
- package/src/components/layout/PageItem.tsx +256 -67
- package/src/components/panel/AiPanel.tsx +10 -2
- package/src/components/panel/PropertiesPanel.tsx +54 -31
- package/src/components/plugins/@antd/item-props/EchartsProps.tsx +0 -1
- package/src/components/plugins/@antd/items/CardRender.tsx +33 -6
- package/src/components/plugins/@antd/items/ColRender.tsx +11 -4
- package/src/components/plugins/@antd/items/EchartsRender.tsx +1 -1
- package/src/components/plugins/@antd/items/PageHeaderRender.tsx +9 -2
- package/src/components/plugins/@antd/items/RowRender.tsx +10 -5
- package/src/components/plugins/@antd/items/SpaceRender.tsx +11 -4
- package/src/components/typing.ts +5 -0
- package/src/example.tsx +147 -64
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./styles.css";
|
|
3
|
-
import { DatasetSelectorFunction, FetchType, PageSchema, PluginType } from "./typing";
|
|
3
|
+
import { DatasetAddFunction, DatasetSelectorFunction, FetchType, PageSchema, PluginType } from "./typing";
|
|
4
4
|
export type PageDesignerProps = {
|
|
5
5
|
pageId: string;
|
|
6
6
|
agentList?: any[];
|
|
@@ -12,6 +12,7 @@ export type PageDesignerProps = {
|
|
|
12
12
|
handleAdd: () => void;
|
|
13
13
|
}>>;
|
|
14
14
|
datasetSelector?: DatasetSelectorFunction;
|
|
15
|
+
datasetAdd?: DatasetAddFunction;
|
|
15
16
|
fetch?: FetchType;
|
|
16
17
|
onSave?: (schema: PageSchema) => void;
|
|
17
18
|
loading?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DatasetSelectorFunction, FetchType, PageSchema, PluginType, SchemaItemType } from "../typing";
|
|
1
|
+
import { DatasetAddFunction, DatasetSelectorFunction, FetchType, PageSchema, PluginType, SchemaItemType } from "../typing";
|
|
2
2
|
type PageContextType = {
|
|
3
3
|
pageId: string;
|
|
4
4
|
designable: boolean;
|
|
@@ -11,8 +11,9 @@ type PageContextType = {
|
|
|
11
11
|
updateSelectedItem: (selectedItem?: Partial<SchemaItemType> | null) => void;
|
|
12
12
|
forceUpdate: () => void;
|
|
13
13
|
datasetSelector?: DatasetSelectorFunction;
|
|
14
|
+
datasetAdd?: DatasetAddFunction;
|
|
14
15
|
onAddAtItem?: (item: SchemaItemType) => void;
|
|
15
|
-
onRemoveAtItem?: (item: SchemaItemType, index
|
|
16
|
+
onRemoveAtItem?: (item: SchemaItemType, index?: number) => void;
|
|
16
17
|
fetch?: FetchType;
|
|
17
18
|
};
|
|
18
19
|
export declare const PageContext: import("react").Context<PageContextType>;
|
|
@@ -3,6 +3,7 @@ import { HtmlBaseProps, SchemaItemType } from "../typing";
|
|
|
3
3
|
type DropContainerProps = {
|
|
4
4
|
rootComponent?: React.ComponentType<any>;
|
|
5
5
|
rootData?: Record<string, any>;
|
|
6
|
+
ancestors: SchemaItemType[];
|
|
6
7
|
list?: SchemaItemType[];
|
|
7
8
|
item?: any;
|
|
8
9
|
onListChange?: (list: any[]) => void;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { SchemaItemType } from "../typing";
|
|
2
|
+
export declare const useDatasource: (id?: string, datasource?: SchemaItemType["datasource"]) => any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CardProps } from "antd";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { HtmlBaseProps } from "../../../typing";
|
|
3
|
+
import { HtmlBaseProps, SchemaItemType } from "../../../typing";
|
|
4
4
|
export type CardRenderProps = {
|
|
5
5
|
bordered?: boolean;
|
|
6
6
|
size?: CardProps["size"];
|
|
@@ -8,5 +8,6 @@ export type CardRenderProps = {
|
|
|
8
8
|
hoverable?: boolean;
|
|
9
9
|
shadow?: boolean;
|
|
10
10
|
item: any;
|
|
11
|
+
ancestors: SchemaItemType[];
|
|
11
12
|
} & HtmlBaseProps;
|
|
12
13
|
export declare const CardRender: React.FC<CardRenderProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { HtmlBaseProps } from "../../../typing";
|
|
2
|
+
import { HtmlBaseProps, SchemaItemType } from "../../../typing";
|
|
3
3
|
export type ColRenderProps = {
|
|
4
4
|
span?: number;
|
|
5
5
|
xs?: number;
|
|
@@ -9,5 +9,6 @@ export type ColRenderProps = {
|
|
|
9
9
|
xl?: number;
|
|
10
10
|
xxl?: number;
|
|
11
11
|
item: any;
|
|
12
|
+
ancestors: SchemaItemType[];
|
|
12
13
|
} & HtmlBaseProps;
|
|
13
14
|
export declare const ColRender: React.FC<ColRenderProps>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { HtmlBaseProps } from "../../../typing";
|
|
2
|
+
import { HtmlBaseProps, SchemaItemType } from "../../../typing";
|
|
3
3
|
export type PageHeaderRenderProps = {
|
|
4
4
|
title?: string;
|
|
5
5
|
subTitle?: string;
|
|
6
6
|
item: any;
|
|
7
|
+
ancestors: SchemaItemType[];
|
|
7
8
|
} & HtmlBaseProps;
|
|
8
9
|
export declare const PageHeaderRender: React.FC<PageHeaderRenderProps>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { HtmlBaseProps } from "../../../typing";
|
|
2
|
+
import { HtmlBaseProps, SchemaItemType } from "../../../typing";
|
|
3
3
|
export type RowRenderProps = {
|
|
4
4
|
gutter?: number | [number, number];
|
|
5
5
|
item: any;
|
|
6
|
+
ancestors: SchemaItemType[];
|
|
6
7
|
} & HtmlBaseProps;
|
|
7
8
|
/**
|
|
8
9
|
* RowRender 组件
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { HtmlBaseProps } from "../../../typing";
|
|
2
|
+
import { HtmlBaseProps, SchemaItemType } from "../../../typing";
|
|
3
3
|
import { type SizeType } from "antd/es/config-provider/SizeContext";
|
|
4
4
|
export type SpaceRenderProps = {
|
|
5
5
|
align?: "start" | "end" | "center" | "baseline";
|
|
6
6
|
size?: SizeType;
|
|
7
7
|
direction?: "horizontal" | "vertical";
|
|
8
8
|
item: any;
|
|
9
|
+
ancestors: SchemaItemType[];
|
|
9
10
|
} & HtmlBaseProps;
|
|
10
11
|
export declare const SpaceRender: React.FC<SpaceRenderProps>;
|
|
@@ -184,4 +184,5 @@ export type EnvType = {
|
|
|
184
184
|
};
|
|
185
185
|
export type CallbacksType = Record<string, (v: any) => void>;
|
|
186
186
|
export type DatasetSelectorFunction = (onSelect: (dataset: DataSetType) => void) => React.ReactNode;
|
|
187
|
+
export type DatasetAddFunction = (onAdd: (dataset: DataSetType) => void, onClose: () => void) => React.ReactNode;
|
|
187
188
|
export {};
|