@manohub/ui 1.1.4 → 1.2.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/dist/components/button/index.d.ts +12 -12
- package/dist/components/capsule/index.d.ts +1 -1
- package/dist/components/code-block/index.d.ts +5 -5
- package/dist/components/date-picker/date-panel.d.ts +1 -1
- package/dist/components/date-picker/index.d.ts +6 -6
- package/dist/components/dialog/index.d.ts +2 -12
- package/dist/components/dialog/index.js +8 -7
- package/dist/components/drawer/index.js +7 -1
- package/dist/components/filter/index.d.ts +2 -2
- package/dist/components/form/index.d.ts +4 -4
- package/dist/components/input/index.d.ts +10 -10
- package/dist/components/input/number-input.d.ts +2 -2
- package/dist/components/list/list-shared.d.ts +11 -0
- package/dist/components/list/list-shared.js +13 -2
- package/dist/components/list/list.d.ts +1 -1
- package/dist/components/list/tree.d.ts +18 -1
- package/dist/components/list/tree.js +9 -0
- package/dist/components/list-view/index.d.ts +2 -2
- package/dist/components/notice/index.d.ts +2 -2
- package/dist/components/notification/index.d.ts +1 -1
- package/dist/components/page/index.d.ts +2 -4
- package/dist/components/page/index.js +9 -2
- package/dist/components/panel/index.d.ts +2 -2
- package/dist/components/panel/index.js +10 -3
- package/dist/components/query-state/index.d.ts +1 -3
- package/dist/components/radio/index.d.ts +7 -7
- package/dist/components/scrollbar/index.d.ts +50 -0
- package/dist/components/scrollbar/index.js +187 -0
- package/dist/components/select/select-list.d.ts +1 -3
- package/dist/components/select/select-tree.d.ts +24 -2
- package/dist/components/select/select-tree.js +19 -3
- package/dist/components/tabbar/index.d.ts +1 -1
- package/dist/components/table/index.js +10 -3
- package/dist/components/tabs/index.d.ts +3 -3
- package/dist/components/toast/index.d.ts +4 -4
- package/dist/styles/components/dialog.css +21 -6
- package/dist/styles/components/drawer.css +18 -5
- package/dist/styles/components/list.css +17 -0
- package/dist/styles/components/page.css +20 -3
- package/dist/styles/components/panel.css +17 -0
- package/dist/styles/components/scrollbar.css +63 -0
- package/dist/styles/components/table.css +33 -4
- package/dist/styles/index.css +1 -0
- package/package.json +2 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineComponent, computed, ref, onMounted, onUpdated, createVNode } from "vue";
|
|
2
2
|
import { Icon } from "@manohub/icon";
|
|
3
3
|
import { Checkbox } from "../checkbox/index.js";
|
|
4
|
+
import { useOverlayScrollbar } from "../scrollbar/index.js";
|
|
4
5
|
const Table = /* @__PURE__ */ defineComponent({
|
|
5
6
|
name: "Table",
|
|
6
7
|
inheritAttrs: false,
|
|
@@ -344,6 +345,7 @@ const Table = /* @__PURE__ */ defineComponent({
|
|
|
344
345
|
};
|
|
345
346
|
onMounted(syncHead);
|
|
346
347
|
onUpdated(syncHead);
|
|
348
|
+
const scrollbar = useOverlayScrollbar(scrollBoxRef);
|
|
347
349
|
return () => {
|
|
348
350
|
const fill = props.fill !== false;
|
|
349
351
|
const tableClass = ["mh-table", resolvedSize.value === "sm" ? "mh-table--sm" : "", resolvedSize.value === "lg" ? "mh-table--lg" : "", props.bordered ? "" : "mh-table--borderless", fill ? "mh-table--fill" : "", fill || props.layout === "fixed" ? "mh-table--fixed" : "", attrs.class].filter(Boolean).join(" ");
|
|
@@ -369,10 +371,15 @@ const Table = /* @__PURE__ */ defineComponent({
|
|
|
369
371
|
return createVNode("div", {
|
|
370
372
|
"class": "mh-table-wrapper",
|
|
371
373
|
"style": attrs.style
|
|
372
|
-
}, [batchBar, createVNode("
|
|
374
|
+
}, [batchBar, createVNode("div", {
|
|
375
|
+
"class": "mh-table__body mh-table__body--auto"
|
|
376
|
+
}, [createVNode("div", {
|
|
377
|
+
"class": "mh-table-scroll mh-table-scroll--auto",
|
|
378
|
+
"ref": scrollBoxRef
|
|
379
|
+
}, [createVNode("table", {
|
|
373
380
|
"class": bodyTableClass,
|
|
374
381
|
"style": cellTokens
|
|
375
|
-
}, [colElements(), props.showHeader ? renderHead() : null, renderBody()]), summaryBar, loadingOverlay]);
|
|
382
|
+
}, [colElements(), props.showHeader ? renderHead() : null, renderBody()])]), scrollbar.render()]), summaryBar, loadingOverlay]);
|
|
376
383
|
}
|
|
377
384
|
const wrapperStyle = props.fill === true || props.fill === "parent" ? [{
|
|
378
385
|
height: "100%"
|
|
@@ -400,7 +407,7 @@ const Table = /* @__PURE__ */ defineComponent({
|
|
|
400
407
|
}, [createVNode("table", {
|
|
401
408
|
"class": bodyTableClass,
|
|
402
409
|
"style": cellTokens
|
|
403
|
-
}, [colElements(), renderBody()])]), loadingOverlay]), summaryBar]);
|
|
410
|
+
}, [colElements(), renderBody()])]), scrollbar.render(), loadingOverlay]), summaryBar]);
|
|
404
411
|
};
|
|
405
412
|
}
|
|
406
413
|
});
|
|
@@ -70,9 +70,9 @@ export declare const TabPanel: import("vue").DefineComponent<import("vue").Extra
|
|
|
70
70
|
type: BooleanConstructor;
|
|
71
71
|
default: boolean;
|
|
72
72
|
};
|
|
73
|
-
}>, () => string | number | boolean | VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
73
|
+
}>, () => string | number | boolean | import("vue").VNodeArrayChildren | VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
74
74
|
[key: string]: any;
|
|
75
|
-
}> |
|
|
75
|
+
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
76
76
|
name: {
|
|
77
77
|
type: StringConstructor;
|
|
78
78
|
required: true;
|
|
@@ -186,8 +186,8 @@ export declare const Tabs: import("vue").DefineComponent<import("vue").ExtractPr
|
|
|
186
186
|
"onUpdate:value"?: ((value: string | number) => any) | undefined;
|
|
187
187
|
}>, {
|
|
188
188
|
size: ControlSize;
|
|
189
|
-
value: string | number | undefined;
|
|
190
189
|
onChange: (value: string | number) => void;
|
|
190
|
+
value: string | number | undefined;
|
|
191
191
|
options: TabsOption[];
|
|
192
192
|
defaultValue: string | number | undefined;
|
|
193
193
|
lazy: boolean;
|
|
@@ -90,7 +90,7 @@ export declare const Toast: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
90
90
|
onClose?: (() => any) | undefined;
|
|
91
91
|
}>, {
|
|
92
92
|
text: string;
|
|
93
|
-
icon: boolean | "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "
|
|
93
|
+
icon: boolean | "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "close" | "pause" | "play" | "image" | "delete" | "key" | "application" | "client" | "service" | "schema" | "compose" | "log" | "mcp" | "agent" | "server" | "exposure" | "openapi" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "chevrons-left" | "chevrons-right" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "tool" | "plus" | "notification" | "settings" | "logout" | "home" | "workbench" | "apps" | "favorite" | "page-title" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "info-circle" | "check-circle" | "alert-circle" | "play-filled" | "pause-filled" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
|
|
94
94
|
closable: boolean;
|
|
95
95
|
tone: ToastTone;
|
|
96
96
|
action: string;
|
|
@@ -142,7 +142,7 @@ export declare const ToastCompound: {
|
|
|
142
142
|
close: () => true;
|
|
143
143
|
}, import("vue").PublicProps, {
|
|
144
144
|
text: string;
|
|
145
|
-
icon: boolean | "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "
|
|
145
|
+
icon: boolean | "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "close" | "pause" | "play" | "image" | "delete" | "key" | "application" | "client" | "service" | "schema" | "compose" | "log" | "mcp" | "agent" | "server" | "exposure" | "openapi" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "chevrons-left" | "chevrons-right" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "tool" | "plus" | "notification" | "settings" | "logout" | "home" | "workbench" | "apps" | "favorite" | "page-title" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "info-circle" | "check-circle" | "alert-circle" | "play-filled" | "pause-filled" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
|
|
146
146
|
closable: boolean;
|
|
147
147
|
tone: ToastTone;
|
|
148
148
|
action: string;
|
|
@@ -196,7 +196,7 @@ export declare const ToastCompound: {
|
|
|
196
196
|
onClose?: (() => any) | undefined;
|
|
197
197
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
|
|
198
198
|
text: string;
|
|
199
|
-
icon: boolean | "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "
|
|
199
|
+
icon: boolean | "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "close" | "pause" | "play" | "image" | "delete" | "key" | "application" | "client" | "service" | "schema" | "compose" | "log" | "mcp" | "agent" | "server" | "exposure" | "openapi" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "chevrons-left" | "chevrons-right" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "tool" | "plus" | "notification" | "settings" | "logout" | "home" | "workbench" | "apps" | "favorite" | "page-title" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "info-circle" | "check-circle" | "alert-circle" | "play-filled" | "pause-filled" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
|
|
200
200
|
closable: boolean;
|
|
201
201
|
tone: ToastTone;
|
|
202
202
|
action: string;
|
|
@@ -247,7 +247,7 @@ export declare const ToastCompound: {
|
|
|
247
247
|
close: () => true;
|
|
248
248
|
}, string, {
|
|
249
249
|
text: string;
|
|
250
|
-
icon: boolean | "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "
|
|
250
|
+
icon: boolean | "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "close" | "pause" | "play" | "image" | "delete" | "key" | "application" | "client" | "service" | "schema" | "compose" | "log" | "mcp" | "agent" | "server" | "exposure" | "openapi" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "chevrons-left" | "chevrons-right" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "tool" | "plus" | "notification" | "settings" | "logout" | "home" | "workbench" | "apps" | "favorite" | "page-title" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "info-circle" | "check-circle" | "alert-circle" | "play-filled" | "pause-filled" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
|
|
251
251
|
closable: boolean;
|
|
252
252
|
tone: ToastTone;
|
|
253
253
|
action: string;
|
|
@@ -124,24 +124,39 @@
|
|
|
124
124
|
outline-offset: 2px;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
/*
|
|
127
|
+
/* 内容区(上下归面板;三段之间无分割线,交界间距只由面板的 `gap` 拥有)
|
|
128
128
|
`flex: 1 1 auto` + `min-height: 0`:吃掉页头与底栏之外的全部高度(含 `panelHeight` /
|
|
129
129
|
消费方经 style 给的高度),超出即**本段**滚动 —— 页头与底栏因此永远可见。
|
|
130
|
-
|
|
130
|
+
|
|
131
|
+
⚠️ 2026-10-19 起本段是**定位父**(浮层滚动条的宿主),自己不滚:滚动落在里面的 `.mh-dialog__scroll`。
|
|
132
|
+
浮层是 `position: absolute` 的兄弟节点,挂在滚动盒自己身上会跟着内容滚走(Table / Panel 同款两层结构)。
|
|
133
|
+
左右内距跟着**滚动盒**走 —— 它属于滚动容器的可视范围(原生滚动条也吃自己容器的内距),
|
|
134
|
+
落在 Body 上会让浮层拇指与内容边对不齐;搬到面板上则会把滚动条顶到面板内 24 处(2026-10-10 实测)。 */
|
|
131
135
|
.mh-dialog__body {
|
|
136
|
+
position: relative;
|
|
132
137
|
flex: 1 1 auto;
|
|
133
138
|
min-height: 0;
|
|
134
|
-
overflow
|
|
135
|
-
padding-inline: var(--ui-dialog-padding-x);
|
|
139
|
+
overflow: hidden;
|
|
136
140
|
font-size: var(--ui-font-body);
|
|
137
141
|
line-height: var(--ui-line-body);
|
|
138
142
|
color: var(--ui-base-content);
|
|
139
143
|
}
|
|
144
|
+
/* 正文的唯一滚动盒:原生条两轴归零(白缝成因见 `scrollbar.css` 头),拇指由浮层画 */
|
|
145
|
+
.mh-dialog__scroll {
|
|
146
|
+
height: 100%;
|
|
147
|
+
overflow-y: auto;
|
|
148
|
+
padding-inline: var(--ui-dialog-padding-x);
|
|
149
|
+
scrollbar-width: none;
|
|
150
|
+
}
|
|
151
|
+
.mh-dialog__scroll::-webkit-scrollbar {
|
|
152
|
+
width: 0;
|
|
153
|
+
height: 0;
|
|
154
|
+
}
|
|
140
155
|
/* 首尾孩子不吃外边距:正文里的 <p> 自带 UA margin,会与内容内距叠成一块大空档 */
|
|
141
|
-
.mh-dialog__body > :first-child {
|
|
156
|
+
.mh-dialog__body > .mh-dialog__scroll > :first-child {
|
|
142
157
|
margin-top: 0;
|
|
143
158
|
}
|
|
144
|
-
.mh-dialog__body > :last-child {
|
|
159
|
+
.mh-dialog__body > .mh-dialog__scroll > :last-child {
|
|
145
160
|
margin-bottom: 0;
|
|
146
161
|
}
|
|
147
162
|
|
|
@@ -111,21 +111,34 @@
|
|
|
111
111
|
outline-offset: 2px;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
/*
|
|
114
|
+
/* 内容区:**三段里唯一可滚的那段**(页头与底栏固定,抽屉才像抽屉)。
|
|
115
|
+
⚠️ 2026-10-19 起本段是**定位父**(浮层滚动条的宿主),自己不滚:滚动落在 `.mh-drawer__scroll`。
|
|
116
|
+
内距跟着滚动盒走(它属于滚动容器的可视范围,浮动拇指的位置与长度才对得上;口径同 Dialog / Panel)。 */
|
|
115
117
|
.mh-drawer__body {
|
|
118
|
+
position: relative;
|
|
116
119
|
flex: 1 1 auto;
|
|
117
120
|
min-height: 0;
|
|
118
|
-
overflow
|
|
119
|
-
padding: var(--ui-drawer-padding-x);
|
|
121
|
+
overflow: hidden;
|
|
120
122
|
font-size: var(--ui-font-body);
|
|
121
123
|
line-height: var(--ui-line-body);
|
|
122
124
|
color: var(--ui-base-content);
|
|
123
125
|
}
|
|
126
|
+
/* 正文的唯一滚动盒:原生条两轴归零(白缝成因见 `scrollbar.css` 头),拇指由浮层画 */
|
|
127
|
+
.mh-drawer__scroll {
|
|
128
|
+
height: 100%;
|
|
129
|
+
overflow-y: auto;
|
|
130
|
+
padding: var(--ui-drawer-padding-x);
|
|
131
|
+
scrollbar-width: none;
|
|
132
|
+
}
|
|
133
|
+
.mh-drawer__scroll::-webkit-scrollbar {
|
|
134
|
+
width: 0;
|
|
135
|
+
height: 0;
|
|
136
|
+
}
|
|
124
137
|
/* 首尾孩子不吃外边距:正文里的 <p> 自带 UA margin,会与内容内距叠成一块大空档 */
|
|
125
|
-
.mh-drawer__body > :first-child {
|
|
138
|
+
.mh-drawer__body > .mh-drawer__scroll > :first-child {
|
|
126
139
|
margin-top: 0;
|
|
127
140
|
}
|
|
128
|
-
.mh-drawer__body > :last-child {
|
|
141
|
+
.mh-drawer__body > .mh-drawer__scroll > :last-child {
|
|
129
142
|
margin-bottom: 0;
|
|
130
143
|
}
|
|
131
144
|
|
|
@@ -59,6 +59,23 @@
|
|
|
59
59
|
color: var(--ui-primary);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
/* 禁用行(`Tree.disabledNode` 命中;`SelectTree` 用它标「不可选的叶子」):
|
|
63
|
+
字色降档 + `not-allowed`,且不给滑过 / 按下反馈 —— 不再是「看起来能点、点了没反应」的死行。
|
|
64
|
+
只用于不可选的叶子;不可选的父节点仍承担展开 / 收起,不禁用。 */
|
|
65
|
+
|
|
66
|
+
.mh-list__row.is-disabled,
|
|
67
|
+
.mh-list__row[aria-disabled='true'] {
|
|
68
|
+
color: var(--ui-base-content-subtle);
|
|
69
|
+
cursor: not-allowed;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.mh-list__row.is-disabled:hover,
|
|
73
|
+
.mh-list__row.is-disabled:active,
|
|
74
|
+
.mh-list__row[aria-disabled='true']:hover,
|
|
75
|
+
.mh-list__row[aria-disabled='true']:active {
|
|
76
|
+
background: transparent;
|
|
77
|
+
}
|
|
78
|
+
|
|
62
79
|
/* 展开箭头:字形由 `@manohub/icon` 的 `<Icon name="chevron-down" />` 提供(本面不画字形);
|
|
63
80
|
展开态即字形的本向(朝下),**收起态由本层转 −90°(指向右)** —— 与 `operations/collapse.css`
|
|
64
81
|
的 `.mh-collapse-caret` 同款配方(参考实现 `@aihub/theme` 的树也是「base 字形 + 收起态转竖向」)。 */
|
|
@@ -95,18 +95,35 @@
|
|
|
95
95
|
padding: 14px var(--ui-space-5) 0;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
/* 主体区:**定位父**(浮层滚动条的宿主),自己不滚 —— 滚动交给里面的 `.mh-page__scroll`。
|
|
99
|
+
为什么要两层:浮层是 `position: absolute` 的兄弟节点,挂在滚动盒自己身上会跟着内容滚走
|
|
100
|
+
(Table 满高档 / Panel.Body / Dialog / Drawer 同款结构,2026-10-19 收口)。
|
|
101
|
+
⚠️ 代价:`Page.Body > *` 这类直接子选择器不再命中业务内容(中间隔了滚动盒),见 `page.md`。 */
|
|
98
102
|
.mh-page__body {
|
|
103
|
+
position: relative;
|
|
99
104
|
flex: 1;
|
|
100
105
|
min-height: 0;
|
|
101
|
-
|
|
106
|
+
overflow: hidden;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* 主体滚动盒:页面内距 20 落在这一层(与页头左边距对齐,同设计稿);原生条两轴归零
|
|
110
|
+
(白缝成因见 `scrollbar.css` 头),拇指由浮层画。缺省不滚,`--scroll` 档才滚。 */
|
|
111
|
+
.mh-page__scroll {
|
|
112
|
+
height: 100%;
|
|
102
113
|
padding: 0 var(--ui-space-5);
|
|
114
|
+
overflow: hidden;
|
|
115
|
+
scrollbar-width: none;
|
|
116
|
+
}
|
|
117
|
+
.mh-page__scroll::-webkit-scrollbar {
|
|
118
|
+
width: 0;
|
|
119
|
+
height: 0;
|
|
103
120
|
}
|
|
104
121
|
|
|
105
|
-
.mh-page__body--scroll {
|
|
122
|
+
.mh-page__body--scroll > .mh-page__scroll {
|
|
106
123
|
overflow-y: auto;
|
|
107
124
|
}
|
|
108
125
|
|
|
109
|
-
.mh-page__body--plain {
|
|
126
|
+
.mh-page__body--plain > .mh-page__scroll {
|
|
110
127
|
overflow: hidden;
|
|
111
128
|
}
|
|
112
129
|
|
|
@@ -46,11 +46,28 @@
|
|
|
46
46
|
min-width: 0;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
/* 内容区:**定位父**(浮层滚动条的宿主),自己不滚 —— 滚动交给里面的 `.mh-panel__scroll`。
|
|
50
|
+
为什么要两层:浮层是 `position: absolute` 的兄弟节点,挂在滚动盒自己身上会跟着内容滚走(Table 满高档同款结构)。
|
|
51
|
+
内距(`padding` prop)**落在滚动盒上**(见下条):原生滚动条的可视范围本来就含内距,
|
|
52
|
+
拇指长度要按同一口径算才与原生一致;Body 因此只做定位父,不吃内距。 */
|
|
49
53
|
.mh-panel__body {
|
|
54
|
+
position: relative;
|
|
50
55
|
flex: 1;
|
|
51
56
|
min-height: 0;
|
|
52
57
|
min-width: 0;
|
|
58
|
+
overflow: hidden;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* 区域内唯一的滚动盒:原生条两轴归零(白缝成因见 `scrollbar.css` 头),拇指由浮层画。
|
|
62
|
+
内距下发在这一层(`PanelBody` 的 `padding` prop → 行内 style):滚动条轨道与可视范围因此同一口径 */
|
|
63
|
+
.mh-panel__scroll {
|
|
64
|
+
height: 100%;
|
|
53
65
|
overflow: auto;
|
|
66
|
+
scrollbar-width: none;
|
|
67
|
+
}
|
|
68
|
+
.mh-panel__scroll::-webkit-scrollbar {
|
|
69
|
+
width: 0;
|
|
70
|
+
height: 0;
|
|
54
71
|
}
|
|
55
72
|
|
|
56
73
|
/* 面板页脚:区域内**常驻**控件(本区域表格的分页条等),不随内容滚动。
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scrollbar —— **浮层滚动条的面**(跨件原语,配 `components/scrollbar/` 的 `useOverlayScrollbar`)。
|
|
3
|
+
*
|
|
4
|
+
* 三件事由本文件定死:拇指多大 / 离框多远 / 什么时候显。
|
|
5
|
+
* 消费方(`Table` 满高档、`Panel.Body`)只负责两件:滚动盒把原生条归零、把 `render()` 的输出放进定位父。
|
|
6
|
+
*
|
|
7
|
+
* 为什么不用原生条(出处见组件头):`scrollbar-gutter: stable` 会给任何滚动容器**永久**预留一条槽,
|
|
8
|
+
* 槽里没人上色 ⇒ 内容的分隔线在槽左缘截断成一条贯穿到底的白缝;改回 `auto` 又会在滚动条出入时整块缩 6px。
|
|
9
|
+
* 归零之后 `offsetWidth - clientWidth` 恒等于 0,两个毛病一起消失 —— 代价是拇指得自己画。
|
|
10
|
+
*
|
|
11
|
+
* ⚠️ 6px / 2px / 24px 是**面内字面量**,不新开 `--ui-scrollbar-*` 令牌:6px 与 `kit/index.css` 的滚动条皮肤
|
|
12
|
+
* 同值(那里同样登记了「等设计给值再开槽位」),2px 是微内缩、24px 是拇指下限 —— 都属于「没人会去改的值」。
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/* 浮层定位盒:铺满**定位父**(滚动盒的兄弟),自己不吃指针 —— 轨道点击翻页明确不做(见组件头第 3 条)。 */
|
|
16
|
+
.mh-scrollbar {
|
|
17
|
+
position: absolute;
|
|
18
|
+
inset: 2px; /* 离外框 2px:视觉上是「浮在帧内」而不是「镶在框上」 */
|
|
19
|
+
z-index: 2; /* 压过固定列一类 sticky 内容(它们用 z-index: 1);加载罩另给更高一档 */
|
|
20
|
+
pointer-events: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.mh-scrollbar__thumb {
|
|
24
|
+
position: absolute;
|
|
25
|
+
background: var(--ui-base-400);
|
|
26
|
+
border-radius: var(--ui-radius-full);
|
|
27
|
+
opacity: 0; /* 静止不显:浮层不该常驻挡内容 */
|
|
28
|
+
transition: opacity 0.2s ease, background-color 0.15s ease;
|
|
29
|
+
pointer-events: none;
|
|
30
|
+
touch-action: none; /* 触屏上拖拇指才不会被当成滚动手势 */
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* 显形档:组件在「滚动 / 指针进入」时挂 `is-visible`,停手 800ms 后摘掉(淡出即上面那 0.2s) */
|
|
34
|
+
.mh-scrollbar.is-visible .mh-scrollbar__thumb {
|
|
35
|
+
opacity: 1;
|
|
36
|
+
pointer-events: auto;
|
|
37
|
+
cursor: grab;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* 悬停 / 拖动提一档深浅:`--ui-base-400`(比线色深、比字色浅的中性档)→ `--ui-base-content-subtle` */
|
|
41
|
+
.mh-scrollbar__thumb:hover,
|
|
42
|
+
.mh-scrollbar.is-dragging .mh-scrollbar__thumb {
|
|
43
|
+
background: var(--ui-base-content-subtle);
|
|
44
|
+
}
|
|
45
|
+
.mh-scrollbar.is-dragging .mh-scrollbar__thumb {
|
|
46
|
+
cursor: grabbing;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* 竖轴:贴右缘;`height` 与 `translateY` 由组件逐帧下发(轨道长取本盒的 clientHeight) */
|
|
50
|
+
.mh-scrollbar__thumb--y {
|
|
51
|
+
top: 0;
|
|
52
|
+
right: 0;
|
|
53
|
+
width: 6px;
|
|
54
|
+
min-height: 24px; /* 行数极多时也抓得住(与组件里的 SCROLLBAR_MIN 同值) */
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* 横轴:贴下缘。会压住内容最后一行右侧 6px —— 与「不做轨道点击」同一取舍:浮层不占内容空间 */
|
|
58
|
+
.mh-scrollbar__thumb--x {
|
|
59
|
+
left: 0;
|
|
60
|
+
bottom: 0;
|
|
61
|
+
height: 6px;
|
|
62
|
+
min-width: 24px;
|
|
63
|
+
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* ⚠️ **单元格左右内距保持 16(`--ui-space-4`)**:设计稿可量的只有「勾选框距表左 20」,而它量的是**内容盒**
|
|
11
11
|
* (勾选列 40 宽 + 居中时内容盒落在 13 处),无法唯一反推内距,故不作推测性改动。
|
|
12
12
|
*
|
|
13
|
-
*
|
|
13
|
+
* 五条必须照做的**结构**决定(做错就与规范不是一回事):
|
|
14
14
|
* 1. **边框模型**:默认是外框 + 表头下分割线 + 每行底线(末行去线)⇒ `border-collapse: separate` +
|
|
15
15
|
* `border-spacing: 0`(圆角只在 separate 下渲染得出来);`--borderless` 才切回 `collapse` 并去外框。
|
|
16
16
|
* **三条线之外的边一律显式清零**(`border: 0` 写在 `th` / `td` / `tr` 上,不是冗余):特异性只在**同一
|
|
@@ -23,12 +23,18 @@
|
|
|
23
23
|
* 勾选列内**:不限列时功能列里任何「内部本来就是 checkbox」的件都会命中 —— `Switch` 内部正是
|
|
24
24
|
* `<input type="checkbox">`,于是「启用」这类**功能值**会把整行点亮。
|
|
25
25
|
* 4. **固定列必须自带底**(`background: var(--ui-base-100)`):它是 sticky 的,不遮挡就会被滚过的单元格透出。
|
|
26
|
+
* 5. **滚动条是自绘浮层,不用原生条**:原生条要么常驻槽留白缝、要么出入时改列宽;归零后两轴都不占位、
|
|
27
|
+
* 表头不用补偿。拇指本身是**跨件原语**(`scrollbar.css` + `useOverlayScrollbar`,Panel.Body 也在用),
|
|
28
|
+
* 本件只提供定位父 `.mh-table__body` 与归零的滚动盒。
|
|
26
29
|
*
|
|
27
30
|
* **不做**:排序与列宽拖拽的**算法**(规范只给 `↕` 字形与 3×40 拖拽线两处视觉),也不做空态 / 加载态
|
|
28
31
|
* (三态归 `QueryState`)。
|
|
29
32
|
*/
|
|
33
|
+
/* 包裹层:**定位父**(两档共用)—— 浮层滚动条必须挂在滚动盒的兄弟节点上,不能挂在滚动盒自己身上
|
|
34
|
+
(`position: absolute` 的兄弟才不随内容滚走)。2026-10-19 起非满高也走「定位父 + 滚动盒」两层,
|
|
35
|
+
与满高档结构完全一致;本层因此不再滚。 */
|
|
30
36
|
.mh-table-wrapper {
|
|
31
|
-
overflow:
|
|
37
|
+
overflow: hidden;
|
|
32
38
|
}
|
|
33
39
|
/* ===== 满高档(两表结构:表头盒 + 表体滚动盒)=====
|
|
34
40
|
* 外框从表移交给包裹层(表自己不再画框),**表头不在滚动盒里** —— 表头固定是结构给的,不靠 sticky。 */
|
|
@@ -55,18 +61,40 @@
|
|
|
55
61
|
flex: 1 1 auto;
|
|
56
62
|
min-height: 0;
|
|
57
63
|
}
|
|
58
|
-
/*
|
|
64
|
+
/* ===== 滚动条:原生条归零(见文件头第 5 条)=====
|
|
65
|
+
* 为什么不用原生条:`scrollbar-gutter: stable` 会给**任何**滚动容器永久预留一条槽,而槽里没人上色
|
|
66
|
+
* ⇒ 表头底 / 行线 / 斑马底 / 选中底全在槽左缘截断,露出一条贯穿到底的白缝(实测 6px,与 `kit/index.css`
|
|
67
|
+
* 的滚动条皮肤同宽)。换成「不预留」(`auto`)则滚动条一出没就整表缩 6px,两表结构下必然错列,只能靠 JS 补。
|
|
68
|
+
* 归零原生条后 `offsetWidth - clientWidth` 恒等于 **0**:白缝没有、列宽不跳、表头补偿也恒为 0(竖轴横轴同一条判据)。
|
|
69
|
+
* 拇指的面与行为在 `scrollbar.css` / `components/scrollbar`(跨件原语)。 */
|
|
59
70
|
.mh-table-scroll {
|
|
60
71
|
height: 100%;
|
|
61
72
|
max-height: var(--ui-table-scroll-height); /* 基础上限;「占满父级」档由下面那条解除 */
|
|
62
73
|
overflow: auto;
|
|
63
|
-
scrollbar-
|
|
74
|
+
scrollbar-width: none; /* FF:整条滚动条归零 */
|
|
75
|
+
}
|
|
76
|
+
.mh-table-scroll::-webkit-scrollbar {
|
|
77
|
+
width: 0;
|
|
78
|
+
height: 0;
|
|
64
79
|
}
|
|
65
80
|
/* 满高档:滚动范围由包裹层高度(或调用方给的内联上限)决定 */
|
|
66
81
|
.mh-table-wrapper--fill > .mh-table__body > .mh-table-scroll {
|
|
67
82
|
max-height: none;
|
|
68
83
|
}
|
|
69
84
|
|
|
85
|
+
/* 非满高档(`--auto` 一对修饰档):高度链「包裹层 → 表体盒 → 滚动盒」逐层 100%。
|
|
86
|
+
包裹层**有定高**(消费方给 height / flex 撑起)⇒ 滚动盒拿到确定高度、超出就滚;
|
|
87
|
+
包裹层**没定高**(缺省,内容撑起)⇒ 百分比对不定高解析成 auto,高度由内容决定、不滚。
|
|
88
|
+
⚠️ 那 132 的「基础上限」是满高档的兜底,不能套到非满高(会把普通表裁成 132 高)。 */
|
|
89
|
+
.mh-table__body--auto {
|
|
90
|
+
height: 100%;
|
|
91
|
+
}
|
|
92
|
+
.mh-table-scroll--auto {
|
|
93
|
+
max-height: none;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* 浮层滚动条的面在 `scrollbar.css`(跨件原语,Table / Panel 共用):本件只负责把原生条归零 +
|
|
97
|
+
把 `useOverlayScrollbar` 的输出放进 `.mh-table__body`(定位父)。 */
|
|
70
98
|
/* 几何只挂在 `<table>` 上:令牌在同名 `.tokens.css`(锚 `[data-manohub-ui]`),几何若跟着挂会给包裹层加边框与圆角 */
|
|
71
99
|
.mh-table {
|
|
72
100
|
width: 100%;
|
|
@@ -425,6 +453,7 @@
|
|
|
425
453
|
.mh-table__loading {
|
|
426
454
|
position: absolute;
|
|
427
455
|
inset: 0;
|
|
456
|
+
z-index: 3; /* 压住浮层滚动条(z-index: 2):加载中不该还能看见拇指 */
|
|
428
457
|
display: flex;
|
|
429
458
|
align-items: flex-start;
|
|
430
459
|
justify-content: center;
|
package/dist/styles/index.css
CHANGED
|
@@ -83,6 +83,7 @@
|
|
|
83
83
|
@import './operations/tabs.css';
|
|
84
84
|
|
|
85
85
|
/* 容器与分区 */
|
|
86
|
+
@import './components/scrollbar.css'; /* 跨件原语(浮层滚动条):被 page / panel / table 消费,先于它们 */
|
|
86
87
|
@import './components/page.css'; /* 页面级骨架(唯一;区域级是 Panel) */
|
|
87
88
|
@import './components/panel.css';
|
|
88
89
|
@import './components/collapse.css'; /* Collapse 的头行皮肤(行为在 operations/collapse.css) */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manohub/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "AIHub 自绘组件层:不依赖 farris 的手写 Vue TSX 组件 + 自带令牌层(Farris 规范视觉 · daisyUI 式语义令牌 · shadcn 式 API 词汇)。",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"vue": "^3.5.0"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@manohub/icon": "^1.
|
|
38
|
+
"@manohub/icon": "^1.2.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/node": "^24.0.0",
|