soma-kit 0.1.14 → 0.1.15

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.
Files changed (287) hide show
  1. package/package.json +3 -3
  2. package/packs/finance/reconcile-desk/compile.ts +1 -1
  3. package/packs/finance/reconcile-desk/shell.ts +1 -1
  4. package/spec/generated/kit-app.schema.json +4 -2
  5. package/spec/generated/kit-page.schema.json +72 -2
  6. package/spec/kit-grammar.json +163 -57
  7. package/spec/kit-grammar.schema.json +0 -24
  8. package/src/app/app-config.ts +1 -1
  9. package/src/app/component-gate.ts +2 -2
  10. package/src/app/compose-apps.ts +5 -2
  11. package/src/app/define-kit-actions.ts +82 -10
  12. package/src/app/define-kit-app.ts +6 -5
  13. package/src/app/define-kit-view.ts +1 -1
  14. package/src/app/index.ts +7 -7
  15. package/src/app/kit-view-context.ts +11 -2
  16. package/src/app/theme-endpoint.ts +1 -1
  17. package/src/app/theme-runtime.ts +7 -2
  18. package/src/base/alert.ts +23 -20
  19. package/src/base/anchored-layer.ts +1 -1
  20. package/src/base/button.ts +30 -15
  21. package/src/base/cascader.ts +8 -4
  22. package/src/base/check-core.ts +9 -6
  23. package/src/base/color-picker.ts +10 -6
  24. package/src/base/command-palette.ts +10 -4
  25. package/src/base/context-menu.ts +5 -2
  26. package/src/base/date-range.ts +9 -6
  27. package/src/base/date.ts +10 -6
  28. package/src/base/delta.ts +4 -2
  29. package/src/base/divider.ts +15 -66
  30. package/src/base/fab.ts +11 -6
  31. package/src/base/gap-value.ts +1 -1
  32. package/src/base/hint-tips.ts +1 -1
  33. package/src/base/index.ts +15 -4
  34. package/src/base/inline-error.ts +84 -0
  35. package/src/base/input.ts +54 -18
  36. package/src/base/kbd.ts +4 -3
  37. package/src/base/link.ts +1 -1
  38. package/src/base/listbox-core.ts +70 -22
  39. package/src/base/mentions.ts +6 -3
  40. package/src/base/menu-button.ts +63 -27
  41. package/src/base/menu-core.ts +9 -2
  42. package/src/base/motion/hover-3d.ts +4 -1
  43. package/src/base/motion/hover-gallery.ts +4 -1
  44. package/src/base/otp.ts +7 -3
  45. package/src/base/overlay-runtime.ts +3 -2
  46. package/src/base/overlay-shell.ts +141 -0
  47. package/src/base/popover.ts +2 -2
  48. package/src/base/popup.ts +47 -41
  49. package/src/base/qty-stepper.ts +14 -9
  50. package/src/base/reason-tip.ts +2 -2
  51. package/src/{frames → base}/resize-handle.ts +1 -1
  52. package/src/base/segmented.ts +35 -36
  53. package/src/base/select.ts +1 -0
  54. package/src/base/shared.ts +43 -7
  55. package/src/base/status-tone.ts +1 -1
  56. package/src/base/tag-input.ts +13 -8
  57. package/src/base/tag.ts +53 -59
  58. package/src/base/text.ts +37 -13
  59. package/src/base/textarea.ts +1 -1
  60. package/src/base/time-picker.ts +9 -5
  61. package/src/base/tree-select.ts +12 -9
  62. package/src/base/upload.ts +21 -13
  63. package/src/biz/approval-desk/compile.ts +28 -1
  64. package/src/biz/approval-desk/shell.ts +2 -2
  65. package/src/biz/auth-panel/compile.ts +1 -1
  66. package/src/biz/auth-panel/shell.ts +2 -2
  67. package/src/biz/category-crud/compile.ts +17 -4
  68. package/src/biz/category-crud/shell.ts +7 -5
  69. package/src/biz/checkout-page/compile.ts +1 -1
  70. package/src/biz/checkout-page/shell.ts +7 -6
  71. package/src/biz/compose.ts +3 -3
  72. package/src/biz/define.ts +1 -1
  73. package/src/biz/import-wizard/compile.ts +1 -1
  74. package/src/biz/import-wizard/shell.ts +6 -4
  75. package/src/biz/index.ts +4 -3
  76. package/src/biz/landing-page/compile.ts +1 -1
  77. package/src/biz/landing-page/shell.ts +5 -4
  78. package/src/biz/link/shared.ts +8 -1
  79. package/src/biz/master-sub/compile.ts +162 -19
  80. package/src/biz/master-sub/detail-head.ts +7 -6
  81. package/src/biz/master-sub/index.ts +3 -3
  82. package/src/biz/master-sub/shell.ts +90 -53
  83. package/src/biz/multi-board/compile.ts +3 -3
  84. package/src/biz/multi-board/index.ts +24 -9
  85. package/src/biz/multi-board/prose-fold.ts +2 -2
  86. package/src/biz/multi-board/shell.ts +17 -13
  87. package/src/biz/names.ts +1 -0
  88. package/src/biz/notification-center/compile.ts +9 -2
  89. package/src/biz/notification-center/shell.ts +9 -2
  90. package/src/biz/page-templates/domain-templates.ts +6 -2
  91. package/src/biz/page-templates/result-page/compile.ts +1 -1
  92. package/src/biz/page-templates/result-page/shell.ts +4 -3
  93. package/src/biz/page-templates/shared.ts +1 -1
  94. package/src/biz/page-templates/sign-in-page/compile.ts +1 -1
  95. package/src/biz/page-templates/sign-in-page/shell.ts +4 -4
  96. package/src/biz/record-detail/compile.ts +5 -2
  97. package/src/biz/record-detail/shell.ts +4 -4
  98. package/src/biz/settings-center/compile.ts +1 -1
  99. package/src/biz/settings-center/shell.ts +8 -5
  100. package/src/biz/shared/action-host.ts +12 -5
  101. package/src/biz/shared/compile-helpers.ts +4 -4
  102. package/src/biz/shared/coordinator.ts +104 -21
  103. package/src/biz/shared/overlay-compile.ts +48 -18
  104. package/src/biz/shared/overlay-shell.ts +63 -112
  105. package/src/biz/single-form/compile.ts +2 -2
  106. package/src/biz/single-form/shell.ts +8 -4
  107. package/src/biz/standard-crud/compile.ts +11 -4
  108. package/src/biz/standard-crud/shell.ts +26 -9
  109. package/src/biz/standard-crud/summary.ts +3 -1
  110. package/src/biz/step-form/compile.ts +1 -1
  111. package/src/biz/step-form/hub.ts +4 -0
  112. package/src/biz/step-form/shell.ts +6 -4
  113. package/src/biz/types.ts +11 -4
  114. package/src/cli/app-layer-check.ts +375 -0
  115. package/src/cli/kit-cli.ts +35 -8
  116. package/src/cli/kit-init.ts +149 -0
  117. package/src/compile/access-gate-attach.ts +1 -1
  118. package/src/compile/action-host-attach.ts +1 -1
  119. package/src/compile/compile-page.ts +29 -234
  120. package/src/compile/component-candidates.ts +2 -1
  121. package/src/compile/hints.ts +5 -58
  122. package/src/compile/index.ts +2 -2
  123. package/src/compile/layout-lint/index.ts +4 -1
  124. package/src/compile/layout-lint/rules-composition.ts +43 -13
  125. package/src/compile/page-composition.ts +33 -31
  126. package/src/compile/redirect.ts +1 -1
  127. package/src/compile/stages.ts +169 -0
  128. package/src/compile/styles.ts +70 -32
  129. package/src/compile/types.ts +2 -2
  130. package/src/data/amount-breakdown.ts +4 -2
  131. package/src/data/anchor-nav.ts +4 -1
  132. package/src/data/approval-flow.ts +9 -4
  133. package/src/data/assignment-picker.ts +28 -18
  134. package/src/data/async-result-panel.ts +6 -2
  135. package/src/data/breadcrumbs.ts +13 -9
  136. package/src/data/calendar.ts +4 -3
  137. package/src/data/carousel.ts +11 -5
  138. package/src/data/chart.ts +153 -23
  139. package/src/data/checklist.ts +5 -4
  140. package/src/data/code-view.ts +220 -26
  141. package/src/data/comment-thread.ts +7 -2
  142. package/src/data/confirm-dialog.ts +56 -13
  143. package/src/data/diff.ts +4 -1
  144. package/src/data/dock.ts +5 -1
  145. package/src/data/embed.ts +1 -1
  146. package/src/data/engine-ports.ts +126 -0
  147. package/src/data/field-mapper.ts +12 -6
  148. package/src/data/flow-editor.ts +105 -29
  149. package/src/data/footer.ts +6 -2
  150. package/src/data/gantt.ts +11 -8
  151. package/src/data/hero.ts +6 -2
  152. package/src/data/image-viewer.ts +7 -3
  153. package/src/data/index.ts +12 -5
  154. package/src/data/item-list.ts +6 -5
  155. package/src/data/json-view.ts +844 -0
  156. package/src/data/kanban.ts +11 -8
  157. package/src/data/markdown-view.ts +487 -0
  158. package/src/data/matrix.ts +23 -14
  159. package/src/data/media-grid.ts +5 -2
  160. package/src/data/mega-menu.ts +4 -3
  161. package/src/data/menu-dom.ts +9 -8
  162. package/src/data/menu.ts +15 -9
  163. package/src/data/mockup.ts +9 -5
  164. package/src/data/modal-dialog.ts +39 -88
  165. package/src/data/navbar.ts +11 -7
  166. package/src/data/notice-list.ts +1 -1
  167. package/src/data/notify-renderer.ts +21 -10
  168. package/src/data/object-form.ts +129 -48
  169. package/src/data/pager.ts +12 -8
  170. package/src/data/panel-head.ts +1 -1
  171. package/src/data/permission-matrix.ts +15 -8
  172. package/src/data/permission-tree.ts +24 -11
  173. package/src/data/pricing-table.ts +8 -3
  174. package/src/data/reaction-bar.ts +6 -3
  175. package/src/data/record-card.ts +13 -9
  176. package/src/data/record-picker.ts +8 -4
  177. package/src/data/redirect.ts +1 -1
  178. package/src/data/request-console.ts +20 -7
  179. package/src/data/resident.ts +0 -12
  180. package/src/data/result-panel.ts +2 -2
  181. package/src/data/rich-text.ts +58 -96
  182. package/src/data/row-editor.ts +10 -5
  183. package/src/data/rule-builder.ts +14 -8
  184. package/src/data/shape-util.ts +14 -3
  185. package/src/data/stat-group.ts +63 -22
  186. package/src/data/static-lazy.ts +3 -0
  187. package/src/data/static-registry.ts +8 -2
  188. package/src/data/steps.ts +6 -2
  189. package/src/data/survey.ts +9 -3
  190. package/src/data/system-switcher.ts +15 -6
  191. package/src/data/text-diff.ts +663 -0
  192. package/src/data/timeline.ts +1 -1
  193. package/src/data/tour-guide.ts +6 -3
  194. package/src/data/transfer.ts +19 -10
  195. package/src/data/tree-table.ts +77 -12
  196. package/src/data/tree.ts +5 -2
  197. package/src/data/virtual-rows.ts +17 -7
  198. package/src/data/wrap.ts +2 -2
  199. package/src/frames/index.ts +3 -2
  200. package/src/frames/inherited-shell.ts +178 -0
  201. package/src/frames/list-summary.ts +59 -36
  202. package/src/frames/page-bar.ts +4 -2
  203. package/src/frames/resident-components.ts +20 -0
  204. package/src/frames/shared.ts +18 -14
  205. package/src/frames/split-frame/shell.ts +17 -11
  206. package/src/frames/split-frame/wiring.ts +2 -2
  207. package/src/frames/tabs-frame/shell.ts +12 -6
  208. package/src/frames/types.ts +3 -2
  209. package/src/frames/workspace-frame/extras.ts +19 -5
  210. package/src/frames/workspace-frame/shell.ts +2 -1
  211. package/src/frames/workspace-frame/state.ts +8 -2
  212. package/src/frames/workspace-frame/view.ts +125 -76
  213. package/src/generated/kit-grammar-runtime.ts +61 -39
  214. package/src/i18n/kit-text.ts +114 -2
  215. package/src/i18n/resolve-text-refs.ts +1 -1
  216. package/src/object-renderer/action-group.ts +31 -1
  217. package/src/object-renderer/action-more.ts +28 -12
  218. package/src/object-renderer/arrange.ts +37 -7
  219. package/src/object-renderer/collection-parts.ts +38 -7
  220. package/src/object-renderer/collection-table.ts +68 -23
  221. package/src/object-renderer/collection.ts +63 -30
  222. package/src/object-renderer/compile-data.ts +1 -1
  223. package/src/object-renderer/defaults.ts +8 -0
  224. package/src/object-renderer/emit-events.ts +1 -1
  225. package/src/object-renderer/emit-object.ts +3 -0
  226. package/src/object-renderer/emit-static.ts +140 -37
  227. package/src/object-renderer/field-value.ts +12 -239
  228. package/src/object-renderer/filter-toolbar.ts +103 -0
  229. package/src/{compile → object-renderer}/fragment.ts +2 -2
  230. package/src/object-renderer/index.ts +1 -1
  231. package/src/object-renderer/layout-facts.ts +37 -5
  232. package/src/object-renderer/overlay-decide.ts +82 -0
  233. package/src/object-renderer/render-object.ts +1 -1
  234. package/src/object-renderer/table-actions.ts +70 -23
  235. package/src/object-renderer/table-tools.ts +12 -5
  236. package/src/object-renderer/types.ts +9 -15
  237. package/src/recipes/app-blocks.ts +66 -0
  238. package/src/recipes/code-view.ts +56 -0
  239. package/src/recipes/compact-group.ts +31 -0
  240. package/src/recipes/container.ts +25 -15
  241. package/src/recipes/control.ts +21 -3
  242. package/src/recipes/desc-list.ts +14 -0
  243. package/src/recipes/divider.ts +53 -0
  244. package/src/recipes/emphasis.ts +12 -8
  245. package/src/recipes/frame-bleed.ts +3 -3
  246. package/src/recipes/index.ts +11 -1
  247. package/src/recipes/inherited-shell.ts +37 -0
  248. package/src/recipes/json-view.ts +49 -0
  249. package/src/recipes/markdown.ts +86 -0
  250. package/src/recipes/overlay.ts +112 -26
  251. package/src/recipes/page-width.ts +20 -0
  252. package/src/recipes/placeholder.ts +1 -1
  253. package/src/recipes/stat-state.ts +1 -1
  254. package/src/recipes/state.ts +10 -8
  255. package/src/recipes/status.ts +13 -12
  256. package/src/recipes/strip.ts +72 -0
  257. package/src/recipes/surface.ts +10 -6
  258. package/src/recipes/table-gap.ts +1 -1
  259. package/src/recipes/table-native-edit.ts +4 -4
  260. package/src/recipes/table-row.ts +11 -8
  261. package/src/recipes/tabs.ts +108 -31
  262. package/src/recipes/text-diff.ts +90 -0
  263. package/src/recipes/title-row.ts +4 -2
  264. package/src/recipes/typography.ts +2 -2
  265. package/src/shared/diagnostics.ts +16 -0
  266. package/src/shared/envelope.ts +1 -1
  267. package/src/shared/field-value-format.ts +246 -0
  268. package/src/shared/focus-ring.ts +8 -0
  269. package/src/shared/hints.ts +56 -0
  270. package/src/{base → shared}/icons.ts +12 -0
  271. package/src/shared/kit-error.ts +1 -1
  272. package/src/{object-renderer → shared}/merge-class.ts +3 -2
  273. package/src/shared/path-guard.ts +1 -1
  274. package/src/shared/primitives-types.ts +8 -0
  275. package/src/shared/theme-runtime-shared.ts +19 -0
  276. package/src/theme/kit-theme-text.ts +1 -1
  277. package/src/theme/kit-theme.css +38 -14
  278. package/src/theme/kit-theme.tpl +38 -14
  279. package/src/theme/nine-dim-structure.ts +66 -41
  280. package/src/theme/surface-layers.ts +11 -3
  281. package/src/theme/theme-tokens.ts +5 -1
  282. package/src/app/envelope.ts +0 -1
  283. package/src/app/notify-renderer.ts +0 -1
  284. package/src/app/paged-list-adapter.ts +0 -1
  285. package/src/app/theme-runtime-shared.ts +0 -1
  286. package/src/compile/kit-error.ts +0 -1
  287. /package/src/{base → shared}/class-candidates.ts +0 -0
