@mxmweb/xviewer 1.1.41 → 1.1.45

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 (62) hide show
  1. package/lib_enter.d.ts +151 -2
  2. package/package.json +3 -2
  3. package/src/Preview.d.ts +0 -1
  4. package/src/adopters/DatabaseIdView/CustomCom.d.ts +0 -29
  5. package/src/adopters/DatabaseIdView/EditConfig.d.ts +0 -10
  6. package/src/adopters/DatabaseIdView/UploadDrawer.d.ts +0 -12
  7. package/src/adopters/DatabaseIdView/index.d.ts +0 -17
  8. package/src/adopters/DatabaseIdView/server.d.ts +0 -22
  9. package/src/adopters/DatabaseTableView/EditRowDrawer.d.ts +0 -8
  10. package/src/adopters/DatabaseTableView/index.d.ts +0 -31
  11. package/src/adopters/DatabaseTableView/server.d.ts +0 -17
  12. package/src/adopters/DatabaseView/CreateModal.d.ts +0 -11
  13. package/src/adopters/DatabaseView/index.d.ts +0 -27
  14. package/src/adopters/DatabaseView/server.d.ts +0 -15
  15. package/src/adopters/ModelManageView/ConfigDrawer.d.ts +0 -17
  16. package/src/adopters/ModelManageView/const.d.ts +0 -35
  17. package/src/adopters/ModelManageView/index.d.ts +0 -14
  18. package/src/adopters/ModelManageView/server.d.ts +0 -15
  19. package/src/adopters/SensitiveView/index.d.ts +0 -17
  20. package/src/adopters/SensitiveView/server.d.ts +0 -11
  21. package/src/adopters/SensitiveView/size-test.d.ts +0 -7
  22. package/src/adopters/shared/statusMap.d.ts +0 -37
  23. package/src/core/DynamicCards.d.ts +0 -28
  24. package/src/core/DynamicDashDataCore.d.ts +0 -11
  25. package/src/core/components/DefaultComponents.d.ts +0 -11
  26. package/src/core/components/DropdownMenu.d.ts +0 -16
  27. package/src/core/components/SharedPagination.d.ts +0 -32
  28. package/src/core/components/StyledComponents.d.ts +0 -6
  29. package/src/core/components/TreeComponent.d.ts +0 -13
  30. package/src/core/components/cardUI/DatabaseCard.d.ts +0 -22
  31. package/src/core/components/cardUI/DefaultCard.d.ts +0 -13
  32. package/src/core/components/cardUI/DesignCard.d.ts +0 -16
  33. package/src/core/components/cardUI/KnowledgebaseCard.d.ts +0 -28
  34. package/src/core/components/cardUI/PrototypeCard.d.ts +0 -16
  35. package/src/core/components/cardUI/RepositoryCard.d.ts +0 -16
  36. package/src/core/components/cardUI/common.d.ts +0 -40
  37. package/src/core/components/cardUI/index.d.ts +0 -13
  38. package/src/core/components/dataDisplayer/DigitalClockDate.d.ts +0 -6
  39. package/src/core/components/dataDisplayer/MobileLockDate.d.ts +0 -6
  40. package/src/core/hooks/animes/useRowAnimation.d.ts +0 -19
  41. package/src/core/hooks/animes/useStaggerAnimation.d.ts +0 -12
  42. package/src/core/hooks/useAppFunctions.d.ts +0 -2
  43. package/src/core/hooks/useAppState.d.ts +0 -14
  44. package/src/core/hooks/useCardStaggerAnimation.d.ts +0 -18
  45. package/src/core/hooks/useDynamicCards.d.ts +0 -48
  46. package/src/core/hooks/useFuzzySearch.d.ts +0 -43
  47. package/src/core/renderers/ContentRenderer.d.ts +0 -30
  48. package/src/core/renderers/TabsRenderer.d.ts +0 -10
  49. package/src/core/renderers/ToolbarRenderer.d.ts +0 -11
  50. package/src/core/shared/types.d.ts +0 -1
  51. package/src/core/types/index.d.ts +0 -176
  52. package/src/core/utils/dataUtils.d.ts +0 -3
  53. package/src/core/utils/viewUtils.d.ts +0 -5
  54. package/src/examples/CardView/index.d.ts +0 -5
  55. package/src/examples/FormView/index.d.ts +0 -9
  56. package/src/examples/TableView/index.d.ts +0 -23
  57. package/src/examples/TableView/mockdata.d.ts +0 -33
  58. package/src/examples/TabsView/index.d.ts +0 -3
  59. package/src/examples/TreeView/index.d.ts +0 -3
  60. package/src/index.d.ts +0 -6
  61. package/src/lib_enter.d.ts +0 -4
  62. package/src/main.d.ts +0 -1
