weifuwu 0.78.0 → 0.79.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 +5 -5
- package/dist/components/AlertGroup/AlertGroup.d.ts +1 -1
- package/dist/components/Anchor/Anchor.d.ts +1 -1
- package/dist/components/AuthPage/AuthPage.d.ts +36 -0
- package/dist/components/AutoComplete/AutoComplete.d.ts +3 -1
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +1 -1
- package/dist/components/Calendar/Calendar.d.ts +1 -1
- package/dist/components/Carousel/Carousel.d.ts +1 -1
- package/dist/components/Cascader/Cascader.d.ts +1 -1
- package/dist/components/ChatInput/ChatInput.d.ts +51 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +2 -0
- package/dist/components/FloatButton/FloatButton.d.ts +1 -1
- package/dist/components/Grid/Grid.d.ts +1 -1
- package/dist/components/InputNumber/InputNumber.d.ts +1 -1
- package/dist/components/JSONViewer/JSONViewer.d.ts +1 -1
- package/dist/components/Link/Link.d.ts +1 -1
- package/dist/components/LogViewer/LogViewer.d.ts +1 -1
- package/dist/components/Markdown/parser.d.ts +1 -1
- package/dist/components/Mentions/Mentions.d.ts +1 -1
- package/dist/components/Menu/Menu.d.ts +1 -1
- package/dist/components/Menubar/Menubar.d.ts +1 -1
- package/dist/components/MessageBubble/MessageBubble.d.ts +1 -1
- package/dist/components/NavMenu/NavMenu.d.ts +1 -1
- package/dist/components/Popconfirm/Popconfirm.d.ts +1 -1
- package/dist/components/Result/Result.d.ts +1 -1
- package/dist/components/Scrollbar/Scrollbar.d.ts +1 -1
- package/dist/components/SearchInput/SearchInput.d.ts +1 -0
- package/dist/components/Slider/Slider.d.ts +1 -0
- package/dist/components/TagsInput/TagsInput.d.ts +1 -1
- package/dist/components/Timeline/Timeline.d.ts +1 -1
- package/dist/components/Transfer/Transfer.d.ts +1 -1
- package/dist/components/TreeSelect/TreeSelect.d.ts +2 -0
- package/dist/components/VirtualList/VirtualList.d.ts +3 -1
- package/dist/components/VirtualTable/VirtualTable.d.ts +1 -1
- package/dist/components/Watermark/Watermark.d.ts +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +12 -12
- package/dist/components/style.css +77 -23
- package/dist/index.js +21 -3
- package/dist/ui-dom/index.js +11 -11
- package/dist/ui-dom/jsx-runtime.js +1 -1
- package/dist/ui-dom/testing.js +1 -1
- package/dist/ui-dom/vdom/diff.d.ts +2 -6
- package/dist/ui-dom/vdom/render.d.ts +2 -2
- package/dist/ui-dom/vdom/transform.d.ts +16 -1
- package/dist/ui-dom/vnode.d.ts +5 -1
- package/docs/components-map.md +3 -1
- package/docs/components.md +6 -3
- package/package.json +1 -1
|
@@ -1783,29 +1783,6 @@ body.wf-dragging {
|
|
|
1783
1783
|
padding: var(--wf-space-sm);
|
|
1784
1784
|
}
|
|
1785
1785
|
|
|
1786
|
-
.wf-aichat-inputbar {
|
|
1787
|
-
display: flex;
|
|
1788
|
-
gap: var(--wf-gap-sm);
|
|
1789
|
-
align-items: center;
|
|
1790
|
-
}
|
|
1791
|
-
|
|
1792
|
-
.wf-aichat-input {
|
|
1793
|
-
flex: 1;
|
|
1794
|
-
min-width: 0;
|
|
1795
|
-
height: var(--wf-control-height);
|
|
1796
|
-
padding: var(--wf-control-pad-y) var(--wf-space-md);
|
|
1797
|
-
border: 1px solid var(--wf-color-border);
|
|
1798
|
-
border-radius: var(--wf-radius);
|
|
1799
|
-
font-family: var(--wf-font-sans);
|
|
1800
|
-
font-size: var(--wf-font-size-sm);
|
|
1801
|
-
color: var(--wf-color-text);
|
|
1802
|
-
background: var(--wf-color-bg);
|
|
1803
|
-
}
|
|
1804
|
-
|
|
1805
|
-
.wf-aichat-input:focus {
|
|
1806
|
-
outline: none;
|
|
1807
|
-
border-color: var(--wf-color-primary);
|
|
1808
|
-
}
|
|
1809
1786
|
|
|
1810
1787
|
/* weifuwu/components — Alert */
|
|
1811
1788
|
|
|
@@ -2130,6 +2107,10 @@ body.wf-dragging {
|
|
|
2130
2107
|
color: var(--wf-color-primary-text);
|
|
2131
2108
|
}
|
|
2132
2109
|
|
|
2110
|
+
/* error(F2 状态矩阵) */
|
|
2111
|
+
.wf-autocomplete-input--err { border-color: var(--wf-color-error); }
|
|
2112
|
+
.wf-autocomplete-input--err:focus { box-shadow: 0 0 0 2px var(--wf-color-error-bg), 0 0 0 1px var(--wf-color-error); }
|
|
2113
|
+
|
|
2133
2114
|
/* weifuwu/components — Avatar */
|
|
2134
2115
|
|
|
2135
2116
|
.wf-avatar {
|
|
@@ -2853,6 +2834,12 @@ body.wf-dragging {
|
|
|
2853
2834
|
text-align: center;
|
|
2854
2835
|
}
|
|
2855
2836
|
|
|
2837
|
+
/* 键盘高亮(R43 W1):与 hover 同视觉,但独立 class(键盘导航可见性) */
|
|
2838
|
+
.wf-cascader-opt--hl {
|
|
2839
|
+
background: var(--wf-color-primary-bg);
|
|
2840
|
+
color: var(--wf-color-primary-text);
|
|
2841
|
+
}
|
|
2842
|
+
|
|
2856
2843
|
/* weifuwu/components — Chart */
|
|
2857
2844
|
|
|
2858
2845
|
.wf-chart {
|
|
@@ -2921,6 +2908,43 @@ body.wf-dragging {
|
|
|
2921
2908
|
opacity: 0.8;
|
|
2922
2909
|
}
|
|
2923
2910
|
|
|
2911
|
+
/* weifuwu/components — ChatInput(独立聊天输入条——从 AiChat 输入条抽取) */
|
|
2912
|
+
|
|
2913
|
+
.wf-chat-inputbar {
|
|
2914
|
+
display: flex;
|
|
2915
|
+
gap: var(--wf-gap-sm);
|
|
2916
|
+
align-items: center;
|
|
2917
|
+
}
|
|
2918
|
+
|
|
2919
|
+
.wf-chat-input {
|
|
2920
|
+
flex: 1;
|
|
2921
|
+
min-width: 0;
|
|
2922
|
+
height: var(--wf-control-height);
|
|
2923
|
+
padding: var(--wf-control-pad-y) var(--wf-space-md);
|
|
2924
|
+
border: 1px solid var(--wf-color-border);
|
|
2925
|
+
border-radius: var(--wf-radius);
|
|
2926
|
+
font-family: var(--wf-font-sans);
|
|
2927
|
+
font-size: var(--wf-font-size-sm);
|
|
2928
|
+
color: var(--wf-color-text);
|
|
2929
|
+
background: var(--wf-color-bg);
|
|
2930
|
+
}
|
|
2931
|
+
|
|
2932
|
+
.wf-chat-input:focus {
|
|
2933
|
+
outline: none;
|
|
2934
|
+
border-color: var(--wf-color-primary);
|
|
2935
|
+
}
|
|
2936
|
+
|
|
2937
|
+
.wf-chat-input:hover:not(:disabled) {
|
|
2938
|
+
border-color: var(--wf-color-primary-muted, var(--wf-color-primary));
|
|
2939
|
+
}
|
|
2940
|
+
|
|
2941
|
+
/* 多行 textarea:自适应高度(行数由内容撑开) */
|
|
2942
|
+
.wf-chat-inputbar textarea.wf-chat-input {
|
|
2943
|
+
height: auto;
|
|
2944
|
+
min-height: var(--wf-control-height);
|
|
2945
|
+
line-height: 1.5;
|
|
2946
|
+
}
|
|
2947
|
+
|
|
2924
2948
|
/* weifuwu/components — Checkbox */
|
|
2925
2949
|
|
|
2926
2950
|
.wf-checkbox {
|
|
@@ -3970,6 +3994,10 @@ body.wf-dragging {
|
|
|
3970
3994
|
overflow-x: auto;
|
|
3971
3995
|
}
|
|
3972
3996
|
|
|
3997
|
+
/* error(F2 状态矩阵) */
|
|
3998
|
+
.wf-datepicker-input--err { border-color: var(--wf-color-error); }
|
|
3999
|
+
.wf-datepicker-input--err:focus { box-shadow: 0 0 0 2px var(--wf-color-error-bg), 0 0 0 1px var(--wf-color-error); }
|
|
4000
|
+
|
|
3973
4001
|
/* weifuwu/components — Descriptions */
|
|
3974
4002
|
|
|
3975
4003
|
.wf-descriptions {
|
|
@@ -4379,6 +4407,12 @@ body.wf-dragging {
|
|
|
4379
4407
|
to { opacity: 1; }
|
|
4380
4408
|
}
|
|
4381
4409
|
|
|
4410
|
+
/* 键盘高亮(R43 W1):菜单方向键导航可见性 */
|
|
4411
|
+
.wf-dropdown-item--hl {
|
|
4412
|
+
background: var(--wf-color-primary-bg);
|
|
4413
|
+
color: var(--wf-color-primary-text);
|
|
4414
|
+
}
|
|
4415
|
+
|
|
4382
4416
|
/* weifuwu/components — Editor */
|
|
4383
4417
|
|
|
4384
4418
|
.wf-editor { position: relative;
|
|
@@ -7805,6 +7839,10 @@ body.wf-dragging {
|
|
|
7805
7839
|
color: var(--wf-color-text);
|
|
7806
7840
|
}
|
|
7807
7841
|
|
|
7842
|
+
/* disabled(F2 状态矩阵) */
|
|
7843
|
+
.wf-search-input--dis { opacity: 0.5; cursor: not-allowed; }
|
|
7844
|
+
.wf-search-input:disabled { cursor: not-allowed; }
|
|
7845
|
+
|
|
7808
7846
|
/* weifuwu/components — SegmentedControl */
|
|
7809
7847
|
|
|
7810
7848
|
.wf-segmented {
|
|
@@ -8372,6 +8410,10 @@ body.wf-dragging {
|
|
|
8372
8410
|
text-align: center;
|
|
8373
8411
|
}
|
|
8374
8412
|
|
|
8413
|
+
/* disabled(F2 状态矩阵) */
|
|
8414
|
+
.wf-slider-input--dis { opacity: 0.5; cursor: not-allowed; }
|
|
8415
|
+
.wf-slider-input:disabled { cursor: not-allowed; }
|
|
8416
|
+
|
|
8375
8417
|
/* weifuwu/components — Space 间距容器 */
|
|
8376
8418
|
|
|
8377
8419
|
.wf-space {
|
|
@@ -9936,6 +9978,11 @@ body.wf-dragging {
|
|
|
9936
9978
|
overflow: auto;
|
|
9937
9979
|
}
|
|
9938
9980
|
|
|
9981
|
+
/* disabled / error(F2 状态矩阵) */
|
|
9982
|
+
.wf-treeselect-trigger--dis { opacity: 0.5; cursor: not-allowed; background: var(--wf-color-fill); }
|
|
9983
|
+
.wf-treeselect-trigger--err { border-color: var(--wf-color-error); }
|
|
9984
|
+
.wf-treeselect-trigger--err:focus-visible { box-shadow: 0 0 0 2px var(--wf-color-error-bg), 0 0 0 1px var(--wf-color-error); }
|
|
9985
|
+
|
|
9939
9986
|
/* weifuwu/components — Typography */
|
|
9940
9987
|
|
|
9941
9988
|
.wf-title {
|
|
@@ -10028,6 +10075,13 @@ body.wf-dragging {
|
|
|
10028
10075
|
box-sizing: border-box;
|
|
10029
10076
|
}
|
|
10030
10077
|
|
|
10078
|
+
/* 空态(F2 状态矩阵) */
|
|
10079
|
+
.wf-virtual-list--empty {
|
|
10080
|
+
display: flex; align-items: center; justify-content: center;
|
|
10081
|
+
color: var(--wf-color-text-tertiary);
|
|
10082
|
+
font-size: var(--wf-font-size-sm);
|
|
10083
|
+
}
|
|
10084
|
+
|
|
10031
10085
|
/* weifuwu/components — VirtualTable(固定表头 + 虚拟滚动表体) */
|
|
10032
10086
|
|
|
10033
10087
|
.wf-virtual-table {
|
package/dist/index.js
CHANGED
|
@@ -3095,6 +3095,17 @@ function holeDetail(v) {
|
|
|
3095
3095
|
}
|
|
3096
3096
|
return `bad-vnode type=${typeof v}`;
|
|
3097
3097
|
}
|
|
3098
|
+
function quoteIfNeeded(s) {
|
|
3099
|
+
return /[\s"=]/.test(s) ? `"${s.replace(/"/g, "'")}"` : s;
|
|
3100
|
+
}
|
|
3101
|
+
function holeMarkup(opts) {
|
|
3102
|
+
const parts = [`type=${opts.type}`];
|
|
3103
|
+
if (opts.value !== void 0) parts.push(`value=${quoteIfNeeded(holeDetail(opts.value))}`);
|
|
3104
|
+
if (opts.key != null) parts.push(`key=${quoteIfNeeded(opts.key)}`);
|
|
3105
|
+
if (opts.id != null) parts.push(`id=${quoteIfNeeded(opts.id)}`);
|
|
3106
|
+
if (opts.fid != null) parts.push(`fid=${quoteIfNeeded(opts.fid)}`);
|
|
3107
|
+
return `wf-hole: ${parts.join(" ")}`;
|
|
3108
|
+
}
|
|
3098
3109
|
function isInvalidVNodeType(t) {
|
|
3099
3110
|
return typeof t !== "string" && typeof t !== "function" && t !== Fragment && t !== Portal;
|
|
3100
3111
|
}
|
|
@@ -3134,8 +3145,14 @@ async function renderSsr(input, ctx) {
|
|
|
3134
3145
|
if (typeof input === "string" || typeof input === "number") return escape(String(input));
|
|
3135
3146
|
if (Array.isArray(input)) {
|
|
3136
3147
|
ensureArrayKeys(input);
|
|
3137
|
-
const
|
|
3138
|
-
|
|
3148
|
+
const fidBase = ctx._fidPath;
|
|
3149
|
+
const parts = await Promise.all(input.map(async (c, i) => {
|
|
3150
|
+
const childFid = fidBase != null ? `${fidBase}-${i}` : String(i);
|
|
3151
|
+
if (c == null || typeof c === "boolean") return Promise.resolve(`<!--${holeMarkup({ type: "hole", value: c })}-->`);
|
|
3152
|
+
if (Array.isArray(c)) {
|
|
3153
|
+
const inner = await renderSsr(c, { ...ctx, _fidPath: childFid });
|
|
3154
|
+
return `<!--${holeMarkup({ type: "fragment-start", key: String(i), fid: childFid })}-->${inner}<!--${holeMarkup({ type: "fragment-end", key: String(i), fid: childFid })}-->`;
|
|
3155
|
+
}
|
|
3139
3156
|
return renderSsr(c, ctx);
|
|
3140
3157
|
}));
|
|
3141
3158
|
return parts.join("");
|
|
@@ -3143,11 +3160,12 @@ async function renderSsr(input, ctx) {
|
|
|
3143
3160
|
const vnode = input;
|
|
3144
3161
|
if (isInvalidVNodeType(vnode.type)) {
|
|
3145
3162
|
console.warn(`[weifuwu] children \u9879\u975E\u6CD5\uFF1Atype=${String(vnode.type)}\uFF08${typeof vnode.type}\uFF09\u2014\u2014\u5DF2\u5360\u4F4D\uFF08wf-hole\uFF09`);
|
|
3146
|
-
return
|
|
3163
|
+
return `<!--${holeMarkup({ type: "hole", value: input })}-->`;
|
|
3147
3164
|
}
|
|
3148
3165
|
if (vnode.type === Portal || vnode.type === Fragment) return renderSsr(vnode.props?.children, ctx);
|
|
3149
3166
|
if (typeof vnode.type === "function") {
|
|
3150
3167
|
const childCtx = Object.create(ctx);
|
|
3168
|
+
delete childCtx._fidPath;
|
|
3151
3169
|
const renderFn = await vnode.type(vnode.props ?? {}, childCtx);
|
|
3152
3170
|
if (typeof renderFn !== "function") {
|
|
3153
3171
|
throw new Error(
|