weifuwu 0.93.1 → 0.93.3
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 +1 -1
- package/dist/client/components/Accordion/Accordion.d.ts +3 -2
- package/dist/client/components/ActionSheet/ActionSheet.d.ts +1 -0
- package/dist/client/components/Affix/Affix.d.ts +3 -2
- package/dist/client/components/AiChat/AiChat.d.ts +2 -1
- package/dist/client/components/Alert/Alert.d.ts +3 -2
- package/dist/client/components/AlertGroup/AlertGroup.d.ts +3 -2
- package/dist/client/components/Anchor/Anchor.d.ts +3 -2
- package/dist/client/components/AppShell/AppShell.d.ts +23 -5
- package/dist/client/components/ApprovalCard/ApprovalCard.d.ts +3 -2
- package/dist/client/components/AspectRatio/AspectRatio.d.ts +3 -2
- package/dist/client/components/AuthPage/AuthPage.d.ts +3 -2
- package/dist/client/components/AutoComplete/AutoComplete.d.ts +3 -2
- package/dist/client/components/Avatar/Avatar.d.ts +1 -0
- package/dist/client/components/AvatarGroup/AvatarGroup.d.ts +1 -0
- package/dist/client/components/BackTop/BackTop.d.ts +3 -2
- package/dist/client/components/Badge/Badge.d.ts +3 -2
- package/dist/client/components/Breadcrumb/Breadcrumb.d.ts +1 -0
- package/dist/client/components/Button/Button.d.ts +3 -2
- package/dist/client/components/Calendar/Calendar.d.ts +1 -0
- package/dist/client/components/Card/Card.d.ts +3 -2
- package/dist/client/components/Carousel/Carousel.d.ts +3 -2
- package/dist/client/components/Cascader/Cascader.d.ts +1 -0
- package/dist/client/components/Chart/Chart.d.ts +1 -0
- package/dist/client/components/Chart/chart-utils.d.ts +1 -0
- package/dist/client/components/ChatInput/ChatInput.d.ts +1 -0
- package/dist/client/components/Checkbox/Checkbox.d.ts +1 -0
- package/dist/client/components/CheckboxGroup/CheckboxGroup.d.ts +1 -0
- package/dist/client/components/CitationCard/CitationCard.d.ts +2 -1
- package/dist/client/components/CodeBlock/CodeBlock.d.ts +1 -0
- package/dist/client/components/CodeBlock/highlight.d.ts +1 -0
- package/dist/client/components/CodeEditor/CodeEditor.d.ts +1 -0
- package/dist/client/components/Collapse/Collapse.d.ts +5 -4
- package/dist/client/components/ColorPicker/ColorPicker.d.ts +1 -0
- package/dist/client/components/Command/Command.d.ts +3 -2
- package/dist/client/components/Confirm/Confirm.d.ts +3 -2
- package/dist/client/components/ContextMenu/ContextMenu.d.ts +4 -3
- package/dist/client/components/CopyButton/CopyButton.d.ts +1 -0
- package/dist/client/components/CronPicker/CronPicker.d.ts +31 -0
- package/dist/client/components/DatePicker/DatePicker.d.ts +1 -0
- package/dist/client/components/DatePicker/calendar-utils.d.ts +1 -0
- package/dist/client/components/Descriptions/Descriptions.d.ts +4 -3
- package/dist/client/components/DiffView/DiffView.d.ts +1 -0
- package/dist/client/components/DiffView/diff-utils.d.ts +1 -0
- package/dist/client/components/Divider/Divider.d.ts +3 -2
- package/dist/client/components/Drawer/Drawer.d.ts +4 -3
- package/dist/client/components/DropZone/DropZone.d.ts +3 -2
- package/dist/client/components/Dropdown/Dropdown.d.ts +3 -2
- package/dist/client/components/Editor/Editor.d.ts +1 -0
- package/dist/client/components/Editor/edit-events.d.ts +1 -0
- package/dist/client/components/Editor/model/apply.d.ts +1 -0
- package/dist/client/components/Editor/model/diff.d.ts +1 -0
- package/dist/client/components/Editor/model/dom.d.ts +1 -0
- package/dist/client/components/Editor/model/history.d.ts +1 -0
- package/dist/client/components/Editor/model/html.d.ts +1 -0
- package/dist/client/components/Editor/model/inverse.d.ts +1 -0
- package/dist/client/components/Editor/model/types.d.ts +1 -0
- package/dist/client/components/Editor/tools/table.d.ts +1 -0
- package/dist/client/components/Editor/tools/toolbar.d.ts +1 -0
- package/dist/client/components/Editor/tools/types.d.ts +1 -0
- package/dist/client/components/EmptyState/EmptyState.d.ts +3 -2
- package/dist/client/components/ExportCSV/ExportCSV.d.ts +4 -3
- package/dist/client/components/Field/Field.d.ts +3 -2
- package/dist/client/components/FilePreview/FilePreview.d.ts +1 -0
- package/dist/client/components/FilePreview/markdown.d.ts +1 -0
- package/dist/client/components/FileTree/FileTree.d.ts +1 -0
- package/dist/client/components/FileUpload/FileUpload.d.ts +3 -2
- package/dist/client/components/FloatButton/FloatButton.d.ts +5 -4
- package/dist/client/components/Form/Form.d.ts +3 -2
- package/dist/client/components/Grid/Grid.d.ts +4 -3
- package/dist/client/components/Highlight/Highlight.d.ts +1 -0
- package/dist/client/components/HoverCard/HoverCard.d.ts +4 -3
- package/dist/client/components/Icon/Icon.d.ts +1 -0
- package/dist/client/components/ImageCropper/ImageCropper.d.ts +1 -0
- package/dist/client/components/Img/Img.d.ts +1 -0
- package/dist/client/components/InView/InView.d.ts +4 -3
- package/dist/client/components/InfiniteScroll/InfiniteScroll.d.ts +3 -2
- package/dist/client/components/Input/Input.d.ts +1 -0
- package/dist/client/components/InputNumber/InputNumber.d.ts +1 -0
- package/dist/client/components/JSONViewer/JSONViewer.d.ts +1 -0
- package/dist/client/components/JsonSchemaForm/JsonSchemaForm.d.ts +1 -0
- package/dist/client/components/Kanban/Kanban.d.ts +1 -0
- package/dist/client/components/Label/Label.d.ts +3 -2
- package/dist/client/components/Layout/Layout.d.ts +8 -7
- package/dist/client/components/Link/Link.d.ts +4 -3
- package/dist/client/components/List/List.d.ts +4 -3
- package/dist/client/components/ListScaffold/ListScaffold.d.ts +40 -0
- package/dist/client/components/Loading/Loading.d.ts +1 -0
- package/dist/client/components/LogViewer/LogViewer.d.ts +1 -0
- package/dist/client/components/Markdown/Markdown.d.ts +1 -0
- package/dist/client/components/Markdown/parser.d.ts +1 -0
- package/dist/client/components/MarkdownEditor/MarkdownEditor.d.ts +1 -0
- package/dist/client/components/Math/Math.d.ts +1 -0
- package/dist/client/components/Mentions/Mentions.d.ts +1 -0
- package/dist/client/components/Menu/Menu.d.ts +6 -3
- package/dist/client/components/Menubar/Menubar.d.ts +3 -2
- package/dist/client/components/MessageBubble/MessageBubble.d.ts +4 -3
- package/dist/client/components/Modal/Modal.d.ts +4 -3
- package/dist/client/components/NavBar/NavBar.d.ts +1 -0
- package/dist/client/components/NavMenu/NavMenu.d.ts +3 -2
- package/dist/client/components/Notification/Notification.d.ts +1 -0
- package/dist/client/components/PageHeader/PageHeader.d.ts +3 -2
- package/dist/client/components/Pagination/Pagination.d.ts +1 -0
- package/dist/client/components/PasswordInput/PasswordInput.d.ts +1 -0
- package/dist/client/components/PinInput/PinInput.d.ts +1 -0
- package/dist/client/components/Pipeline/Pipeline.d.ts +1 -0
- package/dist/client/components/Pipeline/dag-utils.d.ts +1 -0
- package/dist/client/components/Popconfirm/Popconfirm.d.ts +5 -4
- package/dist/client/components/Popover/Popover.d.ts +4 -3
- package/dist/client/components/ProgressBar/ProgressBar.d.ts +1 -0
- package/dist/client/components/PromptTemplate/PromptTemplate.d.ts +1 -0
- package/dist/client/components/QRCode/QRCode.d.ts +1 -0
- package/dist/client/components/QRCode/qr.d.ts +1 -0
- package/dist/client/components/RadioGroup/RadioGroup.d.ts +1 -0
- package/dist/client/components/Rate/Rate.d.ts +1 -0
- package/dist/client/components/ReasoningBlock/ReasoningBlock.d.ts +1 -0
- package/dist/client/components/RelationGraph/RelationGraph.d.ts +1 -0
- package/dist/client/components/Resizable/Resizable.d.ts +1 -0
- package/dist/client/components/Result/Result.d.ts +4 -3
- package/dist/client/components/Scrollbar/Scrollbar.d.ts +3 -2
- package/dist/client/components/SearchInput/SearchInput.d.ts +1 -0
- package/dist/client/components/SegmentedControl/SegmentedControl.d.ts +1 -0
- package/dist/client/components/Select/Select.d.ts +3 -2
- package/dist/client/components/SessionList/SessionList.d.ts +1 -0
- package/dist/client/components/SheetGrid/SheetGrid.d.ts +1 -0
- package/dist/client/components/Skeleton/Skeleton.d.ts +1 -0
- package/dist/client/components/SlideCanvas/SlideCanvas.d.ts +1 -0
- package/dist/client/components/Slider/Slider.d.ts +1 -0
- package/dist/client/components/SortableList/SortableList.d.ts +1 -0
- package/dist/client/components/Space/Space.d.ts +3 -2
- package/dist/client/components/Sparkline/Sparkline.d.ts +1 -0
- package/dist/client/components/Sparkline/sparkline-utils.d.ts +1 -0
- package/dist/client/components/StatCard/StatCard.d.ts +1 -0
- package/dist/client/components/StatusDot/StatusDot.d.ts +25 -0
- package/dist/client/components/Steps/Steps.d.ts +1 -0
- package/dist/client/components/Switch/Switch.d.ts +1 -0
- package/dist/client/components/TabBar/TabBar.d.ts +1 -0
- package/dist/client/components/Table/Table.d.ts +3 -2
- package/dist/client/components/Tabs/Tabs.d.ts +3 -2
- package/dist/client/components/Tag/Tag.d.ts +3 -2
- package/dist/client/components/TagsInput/TagsInput.d.ts +1 -0
- package/dist/client/components/Textarea/Textarea.d.ts +1 -0
- package/dist/client/components/ThemeSwitch/ThemeSwitch.d.ts +1 -0
- package/dist/client/components/Timeline/Timeline.d.ts +5 -4
- package/dist/client/components/Toast/Toast.d.ts +1 -0
- package/dist/client/components/ToggleGroup/ToggleGroup.d.ts +4 -3
- package/dist/client/components/ToolCallCard/ToolCallCard.d.ts +1 -0
- package/dist/client/components/Tooltip/Tooltip.d.ts +3 -2
- package/dist/client/components/Tour/Tour.d.ts +1 -0
- package/dist/client/components/Transfer/Transfer.d.ts +1 -0
- package/dist/client/components/Tree/Tree.d.ts +3 -2
- package/dist/client/components/TreeSelect/TreeSelect.d.ts +1 -0
- package/dist/client/components/Typography/Typography.d.ts +5 -4
- package/dist/client/components/VideoPlayer/VideoPlayer.d.ts +1 -0
- package/dist/client/components/VirtualList/VirtualList.d.ts +4 -3
- package/dist/client/components/VirtualTable/VirtualTable.d.ts +1 -0
- package/dist/client/components/Watermark/Watermark.d.ts +3 -2
- package/dist/client/components/Wave/Wave.d.ts +3 -2
- package/dist/client/components/WordCloud/WordCloud.d.ts +1 -0
- package/dist/client/components/index.d.ts +6 -0
- package/dist/client/components/index.js +40 -40
- package/dist/client/components/style.css +1 -1
- package/dist/client/layout/weifuwu-layout.css +1 -1
- package/docs/client.md +42 -3
- package/docs/layout.md +1 -1
- package/package.json +3 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** DropZone:全区域拖放区——整容器拖入文件高亮 + onFiles 回调(现代 IM 标配——Chat 手搓证据)(showcase /components/dropzone) */
|
|
1
2
|
/**
|
|
2
3
|
* weifuwu/components — DropZone 全区域拖放区
|
|
3
4
|
*
|
|
@@ -16,12 +17,12 @@
|
|
|
16
17
|
* - 非文件拖入忽略(files 空不回调);disabled 全路径拦截
|
|
17
18
|
* - 事件经 useDragDrop 原语(dragover preventDefault 允许放置——vdom 事件表通道)
|
|
18
19
|
*/
|
|
19
|
-
import type { Component } from '../../vdom/index.ts';
|
|
20
|
+
import type { Component, VNodeChild } from '../../vdom/index.ts';
|
|
20
21
|
export interface DropZoneProps {
|
|
21
22
|
/** 拖放文件回调(file 数组——调用方负责后续链——与按钮链共享) */
|
|
22
23
|
onFiles?: (files: File[]) => void;
|
|
23
24
|
disabled?: boolean;
|
|
24
25
|
className?: string;
|
|
25
|
-
children?:
|
|
26
|
+
children?: VNodeChild;
|
|
26
27
|
}
|
|
27
28
|
export declare const DropZone: Component<DropZoneProps>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
/** Dropdown:下拉菜单,支持 danger variant(showcase /components/dropdown) */
|
|
1
2
|
/**
|
|
2
3
|
* weifuwu/components — Dropdown
|
|
3
4
|
*
|
|
4
5
|
* openPopup 内核:click 触发 + 受控 open + 外部点击/Escape(document 级,
|
|
5
6
|
* 弹层在 portal 中按 Escape 也能关)+ 定位/视口 clamp + portal。
|
|
6
7
|
*/
|
|
7
|
-
import type { Component } from '../../vdom/index.ts';
|
|
8
|
+
import type { Component, VNodeChild } from '../../vdom/index.ts';
|
|
8
9
|
export interface DropdownItem {
|
|
9
10
|
label: string;
|
|
10
11
|
value?: string;
|
|
@@ -13,7 +14,7 @@ export interface DropdownItem {
|
|
|
13
14
|
onClick?: () => void;
|
|
14
15
|
}
|
|
15
16
|
export interface DropdownProps {
|
|
16
|
-
trigger
|
|
17
|
+
trigger?: VNodeChild;
|
|
17
18
|
items?: DropdownItem[];
|
|
18
19
|
open?: boolean;
|
|
19
20
|
/** 关闭回调(面板内 Escape / 外部点击) */
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/** EmptyState:空状态占位,支持 icon/text/hint/action(showcase /components/emptystate) */
|
|
2
|
+
import type { Component, VNode, VNodeChild } from '../../vdom/index.ts';
|
|
2
3
|
export interface EmptyStateProps {
|
|
3
4
|
/** 图标——VNode(推荐 <Icon />)或字符串(emoji/字形);默认 Icon inbox(P3:组件内禁裸 emoji) */
|
|
4
5
|
icon?: string | VNode | null;
|
|
5
6
|
text?: string;
|
|
6
7
|
hint?: string;
|
|
7
|
-
children?:
|
|
8
|
+
children?: VNodeChild;
|
|
8
9
|
}
|
|
9
10
|
export declare const EmptyState: Component<EmptyStateProps>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** ExportCSV:数据导出 CSV——RFC 4180 转义 + BOM(Excel 兼容)零依赖(showcase /components/exportcsv) */
|
|
1
2
|
/**
|
|
2
3
|
* ExportCSV — 数据导出 CSV(零依赖:纯函数 + ctx.browser.downloadFile)
|
|
3
4
|
*
|
|
@@ -5,7 +6,7 @@
|
|
|
5
6
|
* exportCSV({ data: rows, filename: 'orders.csv', columns: [{ key, label }] })
|
|
6
7
|
* <ExportCSV data={rows} filename="orders.csv">导出</ExportCSV>
|
|
7
8
|
*/
|
|
8
|
-
import type { Component } from '../../vdom/index.ts';
|
|
9
|
+
import type { Component, VNodeChild } from '../../vdom/index.ts';
|
|
9
10
|
export interface CsvColumn {
|
|
10
11
|
key: string;
|
|
11
12
|
label?: string;
|
|
@@ -15,12 +16,12 @@ export interface ExportCsvOptions {
|
|
|
15
16
|
filename?: string;
|
|
16
17
|
columns?: CsvColumn[];
|
|
17
18
|
/** 值格式化(默认 String;null/undefined → 空) */
|
|
18
|
-
format?: (value:
|
|
19
|
+
format?: (value: VNodeChild, key: string) => string;
|
|
19
20
|
}
|
|
20
21
|
/** 纯函数:data → CSV 字符串(RFC 4180:引号转义 + BOM 防 Excel 乱码) */
|
|
21
22
|
export declare function toCsv({ data, columns, format }: ExportCsvOptions): string;
|
|
22
23
|
export interface ExportCSVProps extends ExportCsvOptions {
|
|
23
|
-
children?:
|
|
24
|
+
children?: VNodeChild;
|
|
24
25
|
variant?: 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
25
26
|
size?: 'sm' | 'md' | 'lg';
|
|
26
27
|
disabled?: boolean;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/** Field:label+error+hint 容器(showcase /components/field) */
|
|
2
|
+
import type { Component, VNodeChild } from '../../vdom/index.ts';
|
|
2
3
|
export interface FieldProps {
|
|
3
4
|
label?: string;
|
|
4
5
|
required?: boolean;
|
|
5
6
|
error?: string;
|
|
6
7
|
hint?: string;
|
|
7
|
-
children?:
|
|
8
|
+
children?: VNodeChild;
|
|
8
9
|
}
|
|
9
10
|
export declare const Field: Component<FieldProps>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
/** FileUpload:文件上传,拖拽区 + 文件列表 + accept/maxSize(showcase /components/fileupload) */
|
|
1
2
|
/**
|
|
2
3
|
* weifuwu/components — FileUpload
|
|
3
4
|
*/
|
|
4
|
-
import type { Component } from '../../vdom/index.ts';
|
|
5
|
+
import type { Component, VNodeChild } from '../../vdom/index.ts';
|
|
5
6
|
export interface FileUploadProps {
|
|
6
7
|
accept?: string;
|
|
7
8
|
multiple?: boolean;
|
|
@@ -15,6 +16,6 @@ export interface FileUploadProps {
|
|
|
15
16
|
uploading?: boolean;
|
|
16
17
|
/** 上传进度 0-100(父层驱动) */
|
|
17
18
|
progress?: number;
|
|
18
|
-
children?:
|
|
19
|
+
children?: VNodeChild;
|
|
19
20
|
}
|
|
20
21
|
export declare const FileUpload: Component<FileUploadProps>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** FloatButton:悬浮按钮组:展开状态机 + badge(showcase /components/floatbutton) */
|
|
1
2
|
/**
|
|
2
3
|
* weifuwu/components — FloatButton 悬浮操作按钮
|
|
3
4
|
*
|
|
@@ -11,10 +12,10 @@
|
|
|
11
12
|
*
|
|
12
13
|
* 裁剪(CS-05,见 docs/client.md):不做拖拽悬浮(Resizable 可组合);回顶用 BackTop 语义更清晰。
|
|
13
14
|
*/
|
|
14
|
-
import type { Component } from '../../vdom/index.ts';
|
|
15
|
+
import type { Component, VNodeChild } from '../../vdom/index.ts';
|
|
15
16
|
export type FloatButtonPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
16
17
|
export interface FloatButtonProps {
|
|
17
|
-
icon?:
|
|
18
|
+
icon?: VNodeChild;
|
|
18
19
|
badge?: number | string;
|
|
19
20
|
position?: FloatButtonPosition;
|
|
20
21
|
/** 'static':组内子项(不 fixed——独立 fixed 会与主按钮重叠) */
|
|
@@ -22,13 +23,13 @@ export interface FloatButtonProps {
|
|
|
22
23
|
disabled?: boolean;
|
|
23
24
|
onClick?: () => void;
|
|
24
25
|
'aria-label'?: string;
|
|
25
|
-
children?:
|
|
26
|
+
children?: VNodeChild;
|
|
26
27
|
}
|
|
27
28
|
/** 单个悬浮按钮 */
|
|
28
29
|
export declare const FloatButton: Component<FloatButtonProps>;
|
|
29
30
|
export interface FloatButtonGroupProps {
|
|
30
31
|
position?: FloatButtonPosition;
|
|
31
|
-
children?:
|
|
32
|
+
children?: VNodeChild;
|
|
32
33
|
}
|
|
33
34
|
/** 悬浮按钮组:主按钮展开/收起子按钮 */
|
|
34
35
|
export declare const FloatButtonGroup: Component<FloatButtonGroupProps>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/** Form:内置验证规则:required/pattern/minLength/自定义(showcase /components/form) */
|
|
2
|
+
import type { Component, VNodeChild } from '../../vdom/index.ts';
|
|
2
3
|
export interface ValidationRule {
|
|
3
4
|
required?: boolean;
|
|
4
5
|
pattern?: RegExp;
|
|
@@ -15,7 +16,7 @@ export interface FormProps {
|
|
|
15
16
|
validation?: Record<string, ValidationRule[]>;
|
|
16
17
|
/** 验证失败时回调,接收字段名→错误消息的对象 */
|
|
17
18
|
onError?: (errors: Record<string, string>) => void;
|
|
18
|
-
children?:
|
|
19
|
+
children?: VNodeChild;
|
|
19
20
|
}
|
|
20
21
|
/** 验证函数:字段值 → 验证规则 → 错误消息 */
|
|
21
22
|
export declare function validateValues(values: Record<string, any>, rules: Record<string, ValidationRule[]>): Promise<Record<string, string>>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** Grid:24 栅格 + gutter + flex 容器模式(Row/Col/Flex 等价)(showcase /components/grid) */
|
|
1
2
|
/**
|
|
2
3
|
* weifuwu/components — Grid 栅格 + Flex 容器
|
|
3
4
|
*
|
|
@@ -13,20 +14,20 @@
|
|
|
13
14
|
* 裁剪(CS-05,见 docs/client.md):不做响应式断点 props(useBreakpoint 由用户驱动);
|
|
14
15
|
* gutter 仅水平(垂直 gutter 低频)。
|
|
15
16
|
*/
|
|
16
|
-
import type { Component } from '../../vdom/index.ts';
|
|
17
|
+
import type { Component, VNodeChild } from '../../vdom/index.ts';
|
|
17
18
|
export interface GridProps {
|
|
18
19
|
gutter?: number;
|
|
19
20
|
flex?: boolean;
|
|
20
21
|
gap?: number;
|
|
21
22
|
direction?: 'row' | 'column';
|
|
22
23
|
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
23
|
-
children?:
|
|
24
|
+
children?: VNodeChild;
|
|
24
25
|
}
|
|
25
26
|
export interface ColProps {
|
|
26
27
|
/** 0-24 栅格跨度;0 = flex:1 占剩余 */
|
|
27
28
|
span?: number;
|
|
28
29
|
gutter?: number;
|
|
29
|
-
children?:
|
|
30
|
+
children?: VNodeChild;
|
|
30
31
|
}
|
|
31
32
|
/** 栅格跨度 → 宽度(纯函数——可单测/SSR) */
|
|
32
33
|
export declare function gridColumns(span: number): string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** HoverCard:悬停富内容卡:openDelay 延迟 + 任意 VNode(shadcn)(showcase /components/hovercard) */
|
|
1
2
|
/**
|
|
2
3
|
* weifuwu/components — HoverCard
|
|
3
4
|
*
|
|
@@ -5,14 +6,14 @@
|
|
|
5
6
|
* (触屏自动降级 tap)+ openDelay/closeDelay + 定位/视口 clamp + Escape。
|
|
6
7
|
* 对应 shadcn HoverCard。
|
|
7
8
|
*/
|
|
8
|
-
import type { Component } from '../../vdom/index.ts';
|
|
9
|
+
import type { Component, VNodeChild } from '../../vdom/index.ts';
|
|
9
10
|
import type { Placement } from '../../vdom/hooks/popup.ts';
|
|
10
11
|
export type HoverCardPosition = Placement;
|
|
11
12
|
export interface HoverCardProps {
|
|
12
13
|
/** 富内容(任意 VNode,区别于 Tooltip 的 string) */
|
|
13
|
-
content
|
|
14
|
+
content?: VNodeChild;
|
|
14
15
|
position?: HoverCardPosition;
|
|
15
|
-
children
|
|
16
|
+
children?: VNodeChild;
|
|
16
17
|
disabled?: boolean;
|
|
17
18
|
/** 悬停打开延迟(ms),默认 150 */
|
|
18
19
|
openDelay?: number;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
+
/** InView:进入视窗后懒加载内容,支持 IntersectionObserver(showcase /components/inview) */
|
|
1
2
|
/**
|
|
2
3
|
* weifuwu/components — InView
|
|
3
4
|
*
|
|
4
5
|
* 进入视窗后替换占位符为真实内容。
|
|
5
6
|
* 实现:ctx.ui.useInView(IO 封装)——滚动/尺寸变化由合成器线程评估,无 scroll 监听。
|
|
6
7
|
*/
|
|
7
|
-
import type { Component } from '../../vdom/index.ts';
|
|
8
|
+
import type { Component, VNodeChild } from '../../vdom/index.ts';
|
|
8
9
|
export interface InViewProps {
|
|
9
10
|
once?: boolean;
|
|
10
11
|
threshold?: number;
|
|
11
12
|
rootMargin?: string;
|
|
12
|
-
placeholder?:
|
|
13
|
+
placeholder?: VNodeChild;
|
|
13
14
|
onEnter?: () => void;
|
|
14
|
-
children?:
|
|
15
|
+
children?: VNodeChild;
|
|
15
16
|
}
|
|
16
17
|
export declare const InView: Component<InViewProps>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/** InfiniteScroll:无限滚动:底部哨兵触底加载 + loading/end 态(showcase /components/infinitescroll) */
|
|
2
|
+
import type { Component, VNodeChild } from '../../vdom/index.ts';
|
|
2
3
|
export interface InfiniteScrollProps {
|
|
3
4
|
hasMore?: boolean;
|
|
4
5
|
loading?: boolean;
|
|
@@ -6,7 +7,7 @@ export interface InfiniteScrollProps {
|
|
|
6
7
|
onLoadMore?: () => void;
|
|
7
8
|
/** 提前触发距离(px) */
|
|
8
9
|
threshold?: number;
|
|
9
|
-
children?:
|
|
10
|
+
children?: VNodeChild;
|
|
10
11
|
loadMoreText?: string;
|
|
11
12
|
endText?: string;
|
|
12
13
|
className?: string;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/** Label:独立标签(required 星号)+ 宽高比容器(内容填满)(showcase /components/label) */
|
|
2
|
+
import type { Component, VNodeChild } from '../../vdom/index.ts';
|
|
2
3
|
export interface LabelProps {
|
|
3
4
|
htmlFor?: string;
|
|
4
5
|
/** 必填星号 */
|
|
5
6
|
required?: boolean;
|
|
6
|
-
children?:
|
|
7
|
+
children?: VNodeChild;
|
|
7
8
|
className?: string;
|
|
8
9
|
[key: string]: any;
|
|
9
10
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** Layout:布局外壳:Sider 折叠 + Header/Content/Footer 骨架(antd Layout / shadcn Sidebar 等价)(showcase /components/layout) */
|
|
1
2
|
/**
|
|
2
3
|
* weifuwu/components — Layout 布局外壳
|
|
3
4
|
*
|
|
@@ -18,11 +19,11 @@
|
|
|
18
19
|
* - 响应式折叠交还用户:useBreakpoint 驱动 collapsed(裁剪:不自动抽屉化)
|
|
19
20
|
* - 静态外壳见 layout `_app-shell.css`(wf-app-shell/wf-sidebar/wf-main)
|
|
20
21
|
*/
|
|
21
|
-
import type { Component } from '../../vdom/index.ts';
|
|
22
|
+
import type { Component, VNodeChild } from '../../vdom/index.ts';
|
|
22
23
|
export interface LayoutProps {
|
|
23
24
|
style?: any;
|
|
24
25
|
className?: string;
|
|
25
|
-
children?:
|
|
26
|
+
children?: VNodeChild;
|
|
26
27
|
}
|
|
27
28
|
export interface LayoutSiderProps {
|
|
28
29
|
width?: number | string;
|
|
@@ -33,19 +34,19 @@ export interface LayoutSiderProps {
|
|
|
33
34
|
collapsible?: boolean;
|
|
34
35
|
onCollapse?: (collapsed: boolean) => void;
|
|
35
36
|
/** 触发器内容(默认 chevron Icon) */
|
|
36
|
-
trigger?:
|
|
37
|
-
children?:
|
|
37
|
+
trigger?: VNodeChild;
|
|
38
|
+
children?: VNodeChild;
|
|
38
39
|
}
|
|
39
40
|
export interface LayoutHeaderProps {
|
|
40
|
-
children?:
|
|
41
|
+
children?: VNodeChild;
|
|
41
42
|
style?: any;
|
|
42
43
|
}
|
|
43
44
|
export interface LayoutContentProps {
|
|
44
|
-
children?:
|
|
45
|
+
children?: VNodeChild;
|
|
45
46
|
style?: any;
|
|
46
47
|
}
|
|
47
48
|
export interface LayoutFooterProps {
|
|
48
|
-
children?:
|
|
49
|
+
children?: VNodeChild;
|
|
49
50
|
style?: any;
|
|
50
51
|
}
|
|
51
52
|
/** 布局容器:含 Sider → row(横向),否则 column(纵向) */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** Link:文字链接:语义色/下划线/disabled/新窗口(showcase /components/link) */
|
|
1
2
|
/**
|
|
2
3
|
* weifuwu/components — Link 文字链接
|
|
3
4
|
*
|
|
@@ -8,15 +9,15 @@
|
|
|
8
9
|
*
|
|
9
10
|
* 裁剪(CS-05,见 docs/client.md):不做 hover 弹层预览/图标内置枚举(icon 任意 VNode)。
|
|
10
11
|
*/
|
|
11
|
-
import type { Component } from '../../vdom/index.ts';
|
|
12
|
+
import type { Component, VNodeChild } from '../../vdom/index.ts';
|
|
12
13
|
export interface LinkProps {
|
|
13
14
|
href?: string;
|
|
14
15
|
variant?: 'default' | 'primary' | 'danger' | 'muted';
|
|
15
16
|
underline?: boolean;
|
|
16
17
|
disabled?: boolean;
|
|
17
18
|
target?: string;
|
|
18
|
-
icon?:
|
|
19
|
+
icon?: VNodeChild;
|
|
19
20
|
onClick?: (e: any) => void;
|
|
20
|
-
children?:
|
|
21
|
+
children?: VNodeChild;
|
|
21
22
|
}
|
|
22
23
|
export declare const Link: Component<LinkProps>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
/** List:通用列表:renderItem + divided + header/footer/empty(showcase /components/list) */
|
|
1
2
|
/**
|
|
2
3
|
* weifuwu/components — List
|
|
3
4
|
*
|
|
4
5
|
* 通用列表:items + renderItem + header/footer/empty 占位。
|
|
5
6
|
* 定位:Table 大材小用的消息/文件/成员列表场景。
|
|
6
7
|
*/
|
|
7
|
-
import type { Component } from '../../vdom/index.ts';
|
|
8
|
+
import type { Component, VNodeChild } from '../../vdom/index.ts';
|
|
8
9
|
export interface ListProps<T = any> {
|
|
9
10
|
items: T[];
|
|
10
11
|
renderItem: (item: T, index: number) => any;
|
|
@@ -12,8 +13,8 @@ export interface ListProps<T = any> {
|
|
|
12
13
|
* 身份跟随内容的 key(如项 id),否则默认下标 = 位置身份,增删后项状态会继承错位(规则表 §3) */
|
|
13
14
|
keyBy?: (item: T, index: number) => string | number;
|
|
14
15
|
divided?: boolean;
|
|
15
|
-
header?:
|
|
16
|
-
footer?:
|
|
16
|
+
header?: VNodeChild;
|
|
17
|
+
footer?: VNodeChild;
|
|
17
18
|
emptyText?: string;
|
|
18
19
|
emptyIcon?: any;
|
|
19
20
|
className?: string;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** ListScaffold:列表页骨架(PageHeader + 工具栏 + loading/empty + 内容插槽)(showcase /components/list-scaffold) */
|
|
2
|
+
import type { Component, VNodeChild } from '../../vdom/index.ts';
|
|
3
|
+
/**
|
|
4
|
+
* weifuwu/components — ListScaffold
|
|
5
|
+
*
|
|
6
|
+
* 列表页骨架原语:PageHeader + 搜索/工具区 + loading/empty 态 + 内容插槽。
|
|
7
|
+
* 各页面差异在内容循环(render 插槽)——头部/状态区单点一致。
|
|
8
|
+
* 组合 PageHeader/EmptyState/Loading(库内组合——无自有样式——布局类单源)。
|
|
9
|
+
*
|
|
10
|
+
* **empty 显式契约**(agent-platform ListScaffold 空态与列表并存 bug 修复——
|
|
11
|
+
* 2027-09 沉淀入库):empty 仅在 `isEmpty` 时渲染——**有数据也显示空态**
|
|
12
|
+
* 的空态/列表并存已消除(原实现 empty 条件缺失 isEmpty——双段显示)。
|
|
13
|
+
* loading 优先于 empty(加载中不闪空态)——空态在 loading 后判断。
|
|
14
|
+
*
|
|
15
|
+
* 来源:agent-platform ListScaffold(>1 消费者 Agents/Departments——
|
|
16
|
+
* 入库判负登记已推翻:用户指令 = 框架层第二消费面确立)。
|
|
17
|
+
*/
|
|
18
|
+
export interface ListScaffoldProps {
|
|
19
|
+
/** 页面标题(PageHeader title) */
|
|
20
|
+
title: string;
|
|
21
|
+
/** 标题副文案 */
|
|
22
|
+
sub?: string;
|
|
23
|
+
/** header 右区(按钮组——JSX 子元素面) */
|
|
24
|
+
actions?: VNodeChild;
|
|
25
|
+
/** 搜索/筛选工具区(loading 时仍渲染——搜索框可用) */
|
|
26
|
+
toolbar?: VNodeChild;
|
|
27
|
+
/** 加载中(loading 优先于 empty——不闪空态) */
|
|
28
|
+
loading?: boolean;
|
|
29
|
+
/** 空态定义(图标/文案/提示) */
|
|
30
|
+
empty?: {
|
|
31
|
+
icon?: string | null;
|
|
32
|
+
text?: string;
|
|
33
|
+
hint?: string;
|
|
34
|
+
};
|
|
35
|
+
/** 内容空(empty 仅在 isEmpty 时显示) */
|
|
36
|
+
isEmpty?: boolean;
|
|
37
|
+
/** 内容插槽(页面核心循环——children 在 empty 之后——有数据时渲染) */
|
|
38
|
+
children?: VNodeChild;
|
|
39
|
+
}
|
|
40
|
+
export declare const ListScaffold: Component<ListScaffoldProps>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** Menu:侧栏导航:分组 + 图标 + 选中态 + 方向键(showcase /components/menu) */
|
|
1
2
|
/**
|
|
2
3
|
* weifuwu/components — Menu
|
|
3
4
|
*
|
|
@@ -5,15 +6,17 @@
|
|
|
5
6
|
* 用于 SaaS 应用侧边导航(替代手写 nav-item 循环)。
|
|
6
7
|
* 裁剪(CS-05,见 docs/client.md):水平菜单栏(Menubar,独立组件)、子菜单自动互斥。折叠态子菜单浮层已实现(openPopup 内核基座)。
|
|
7
8
|
*/
|
|
8
|
-
import type { Component } from '../../vdom/index.ts';
|
|
9
|
+
import type { Component, VNodeChild } from '../../vdom/index.ts';
|
|
9
10
|
export interface MenuItem {
|
|
10
11
|
key: string;
|
|
11
|
-
label
|
|
12
|
-
icon?:
|
|
12
|
+
label?: VNodeChild;
|
|
13
|
+
icon?: VNodeChild;
|
|
13
14
|
/** 分组标题(相邻同组项之间插分组头) */
|
|
14
15
|
group?: string;
|
|
15
16
|
active?: boolean;
|
|
16
17
|
danger?: boolean;
|
|
18
|
+
/** 计数徽标(数字 → Badge count 胶囊——99+ 溢出;label 直传自定义形态) */
|
|
19
|
+
badge?: string | number;
|
|
17
20
|
onClick?: () => void;
|
|
18
21
|
/** 子菜单项(有 children 即渲染为可展开子菜单) */
|
|
19
22
|
children?: MenuItem[];
|