bi-sdk-react 0.0.49 → 0.0.51

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 (26) hide show
  1. package/dist/es/js/bi-sdk.es.js +55 -31
  2. package/dist/types/components/context/PageContext.d.ts +1 -2
  3. package/dist/types/components/layout/PageItem.d.ts +1 -0
  4. package/dist/types/components/plugins/@antd/index.d.ts +2 -0
  5. package/dist/types/components/plugins/@antd/item-props/DrawerProps.d.ts +20 -0
  6. package/dist/types/components/plugins/@antd/item-props/ModalProps.d.ts +18 -0
  7. package/dist/types/components/plugins/@antd/item-props/index.d.ts +2 -0
  8. package/dist/types/components/plugins/@antd/items/DrawerRender.d.ts +19 -0
  9. package/dist/types/components/plugins/@antd/items/ModalRender.d.ts +17 -0
  10. package/dist/types/components/plugins/@antd/items/index.d.ts +2 -0
  11. package/dist/umd/js/bi-sdk.umd.min.js +55 -31
  12. package/package.json +1 -1
  13. package/src/components/context/PageContext.tsx +2 -12
  14. package/src/components/dnd/DropContainer.tsx +34 -0
  15. package/src/components/hooks/datasource.ts +6 -6
  16. package/src/components/icon/IconFont.tsx +1 -1
  17. package/src/components/layout/PageItem.tsx +17 -2
  18. package/src/components/panel/LayerPanel.tsx +7 -6
  19. package/src/components/plugins/@antd/index.ts +56 -0
  20. package/src/components/plugins/@antd/item-props/DrawerProps.tsx +157 -0
  21. package/src/components/plugins/@antd/item-props/ModalProps.tsx +136 -0
  22. package/src/components/plugins/@antd/item-props/index.ts +2 -0
  23. package/src/components/plugins/@antd/items/DrawerRender.tsx +166 -0
  24. package/src/components/plugins/@antd/items/ModalRender.tsx +146 -0
  25. package/src/components/plugins/@antd/items/index.ts +2 -1
  26. package/src/example.tsx +2 -1
@@ -26,8 +26,7 @@ type PageContextType = {
26
26
  handleCallback: (item: SchemaItemType, refresh?: boolean, consume?: (item: Omit<SchemaItemType, "children">, data: any) => void) => void;
27
27
  getVars: (id: string) => Record<string, any>;
28
28
  setVar: (item: SchemaItemType, key: string, value: any) => void;
29
- getItemData: (id: string) => any;
30
- setItemData: (id: string, data: any) => void;
29
+ setItemData?: (id: string, data: any) => void;
31
30
  };
32
31
  export declare const PageContext: import("react").Context<PageContextType>;
33
32
  type PageProviderProps = React.PropsWithChildren<Omit<Partial<PageContextType>, "updateSelectedItem" | "schema" | "forceUpdate" | "deviceWidth" | "setDeviceWidth" | "initCallback" | "handleCallback" | "getVars" | "setVar"> & Pick<PageContextType, "schema" | "pageId">>;
@@ -3,6 +3,7 @@ import { SchemaItemType } from "../typing";
3
3
  export type PageItemProps = {
4
4
  id?: string;
5
5
  item: SchemaItemType;
6
+ onCopy?: (item: SchemaItemType) => void;
6
7
  onDelete?: () => void;
7
8
  ancestors: SchemaItemType[];
8
9
  parentList?: any[];
@@ -19,4 +19,6 @@ export declare const SpacePlugin: PluginType;
19
19
  export declare const CardPlugin: PluginType;
20
20
  export declare const RowPlugin: PluginType;
21
21
  export declare const ColPlugin: PluginType;
22
+ export declare const ModalPlugin: PluginType;
23
+ export declare const DrawerPlugin: PluginType;
22
24
  export declare const plugins: PluginType[];
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import type { PropEditorProps } from "./types";
3
+ export type DrawerModel = {
4
+ title?: string;
5
+ size?: number;
6
+ okType?: "primary" | "link" | "text" | "dashed" | "default";
7
+ okText?: string;
8
+ cancelText?: string;
9
+ resizable?: boolean;
10
+ placement?: "top" | "bottom" | "left" | "right";
11
+ closable?: boolean;
12
+ keyboard?: boolean;
13
+ mask?: boolean;
14
+ maskClosable?: boolean;
15
+ footer?: boolean;
16
+ };
17
+ /**
18
+ * 抽屉属性编辑器
19
+ */
20
+ export declare const DrawerProps: React.FC<PropEditorProps<DrawerModel>>;
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import type { PropEditorProps } from "./types";
3
+ export type ModalModel = {
4
+ title?: string;
5
+ width?: number;
6
+ okType?: "primary" | "link" | "text" | "dashed" | "default";
7
+ okText?: string;
8
+ cancelText?: string;
9
+ closable?: boolean;
10
+ keyboard?: boolean;
11
+ mask?: boolean;
12
+ maskClosable?: boolean;
13
+ footer?: boolean;
14
+ };
15
+ /**
16
+ * 模态框属性编辑器
17
+ */
18
+ export declare const ModalProps: React.FC<PropEditorProps<ModalModel>>;
@@ -16,4 +16,6 @@ export { TableProps } from './TableProps';
16
16
  export { PageHeaderProps } from './PageHeaderProps';
17
17
  export { RowProps } from './RowProps';
18
18
  export { ColProps } from './ColProps';
19
+ export { ModalProps } from './ModalProps';
19
20
  export { SpaceProps } from './SpaceProps';
21
+ export { DrawerProps } from './DrawerProps';
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import { HtmlBaseProps, SchemaItemType } from "../../../typing";
3
+ export type DrawerRenderProps = {
4
+ item: any;
5
+ title?: string;
6
+ size?: number;
7
+ placement?: "top" | "bottom" | "left" | "right";
8
+ okType?: "primary" | "link" | "text" | "dashed" | "default";
9
+ okText?: string;
10
+ cancelText?: string;
11
+ closable?: boolean;
12
+ keyboard?: boolean;
13
+ mask?: boolean;
14
+ maskClosable?: boolean;
15
+ resizable?: boolean;
16
+ footer?: boolean;
17
+ ancestors: SchemaItemType[];
18
+ } & HtmlBaseProps;
19
+ export declare const DrawerRender: React.FC<DrawerRenderProps>;
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import { HtmlBaseProps, SchemaItemType } from "../../../typing";
3
+ export type ModalRenderProps = {
4
+ item: any;
5
+ title?: string;
6
+ width?: number;
7
+ okType?: "primary" | "link" | "text" | "dashed" | "default";
8
+ okText?: string;
9
+ cancelText?: string;
10
+ closable?: boolean;
11
+ keyboard?: boolean;
12
+ mask?: boolean;
13
+ maskClosable?: boolean;
14
+ footer?: boolean;
15
+ ancestors: SchemaItemType[];
16
+ } & HtmlBaseProps;
17
+ export declare const ModalRender: React.FC<ModalRenderProps>;
@@ -17,3 +17,5 @@ export { CapsuleRender } from './CapsuleRender';
17
17
  export { CheckboxRender } from './CheckboxRender';
18
18
  export { DatePickerRender } from './DatePickerRender';
19
19
  export { SwitchRender } from './SwitchRender';
20
+ export { ModalRender } from './ModalRender';
21
+ export { DrawerRender } from './DrawerRender';