@@ -121,6 +121,12 @@ export interface KitClassDefaults {
121
121
  compactMetaItem: string;
122
122
  compactSep: string;
123
123
  compactActions: string;
124
+ /** 主从页左窗格条目(paneItem 紧凑列表):列表容器 / 条目(选中 = 白面 + 左 2px 品牌色指示条)/ 名称行与编码行 / 右侧标签 / 等宽编码文字 */
125
+ paneList: string;
126
+ paneItem: string;
127
+ paneRow: string;
128
+ paneTag: string;
129
+ paneCode: string;
124
130
  staticRoot: string;
125
131
  groupsWrap: string;
126
132
  groupSection: string;
@@ -269,3 +275,5 @@ export const KIT_DIAGNOSTIC_MESSAGES: Readonly<Record<string, string>> = G.diagn
269
275
 
270
276
  /** 必填星号:标签旁的红色子元素(彩色文字只用 -on-soft;start = 标签前,end = 标签后)。对齐 Element / MUI 的红星 */
271
277
  export const KIT_REQUIRED_STAR_CLASS = { start: 'me-1 text-danger-on-soft', end: 'ms-1 text-danger-on-soft' } as const;
278
+ /** 「(选填)」标记(必填是多数时只标选填,KT-K-form-3):标签后、弱化墨、常规字重 */
279
+ export const KIT_OPTIONAL_MARK_CLASS = 'ms-1 font-normal text-fg-subtle';
@@ -18,7 +18,7 @@
18
18
  // 多个行操作各抛各的槽位事件 `row_action_<序号>`(序号 = 动作在组件 actions 数组里的位置),每个动作各绑一条管道。
19
19
 
20
20
  import type { KitAction, KitCell, KitDiagnostic, KitLayoutIR, KitObjectIR, KitViewOnValue } from './types';
21
- import { hintOf, nameSuggestion } from '../compile/hints';
21
+ import { hintOf, nameSuggestion } from '../shared/hints';
22
22
  import { filterAnchor, headAnchor, pagerAnchor } from './compile-data';
23
23
  import { registerSliceReload } from './filter-reload';
24
24
  import { KIT_ACTION_SLOT_BASE, actionSlotEvent, actionSlotOverflow } from '../base/action-slots';
@@ -26,6 +26,8 @@ export interface KitEmitInput {
26
26
  pickOnRow?: boolean;
27
27
  /** 分页条的附加类(业务壳给:列表页贴工作面底 sticky + 轴内边距) */
28
28
  pagerClass?: string;
29
+ /** 列表默认紧凑档(页面类型默认密度:列表页 = 紧凑):表格外壳标 data-kit-dense,行高取紧凑档;表格工具栏里用户选过密度则以用户为准 */
30
+ defaultDense?: boolean;
29
31
  /** 勾选列接 selection:协调组件 focus 切片 sel 镜像的路径;给了才发射可勾选的勾选列与 row_select 事件 */
30
32
  selectedPath?: string;
31
33
  /** 行删除在途置灰读的协调组件作用域(忙闲通道名 = 作用域 + 行主键,须与 KitCrudBridge 的 scope 一致);缺省用本对象作用域 */
@@ -68,6 +70,7 @@ export function emitObject(obj: KitObject, ctx: KitRenderContext, input: KitEmit
68
70
  ...(input.formInitialPath !== undefined ? { formInitialPath: input.formInitialPath } : {}),
69
71
  ...(input.pickOnRow === true ? { pickOnRow: true } : {}),
70
72
  ...(input.pagerClass !== undefined ? { pagerClass: input.pagerClass } : {}),
73
+ ...(input.defaultDense === true ? { defaultDense: true } : {}),
71
74
  ...(input.selectedPath !== undefined ? { selectedPath: input.selectedPath } : {}),
72
75
  ...(input.removeScope !== undefined ? { removeScope: input.removeScope } : {}),
73
76
  ...(input.expandPath !== undefined ? { expandPath: input.expandPath } : {}),
@@ -1,4 +1,5 @@
1
1
  import { kitRowActionsNarrowCap } from 'soma-foundation/kit-layout';
2
+ import { KIT_EMPHASIS } from 'soma-foundation/kit-limits';
2
3
  import { esc } from '../shared/escape';
3
4
  import { getCompileEnvelope } from '../shared/envelope';
4
5
  // emitStatic:IR -> 静态 HTML + `_ui.yaml` 的 `show:` 片段(设计稿 §1.2 做法 B、§6)。
@@ -21,13 +22,14 @@ import type {
21
22
  import { KIT_CLASS_DEFAULTS, KIT_GRAMMAR, KIT_GROUP_MARKERS, KIT_REQUIRED_STAR_CLASS, KIT_WIDTH } from './defaults';
22
23
  import type { KitSkeletonCol, KitSkeletonConfig } from './skeleton';
23
24
  import { isNumericColumnType } from './collection-table';
24
- import { mergeClass } from './merge-class';
25
- import { projectActionGroup, type KitActionImportance } from './action-group';
26
- import { kitTabRecipe } from '../recipes/tabs';
25
+ import { mergeClass } from '../shared/merge-class';
26
+ import { projectActionGroup, projectTabOverflow, type KitActionImportance } from './action-group';
27
+ import { KIT_TAB_TEXT_ATTR, kitTabRecipe } from '../recipes/tabs';
27
28
  import { KIT_TABLE_GAP_HEAD_ATTR, tableGapReasonField } from '../recipes/table-gap';
28
29
  import { kitTextActionRecipe } from '../recipes/control';
29
30
  import { kitStatusPillProps } from '../recipes/emphasis';
30
31
  import { KIT_OVERLAY_FORM_HOST_CLASS } from '../recipes/overlay';
32
+ import { KIT_STRIP_HEAD_MIN_CLASS } from '../recipes/strip';
31
33
  import { KIT_PANEL_TITLE_CLASS, kitPanelTitleHtml } from '../recipes/title-row';
32
34
  import { headAnchor } from './compile-data';
33
35
  import { KIT_STATE_DEFAULT_TEXT } from './collection';
@@ -39,6 +41,7 @@ import type { KitObjectFormClasses, KitObjectFormProps } from '../data/object-fo
39
41
  import { KIT_PART_CARD, KIT_PART_SECTION, KIT_PART_TITLE_SECTION, kitContainerPartOf, type KitFormDetail } from './form-detail';
40
42
  import { KIT_PART_TABLE, KIT_PART_TABLE_CELL, KIT_PART_TABLE_HEAD, KIT_PART_TABLE_ROW } from './collection-table';
41
43
  import { readStatePathsOf } from './crud-bridge';
44
+ import { KIT_FILTER_TOOLBAR_ACTIONS, KIT_FILTER_TOOLBAR_MARK, KIT_FILTER_TOOLBAR_WRAP, filterToolbarCells } from './filter-toolbar';
42
45
  import { primaryKeyFieldOf } from './key-field';
43
46
 
44
47
  /** 行变量按对象取(`kit_row_<对象>`):core 的 varMap 按变量名建,同页两个列表共用一个名字会撞 */
@@ -121,6 +124,8 @@ export interface KitStaticOptions {
121
124
  formInitialPath?: string;
122
125
  /** 分页条的附加类(业务壳给:列表页贴工作面底 sticky + 轴内边距) */
123
126
  pagerClass?: string;
127
+ /** 列表默认紧凑档(见 emit-object):原生表格外壳标 data-kit-dense */
128
+ defaultDense?: boolean;
124
129
  /** 表格行可点选:行容器标 data-kit-row,KitTableActions 开 pickOnRow,行点击抛 row_action(builtin select) */
125
130
  pickOnRow?: boolean;
126
131
  /**
@@ -269,9 +274,7 @@ function cellProps(ctx: Ctx, cell: KitCell, valuePath: string, _at: string): Rec
269
274
  props.aria_label = cell.label;
270
275
  }
271
276
  if (cell.valueClass !== '') props.class = cell.valueClass;
272
- // 状态类字段(单选枚举且选项带 tone)默认呈现为状态徽标(emphasis.status = pill:浅色底 + on-soft 字 + 6px 圆点),全应用统一,与紧凑列表、表格一致;
273
- // 圆点 + 文字(dot)形态只留给页面显式写的 variant: dot
274
- // 集合里(表格 / 紧凑列表)作者写的 `variant: dot` 与不写等价——「全应用统一」是框架默认值的事,不逐页改应用页面;dot 形态留给集合之外的 Tag / StatusDot 用法
277
+ // 状态类字段(单选枚举且选项带 tone)默认呈现为状态(emphasis.status = dot:圆点 + 语义色文字,没有容器;常态用中性灰),全应用统一,与紧凑列表、表格一致
275
278
  if (cell.component === 'Tag' && (props.variant === undefined || props.variant === 'dot')) {
276
279
  const field = ctx.options.schema?.[cell.field] as { type?: string; options?: unknown } | undefined;
277
280
  const opts = Array.isArray(field?.options) ? (field!.options as unknown[]) : [];
@@ -358,8 +361,11 @@ function renderArrangement(ctx: Ctx, slot: KitViewSlot, layout: KitLayoutIR, val
358
361
  }
359
362
  const grpPart = g.surface !== undefined ? kitContainerPartOf(g.surface) : KIT_PART_SECTION;
360
363
  const grpAttrs = `${g.surface !== undefined ? ` data-kit-surface="${esc(g.surface)}"` : ''}${g.emphasis !== undefined ? ` data-kit-emphasis="${esc(g.emphasis)}"` : ''} data-kit-part="${esc(grpPart)}"`;
364
+ // summary 分组 section 吃容器边框/圆角规则,在抽屉等非 flat 容器内需有卡片内边距,避免文字紧贴圆角边框
365
+ const sectionCls = slot === 'summary' ? joinClasses(layout.sectionClass, 'p-card') : layout.sectionClass;
361
366
  if (!g.collapsible) {
362
- return `${divider}<section${grpAttrs}${attr('class', layout.sectionClass)}><h4${attr('class', layout.titleClass)} data-kit-part="${KIT_PART_TITLE_SECTION}">${esc(g.title)}</h4>${inner}</section>`;
367
+ // 外观声明(D-08):分组 section 声明 card(与删标签名规则前渲染一致)
368
+ return `${divider}<section data-kit-container="card"${grpAttrs}${attr('class', sectionCls)}><h4${attr('class', layout.titleClass)} data-kit-part="${KIT_PART_TITLE_SECTION}">${esc(g.title)}</h4>${inner}</section>`;
363
369
  }
364
370
  // 可折叠:标题是 h4 里的 button(aria-expanded + aria-controls),折叠体是块级 div(hidden 不和 flex / grid 同元素),初态按 open 写好
365
371
  const btn = `<button type="button" id="${esc(g.id)}__btn"${attr('class', KIT_CLASS_DEFAULTS.groupToggle)} data-kit-collapse-toggle="" aria-expanded="${g.open ? 'true' : 'false'}" aria-controls="${esc(g.id)}">`
@@ -367,7 +373,7 @@ function renderArrangement(ctx: Ctx, slot: KitViewSlot, layout: KitLayoutIR, val
367
373
  + `<span${attr('class', KIT_CLASS_DEFAULTS.groupMark)} aria-hidden="true" data-kit-collapse-mark="" data-kit-mark-open="${markers[1]}" data-kit-mark-closed="${markers[0]}">${g.open ? markers[1] : markers[0]}</span>`
368
374
  + '</button>';
369
375
  const body = `<div id="${esc(g.id)}" role="region" aria-labelledby="${esc(g.id)}__btn"${attr('class', g.open ? '' : 'hidden')}>${inner}</div>`;
370
- return `${divider}<section${grpAttrs}${attr('class', layout.sectionClass)}><h4${attr('class', layout.titleClass)} data-kit-part="${KIT_PART_TITLE_SECTION}">${btn}</h4>${body}</section>`;
376
+ return `${divider}<section data-kit-container="card"${grpAttrs}${attr('class', sectionCls)}><h4${attr('class', layout.titleClass)} data-kit-part="${KIT_PART_TITLE_SECTION}">${btn}</h4>${body}</section>`;
371
377
  }).join('');
372
378
  const wrap = `<div${attr('class', layout.wrapClass)}${layout.collapsible ? ' data-kit-collapse-root=""' : ''}>${sections}</div>`;
373
379
  if (!layout.collapsible) return wrap;
@@ -391,7 +397,7 @@ export function groupPanelAnchor(object: string, slot: KitViewSlot, index: numbe
391
397
  export function groupTabWireAnchor(object: string, slot: KitViewSlot): string { return `${object}__${slot}__gwire`; }
392
398
 
393
399
  // 分组页签的类:页签呈现唯一出口 recipes/tabs(与页内页签 / 外壳页签条同一套)
394
- const GROUPS_AS = { barClass: `mb-4 ${kitTabRecipe().bar}`, tabClass: kitTabRecipe().tab };
400
+ const GROUPS_AS = { barClass: `mb-4 ${kitTabRecipe().bar}` };
395
401
 
396
402
  /**
397
403
  * groups 呈现为页签:tablist + 若干 tab 按钮 + 各组面板(首签显示,其余外层 hidden)。
@@ -435,8 +441,15 @@ export function groupTabsFrame(
435
441
  showInto: Record<string, unknown>,
436
442
  components: Set<string>,
437
443
  ): string {
438
- const buttons = titles.map((title, i) => `<button type="button" data-soma-id="${esc(groupTabAnchor(object, slot, i))}" data-key="${i}" role="tab" aria-selected="${i === 0 ? 'true' : 'false'}"${attr('class', GROUPS_AS.tabClass)}>${esc(title)}</button>`).join('');
439
- const panelEls = panels.map((inner, i) => `<div data-soma-id="${esc(groupPanelAnchor(object, slot, i))}"${i === 0 ? '' : ' hidden'}>${inner}</div>`).join('');
444
+ // data-kit-tab-text:结构 CSS 按选中字重预留宽度,切换选中不位移(KT-K-tabs-2)
445
+ // KT-K-tabs-3(§6.1 G-16):放不下的尾部页签编译期估宽、按容器档隐藏并收进「更多」,选中页签恒可见
446
+ const overflow = projectTabOverflow(titles, kitTabRecipe().tab);
447
+ const buttons = titles.map((title, i) => `<button type="button" data-soma-id="${esc(groupTabAnchor(object, slot, i))}" data-key="${i}" role="tab" aria-selected="${i === 0 ? 'true' : 'false'}" ${KIT_TAB_TEXT_ATTR}="${esc(title)}"${attr('class', overflow.tabClasses[i])}>${esc(title)}</button>`).join('');
448
+ const moreShell = overflow.hasMore
449
+ ? `<div${attr('class', `${overflow.moreClass} -mb-px`)}><div data-soma-component="KitActionMore" data-soma-id="${esc(`${object}__${slot}__gmore`)}"></div></div>`
450
+ : '';
451
+ if (overflow.hasMore) components.add('KitActionMore');
452
+ const panelEls = panels.map((inner, i) => `<div data-soma-id="${esc(groupPanelAnchor(object, slot, i))}" data-kit-tab-panel=""${i === 0 ? '' : ' hidden'}>${inner}</div>`).join('');
440
453
  const wireId = groupTabWireAnchor(object, slot);
441
454
  components.add('KitTabsWiring');
442
455
  showInto[wireId] = {
@@ -447,7 +460,7 @@ export function groupTabsFrame(
447
460
  ids: titles.map((_t, i) => String(i)),
448
461
  },
449
462
  };
450
- const bar = `<div data-soma-id="${esc(groupTabBarAnchor(object, slot))}" role="tablist"${attr('class', GROUPS_AS.barClass)}>${buttons}</div>`;
463
+ const bar = `<div data-soma-id="${esc(groupTabBarAnchor(object, slot))}" role="tablist"${attr('class', GROUPS_AS.barClass)}>${buttons}${moreShell}</div>`;
451
464
  const wiring = `<div data-soma-component="KitTabsWiring" data-soma-id="${esc(wireId)}" hidden></div>`;
452
465
  return `<div data-kit-tabs-frame=""${attr('class', wrapClass)}>${bar}${wiring}${panelEls}</div>`;
453
466
  }
@@ -480,6 +493,15 @@ function literalReason(a: KitAction): { disabledReason?: string } {
480
493
  * { 动作id: { hidden?, disabled? } },叶子是 core 行路径(行变量.<字段>),由 core 在行模板里逐行求值。
481
494
  * 返回要并进 prop 的 { actionState };没有绑定返回空对象。非法写法已在 emitStatic 入口记过诊断,这里只收合法的。
482
495
  */
496
+ /**
497
+ * 主从页详情头动作区(KitTableActions look: button)的 props:与行内操作同一套动作项与行级状态绑定(disabled / hidden / disabledReason),
498
+ * 只是「行」换成选中行镜像(rowPath = 链接作用域上的 link_sel_row 路径):`row.<字段>` 编成 `<rowPath>.<字段>`,点击抛的 row 载荷也取它,与行内点击发出的同形。
499
+ */
500
+ export function headActionProps(actions: readonly KitAction[], rowPath: string): Record<string, unknown> {
501
+ const stub = { rowVar: rowPath } as Ctx;
502
+ return { actions: actionItems(actions, stub), ...actionStateProp(actions, stub), row: rowPath };
503
+ }
504
+
483
505
  function actionStateProp(actions: readonly KitAction[], ctx: Ctx): { actionState?: Record<string, Record<string, string>> } {
484
506
  const state: Record<string, Record<string, string>> = {};
485
507
  for (const a of actions) {
@@ -545,7 +567,7 @@ function renderTable(ctx: Ctx, layout: Extract<KitLayoutIR, { kind: 'table' }>):
545
567
 
546
568
  const tools = layout.tools === true && layout.tree === null;
547
569
  const selHead = layout.selectHeadClass ?? layout.selectClass;
548
- const actHead = `${layout.actionsHeadClass ?? layout.actionsClass} text-end`;
570
+ const actHead = joinClasses(layout.actionsHeadClass ?? layout.actionsClass, 'whitespace-nowrap text-end justify-end');
549
571
  // 表格语义(W3C table 模式:table > row > columnheader / cell,aria-sort 在 columnheader 上):
550
572
  // 树表(外壳由 KitTreeTable 自带 treegrid,表头在它之外)与展开详情行(行下挂非 row 的开关与详情体)不满足 table 的结构要求,这两种不写表格角色
551
573
  const semTable = layout.tree === null && layout.expand === null;
@@ -664,11 +686,11 @@ function renderTable(ctx: Ctx, layout: Extract<KitLayoutIR, { kind: 'table' }>):
664
686
  ...removeBusyProps(ctx),
665
687
  },
666
688
  };
667
- rowParts.push(`<div${cellRoleAttr(cellRole)}${attr('class', layout.selectClass)}>${host('KitTableActions', selAnchor(object))}</div>`);
689
+ rowParts.push(`<div${cellRoleAttr(cellRole)} data-kit-part="${KIT_PART_TABLE_CELL}"${attr('class', layout.selectClass)}>${host('KitTableActions', selAnchor(object))}</div>`);
668
690
  } else {
669
691
  ctx.components.add('Checkbox');
670
692
  rowShow[selAnchor(object)] = { props: {} };
671
- rowParts.push(`<div${cellRoleAttr(cellRole)}${attr('class', layout.selectClass)}>${host('Checkbox', selAnchor(object))}</div>`);
693
+ rowParts.push(`<div${cellRoleAttr(cellRole)} data-kit-part="${KIT_PART_TABLE_CELL}"${attr('class', layout.selectClass)}>${host('Checkbox', selAnchor(object))}</div>`);
672
694
  }
673
695
  }
674
696
  layout.cells.forEach((c, i) => rowParts.push(columnCell(ctx, gapCols.get(c.field) ?? c, `${at}.cells[${i}]`, rowShow, tools, cellRole)));
@@ -677,7 +699,7 @@ function renderTable(ctx: Ctx, layout: Extract<KitLayoutIR, { kind: 'table' }>):
677
699
  rowShow[opsAnchor(object)] = {
678
700
  props: { actions: actionItems(layout.rowActions, ctx), ...actionStateProp(layout.rowActions, ctx), row: ctx.rowVar, ...rowToneProp(layout, ctx), ...(ctx.options.pickOnRow === true ? { pickOnRow: true } : {}), ...removeBusyProps(ctx), ...selectedProps(ctx), ...(layout.tools === true && (layout.batch?.length ?? 0) > 0 && ctx.options.selectedPath !== undefined ? { bulkLock: true } : {}) },
679
701
  };
680
- rowParts.push(`<div${cellRoleAttr(cellRole)}${attr('class', layout.actionsClass)}>${host('KitTableActions', opsAnchor(object))}</div>`);
702
+ rowParts.push(`<div${cellRoleAttr(cellRole)} data-kit-part="${KIT_PART_TABLE_CELL}"${attr('class', layout.actionsClass)}>${host('KitTableActions', opsAnchor(object))}</div>`);
681
703
  }
682
704
  // pickOnRow 或行样式档位(rowTone)且没有行操作列:补一个无按钮的 KitTableActions 实例,专管行点击 / 行样式
683
705
  if ((ctx.options.pickOnRow === true || layout.rowTone !== undefined) && layout.rowActions.length === 0) {
@@ -737,7 +759,7 @@ function renderTable(ctx: Ctx, layout: Extract<KitLayoutIR, { kind: 'table' }>):
737
759
  ctx.show[gapId] = { props: { rows: ctx.rowsPath, fields: [...gapCols.keys()] } };
738
760
  gapHost = host('KitTableGap', gapId);
739
761
  }
740
- const body = `<div${attr('class', layout.wrapClass)}${wrapA11y}${tools ? ` data-kit-table="" data-kit-table-of="${esc(toolsAnchor(object))}"` : ''} data-kit-part="${KIT_PART_TABLE}"${gridMark(layout)} ${KIT_TIPS_SCOPE_ATTR}=""><div${tableA11y}${attr('class', layout.innerClass)}>${gapHost}${head}${rows}${summary}</div></div>`;
762
+ const body = `<div${attr('class', layout.wrapClass)}${wrapA11y}${tools ? ` data-kit-table="" data-kit-table-of="${esc(toolsAnchor(object))}"` : ''}${ctx.options.defaultDense === true ? ' data-kit-dense=""' : ''} data-kit-part="${KIT_PART_TABLE}"${gridMark(layout)} ${KIT_TIPS_SCOPE_ATTR}=""><div${tableA11y}${attr('class', layout.innerClass)}>${gapHost}${head}${rows}${summary}</div></div>`;
741
763
  return `${renderTools(ctx, layout)}${body}${renderState(ctx, layout.state, skeletonShapeOf(layout, ctx.options.schema))}${renderPager(ctx, layout.pager)}`;
742
764
  }
743
765
 
@@ -840,13 +862,18 @@ function renderSummary(ctx: Ctx, layout: Extract<KitLayoutIR, { kind: 'table' }>
840
862
  if (layout.summary === undefined || layout.summary === null || layout.tree !== null) return '';
841
863
  const id = summaryAnchor(ctx.object);
842
864
  ctx.components.add('KitTableSummary');
865
+ // 合计行固定选择/操作角格用与合计行一致的实底 bg-surface-sunken 与 z-20,防止横向滚动数字穿透固定列
866
+ const summaryCorner = (cls: string): string => cls
867
+ .replace(/\bbefore:bg-surface-band\b/g, 'before:bg-surface-sunken')
868
+ .replace(/\bbg-surface-band\b/g, 'bg-surface-sunken')
869
+ .replace(/\bz-10\b/g, 'z-20');
843
870
  ctx.show[id] = {
844
871
  props: {
845
872
  rows: ctx.rowsPath,
846
873
  class: layout.summaryRowClass ?? '',
847
874
  ...(semTable ? { semantics: 'table' } : {}),
848
- selectClass: layout.select !== 'none' ? selHead : '',
849
- actionsClass: layout.rowActions.length > 0 ? actHead : '',
875
+ selectClass: layout.select !== 'none' ? summaryCorner(selHead) : '',
876
+ actionsClass: layout.rowActions.length > 0 ? summaryCorner(actHead) : '',
850
877
  label: layout.summary.label,
851
878
  labelField: layout.summary.labelField,
852
879
  columns: layout.cells.map((c, i) => ({
@@ -887,7 +914,8 @@ function skeletonShapeOf(layout: Extract<KitLayoutIR, { kind: 'table' | 'cards'
887
914
 
888
915
  /** 展开行的开关条与详情体(语义色名 + 内置尺度) */
889
916
  const EXPAND_TOGGLE_CLASS = 'px-4 py-1';
890
- const EXPAND_BODY_CLASS = 'border-b border-border-subtle bg-surface-sunken px-4 py-3';
917
+ // 展开行的内容是凹槽面:与上下行之间已有面差,不再加线(一处分隔一种手段,KT-B5 / D-30)
918
+ const EXPAND_BODY_CLASS = 'bg-surface-sunken px-4 py-3';
891
919
 
892
920
  /** 标题与它旁边的集合辅助文字(共 N 条 / 已筛选提示)同一组:基线对齐、窄时换行 */
893
921
  const TITLE_GROUP_CLASS = 'flex min-w-0 flex-wrap items-baseline gap-x-3 gap-y-1';
@@ -997,24 +1025,81 @@ function renderCompactBody(ctx: Ctx, compact: NonNullable<Extract<KitLayoutIR, {
997
1025
  };
998
1026
  const titleId = cellAnchor(ctx.object, 'list', compact.title.field);
999
1027
  ctx.components.add(compact.title.component);
1000
- rowShow[titleId] = { props: sized(compact.title) };
1001
- const title = `<div${attr('class', D.compactTitle)} ${KIT_TIPS_SCOPE_ATTR}="">${host(compact.title.component, titleId)}</div>`;
1028
+ const titleProps = sized(compact.title);
1029
+ // 紧凑列表标题文本自带 block min-w-0 truncate,避免长客户名 / 长接口名硬切或压盖右侧状态点与金额
1030
+ if (compact.title.component === 'Text' || compact.title.component === 'Link') {
1031
+ titleProps.class = joinClasses(typeof titleProps.class === 'string' ? titleProps.class : '', 'block min-w-0 truncate');
1032
+ }
1033
+ rowShow[titleId] = { props: titleProps };
1034
+ // 左窗格条目(主从页):第一行 = 名称 + 右侧状态(第一个 Tag 字段),第二行 = 等宽编码(其余文本字段,「·」分隔)+ 右侧类型标签(其余 Tag 字段)
1035
+ if (compact.pane === true) {
1036
+ // 标签类字段:Tag 组件,或枚举 / 布尔类型的字段(枚举的只读展示组件是 Text,按类型判)
1037
+ const isTag = (c: KitCell): boolean => {
1038
+ const type = ctx.options.schema?.[c.field]?.type;
1039
+ return c.component === 'Tag' || type === 'enum' || type === 'enums' || type === 'bool';
1040
+ };
1041
+ const tags = compact.meta.filter(isTag);
1042
+ const texts = compact.meta.filter((c) => !isTag(c));
1043
+ const tagHtml = (cell: KitCell): string => {
1044
+ const id = cellAnchor(ctx.object, 'list', cell.field);
1045
+ // 状态 / 类型标签一律是圆点 + 语义色文字(没有容器):枚举的只读展示组件是 Text(徽标呈现),在条目里换成 Tag 的 dot 变体(同一份 options / value)
1046
+ const comp = cell.component === 'Text' ? 'Tag' : cell.component;
1047
+ ctx.components.add(comp);
1048
+ const props = sized(cell);
1049
+ // 值带语气(单选枚举、选项带 tone)= 状态 → 圆点 + 文字;不带语气的分类 / 多值 / 布尔 = 标签(浅底小圆角)——状态与标签永不同形(KT-K-status-3)
1050
+ const field = ctx.options.schema?.[cell.field] as { type?: string; options?: unknown } | undefined;
1051
+ const opts = Array.isArray(field?.options) ? (field!.options as unknown[]) : [];
1052
+ const toned = field?.type === 'enum' && opts.some((o) => o !== null && typeof o === 'object' && 'tone' in (o as Record<string, unknown>));
1053
+ if (toned && (props.variant === undefined || props.variant === 'dot')) Object.assign(props, kitStatusPillProps());
1054
+ rowShow[id] = { props };
1055
+ return `<span${attr('class', D.paneTag)}>${host(comp, id)}</span>`;
1056
+ };
1057
+ const textHtml = texts.map((cell, i) => {
1058
+ const id = cellAnchor(ctx.object, 'list', cell.field);
1059
+ ctx.components.add(cell.component);
1060
+ const props = sized(cell);
1061
+ const type = ctx.options.schema?.[cell.field]?.type;
1062
+ const numeric = isNumericColumnType(type);
1063
+ if (cell.component === 'Text') {
1064
+ props.class = joinClasses(typeof props.class === 'string' ? props.class : '', numeric ? D.paneCode : `${D.paneCode} block min-w-0 truncate`);
1065
+ }
1066
+ rowShow[id] = { props };
1067
+ const hideable = !numeric && type !== 'enum' && type !== 'enums' && type !== 'bool';
1068
+ const itemCls = numeric ? joinClasses(D.compactMetaItem, 'shrink-0') : D.compactMetaItem;
1069
+ const sep = i > 0 ? `<span${attr('class', D.compactSep)} aria-hidden="true">·</span>` : '';
1070
+ if (!hideable) return `<span${attr('class', itemCls)}>${sep}${host(cell.component, id)}</span>`;
1071
+ const wid = `${id}__item`;
1072
+ rowShow[wid] = { when: `${ctx.rowVar}.${cell.field}` };
1073
+ return `<span data-soma-id="${esc(wid)}"${attr('class', itemCls)}>${sep}${host(cell.component, id)}</span>`;
1074
+ });
1075
+ const [status, ...kinds] = tags;
1076
+ const row1 = `<div${attr('class', D.paneRow)}><div${attr('class', `${D.compactTitle} flex-1 overflow-hidden`)} ${KIT_TIPS_SCOPE_ATTR}="">${host(compact.title.component, titleId)}</div>${status !== undefined ? tagHtml(status) : ''}</div>`;
1077
+ const row2 = textHtml.length > 0 || kinds.length > 0
1078
+ ? `<div${attr('class', `${D.paneRow} text-fg-muted`)}><div${attr('class', `${D.compactMeta} flex-1`)}>${textHtml.join('')}</div>${kinds.map(tagHtml).join('')}</div>`
1079
+ : '';
1080
+ return `<div${attr('class', D.compactBody)}>${row1}${row2}</div>`;
1081
+ }
1082
+ const title = `<div${attr('class', `${D.compactTitle} overflow-hidden`)} ${KIT_TIPS_SCOPE_ATTR}="">${host(compact.title.component, titleId)}</div>`;
1002
1083
  const items = compact.meta.map((cell, i) => {
1003
1084
  const id = cellAnchor(ctx.object, 'list', cell.field);
1004
1085
  ctx.components.add(cell.component);
1005
1086
  const props = sized(cell);
1006
- // 状态字段:状态徽标(浅色底 + on-soft 字 + 圆点,emphasis.status);其余文本沿用组件默认外观
1087
+ const type = ctx.options.schema?.[cell.field]?.type;
1088
+ const numeric = isNumericColumnType(type);
1089
+ // 状态字段:圆点 + 文字、没有容器(emphasis.status = dot);其余文本沿用组件默认外观
1007
1090
  if (cell.component === 'Tag' && (props.variant === undefined || props.variant === 'dot')) Object.assign(props, kitStatusPillProps());
1008
- // 次要信息是辅助文字:纯文本值走次要字色(Text 根自带正文色,色类由值类补上)
1009
- if (cell.component === 'Text') props.class = joinClasses(typeof props.class === 'string' ? props.class : '', 'text-fg-muted');
1091
+ // 次要信息是辅助文字:纯文本值走次要字色(Text 根自带正文色,色类由值类补上),非数值文本带省略防压盖金额 / 状态点
1092
+ if (cell.component === 'Text') {
1093
+ props.class = joinClasses(typeof props.class === 'string' ? props.class : '', numeric ? 'text-fg-muted' : 'text-fg-muted block min-w-0 truncate');
1094
+ }
1010
1095
  rowShow[id] = { props };
1011
- const type = ctx.options.schema?.[cell.field]?.type;
1012
- const hideable = cell.component !== 'Tag' && !isNumericColumnType(type) && type !== 'enum' && type !== 'enums' && type !== 'bool';
1096
+ const hideable = cell.component !== 'Tag' && !numeric && type !== 'enum' && type !== 'enums' && type !== 'bool';
1097
+ const itemCls = cell.component === 'Tag' || numeric ? joinClasses(D.compactMetaItem, 'shrink-0') : D.compactMetaItem;
1013
1098
  const sep = i > 0 ? `<span${attr('class', D.compactSep)} aria-hidden="true">·</span>` : '';
1014
- if (!hideable) return `<span${attr('class', D.compactMetaItem)}>${sep}${host(cell.component, id)}</span>`;
1099
+ if (!hideable) return `<span${attr('class', itemCls)}>${sep}${host(cell.component, id)}</span>`;
1015
1100
  const wid = `${id}__item`;
1016
1101
  rowShow[wid] = { when: `${ctx.rowVar}.${cell.field}` };
1017
- return `<span data-soma-id="${esc(wid)}"${attr('class', D.compactMetaItem)}>${sep}${host(cell.component, id)}</span>`;
1102
+ return `<span data-soma-id="${esc(wid)}"${attr('class', itemCls)}>${sep}${host(cell.component, id)}</span>`;
1018
1103
  });
1019
1104
  const meta = items.length > 0 ? `<div${attr('class', D.compactMeta)}>${items.join('')}</div>` : '';
1020
1105
  return `<div${attr('class', D.compactBody)}>${title}${meta}</div>`;
@@ -1182,6 +1267,9 @@ function renderObjectForm(ctx: Ctx, slot: 'filter' | 'form', layout: KitLayoutIR
1182
1267
  ctx.components.add('KitObjectForm');
1183
1268
  // 底栏动作组的「更多」入口(可编辑表单;筛选表单没有)
1184
1269
  if (slot === 'form') ctx.components.add('KitActionMore');
1270
+ // 筛选工具条(风格档案 SPACE_MATERIAL):简单筛选改成「搜索框 + 分段 / 下拉」一条工具条(见 filter-toolbar.ts),不合格返回 null 照旧排布
1271
+ const toolbarCells = slot === 'filter' && layout.kind === 'grid' ? filterToolbarCells(packed.fields, ctx.options.locale ?? '') : null;
1272
+ if (toolbarCells !== null) packed.fields = toolbarCells;
1185
1273
  for (const c of packed.fields) if (c.component !== '') ctx.components.add(c.component);
1186
1274
  // 可编辑 form 的 mode / initial 可绑镜像路径(字符串路径由 core 解析成绑定);filter 恒为字面量
1187
1275
  const bindMode = slot === 'form' ? ctx.options.formModePath : undefined;
@@ -1204,8 +1292,10 @@ function renderObjectForm(ctx: Ctx, slot: 'filter' | 'form', layout: KitLayoutIR
1204
1292
  const fo = ir.views[slot]?.formOpts;
1205
1293
  // 筛选栏(cols 排布):排布引擎的投影(filter-plan.ts)——根容器左起流式换行、字段按类型取 [最小, 理想, 最大] 定宽(不拉伸)、
1206
1294
  // 动作区(查询 / 重置,或即时档的「清除」)紧跟最后一个字段并对齐到控件那一行;档位(即时 / 提交 / 更多)与钉住个数作为 props,运行时不量宽
1207
- const proj = slot === 'filter' && layout.kind === 'grid' ? layout.filterProjection : undefined;
1208
- if (proj !== undefined && layout.kind === 'grid') {
1295
+ const proj = slot === 'filter' && layout.kind === 'grid' && toolbarCells === null ? layout.filterProjection : undefined;
1296
+ if (toolbarCells !== null) {
1297
+ props.classes = { wrap: KIT_FILTER_TOOLBAR_WRAP, grid: 'contents', actions: KIT_FILTER_TOOLBAR_ACTIONS, pad: 'hidden', notice: 'w-full' };
1298
+ } else if (proj !== undefined && layout.kind === 'grid') {
1209
1299
  props.fields = packed.fields.map((c, i) => (c.placeholder === true ? c : { ...c, cellClass: swapSpanForWidth(c.cellClass, proj.widthClasses[i] ?? '') }));
1210
1300
  const keep = layout.gridClass.split(/\s+/).filter((t) => t !== '' && !/^(?:@[a-z0-9]+:)?(?:grid|grid-cols-\d+|gap-[a-z0-9.]+)$/.test(t));
1211
1301
  props.classes = {
@@ -1261,6 +1351,7 @@ function renderObjectForm(ctx: Ctx, slot: 'filter' | 'form', layout: KitLayoutIR
1261
1351
  // 页面真有按需字段控件(画布)时在宿主上点名,core 才补载其分片
1262
1352
  const needs = [...new Set(packed.fields.map((c) => c.component).filter((n) => n === 'FlowEditor'))];
1263
1353
  let html = host('KitObjectForm', id);
1354
+ if (toolbarCells !== null) html = html.replace('></div>', ` ${KIT_FILTER_TOOLBAR_MARK}=""></div>`);
1264
1355
  // 容器查询只对后代生效:表单根上的字段宽度 / 动作区变体类(@<档>:w-N)要查到宿主这一层,所以宿主做查询容器
1265
1356
  if (proj !== undefined) {
1266
1357
  html = html.includes(' class="') ? html.replace(' class="', ` class="${KIT_WIDTH.containerClass} `) : html.replace('></div>', ` class="${KIT_WIDTH.containerClass}"></div>`);
@@ -1270,8 +1361,15 @@ function renderObjectForm(ctx: Ctx, slot: 'filter' | 'form', layout: KitLayoutIR
1270
1361
 
1271
1362
  // ---------------------------------------------------------------- 工具栏
1272
1363
 
1273
- const AUXILIARY_BUILTINS = new Set(['reload', 'reset', 'export', 'back']);
1274
- const AUXILIARY_IDS = new Set(['reload', 'refresh', 'reset', 'export', 'back']);
1364
+ /** 内置动作 / 常见动作 id → 语义角色(真源 KIT_EMPHASIS.semanticRoles 的键):编译器按语义角色定强调档,页面不写样式 */
1365
+ const SEMANTIC_OF_NAME: Readonly<Record<string, keyof typeof KIT_EMPHASIS.semanticRoles>> = {
1366
+ reload: 'refresh', refresh: 'refresh', reset: 'reset', back: 'back', cancel: 'cancel', close: 'close',
1367
+ export: 'alternative', more: 'more', remove: 'delete', delete: 'delete',
1368
+ };
1369
+ /** 强调档 → 按钮语气(主 = 实心;次 = 白底描边中性钮(neutral 语气);三级 = 文字钮(ghost 语气);安静 = 灰字(ghost 语气);危险 = 灰字悬停变红)。色调钮(tonal)只由页面显式写 tone: tonal 得到 */
1370
+ const TONE_OF_LEVEL: Readonly<Record<string, 'primary' | 'neutral' | 'danger' | 'ghost' | 'tonal'>> = {
1371
+ primary: 'primary', secondary: 'neutral', tertiary: 'ghost', quiet: 'ghost', danger: 'danger',
1372
+ };
1275
1373
 
1276
1374
  function actionTone(a: KitAction): 'primary' | 'neutral' | 'danger' | 'ghost' | 'tonal' {
1277
1375
  if (a.tone === 'danger' || a.tone === 'neutral' || a.tone === 'primary' || a.tone === 'ghost' || a.tone === 'tonal') {
@@ -1279,9 +1377,10 @@ function actionTone(a: KitAction): 'primary' | 'neutral' | 'danger' | 'ghost' |
1279
1377
  }
1280
1378
  if (a.tone === 'info' || a.tone === 'success') return 'primary';
1281
1379
  if (a.tone === 'warning') return 'tonal';
1282
- if ((a.builtin !== undefined && AUXILIARY_BUILTINS.has(a.builtin)) || AUXILIARY_IDS.has(a.id)) {
1283
- return 'neutral';
1284
- }
1380
+ const semantic = (a.builtin !== undefined ? SEMANTIC_OF_NAME[a.builtin] : undefined)
1381
+ ?? SEMANTIC_OF_NAME[a.id]
1382
+ ?? (/^export(?:[A-Z_-]|$)/.test(a.id) ? 'alternative' : undefined);
1383
+ if (semantic !== undefined) return TONE_OF_LEVEL[KIT_EMPHASIS.semanticRoles[semantic]] ?? 'primary';
1285
1384
  return 'primary';
1286
1385
  }
1287
1386
 
@@ -1317,6 +1416,8 @@ function renderToolbar(ctx: Ctx, actions: readonly KitAction[]): string {
1317
1416
  props: {
1318
1417
  label: a.name,
1319
1418
  variant: actionTone(a),
1419
+ // 动作语义是「新建」(内置 openCreate)时由框架给前置加号图标,页面不写
1420
+ ...(a.builtin === 'openCreate' ? { icon: 'plus' } : {}),
1320
1421
  // 展示对象路径:路径取值为真时按钮置灰(Button 的 disabled prop)
1321
1422
  ...(a.disabled !== undefined && isViewPath(a.disabled) ? { disabled: viewPathToCore(a.disabled) } : {}),
1322
1423
  // 置灰原因(disabled 为真时 Button 才显示):字面量原样带,view.<成员> 编成页面变量路径;row. 路径在入口已报 KIT-VIEW-001
@@ -1455,7 +1556,9 @@ export function emitStatic(ir: KitObjectIR, options: KitStaticOptions): KitStati
1455
1556
  ? `<div${attr('class', KIT_CLASS_DEFAULTS.toolbarSecondary)}>${treeCtl}${mergeToolbar ? parts.toolbar! : ''}</div>`
1456
1557
  : parts.toolbar!;
1457
1558
  // 集合辅助文字紧随标题作标题行的直接子项(宿主 display: contents,其根自带 me-auto 把工具区推到最右)
1458
- html = `<div data-kit-title-row="" class="${KIT_CLASS_DEFAULTS.toolbarTitleRow}">${titleEl}${metaHtml}${right}</div>${html}`;
1559
+ // 带工具的列表标题行是面内的头部条(strip.headPx 下限,内容垂直居中):不设下限时工具钮贴着面板顶边,
1560
+ // 钮的上描边与面板上边相距 0 成双线(边框普查 B01,外壳用户授权「导出」)
1561
+ html = `<div data-kit-title-row="" class="${KIT_CLASS_DEFAULTS.toolbarTitleRow} ${KIT_STRIP_HEAD_MIN_CLASS}">${titleEl}${metaHtml}${right}</div>${html}`;
1459
1562
  if (mergeToolbar) delete parts.toolbar;
1460
1563
  } else {
1461
1564
  html = `${metaHtml === '' ? titleEl : `<div data-kit-title-row="" class="${TITLE_GROUP_CLASS}">${titleEl}${metaHtml}</div>`}${html}`;