@hkyhy/marsun-components-core 0.1.3 → 0.1.5
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/README.md +5 -7
- package/dist/components/AgentHub/AgentHubAccessGuard.d.ts +11 -0
- package/dist/components/AgentHub/AgentHubIndexRedirect.d.ts +8 -0
- package/dist/components/AgentHub/Chat/Action/CreateButton.d.ts +6 -0
- package/dist/components/AgentHub/Chat/Action/ManageActionButtons.d.ts +6 -0
- package/dist/components/AgentHub/Chat/Action/SessionActionButtons.d.ts +8 -0
- package/dist/components/AgentHub/Chat/Action/handlers.d.ts +11 -0
- package/dist/components/AgentHub/Chat/Action/index.d.ts +7 -0
- package/dist/components/AgentHub/Chat/Detail/ChatInput/index.d.ts +11 -0
- package/dist/components/AgentHub/Chat/Detail/CitationContent/index.d.ts +6 -0
- package/dist/components/AgentHub/Chat/Detail/CitationInlineBadge/index.d.ts +7 -0
- package/dist/components/AgentHub/Chat/Detail/CitationMarkdownContent/index.d.ts +12 -0
- package/dist/components/AgentHub/Chat/Detail/CitationPanel/index.d.ts +9 -0
- package/dist/components/AgentHub/Chat/Detail/MermaidBlock/index.d.ts +7 -0
- package/dist/components/AgentHub/Chat/Detail/MessageActions/index.d.ts +33 -0
- package/dist/components/AgentHub/Chat/Detail/MessageEditPopover/index.d.ts +13 -0
- package/dist/components/AgentHub/Chat/Detail/MessageItem/index.d.ts +14 -0
- package/dist/components/AgentHub/Chat/Detail/ThinkingSection/index.d.ts +13 -0
- package/dist/components/AgentHub/Chat/Detail/index.d.ts +12 -0
- package/dist/components/AgentHub/Chat/Form/Form.d.ts +16 -0
- package/dist/components/AgentHub/Chat/Form/index.d.ts +2 -0
- package/dist/components/AgentHub/Chat/List/ChatCard/index.d.ts +11 -0
- package/dist/components/AgentHub/Chat/List/FilterBar.d.ts +7 -0
- package/dist/components/AgentHub/Chat/List/SessionSidebar/index.d.ts +15 -0
- package/dist/components/AgentHub/Chat/List/index.d.ts +6 -0
- package/dist/components/AgentHub/Chat/Modal/FormModal.d.ts +12 -0
- package/dist/components/AgentHub/Chat/Modal/index.d.ts +2 -0
- package/dist/components/AgentHub/Chat/constants/index.d.ts +1 -0
- package/dist/components/AgentHub/Chat/constants/types.d.ts +2 -0
- package/dist/components/AgentHub/Chat/hooks/index.d.ts +5 -0
- package/dist/components/AgentHub/Chat/hooks/useAutoScrollToBottom.d.ts +21 -0
- package/dist/components/AgentHub/Chat/hooks/useChat.d.ts +19 -0
- package/dist/components/AgentHub/Chat/hooks/useChatSessions.d.ts +20 -0
- package/dist/components/AgentHub/Chat/hooks/useSSECompletion.d.ts +13 -0
- package/dist/components/AgentHub/Chat/hooks/useTypewriter.d.ts +16 -0
- package/dist/components/AgentHub/Chat/index.d.ts +7 -0
- package/dist/components/AgentHub/Chat/utils/citationContent.d.ts +37 -0
- package/dist/components/AgentHub/Chat/utils/index.d.ts +5 -0
- package/dist/components/AgentHub/Chat/utils/messageContent.d.ts +18 -0
- package/dist/components/AgentHub/Chat/utils/sanitizeMermaidChart.d.ts +7 -0
- package/dist/components/AgentHub/Chat/utils/sessionMessages.d.ts +21 -0
- package/dist/components/AgentHub/Chat/utils/smoothScroll.d.ts +14 -0
- package/dist/components/AgentHub/ChatSessionAccessGuard.d.ts +8 -0
- package/dist/components/AgentHub/KnowledgeBase/Action/CreateButton.d.ts +6 -0
- package/dist/components/AgentHub/KnowledgeBase/Action/ManageActionButtons.d.ts +6 -0
- package/dist/components/AgentHub/KnowledgeBase/Action/handlers.d.ts +5 -0
- package/dist/components/AgentHub/KnowledgeBase/Action/index.d.ts +5 -0
- package/dist/components/AgentHub/KnowledgeBase/Detail/DocumentTable/index.d.ts +16 -0
- package/dist/components/AgentHub/KnowledgeBase/Detail/ParseStatusTag/index.d.ts +6 -0
- package/dist/components/AgentHub/KnowledgeBase/Detail/index.d.ts +4 -0
- package/dist/components/AgentHub/KnowledgeBase/Form/Form.d.ts +13 -0
- package/dist/components/AgentHub/KnowledgeBase/Form/index.d.ts +2 -0
- package/dist/components/AgentHub/KnowledgeBase/List/FilterBar.d.ts +7 -0
- package/dist/components/AgentHub/KnowledgeBase/List/KnowledgeCard/index.d.ts +11 -0
- package/dist/components/AgentHub/KnowledgeBase/List/index.d.ts +4 -0
- package/dist/components/AgentHub/KnowledgeBase/Modal/FormModal.d.ts +11 -0
- package/dist/components/AgentHub/KnowledgeBase/Modal/index.d.ts +2 -0
- package/dist/components/AgentHub/KnowledgeBase/constants/index.d.ts +1 -0
- package/dist/components/AgentHub/KnowledgeBase/constants/types.d.ts +16 -0
- package/dist/components/AgentHub/KnowledgeBase/hooks/index.d.ts +2 -0
- package/dist/components/AgentHub/KnowledgeBase/hooks/useKBDocuments.d.ts +10 -0
- package/dist/components/AgentHub/KnowledgeBase/hooks/useKnowledgeBase.d.ts +13 -0
- package/dist/components/AgentHub/KnowledgeBase/index.d.ts +7 -0
- package/dist/components/AgentHub/types.d.ts +83 -0
- package/dist/components/Auth/PermissionGuard.d.ts +19 -0
- package/dist/components/Auth/ProtectedRoute.d.ts +10 -0
- package/dist/components/Auth/hasPermission.d.ts +2 -0
- package/dist/components/Auth/index.d.ts +3 -0
- package/dist/components/Auth/types.d.ts +1 -0
- package/dist/components/Descriptions/CommonDescriptions.d.ts +23 -0
- package/dist/components/Descriptions/index.d.ts +2 -0
- package/dist/components/File/FileItem/index.d.ts +22 -0
- package/dist/components/File/FileLink/index.d.ts +8 -0
- package/dist/components/File/FilePreview/index.d.ts +11 -0
- package/dist/components/File/FilePreviewModal/index.d.ts +10 -0
- package/dist/components/File/fileDisplay.d.ts +11 -0
- package/dist/components/File/index.d.ts +10 -0
- package/dist/components/File/types.d.ts +20 -0
- package/dist/components/Filter/CommonFilter/index.d.ts +41 -0
- package/dist/components/Filter/FilterDateRange/index.d.ts +18 -0
- package/dist/components/Filter/FilterInput/index.d.ts +10 -0
- package/dist/components/Filter/FilterNumberRange/index.d.ts +12 -0
- package/dist/components/Filter/FilterPanel/index.d.ts +11 -0
- package/dist/components/Filter/FilterPopover/index.d.ts +24 -0
- package/dist/components/Filter/FilterSelect/index.d.ts +18 -0
- package/dist/components/Filter/FilterTreeSelect/index.d.ts +22 -0
- package/dist/components/Filter/FilterTrigger/index.d.ts +16 -0
- package/dist/components/Filter/index.d.ts +30 -0
- package/dist/components/Filter/types.d.ts +35 -0
- package/dist/components/Filter/useFilterState.d.ts +49 -0
- package/dist/components/Form/FetchSelect.d.ts +21 -0
- package/dist/components/Form/FetchTreeSelect.d.ts +22 -0
- package/dist/components/Form/PersonOptionRow/index.d.ts +9 -0
- package/dist/components/Form/StepForm.d.ts +42 -0
- package/dist/components/Form/index.d.ts +8 -0
- package/dist/components/Icons/index.d.ts +85 -0
- package/dist/components/Layout/PageHeaderLayout/index.d.ts +12 -0
- package/dist/components/Layout/index.d.ts +2 -0
- package/dist/components/Modal/StepModal/index.d.ts +25 -0
- package/dist/components/Modal/StepModalTypes.d.ts +40 -0
- package/dist/components/Modal/index.d.ts +2 -0
- package/dist/components/Stat/StatCard/index.d.ts +22 -0
- package/dist/components/Stat/StatCardList.d.ts +26 -0
- package/dist/components/Stat/StatPendingBreakdown/index.d.ts +25 -0
- package/dist/components/Stat/index.d.ts +6 -0
- package/dist/components/Tag/FileTags.d.ts +6 -0
- package/dist/components/Tag/SemanticTag.d.ts +52 -0
- package/dist/components/Tag/Tags/index.d.ts +16 -0
- package/dist/components/Tag/index.d.ts +6 -0
- package/dist/components/TooltipInfo/TooltipInfo.d.ts +19 -0
- package/dist/components/TooltipInfo/index.d.ts +2 -0
- package/dist/components/Tour/AppTour/index.d.ts +19 -0
- package/dist/components/Tour/index.d.ts +2 -0
- package/dist/components/Upload/index.d.ts +66 -0
- package/dist/components/Upload/index.js +181 -0
- package/dist/components/Upload/index.js.map +1 -0
- package/dist/components/Upload/style.module.scss.js +19 -0
- package/dist/components/Upload/style.module.scss.js.map +1 -0
- package/dist/components/VirtualScrollbar/VirtualScrollbar/index.d.ts +14 -0
- package/dist/components/VirtualScrollbar/index.d.ts +3 -0
- package/dist/components/VirtualScrollbar/useVirtualScrollbar.d.ts +23 -0
- package/dist/components/index.d.ts +15 -0
- package/dist/hooks/useFetchData.d.ts +22 -0
- package/dist/index.d.ts +26 -28
- package/dist/index.js +166 -164
- package/dist/index.js.map +1 -1
- package/dist/marsun-components-core.css +1 -1
- package/dist/provider/MarsunCoreProvider.d.ts +20 -0
- package/dist/provider/context.d.ts +24 -0
- package/dist/provider/index.d.ts +3 -0
- package/dist/styles/global.css +1 -0
- package/dist/theme/constants.d.ts +12 -0
- package/dist/theme/theme.d.ts +11 -0
- package/dist/utils/format.d.ts +2 -0
- package/dist/utils/resolveMaybeFn.d.ts +11 -0
- package/package.json +9 -4
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SelectedItem } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* 筛选项注册信息
|
|
5
|
+
*/
|
|
6
|
+
interface FilterRegistration {
|
|
7
|
+
/** 筛选项标签 */
|
|
8
|
+
label: string;
|
|
9
|
+
/** 当前值的展示文案(如 "技术中心" / "审核员"),为空则不显示该条目 */
|
|
10
|
+
valueLabel: string;
|
|
11
|
+
/** 移除回调 */
|
|
12
|
+
onRemove: () => void;
|
|
13
|
+
}
|
|
14
|
+
/** Context 类型 */
|
|
15
|
+
interface FilterContextValue {
|
|
16
|
+
/** 注册筛选条件(有值时调用) */
|
|
17
|
+
register: (key: string, reg: FilterRegistration) => void;
|
|
18
|
+
/** 注销筛选条件(组件卸载或值清空时调用) */
|
|
19
|
+
unregister: (key: string) => void;
|
|
20
|
+
}
|
|
21
|
+
/** 供子组件使用 —— 在 CommonFilter 内部注册自身状态(不在 CommonFilter 内时安全返回 null) */
|
|
22
|
+
export declare function useFilterRegister(): FilterContextValue | null;
|
|
23
|
+
interface UseFilterStateReturn {
|
|
24
|
+
/** 所有已注册的筛选项 */
|
|
25
|
+
registrations: Record<string, FilterRegistration>;
|
|
26
|
+
/** 已选条目数组(过滤掉无 valueLabel 的项) */
|
|
27
|
+
selectedItems: SelectedItem[];
|
|
28
|
+
/** 注册方法 */
|
|
29
|
+
register: (key: string, reg: FilterRegistration) => void;
|
|
30
|
+
/** 注销方法 */
|
|
31
|
+
unregister: (key: string) => void;
|
|
32
|
+
/** 清空全部 */
|
|
33
|
+
clearAll: () => void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* 筛选状态管理 Hook
|
|
37
|
+
*
|
|
38
|
+
* 各 Filter 子组件通过 `register(key, { label, valueLabel, onRemove })` 注册,
|
|
39
|
+
* CommonFilter 自动聚合成 `selectedItems` 展示。
|
|
40
|
+
*/
|
|
41
|
+
export declare function useFilterState(): UseFilterStateReturn;
|
|
42
|
+
interface FilterProviderProps {
|
|
43
|
+
children: React.ReactNode;
|
|
44
|
+
/** register / unregister 方法 */
|
|
45
|
+
ctx: Pick<UseFilterStateReturn, 'register' | 'unregister'>;
|
|
46
|
+
}
|
|
47
|
+
/** 内部 Provider,将 register/unregister 注入给子组件 */
|
|
48
|
+
export declare const FilterProvider: React.FC<FilterProviderProps>;
|
|
49
|
+
export default useFilterState;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SelectProps } from 'antd';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
export interface SelectOptionItem {
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
value: string | number;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
export type FetchSelectProps = Omit<SelectProps, 'options' | 'loading' | 'filterOption' | 'optionLabelProp'> & {
|
|
10
|
+
/** props 模式选项(优先) */
|
|
11
|
+
options?: SelectOptionItem[];
|
|
12
|
+
fetchUrl?: string;
|
|
13
|
+
fetchOptions?: RequestInit;
|
|
14
|
+
transformData?: (raw: unknown) => SelectOptionItem[];
|
|
15
|
+
enabled?: boolean;
|
|
16
|
+
/** 自定义选项行渲染 */
|
|
17
|
+
optionRender?: (option: SelectOptionItem) => React.ReactNode;
|
|
18
|
+
};
|
|
19
|
+
/** 泛化下拉选择:支持 props 或 fetch+transformData */
|
|
20
|
+
declare const FetchSelect: React.FC<FetchSelectProps>;
|
|
21
|
+
export default FetchSelect;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TreeSelectProps } from 'antd';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
export interface TreeNodeOption {
|
|
4
|
+
value: string;
|
|
5
|
+
title: React.ReactNode;
|
|
6
|
+
key: string;
|
|
7
|
+
children?: TreeNodeOption[];
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export type FetchTreeSelectProps = Omit<TreeSelectProps, 'treeData' | 'loading'> & {
|
|
11
|
+
/** props 模式树数据(优先) */
|
|
12
|
+
treeData?: TreeNodeOption[];
|
|
13
|
+
/** fetch 模式 URL */
|
|
14
|
+
fetchUrl?: string;
|
|
15
|
+
fetchOptions?: RequestInit;
|
|
16
|
+
/** 将 API 响应转为 treeData */
|
|
17
|
+
transformData?: (raw: unknown) => TreeNodeOption[];
|
|
18
|
+
enabled?: boolean;
|
|
19
|
+
};
|
|
20
|
+
/** 泛化树形选择:支持 props 或 fetch+transformData,无业务数据转换 */
|
|
21
|
+
declare const FetchTreeSelect: React.FC<FetchTreeSelectProps>;
|
|
22
|
+
export default FetchTreeSelect;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PersonOption } from '../../Filter/types';
|
|
3
|
+
export interface PersonOptionRowProps {
|
|
4
|
+
option: Pick<PersonOption, 'label' | 'departmentName' | 'email' | 'phone' | 'employeeId'>;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
/** 人员选项行:姓名 + 部门 + 右侧 info 图标,hover 展示联系方式 */
|
|
8
|
+
declare const PersonOptionRow: React.FC<PersonOptionRowProps>;
|
|
9
|
+
export default PersonOptionRow;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { StepItem, StepModalProps } from '../Modal';
|
|
2
|
+
import { Form } from 'antd';
|
|
3
|
+
import { default as React } from 'react';
|
|
4
|
+
export interface StepFormProps extends Omit<StepModalProps, 'steps'> {
|
|
5
|
+
/** 步骤列表 */
|
|
6
|
+
steps: StepFormItem[];
|
|
7
|
+
/** antd Form 实例 */
|
|
8
|
+
form: ReturnType<typeof Form.useForm>[0];
|
|
9
|
+
}
|
|
10
|
+
/** 扩展 StepItem,增加表单校验步骤支持 */
|
|
11
|
+
export interface StepFormItem extends Omit<StepItem, 'beforeEnter'> {
|
|
12
|
+
/** 进入下一步前校验的表单字段列表,不传则不做表单校验 */
|
|
13
|
+
validateFields?: string[];
|
|
14
|
+
/** 自定义校验(在 validateFields 之后执行) */
|
|
15
|
+
beforeEnter?: (values: Record<string, unknown>) => boolean | Promise<boolean>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 步骤式表单弹窗
|
|
19
|
+
*
|
|
20
|
+
* 在 StepModal 基础上集成 Form 校验能力,
|
|
21
|
+
* 每个步骤可声明需要校验的字段,点击"下一步"时自动 validateFields。
|
|
22
|
+
*
|
|
23
|
+
* 用法:
|
|
24
|
+
* ```tsx
|
|
25
|
+
* const [form] = Form.useForm();
|
|
26
|
+
* const [current, setCurrent] = useState('basic');
|
|
27
|
+
*
|
|
28
|
+
* <StepForm
|
|
29
|
+
* form={form}
|
|
30
|
+
* open={open}
|
|
31
|
+
* current={current}
|
|
32
|
+
* onCancel={onCancel}
|
|
33
|
+
* onStepChange={setCurrent}
|
|
34
|
+
* steps={[
|
|
35
|
+
* { key: 'basic', title: '基本信息', validateFields: ['name'], content: <BasicStep /> },
|
|
36
|
+
* { key: 'detail', title: '详细信息', content: <DetailStep /> },
|
|
37
|
+
* ]}
|
|
38
|
+
* />
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
declare const StepForm: React.FC<StepFormProps>;
|
|
42
|
+
export default StepForm;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as StepForm } from './StepForm';
|
|
2
|
+
export type { StepFormItem, StepFormProps } from './StepForm';
|
|
3
|
+
export { default as FetchTreeSelect } from './FetchTreeSelect';
|
|
4
|
+
export type { FetchTreeSelectProps, TreeNodeOption } from './FetchTreeSelect';
|
|
5
|
+
export { default as FetchSelect } from './FetchSelect';
|
|
6
|
+
export type { FetchSelectProps, SelectOptionItem } from './FetchSelect';
|
|
7
|
+
export { default as PersonOptionRow } from './PersonOptionRow';
|
|
8
|
+
export type { PersonOptionRowProps } from './PersonOptionRow';
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { LucideIcon, LucideProps } from 'lucide-react';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
export type IconProps = LucideProps & {
|
|
4
|
+
spin?: boolean;
|
|
5
|
+
rotate?: number;
|
|
6
|
+
};
|
|
7
|
+
declare const createIcon: (Icon: LucideIcon, options?: {
|
|
8
|
+
filled?: boolean;
|
|
9
|
+
}) => React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
10
|
+
export declare const ArrowLeft: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
11
|
+
export declare const ArrowLeftRight: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
12
|
+
export declare const BarChart3: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
13
|
+
export declare const BookOpen: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
14
|
+
export declare const Bot: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
15
|
+
export declare const Check: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
16
|
+
export declare const ChevronDown: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
17
|
+
export declare const ChevronLeft: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
18
|
+
export declare const ChevronRight: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
19
|
+
export declare const ChevronUp: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
20
|
+
export declare const CircleAlert: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
21
|
+
export declare const CircleCheck: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
22
|
+
export declare const CircleHelp: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
23
|
+
export declare const CirclePlay: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
24
|
+
export declare const CircleX: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
25
|
+
export declare const ClipboardCheck: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
26
|
+
export declare const Clock: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
27
|
+
export declare const CloudDownload: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
28
|
+
export declare const CloudUpload: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
29
|
+
export declare const Code: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
30
|
+
export declare const Copy: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
31
|
+
export declare const Crown: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
32
|
+
export declare const Database: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
33
|
+
export declare const Download: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
34
|
+
export declare const Eye: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
35
|
+
export declare const File: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
36
|
+
export declare const FileArchive: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
37
|
+
export declare const FileImage: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
38
|
+
export declare const FileSpreadsheet: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
39
|
+
export declare const FileText: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
40
|
+
export declare const Flag: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
41
|
+
export declare const Flame: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
42
|
+
export declare const Folder: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
43
|
+
export declare const FolderOpen: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
44
|
+
export declare const Hash: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
45
|
+
export declare const House: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
46
|
+
export declare const Import: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
47
|
+
export declare const Inbox: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
48
|
+
export declare const Info: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
49
|
+
export declare const LayoutDashboard: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
50
|
+
export declare const LayoutGrid: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
51
|
+
export declare const Loader2: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
52
|
+
export declare const Lock: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
53
|
+
export declare const LogOut: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
54
|
+
export declare const MessageCircle: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
55
|
+
export declare const MessageSquare: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
56
|
+
export declare const PanelLeftClose: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
57
|
+
export declare const PanelLeftOpen: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
58
|
+
export declare const Pause: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
59
|
+
export declare const Pencil: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
60
|
+
export declare const Plus: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
61
|
+
export declare const Presentation: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
62
|
+
export declare const RefreshCw: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
63
|
+
export declare const RotateCw: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
64
|
+
export declare const Send: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
65
|
+
export declare const Settings: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
66
|
+
export declare const Shield: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
67
|
+
export declare const ShieldCheck: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
68
|
+
export declare const SlidersHorizontal: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
69
|
+
export declare const Square: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
70
|
+
export declare const Star: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
71
|
+
export declare const ThumbsDown: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
72
|
+
export declare const ThumbsUp: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
73
|
+
export declare const Trash2: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
74
|
+
export declare const Trophy: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
75
|
+
export declare const Undo2: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
76
|
+
export declare const Upload: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
77
|
+
export declare const User: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
78
|
+
export declare const UserPlus: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
79
|
+
export declare const UserRoundCog: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
80
|
+
export declare const Users: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
81
|
+
export declare const X: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
82
|
+
export { createIcon };
|
|
83
|
+
export declare const ICON_NAMES: readonly ["ArrowLeft", "ArrowLeftRight", "BarChart3", "BookOpen", "Bot", "Check", "ChevronDown", "ChevronLeft", "ChevronRight", "ChevronUp", "CircleAlert", "CircleCheck", "CircleHelp", "CirclePlay", "CircleX", "ClipboardCheck", "Clock", "CloudDownload", "CloudUpload", "Code", "Copy", "Crown", "Database", "Download", "Eye", "File", "FileArchive", "FileImage", "FileSpreadsheet", "FileText", "Flag", "Flame", "Folder", "FolderOpen", "Hash", "House", "Import", "Inbox", "Info", "LayoutDashboard", "LayoutGrid", "Loader2", "Lock", "LogOut", "MessageCircle", "MessageSquare", "PanelLeftClose", "PanelLeftOpen", "Pause", "Pencil", "Plus", "Presentation", "RefreshCw", "RotateCw", "Send", "Settings", "Shield", "ShieldCheck", "SlidersHorizontal", "Square", "Star", "ThumbsDown", "ThumbsUp", "Trash2", "Trophy", "Undo2", "Upload", "User", "UserPlus", "UserRoundCog", "Users", "X"];
|
|
84
|
+
export type IconName = (typeof ICON_NAMES)[number];
|
|
85
|
+
export declare const ICON_REGISTRY: Record<IconName, React.FC<IconProps>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface PageHeaderLayoutProps {
|
|
3
|
+
title: string;
|
|
4
|
+
onBack?: () => void;
|
|
5
|
+
actions?: React.ReactNode;
|
|
6
|
+
/** 页面说明提示,显示在头部下方、内容区上方 */
|
|
7
|
+
description?: React.ReactNode;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/** 页面头部布局:返回按钮 + 标题 + 操作区 + 说明提示 + 内容 */
|
|
11
|
+
declare const PageHeaderLayout: React.FC<PageHeaderLayoutProps>;
|
|
12
|
+
export default PageHeaderLayout;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { StepModalProps } from '../StepModalTypes';
|
|
3
|
+
/**
|
|
4
|
+
* 步骤式弹窗
|
|
5
|
+
*
|
|
6
|
+
* 将多步骤流程封装在同一个 Modal 中,自动管理步骤导航、标题切换和底部按钮。
|
|
7
|
+
*
|
|
8
|
+
* 用法:
|
|
9
|
+
* ```tsx
|
|
10
|
+
* const [current, setCurrent] = useState('select');
|
|
11
|
+
* <StepModal
|
|
12
|
+
* open={open}
|
|
13
|
+
* current={current}
|
|
14
|
+
* onCancel={onCancel}
|
|
15
|
+
* steps={[
|
|
16
|
+
* { key: 'select', title: '选择文件', content: <SelectStep /> },
|
|
17
|
+
* { key: 'uploading', title: '上传文件', content: <UploadingStep /> },
|
|
18
|
+
* { key: 'result', title: '上传结果', content: <ResultStep /> },
|
|
19
|
+
* ]}
|
|
20
|
+
* onStepChange={setCurrent}
|
|
21
|
+
* />
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
declare const StepModal: React.FC<StepModalProps>;
|
|
25
|
+
export default StepModal;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/** 步骤项定义 */
|
|
3
|
+
export interface StepItem {
|
|
4
|
+
/** 步骤唯一 key */
|
|
5
|
+
key: string;
|
|
6
|
+
/** 步骤标题 */
|
|
7
|
+
title: string;
|
|
8
|
+
/** 步骤描述(可选,显示在 Steps 下方) */
|
|
9
|
+
description?: string;
|
|
10
|
+
/** 步骤内容,支持直接 JSX 或函数返回 JSX(延迟求值) */
|
|
11
|
+
content: React.ReactNode | (() => React.ReactNode);
|
|
12
|
+
/** 底部按钮区域,不传则使用默认的"取消/下一步"逻辑,支持函数延迟求值 */
|
|
13
|
+
footer?: React.ReactNode | (() => React.ReactNode);
|
|
14
|
+
/** 是否允许返回上一步 */
|
|
15
|
+
allowBack?: boolean;
|
|
16
|
+
/** 进入该步骤前的校验,返回 true 允许进入,false 阻止 */
|
|
17
|
+
beforeEnter?: () => boolean | Promise<boolean>;
|
|
18
|
+
}
|
|
19
|
+
export interface StepModalProps {
|
|
20
|
+
/** 弹窗标题(覆盖步骤标题) */
|
|
21
|
+
title?: string;
|
|
22
|
+
/** 步骤列表 */
|
|
23
|
+
steps: StepItem[];
|
|
24
|
+
/** 当前步骤 key */
|
|
25
|
+
current: string;
|
|
26
|
+
/** 弹窗是否打开 */
|
|
27
|
+
open: boolean;
|
|
28
|
+
/** 取消/关闭回调 */
|
|
29
|
+
onCancel: () => void;
|
|
30
|
+
/** 弹窗宽度 */
|
|
31
|
+
width?: number;
|
|
32
|
+
/** 是否显示 Steps 导航条 */
|
|
33
|
+
showSteps?: boolean;
|
|
34
|
+
/** 是否允许点击遮罩关闭 */
|
|
35
|
+
maskClosable?: boolean;
|
|
36
|
+
/** 自定义 className */
|
|
37
|
+
className?: string;
|
|
38
|
+
/** 切换步骤回调 */
|
|
39
|
+
onStepChange?: (key: string) => void;
|
|
40
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface StatCardProps {
|
|
3
|
+
/** 标题 */
|
|
4
|
+
title: string;
|
|
5
|
+
/** 数值 */
|
|
6
|
+
value: number;
|
|
7
|
+
/** 前缀图标 */
|
|
8
|
+
prefix?: React.ReactNode;
|
|
9
|
+
/** 数值颜色 */
|
|
10
|
+
color?: string;
|
|
11
|
+
/** 点击回调 */
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
/** 是否内联模式(不使用 Card 包裹) */
|
|
14
|
+
inline?: boolean;
|
|
15
|
+
/** 内联模式下的字体大小 */
|
|
16
|
+
fontSize?: number;
|
|
17
|
+
/** 自定义样式 */
|
|
18
|
+
style?: React.CSSProperties;
|
|
19
|
+
}
|
|
20
|
+
/** 可点击的统计卡片 */
|
|
21
|
+
declare const StatCard: React.FC<StatCardProps>;
|
|
22
|
+
export default StatCard;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ColProps } from 'antd/es/grid';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { StatCardProps } from './StatCard';
|
|
4
|
+
export interface StatItem extends Omit<StatCardProps, 'inline' | 'fontSize'> {
|
|
5
|
+
/** 卡片占列配置,不传则根据总 items 数自动计算 */
|
|
6
|
+
colProps?: ColProps;
|
|
7
|
+
/** 是否隐藏,为 true 时不渲染 */
|
|
8
|
+
hidden?: boolean;
|
|
9
|
+
/** 后缀 */
|
|
10
|
+
suffix?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export interface StatCardListProps {
|
|
13
|
+
/** 统计项列表 */
|
|
14
|
+
items: StatItem[];
|
|
15
|
+
/** 行间距 */
|
|
16
|
+
gutter?: [number, number];
|
|
17
|
+
/** 容器 className */
|
|
18
|
+
className?: string;
|
|
19
|
+
/** 是否内联模式 */
|
|
20
|
+
inline?: boolean;
|
|
21
|
+
/** 内联模式字体大小 */
|
|
22
|
+
fontSize?: number;
|
|
23
|
+
}
|
|
24
|
+
/** 统计卡片列表 */
|
|
25
|
+
declare const StatCardList: React.FC<StatCardListProps>;
|
|
26
|
+
export default StatCardList;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { StatItem } from '../StatCardList';
|
|
3
|
+
export interface StatPendingBreakdownProps {
|
|
4
|
+
/** 卡片标题 */
|
|
5
|
+
title?: string;
|
|
6
|
+
/** 数据可见范围说明,显示在标题下方 */
|
|
7
|
+
subtitle?: React.ReactNode;
|
|
8
|
+
/** 汇总统计项 */
|
|
9
|
+
summaryItems?: StatItem[];
|
|
10
|
+
/** 待审核明细统计项 */
|
|
11
|
+
detailItems: StatItem[];
|
|
12
|
+
/** 汇总区字体大小 */
|
|
13
|
+
summaryFontSize?: number;
|
|
14
|
+
/** 明细区字体大小 */
|
|
15
|
+
detailFontSize?: number;
|
|
16
|
+
/** 明细区标题 */
|
|
17
|
+
detailLabel?: string;
|
|
18
|
+
/** 容器 className */
|
|
19
|
+
className?: string;
|
|
20
|
+
/** 无 Card 包裹,仅展示统计内容(用于外层已有 Card 的场景) */
|
|
21
|
+
plain?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** 待审核汇总 + 明细独立展示区块 */
|
|
24
|
+
declare const StatPendingBreakdown: React.FC<StatPendingBreakdownProps>;
|
|
25
|
+
export default StatPendingBreakdown;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as StatCard } from './StatCard';
|
|
2
|
+
export type { StatCardProps } from './StatCard';
|
|
3
|
+
export { default as StatCardList } from './StatCardList';
|
|
4
|
+
export type { StatCardListProps, StatItem } from './StatCardList';
|
|
5
|
+
export { default as StatPendingBreakdown } from './StatPendingBreakdown';
|
|
6
|
+
export type { StatPendingBreakdownProps } from './StatPendingBreakdown';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 语义化颜色常量
|
|
4
|
+
* 统一管理所有 Tag 的颜色,避免各处硬编码不一致
|
|
5
|
+
*
|
|
6
|
+
* 主题色(primary/success/info/warning/danger)使用 CSS 变量,跟随系统主题色动态变化
|
|
7
|
+
* 固定色(default/processing/other/volcano/cyan/gold/lime)集中管理,不随主题变化
|
|
8
|
+
*/
|
|
9
|
+
export declare const SEMANTIC_COLORS: {
|
|
10
|
+
/** 主题色(跟随系统主题色动态变化) */
|
|
11
|
+
readonly PRIMARY: "primary";
|
|
12
|
+
/** 默认/中性 */
|
|
13
|
+
readonly DEFAULT: "default";
|
|
14
|
+
/** 信息/提示 */
|
|
15
|
+
readonly INFO: "info";
|
|
16
|
+
/** 进行中/处理中 */
|
|
17
|
+
readonly PROCESSING: "processing";
|
|
18
|
+
/** 成功/已完成/已通过 */
|
|
19
|
+
readonly SUCCESS: "success";
|
|
20
|
+
/** 警告/待处理 */
|
|
21
|
+
readonly WARNING: "warning";
|
|
22
|
+
/** 危险/紧急/已驳回 */
|
|
23
|
+
readonly DANGER: "danger";
|
|
24
|
+
/** 其他/特殊 */
|
|
25
|
+
readonly OTHER: "other";
|
|
26
|
+
/** 火山/待领导审批 */
|
|
27
|
+
readonly VOLCANO: "volcano";
|
|
28
|
+
/** 青色/辅助 */
|
|
29
|
+
readonly CYAN: "cyan";
|
|
30
|
+
/** 金色/高优先级 */
|
|
31
|
+
readonly GOLD: "gold";
|
|
32
|
+
/** 石灰/低优先级 */
|
|
33
|
+
readonly LIME: "lime";
|
|
34
|
+
};
|
|
35
|
+
export type SemanticColor = (typeof SEMANTIC_COLORS)[keyof typeof SEMANTIC_COLORS];
|
|
36
|
+
interface SemanticTagProps {
|
|
37
|
+
/** 标签文本 */
|
|
38
|
+
children: React.ReactNode;
|
|
39
|
+
/** 语义化颜色,优先使用 SEMANTIC_COLORS 中的值 */
|
|
40
|
+
color?: SemanticColor | string;
|
|
41
|
+
/** antd Tag 其余属性 */
|
|
42
|
+
[key: string]: unknown;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* 统一 Tag 组件
|
|
46
|
+
* - 主题色(primary/success/info/warning/danger)使用 CSS 变量,跟随系统主题色动态变化
|
|
47
|
+
* - 固定色集中管理,避免硬编码
|
|
48
|
+
* - 文字颜色 = 语义色,背景色 = 语义色 6% 透明度
|
|
49
|
+
* - 统一尺寸:height 24px, line-height 24px, padding 0 8px
|
|
50
|
+
*/
|
|
51
|
+
declare const SemanticTag: React.FC<SemanticTagProps>;
|
|
52
|
+
export default SemanticTag;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SemanticColor } from '../SemanticTag';
|
|
3
|
+
export interface TagsProps {
|
|
4
|
+
/** 标签列表 */
|
|
5
|
+
tags?: string[];
|
|
6
|
+
/** 最多展示的标签数量;未传或 tags 数量未超出时展示全部 */
|
|
7
|
+
showLength?: number;
|
|
8
|
+
/** 无标签时的占位,传 null 则不渲染 */
|
|
9
|
+
empty?: React.ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
/** 标签颜色,默认 INFO */
|
|
12
|
+
color?: SemanticColor | string;
|
|
13
|
+
}
|
|
14
|
+
/** 通用标签列表(SemanticTag + showLength 截断) */
|
|
15
|
+
declare const Tags: React.FC<TagsProps>;
|
|
16
|
+
export default Tags;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as FileTags } from './FileTags';
|
|
2
|
+
export type { FileTagsProps } from './FileTags';
|
|
3
|
+
export { default as Tags } from './Tags';
|
|
4
|
+
export type { TagsProps } from './Tags';
|
|
5
|
+
export { SEMANTIC_COLORS, default as SemanticTag } from './SemanticTag';
|
|
6
|
+
export type { SemanticColor } from './SemanticTag';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TooltipProps } from 'antd';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { DescriptionItem } from '../Descriptions/CommonDescriptions';
|
|
4
|
+
export interface TooltipInfoProps extends Pick<TooltipProps, 'placement' | 'mouseEnterDelay' | 'mouseLeaveDelay'> {
|
|
5
|
+
/** 详情描述项,内部使用 CommonDescriptions 渲染 */
|
|
6
|
+
content: DescriptionItem[];
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/** CommonDescriptions 列数,默认 1 */
|
|
9
|
+
column?: number;
|
|
10
|
+
/** 为 true 或 content 为空时不展示 Tooltip */
|
|
11
|
+
hidden?: boolean;
|
|
12
|
+
/** @deprecated 使用 classNames.root */
|
|
13
|
+
overlayClassName?: string;
|
|
14
|
+
/** @deprecated 使用 styles.root */
|
|
15
|
+
overlayStyle?: React.CSSProperties;
|
|
16
|
+
}
|
|
17
|
+
/** Tooltip 详情展示,内部统一使用 CommonDescriptions */
|
|
18
|
+
declare const TooltipInfo: React.FC<TooltipInfoProps>;
|
|
19
|
+
export default TooltipInfo;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TourProps } from 'antd';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
export interface AppTourStep {
|
|
4
|
+
title: string;
|
|
5
|
+
description: React.ReactNode;
|
|
6
|
+
target?: () => HTMLElement;
|
|
7
|
+
placement?: TourProps['steps'] extends (infer S)[] | undefined ? S extends {
|
|
8
|
+
placement?: infer P;
|
|
9
|
+
} ? P : never : never;
|
|
10
|
+
}
|
|
11
|
+
export interface AppTourProps {
|
|
12
|
+
steps: AppTourStep[];
|
|
13
|
+
/** localStorage key,用于记录是否已完成导览 */
|
|
14
|
+
storageKey?: string;
|
|
15
|
+
/** 是否自动打开(首次) */
|
|
16
|
+
autoOpen?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const AppTour: React.FC<AppTourProps>;
|
|
19
|
+
export default AppTour;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { UploadFile } from 'antd/es/upload/interface';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
/** 上传变体 */
|
|
4
|
+
export type UploadVariant = 'panel' | 'button';
|
|
5
|
+
export interface CommonUploadProps {
|
|
6
|
+
value?: UploadFile[];
|
|
7
|
+
onChange?: (value: UploadFile[]) => void;
|
|
8
|
+
className?: string;
|
|
9
|
+
/** 单文件大小限制(字节),默认 500MB */
|
|
10
|
+
fileSize?: number;
|
|
11
|
+
/** 最大上传数量 */
|
|
12
|
+
maxLength?: number;
|
|
13
|
+
multiple?: boolean;
|
|
14
|
+
/** 目录上传模式(webkitdirectory),选中整个文件夹并保留 webkitRelativePath */
|
|
15
|
+
directory?: boolean;
|
|
16
|
+
size?: 'small' | 'middle' | 'large';
|
|
17
|
+
accept?: string;
|
|
18
|
+
/** panel = 拖拽面板(Dragger 样式),button = 按钮(默认) */
|
|
19
|
+
variant?: UploadVariant;
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
renderTips?: () => React.ReactNode;
|
|
22
|
+
/** 是否展示已上传文件列表,默认 true(tips 下方) */
|
|
23
|
+
showFileList?: boolean;
|
|
24
|
+
onSave?: (fileList: UploadFile[]) => void;
|
|
25
|
+
ossUpload?: boolean;
|
|
26
|
+
onUpload?: (options: {
|
|
27
|
+
file: File;
|
|
28
|
+
onSuccess: (url?: string) => void;
|
|
29
|
+
onError: (err: Error) => void;
|
|
30
|
+
}) => Promise<void> | void;
|
|
31
|
+
getPermission?: (file: File) => boolean;
|
|
32
|
+
concurrentCount?: number;
|
|
33
|
+
}
|
|
34
|
+
export type CommonUploadRef = {
|
|
35
|
+
upload: () => void;
|
|
36
|
+
uploading: boolean;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* CommonUpload — 通用上传组件
|
|
40
|
+
*
|
|
41
|
+
* - 在 antd `<Form.Item>` 内使用时,通过 `value`/`onChange` 自动接入表单
|
|
42
|
+
* - 独立使用时,通过 `onSave` 获取文件列表
|
|
43
|
+
*
|
|
44
|
+
* ## 两种变体
|
|
45
|
+
*
|
|
46
|
+
* - **`variant="button"`(默认)** — 虚线边框按钮 + 底部提示文案 + 已传文件列表
|
|
47
|
+
* - **`variant="panel"`** — Dragger 拖拽面板 + 底部已传文件列表
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx
|
|
51
|
+
* // 在 Form.Item 中使用
|
|
52
|
+
* <Form.Item name="files" label="简历附件" rules={[{ required: true, message: '请上传文件' }]}>
|
|
53
|
+
* <CommonUpload accept=".pdf,.jpg,.png" maxLength={10} />
|
|
54
|
+
* </Form.Item>
|
|
55
|
+
*
|
|
56
|
+
* // 独立使用(Modal 内、非表单场景)
|
|
57
|
+
* <CommonUpload variant="panel" accept=".doc,.pdf" onSave={(list) => setFiles(list)} />
|
|
58
|
+
*
|
|
59
|
+
* // ref 手动触发上传
|
|
60
|
+
* const ref = useRef<CommonUploadRef>(null);
|
|
61
|
+
* <CommonUpload ref={ref} onUpload={...} />;
|
|
62
|
+
* ref.current?.upload();
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
declare const CommonUpload: React.ForwardRefExoticComponent<CommonUploadProps & React.RefAttributes<CommonUploadRef>>;
|
|
66
|
+
export default CommonUpload;
|