weifuwu 0.62.0 → 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 +71 -4
- package/dist/client/index.js +3 -3
- package/dist/client/types.d.ts +59 -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/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/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/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/Label/Label.d.ts +11 -0
- package/dist/components/Mentions/Mentions.d.ts +19 -0
- package/dist/components/Menubar/Menubar.d.ts +22 -0
- package/dist/components/Notification/Notification.d.ts +70 -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/Select/Select.d.ts +4 -2
- package/dist/components/Table/Table.d.ts +10 -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 +58 -0
- package/dist/components/index.js +13 -6
- package/dist/components/style.css +4636 -2699
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Component } from '../../client/vnode.ts';
|
|
2
|
+
export interface ColorPickerProps {
|
|
3
|
+
/** 受控颜色值(hex,如 #4f6ef7) */
|
|
4
|
+
value?: string;
|
|
5
|
+
onChange?: (value: string) => void;
|
|
6
|
+
/** 预设色板(默认内置 10 色) */
|
|
7
|
+
colors?: string[];
|
|
8
|
+
size?: 'sm' | 'md' | 'lg';
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** 显示 hex 输入框(自由输入) */
|
|
11
|
+
showInput?: boolean;
|
|
12
|
+
'aria-label'?: string;
|
|
13
|
+
}
|
|
14
|
+
/** 颜色选择(对应 antd/EP ColorPicker 预设版):触发按钮 + 色板弹层 + hex 输入。
|
|
15
|
+
* 裁剪:不做吸管/自由取色/透明度(预设色板 + hex 输入覆盖 90% 场景)。 */
|
|
16
|
+
export declare const ColorPicker: Component<ColorPickerProps>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Component } from '../../client/vnode.ts';
|
|
2
|
+
export interface CommandItem {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: any;
|
|
6
|
+
/** 显示快捷键(如 'G S') */
|
|
7
|
+
shortcut?: string;
|
|
8
|
+
group?: string;
|
|
9
|
+
keywords?: string[];
|
|
10
|
+
onSelect?: () => void;
|
|
11
|
+
}
|
|
12
|
+
export interface CommandProps {
|
|
13
|
+
open?: boolean;
|
|
14
|
+
onOpenChange?: (open: boolean) => void;
|
|
15
|
+
items?: CommandItem[];
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
emptyText?: string;
|
|
18
|
+
/** 全局快捷键,如 'mod+k'(cmd/ctrl + k);null 关闭全局监听 */
|
|
19
|
+
globalShortcut?: string | null;
|
|
20
|
+
}
|
|
21
|
+
/** 命令面板(对应 shadcn Command):全屏 overlay + 搜索 + 键盘流(↑↓ Enter Escape)+ Cmd+K 全局快捷键 */
|
|
22
|
+
export declare const Command: Component<CommandProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Component } from '../../client/vnode.ts';
|
|
2
|
+
export interface ContextMenuItem {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: any;
|
|
6
|
+
variant?: 'default' | 'danger';
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
}
|
|
10
|
+
export interface ContextMenuProps {
|
|
11
|
+
items?: ContextMenuItem[];
|
|
12
|
+
children: any;
|
|
13
|
+
'aria-label'?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
/** 右键菜单(对应 shadcn ContextMenu):右键在光标处弹出,点击外部/Escape 关闭,方向键导航 */
|
|
17
|
+
export declare const ContextMenu: Component<ContextMenuProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Component } from '../../client/vnode.ts';
|
|
2
|
+
export interface CopyButtonProps {
|
|
3
|
+
/** 要复制的文本 */
|
|
4
|
+
value: string;
|
|
5
|
+
/** 按钮文字(默认仅图标) */
|
|
6
|
+
label?: string;
|
|
7
|
+
size?: 'sm' | 'md' | 'lg';
|
|
8
|
+
variant?: 'ghost' | 'secondary' | 'default';
|
|
9
|
+
/** 仅图标(无文字) */
|
|
10
|
+
iconOnly?: boolean;
|
|
11
|
+
/** 成功提示文字(默认「已复制」) */
|
|
12
|
+
successText?: string;
|
|
13
|
+
onCopied?: () => void;
|
|
14
|
+
className?: string;
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}
|
|
17
|
+
/** 复制按钮(weifuwu 独有,Chat 消息复制/CodeBlock 抽取统一) */
|
|
18
|
+
export declare const CopyButton: Component<CopyButtonProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Component } from '../../client/vnode.ts';
|
|
2
|
+
import type { Placement } from '../../client/popup.ts';
|
|
3
|
+
export type HoverCardPosition = Placement;
|
|
4
|
+
export interface HoverCardProps {
|
|
5
|
+
/** 富内容(任意 VNode,区别于 Tooltip 的 string) */
|
|
6
|
+
content: any;
|
|
7
|
+
position?: HoverCardPosition;
|
|
8
|
+
children: any;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** 悬停打开延迟(ms),默认 150 */
|
|
11
|
+
openDelay?: number;
|
|
12
|
+
/** 移出关闭延迟(ms),默认 0 */
|
|
13
|
+
closeDelay?: number;
|
|
14
|
+
}
|
|
15
|
+
/** 悬停富内容卡(对应 shadcn HoverCard):hover 延迟显隐,支持任意 VNode 内容 */
|
|
16
|
+
export declare const HoverCard: Component<HoverCardProps>;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* h(Icon, { name: 'check', size: 16 })
|
|
10
10
|
*/
|
|
11
11
|
import type { Component } from '../../client/vnode.ts';
|
|
12
|
-
export type IconName = 'chevron-down' | 'chevron-up' | 'chevron-left' | 'chevron-right' | 'arrow-left' | 'arrow-up' | 'arrow-down' | 'sort' | 'sort-asc' | 'sort-desc' | 'check' | 'close' | 'alert' | 'info' | 'warning' | 'pause' | 'settings' | 'search' | 'send' | 'stop' | 'retry' | 'upload' | 'trash' | 'edit' | 'plus' | 'copy' | 'eye' | 'eye-off';
|
|
12
|
+
export type IconName = 'chevron-down' | 'chevron-up' | 'chevron-left' | 'chevron-right' | 'arrow-left' | 'arrow-up' | 'arrow-down' | 'arrow-right' | 'sort' | 'sort-asc' | 'sort-desc' | 'check' | 'close' | 'alert' | 'info' | 'warning' | 'pause' | 'settings' | 'search' | 'send' | 'stop' | 'retry' | 'upload' | 'trash' | 'edit' | 'plus' | 'copy' | 'eye' | 'eye-off' | 'star';
|
|
13
13
|
export interface IconProps {
|
|
14
14
|
name: IconName;
|
|
15
15
|
/** 尺寸,默认 1em(随字号缩放) */
|
|
@@ -11,5 +11,9 @@ export interface ImgProps {
|
|
|
11
11
|
height?: number | string;
|
|
12
12
|
className?: string;
|
|
13
13
|
style?: Record<string, string>;
|
|
14
|
+
/** 点击放大预览(对应 antd/EP Image preview) */
|
|
15
|
+
preview?: boolean;
|
|
16
|
+
/** 预览缩放倍率,默认 1 */
|
|
17
|
+
previewScale?: number;
|
|
14
18
|
}
|
|
15
19
|
export declare const Img: Component<ImgProps>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* weifuwu/components — InView
|
|
3
3
|
*
|
|
4
|
-
* 组件挂载后用 ctx.ui.onmounted 获取根元素,设置 IntersectionObserver。
|
|
5
4
|
* 进入视窗后替换占位符为真实内容。
|
|
5
|
+
* 实现:ctx.ui.useInView(IO 封装)——滚动/尺寸变化由合成器线程评估,无 scroll 监听。
|
|
6
6
|
*/
|
|
7
7
|
import type { Component } from '../../client/vnode.ts';
|
|
8
8
|
export interface InViewProps {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Component } from '../../client/vnode.ts';
|
|
2
|
+
export interface InfiniteScrollProps {
|
|
3
|
+
hasMore?: boolean;
|
|
4
|
+
loading?: boolean;
|
|
5
|
+
/** 触底加载回调(sentinel 进入视口触发) */
|
|
6
|
+
onLoadMore?: () => void;
|
|
7
|
+
/** 提前触发距离(px) */
|
|
8
|
+
threshold?: number;
|
|
9
|
+
children?: any;
|
|
10
|
+
loadMoreText?: string;
|
|
11
|
+
endText?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
/** 无限滚动(对应 EP InfiniteScroll):底部哨兵进入视口 → 加载更多。 */
|
|
15
|
+
export declare const InfiniteScroll: Component<InfiniteScrollProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Component } from '../../client/vnode.ts';
|
|
2
|
+
export interface LabelProps {
|
|
3
|
+
htmlFor?: string;
|
|
4
|
+
/** 必填星号 */
|
|
5
|
+
required?: boolean;
|
|
6
|
+
children?: any;
|
|
7
|
+
className?: string;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
/** 独立标签(对应 shadcn Label;weifuwu Input/Field 已内嵌 label,独立组件用于自定义布局) */
|
|
11
|
+
export declare const Label: Component<LabelProps>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Component } from '../../client/vnode.ts';
|
|
2
|
+
export interface MentionsOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface MentionsProps {
|
|
7
|
+
value?: string;
|
|
8
|
+
onChange?: (value: string) => void;
|
|
9
|
+
options?: MentionsOption[];
|
|
10
|
+
/** 触发字符,默认 '@' */
|
|
11
|
+
prefix?: string;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
rows?: number;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
size?: 'sm' | 'md' | 'lg';
|
|
16
|
+
}
|
|
17
|
+
/** @提及输入(对应 antd Mentions):输入 prefix + 关键词弹出候选,点击/Enter 插入。
|
|
18
|
+
* 裁剪:不做多 prefix/自定义高亮渲染/远程搜索(options 静态传入)。 */
|
|
19
|
+
export declare const Mentions: Component<MentionsProps>;
|
|
@@ -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,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,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>;
|
|
@@ -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,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>;
|
|
@@ -129,3 +129,61 @@ export { List } from './List/List.ts';
|
|
|
129
129
|
export type { ListProps } from './List/List.ts';
|
|
130
130
|
export { Result } from './Result/Result.ts';
|
|
131
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';
|