@manohub/ui 1.2.7 → 1.2.9
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/dialog/index.js +9 -6
- package/dist/components/drawer/index.js +1 -2
- package/dist/styles/components/dialog.css +4 -3
- package/dist/styles/components/notification.css +2 -0
- package/dist/styles/components/page.css +17 -1
- package/dist/styles/components/select.css +3 -2
- package/dist/styles/components/toast.css +2 -1
- package/package.json +2 -2
|
@@ -162,17 +162,20 @@ const Dialog = /* @__PURE__ */ defineComponent({
|
|
|
162
162
|
const widthStyle = computed(() => {
|
|
163
163
|
if (props.panelWidth) return {
|
|
164
164
|
width: props.panelWidth,
|
|
165
|
-
maxWidth:
|
|
166
|
-
};
|
|
167
|
-
if (typeof props.width === "number") return {
|
|
168
|
-
width: `${props.width}px`,
|
|
169
|
-
maxWidth: `${props.width}px`
|
|
165
|
+
maxWidth: "calc(100vw - 32px)"
|
|
170
166
|
};
|
|
167
|
+
if (typeof props.width === "number") {
|
|
168
|
+
return {
|
|
169
|
+
width: `${props.width}px`,
|
|
170
|
+
maxWidth: "calc(100vw - 32px)"
|
|
171
|
+
};
|
|
172
|
+
}
|
|
171
173
|
return void 0;
|
|
172
174
|
});
|
|
173
175
|
const widthClass = computed(() => typeof props.width === "string" && props.width !== "md" ? `mh-dialog--${props.width}` : "");
|
|
174
176
|
const heightStyle = computed(() => props.panelHeight ? {
|
|
175
|
-
height: props.panelHeight
|
|
177
|
+
height: props.panelHeight,
|
|
178
|
+
maxHeight: "calc(100vh - 32px)"
|
|
176
179
|
} : void 0);
|
|
177
180
|
return () => createVNode("dialog", {
|
|
178
181
|
"ref": dialogRef,
|
|
@@ -140,8 +140,7 @@ const Drawer = /* @__PURE__ */ defineComponent({
|
|
|
140
140
|
const widthStyle = computed(() => {
|
|
141
141
|
const width = typeof props.width === "number" ? `${props.width}px` : props.width;
|
|
142
142
|
return {
|
|
143
|
-
width
|
|
144
|
-
maxWidth: width
|
|
143
|
+
width
|
|
145
144
|
};
|
|
146
145
|
});
|
|
147
146
|
return () => createVNode("dialog", {
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
与 `Drawer` 那条 `margin: 0` 是同一件事的两面(那边要贴侧、必须归零),两边都**不能交给 UA**。 */
|
|
28
28
|
margin: auto;
|
|
29
29
|
width: var(--ui-dialog-width);
|
|
30
|
-
|
|
30
|
+
/* 视口兜底:窄屏 / 150% 缩放下不再横向溢出(左右各留 16) */
|
|
31
|
+
max-width: min(var(--ui-dialog-width), calc(100vw - 32px));
|
|
31
32
|
/* 上下呼吸位归面板(也一并归零 UA 给 `<dialog>` 的 1em):面板上下 16 + 段间距 `gap` 24。
|
|
32
33
|
**左右不归面板**,由三段各自 `padding-inline` —— 正文是滚动容器,面板给左右内距会把
|
|
33
34
|
滚动条顶到面板内 24 处(实测踩到,`contract-style-feedback.spec.ts` 有一条负向锁守着)。 */
|
|
@@ -42,11 +43,11 @@
|
|
|
42
43
|
}
|
|
43
44
|
.mh-dialog--sm {
|
|
44
45
|
width: var(--ui-dialog-width-sm);
|
|
45
|
-
max-width: var(--ui-dialog-width-sm);
|
|
46
|
+
max-width: min(var(--ui-dialog-width-sm), calc(100vw - 32px));
|
|
46
47
|
}
|
|
47
48
|
.mh-dialog--lg {
|
|
48
49
|
width: var(--ui-dialog-width-lg);
|
|
49
|
-
max-width: var(--ui-dialog-width-lg);
|
|
50
|
+
max-width: min(var(--ui-dialog-width-lg), calc(100vw - 32px));
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
/* 真浮层遮罩:`<dialog>` 进 top layer 时才生成 ::backdrop(静态档不生成,对本面无影响) */
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
display: flex;
|
|
22
22
|
gap: var(--ui-space-3);
|
|
23
23
|
width: var(--ui-notification-width);
|
|
24
|
+
/* 视口兜底:200% 缩放 / 小窗口下 430 的固定宽会横向溢出 */
|
|
25
|
+
max-width: calc(100vw - 32px);
|
|
24
26
|
min-height: var(--ui-notification-min-height);
|
|
25
27
|
padding: var(--ui-notification-pad) var(--ui-notification-pad) var(--ui-notification-pad)
|
|
26
28
|
var(--ui-notification-pad-left);
|
|
@@ -28,11 +28,16 @@
|
|
|
28
28
|
align-items: flex-end;
|
|
29
29
|
justify-content: space-between;
|
|
30
30
|
gap: var(--ui-space-4);
|
|
31
|
+
/* 窄视口 / 150% 缩放:右位放不下时整行换到下一行,**标题不被压扁**。
|
|
32
|
+
缺这条时右侧筛选(固定宽、flex-shrink:0)会把标题挤到一字一行(缺陷:应用管理页头)。 */
|
|
33
|
+
flex-wrap: wrap;
|
|
34
|
+
row-gap: var(--ui-space-2);
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
.mh-page__header-text {
|
|
34
38
|
min-width: 0;
|
|
35
|
-
|
|
39
|
+
/* `auto` 基准:标题先按内容宽参与分配,空间不够时由父级换行,而不是缩到 min-content(一字一行) */
|
|
40
|
+
flex: 1 1 auto;
|
|
36
41
|
}
|
|
37
42
|
|
|
38
43
|
.mh-page__header-title-row {
|
|
@@ -40,12 +45,14 @@
|
|
|
40
45
|
align-items: center;
|
|
41
46
|
/* 设计稿:图标 26 宽 + 10 间距 → 文字起点 36 */
|
|
42
47
|
gap: 10px;
|
|
48
|
+
min-width: 0;
|
|
43
49
|
}
|
|
44
50
|
|
|
45
51
|
.mh-page__header-icon {
|
|
46
52
|
display: inline-flex;
|
|
47
53
|
align-items: center;
|
|
48
54
|
color: var(--ui-primary);
|
|
55
|
+
flex: none;
|
|
49
56
|
}
|
|
50
57
|
|
|
51
58
|
.mh-page__header-icon svg {
|
|
@@ -65,6 +72,10 @@
|
|
|
65
72
|
display: flex;
|
|
66
73
|
align-items: center;
|
|
67
74
|
gap: var(--ui-space-3);
|
|
75
|
+
/* 极窄时控件自身换行(如两个 240 筛选 + 两颗按钮),并靠右对齐 */
|
|
76
|
+
flex-wrap: wrap;
|
|
77
|
+
justify-content: flex-end;
|
|
78
|
+
max-width: 100%;
|
|
68
79
|
}
|
|
69
80
|
|
|
70
81
|
.mh-page__header-title {
|
|
@@ -73,6 +84,11 @@
|
|
|
73
84
|
font-weight: var(--ui-weight-semibold);
|
|
74
85
|
line-height: 28px;
|
|
75
86
|
color: var(--ui-base-content);
|
|
87
|
+
/* 标题永远单行:空间不足时省略,不拆成一字一行(中文标题逐字换行的直接原因) */
|
|
88
|
+
min-width: 0; /* 作为 flex item 允许收缩,ellipsis 才生效 */
|
|
89
|
+
white-space: nowrap;
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
text-overflow: ellipsis;
|
|
76
92
|
}
|
|
77
93
|
|
|
78
94
|
/* 页头副标题(`subTitle`):标题下一行的次要说明,取 caption 档字号与次要色。间距只用 `margin-top: 4` —— 页头条
|
|
@@ -104,8 +104,9 @@
|
|
|
104
104
|
`operations/popup.css` 里那条 `:is()` 兜底 —— **那条兜底不能删**(与 `dialog.css` 同一处坑)。 */
|
|
105
105
|
display: flex;
|
|
106
106
|
flex-direction: column;
|
|
107
|
-
/*
|
|
108
|
-
|
|
107
|
+
/* 限高(**含搜索行**):超出即内容区滚动。面板仍贴锚点,只是不再无限长。
|
|
108
|
+
再按视口收口:视口比 320 还矮时上下都会溢出(翻面也救不了) */
|
|
109
|
+
max-height: min(var(--ui-select-panel-max-height), calc(100vh - 16px));
|
|
109
110
|
/* UA 给 `[popover]` 的是 `overflow: auto`,必须归零:内容区已是滚动容器,留一层就叠成两条滚动条 */
|
|
110
111
|
overflow: hidden;
|
|
111
112
|
padding: var(--ui-space-1) 0;
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
改 min/max 夹住的 fit-content 后:短文案仍是 240(样张宽不变),长文案按内容展开、到 560 才折行。 */
|
|
26
26
|
width: fit-content;
|
|
27
27
|
min-width: var(--ui-toast-width);
|
|
28
|
-
|
|
28
|
+
/* 视口兜底:150% 缩放时视口约 576,560 贴边;再窄就横向溢出 */
|
|
29
|
+
max-width: min(var(--ui-toast-width-max), calc(100vw - 32px));
|
|
29
30
|
min-height: var(--ui-toast-min-height);
|
|
30
31
|
padding: var(--ui-toast-padding);
|
|
31
32
|
border: 1px solid var(--ui-toast-border);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manohub/ui",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.9",
|
|
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.2.
|
|
38
|
+
"@manohub/icon": "^1.2.9"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/node": "^24.0.0",
|