@huibo-ui/react-antd 1.0.0
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/lib/components/Affix.d.ts +6 -0
- package/lib/components/Affix.js +5 -0
- package/lib/components/Alert.d.ts +10 -0
- package/lib/components/Alert.js +5 -0
- package/lib/components/Anchor.d.ts +7 -0
- package/lib/components/Anchor.js +5 -0
- package/lib/components/App.d.ts +4 -0
- package/lib/components/App.js +6 -0
- package/lib/components/Avatar.d.ts +8 -0
- package/lib/components/Avatar.js +6 -0
- package/lib/components/BackTop.d.ts +6 -0
- package/lib/components/BackTop.js +5 -0
- package/lib/components/Badge.d.ts +9 -0
- package/lib/components/Badge.js +5 -0
- package/lib/components/Breadcrumb.d.ts +12 -0
- package/lib/components/Breadcrumb.js +10 -0
- package/lib/components/Button.d.ts +14 -0
- package/lib/components/Button.js +7 -0
- package/lib/components/Card.d.ts +11 -0
- package/lib/components/Card.js +5 -0
- package/lib/components/Cascader.d.ts +12 -0
- package/lib/components/Cascader.js +5 -0
- package/lib/components/Checkbox.d.ts +18 -0
- package/lib/components/Checkbox.js +10 -0
- package/lib/components/Collapse.d.ts +11 -0
- package/lib/components/Collapse.js +7 -0
- package/lib/components/ConfigProvider.d.ts +27 -0
- package/lib/components/ConfigProvider.js +80 -0
- package/lib/components/DatePicker.d.ts +35 -0
- package/lib/components/DatePicker.js +15 -0
- package/lib/components/Descriptions.d.ts +12 -0
- package/lib/components/Descriptions.js +13 -0
- package/lib/components/Divider.d.ts +8 -0
- package/lib/components/Divider.js +5 -0
- package/lib/components/Drawer.d.ts +11 -0
- package/lib/components/Drawer.js +6 -0
- package/lib/components/Dropdown.d.ts +10 -0
- package/lib/components/Dropdown.js +5 -0
- package/lib/components/Empty.d.ts +10 -0
- package/lib/components/Empty.js +14 -0
- package/lib/components/FloatButton.d.ts +8 -0
- package/lib/components/FloatButton.js +5 -0
- package/lib/components/Form.d.ts +79 -0
- package/lib/components/Form.js +97 -0
- package/lib/components/Image.d.ts +9 -0
- package/lib/components/Image.js +5 -0
- package/lib/components/Input.d.ts +39 -0
- package/lib/components/Input.js +37 -0
- package/lib/components/InputNumber.d.ts +13 -0
- package/lib/components/InputNumber.js +5 -0
- package/lib/components/Layout.d.ts +46 -0
- package/lib/components/Layout.js +85 -0
- package/lib/components/Menu.d.ts +39 -0
- package/lib/components/Menu.js +32 -0
- package/lib/components/Modal.d.ts +26 -0
- package/lib/components/Modal.js +76 -0
- package/lib/components/PageHeader.d.ts +8 -0
- package/lib/components/PageHeader.js +5 -0
- package/lib/components/Pagination.d.ts +11 -0
- package/lib/components/Pagination.js +5 -0
- package/lib/components/Popconfirm.d.ts +10 -0
- package/lib/components/Popconfirm.js +5 -0
- package/lib/components/Popover.d.ts +8 -0
- package/lib/components/Popover.js +5 -0
- package/lib/components/Progress.d.ts +10 -0
- package/lib/components/Progress.js +5 -0
- package/lib/components/QRCode.d.ts +14 -0
- package/lib/components/QRCode.js +10 -0
- package/lib/components/Radio.d.ts +24 -0
- package/lib/components/Radio.js +23 -0
- package/lib/components/Rate.d.ts +9 -0
- package/lib/components/Rate.js +5 -0
- package/lib/components/Result.d.ts +8 -0
- package/lib/components/Result.js +5 -0
- package/lib/components/Segmented.d.ts +11 -0
- package/lib/components/Segmented.js +5 -0
- package/lib/components/Select.d.ts +30 -0
- package/lib/components/Select.js +43 -0
- package/lib/components/Skeleton.d.ts +19 -0
- package/lib/components/Skeleton.js +20 -0
- package/lib/components/Slider.d.ts +11 -0
- package/lib/components/Slider.js +5 -0
- package/lib/components/Space.d.ts +12 -0
- package/lib/components/Space.js +12 -0
- package/lib/components/Spin.d.ts +8 -0
- package/lib/components/Spin.js +8 -0
- package/lib/components/Statistic.d.ts +9 -0
- package/lib/components/Statistic.js +5 -0
- package/lib/components/Steps.d.ts +13 -0
- package/lib/components/Steps.js +7 -0
- package/lib/components/Switch.d.ts +10 -0
- package/lib/components/Switch.js +5 -0
- package/lib/components/Table.d.ts +55 -0
- package/lib/components/Table.js +187 -0
- package/lib/components/Tabs.d.ts +21 -0
- package/lib/components/Tabs.js +7 -0
- package/lib/components/Tag.d.ts +8 -0
- package/lib/components/Tag.js +6 -0
- package/lib/components/TimePicker.d.ts +11 -0
- package/lib/components/TimePicker.js +5 -0
- package/lib/components/Timeline.d.ts +7 -0
- package/lib/components/Timeline.js +5 -0
- package/lib/components/Tooltip.d.ts +7 -0
- package/lib/components/Tooltip.js +5 -0
- package/lib/components/Tour.d.ts +6 -0
- package/lib/components/Tour.js +5 -0
- package/lib/components/Tree.d.ts +22 -0
- package/lib/components/Tree.js +45 -0
- package/lib/components/TreeSelect.d.ts +11 -0
- package/lib/components/TreeSelect.js +5 -0
- package/lib/components/Typography.d.ts +10 -0
- package/lib/components/Typography.js +19 -0
- package/lib/components/Upload.d.ts +18 -0
- package/lib/components/Upload.js +12 -0
- package/lib/components/Watermark.d.ts +13 -0
- package/lib/components/Watermark.js +5 -0
- package/lib/components/message.d.ts +19 -0
- package/lib/components/message.js +32 -0
- package/lib/components/notification.d.ts +19 -0
- package/lib/components/notification.js +28 -0
- package/lib/index.d.ts +219 -0
- package/lib/index.js +123 -0
- package/lib/utils.d.ts +1 -0
- package/lib/utils.js +1 -0
- package/package.json +33 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { HbTimePicker } from '@huibo-ui/react';
|
|
3
|
+
export function TimePicker(props) {
|
|
4
|
+
return _jsx(HbTimePicker, { modelValue: props.value, format: props.format, clearable: props.allowClear, disabled: props.disabled, size: props.size === 'middle' ? 'default' : props.size, placeholder: props.placeholder, style: props.style, onHbChange: (e) => props.onChange?.(e.detail) });
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { HbTooltip } from '@huibo-ui/react';
|
|
3
|
+
export function Tooltip(props) {
|
|
4
|
+
return _jsx(HbTooltip, { content: typeof props.title === 'string' ? props.title : '', position: (props.placement || 'top'), children: props.children });
|
|
5
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface TreeProps {
|
|
3
|
+
treeData?: any[];
|
|
4
|
+
checkable?: boolean;
|
|
5
|
+
checkStrictly?: boolean;
|
|
6
|
+
showIcon?: boolean;
|
|
7
|
+
showLine?: boolean;
|
|
8
|
+
checkedKeys?: any[];
|
|
9
|
+
selectedKeys?: any[];
|
|
10
|
+
expandedKeys?: any[];
|
|
11
|
+
defaultExpandAll?: boolean;
|
|
12
|
+
fieldNames?: {
|
|
13
|
+
title?: string;
|
|
14
|
+
key?: string;
|
|
15
|
+
children?: string;
|
|
16
|
+
};
|
|
17
|
+
onCheck?: (keys: any[]) => void;
|
|
18
|
+
onSelect?: (keys: any[]) => void;
|
|
19
|
+
onExpand?: (keys: any[]) => void;
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
}
|
|
22
|
+
export declare function Tree(props: TreeProps): React.JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { HbTree } from '@huibo-ui/react';
|
|
4
|
+
/**
|
|
5
|
+
* 把节点 title(可能是 React 元素 / JSX)转成纯文本。
|
|
6
|
+
* Stencil hb-tree 无法直接渲染被冻结的 React 元素(会触发
|
|
7
|
+
* "Cannot add property $elm$, object is not extensible"),所以兼容层先把 title 拍平成字符串。
|
|
8
|
+
*/
|
|
9
|
+
const titleToText = (title) => {
|
|
10
|
+
if (title == null || typeof title === 'boolean')
|
|
11
|
+
return '';
|
|
12
|
+
if (typeof title === 'string' || typeof title === 'number')
|
|
13
|
+
return String(title);
|
|
14
|
+
if (typeof title === 'object') {
|
|
15
|
+
const child = title?.props?.children;
|
|
16
|
+
if (typeof child === 'string')
|
|
17
|
+
return child;
|
|
18
|
+
if (typeof child === 'number')
|
|
19
|
+
return String(child);
|
|
20
|
+
if (Array.isArray(child)) {
|
|
21
|
+
return child
|
|
22
|
+
.map((c) => (typeof c === 'string' || typeof c === 'number' ? String(c) : ''))
|
|
23
|
+
.join('');
|
|
24
|
+
}
|
|
25
|
+
return '';
|
|
26
|
+
}
|
|
27
|
+
return '';
|
|
28
|
+
};
|
|
29
|
+
export function Tree(props) {
|
|
30
|
+
const { treeData, fieldNames } = props;
|
|
31
|
+
const titleField = fieldNames?.title || 'title';
|
|
32
|
+
const keyField = fieldNames?.key || 'key';
|
|
33
|
+
const childField = fieldNames?.children || 'children';
|
|
34
|
+
// 1) 适配 fieldNames;2) 把 title(含 React 元素)统一转成字符串,避免 hb-tree 渲染冻结对象
|
|
35
|
+
const normalizedData = React.useMemo(() => {
|
|
36
|
+
const walk = (nodes) => (nodes || []).map((n) => ({
|
|
37
|
+
key: String(n[keyField]),
|
|
38
|
+
title: titleToText(n[titleField]),
|
|
39
|
+
disabled: !!n.disabled,
|
|
40
|
+
...(n[childField] && n[childField].length > 0 ? { children: walk(n[childField]) } : {}),
|
|
41
|
+
}));
|
|
42
|
+
return walk(treeData || []);
|
|
43
|
+
}, [treeData, titleField, keyField, childField]);
|
|
44
|
+
return (_jsx(HbTree, { data: normalizedData, checkable: props.checkable, checkedKeys: props.checkedKeys || [], selectedKeys: props.selectedKeys || [], expandedKeys: props.expandedKeys || [], defaultExpandAll: props.defaultExpandAll, showLine: props.showLine, onHbCheck: (e) => props.onCheck?.(e.detail), onHbSelect: (e) => props.onSelect?.(e.detail), onHbExpand: (e) => props.onExpand?.(e.detail), style: props.style }));
|
|
45
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare function TreeSelect(props: {
|
|
3
|
+
treeData?: any[];
|
|
4
|
+
value?: any;
|
|
5
|
+
onChange?: (value: any) => void;
|
|
6
|
+
multiple?: boolean;
|
|
7
|
+
treeCheckable?: boolean;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { HbTreeSelect } from '@huibo-ui/react';
|
|
3
|
+
export function TreeSelect(props) {
|
|
4
|
+
return _jsx(HbTreeSelect, { data: props.treeData || [], modelValue: props.value, multiple: props.multiple || props.treeCheckable, checkable: props.treeCheckable, placeholder: props.placeholder, disabled: props.disabled, onHbChange: (e) => props.onChange?.(e.detail), style: props.style });
|
|
5
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { HbLink } from '@huibo-ui/react';
|
|
4
|
+
export function Typography(props) {
|
|
5
|
+
return _jsx(_Fragment, { children: props.children });
|
|
6
|
+
}
|
|
7
|
+
Typography.Title = function Title({ children, level }) {
|
|
8
|
+
const tag = level === 1 ? 'h1' : level === 2 ? 'h2' : level === 3 ? 'h3' : level === 4 ? 'h4' : 'h5';
|
|
9
|
+
return React.createElement(tag, null, children);
|
|
10
|
+
};
|
|
11
|
+
Typography.Paragraph = function Paragraph(props) {
|
|
12
|
+
return _jsx("p", { children: props.children });
|
|
13
|
+
};
|
|
14
|
+
Typography.Link = function Link(props) {
|
|
15
|
+
return _jsx(HbLink, { href: props.href, children: props.children });
|
|
16
|
+
};
|
|
17
|
+
Typography.Text = function Text(props) {
|
|
18
|
+
return _jsx("span", { style: { fontWeight: props.strong ? 'bold' : undefined, fontStyle: props.italic ? 'italic' : undefined, textDecoration: props.delete ? 'line-through' : props.underline ? 'underline' : undefined }, children: props.children });
|
|
19
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare function Upload(props: {
|
|
3
|
+
action?: string;
|
|
4
|
+
multiple?: boolean;
|
|
5
|
+
accept?: string;
|
|
6
|
+
maxCount?: number;
|
|
7
|
+
fileList?: any[];
|
|
8
|
+
beforeUpload?: (file: File) => boolean | Promise<boolean>;
|
|
9
|
+
customRequest?: (options: any) => void;
|
|
10
|
+
listType?: 'text' | 'picture' | 'picture-card';
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
onChange?: (info: any) => void;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
style?: React.CSSProperties;
|
|
15
|
+
}): React.JSX.Element;
|
|
16
|
+
export declare namespace Upload {
|
|
17
|
+
var Dragger: any;
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { HbUpload } from '@huibo-ui/react';
|
|
3
|
+
export function Upload(props) {
|
|
4
|
+
return _jsx(HbUpload, { action: props.action, multiple: props.multiple, accept: props.accept, limit: props.maxCount, fileList: props.fileList || [], beforeUpload: props.beforeUpload, customRequest: props.customRequest, listType: props.listType || 'text', disabled: props.disabled, onHbChange: (e) => props.onChange?.({ fileList: e.detail }), style: props.style, children: props.children });
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Upload.Dragger —— 拖拽上传(antd 子组件)。huibo hb-upload 无 drag 形态,
|
|
8
|
+
* 这里复用 Upload(功能可用,无拖拽视觉)。
|
|
9
|
+
*/
|
|
10
|
+
Upload.Dragger = function Dragger(props) {
|
|
11
|
+
return _jsx(Upload, { ...props });
|
|
12
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare function Watermark(props: {
|
|
3
|
+
content?: string;
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
gap?: [number, number];
|
|
7
|
+
rotate?: number;
|
|
8
|
+
font?: {
|
|
9
|
+
color?: string;
|
|
10
|
+
fontSize?: number;
|
|
11
|
+
};
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { HbWatermark } from '@huibo-ui/react';
|
|
3
|
+
export function Watermark(props) {
|
|
4
|
+
return _jsx(HbWatermark, { content: props.content || '', width: props.width, height: props.height, gap: Array.isArray(props.gap) ? props.gap[0] : props.gap, rotate: props.rotate, fontColor: props.font?.color, fontSize: props.font?.fontSize, children: props.children });
|
|
5
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const message: {
|
|
2
|
+
success: (content: any, duration?: number) => {
|
|
3
|
+
close: () => void;
|
|
4
|
+
};
|
|
5
|
+
error: (content: any, duration?: number) => {
|
|
6
|
+
close: () => void;
|
|
7
|
+
};
|
|
8
|
+
warning: (content: any, duration?: number) => {
|
|
9
|
+
close: () => void;
|
|
10
|
+
};
|
|
11
|
+
info: (content: any, duration?: number) => {
|
|
12
|
+
close: () => void;
|
|
13
|
+
};
|
|
14
|
+
loading: (content: any, duration?: number) => {
|
|
15
|
+
close: () => void;
|
|
16
|
+
};
|
|
17
|
+
destroy: () => void;
|
|
18
|
+
config: (_opts: any) => void;
|
|
19
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* antd message 命令式 API 兼容层
|
|
3
|
+
* message.success('保存成功') → 创建 hb-message 并显示
|
|
4
|
+
*/
|
|
5
|
+
let messageCounter = 0;
|
|
6
|
+
function showMessage(type, content, duration) {
|
|
7
|
+
const id = `hb-msg-${++messageCounter}`;
|
|
8
|
+
const div = document.createElement('div');
|
|
9
|
+
div.id = id;
|
|
10
|
+
document.body.appendChild(div);
|
|
11
|
+
// 创建 hb-message 元素
|
|
12
|
+
const el = document.createElement('hb-message');
|
|
13
|
+
el.type = type;
|
|
14
|
+
el.message = typeof content === 'string' ? content : String(content);
|
|
15
|
+
el.duration = duration ?? 3000;
|
|
16
|
+
el.closable = false;
|
|
17
|
+
div.appendChild(el);
|
|
18
|
+
// 等动画结束后移除
|
|
19
|
+
setTimeout(() => { div.remove(); }, (duration ?? 3000) + 500);
|
|
20
|
+
return { close: () => div.remove() };
|
|
21
|
+
}
|
|
22
|
+
export const message = {
|
|
23
|
+
success: (content, duration) => showMessage('success', content, duration),
|
|
24
|
+
error: (content, duration) => showMessage('error', content, duration),
|
|
25
|
+
warning: (content, duration) => showMessage('warning', content, duration),
|
|
26
|
+
info: (content, duration) => showMessage('info', content, duration),
|
|
27
|
+
loading: (content, duration) => showMessage('info', content, duration ?? 0),
|
|
28
|
+
destroy: () => {
|
|
29
|
+
document.querySelectorAll('[id^="hb-msg-"]').forEach(el => el.remove());
|
|
30
|
+
},
|
|
31
|
+
config: (_opts) => { },
|
|
32
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const notification: {
|
|
2
|
+
success: (props: any) => {
|
|
3
|
+
close: () => void;
|
|
4
|
+
};
|
|
5
|
+
error: (props: any) => {
|
|
6
|
+
close: () => void;
|
|
7
|
+
};
|
|
8
|
+
warning: (props: any) => {
|
|
9
|
+
close: () => void;
|
|
10
|
+
};
|
|
11
|
+
info: (props: any) => {
|
|
12
|
+
close: () => void;
|
|
13
|
+
};
|
|
14
|
+
open: (props: any) => {
|
|
15
|
+
close: () => void;
|
|
16
|
+
};
|
|
17
|
+
destroy: () => void;
|
|
18
|
+
config: (_opts: any) => void;
|
|
19
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
let notifCounter = 0;
|
|
2
|
+
function showNotification(type, props) {
|
|
3
|
+
const id = `hb-notif-${++notifCounter}`;
|
|
4
|
+
const div = document.createElement('div');
|
|
5
|
+
div.id = id;
|
|
6
|
+
div.style.cssText = 'position:fixed;top:24px;right:24px;z-index:2000';
|
|
7
|
+
document.body.appendChild(div);
|
|
8
|
+
const el = document.createElement('hb-notification');
|
|
9
|
+
el.type = type;
|
|
10
|
+
el.title = props.message || '';
|
|
11
|
+
el.message = props.description || '';
|
|
12
|
+
el.duration = props.duration ?? 4500;
|
|
13
|
+
el.position = 'top-right';
|
|
14
|
+
div.appendChild(el);
|
|
15
|
+
setTimeout(() => { div.remove(); }, (props.duration ?? 4500) + 500);
|
|
16
|
+
return { close: () => div.remove() };
|
|
17
|
+
}
|
|
18
|
+
export const notification = {
|
|
19
|
+
success: (props) => showNotification('success', props),
|
|
20
|
+
error: (props) => showNotification('error', props),
|
|
21
|
+
warning: (props) => showNotification('warning', props),
|
|
22
|
+
info: (props) => showNotification('info', props),
|
|
23
|
+
open: (props) => showNotification(props.type || 'info', props),
|
|
24
|
+
destroy: () => {
|
|
25
|
+
document.querySelectorAll('[id^="hb-notif-"]').forEach(el => el.remove());
|
|
26
|
+
},
|
|
27
|
+
config: (_opts) => { },
|
|
28
|
+
};
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @huibo-ui/react-antd — antd 兼容层
|
|
3
|
+
*
|
|
4
|
+
* 接收 antd 原生 props(value/onChange/allowClear/dataSource 等),
|
|
5
|
+
* 内部自动转换为 huibo-ui props(modelValue/hbChange/clearable/data 等)。
|
|
6
|
+
* 业务代码保持 antd 写法不变,实现「零改写」迁移。
|
|
7
|
+
*
|
|
8
|
+
* 三层结构:本层(兼容) → @huibo-ui/react(React 包装) → hb-* 自定义元素(Stencil WC)
|
|
9
|
+
*
|
|
10
|
+
* ⚠️ 消费方(应用入口)必须自行:
|
|
11
|
+
* 1. import 'huibo-ui/styles.css' —— 注入 --hb-* 设计令牌
|
|
12
|
+
* 2. import 'huibo-ui/components/hb-xxx' —— 注册用到的自定义元素
|
|
13
|
+
* 否则 hb-* 是 HTMLUnknownElement、令牌为空,导致白屏。
|
|
14
|
+
* (@huibo-ui/react 只造代理组件,不调用 customElements.define。)
|
|
15
|
+
*
|
|
16
|
+
* 用法:
|
|
17
|
+
* import { Button, Input, Select, Table, Form, message } from '@huibo-ui/react-antd';
|
|
18
|
+
* // 与 antd 完全相同的 API,无需改任何 prop
|
|
19
|
+
*
|
|
20
|
+
* 已支持的实例/静态/子 API(详见 docs/guide/migration.md 方案 B 支持矩阵):
|
|
21
|
+
* Form.useForm(转发 hb-form @Method)/ Form.useWatch / useWatch
|
|
22
|
+
* Modal.useModal / Modal.confirm/info/warning/success/error
|
|
23
|
+
* message.* / Empty.PRESENTED_IMAGE_* / DatePicker.RangePicker
|
|
24
|
+
* Input.{TextArea,Search,Password} / Select.{Option,OptGroup}
|
|
25
|
+
* Radio.{Group,Button} / Checkbox.Group / Descriptions.Item / Space.Compact
|
|
26
|
+
* Upload.Dragger / Skeleton.{Input,Button} / Layout.{Header,Sider,Content}
|
|
27
|
+
* 类型:ColumnsType / TableProps / TableRowSelection / Rule / RuleObject / TreeDataNode ...
|
|
28
|
+
*/
|
|
29
|
+
export type SizeType = 'small' | 'middle' | 'large';
|
|
30
|
+
/** antd size → huibo-ui size(middle → default) */
|
|
31
|
+
export declare function mapSize(size?: SizeType): 'small' | 'default' | 'large';
|
|
32
|
+
/** 通用 antd 事件 → huibo-ui 事件适配器 */
|
|
33
|
+
export declare function adaptOnChange<T>(onChange?: (value: T) => void): ((e: CustomEvent) => void) | undefined;
|
|
34
|
+
export { Button } from './components/Button';
|
|
35
|
+
export { Input, TextArea } from './components/Input';
|
|
36
|
+
export { InputNumber } from './components/InputNumber';
|
|
37
|
+
export { Select } from './components/Select';
|
|
38
|
+
export { Switch } from './components/Switch';
|
|
39
|
+
export { Checkbox, CheckboxGroup } from './components/Checkbox';
|
|
40
|
+
export { Radio, RadioGroup } from './components/Radio';
|
|
41
|
+
export { Table } from './components/Table';
|
|
42
|
+
export { Form, FormItem } from './components/Form';
|
|
43
|
+
export { Modal } from './components/Modal';
|
|
44
|
+
export { Drawer } from './components/Drawer';
|
|
45
|
+
export { Menu } from './components/Menu';
|
|
46
|
+
export { Tabs } from './components/Tabs';
|
|
47
|
+
export { Steps } from './components/Steps';
|
|
48
|
+
export { DatePicker } from './components/DatePicker';
|
|
49
|
+
export { Upload } from './components/Upload';
|
|
50
|
+
export { Tooltip } from './components/Tooltip';
|
|
51
|
+
export { Popover } from './components/Popover';
|
|
52
|
+
export { Popconfirm } from './components/Popconfirm';
|
|
53
|
+
export { Dropdown } from './components/Dropdown';
|
|
54
|
+
export { Tag } from './components/Tag';
|
|
55
|
+
export { Badge } from './components/Badge';
|
|
56
|
+
export { Avatar } from './components/Avatar';
|
|
57
|
+
export { Card } from './components/Card';
|
|
58
|
+
export { Alert } from './components/Alert';
|
|
59
|
+
export { Divider } from './components/Divider';
|
|
60
|
+
export { Empty } from './components/Empty';
|
|
61
|
+
export { Spin } from './components/Spin';
|
|
62
|
+
export { Space } from './components/Space';
|
|
63
|
+
export { Pagination } from './components/Pagination';
|
|
64
|
+
export { Progress } from './components/Progress';
|
|
65
|
+
export { Descriptions } from './components/Descriptions';
|
|
66
|
+
export { Collapse } from './components/Collapse';
|
|
67
|
+
export { Rate } from './components/Rate';
|
|
68
|
+
export { Slider } from './components/Slider';
|
|
69
|
+
export { Image } from './components/Image';
|
|
70
|
+
export { Tree } from './components/Tree';
|
|
71
|
+
export { TreeSelect } from './components/TreeSelect';
|
|
72
|
+
export { Cascader } from './components/Cascader';
|
|
73
|
+
export { ConfigProvider } from './components/ConfigProvider';
|
|
74
|
+
export { Layout, Row, Col } from './components/Layout';
|
|
75
|
+
export { message } from './components/message';
|
|
76
|
+
export { notification } from './components/notification';
|
|
77
|
+
export type { ColumnType as ColumnsType, ColumnType as TableColumnsType, TableProps, ColumnType } from './components/Table';
|
|
78
|
+
export type MenuProps = {
|
|
79
|
+
items?: any[];
|
|
80
|
+
mode?: 'horizontal' | 'vertical' | 'inline';
|
|
81
|
+
selectedKeys?: string[];
|
|
82
|
+
theme?: 'light' | 'dark';
|
|
83
|
+
onClick?: (info: {
|
|
84
|
+
key: string;
|
|
85
|
+
keyPath: string[];
|
|
86
|
+
}) => void;
|
|
87
|
+
};
|
|
88
|
+
export type TreeProps = {
|
|
89
|
+
treeData?: any[];
|
|
90
|
+
checkable?: boolean;
|
|
91
|
+
checkedKeys?: any[];
|
|
92
|
+
};
|
|
93
|
+
export type UploadFile = {
|
|
94
|
+
name: string;
|
|
95
|
+
size?: number;
|
|
96
|
+
type?: string;
|
|
97
|
+
url?: string;
|
|
98
|
+
status?: 'ready' | 'uploading' | 'success' | 'error';
|
|
99
|
+
};
|
|
100
|
+
export type AnyObject = Record<string, any>;
|
|
101
|
+
export type RuleObject = {
|
|
102
|
+
required?: boolean;
|
|
103
|
+
message?: React.ReactNode;
|
|
104
|
+
type?: 'string' | 'number' | 'boolean' | 'email' | 'url' | 'date';
|
|
105
|
+
pattern?: RegExp | string;
|
|
106
|
+
min?: number;
|
|
107
|
+
max?: number;
|
|
108
|
+
len?: number;
|
|
109
|
+
enum?: Array<string | number>;
|
|
110
|
+
whitespace?: boolean;
|
|
111
|
+
validator?: (value: any, rules?: any) => void | Promise<void>;
|
|
112
|
+
transform?: (value: any) => any;
|
|
113
|
+
trigger?: string;
|
|
114
|
+
};
|
|
115
|
+
export type Rule = RuleObject;
|
|
116
|
+
export type TreeDataNode = {
|
|
117
|
+
key?: string | number;
|
|
118
|
+
title?: React.ReactNode;
|
|
119
|
+
value?: string | number;
|
|
120
|
+
children?: TreeDataNode[];
|
|
121
|
+
disabled?: boolean;
|
|
122
|
+
selectable?: boolean;
|
|
123
|
+
[key: string]: any;
|
|
124
|
+
};
|
|
125
|
+
export type CollapseProps = {
|
|
126
|
+
activeKey?: string | string[];
|
|
127
|
+
defaultActiveKey?: string | string[];
|
|
128
|
+
accordion?: boolean;
|
|
129
|
+
onChange?: (key: string | string[]) => void;
|
|
130
|
+
bordered?: boolean;
|
|
131
|
+
ghost?: boolean;
|
|
132
|
+
items?: Array<{
|
|
133
|
+
key: string;
|
|
134
|
+
label?: React.ReactNode;
|
|
135
|
+
children?: React.ReactNode;
|
|
136
|
+
disabled?: boolean;
|
|
137
|
+
}>;
|
|
138
|
+
};
|
|
139
|
+
export type TabsProps = {
|
|
140
|
+
activeKey?: string;
|
|
141
|
+
defaultActiveKey?: string;
|
|
142
|
+
items?: Array<{
|
|
143
|
+
key: string;
|
|
144
|
+
label?: React.ReactNode;
|
|
145
|
+
children?: React.ReactNode;
|
|
146
|
+
disabled?: boolean;
|
|
147
|
+
}>;
|
|
148
|
+
onChange?: (key: string) => void;
|
|
149
|
+
type?: 'line' | 'card';
|
|
150
|
+
size?: 'large' | 'default' | 'small';
|
|
151
|
+
tabPosition?: 'top' | 'bottom' | 'left' | 'right';
|
|
152
|
+
};
|
|
153
|
+
export type UploadProps = {
|
|
154
|
+
action?: string;
|
|
155
|
+
multiple?: boolean;
|
|
156
|
+
accept?: string;
|
|
157
|
+
disabled?: boolean;
|
|
158
|
+
limit?: number;
|
|
159
|
+
drag?: boolean;
|
|
160
|
+
name?: string;
|
|
161
|
+
headers?: Record<string, string>;
|
|
162
|
+
data?: Record<string, any>;
|
|
163
|
+
withCredentials?: boolean;
|
|
164
|
+
beforeUpload?: (file: any, fileList: any[]) => boolean | Promise<any>;
|
|
165
|
+
fileList?: UploadFile[];
|
|
166
|
+
listType?: 'text' | 'picture' | 'picture-card';
|
|
167
|
+
customRequest?: (options: any) => void;
|
|
168
|
+
onPreview?: (file: any) => void;
|
|
169
|
+
onRemove?: (file: any) => void | Promise<any>;
|
|
170
|
+
onChange?: (info: any) => void;
|
|
171
|
+
};
|
|
172
|
+
export declare const zhCN: {
|
|
173
|
+
locale: string;
|
|
174
|
+
};
|
|
175
|
+
export type DataNode = {
|
|
176
|
+
key: string | number;
|
|
177
|
+
title?: React.ReactNode;
|
|
178
|
+
children?: DataNode[];
|
|
179
|
+
disabled?: boolean;
|
|
180
|
+
};
|
|
181
|
+
export type DirectoryTreeProps = TreeProps;
|
|
182
|
+
export type TableRowSelection<T = any> = {
|
|
183
|
+
type?: 'checkbox' | 'radio';
|
|
184
|
+
selectedRowKeys?: React.Key[];
|
|
185
|
+
onChange?: (selectedRowKeys: React.Key[], selectedRows: T[]) => void;
|
|
186
|
+
getCheckboxProps?: (record: T) => {
|
|
187
|
+
disabled?: boolean;
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
import React from 'react';
|
|
191
|
+
export declare function useWatch(namePath: string | string[], form?: any): any;
|
|
192
|
+
export { App } from './components/App';
|
|
193
|
+
export type ThemeConfig = {
|
|
194
|
+
token?: Record<string, any>;
|
|
195
|
+
algorithm?: string;
|
|
196
|
+
components?: Record<string, any>;
|
|
197
|
+
};
|
|
198
|
+
export type TimeRangePickerProps = {
|
|
199
|
+
value?: any;
|
|
200
|
+
onChange?: (value: any) => void;
|
|
201
|
+
format?: string;
|
|
202
|
+
allowClear?: boolean;
|
|
203
|
+
};
|
|
204
|
+
export { Skeleton } from './components/Skeleton';
|
|
205
|
+
export { Statistic } from './components/Statistic';
|
|
206
|
+
export { Result } from './components/Result';
|
|
207
|
+
export { Timeline } from './components/Timeline';
|
|
208
|
+
export { PageHeader } from './components/PageHeader';
|
|
209
|
+
export { Segmented } from './components/Segmented';
|
|
210
|
+
export { FloatButton } from './components/FloatButton';
|
|
211
|
+
export { Anchor } from './components/Anchor';
|
|
212
|
+
export { Tour } from './components/Tour';
|
|
213
|
+
export { Watermark } from './components/Watermark';
|
|
214
|
+
export { Affix } from './components/Affix';
|
|
215
|
+
export { BackTop } from './components/BackTop';
|
|
216
|
+
export { Breadcrumb } from './components/Breadcrumb';
|
|
217
|
+
export { Typography } from './components/Typography';
|
|
218
|
+
export { QRCode } from './components/QRCode';
|
|
219
|
+
export { TimePicker } from './components/TimePicker';
|