@@ -1,13 +0,0 @@
1
- import { default as React } from 'react';
2
- import { ViewType, TreeModelStyle } from '../types';
3
- interface TreeComponentProps {
4
- views: ViewType[];
5
- activeId: string;
6
- onSelect: (node: ViewType) => void;
7
- theme: any;
8
- modelStyle: TreeModelStyle;
9
- label: string;
10
- activableParentNode?: boolean;
11
- }
12
- export declare const TreeComponent: React.FC<TreeComponentProps>;
13
- export {};
@@ -1,22 +0,0 @@
1
- import { CardAction } from '../../hooks/useDynamicCards';
2
- import * as React from 'react';
3
- interface DatabaseCardProps {
4
- data: {
5
- id: string;
6
- name: string;
7
- dbType?: string;
8
- description?: string;
9
- dbHost?: string;
10
- dbUser?: string;
11
- dbPort?: string | number;
12
- status?: string;
13
- actions?: CardAction[];
14
- datasourceType?: 'DataTable' | 'DirectDB' | string;
15
- [key: string]: any;
16
- };
17
- theme?: any;
18
- actions?: CardAction[];
19
- onAction?: (action: string, data: any) => void;
20
- }
21
- declare const DatabaseCard: React.FC<DatabaseCardProps>;
22
- export default DatabaseCard;
@@ -1,13 +0,0 @@
1
- import * as React from 'react';
2
- /**
3
- * 默认卡片组件
4
- * 用于展示基础卡片信息
5
- * @author mxm
6
- * @date 2024-12-19
7
- */
8
- interface DefaultCardProps {
9
- data: any;
10
- theme?: any;
11
- }
12
- declare const DefaultCard: React.FC<DefaultCardProps>;
13
- export default DefaultCard;
@@ -1,16 +0,0 @@
1
- import { CardAction } from '../../hooks/useDynamicCards';
2
- import * as React from 'react';
3
- /**
4
- * 设计卡片组件
5
- * 用于展示设计稿信息
6
- * @author mxm
7
- * @date 2024-12-19
8
- */
9
- interface DesignCardProps {
10
- data: any;
11
- theme?: any;
12
- actions?: CardAction[];
13
- onAction?: (action: string, data: any) => void;
14
- }
15
- declare const DesignCard: React.FC<DesignCardProps>;
16
- export default DesignCard;
@@ -1,28 +0,0 @@
1
- import { CardAction } from '../../hooks/useDynamicCards';
2
- import * as React from 'react';
3
- /**
4
- * 数据库卡片组件
5
- * 用于展示数据库连接信息
6
- * @author mxm
7
- * @date 2024-12-19
8
- */
9
- interface DatabaseCardProps {
10
- data: {
11
- id: string;
12
- name: string;
13
- dbType?: string;
14
- description?: string;
15
- url?: string;
16
- username?: string;
17
- port?: string | number;
18
- status?: string;
19
- actions?: CardAction[];
20
- databaseType?: 'upload' | 'direct' | string;
21
- [key: string]: any;
22
- };
23
- theme?: any;
24
- actions?: CardAction[];
25
- onAction?: (action: string, data: any) => void;
26
- }
27
- declare const DatabaseCard: React.FC<DatabaseCardProps>;
28
- export default DatabaseCard;
@@ -1,16 +0,0 @@
1
- import { CardAction } from '../../hooks/useDynamicCards';
2
- import * as React from 'react';
3
- /**
4
- * 原型卡片组件
5
- * 用于展示原型设计信息
6
- * @author mxm
7
- * @date 2024-12-19
8
- */
9
- interface PrototypeCardProps {
10
- data: any;
11
- theme?: any;
12
- actions?: CardAction[];
13
- onAction?: (action: string, data: any) => void;
14
- }
15
- declare const PrototypeCard: React.FC<PrototypeCardProps>;
16
- export default PrototypeCard;
@@ -1,16 +0,0 @@
1
- import { CardAction } from '../../hooks/useDynamicCards';
2
- import * as React from 'react';
3
- /**
4
- * 代码仓库卡片组件
5
- * 用于展示代码仓库信息
6
- * @author mxm
7
- * @date 2024-12-19
8
- */
9
- interface RepositoryCardProps {
10
- data: any;
11
- theme?: any;
12
- actions?: CardAction[];
13
- onAction?: (action: string, data: any) => void;
14
- }
15
- declare const RepositoryCard: React.FC<RepositoryCardProps>;
16
- export default RepositoryCard;
@@ -1,40 +0,0 @@
1
- import * as React from 'react';
2
- /**
3
- * 卡片通用样式组件
4
- * 提供所有卡片类型共用的样式定义
5
- * @author mxm
6
- * @date 2024-12-19
7
- */
8
- interface Theme {
9
- colors?: {
10
- border?: string;
11
- background?: string;
12
- shadow?: string;
13
- primary?: string;
14
- };
15
- space?: {
16
- radius?: number;
17
- };
18
- }
19
- type StatusType = 'connect' | 'active' | 'completed' | 'error' | 'deprecated' | 'in_progress' | 'pending' | 'archived';
20
- export declare const CardWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
21
- theme?: any;
22
- }>> & string;
23
- export declare const CardContent: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
24
- export declare const CardHeader: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
25
- export declare const CardTitle: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
26
- export declare const CardDesc: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
27
- $minHeight?: string;
28
- }>> & string;
29
- export declare const CardMeta: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
30
- export declare const CardActions: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
31
- export declare const StatusDotWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
32
- export declare const StatusDot: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
33
- status?: any;
34
- }>> & string;
35
- export declare const Wave: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
36
- export declare const Tooltip: React.FC<{
37
- title: string;
38
- children: React.ReactNode;
39
- }>;
40
- export type { Theme, StatusType };
@@ -1,13 +0,0 @@
1
- /**
2
- * CardUI 组件导出文件
3
- * 提供各种卡片类型的UI组件
4
- * @author mxm
5
- * @date 2024-12-19
6
- */
7
- export { default as DatabaseCard } from './DatabaseCard';
8
- export { default as DesignCard } from './DesignCard';
9
- export { default as PrototypeCard } from './PrototypeCard';
10
- export { default as RepositoryCard } from './RepositoryCard';
11
- export { default as DefaultCard } from './DefaultCard';
12
- export { CardWrapper, CardContent, CardHeader, CardTitle, CardDesc, CardMeta, CardActions, StatusDotWrapper, StatusDot, Wave, Tooltip, } from './common';
13
- export type { Theme, StatusType } from './common';
@@ -1,6 +0,0 @@
1
- import { default as React } from 'react';
2
- export interface DigitalClockDateProps {
3
- value: string;
4
- }
5
- declare const DigitalClockDate: React.FC<DigitalClockDateProps>;
6
- export default DigitalClockDate;
@@ -1,6 +0,0 @@
1
- import { default as React } from 'react';
2
- export interface MobileLockDateProps {
3
- value: string;
4
- }
5
- declare const MobileLockDate: React.FC<MobileLockDateProps>;
6
- export default MobileLockDate;
@@ -1,19 +0,0 @@
1
- /**
2
- * 表格行动画hook
3
- * 处理删除动画:删除行向右滑出
4
- */
5
- export declare const useRowAnimation: (onAnimationComplete: (rowId: string) => void) => {
6
- getRowProps: (row: any) => {
7
- className: string;
8
- style: {
9
- transition: string;
10
- opacity: number;
11
- transform: string;
12
- } | {
13
- transition?: undefined;
14
- opacity?: undefined;
15
- transform?: undefined;
16
- };
17
- onTransitionEnd: (e: React.TransitionEvent) => void;
18
- };
19
- };
@@ -1,12 +0,0 @@
1
- /**
2
- * 表格行stagger动画hook
3
- * 处理删除动画:删除行向右滑出,后续行向上补充位置的stagger效果
4
- * 性能优化版本
5
- */
6
- export declare const useStaggerAnimation: (onAnimationComplete: (rowId: string) => void) => {
7
- getRowProps: (row: any) => {
8
- className: string;
9
- ref: (el: HTMLElement | null) => void;
10
- };
11
- cleanup: () => void;
12
- };
@@ -1,2 +0,0 @@
1
- import { AppFn } from '../types';
2
- export declare const useAppFunctions: (setInnerData: React.Dispatch<React.SetStateAction<any[]>>, addPending: (id: string) => void, removePending: (id: string) => void, addAdding: (id: string) => void, removeAdding: (id: string) => void, pendingIds: Set<string>, addingIds: Set<string>) => AppFn;
@@ -1,14 +0,0 @@
1
- import { DataSource } from '../types';
2
- export declare const useAppState: (dataSource: DataSource, activeNodeType?: string) => {
3
- innerData: any[];
4
- setInnerData: import('react').Dispatch<import('react').SetStateAction<any[]>>;
5
- pendingIds: Set<string>;
6
- setPendingIds: import('react').Dispatch<import('react').SetStateAction<Set<string>>>;
7
- addingIds: Set<string>;
8
- setAddingIds: import('react').Dispatch<import('react').SetStateAction<Set<string>>>;
9
- fuzzyValue: string;
10
- setFuzzyValue: import('react').Dispatch<import('react').SetStateAction<string>>;
11
- selectedIds: string[];
12
- setSelectedIds: import('react').Dispatch<import('react').SetStateAction<string[]>>;
13
- resetStateOnNodeChange: () => void;
14
- };
@@ -1,18 +0,0 @@
1
- /**
2
- * 批量卡片删除动画hook
3
- * @param removingIds 需要执行动画的卡片id数组
4
- * @param onBatchComplete 所有动画完成后统一回调
5
- * @returns getCardProps
6
- */
7
- export declare function useBatchCardStaggerAnimation(removingIds: string[], onBatchComplete: (ids: string[]) => void): {
8
- getCardProps: (card: any) => {
9
- id: string;
10
- style: {
11
- willChange: string;
12
- pointerEvents: string;
13
- } | {
14
- willChange?: undefined;
15
- pointerEvents?: undefined;
16
- };
17
- };
18
- };
@@ -1,48 +0,0 @@
1
- import * as React from 'react';
2
- export type CardType = 'knowledgeBase' | 'database' | 'default' | 'customized' | 'design' | 'prototype' | 'repository';
3
- export interface CardAction {
4
- key: string;
5
- label?: string;
6
- type?: 'divider' | 'action';
7
- icon?: React.ReactNode;
8
- onClick?: (data: any) => void;
9
- disabled?: boolean;
10
- allow?: boolean;
11
- }
12
- export interface CardConfig {
13
- id: string;
14
- cardtype: CardType;
15
- title?: string;
16
- name?: string;
17
- description?: string;
18
- dbType?: string;
19
- content?: string;
20
- actions?: CardAction[];
21
- render?: (data: any, options?: any) => React.ReactNode;
22
- [key: string]: any;
23
- }
24
- export interface UseDynamicCardsOptions {
25
- onAction?: (action: string, data: any) => void;
26
- onCardClick?: (cardData: any, event: any) => void;
27
- onCardDoubleClick?: (cardData: any, event: any) => void;
28
- theme?: any;
29
- actions?: CardAction[];
30
- }
31
- /**
32
- * useDynamicCards hooks
33
- * 负责将卡片配置数组转为带 render 的卡片对象,支持多种 cardtype 和自定义渲染。
34
- * @param configs 卡片配置数组
35
- * @param options 事件回调等
36
- * @returns 带 render 的卡片配置数组
37
- */
38
- export declare function useDynamicCards(configs: CardConfig[], cardType: CardType, options?: UseDynamicCardsOptions): (CardConfig | {
39
- render: (data: any, extra?: any) => import("react/jsx-runtime").JSX.Element;
40
- id: string;
41
- cardtype: CardType;
42
- title?: string;
43
- name?: string;
44
- description?: string;
45
- dbType?: string;
46
- content?: string;
47
- actions?: CardAction[];
48
- })[];
@@ -1,43 +0,0 @@
1
- export interface FuzzySearchConfig {
2
- searchKeys?: string[];
3
- fuzzyValue: string;
4
- }
5
- export interface TableDataItem {
6
- id: string;
7
- data: Array<{
8
- columnId: string;
9
- value: any;
10
- statusType?: string;
11
- [key: string]: any;
12
- }>;
13
- [key: string]: any;
14
- }
15
- export interface CardDataItem {
16
- id: string;
17
- [key: string]: any;
18
- }
19
- export interface TableColumn {
20
- id: string;
21
- title: string;
22
- type: string;
23
- [key: string]: any;
24
- }
25
- /**
26
- * 通用模糊搜索Hook
27
- * 支持表格数据和卡片数据的模糊搜索过滤
28
- *
29
- * @param data - 要过滤的数据源
30
- * @param config - 模糊搜索配置
31
- * @param dataType - 数据类型:'table' | 'card'
32
- * @param columns - 表格列定义(仅table类型需要)
33
- * @returns 过滤后的数据
34
- */
35
- export declare function useFuzzySearch<T extends TableDataItem | CardDataItem>(data: T[], config: FuzzySearchConfig, dataType: 'table' | 'card', columns?: TableColumn[]): T[];
36
- /**
37
- * 从工具栏配置中提取模糊搜索配置
38
- *
39
- * @param toolbar - 工具栏配置
40
- * @param fuzzyValue - 模糊搜索值
41
- * @returns 模糊搜索配置
42
- */
43
- export declare function extractFuzzySearchConfig(toolbar: any[] | undefined, fuzzyValue: string): FuzzySearchConfig;
@@ -1,30 +0,0 @@
1
- import { default as React } from 'react';
2
- import { ViewType, CustomComponents } from '../types';
3
- interface ContentRendererProps {
4
- activeNode: ViewType | null;
5
- innerData: any[];
6
- fuzzyValue: string;
7
- selectedIds: string[];
8
- pendingIds: Set<string>;
9
- addingIds: Set<string>;
10
- onCardSelectChange: (id: string, checked: boolean) => void;
11
- onCardAnimationComplete: (ids: string | string[]) => void;
12
- onRemoveCard: (id: string) => void;
13
- onRemoveCards: (ids: string[]) => void;
14
- onCardAddAnimationComplete: (id: string) => void;
15
- onTableRowAnimationComplete: (rowId: string) => void;
16
- onTableRowAddAnimationComplete: (id: string) => void;
17
- onEventsEmit: (name: string, data: any, appFn: any) => void;
18
- styles: any;
19
- CustomComponents?: CustomComponents;
20
- subTablePendingIds?: any;
21
- onSubTableRowAnimationComplete?: any;
22
- subTableConfig?: any;
23
- viewId?: string;
24
- total?: number;
25
- requestPagesize?: number;
26
- viewPageSize?: number;
27
- }
28
- export declare const ContentRenderer: React.FC<ContentRendererProps>;
29
- declare const _default: React.NamedExoticComponent<ContentRendererProps>;
30
- export default _default;
@@ -1,10 +0,0 @@
1
- import { default as React } from 'react';
2
- import { ViewType } from '../types';
3
- interface TabsRendererProps {
4
- views: ViewType[];
5
- activeId: string;
6
- onSelect: (node: ViewType) => void;
7
- theme: any;
8
- }
9
- export declare const TabsRenderer: React.FC<TabsRendererProps>;
10
- export {};
@@ -1,11 +0,0 @@
1
- import { default as React } from 'react';
2
- import { ViewType } from '../types/index';
3
- interface ToolbarRendererProps {
4
- activeNode: ViewType | null;
5
- fuzzyValue: string;
6
- onFuzzyValueChange: (value: string) => void;
7
- onToolbarAction: (action: string, data: any) => void;
8
- styles: any;
9
- }
10
- export declare const ToolbarRenderer: React.FC<ToolbarRendererProps>;
11
- export {};
@@ -1 +0,0 @@
1
- export type AppStatus = 'ready' | 'loading' | 'error' | 'processing' | 'uploading' | 'thinking' | 'analyzing';
@@ -1,176 +0,0 @@
1
- import { default as React } from 'react';
2
- import { Styles } from '@mxmweb/zui';
3
- export type AppStatus = 'ready' | 'loading' | 'error' | 'processing' | 'uploading' | 'thinking' | 'analyzing';
4
- export type AppFn = {
5
- addItem: (item: any, options?: {
6
- animate?: boolean;
7
- position?: 'start' | 'end' | number;
8
- tableId?: string;
9
- }) => void;
10
- removeItem: (id?: string, tableId?: string) => void;
11
- removeItems: (ids: string[], tableId?: string) => void;
12
- updateItem: (patch: any, id?: string, tableId?: string) => void;
13
- scrollToItem: (id?: string) => void;
14
- addPending: (id: string) => void;
15
- removePending: (id: string) => void;
16
- isPending: (id: string) => boolean;
17
- addAdding: (id: string) => void;
18
- removeAdding: (id: string) => void;
19
- isAdding: (id: string) => boolean;
20
- syncSourceData: (data: any | any[], tableId?: string) => void;
21
- tablePending: (tableId: string) => void;
22
- removeTablePending: (tableId: string) => void;
23
- addSubTable: (parentId: string) => void;
24
- deleteSubTable: (parentId: string) => void;
25
- removeSubTableRow: (id: string, tableId: string) => void;
26
- };
27
- export type EventsEmit = (name: string, data: any, appFn: AppFn) => void;
28
- export interface AppStatusManager {
29
- app: 'ready' | 'initializing' | 'error';
30
- container: 'ready' | 'loading' | 'error' | 'processing' | 'uploading';
31
- content?: 'ready' | 'loading' | 'error' | 'processing' | 'uploading';
32
- }
33
- export interface CustomComponents {
34
- AppLoading?: React.ComponentType<any>;
35
- AppError?: React.ComponentType<any>;
36
- ContainerLoading?: React.ComponentType<any>;
37
- ContainerError?: React.ComponentType<any>;
38
- ContentLoading?: React.ComponentType<any>;
39
- ContentError?: React.ComponentType<any>;
40
- EmptyData?: React.ComponentType<any>;
41
- }
42
- export type ToolbarItem = {
43
- type: 'button' | 'fuzzy_search' | 'customized';
44
- label?: string;
45
- key: string;
46
- render?: () => React.ReactNode;
47
- component?: React.ComponentType<{
48
- onAction: (action: string, data: any) => void;
49
- [key: string]: any;
50
- }>;
51
- searchKeys?: (string | string[])[];
52
- btnType?: 'primary' | 'default' | 'error' | 'text';
53
- disabled?: boolean;
54
- icon?: React.ReactNode;
55
- position?: 'left' | 'right';
56
- };
57
- export interface TableDataItem {
58
- id: string;
59
- [key: string]: any;
60
- }
61
- export interface CardDataItem {
62
- id: string;
63
- title?: string;
64
- name?: string;
65
- description?: string;
66
- actions?: Array<{
67
- key: string;
68
- label: string;
69
- icon?: React.ReactNode;
70
- disabled?: boolean;
71
- [key: string]: any;
72
- }>;
73
- [key: string]: any;
74
- }
75
- export interface FormDataItem {
76
- id: string;
77
- [key: string]: any;
78
- }
79
- export interface MarkdownDataItem {
80
- id: string;
81
- content: string;
82
- [key: string]: any;
83
- }
84
- export interface ViewType {
85
- label: string;
86
- icon?: React.ReactNode;
87
- id: string;
88
- type?: 'table' | 'form' | 'card' | 'customized' | 'timeline' | 'column' | string;
89
- columns?: Array<{
90
- title: string;
91
- id: string;
92
- type: string;
93
- [key: string]: any;
94
- }>;
95
- children?: ViewType[] | {
96
- [key: string]: ViewType;
97
- };
98
- cardType?: string;
99
- viewBehavior?: 'pagination' | 'scroll';
100
- rowHeight?: number;
101
- formConfig?: any;
102
- formWidth?: string;
103
- toolbar?: ToolbarItem[];
104
- allowMultiSelect?: boolean;
105
- size?: 'sm' | 'md';
106
- total?: number;
107
- requestPagesize?: number;
108
- viewPageSize?: number;
109
- }
110
- export declare enum TreeModelStyle {
111
- FLAT = "files",
112
- NAV = "nav"
113
- }
114
- export declare enum TabsModelStyle {
115
- DEFAULT = "default",
116
- TAG = "tag"
117
- }
118
- export type DataSource = TableDataItem[] | CardDataItem[] | FormDataItem[] | React.ReactElement | undefined;
119
- export declare const validateDataSourceType: (data: any) => data is DataSource;
120
- /**
121
- * 数据源使用示例:
122
- *
123
- * // 1. 表格数据
124
- * const tableDataSource: DataSource = [
125
- * { id: '1', name: '张三', age: 25, email: 'zhangsan@example.com' },
126
- * { id: '2', name: '李四', age: 30, email: 'lisi@example.com' }
127
- * ];
128
- *
129
- * // 2. 卡片数据
130
- * const cardDataSource: DataSource = [
131
- * {
132
- * id: '1',
133
- * title: '项目A',
134
- * description: '这是一个重要项目',
135
- * actions: [
136
- * { key: 'edit', label: '编辑', icon: <EditIcon /> },
137
- * { key: 'delete', label: '删除', icon: <DeleteIcon /> }
138
- * ]
139
- * }
140
- * ];
141
- *
142
- * // 3. React组件
143
- * const componentDataSource: DataSource = <CustomDashboard />;
144
- *
145
- * // 4. 表单数据
146
- * const formDataSource: DataSource = [
147
- * { id: '1', field1: 'value1', field2: 'value2' }
148
- * ];
149
- *
150
- * // 5. Markdown数据
151
- * const markdownDataSource: DataSource = [
152
- * { id: '1', content: '# 标题\n\n这是内容' }
153
- * ];
154
- */
155
- export declare const getDataSourceType: (data: DataSource) => string;
156
- export declare const isTableData: (data: DataSource) => data is TableDataItem[];
157
- export declare const isCardData: (data: DataSource) => data is CardDataItem[];
158
- export declare const isFormData: (data: DataSource) => data is FormDataItem[];
159
- export declare const isMarkdownData: (data: DataSource) => data is MarkdownDataItem[];
160
- export declare const isReactComponent: (data: DataSource) => data is React.ReactElement;
161
- export type DynamicDashView = {
162
- label?: string;
163
- key?: string;
164
- ref?: React.RefObject<any>;
165
- defaultActiveId: string;
166
- model?: 'tree' | 'tabs' | 'hero' | null;
167
- modelStyle?: TreeModelStyle | TabsModelStyle;
168
- activable_parentNode?: boolean;
169
- views: ViewType[];
170
- dataSource?: DataSource;
171
- eventsEmit?: (name: string, data?: any, appFn?: any) => any;
172
- styles?: Styles;
173
- status?: AppStatusManager;
174
- CustomComponents?: CustomComponents;
175
- [key: string]: any;
176
- };
@@ -1,3 +0,0 @@
1
- export declare const validateDataSource: (dataSource: any, viewType?: string) => any[];
2
- export declare const extractAddingIds: (data: any[]) => Set<string>;
3
- export declare const createEnhancedAppFn: (baseAppFn: any, setInnerData: React.Dispatch<React.SetStateAction<any[]>>, addPending: (id: string) => void, addAdding: (id: string) => void, removePending: (id: string) => void, removeAdding: (id: string) => void) => any;
@@ -1,5 +0,0 @@
1
- import { ViewType } from '../types';
2
- export declare const findNodeById: (nodes: ViewType[], id: string) => ViewType | null;
3
- export declare const getFirstLeafId: (nodes: ViewType[]) => string | undefined;
4
- export declare const collectAllChildren: (node: ViewType) => ViewType[];
5
- export declare const convertViewsToTreeData: (views: ViewType[]) => any[];
@@ -1,5 +0,0 @@
1
- export default function ExampleCards({ url, token, styles, }: {
2
- url?: string;
3
- token?: string;
4
- styles?: any;
5
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +0,0 @@
1
- interface ExampleFormProps {
2
- url?: string;
3
- token?: string;
4
- styles?: any;
5
- formWidth?: string;
6
- eventsEmit?: (name: string, data: any, appFn?: any) => void;
7
- }
8
- export default function ExampleForm(props: ExampleFormProps): import("react/jsx-runtime").JSX.Element;
9
- export {};
@@ -1,23 +0,0 @@
1
- import { default as React } from 'react';
2
- interface TableCell {
3
- columnId: string;
4
- value: any;
5
- type: string;
6
- label?: string;
7
- icon?: React.ReactNode;
8
- status?: 'success' | 'warning' | 'error';
9
- }
10
- export interface TableRow {
11
- id: string;
12
- data: TableCell[];
13
- children?: TableRow[];
14
- expanded?: boolean;
15
- }
16
- interface ExampleTableProps {
17
- url?: string;
18
- token?: string;
19
- styles?: any;
20
- eventsEmit?: (name: string, data: any, appFn?: any) => void;
21
- }
22
- export default function ExampleTable(props: ExampleTableProps): import("react/jsx-runtime").JSX.Element;
23
- export {};