@mxmweb/xviewer 1.1.40 → 1.1.41

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.
@@ -1 +0,0 @@
1
- export default function Preview(): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +0,0 @@
1
- export declare const RAG_APP_NAME = "rag_ai";
2
- export declare const RAG_AUTH_PLUGIN_PREFIX = "gitech_ril:";
3
- declare const axios$: import('axios').AxiosInstance;
4
- export default axios$;
5
- export declare const getLocalUserInfo: () => any;
6
- export declare const getTokenLocal: () => any;
@@ -1,8 +0,0 @@
1
- interface KnowledgeBaseProps {
2
- url?: string;
3
- token?: string;
4
- role?: string;
5
- eventsEmit?: (name: string, data: any) => void;
6
- }
7
- declare const KnowledgeBase: React.FC<KnowledgeBaseProps>;
8
- export default KnowledgeBase;
@@ -1,4 +0,0 @@
1
- export declare const knowledgeBaseAPI: {
2
- getKnowledgeBaseSharedList: (params?: any, config?: any) => Promise<any>;
3
- getknowledgeBaseList: (params?: any, config?: any) => Promise<any>;
4
- };
@@ -1,59 +0,0 @@
1
- import { default as React } from 'react';
2
- export interface DynamicTableColumn {
3
- id: string;
4
- title: string;
5
- type: string;
6
- [key: string]: any;
7
- }
8
- export interface DynamicTableCell {
9
- columnId: string;
10
- type: string;
11
- value: any;
12
- [key: string]: any;
13
- }
14
- export interface DynamicTableRow {
15
- id: string;
16
- data: DynamicTableCell[];
17
- children?: {
18
- [viewKey: string]: DynamicTableRow[];
19
- };
20
- expanded?: boolean;
21
- [key: string]: any;
22
- }
23
- export interface DynamicTableProps {
24
- columns: DynamicTableColumn[];
25
- dataSource: DynamicTableRow[];
26
- onSearch?: (keyword: string) => void;
27
- filters?: Array<{
28
- label: string;
29
- name: string;
30
- options: {
31
- label: string;
32
- value: string;
33
- }[];
34
- }>;
35
- actionBar?: React.ReactNode;
36
- styles?: any;
37
- eventsEmit?: (event: string, data: any) => void;
38
- allowMultiSelect?: boolean;
39
- viewBehavior?: 'scroll' | 'pagination';
40
- hideSearch?: boolean;
41
- rowProps?: (row: any, rowIndex?: number) => React.HTMLAttributes<HTMLTableRowElement>;
42
- isPending?: (id: string) => boolean;
43
- onRowAnimationComplete?: (rowId: string) => void;
44
- size?: 'sm' | 'md';
45
- addingIds?: string[];
46
- onRowAddAnimationComplete?: (rowId: string) => void;
47
- subTableConfig?: {
48
- [viewKey: string]: {
49
- columns: DynamicTableColumn[];
50
- allowMultiSelect?: boolean;
51
- toolbar?: any[];
52
- eventsEmit?: (name: string, data: any, appFn: any) => void;
53
- };
54
- };
55
- level?: number;
56
- isSubTable?: boolean;
57
- }
58
- declare const DynamicAntTable: React.FC<DynamicTableProps>;
59
- export default DynamicAntTable;
@@ -1,26 +0,0 @@
1
- import { default as React } from 'react';
2
- import { FormItemProps } from './hooks/useDynamicForm';
3
- /**
4
- * DynamicForm 组件
5
- * 复用 useDynamicFormItems 动态表单能力
6
- * 支持 formItems 配置,formProps 透传
7
- * 底部absolute"确认"重置"按钮,仅吸附在本组件底部
8
- * @author mxm
9
- * @date 2024-06-09
10
- */
11
- export interface DynamicFormProps {
12
- formItems: FormItemProps[];
13
- formProps?: any;
14
- initialValues?: Record<string, any>;
15
- eventsEmit?: (eventName: string, data: any) => void;
16
- styles?: any;
17
- size?: 'sm' | 'md';
18
- formConfig?: any;
19
- title?: string;
20
- description?: string;
21
- formWidth?: string;
22
- /** 其他props透传 */
23
- [key: string]: any;
24
- }
25
- declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<DynamicFormProps, "ref"> & React.RefAttributes<any>>>;
26
- export default _default;
@@ -1,85 +0,0 @@
1
- import { default as React } from 'react';
2
- /**
3
- * DynamicTable 组件(自研,兼容性好)
4
- * - columns/dataSource 合并为 data: { columns, dataSource }
5
- * - 支持搜索、过滤、actionBar
6
- * - 主题色、圆角、阴影用 styled-components + tailwindcss + theme
7
- * - 保证移动端和主流浏览器兼容性
8
- * - 支持嵌套table功能
9
- * @author mxm
10
- * @date 2024-06-09
11
- */
12
- export interface DynamicTableColumn {
13
- id: string;
14
- title: string;
15
- type: string;
16
- helpText?: string;
17
- [key: string]: any;
18
- }
19
- export interface DynamicTableCell {
20
- columnId: string;
21
- type: string;
22
- value: any;
23
- [key: string]: any;
24
- }
25
- export interface DynamicTableRow {
26
- id: string;
27
- data: DynamicTableCell[];
28
- children?: DynamicTableRow[];
29
- expanded?: boolean;
30
- [key: string]: any;
31
- }
32
- export interface DynamicTableProps {
33
- columns: DynamicTableColumn[];
34
- dataSource: DynamicTableRow[];
35
- onSearch?: (keyword: string) => void;
36
- filters?: Array<{
37
- label: string;
38
- name: string;
39
- options: {
40
- label: string;
41
- value: string;
42
- }[];
43
- }>;
44
- actionBar?: React.ReactNode;
45
- styles?: any;
46
- eventsEmit?: (event: string, data: any, appFn?: any) => void;
47
- allowMultiSelect?: boolean;
48
- viewBehavior?: 'scroll' | 'pagination';
49
- hideSearch?: boolean;
50
- rowProps?: (row: any, rowIndex?: number) => React.HTMLAttributes<HTMLTableRowElement>;
51
- isPending?: (id: string) => boolean;
52
- onRowAnimationComplete?: (rowId: string) => void;
53
- size?: 'sm' | 'md';
54
- addingIds?: string[];
55
- onRowAddAnimationComplete?: (rowId: string) => void;
56
- subTableConfig?: {
57
- columns?: DynamicTableColumn[];
58
- allowMultiSelect?: boolean;
59
- toolbar?: any[];
60
- default?: {
61
- columns: DynamicTableColumn[];
62
- allowMultiSelect?: boolean;
63
- viewBehavior?: 'scroll' | 'pagination';
64
- viewPageSize?: number;
65
- total?: number;
66
- requestPagesize?: number;
67
- };
68
- [key: string]: any;
69
- };
70
- level?: number;
71
- isSubTable?: boolean;
72
- subTablePendingIds?: {
73
- [parentId: string]: string[];
74
- };
75
- onSubTableRowAnimationComplete?: (parentId: string, rowId: string) => void;
76
- customizeComponents?: {
77
- [key: string]: React.ComponentType<any>;
78
- };
79
- viewId?: string;
80
- total?: number;
81
- requestPagesize?: number;
82
- viewPageSize?: number;
83
- }
84
- declare const DynamicTable: React.FC<DynamicTableProps>;
85
- export default DynamicTable;
@@ -1,15 +0,0 @@
1
- import { default as React } from 'react';
2
- export type ButtonType = 'primary' | 'default' | 'error' | 'warning' | 'success' | 'text';
3
- export interface ButtonProps {
4
- mode?: ButtonType;
5
- label?: string;
6
- styles?: any;
7
- icon?: React.ReactNode;
8
- disabled?: boolean;
9
- onClick?: () => void;
10
- style?: React.CSSProperties;
11
- className?: string;
12
- children?: React.ReactNode;
13
- }
14
- declare const Button: React.FC<ButtonProps>;
15
- export default Button;
@@ -1,116 +0,0 @@
1
- import { default as React } from 'react';
2
- /**
3
- * 动态表单配置接口
4
- *
5
- * 新增 col 布局元素类型,用于创建 flex 布局的列容器
6
- *
7
- * @example
8
- * // 基础用法 - 水平排列两个输入框
9
- * {
10
- * type: 'col',
11
- * children: [
12
- * { type: 'input', label: '姓名', name: 'firstName', required: true },
13
- * { type: 'input', label: '姓氏', name: 'lastName', required: true }
14
- * ]
15
- * }
16
- *
17
- * @example
18
- * // 高级用法 - 自定义布局属性
19
- * {
20
- * type: 'col',
21
- * direction: 'row', // flex 方向: 'row' | 'column'
22
- * gap: 24, // 间距
23
- * justify: 'space-between', // 主轴对齐: 'start' | 'center' | 'end' | 'space-between' | 'space-around'
24
- * align: 'center', // 交叉轴对齐: 'start' | 'center' | 'end' | 'stretch'
25
- * wrap: true, // 是否换行
26
- * children: [
27
- * { type: 'select', label: '性别', name: 'gender', options: [...] },
28
- * { type: 'number', label: '年龄', name: 'age', range: { min: 1, max: 120 } }
29
- * ]
30
- * }
31
- */
32
- export type FormItemType = 'input' | 'select' | 'number' | 'slider' | 'switch' | 'date' | 'time' | 'datetime' | 'radio' | 'checkbox' | 'textarea' | 'divider' | 'password' | 'email' | 'col' | 'title' | 'uploader' | 'file' | 'color' | 'json' | 'markdown';
33
- export interface FormItemProps {
34
- type: 'input' | 'select' | 'number' | 'slider' | 'switch' | 'date' | 'time' | 'datetime' | 'radio' | 'checkbox' | 'textarea' | 'divider' | 'password' | 'email' | 'col' | 'title' | 'uploader' | 'file' | 'color' | 'json' | 'markdown';
35
- label?: string;
36
- description?: string;
37
- helpText?: string;
38
- control?: string[];
39
- controlledItems?: string[] | {
40
- [key: string]: string[];
41
- };
42
- name?: string;
43
- defaultValue?: any;
44
- options?: {
45
- label: string;
46
- value: string;
47
- render?: () => React.ReactNode;
48
- }[];
49
- range?: {
50
- min: number;
51
- max: number;
52
- };
53
- step?: number;
54
- unit?: string;
55
- placeholder?: string;
56
- className?: string;
57
- disabled?: boolean;
58
- required?: boolean;
59
- error?: string;
60
- level?: number;
61
- validate?: (value: any) => string | undefined;
62
- counter?: number;
63
- children?: FormItemProps[];
64
- direction?: 'row' | 'column';
65
- gap?: number;
66
- justify?: 'start' | 'center' | 'end' | 'space-between' | 'space-around';
67
- align?: 'start' | 'center' | 'end' | 'stretch';
68
- wrap?: boolean;
69
- percentage?: number[];
70
- uploaderConfig?: {
71
- multiple?: boolean;
72
- accept?: string;
73
- maxSize?: number;
74
- maxFiles?: number;
75
- autoUpload?: boolean;
76
- url?: string;
77
- headers?: Record<string, string>;
78
- queryParams?: Record<string, string>;
79
- itemForm?: any[];
80
- icons?: {
81
- dragUpload?: React.ReactNode;
82
- itemStatus?: {
83
- pending?: React.ReactNode;
84
- uploading?: React.ReactNode;
85
- success?: React.ReactNode;
86
- error?: React.ReactNode;
87
- };
88
- fileType?: {
89
- default?: React.ReactNode;
90
- image?: React.ReactNode;
91
- document?: React.ReactNode;
92
- spreadsheet?: React.ReactNode;
93
- archive?: React.ReactNode;
94
- video?: React.ReactNode;
95
- audio?: React.ReactNode;
96
- };
97
- };
98
- buttons?: Array<{
99
- label: string;
100
- mode?: 'primary' | 'default' | 'error' | 'text';
101
- icon?: React.ReactNode;
102
- disabled?: boolean;
103
- onClick: () => void;
104
- }>;
105
- placeholder?: React.ReactNode;
106
- listName?: string;
107
- errorMessages?: {
108
- noUrl?: string;
109
- uploadFailed?: string;
110
- fileTooLarge?: string;
111
- invalidFileType?: string;
112
- };
113
- onRef?: (methods: any) => void;
114
- };
115
- }
116
- export declare function useDynamicFormItems(config?: FormItemProps[], styles?: any, initialValues?: Record<string, any>, size?: 'sm' | 'md'): (import("react/jsx-runtime").JSX.Element | null)[];
@@ -1,43 +0,0 @@
1
- import { default as React } from 'react';
2
- export interface TableColumnConfig {
3
- id: string;
4
- title: string;
5
- type: string;
6
- helpText?: string;
7
- [key: string]: any;
8
- }
9
- export interface TableCellConfig {
10
- columnId: string;
11
- value: any;
12
- statusType?: string;
13
- [key: string]: any;
14
- }
15
- export interface TableRowConfig {
16
- id: string;
17
- cells: TableCellConfig[];
18
- [key: string]: any;
19
- }
20
- export declare enum StatusType {
21
- success = "success",
22
- error = "error",
23
- warning = "warning",
24
- processing = "processing",
25
- info = "info",
26
- default = "default"
27
- }
28
- interface UseDynamicTableColumnsOptions {
29
- eventsEmit?: (eventName: string, data: any) => void;
30
- isPending?: (id: string) => boolean;
31
- customizeComponents?: {
32
- [key: string]: React.ComponentType<any>;
33
- };
34
- }
35
- /**
36
- * useDynamicTableColumns
37
- * 根据配置项自动生成统一风格的table columns
38
- * 支持字符、数字、状态、列表、日期、操作等类型
39
- * @param configs 列配置数组
40
- * @param options 事件分发等
41
- */
42
- export declare function useDynamicTableColumns(configs: TableColumnConfig[], options?: UseDynamicTableColumnsOptions, styles?: any): TableColumnConfig[];
43
- export {};
@@ -1,97 +0,0 @@
1
- import { default as React } from 'react';
2
- export type SizeType = 'sm' | 'md' | 'lg';
3
- export type FontWeightType = 'normal' | 'bold' | 'thin';
4
- export type FontFamilyType = 'default' | 'serif' | 'mono';
5
- export interface AiChatStyles {
6
- theme?: AppTheme;
7
- mode?: 'light' | 'dark';
8
- [key: string]: any;
9
- }
10
- export interface ThemeColors {
11
- primary: string;
12
- secondary: string;
13
- success: string;
14
- warning: string;
15
- error: string;
16
- info: string;
17
- background: string;
18
- text: string;
19
- border: string;
20
- disabled: string;
21
- disabledBackground: string;
22
- disabledText: string;
23
- [key: string]: any;
24
- }
25
- export interface ThemeOthers {
26
- }
27
- export interface ThemeSpace {
28
- sidebar: string;
29
- size: string;
30
- radius: string;
31
- padding: string;
32
- margin: string;
33
- shadow: string;
34
- lineHeight: string;
35
- [key: string]: any;
36
- }
37
- export interface ThemeIcons {
38
- [key: string]: any;
39
- }
40
- export interface AppTheme {
41
- colors: ThemeColors;
42
- space: ThemeSpace;
43
- icons: ThemeIcons;
44
- others?: ThemeOthers;
45
- }
46
- export declare const defaultTheme: AppTheme;
47
- export declare const sidebarMap: {
48
- sm: string;
49
- md: string;
50
- lg: string;
51
- };
52
- export declare const sizeMap: {
53
- sm: string;
54
- md: string;
55
- lg: string;
56
- };
57
- export declare const radiusMap: {
58
- sm: string;
59
- md: string;
60
- lg: string;
61
- };
62
- export declare const paddingMap: {
63
- sm: string;
64
- md: string;
65
- lg: string;
66
- };
67
- export declare const marginMap: {
68
- sm: string;
69
- md: string;
70
- lg: string;
71
- };
72
- export declare const shadowMap: {
73
- sm: string;
74
- md: string;
75
- lg: string;
76
- };
77
- export declare const lineHeightMap: {
78
- sm: string;
79
- md: string;
80
- lg: string;
81
- };
82
- export declare function deepMergeTheme(defaultTheme: AppTheme, customTheme?: Partial<AppTheme>): AppTheme;
83
- export declare function mapSpaceToCssValue(space: Record<string, string>): {
84
- size: string;
85
- radius: string;
86
- padding: string;
87
- margin: string;
88
- shadow: string;
89
- lineHeight: string;
90
- sidebar: string;
91
- };
92
- export declare const ThemeContext: React.Context<AppTheme>;
93
- export declare const useTheme: () => AppTheme;
94
- export declare const ThemeProvider: ({ theme, children, }: {
95
- theme: AppTheme;
96
- children: React.ReactNode;
97
- }) => import("react/jsx-runtime").JSX.Element;