@manohub/ui 1.3.1 → 1.3.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.
|
@@ -165,7 +165,12 @@ const Dialog = /* @__PURE__ */ defineComponent({
|
|
|
165
165
|
const el = dialogRef.value;
|
|
166
166
|
if (!el) return;
|
|
167
167
|
if (props.open) {
|
|
168
|
-
if (!el.open && typeof el.showModal === "function")
|
|
168
|
+
if (!el.open && typeof el.showModal === "function") {
|
|
169
|
+
el.showModal();
|
|
170
|
+
el.focus({
|
|
171
|
+
preventScroll: true
|
|
172
|
+
});
|
|
173
|
+
}
|
|
169
174
|
} else if (el.open && typeof el.close === "function") {
|
|
170
175
|
el.close();
|
|
171
176
|
}
|
|
@@ -208,6 +213,7 @@ const Dialog = /* @__PURE__ */ defineComponent({
|
|
|
208
213
|
} : void 0);
|
|
209
214
|
return () => createVNode("dialog", {
|
|
210
215
|
"ref": dialogRef,
|
|
216
|
+
"tabindex": -1,
|
|
211
217
|
"class": ["mh-popup", "mh-dialog", widthClass.value, isFullscreen.value ? "mh-dialog--fullscreen" : "", props.tone ? `mh-dialog--${props.tone}` : "", attrs.class].filter(Boolean).join(" "),
|
|
212
218
|
"style": {
|
|
213
219
|
...widthStyle.value,
|
|
@@ -115,7 +115,12 @@ const Drawer = /* @__PURE__ */ defineComponent({
|
|
|
115
115
|
const el = dialogRef.value;
|
|
116
116
|
if (!el) return;
|
|
117
117
|
if (props.open) {
|
|
118
|
-
if (!el.open && typeof el.showModal === "function")
|
|
118
|
+
if (!el.open && typeof el.showModal === "function") {
|
|
119
|
+
el.showModal();
|
|
120
|
+
el.focus({
|
|
121
|
+
preventScroll: true
|
|
122
|
+
});
|
|
123
|
+
}
|
|
119
124
|
} else if (el.open && typeof el.close === "function") {
|
|
120
125
|
el.close();
|
|
121
126
|
}
|
|
@@ -145,6 +150,7 @@ const Drawer = /* @__PURE__ */ defineComponent({
|
|
|
145
150
|
});
|
|
146
151
|
return () => createVNode("dialog", {
|
|
147
152
|
"ref": dialogRef,
|
|
153
|
+
"tabindex": -1,
|
|
148
154
|
"class": ["mh-popup", "mh-drawer", props.side === "left" ? "mh-drawer--left" : "", attrs.class].filter(Boolean).join(" "),
|
|
149
155
|
"style": {
|
|
150
156
|
...widthStyle.value,
|
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
.mh-checkbox {
|
|
17
17
|
display: inline-flex;
|
|
18
18
|
align-items: center;
|
|
19
|
+
/* **行内基线固定 middle,别改回 baseline**:框内三态换的是「10px 勾」与「2px 横杠」,
|
|
20
|
+
inline-flex 的基线由第一个子元素决定 ⇒ 按 baseline 对齐时,表头全选从半选切到全选
|
|
21
|
+
会让整块上下跳约 4px(框本身大小不变,跳的是行内盒的基线)。middle 只认盒子的垂直
|
|
22
|
+
中线,与内容无关;顺带让勾选框与同级文字按控件中线对齐。 */
|
|
23
|
+
vertical-align: middle;
|
|
19
24
|
gap: var(--ui-checkbox-label-gap);
|
|
20
25
|
font-size: var(--ui-font-body);
|
|
21
26
|
line-height: var(--ui-line-body);
|
|
@@ -54,6 +54,13 @@
|
|
|
54
54
|
transition-timing-function: var(--ui-ease-out);
|
|
55
55
|
transition-behavior: allow-discrete;
|
|
56
56
|
}
|
|
57
|
+
/* 初始焦点归**面板自身**(见 `components/dialog/index.tsx` 的 `syncOpen()`):容器不是交互件,
|
|
58
|
+
不画焦点环 —— 环只留给里面真正可操作的件。程序化聚焦在「上一次输入是键盘」时仍会命中
|
|
59
|
+
`:focus-visible`(Chromium 实测),故显式归零。 */
|
|
60
|
+
.mh-dialog:focus-visible {
|
|
61
|
+
outline: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
57
64
|
/* 展开态(`[open]` 由原生 `showModal()` 写上)。
|
|
58
65
|
进场走 **animation**、不用 `@starting-style`:宿主微前端(micro-app)的作用域转换是 **at-rule 白名单**
|
|
59
66
|
(keyframes / media / supports / import / container / layer …),`@starting-style` 不在名单里,会被当成
|
|
@@ -45,6 +45,13 @@
|
|
|
45
45
|
inset-inline: 0 auto; /* 贴左侧 */
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
/* 初始焦点归**面板自身**(见 `components/drawer/index.tsx` 的 `syncOpen()`):容器不是交互件,
|
|
49
|
+
不画焦点环 —— 环只留给里面真正可操作的件。程序化聚焦在「上一次输入是键盘」时仍会命中
|
|
50
|
+
`:focus-visible`(Chromium 实测),故显式归零。 */
|
|
51
|
+
.mh-drawer:focus-visible {
|
|
52
|
+
outline: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
48
55
|
/* 真浮层遮罩:`<dialog>` 进 top layer 时才生成 ::backdrop(静态档不生成,对本面无影响)。
|
|
49
56
|
与面板同源淡入淡出(遮罩先消失、面板再滑出会露馅)。 */
|
|
50
57
|
.mh-drawer::backdrop {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manohub/ui",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
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.3.
|
|
38
|
+
"@manohub/icon": "^1.3.3"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/node": "^24.0.0",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"vue-tsc": "^3.3.8"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
|
-
"build": "
|
|
52
|
+
"build": "vite build && vue-tsc -p tsconfig.build.json && node scripts/copy-styles.mjs",
|
|
53
53
|
"type-check": "vue-tsc --noEmit -p tsconfig.json && vue-tsc --noEmit -p docs/tsconfig.json",
|
|
54
54
|
"test:unit": "vitest run",
|
|
55
55
|
"test:contract": "vitest run contract- popup-surface",
|