weifuwu 0.61.2 → 0.63.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/README.md +168 -11
- package/dist/client/diff.d.ts +13 -1
- package/dist/client/index.js +3 -3
- package/dist/client/popup.d.ts +22 -0
- package/dist/client/types.d.ts +63 -0
- package/dist/client/ui.d.ts +6 -0
- package/dist/components/Accordion/Accordion.d.ts +9 -0
- package/dist/components/Affix/Affix.d.ts +16 -0
- package/dist/components/AspectRatio/AspectRatio.d.ts +10 -0
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +21 -0
- package/dist/components/BackTop/BackTop.d.ts +16 -0
- package/dist/components/Calendar/Calendar.d.ts +21 -0
- package/dist/components/Carousel/Carousel.d.ts +17 -0
- package/dist/components/Cascader/Cascader.d.ts +21 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +23 -0
- package/dist/components/CodeBlock/CodeBlock.d.ts +14 -0
- package/dist/components/Collapse/Collapse.d.ts +28 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts +16 -0
- package/dist/components/Command/Command.d.ts +22 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +17 -0
- package/dist/components/CopyButton/CopyButton.d.ts +18 -0
- package/dist/components/Descriptions/Descriptions.d.ts +21 -0
- package/dist/components/Highlight/Highlight.d.ts +13 -0
- package/dist/components/HoverCard/HoverCard.d.ts +16 -0
- package/dist/components/Icon/Icon.d.ts +1 -1
- package/dist/components/Img/Img.d.ts +4 -0
- package/dist/components/InView/InView.d.ts +1 -1
- package/dist/components/InfiniteScroll/InfiniteScroll.d.ts +15 -0
- package/dist/components/InputNumber/InputNumber.d.ts +25 -0
- package/dist/components/Label/Label.d.ts +11 -0
- package/dist/components/List/List.d.ts +18 -0
- package/dist/components/Markdown/Markdown.d.ts +14 -0
- package/dist/components/Markdown/parser.d.ts +32 -0
- package/dist/components/Mentions/Mentions.d.ts +19 -0
- package/dist/components/Menu/Menu.d.ts +25 -0
- package/dist/components/Menubar/Menubar.d.ts +22 -0
- package/dist/components/MessageBubble/MessageBubble.d.ts +20 -0
- package/dist/components/Notification/Notification.d.ts +70 -0
- package/dist/components/PasswordInput/PasswordInput.d.ts +21 -0
- package/dist/components/PinInput/PinInput.d.ts +18 -0
- package/dist/components/QRCode/QRCode.d.ts +20 -0
- package/dist/components/QRCode/qr.d.ts +15 -0
- package/dist/components/Rate/Rate.d.ts +16 -0
- package/dist/components/Resizable/Resizable.d.ts +18 -0
- package/dist/components/Result/Result.d.ts +17 -0
- package/dist/components/Select/Select.d.ts +4 -2
- package/dist/components/Table/Table.d.ts +10 -0
- package/dist/components/TagsInput/TagsInput.d.ts +21 -0
- package/dist/components/Timeline/Timeline.d.ts +25 -0
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +33 -0
- package/dist/components/Transfer/Transfer.d.ts +18 -0
- package/dist/components/Tree/Tree.d.ts +27 -0
- package/dist/components/Typography/Typography.d.ts +39 -0
- package/dist/components/VirtualList/VirtualList.d.ts +21 -0
- package/dist/components/Watermark/Watermark.d.ts +19 -0
- package/dist/components/index.d.ts +85 -0
- package/dist/components/index.js +14 -1
- package/dist/components/style.css +4824 -2211
- package/dist/db/postgres/connection.d.ts +24 -3
- package/dist/db/postgres/pool.d.ts +30 -8
- package/dist/db/redis/client.d.ts +43 -0
- package/dist/db/redis/connection.d.ts +12 -0
- package/dist/db/redis/pipeline.d.ts +26 -0
- package/dist/db/redis/pool.d.ts +27 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1055 -94
- package/dist/layout/weifuwu-layout.css +11 -1
- package/dist/postgres/types.d.ts +2 -1
- package/dist/redis/types.d.ts +6 -0
- package/dist/scheduler/cron.d.ts +26 -0
- package/dist/scheduler/index.d.ts +69 -0
- package/package.json +2 -4
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Component } from '../../client/vnode.ts';
|
|
2
|
+
export interface MenubarItem {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: any;
|
|
6
|
+
shortcut?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
onSelect?: () => void;
|
|
9
|
+
}
|
|
10
|
+
export interface MenubarMenu {
|
|
11
|
+
key: string;
|
|
12
|
+
label: string;
|
|
13
|
+
items?: MenubarItem[];
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface MenubarProps {
|
|
17
|
+
menus?: MenubarMenu[];
|
|
18
|
+
'aria-label'?: string;
|
|
19
|
+
}
|
|
20
|
+
/** 水平菜单栏(对应 shadcn Menubar):trigger 点击展开下拉,←→ 切换菜单,Escape 关闭。
|
|
21
|
+
* 裁剪:hover 展开、子菜单、可拖拽菜单。 */
|
|
22
|
+
export declare const Menubar: Component<MenubarProps>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* weifuwu/components — MessageBubble
|
|
3
|
+
*
|
|
4
|
+
* 独立消息气泡(从 AiChat 气泡层抽取,业务聊天页复用)。
|
|
5
|
+
* 复用 layout 的 wf-bubble 原语:user → --own,assistant → --ai。
|
|
6
|
+
* content 支持文本或任意 VNode(可与 Markdown 组合)。
|
|
7
|
+
* 裁剪:不做打字指示动画(Loading 已有)。
|
|
8
|
+
*/
|
|
9
|
+
import type { Component } from '../../client/vnode.ts';
|
|
10
|
+
export type MessageBubbleRole = 'user' | 'assistant';
|
|
11
|
+
export type MessageBubbleStatus = 'complete' | 'streaming' | 'error';
|
|
12
|
+
export interface MessageBubbleProps {
|
|
13
|
+
content: any;
|
|
14
|
+
role: MessageBubbleRole;
|
|
15
|
+
status?: MessageBubbleStatus;
|
|
16
|
+
/** 气泡尾部操作区(重试/复制按钮等,VNode 或数组) */
|
|
17
|
+
actions?: any;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare const MessageBubble: Component<MessageBubbleProps>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { Component } from '../../client/vnode.ts';
|
|
2
|
+
import type { AppMiddleware } from '../../client/types.ts';
|
|
3
|
+
export type NotificationType = 'success' | 'error' | 'info' | 'warning';
|
|
4
|
+
export type NotificationPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
|
|
5
|
+
export interface NotificationItem {
|
|
6
|
+
id: string;
|
|
7
|
+
type: NotificationType;
|
|
8
|
+
title: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
/** 自动关闭时间(ms),0 = 不自动关闭,默认 4500 */
|
|
11
|
+
duration?: number;
|
|
12
|
+
action?: {
|
|
13
|
+
label: string;
|
|
14
|
+
onClick: () => void;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export interface NotificationProps {
|
|
18
|
+
items?: NotificationItem[];
|
|
19
|
+
onRemove?: (id: string) => void;
|
|
20
|
+
position?: NotificationPosition;
|
|
21
|
+
/** 全局默认自动关闭时间(ms),默认 4500 */
|
|
22
|
+
duration?: number;
|
|
23
|
+
/** 最大显示条数,超出移除最早,默认 0 = 不限制 */
|
|
24
|
+
max?: number;
|
|
25
|
+
}
|
|
26
|
+
export interface NotificationOptions {
|
|
27
|
+
position?: NotificationPosition;
|
|
28
|
+
duration?: number;
|
|
29
|
+
max?: number;
|
|
30
|
+
}
|
|
31
|
+
/** 通知(对应 antd/EP Notification 队列式):title + description + icon + 操作,聚合角落 */
|
|
32
|
+
export declare const Notification: Component<NotificationProps>;
|
|
33
|
+
export interface NotificationInjected {
|
|
34
|
+
notification: {
|
|
35
|
+
(title: string, opts?: {
|
|
36
|
+
type?: NotificationType;
|
|
37
|
+
description?: string;
|
|
38
|
+
duration?: number;
|
|
39
|
+
action?: NotificationItem['action'];
|
|
40
|
+
}): void;
|
|
41
|
+
open: (opts: {
|
|
42
|
+
type?: NotificationType;
|
|
43
|
+
title: string;
|
|
44
|
+
description?: string;
|
|
45
|
+
duration?: number;
|
|
46
|
+
action?: NotificationItem['action'];
|
|
47
|
+
}) => void;
|
|
48
|
+
success: (opts: {
|
|
49
|
+
title: string;
|
|
50
|
+
description?: string;
|
|
51
|
+
duration?: number;
|
|
52
|
+
}) => void;
|
|
53
|
+
error: (opts: {
|
|
54
|
+
title: string;
|
|
55
|
+
description?: string;
|
|
56
|
+
duration?: number;
|
|
57
|
+
}) => void;
|
|
58
|
+
info: (opts: {
|
|
59
|
+
title: string;
|
|
60
|
+
description?: string;
|
|
61
|
+
duration?: number;
|
|
62
|
+
}) => void;
|
|
63
|
+
warning: (opts: {
|
|
64
|
+
title: string;
|
|
65
|
+
description?: string;
|
|
66
|
+
duration?: number;
|
|
67
|
+
}) => void;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export declare function notification(opts?: NotificationOptions): AppMiddleware<{}, NotificationInjected>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* weifuwu/components — PasswordInput
|
|
3
|
+
*
|
|
4
|
+
* 密码输入:眼睛按钮切换可见性。Input 子集(label/error/hint/required/autoComplete 透传)。
|
|
5
|
+
*/
|
|
6
|
+
import type { Component } from '../../client/vnode.ts';
|
|
7
|
+
export interface PasswordInputProps {
|
|
8
|
+
value?: string;
|
|
9
|
+
onInput?: (e: Event) => void;
|
|
10
|
+
onChange?: (e: Event) => void;
|
|
11
|
+
label?: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
error?: string;
|
|
16
|
+
hint?: string;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
autoComplete?: string;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare const PasswordInput: Component<PasswordInputProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Component } from '../../client/vnode.ts';
|
|
2
|
+
export interface PinInputProps {
|
|
3
|
+
/** 位数,默认 6 */
|
|
4
|
+
length?: number;
|
|
5
|
+
/** 受控完整值(如 '483920') */
|
|
6
|
+
value?: string;
|
|
7
|
+
onChange?: (value: string) => void;
|
|
8
|
+
/** number = 纯数字(默认);text = 任意字符 */
|
|
9
|
+
type?: 'number' | 'text';
|
|
10
|
+
size?: 'sm' | 'md' | 'lg';
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
'aria-label'?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 验证码输入(对应 shadcn InputOTP / antd 无):自动聚焦下一格、粘贴分派、
|
|
16
|
+
* Backspace 回退、方向键移动。受控 value 为完整字符串。
|
|
17
|
+
*/
|
|
18
|
+
export declare const PinInput: Component<PinInputProps>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Component } from '../../client/vnode.ts';
|
|
2
|
+
import type { QrEcLevel } from './qr.ts';
|
|
3
|
+
export interface QRCodeProps {
|
|
4
|
+
/** 二维码内容(URL/文本) */
|
|
5
|
+
value: string;
|
|
6
|
+
/** 纠错级别,默认 M */
|
|
7
|
+
ecLevel?: QrEcLevel;
|
|
8
|
+
/** 渲染尺寸(px),默认 128 */
|
|
9
|
+
size?: number;
|
|
10
|
+
/** 静默区模块数,默认 4 */
|
|
11
|
+
quietZone?: number;
|
|
12
|
+
/** 模块颜色,默认 currentColor */
|
|
13
|
+
color?: string;
|
|
14
|
+
/** 背景色(填充静默区),默认 transparent */
|
|
15
|
+
bgColor?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
/** 二维码(对应 antd QRCode):自研 QR 编码器(版本 1-6,字节模式,8 掩码)→ SVG 渲染。
|
|
19
|
+
* 零依赖(Reed-Solomon GF(256) 自实现)。 */
|
|
20
|
+
export declare const QRCode: Component<QRCodeProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* weifuwu QR 编码器(零依赖自研)
|
|
3
|
+
*
|
|
4
|
+
* 支持:版本 1-6(17-41 模块)、纠错 L/M/Q/H、字节模式、8 掩码惩罚分自动选择。
|
|
5
|
+
* 裁剪:版本 7+(需版本信息模块)、数字/字母模式、Kanji、多字节 UTF-8 之外编码。
|
|
6
|
+
*/
|
|
7
|
+
export type QrEcLevel = 'L' | 'M' | 'Q' | 'H';
|
|
8
|
+
export interface QrMatrix {
|
|
9
|
+
size: number;
|
|
10
|
+
version: number;
|
|
11
|
+
level: QrEcLevel;
|
|
12
|
+
mask: number;
|
|
13
|
+
matrix: boolean[][];
|
|
14
|
+
}
|
|
15
|
+
export declare function generateQr(text: string, level?: QrEcLevel): QrMatrix;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Component } from '../../client/vnode.ts';
|
|
2
|
+
export interface RateProps {
|
|
3
|
+
/** 当前评分值(0..count) */
|
|
4
|
+
value?: number;
|
|
5
|
+
onChange?: (value: number) => void;
|
|
6
|
+
/** 星星总数,默认 5 */
|
|
7
|
+
count?: number;
|
|
8
|
+
size?: 'sm' | 'md' | 'lg';
|
|
9
|
+
/** 只读(展示态,不可交互、不可聚焦) */
|
|
10
|
+
readOnly?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** 点击当前评分值 → 清除为 0(antd 对齐) */
|
|
13
|
+
allowClear?: boolean;
|
|
14
|
+
'aria-label'?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const Rate: Component<RateProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Component } from '../../client/vnode.ts';
|
|
2
|
+
export interface ResizableProps {
|
|
3
|
+
/** horizontal 左右分割(默认)/ vertical 上下分割 */
|
|
4
|
+
direction?: 'horizontal' | 'vertical';
|
|
5
|
+
/** 第一面板初始尺寸(px) */
|
|
6
|
+
defaultSize?: number;
|
|
7
|
+
/** 最小尺寸(px),默认 80 */
|
|
8
|
+
min?: number;
|
|
9
|
+
/** 最大尺寸(px),默认 80% 视口 */
|
|
10
|
+
max?: number;
|
|
11
|
+
/** 键盘步进(px),默认 20 */
|
|
12
|
+
step?: number;
|
|
13
|
+
children: [any, any];
|
|
14
|
+
onResize?: (size: number) => void;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/** 可拖拽分割面板(对应 shadcn Resizable):两面板 + 拖拽手柄(pointer + 键盘方向键)。 */
|
|
18
|
+
export declare const Resizable: Component<ResizableProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* weifuwu/components — Result
|
|
3
|
+
*
|
|
4
|
+
* 结果页:status + title + desc + extra(操作按钮区)。
|
|
5
|
+
* 用于注册完成/操作成功/404/403 页。
|
|
6
|
+
* 裁剪:不做内置路由跳转(页面自身处理)。
|
|
7
|
+
*/
|
|
8
|
+
import type { Component } from '../../client/vnode.ts';
|
|
9
|
+
export type ResultStatus = 'success' | 'error' | 'warning' | 'info';
|
|
10
|
+
export interface ResultProps {
|
|
11
|
+
status?: ResultStatus;
|
|
12
|
+
title: any;
|
|
13
|
+
desc?: any;
|
|
14
|
+
extra?: any;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const Result: Component<ResultProps>;
|
|
@@ -6,16 +6,18 @@ export interface SelectOption {
|
|
|
6
6
|
}
|
|
7
7
|
export interface SelectProps {
|
|
8
8
|
label?: string;
|
|
9
|
-
value?: string;
|
|
9
|
+
value?: string | string[];
|
|
10
10
|
options?: SelectOption[];
|
|
11
11
|
placeholder?: string;
|
|
12
12
|
required?: boolean;
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
error?: string;
|
|
15
|
-
onChange?: (value: string) => void;
|
|
15
|
+
onChange?: (value: string | string[]) => void;
|
|
16
16
|
children?: any;
|
|
17
17
|
/** 启用搜索过滤 */
|
|
18
18
|
searchable?: boolean;
|
|
19
|
+
/** 多选模式(searchable 下生效;value/onChange 为数组) */
|
|
20
|
+
multiple?: boolean;
|
|
19
21
|
/** 异步搜索回调,返回值作为新选项列表 */
|
|
20
22
|
onSearch?: (keyword: string) => SelectOption[] | Promise<SelectOption[]>;
|
|
21
23
|
}
|
|
@@ -10,6 +10,14 @@ export interface TableColumn {
|
|
|
10
10
|
/** 自定义渲染 */
|
|
11
11
|
render?: (value: any, row: any, index: number) => any;
|
|
12
12
|
}
|
|
13
|
+
export interface TableRowSelection {
|
|
14
|
+
/** 受控选中行 keys */
|
|
15
|
+
selectedRowKeys?: (string | number)[];
|
|
16
|
+
/** 选中变化回调(全选/取消全选/行点击) */
|
|
17
|
+
onChange?: (keys: (string | number)[], rows: any[]) => void;
|
|
18
|
+
/** 行 key 字段,默认 'id' */
|
|
19
|
+
rowKey?: string;
|
|
20
|
+
}
|
|
13
21
|
export interface TableProps {
|
|
14
22
|
data?: any[];
|
|
15
23
|
columns: TableColumn[];
|
|
@@ -20,6 +28,8 @@ export interface TableProps {
|
|
|
20
28
|
sortOrder?: 'asc' | 'desc';
|
|
21
29
|
/** 排序变化回调 */
|
|
22
30
|
onSort?: (key: string, order: 'asc' | 'desc') => void;
|
|
31
|
+
/** 行选择(受控) */
|
|
32
|
+
rowSelection?: TableRowSelection;
|
|
23
33
|
/** 数据为空时显示的文本 */
|
|
24
34
|
emptyText?: string;
|
|
25
35
|
/** 表格最小宽度(窄屏横向滚动,如 '720px') */
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* weifuwu/components — TagsInput
|
|
3
|
+
*
|
|
4
|
+
* 标签输入:回车/逗号添加、Backspace 删除、去重、maxTags 限制。
|
|
5
|
+
* 中文输入法 composition 感知(输入法候选词确认的 Enter 不触发添加)。
|
|
6
|
+
* 裁剪:不做下拉建议(组合 Select searchable)。
|
|
7
|
+
*/
|
|
8
|
+
import type { Component } from '../../client/vnode.ts';
|
|
9
|
+
export interface TagsInputProps {
|
|
10
|
+
value?: string[];
|
|
11
|
+
onChange?: (tags: string[]) => void;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
maxTags?: number;
|
|
14
|
+
allowDuplicates?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
label?: string;
|
|
17
|
+
error?: string;
|
|
18
|
+
hint?: string;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare const TagsInput: Component<TagsInputProps>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* weifuwu/components — Timeline
|
|
3
|
+
*
|
|
4
|
+
* 竖向时间线:节点(状态色圆点/自定义)+ 标题 + 时间 + 内容 + 连接线。
|
|
5
|
+
* 用于执行日志、审批历史、审计记录。
|
|
6
|
+
* 裁剪:不做横向时间线/折叠节点(见 roadmap)。
|
|
7
|
+
*/
|
|
8
|
+
import type { Component } from '../../client/vnode.ts';
|
|
9
|
+
export type TimelineStatus = 'default' | 'info' | 'success' | 'warning' | 'error';
|
|
10
|
+
export interface TimelineItem {
|
|
11
|
+
key: string;
|
|
12
|
+
title: any;
|
|
13
|
+
time?: string;
|
|
14
|
+
content?: any;
|
|
15
|
+
status?: TimelineStatus;
|
|
16
|
+
/** 自定义节点内容(覆盖状态圆点) */
|
|
17
|
+
dot?: any;
|
|
18
|
+
onClick?: () => void;
|
|
19
|
+
}
|
|
20
|
+
export interface TimelineProps {
|
|
21
|
+
items: TimelineItem[];
|
|
22
|
+
mode?: 'left' | 'alternate';
|
|
23
|
+
reverse?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare const Timeline: Component<TimelineProps>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Component } from '../../client/vnode.ts';
|
|
2
|
+
export interface ToggleProps {
|
|
3
|
+
/** 按下状态(受控) */
|
|
4
|
+
pressed?: boolean;
|
|
5
|
+
onPressedChange?: (pressed: boolean) => void;
|
|
6
|
+
variant?: 'default' | 'outline';
|
|
7
|
+
size?: 'sm' | 'md' | 'lg';
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
'aria-label'?: string;
|
|
10
|
+
children?: any;
|
|
11
|
+
className?: string;
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
14
|
+
export interface ToggleGroupOption {
|
|
15
|
+
value: string;
|
|
16
|
+
label?: any;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface ToggleGroupProps {
|
|
20
|
+
/** single 单选 / multiple 多选(shadcn 对齐) */
|
|
21
|
+
type?: 'single' | 'multiple';
|
|
22
|
+
value?: string | string[];
|
|
23
|
+
onChange?: (value: string | string[]) => void;
|
|
24
|
+
options?: ToggleGroupOption[];
|
|
25
|
+
size?: 'sm' | 'md' | 'lg';
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
'aria-label'?: string;
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
/** 单个切换按钮(对应 shadcn Toggle):加粗/斜体/视图切换等 */
|
|
31
|
+
export declare const Toggle: Component<ToggleProps>;
|
|
32
|
+
/** 切换按钮组(对应 shadcn ToggleGroup):type=single 单选 / multiple 多选 */
|
|
33
|
+
export declare const ToggleGroup: Component<ToggleGroupProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Component } from '../../client/vnode.ts';
|
|
2
|
+
export interface TransferItem {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface TransferProps {
|
|
8
|
+
data?: TransferItem[];
|
|
9
|
+
/** 目标侧已选 keys */
|
|
10
|
+
targetKeys?: string[];
|
|
11
|
+
onChange?: (targetKeys: string[]) => void;
|
|
12
|
+
titles?: [string, string];
|
|
13
|
+
size?: 'sm' | 'md' | 'lg';
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** 穿梭框(对应 antd/EP Transfer):双列表 + 中间穿梭按钮。
|
|
17
|
+
* 裁剪:搜索过滤、拖拽排序、自定义渲染。 */
|
|
18
|
+
export declare const Transfer: Component<TransferProps>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Component } from '../../client/vnode.ts';
|
|
2
|
+
export interface TreeNode {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
children?: TreeNode[];
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
icon?: any;
|
|
8
|
+
}
|
|
9
|
+
export interface TreeProps {
|
|
10
|
+
data?: TreeNode[];
|
|
11
|
+
/** 受控选中 keys */
|
|
12
|
+
selectedKeys?: string[];
|
|
13
|
+
onSelect?: (keys: string[]) => void;
|
|
14
|
+
/** 受控展开 keys */
|
|
15
|
+
expandedKeys?: string[];
|
|
16
|
+
onExpand?: (keys: string[]) => void;
|
|
17
|
+
/** 勾选模式(父子联动,antd 非 strict 语义) */
|
|
18
|
+
checkable?: boolean;
|
|
19
|
+
checkedKeys?: string[];
|
|
20
|
+
onCheck?: (keys: string[]) => void;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 树形(对应 antd/EP Tree):递归节点 + 展开/折叠 + 单选 + 勾选(父子联动 +
|
|
25
|
+
* indeterminate 半选态)。裁剪:拖拽、异步加载、搜索过滤。
|
|
26
|
+
*/
|
|
27
|
+
export declare const Tree: Component<TreeProps>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Component } from '../../client/vnode.ts';
|
|
2
|
+
export type TextType = 'secondary' | 'success' | 'warning' | 'danger';
|
|
3
|
+
export interface TitleProps {
|
|
4
|
+
/** 1-5,默认 1(h1-h5) */
|
|
5
|
+
level?: 1 | 2 | 3 | 4 | 5;
|
|
6
|
+
children?: any;
|
|
7
|
+
className?: string;
|
|
8
|
+
style?: Record<string, string>;
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}
|
|
11
|
+
export interface TextProps {
|
|
12
|
+
type?: TextType;
|
|
13
|
+
strong?: boolean;
|
|
14
|
+
underline?: boolean;
|
|
15
|
+
/** 删除线 */
|
|
16
|
+
strikethrough?: boolean;
|
|
17
|
+
/** 高亮底色 */
|
|
18
|
+
mark?: boolean;
|
|
19
|
+
/** 行内代码 */
|
|
20
|
+
code?: boolean;
|
|
21
|
+
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
22
|
+
children?: any;
|
|
23
|
+
className?: string;
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
}
|
|
26
|
+
export interface ParagraphProps {
|
|
27
|
+
type?: TextType;
|
|
28
|
+
/** 单行截断(ellipsis) */
|
|
29
|
+
ellipsis?: boolean;
|
|
30
|
+
children?: any;
|
|
31
|
+
className?: string;
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
}
|
|
34
|
+
/** 标题(对应 antd/EP Typography.Title) */
|
|
35
|
+
export declare const Title: Component<TitleProps>;
|
|
36
|
+
/** 行内文本(对应 antd/EP Typography.Text) */
|
|
37
|
+
export declare const Text: Component<TextProps>;
|
|
38
|
+
/** 段落(对应 antd/EP Typography.Paragraph) */
|
|
39
|
+
export declare const Paragraph: Component<ParagraphProps>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Component } from '../../client/vnode.ts';
|
|
2
|
+
export interface VirtualListProps {
|
|
3
|
+
items?: any[];
|
|
4
|
+
/** 视口高度(px) */
|
|
5
|
+
height?: number;
|
|
6
|
+
/** 固定 item 高度(px)——虚拟滚动的基础 */
|
|
7
|
+
itemHeight?: number;
|
|
8
|
+
renderItem?: (item: any, index: number) => any;
|
|
9
|
+
/** 可见区外额外渲染数量 */
|
|
10
|
+
overscan?: number;
|
|
11
|
+
keyBy?: (item: any, index: number) => string | number;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 虚拟列表(对应 EP VirtualTable):固定高度 items 只渲染可见窗口,
|
|
16
|
+
* spacer 撑总高 + 绝对定位可见项。1000+ 条列表性能关键。
|
|
17
|
+
* 裁剪:动态高度(ResizeObserver 测量)、滚动平滑(sticky 场景)。
|
|
18
|
+
* 滚动跟随:ctx.ui.useScrollPosition(内置全局 scroll 监听 + rAF 节流)——
|
|
19
|
+
* 像素级 scrollTop 响应式,无组件自建 scroll 监听。
|
|
20
|
+
*/
|
|
21
|
+
export declare const VirtualList: Component<VirtualListProps>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Component } from '../../client/vnode.ts';
|
|
2
|
+
export interface WatermarkProps {
|
|
3
|
+
/** 水印文字 */
|
|
4
|
+
text?: string;
|
|
5
|
+
fontSize?: number;
|
|
6
|
+
/** 文字颜色(默认继承) */
|
|
7
|
+
color?: string;
|
|
8
|
+
/** 透明度 0-1,默认 0.15 */
|
|
9
|
+
opacity?: number;
|
|
10
|
+
/** 旋转角度(度),默认 -25 */
|
|
11
|
+
rotate?: number;
|
|
12
|
+
/** 平铺间距(px),默认 100 */
|
|
13
|
+
gap?: number;
|
|
14
|
+
children?: any;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/** 水印(对应 antd Watermark):canvas 绘制平铺文字 + overlay 覆盖内容(pointer-events none)。
|
|
18
|
+
* 裁剪:图片水印、多行文字、动态旋转。 */
|
|
19
|
+
export declare const Watermark: Component<WatermarkProps>;
|
|
@@ -102,3 +102,88 @@ export { ApprovalCard } from './ApprovalCard/ApprovalCard.ts';
|
|
|
102
102
|
export type { ApprovalCardProps, ApprovalStatus } from './ApprovalCard/ApprovalCard.ts';
|
|
103
103
|
export { AiChat } from './AiChat/AiChat.ts';
|
|
104
104
|
export type { AiChatProps, AiChatLabels } from './AiChat/AiChat.ts';
|
|
105
|
+
export { Markdown } from './Markdown/Markdown.ts';
|
|
106
|
+
export type { MarkdownProps } from './Markdown/Markdown.ts';
|
|
107
|
+
export { parseMarkdown, parseInline } from './Markdown/parser.ts';
|
|
108
|
+
export { CodeBlock } from './CodeBlock/CodeBlock.ts';
|
|
109
|
+
export type { CodeBlockProps } from './CodeBlock/CodeBlock.ts';
|
|
110
|
+
export { Timeline } from './Timeline/Timeline.ts';
|
|
111
|
+
export type { TimelineProps, TimelineItem, TimelineStatus } from './Timeline/Timeline.ts';
|
|
112
|
+
export { InputNumber } from './InputNumber/InputNumber.ts';
|
|
113
|
+
export type { InputNumberProps } from './InputNumber/InputNumber.ts';
|
|
114
|
+
export { Descriptions } from './Descriptions/Descriptions.ts';
|
|
115
|
+
export type { DescriptionsProps, DescriptionItem } from './Descriptions/Descriptions.ts';
|
|
116
|
+
export { AvatarGroup } from './AvatarGroup/AvatarGroup.ts';
|
|
117
|
+
export type { AvatarGroupProps, AvatarGroupItem } from './AvatarGroup/AvatarGroup.ts';
|
|
118
|
+
export { MessageBubble } from './MessageBubble/MessageBubble.ts';
|
|
119
|
+
export type { MessageBubbleProps, MessageBubbleRole, MessageBubbleStatus } from './MessageBubble/MessageBubble.ts';
|
|
120
|
+
export { Menu } from './Menu/Menu.ts';
|
|
121
|
+
export type { MenuProps, MenuItem } from './Menu/Menu.ts';
|
|
122
|
+
export { PasswordInput } from './PasswordInput/PasswordInput.ts';
|
|
123
|
+
export type { PasswordInputProps } from './PasswordInput/PasswordInput.ts';
|
|
124
|
+
export { TagsInput } from './TagsInput/TagsInput.ts';
|
|
125
|
+
export type { TagsInputProps } from './TagsInput/TagsInput.ts';
|
|
126
|
+
export { Highlight } from './Highlight/Highlight.ts';
|
|
127
|
+
export type { HighlightProps } from './Highlight/Highlight.ts';
|
|
128
|
+
export { List } from './List/List.ts';
|
|
129
|
+
export type { ListProps } from './List/List.ts';
|
|
130
|
+
export { Result } from './Result/Result.ts';
|
|
131
|
+
export type { ResultProps, ResultStatus } from './Result/Result.ts';
|
|
132
|
+
export { Rate } from './Rate/Rate.ts';
|
|
133
|
+
export type { RateProps } from './Rate/Rate.ts';
|
|
134
|
+
export { Title, Text, Paragraph } from './Typography/Typography.ts';
|
|
135
|
+
export type { TitleProps, TextProps, ParagraphProps, TextType } from './Typography/Typography.ts';
|
|
136
|
+
export { Label } from './Label/Label.ts';
|
|
137
|
+
export type { LabelProps } from './Label/Label.ts';
|
|
138
|
+
export { AspectRatio } from './AspectRatio/AspectRatio.ts';
|
|
139
|
+
export type { AspectRatioProps } from './AspectRatio/AspectRatio.ts';
|
|
140
|
+
export { Toggle, ToggleGroup } from './ToggleGroup/ToggleGroup.ts';
|
|
141
|
+
export type { ToggleProps, ToggleGroupProps, ToggleGroupOption } from './ToggleGroup/ToggleGroup.ts';
|
|
142
|
+
export { CheckboxGroup } from './CheckboxGroup/CheckboxGroup.ts';
|
|
143
|
+
export type { CheckboxGroupProps, CheckboxGroupOption } from './CheckboxGroup/CheckboxGroup.ts';
|
|
144
|
+
export { PinInput } from './PinInput/PinInput.ts';
|
|
145
|
+
export type { PinInputProps } from './PinInput/PinInput.ts';
|
|
146
|
+
export { CopyButton } from './CopyButton/CopyButton.ts';
|
|
147
|
+
export type { CopyButtonProps } from './CopyButton/CopyButton.ts';
|
|
148
|
+
export { ColorPicker } from './ColorPicker/ColorPicker.ts';
|
|
149
|
+
export type { ColorPickerProps } from './ColorPicker/ColorPicker.ts';
|
|
150
|
+
export { BackTop } from './BackTop/BackTop.ts';
|
|
151
|
+
export type { BackTopProps } from './BackTop/BackTop.ts';
|
|
152
|
+
export { Affix } from './Affix/Affix.ts';
|
|
153
|
+
export type { AffixProps } from './Affix/Affix.ts';
|
|
154
|
+
export { HoverCard } from './HoverCard/HoverCard.ts';
|
|
155
|
+
export type { HoverCardProps, HoverCardPosition } from './HoverCard/HoverCard.ts';
|
|
156
|
+
export { Notification, notification } from './Notification/Notification.ts';
|
|
157
|
+
export type { NotificationProps, NotificationItem, NotificationType, NotificationPosition, NotificationOptions, NotificationInjected } from './Notification/Notification.ts';
|
|
158
|
+
export { ContextMenu } from './ContextMenu/ContextMenu.ts';
|
|
159
|
+
export type { ContextMenuProps, ContextMenuItem } from './ContextMenu/ContextMenu.ts';
|
|
160
|
+
export { Mentions } from './Mentions/Mentions.ts';
|
|
161
|
+
export type { MentionsProps, MentionsOption } from './Mentions/Mentions.ts';
|
|
162
|
+
export { Collapse } from './Collapse/Collapse.ts';
|
|
163
|
+
export type { CollapseProps, CollapseItem } from './Collapse/Collapse.ts';
|
|
164
|
+
export { Tree } from './Tree/Tree.ts';
|
|
165
|
+
export type { TreeProps, TreeNode } from './Tree/Tree.ts';
|
|
166
|
+
export { Cascader } from './Cascader/Cascader.ts';
|
|
167
|
+
export type { CascaderProps, CascaderOption } from './Cascader/Cascader.ts';
|
|
168
|
+
export { Transfer } from './Transfer/Transfer.ts';
|
|
169
|
+
export type { TransferProps, TransferItem } from './Transfer/Transfer.ts';
|
|
170
|
+
export { Command } from './Command/Command.ts';
|
|
171
|
+
export type { CommandProps, CommandItem } from './Command/Command.ts';
|
|
172
|
+
export { Menubar } from './Menubar/Menubar.ts';
|
|
173
|
+
export type { MenubarProps, MenubarMenu, MenubarItem } from './Menubar/Menubar.ts';
|
|
174
|
+
export { Carousel } from './Carousel/Carousel.ts';
|
|
175
|
+
export type { CarouselProps } from './Carousel/Carousel.ts';
|
|
176
|
+
export { Resizable } from './Resizable/Resizable.ts';
|
|
177
|
+
export type { ResizableProps } from './Resizable/Resizable.ts';
|
|
178
|
+
export { Calendar } from './Calendar/Calendar.ts';
|
|
179
|
+
export type { CalendarProps, CalendarEvent } from './Calendar/Calendar.ts';
|
|
180
|
+
export { Watermark } from './Watermark/Watermark.ts';
|
|
181
|
+
export type { WatermarkProps } from './Watermark/Watermark.ts';
|
|
182
|
+
export { InfiniteScroll } from './InfiniteScroll/InfiniteScroll.ts';
|
|
183
|
+
export type { InfiniteScrollProps } from './InfiniteScroll/InfiniteScroll.ts';
|
|
184
|
+
export { VirtualList } from './VirtualList/VirtualList.ts';
|
|
185
|
+
export type { VirtualListProps } from './VirtualList/VirtualList.ts';
|
|
186
|
+
export { QRCode } from './QRCode/QRCode.ts';
|
|
187
|
+
export type { QRCodeProps } from './QRCode/QRCode.ts';
|
|
188
|
+
export { generateQr } from './QRCode/qr.ts';
|
|
189
|
+
export type { QrMatrix, QrEcLevel } from './QRCode/qr.ts';
|