@manohub/ui 1.1.1 → 1.1.2

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.
@@ -346,7 +346,7 @@ const Table = /* @__PURE__ */ defineComponent({
346
346
  onUpdated(syncHead);
347
347
  return () => {
348
348
  const fill = props.fill !== false;
349
- const tableClass = ["mh-table", resolvedSize.value === "sm" ? "mh-table--xs" : "", 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(" ");
349
+ 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(" ");
350
350
  const bodyTableClass = props.stickyCol ? `${tableClass} mh-table--sticky-col` : tableClass;
351
351
  const cellTokens = fill || props.layout === "fixed" ? {
352
352
  "--ui-control-min-width": "0"
@@ -90,7 +90,7 @@
90
90
  border-radius: 0;
91
91
  }
92
92
  /* 紧凑档(`size="sm"`):三档 30 / 38 / 46 里的最小档,嵌在卡片 / 面板里的表格用它 */
93
- .mh-table--xs {
93
+ .mh-table--sm {
94
94
  --ui-table-head-height: 30px;
95
95
  --ui-table-row-height: 30px;
96
96
  }
@@ -170,6 +170,20 @@
170
170
  .mh-table tbody tr:last-child td {
171
171
  border-bottom: none;
172
172
  }
173
+
174
+ /* ===== 格子里只有一个行内小件时,行盒归零 =====
175
+ * 判据是**属性协议** `[data-inline-control]`(`Switch` / `Checkbox` / `Radio` 在根节点自带,见 form.css)
176
+ * 与表格自带的展开箭头:它们都是 `inline-flex`,基线取「无基线 flex 项的底边」⇒ 行盒会在件下方再垫
177
+ * 一行 strut 的 descender(实测开关 18 ⇒ 行盒 23),30 的紧凑行因此被顶高、件本身也偏上 2.5px。
178
+ * 归零行盒后行盒 = 件自身高度:行高回到声明值、件上下正好居中(实测 30 / 38 / 46 三档均偏 0)。
179
+ * **只收行盒不收字号** —— 各件自带 `line-height` 与 px 尺寸,收字号会把 em 尺寸一起改掉。
180
+ * ⚠️ `:only-child` 数的是**元素**子节点:同格还夹着文字时本条照样生效(实测相对位置与改前一致);
181
+ * 同格另有**元素**(如按钮)时不生效,那种格子由调用方自己排。 */
182
+ .mh-table tbody td:has(> [data-inline-control]:only-child),
183
+ .mh-table tbody td:has(> .mh-table__expand:only-child) {
184
+ line-height: 0;
185
+ }
186
+
173
187
  /* 行态顺序即优先级:斑马 → 滑过 → 选中 → 禁用(禁用压住一切,故放最后) */
174
188
  .mh-table tbody tr.is-striped td {
175
189
  background: var(--ui-table-row-alt);
@@ -13,7 +13,7 @@
13
13
  /* 尺寸档三档 = 30 / 38 / 46(sm / md / lg),本节是**基础值 = 中档(md)**,
14
14
  与 Button(24 / 32 / 40)、Tree(基础 34、紧凑 28)同一条库内约定:
15
15
  基础令牌承担 md,`.mh-<件>--<档>` 只改写另两档。
16
- ⚠️ 两个档位改写分别在面文件的 `.mh-table--xs`(sm)与 `.mh-table--lg` 里,别写回本文件。 */
16
+ ⚠️ 两个档位改写分别在面文件的 `.mh-table--sm`(紧凑档)与 `.mh-table--lg` 里,别写回本文件。 */
17
17
  --ui-table-head-height: 38px; /* 中档(md)表头 = 行高 */
18
18
  --ui-table-row-height: 38px; /* 中档(md)行高 */
19
19
  --ui-table-line-height: var(--ui-line-caption); /* 单元格行高 = 正文档的 13px 配对(default 20 / farris 18) */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manohub/ui",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
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.1.1"
38
+ "@manohub/icon": "^1.1.2"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/node": "^24.0.0",