weifuwu 0.93.2 → 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/dist/client/components/AppShell/AppShell.d.ts +18 -1
- package/dist/client/components/CronPicker/CronPicker.d.ts +31 -0
- package/dist/client/components/ListScaffold/ListScaffold.d.ts +40 -0
- package/dist/client/components/Menu/Menu.d.ts +2 -0
- package/dist/client/components/StatusDot/StatusDot.d.ts +25 -0
- package/dist/client/components/index.d.ts +6 -0
- package/dist/client/components/index.js +36 -36
- package/dist/client/components/style.css +1 -1
- package/docs/client.md +20 -1
- package/package.json +1 -1
|
@@ -11,11 +11,22 @@
|
|
|
11
11
|
* (wf-app-shell + wf-sidebar 系列 + wf-main——grid 栅格 + 移动端降级),
|
|
12
12
|
* 组件只补品牌区/用户区细节(AppShell.css)。
|
|
13
13
|
*
|
|
14
|
+
* **移动抽屉(W2——AppLayout 功能面入库)**:`mobile` prop 父层驱动
|
|
15
|
+
* (useBreakpoint 交还用户——库惯例同 Layout/NavMenu「响应式折叠交还用户」;
|
|
16
|
+
* 零 breakpoint 内建保证 SSR 首帧确定性——node 无 matchMedia 时 useBreakpoint
|
|
17
|
+
* 恒返回基档(mobile)导致 SSR≡SPA 首帧不一致(absorb 违例——实证))。
|
|
18
|
+
* <768 侧栏转抽屉(translateX 滑入——layout 堆叠降级被替换)+ 遮罩 + 移动
|
|
19
|
+
* 顶栏(NavBar——汉堡开抽屉 · 右侧设置)+ aside 头部关闭按钮。
|
|
20
|
+
*
|
|
21
|
+
* **导航徽标(W2)**:nav[].badge → Menu badge 胶囊(Badge count——
|
|
22
|
+
* 99+ 溢出内建)——审批待办计数场景。
|
|
23
|
+
*
|
|
14
24
|
* 状态约定(父层驱动):
|
|
15
25
|
* - nav/path:菜单数据与当前路由(activeKey 计算)
|
|
16
26
|
* - user:用户信息(null = 未登录——父层守卫跳登录)
|
|
17
27
|
* - onNavigate/onLogout/onSettings:回调上抛
|
|
18
28
|
* - loading:守卫加载态(骨架占位)
|
|
29
|
+
* - mobile:移动模式(父层 breakpoint 判定)——抽屉/顶栏分支
|
|
19
30
|
*/
|
|
20
31
|
import type { Component, VNodeChild } from '../../vdom/index.ts';
|
|
21
32
|
export interface AppShellNavItem {
|
|
@@ -23,9 +34,11 @@ export interface AppShellNavItem {
|
|
|
23
34
|
label: string;
|
|
24
35
|
icon?: VNodeChild;
|
|
25
36
|
group?: string;
|
|
37
|
+
/** 导航徽标(数字 → Badge count 胶囊——99+ 溢出内建) */
|
|
38
|
+
badge?: string | number;
|
|
26
39
|
}
|
|
27
40
|
export interface AppShellProps {
|
|
28
|
-
/** 导航菜单项(Menu items——key/label/icon/group) */
|
|
41
|
+
/** 导航菜单项(Menu items——key/label/icon/group/badge) */
|
|
29
42
|
nav?: AppShellNavItem[];
|
|
30
43
|
/** 当前路由路径(activeKey 匹配——'/' 精确,其余前缀) */
|
|
31
44
|
path?: string;
|
|
@@ -52,5 +65,9 @@ export interface AppShellProps {
|
|
|
52
65
|
footer?: VNodeChild;
|
|
53
66
|
/** 侧栏宽度(layout 变量——默认 240px) */
|
|
54
67
|
sidebarWidth?: string;
|
|
68
|
+
/** 移动顶栏标题(默认 brand.name) */
|
|
69
|
+
mobileTitle?: string;
|
|
70
|
+
/** 移动模式(父层 breakpoint 判定——抽屉/顶栏分支;SSR 一致性:默认 false) */
|
|
71
|
+
mobile?: boolean;
|
|
55
72
|
}
|
|
56
73
|
export declare const AppShell: Component<AppShellProps>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** CronPicker:cron 表达式快捷输入(预置常见 + 自由编辑)(showcase /components/cronpicker) */
|
|
2
|
+
import type { Component } from '../../vdom/index.ts';
|
|
3
|
+
/**
|
|
4
|
+
* weifuwu/components — CronPicker
|
|
5
|
+
*
|
|
6
|
+
* cron 表达式输入原语:预置语义 + 自由编辑双通道。
|
|
7
|
+
* - 预置面:常见档(每分钟/每 5 分钟/每小时/每天/工作日——单源 PRESETS)
|
|
8
|
+
* - 自由面:Input 直编(任何 cron 表达式——服务端解析器裁决语义)
|
|
9
|
+
* - 契约:preset 选中 → onChange(五段 * / N / N-M / N,M 与 server 解析器
|
|
10
|
+
* 语义对齐——见 src/server/... cron 解析面);自由输入全量直传。
|
|
11
|
+
*
|
|
12
|
+
* 来源:agent-platform CronPicker(平台层单一消费者 workflow 详情——入
|
|
13
|
+
* 库判负登记已推翻(用户指令 = 第二消费面确立)——库件标准形(Select 单源
|
|
14
|
+
* 表单面——替换原生 select)。
|
|
15
|
+
*/
|
|
16
|
+
export interface CronPickerProps {
|
|
17
|
+
value: string;
|
|
18
|
+
onChange?: (v: string) => void;
|
|
19
|
+
/** 预置档(默认 6 档——Preset 可覆盖——自定义场景) */
|
|
20
|
+
presets?: {
|
|
21
|
+
label: string;
|
|
22
|
+
value: string;
|
|
23
|
+
}[];
|
|
24
|
+
/** 预设选择占位文案 */
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare const CRON_PRESETS: {
|
|
28
|
+
label: string;
|
|
29
|
+
value: string;
|
|
30
|
+
}[];
|
|
31
|
+
export declare const CronPicker: Component<CronPickerProps>;
|
|
@@ -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>;
|
|
@@ -15,6 +15,8 @@ export interface MenuItem {
|
|
|
15
15
|
group?: string;
|
|
16
16
|
active?: boolean;
|
|
17
17
|
danger?: boolean;
|
|
18
|
+
/** 计数徽标(数字 → Badge count 胶囊——99+ 溢出;label 直传自定义形态) */
|
|
19
|
+
badge?: string | number;
|
|
18
20
|
onClick?: () => void;
|
|
19
21
|
/** 子菜单项(有 children 即渲染为可展开子菜单) */
|
|
20
22
|
children?: MenuItem[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** StatusDot:状态点(on/tone 语义——label 缺省只渲染点)(showcase /components/status-dot) */
|
|
2
|
+
import type { Component, VNodeChild } from '../../vdom/index.ts';
|
|
3
|
+
/**
|
|
4
|
+
* weifuwu/components — StatusDot
|
|
5
|
+
*
|
|
6
|
+
* 状态点原语(颜色语义——一个状态一个声音)。
|
|
7
|
+
* 契约(agent-platform StatusDot 语言化——原名「自带默认文案的运行中/已暂停」
|
|
8
|
+
* 与调用方状态标签撞车——双标签实证修复):
|
|
9
|
+
* - **label 缺省只渲染点**(文字是调用方职责——防双标签)
|
|
10
|
+
* - tone 覆盖点/文字色:success 绿(健康运行)· warning 黄(降级)·
|
|
11
|
+
* error 红(故障)· default 灰(非活跃)
|
|
12
|
+
* - on 是主开关(true→success · false→default)——tone 仅在非绿非灰时传
|
|
13
|
+
*
|
|
14
|
+
* 来源:agent-platform ui.tsx StatusDot(平台原语——库无状态点面——
|
|
15
|
+
* 入库:通用状态语义组件)。
|
|
16
|
+
*/
|
|
17
|
+
export interface StatusDotProps {
|
|
18
|
+
/** 状态开关(true→success · false→default) */
|
|
19
|
+
on?: boolean;
|
|
20
|
+
/** 状态文案(缺省只渲染点——文字是调用方职责) */
|
|
21
|
+
label?: VNodeChild;
|
|
22
|
+
/** 覆盖色(非绿非灰时传——降级/故障) */
|
|
23
|
+
tone?: 'success' | 'warning' | 'error' | 'default';
|
|
24
|
+
}
|
|
25
|
+
export declare const StatusDot: Component<StatusDotProps>;
|
|
@@ -290,3 +290,9 @@ export { Math } from './Math/Math.ts';
|
|
|
290
290
|
export type { MathProps } from './Math/Math.ts';
|
|
291
291
|
export { WordCloud } from './WordCloud/WordCloud.ts';
|
|
292
292
|
export type { WordCloudProps, WordCloudData } from './WordCloud/WordCloud.ts';
|
|
293
|
+
export { CronPicker } from './CronPicker/CronPicker.ts';
|
|
294
|
+
export type { CronPickerProps } from './CronPicker/CronPicker.ts';
|
|
295
|
+
export { ListScaffold } from './ListScaffold/ListScaffold.ts';
|
|
296
|
+
export type { ListScaffoldProps } from './ListScaffold/ListScaffold.ts';
|
|
297
|
+
export { StatusDot } from './StatusDot/StatusDot.ts';
|
|
298
|
+
export type { StatusDotProps } from './StatusDot/StatusDot.ts';
|