soma-kit 0.1.12 → 0.1.14
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/README.md +5 -4
- package/bin/soma-kit.mjs +31 -1
- package/bin/soma.mjs +0 -0
- package/package.json +5 -4
- package/spec/generated/kit-app.schema.json +172 -4
- package/spec/generated/kit-page.schema.json +164 -5
- package/spec/kit-grammar.json +598 -96
- package/spec/kit-grammar.schema.json +12 -6
- package/src/app/app-config.ts +92 -8
- package/src/app/component-gate.ts +271 -13
- package/src/app/define-kit-app.ts +2 -2
- package/src/app/define-kit-view.ts +9 -5
- package/src/app/dev-diagnostic.ts +5 -0
- package/src/app/index.ts +29 -5
- package/src/app/kit-view-context.ts +181 -15
- package/src/app/render-ports.ts +18 -0
- package/src/app/server-pages.ts +8 -2
- package/src/app/server.ts +55 -8
- package/src/app/theme-runtime.ts +4 -0
- package/src/base/action-busy.ts +101 -4
- package/src/base/action-slots.ts +13 -2
- package/src/base/anchored-layer.ts +50 -0
- package/src/base/button.ts +62 -15
- package/src/base/check-core.ts +8 -0
- package/src/base/checkbox.ts +2 -1
- package/src/base/choice.ts +21 -2
- package/src/base/color-picker.ts +10 -5
- package/src/base/command-palette.ts +1 -1
- package/src/base/context-menu.ts +10 -7
- package/src/base/date-range.ts +7 -7
- package/src/base/date.ts +55 -16
- package/src/base/delta.ts +72 -0
- package/src/base/end-edge.ts +61 -0
- package/src/base/fab.ts +1 -1
- package/src/base/gap-value.ts +168 -0
- package/src/base/hint-tips.ts +170 -0
- package/src/base/icons.ts +8 -0
- package/src/base/illustrations.ts +95 -0
- package/src/base/index.ts +32 -9
- package/src/base/listbox-core.ts +6 -5
- package/src/base/loading-gate.ts +140 -87
- package/src/base/mentions.ts +2 -1
- package/src/base/menu-button.ts +16 -18
- package/src/base/menu-core.ts +37 -8
- package/src/base/motion/hover-3d.ts +1 -1
- package/src/base/motion/marquee.ts +1 -1
- package/src/base/otp.ts +5 -4
- package/src/base/overlay-runtime.ts +235 -0
- package/src/base/popover.ts +10 -9
- package/src/base/popup.ts +67 -8
- package/src/base/portal-core.ts +4 -0
- package/src/base/qty-stepper.ts +5 -5
- package/src/base/radio.ts +2 -1
- package/src/base/range.ts +19 -2
- package/src/base/rating.ts +11 -6
- package/src/base/reason-tip.ts +150 -0
- package/src/base/segmented.ts +36 -24
- package/src/base/shared.ts +180 -36
- package/src/base/state-panel.ts +367 -0
- package/src/base/status-tone.ts +27 -0
- package/src/base/sticky-edge.ts +116 -0
- package/src/base/swap.ts +6 -6
- package/src/base/switch.ts +10 -5
- package/src/base/tag-input.ts +6 -6
- package/src/base/tag.ts +76 -41
- package/src/base/text.ts +43 -14
- package/src/base/time-picker.ts +7 -5
- package/src/base/tree-select.ts +6 -4
- package/src/base/trend-tone.ts +9 -0
- package/src/base/upload.ts +15 -9
- package/src/base/view-transition.ts +77 -0
- package/src/biz/approval-desk/shell.ts +15 -11
- package/src/biz/auth-panel/shell.ts +9 -7
- package/src/biz/category-crud/compile.ts +5 -4
- package/src/biz/category-crud/shell.ts +5 -3
- package/src/biz/checkout-page/compile.ts +2 -1
- package/src/biz/checkout-page/shell.ts +10 -8
- package/src/biz/compose.ts +2 -2
- package/src/biz/data-components.ts +4 -0
- package/src/biz/import-wizard/shell.ts +13 -10
- package/src/biz/landing-page/shell.ts +2 -2
- package/src/biz/link/hub.ts +23 -5
- package/src/biz/link/shared.ts +23 -12
- package/src/biz/master-sub/compile.ts +207 -16
- package/src/biz/master-sub/detail-head.ts +61 -0
- package/src/biz/master-sub/index.ts +7 -3
- package/src/biz/master-sub/shell.ts +133 -24
- package/src/biz/multi-board/compile.ts +167 -9
- package/src/biz/multi-board/composition.ts +58 -0
- package/src/biz/multi-board/index.ts +1 -1
- package/src/biz/multi-board/prose-fold.ts +143 -0
- package/src/biz/multi-board/shell.ts +94 -23
- package/src/biz/notification-center/shell.ts +10 -7
- package/src/biz/page-templates/domain-templates.ts +2 -2
- package/src/biz/page-templates/result-page/shell.ts +4 -3
- package/src/biz/page-templates/sign-in-page/shell.ts +16 -16
- package/src/biz/record-detail/compile.ts +2 -2
- package/src/biz/record-detail/shell.ts +13 -10
- package/src/biz/settings-center/compile.ts +2 -1
- package/src/biz/settings-center/shell.ts +12 -9
- package/src/biz/shared/action-host.ts +6 -0
- package/src/biz/shared/compile-helpers.ts +97 -0
- package/src/biz/shared/coordinator.ts +7 -30
- package/src/biz/shared/index.ts +5 -0
- package/src/biz/shared/object-aliases.ts +154 -0
- package/src/biz/shared/overlay-compile.ts +281 -0
- package/src/biz/shared/overlay-shell.ts +142 -11
- package/src/biz/shared/pipes.ts +11 -5
- package/src/biz/shared/remove-wire.ts +4 -19
- package/src/biz/shared/runtime-hub.ts +10 -0
- package/src/biz/single-form/compile.ts +3 -2
- package/src/biz/single-form/shell.ts +9 -6
- package/src/biz/standard-crud/compile.ts +36 -161
- package/src/biz/standard-crud/shell.ts +23 -60
- package/src/biz/standard-crud/summary.ts +40 -0
- package/src/biz/step-form/shell.ts +15 -13
- package/src/biz/types.ts +6 -1
- package/src/cli/kit-cli.ts +138 -13
- package/src/cli/kit-init.ts +6 -1
- package/src/cli/layout-cli.ts +167 -0
- package/src/cli/migrate/index.ts +10 -0
- package/src/cli/migrate/migrate.ts +248 -0
- package/src/cli/migrate/text-utils.ts +306 -0
- package/src/cli/migrate/theme-map.ts +104 -0
- package/src/cli/migrate/ts-rules.ts +235 -0
- package/src/cli/migrate/types.ts +95 -0
- package/src/cli/migrate/view-skeleton.ts +159 -0
- package/src/cli/migrate/yaml-report.ts +376 -0
- package/src/cli/migrate/yaml-rules.ts +465 -0
- package/src/cli/view-writes.ts +69 -60
- package/src/compile/access-gate-attach.ts +27 -0
- package/src/compile/closed-set.ts +65 -4
- package/src/compile/compile-page.ts +66 -11
- package/src/compile/component-candidates.ts +14 -1
- package/src/compile/fragment.ts +11 -0
- package/src/compile/layout-lint/engine.ts +82 -0
- package/src/compile/layout-lint/index.ts +55 -0
- package/src/compile/layout-lint/rules-composition.ts +267 -0
- package/src/compile/layout-lint/rules-form.ts +191 -0
- package/src/compile/layout-lint/rules-table.ts +278 -0
- package/src/compile/layout-lint/score.ts +52 -0
- package/src/compile/layout-lint/types.ts +51 -0
- package/src/compile/page-composition.ts +189 -0
- package/src/compile/parse.ts +4 -0
- package/src/compile/producer-fingerprint.ts +56 -0
- package/src/compile/remove-guard.ts +10 -7
- package/src/compile/styles.ts +46 -8
- package/src/compile/types.ts +16 -2
- package/src/compile/view-check.ts +149 -16
- package/src/data/access-gate.ts +112 -0
- package/src/data/amount-breakdown.ts +9 -2
- package/src/data/approval-flow.ts +5 -2
- package/src/data/assignment-picker.ts +59 -28
- package/src/data/async-result-panel.ts +49 -3
- package/src/data/breadcrumbs.ts +3 -2
- package/src/data/calendar.ts +8 -3
- package/src/data/carousel.ts +10 -6
- package/src/data/chart.ts +744 -46
- package/src/data/checklist.ts +22 -6
- package/src/data/code-view.ts +8 -4
- package/src/data/comment-thread.ts +3 -2
- package/src/data/confirm-dialog.ts +72 -25
- package/src/data/context-menu.ts +3 -3
- package/src/data/dock.ts +1 -1
- package/src/data/embed.ts +231 -29
- package/src/data/field-mapper.ts +7 -4
- package/src/data/flow-editor-contract.ts +7 -0
- package/src/data/flow-editor.ts +26 -9
- package/src/data/flow-node-options.ts +33 -3
- package/src/data/footer.ts +2 -0
- package/src/data/gantt.ts +192 -27
- package/src/data/hero.ts +4 -1
- package/src/data/image-viewer.ts +7 -4
- package/src/data/index.ts +16 -4
- package/src/data/item-list.ts +27 -12
- package/src/data/kanban.ts +41 -10
- package/src/data/matrix.ts +391 -0
- package/src/data/media-grid.ts +6 -1
- package/src/data/mega-menu.ts +6 -4
- package/src/data/menu-dom.ts +4 -2
- package/src/data/menu.ts +60 -16
- package/src/data/mockup.ts +5 -1
- package/src/data/modal-dialog.ts +146 -26
- package/src/data/navbar.ts +8 -6
- package/src/data/notice-list.ts +301 -0
- package/src/data/notify-renderer.ts +21 -6
- package/src/data/object-form.ts +409 -87
- package/src/data/outcome-watch.ts +61 -2
- package/src/data/pager.ts +19 -8
- package/src/data/panel-head.ts +406 -0
- package/src/data/permission-matrix.ts +36 -11
- package/src/data/permission-tree.ts +52 -23
- package/src/data/pricing-table.ts +22 -11
- package/src/data/prompt-dialog.ts +165 -0
- package/src/data/reaction-bar.ts +6 -4
- package/src/data/record-card.ts +40 -7
- package/src/data/record-picker.ts +13 -7
- package/src/data/resident.ts +8 -0
- package/src/data/result-panel.ts +4 -2
- package/src/data/rich-text.ts +17 -1
- package/src/data/row-editor.ts +77 -24
- package/src/data/rule-builder.ts +14 -9
- package/src/data/shape-util.ts +27 -12
- package/src/data/stat-group.ts +459 -74
- package/src/data/static-lazy.ts +5 -0
- package/src/data/static-registry.ts +8 -0
- package/src/data/steps.ts +8 -3
- package/src/data/survey.ts +7 -4
- package/src/data/system-switcher.ts +3 -2
- package/src/data/text-action-button.ts +17 -0
- package/src/data/timeline.ts +17 -6
- package/src/data/tour-guide.ts +3 -2
- package/src/data/transfer.ts +40 -16
- package/src/data/tree-table.ts +65 -37
- package/src/data/tree.ts +22 -2
- package/src/data/virtual-rows.ts +21 -11
- package/src/data/wrapped-candidates.ts +32 -1
- package/src/frames/index.ts +1 -0
- package/src/frames/list-summary.ts +100 -0
- package/src/frames/page-bar.ts +7 -14
- package/src/frames/page-status.ts +7 -5
- package/src/frames/shared.ts +34 -13
- package/src/frames/split-frame/shell.ts +1 -1
- package/src/frames/tabs-frame/shell.ts +9 -6
- package/src/frames/tabs-frame/wiring.ts +1 -0
- package/src/frames/top-main-frame.ts +3 -3
- package/src/frames/types.ts +3 -1
- package/src/frames/workspace-frame/extras.ts +1 -1
- package/src/frames/workspace-frame/shell.ts +4 -4
- package/src/frames/workspace-frame/tab-scroll.ts +28 -0
- package/src/frames/workspace-frame/view.ts +168 -44
- package/src/generated/kit-grammar-runtime.ts +390 -59
- package/src/i18n/kit-text.ts +90 -4
- package/src/i18n/resolve-text-refs.ts +22 -6
- package/src/object-renderer/action-group.ts +139 -0
- package/src/object-renderer/action-more.ts +144 -0
- package/src/object-renderer/arrange.ts +71 -7
- package/src/object-renderer/candidates.ts +4 -0
- package/src/object-renderer/collection-parts.ts +264 -62
- package/src/object-renderer/collection-table.ts +177 -5
- package/src/object-renderer/collection.ts +188 -37
- package/src/object-renderer/compile-data.ts +28 -3
- package/src/object-renderer/defaults.ts +27 -2
- package/src/object-renderer/display-checks.ts +1 -1
- package/src/object-renderer/emit-events.ts +43 -9
- package/src/object-renderer/emit-object.ts +4 -0
- package/src/object-renderer/emit-static.ts +434 -41
- package/src/object-renderer/filter-plan.ts +84 -0
- package/src/object-renderer/form-detail.ts +1 -2
- package/src/object-renderer/form-notify.ts +45 -0
- package/src/object-renderer/index.ts +5 -0
- package/src/object-renderer/layout-facts.ts +394 -0
- package/src/object-renderer/layout-plan.ts +225 -0
- package/src/object-renderer/layout-plan.types.ts +59 -0
- package/src/object-renderer/parts.ts +6 -7
- package/src/object-renderer/render-object.ts +107 -46
- package/src/object-renderer/request-actions.ts +4 -2
- package/src/object-renderer/skeleton.ts +58 -19
- package/src/object-renderer/table-actions.ts +172 -32
- package/src/object-renderer/table-gap.ts +37 -0
- package/src/object-renderer/table-tools.ts +62 -30
- package/src/object-renderer/types.ts +84 -13
- package/src/object-renderer/view-binding.ts +205 -8
- package/src/page-target/intent-schema.ts +11 -0
- package/src/page-target/target.ts +5 -1
- package/src/recipes/container.ts +77 -1
- package/src/recipes/control.ts +76 -116
- package/src/recipes/emphasis.ts +56 -0
- package/src/recipes/frame-bleed.ts +33 -0
- package/src/recipes/index.ts +72 -0
- package/src/recipes/nowrap.ts +16 -0
- package/src/recipes/overlay.ts +120 -17
- package/src/recipes/placeholder.ts +95 -0
- package/src/recipes/rail-grid.ts +48 -0
- package/src/recipes/slot-align.ts +56 -0
- package/src/recipes/stat-state.ts +65 -0
- package/src/recipes/state.ts +40 -21
- package/src/recipes/status.ts +147 -0
- package/src/recipes/surface-edge.ts +16 -0
- package/src/recipes/surface.ts +40 -0
- package/src/recipes/table-gap.ts +80 -0
- package/src/recipes/table-native-edit.ts +242 -0
- package/src/recipes/table-row.ts +146 -3
- package/src/recipes/tabs.ts +49 -0
- package/src/recipes/title-row.ts +37 -0
- package/src/recipes/typography.ts +30 -37
- package/src/shared/confirm-decl.ts +118 -0
- package/src/shared/envelope.ts +2 -2
- package/src/shared/paged-list-adapter.ts +15 -240
- package/src/shared/theme-runtime-shared.ts +6 -1
- package/src/theme/index.ts +1 -0
- package/src/theme/kit-theme-text.ts +1 -1
- package/src/theme/kit-theme.css +384 -13
- package/src/theme/kit-theme.tpl +384 -13
- package/src/theme/nine-dim-structure.ts +244 -7
- package/src/theme/surface-layers.ts +10 -1
- package/src/theme/theme-tokens.ts +63 -16
- package/src/theme/theme-types.ts +32 -0
- package/src/theme/typography.ts +21 -17
- package/src/biz/shared/remove-key.ts +0 -6
|
@@ -10,10 +10,12 @@
|
|
|
10
10
|
// 组件不改数据:写入只抛事件;勾选只抛 select_change(载荷 rows 批量,协调组件维护已选)。
|
|
11
11
|
// 记忆(列显隐、行高):localStorage,键含页面路径与对象名,读写全包 try/catch。
|
|
12
12
|
|
|
13
|
-
import type
|
|
13
|
+
import { substituteConfirmText, type SomaComponentDefinition, type SomaDataPort, type SomaRegionPort } from 'soma-core';
|
|
14
14
|
import { tableQuerySignature } from './collection-table';
|
|
15
15
|
import { KIT_ROW_TONE_CLASS } from './view-binding';
|
|
16
|
-
import { KIT_FACE_FIELD, KIT_FACE_RAISED, kitDisabledRecipe, setKitFace, type KitFaceKind } from '../recipes';
|
|
16
|
+
import { KIT_FACE_FIELD, KIT_FACE_RAISED, kitDisabledRecipe, kitSegmentRecipe, kitTextActionRecipe, setKitFace, type KitFaceKind } from '../recipes';
|
|
17
|
+
import { kitEmphasisButtonRecipe } from '../recipes/emphasis';
|
|
18
|
+
import { measureEdges } from '../base/end-edge';
|
|
17
19
|
import { CLASS_PROP, createKitController, num, str } from '../base/shared';
|
|
18
20
|
import { KIT_DROPDOWN_CLASS_CANDIDATES, onOutsidePress, overlayVerdict, releaseDropdownsIn, syncDropdown } from '../base/popup';
|
|
19
21
|
import { permissionCheckerOf } from '../base/permission-gate';
|
|
@@ -28,27 +30,30 @@ import { attachResizeHandle, type ResizeHandle } from '../frames/resize-handle';
|
|
|
28
30
|
import { kitText, type KitTextKey } from '../i18n/kit-text';
|
|
29
31
|
import { KIT_ACTION_SLOT_BASE, actionSlotEmits, emitActionSlot } from '../base/action-slots';
|
|
30
32
|
import { isKitActionBusy, onKitActionBusy } from '../base/action-busy';
|
|
33
|
+
import { KIT_ACTION_MORE_CLASS_CANDIDATES, buildActionGroup, type DomActionEntry } from './action-more';
|
|
31
34
|
|
|
32
35
|
/** 按语气取质感标记:primary 实心 / neutral 描边有面;danger 是透明底幽灵钮,无面不标 */
|
|
33
36
|
const faceOfTone = (tone: 'primary' | 'danger' | 'neutral'): KitFaceKind | null => (tone === 'danger' ? null : KIT_FACE_RAISED);
|
|
34
37
|
|
|
35
38
|
// ---------------------------------------------------------------- 类(整串字面量)
|
|
36
39
|
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const
|
|
40
|
+
// 工具条 / 批量条里的成组动作恒单行(action-group.ts:排布引擎投影):根与组都不换行,放不下的次要动作收进「更多」
|
|
41
|
+
const ROOT_CLASS = 'flex flex-nowrap items-center justify-between gap-2 pb-2';
|
|
42
|
+
const GROUP_CLASS = 'flex min-w-0 flex-1 flex-nowrap items-center justify-end gap-2';
|
|
43
|
+
// 工具条按钮 / 分段按钮 / 文字链接:控件引擎的配方(工具条宿主 tight),不再手写按钮类串
|
|
44
|
+
const TOOL_BTN_CLASS = kitEmphasisButtonRecipe('button.toolbar', { tight: true });
|
|
45
|
+
const SEG_GROUP_CLASS = 'inline-flex items-center rounded-md border border-border-subtle bg-surface p-0.5';
|
|
46
|
+
const SEG_BTN_CLASS = kitSegmentRecipe(false);
|
|
47
|
+
const SEG_BTN_ON_CLASS = kitSegmentRecipe(true);
|
|
48
|
+
const BATCH_BAR_CLASS = 'flex w-full flex-nowrap items-center gap-2 whitespace-nowrap rounded-lg bg-primary-soft px-3 py-1.5 text-sm text-primary-on-soft';
|
|
49
|
+
const BATCH_TEXT_CLASS = 'shrink-0 font-medium';
|
|
50
|
+
const LINK_BTN_CLASS = kitTextActionRecipe('primary');
|
|
46
51
|
const CHECK_TEXT_CLASS = 'text-sm text-fg';
|
|
47
|
-
const PANEL_CHECK_CLASS = 'w-full px-2 py-1 text-sm text-fg hover:bg-
|
|
52
|
+
const PANEL_CHECK_CLASS = 'w-full px-2 py-1 text-sm text-fg hover:bg-state-layer-hover active:bg-state-layer-press';
|
|
48
53
|
const PANEL_CHECK_LOCKED_CLASS = 'w-full px-2 py-1 text-sm';
|
|
49
54
|
const ANCHOR_CLASS = 'relative inline-flex';
|
|
50
55
|
const PANEL_BASE = 'absolute z-20 w-56 rounded-lg border border-border-subtle bg-surface-raised p-2 text-sm text-fg shadow-lg';
|
|
51
|
-
const PANEL_ITEM_CLASS = 'flex cursor-pointer items-center gap-2 rounded-md px-2 py-1 hover:bg-
|
|
56
|
+
const PANEL_ITEM_CLASS = 'flex cursor-pointer items-center gap-2 rounded-md px-2 py-1 hover:bg-state-layer-hover active:bg-state-layer-press';
|
|
52
57
|
const PANEL_ITEM_LOCKED_CLASS = 'flex cursor-not-allowed items-center gap-2 rounded-md px-2 py-1 text-fg-subtle';
|
|
53
58
|
const PANEL_FOOT_CLASS = 'mt-1 flex justify-end border-t border-border-subtle pt-1';
|
|
54
59
|
const NOTICE_CLASS = 'text-xs text-fg-muted';
|
|
@@ -92,7 +97,7 @@ export const KIT_TABLE_TOOLS_CLASS_CANDIDATES: readonly string[] = [
|
|
|
92
97
|
CHECK_TEXT_CLASS, PANEL_CHECK_CLASS, PANEL_CHECK_LOCKED_CLASS, ...KIT_CHECK_CLASS_CANDIDATES, ANCHOR_CLASS, PANEL_BASE, PANEL_ITEM_CLASS, PANEL_ITEM_LOCKED_CLASS, PANEL_FOOT_CLASS, NOTICE_CLASS, NOTICE_ERR_CLASS,
|
|
93
98
|
EDIT_CELL_CLASS, EDIT_INPUT_CLASS, EDIT_DATE_CLASS, EDIT_SELECT_CLASS, EDIT_ERR_CLASS, HIDDEN_CLASS, BUSY_TABLE_CLASS, BUSY_BTN_CLASS,
|
|
94
99
|
...KIT_DATE_CLASS_CANDIDATES, ...KIT_LISTBOX_CLASS_CANDIDATES,
|
|
95
|
-
...Object.values(ACTION_BUTTON_CLASS), ...KIT_TABLE_ACTIONS_CLASS_CANDIDATES, ...KIT_DROPDOWN_CLASS_CANDIDATES,
|
|
100
|
+
...Object.values(ACTION_BUTTON_CLASS), ...KIT_TABLE_ACTIONS_CLASS_CANDIDATES, ...KIT_DROPDOWN_CLASS_CANDIDATES, ...KIT_ACTION_MORE_CLASS_CANDIDATES,
|
|
96
101
|
].flatMap((s) => s.split(/\s+/).filter((c) => c !== ''));
|
|
97
102
|
|
|
98
103
|
// ---------------------------------------------------------------- 纯函数
|
|
@@ -185,9 +190,12 @@ export function buildCsv(columns: readonly ToolsColumn[], rows: readonly unknown
|
|
|
185
190
|
return `${KIT_TABLE_EXT.export.bom ? '' : ''}${lines.join('\r\n')}\r\n`;
|
|
186
191
|
}
|
|
187
192
|
|
|
188
|
-
/**
|
|
193
|
+
/**
|
|
194
|
+
* 批量条的两步确认文案:{n} 换成已选个数。占位文法与代入口径只有 core 的 confirm-spec 一份(substituteConfirmText:
|
|
195
|
+
* `{{` / `}}` 转义、非标识符花括号原样保留;批量只许 {n},其余名字编译期已拒,这里万一遇到按 core 口径代入「—」)。
|
|
196
|
+
*/
|
|
189
197
|
export function confirmText(template: string, n: number): string {
|
|
190
|
-
return template
|
|
198
|
+
return substituteConfirmText(template, { count: n });
|
|
191
199
|
}
|
|
192
200
|
|
|
193
201
|
/** 记忆键:kit-table:页面路径:对象名:列设置|密度 */
|
|
@@ -510,18 +518,15 @@ export function createKitTableTools(): SomaComponentDefinition {
|
|
|
510
518
|
|
|
511
519
|
const applyEdges = (): void => {
|
|
512
520
|
if (!table || P().scroll !== true) return;
|
|
513
|
-
const left = table
|
|
514
|
-
const right = table.scrollLeft + table.clientWidth < table.scrollWidth - 1;
|
|
521
|
+
const { left, right } = measureEdges(table);
|
|
515
522
|
if (left) table.setAttribute('data-kit-edge-l', ''); else table.removeAttribute('data-kit-edge-l');
|
|
516
523
|
if (right) table.setAttribute('data-kit-edge-r', ''); else table.removeAttribute('data-kit-edge-r');
|
|
517
524
|
};
|
|
518
525
|
|
|
519
526
|
const applyCells = (): void => {
|
|
520
527
|
if (!table) return;
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
if (text !== '' && el.getAttribute('title') !== text) el.setAttribute('title', text);
|
|
524
|
-
});
|
|
528
|
+
// 省略列的全文提示不在这里逐格写原生 title:改由 base/hint-tips.ts 的委托在悬停 / 聚焦到单元格时现量、真被截断才挂 kitTooltip
|
|
529
|
+
//(表格外壳带 data-kit-tips 标出作用范围;大表 / 虚拟表不为每个单元格建任何东西)
|
|
525
530
|
if (str(P().editMode) !== '') {
|
|
526
531
|
table.querySelectorAll<HTMLElement>('[data-kit-editable]').forEach((el) => {
|
|
527
532
|
if (el.hasAttribute('data-kit-edit-ready')) return;
|
|
@@ -776,16 +781,28 @@ export function createKitTableTools(): SomaComponentDefinition {
|
|
|
776
781
|
/** 重新读取中:读状态 loading 且当前已有行(首次加载无行,走三态骨架,不叠加) */
|
|
777
782
|
const reading = (p: Rec): boolean => str(p.readState) === 'loading' && Array.isArray(p.rows) && p.rows.length > 0;
|
|
778
783
|
|
|
784
|
+
// 动作组「更多」菜单的清理函数(每次整体重建前先清)
|
|
785
|
+
let groupOffs: Array<() => void> = [];
|
|
786
|
+
const releaseGroups = (): void => {
|
|
787
|
+
for (const off of groupOffs) off();
|
|
788
|
+
groupOffs = [];
|
|
789
|
+
};
|
|
790
|
+
|
|
791
|
+
/** 工具栏:密度分段是视图模式开关(不进动作组,恒可见);刷新 / 列设置 / 导出是动作,成组经排布引擎(恒单行,放不下的次要项收进「更多」,列设置 = 主操作恒可见) */
|
|
779
792
|
const renderToolbar = (doc: Document, items: string[], busy: boolean): HTMLElement => {
|
|
780
793
|
const group = doc.createElement('div');
|
|
781
794
|
group.className = GROUP_CLASS;
|
|
795
|
+
const entries: DomActionEntry[] = [];
|
|
782
796
|
for (const it of items) {
|
|
783
797
|
if (it === 'reload') {
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
798
|
+
entries.push({
|
|
799
|
+
id: 'reload', label: T('soma.kit.refresh'), importance: 'secondary',
|
|
800
|
+
button: btn(
|
|
801
|
+
doc, busy ? `${TOOL_BTN_CLASS} ${BUSY_BTN_CLASS}` : TOOL_BTN_CLASS, T('soma.kit.refresh'),
|
|
802
|
+
busy ? { 'data-kit-tool': 'reload', disabled: '', 'aria-busy': 'true' } : { 'data-kit-tool': 'reload' },
|
|
803
|
+
KIT_FACE_RAISED,
|
|
804
|
+
),
|
|
805
|
+
});
|
|
789
806
|
} else if (it === 'density') {
|
|
790
807
|
const seg = doc.createElement('div');
|
|
791
808
|
seg.className = SEG_GROUP_CLASS;
|
|
@@ -796,17 +813,23 @@ export function createKitTableTools(): SomaComponentDefinition {
|
|
|
796
813
|
const b = btn(doc, on ? SEG_BTN_ON_CLASS : SEG_BTN_CLASS, T(d.label), { 'data-kit-table-density': d.id, 'aria-pressed': on ? 'true' : 'false' }, on ? KIT_FACE_RAISED : null);
|
|
797
814
|
seg.appendChild(b);
|
|
798
815
|
}
|
|
816
|
+
seg.classList.add('shrink-0');
|
|
799
817
|
group.appendChild(seg);
|
|
800
818
|
} else if (it === 'columns') {
|
|
801
819
|
const anchor = doc.createElement('div');
|
|
802
820
|
anchor.className = ANCHOR_CLASS;
|
|
803
821
|
anchor.appendChild(btn(doc, TOOL_BTN_CLASS, T('soma.kit.columns'), { 'data-kit-tool': 'columns', 'aria-haspopup': 'dialog', 'aria-expanded': panelOpen ? 'true' : 'false' }, KIT_FACE_RAISED));
|
|
804
822
|
if (panelOpen) anchor.appendChild(columnPanel(doc));
|
|
805
|
-
|
|
823
|
+
entries.push({ id: 'columns', label: T('soma.kit.columns'), importance: 'primary', button: anchor });
|
|
806
824
|
} else if (it === 'export') {
|
|
807
|
-
|
|
825
|
+
entries.push({ id: 'export', label: T('soma.kit.export'), importance: 'secondary', button: btn(doc, TOOL_BTN_CLASS, T('soma.kit.export'), { 'data-kit-tool': 'export', title: T('soma.kit.export_page_hint') }, KIT_FACE_RAISED) });
|
|
808
826
|
}
|
|
809
827
|
}
|
|
828
|
+
if (entries.length > 0) {
|
|
829
|
+
const built = buildActionGroup(doc, entries);
|
|
830
|
+
groupOffs.push(built.destroy);
|
|
831
|
+
group.appendChild(built.el);
|
|
832
|
+
}
|
|
810
833
|
return group;
|
|
811
834
|
};
|
|
812
835
|
|
|
@@ -883,6 +906,8 @@ export function createKitTableTools(): SomaComponentDefinition {
|
|
|
883
906
|
return bar;
|
|
884
907
|
}
|
|
885
908
|
}
|
|
909
|
+
// 批量动作成组经排布引擎:恒单行,放不下的次要动作收进「更多」(危险项置末加分隔线),主操作恒在行尾可见
|
|
910
|
+
const entries: DomActionEntry[] = [];
|
|
886
911
|
for (const b of batch) {
|
|
887
912
|
if (b.permission !== '' && check !== null && !check(b.permission)) continue;
|
|
888
913
|
const busy = isKitActionBusy(batchBusyNames(b));
|
|
@@ -893,7 +918,12 @@ export function createKitTableTools(): SomaComponentDefinition {
|
|
|
893
918
|
}
|
|
894
919
|
const button = btn(doc, ACTION_BUTTON_CLASS[b.tone], b.name, attrs, faceOfTone(b.tone));
|
|
895
920
|
if (busy) button.disabled = true;
|
|
896
|
-
|
|
921
|
+
entries.push({ id: b.id, label: b.name, importance: b.tone === 'primary' ? 'primary' : b.tone === 'danger' ? 'danger' : 'secondary', tone: b.tone, button });
|
|
922
|
+
}
|
|
923
|
+
if (entries.length > 0) {
|
|
924
|
+
const built = buildActionGroup(doc, entries);
|
|
925
|
+
groupOffs.push(built.destroy);
|
|
926
|
+
bar.appendChild(built.el);
|
|
897
927
|
}
|
|
898
928
|
return bar;
|
|
899
929
|
};
|
|
@@ -934,6 +964,7 @@ export function createKitTableTools(): SomaComponentDefinition {
|
|
|
934
964
|
// 重建会销毁旧面板;开着时由 columnPanel 重新登记,关着就保持空
|
|
935
965
|
colsPanelEl = null;
|
|
936
966
|
releaseDropdownsIn(root);
|
|
967
|
+
releaseGroups();
|
|
937
968
|
root.replaceChildren();
|
|
938
969
|
if (!liveEl || liveEl.parentElement === null) {
|
|
939
970
|
liveEl = doc.createElement('div');
|
|
@@ -1112,6 +1143,7 @@ export function createKitTableTools(): SomaComponentDefinition {
|
|
|
1112
1143
|
const offs: Array<() => void> = [];
|
|
1113
1144
|
cancelHeldRebuild = () => { rebuildHeld = false; renderHeld = false; pressing = false; disarmHeld(); };
|
|
1114
1145
|
offs.push(() => cancelHeldRebuild());
|
|
1146
|
+
offs.push(() => releaseGroups());
|
|
1115
1147
|
offs.push(onKitActionBusy(() => rebuild()));
|
|
1116
1148
|
for (const sliceName of ['filter', 'view'] as const) {
|
|
1117
1149
|
const slice = regionPort()?.slice(sliceName);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// 对象渲染内核的全部类型(C 组独占;D、E 只 import)。
|
|
2
2
|
// renderObject(KitObject, KitRenderContext) -> KitObjectIR,纯函数,不碰 DOM。
|
|
3
3
|
|
|
4
|
+
import type { SomaConfirmSpec } from 'soma-core';
|
|
5
|
+
|
|
4
6
|
export type KitType =
|
|
5
7
|
| 'text' | 'longtext' | 'int' | 'decimal' | 'money' | 'percent' | 'bool'
|
|
6
8
|
| 'enum' | 'enums' | 'date' | 'datetime' | 'daterange';
|
|
@@ -103,7 +105,11 @@ export interface KitAction {
|
|
|
103
105
|
submit?: string; // 具名动作名
|
|
104
106
|
builtin?: string;
|
|
105
107
|
targetOverlay?: string; // 由第 3 层业务组件解释
|
|
106
|
-
|
|
108
|
+
/**
|
|
109
|
+
* 二次确认:字符串 = plain 文案(逐字写进 core 的 confirm 尾段);对象 = core 确认规格 { level, text, phrase?, impact? }(字面量,
|
|
110
|
+
* 对象形只给普通动作,删除动作与批量动作只收字符串)。判据见 shared/confirm-decl.ts
|
|
111
|
+
*/
|
|
112
|
+
confirm?: string | SomaConfirmSpec;
|
|
107
113
|
tone?: KitActionTone;
|
|
108
114
|
/** 纯字段名提取列表(仅 request 动作允许,从当前行/上下文取纯字段名,禁止表达式) */
|
|
109
115
|
pick?: string[];
|
|
@@ -119,6 +125,11 @@ export interface KitAction {
|
|
|
119
125
|
download?: KitDownloadDecl;
|
|
120
126
|
/** on: toolbar:展示对象路径 `view.<成员>`;on: row:行字段路径 `row.<字段>`。路径取值为真时动作置灰;只许纯路径,见 view-binding.ts */
|
|
121
127
|
disabled?: string;
|
|
128
|
+
/**
|
|
129
|
+
* 置灰原因(必须与 disabled 同写,只在动作置灰时显示):字面量文案 | `view.<成员>`(toolbar / row)| `row.<字段>`(仅 row)。
|
|
130
|
+
* 呈现写死:按钮保持可聚焦(只留 aria-disabled)、原因走气泡与 aria-describedby,菜单项带描述文字;见 base/reason-tip.ts
|
|
131
|
+
*/
|
|
132
|
+
disabledReason?: string;
|
|
122
133
|
/** on: row:行字段路径 `row.<字段>`,取值为真时该行不显示这个动作(业务对象逐行给出);只许纯路径 */
|
|
123
134
|
hidden?: string;
|
|
124
135
|
}
|
|
@@ -180,6 +191,8 @@ export interface KitBehavior {
|
|
|
180
191
|
params?: Record<string, string>;
|
|
181
192
|
/** 必填关联参数名(biz 联动组件内部写:子对象缺关联键时 core 跳过请求,编成 from[].require;须是 params 的键) */
|
|
182
193
|
requireParams?: string[];
|
|
194
|
+
/** 必填请求参数(J14,人写页公开写法):名字须是 params 的键;任一为空时 core 不发读请求、对象保持 idle;与 requireParams 同编成 from[].require */
|
|
195
|
+
require?: Array<string | string[]>;
|
|
183
196
|
list?: Partial<KitListShape> & { rowsPath?: string; totalPath?: string };
|
|
184
197
|
linkKey?: string;
|
|
185
198
|
actions?: KitAction[];
|
|
@@ -202,7 +215,7 @@ export interface KitFieldRef {
|
|
|
202
215
|
label?: string;
|
|
203
216
|
/** 逐视图覆写占位文案(K-3);等价于 props.placeholder,props 里显式写的优先 */
|
|
204
217
|
placeholder?: string;
|
|
205
|
-
/**
|
|
218
|
+
/** 字段说明文字:编辑态格(form / filter)渲染在控件下;只读视图(列表列头 / 摘要标签旁)显示成「i」说明气泡(J9) */
|
|
206
219
|
help?: string;
|
|
207
220
|
/** 字段 action 绑定的组件事件名(闭集 = 该组件契约 emits);缺省 Button / Link 绑 click、其余绑 change */
|
|
208
221
|
on?: string;
|
|
@@ -246,6 +259,13 @@ export interface KitFieldRef {
|
|
|
246
259
|
options?: string;
|
|
247
260
|
/** 展示对象路径 `view.<成员>`(表单里的画布字段 FlowEditor):节点字段候选项,成员是 { "<节点类型>.<字段键>": [{ value, label, meta? }] } 对象(整体替换引用写入);并进画布对应 select 字段的 options */
|
|
248
261
|
nodeOptions?: string;
|
|
262
|
+
/** 子表字段(RowEditor)的列候选项:view.<对象成员> { "<列键>": [{ value, label }] } */
|
|
263
|
+
columnOptions?: string;
|
|
264
|
+
/**
|
|
265
|
+
* 展示对象路径 `view.<成员>`(表单里的画布字段 FlowEditor):AI 建议,成员是 [{ id, label, reason?, nodes, edges }] 数组(展示对象持有状态,整体替换引用写入);
|
|
266
|
+
* 画布把它们画成虚影并给「采纳 / 忽略」。采纳把建议并进草稿值,采纳 / 忽略都经 `view.form.onDraft` 的载荷(`suggestion: { id, action }`)回到展示对象,由它清掉对应建议
|
|
267
|
+
*/
|
|
268
|
+
suggestions?: string;
|
|
249
269
|
}
|
|
250
270
|
|
|
251
271
|
/** 分隔线字段项的内容(对象渲染里的 `{ divider: ... }`,编成基础件 KitDivider) */
|
|
@@ -350,6 +370,8 @@ export type KitCollection =
|
|
|
350
370
|
| ({
|
|
351
371
|
type: 'table'; tree?: KitTreeDecl; select?: KitSelectDecl; rowActions?: string[]; page?: KitPageDecl; stickyHeader?: boolean; expand?: KitExpandDecl;
|
|
352
372
|
striped?: boolean; bordered?: boolean;
|
|
373
|
+
/** 标题旁的「共 N 条」(有标题行的非分页集合缺省显示;写 false 关闭;分页集合由分页器显示总数,写 true 也不重复) */
|
|
374
|
+
count?: boolean;
|
|
353
375
|
/** 工具栏:reload / density / columns / export(顺序即显示顺序) */
|
|
354
376
|
toolbar?: Array<'reload' | 'density' | 'columns' | 'export'>;
|
|
355
377
|
/** 批量操作:`@动作id` 引用 behavior.actions,或内联 { id, name, submit | builtin, confirm?, tone?, permission? };confirm 里 `{n}` 换成已选个数 */
|
|
@@ -368,8 +390,14 @@ export type KitCollection =
|
|
|
368
390
|
resizable?: boolean;
|
|
369
391
|
} & KitCollectionStateDecl)
|
|
370
392
|
| ({ type: 'treeTable'; tree?: KitTreeDecl; select?: 'none' | 'single' | 'multi'; rowActions?: string[]; page?: KitPageDecl; stickyHeader?: boolean; striped?: boolean; bordered?: boolean; contextMenu?: string[] } & KitCollectionStateDecl)
|
|
371
|
-
| ({ type: 'cards'; cols: 1 | 2 | 3 | 4 | 6; class?: string; rowActions?: string[]; page?: KitPageDecl; contextMenu?: string[]; bordered?: boolean } & KitCollectionStateDecl)
|
|
372
|
-
| ({ type: 'stack'; class?: string; rowActions?: string[]; page?: KitPageDecl; contextMenu?: string[]; bordered?: boolean } & KitCollectionStateDecl)
|
|
393
|
+
| ({ type: 'cards'; cols: 1 | 2 | 3 | 4 | 6; class?: string; rowActions?: string[]; page?: KitPageDecl; contextMenu?: string[]; bordered?: boolean; count?: boolean } & KitCollectionStateDecl)
|
|
394
|
+
| ({ type: 'stack'; class?: string; rowActions?: string[]; page?: KitPageDecl; contextMenu?: string[]; bordered?: boolean; count?: boolean } & KitCollectionStateDecl)
|
|
395
|
+
/**
|
|
396
|
+
* 紧凑列表(主栏 / 侧栏用):每条两行——主标题(fields 第一项)+ 次要信息(其余字段以「·」分隔的辅助文字,枚举 / 状态字段以圆点 + 文字呈现),
|
|
397
|
+
* 右侧行操作为文字链接;选中态与表格行选中同一条事件通道与区域切片;行高由密度令牌决定(py-N)。
|
|
398
|
+
* 外观写死(bordered 无意义、被忽略;class 只作列表容器的覆写);分页、右键菜单、三态、count 与 stack 同。
|
|
399
|
+
*/
|
|
400
|
+
| ({ type: 'compact-list'; class?: string; bordered?: boolean; rowActions?: string[]; page?: KitPageDecl; contextMenu?: string[]; count?: boolean } & KitCollectionStateDecl);
|
|
373
401
|
|
|
374
402
|
export interface KitViewForm {
|
|
375
403
|
/**
|
|
@@ -379,6 +407,11 @@ export interface KitViewForm {
|
|
|
379
407
|
title?: string | { create?: string; edit?: string };
|
|
380
408
|
/** form 视图:提交按钮文案(K-7) */
|
|
381
409
|
submitLabel?: string;
|
|
410
|
+
/**
|
|
411
|
+
* form 视图:保存成功的提示文案(字面量;含义同请求动作 `request.notify`),替换默认的「已保存」类提示。
|
|
412
|
+
* 只对 SingleObjectForm / CheckoutPage / SettingsCenter 的表单生效;不许 view. / row. 路径、{…} 占位、管道符;空串 / 缺省 = 默认文案。
|
|
413
|
+
*/
|
|
414
|
+
notify?: string;
|
|
382
415
|
/** form 视图:表单草稿变化时调用的展示对象方法名(只写方法名,编成 UI_REFRESH | page.<方法>) */
|
|
383
416
|
onDraft?: string;
|
|
384
417
|
/** form 视图:提交闸门,展示对象路径 `view.<成员>`;为真时禁用提交按钮(字段仍可编辑),如分步表单某步先验证通过才可「下一步」 */
|
|
@@ -389,7 +422,7 @@ export interface KitViewForm {
|
|
|
389
422
|
class?: string;
|
|
390
423
|
cellClass?: string;
|
|
391
424
|
rowClass?: string;
|
|
392
|
-
/** 行样式档位:`row.<字段>`,字段取值是 viewObject.rowState.toneTiers
|
|
425
|
+
/** 行样式档位:`row.<字段>`,字段取值是 viewObject.rowState.toneTiers 的档位名(业务对象逐行给出);只许纯路径,对所有集合(table / treeTable / 虚拟滚动表 / cards / stack)生效 */
|
|
393
426
|
rowTone?: string;
|
|
394
427
|
replaceClass?: boolean;
|
|
395
428
|
staticComponent?: string;
|
|
@@ -561,6 +594,27 @@ export interface KitDiagnostic {
|
|
|
561
594
|
hint?: string;
|
|
562
595
|
}
|
|
563
596
|
|
|
597
|
+
/**
|
|
598
|
+
* 布局体检建议(RV-1117 T05):与 diagnostics 并行的新通道,`ok` / diagnostics 契约不变。
|
|
599
|
+
* 严重级沿用 diagnostic-registry.severities:error / warn / advice(该档案下不适用的规则不产出)。
|
|
600
|
+
*/
|
|
601
|
+
export type KitAdvisorySeverity = 'error' | 'warn' | 'advice';
|
|
602
|
+
export interface KitAdvisory {
|
|
603
|
+
/** 布局气味码:`KIT-LAYOUT-` 加三位序号(001 起,登记在 kit-grammar.json#diagnostics) */
|
|
604
|
+
code: string;
|
|
605
|
+
severity: KitAdvisorySeverity;
|
|
606
|
+
/** 位置,如 `main.entity.view.list.fields[2]` */
|
|
607
|
+
path: string;
|
|
608
|
+
/** 问题(三段式的「问题」) */
|
|
609
|
+
message: string;
|
|
610
|
+
/** 建议(三段式的「建议」) */
|
|
611
|
+
hint: string;
|
|
612
|
+
/** 来源文件(应用装配编译页面时补,相对应用根) */
|
|
613
|
+
file?: string;
|
|
614
|
+
line?: number;
|
|
615
|
+
column?: number;
|
|
616
|
+
}
|
|
617
|
+
|
|
564
618
|
// ---------------------------------------------------------------- IR
|
|
565
619
|
|
|
566
620
|
/** 12 份制在三个关键档上的份数:base 窄档恒 12;wide = md 档;full = 最宽档。 */
|
|
@@ -581,6 +635,8 @@ export interface KitCell {
|
|
|
581
635
|
label: string;
|
|
582
636
|
/** 传给组件的 props(含 options / format / ref.props)。options 保持 kit 形状(value/label/tone)。 */
|
|
583
637
|
props: Record<string, unknown>;
|
|
638
|
+
/** 列表字段项 props 里绑 row.<字段> 的项({ prop 名: 行字段名 },已核字段在 schema 里);发射层按行变量换成 core 行路径,不进 props */
|
|
639
|
+
rowProps?: Record<string, string>;
|
|
584
640
|
action?: string;
|
|
585
641
|
parts: KitCellParts;
|
|
586
642
|
/** 格容器类:栅格跨度类 + 基准类 + 覆写,已 mergeClass。 */
|
|
@@ -591,6 +647,8 @@ export interface KitCell {
|
|
|
591
647
|
errorClass: string;
|
|
592
648
|
/** 说明文字(编辑态格,来自 fields[].help;缺省不出现) */
|
|
593
649
|
help?: string;
|
|
650
|
+
/** 说明气泡文字(只读格:列表列头 / 摘要标签旁的「i」图标钮,来自 fields[].help,J9;编辑态走上面的 help 行,两者互斥) */
|
|
651
|
+
helpTip?: string;
|
|
594
652
|
placeholder?: boolean;
|
|
595
653
|
/** 分隔线格(字段项 `{ divider }`):不对应 schema 字段、不参与提交 / 筛选镜像 */
|
|
596
654
|
divider?: boolean;
|
|
@@ -668,6 +726,8 @@ export interface KitHeadCell {
|
|
|
668
726
|
group?: number;
|
|
669
727
|
/** 叶子表头格右缘带列宽拖拽手柄(需要 col;手柄由 KitTableTools 补) */
|
|
670
728
|
resizable?: boolean;
|
|
729
|
+
/** 字段说明(fields[].help):标签旁「i」图标钮,悬停 / 聚焦显示(J9);缺省不出现 */
|
|
730
|
+
help?: string;
|
|
671
731
|
}
|
|
672
732
|
|
|
673
733
|
/** 多级表头的一个列组(Q 波 G4,单层):组块 = flex 列(上组标题格 + 下叶子表头行) */
|
|
@@ -758,7 +818,7 @@ export interface KitExpandIR {
|
|
|
758
818
|
}
|
|
759
819
|
|
|
760
820
|
export type KitLayoutIR =
|
|
761
|
-
| { kind: 'grid'; wrapClass: string; gridClass: string; cells: KitCell[] }
|
|
821
|
+
| { kind: 'grid'; wrapClass: string; gridClass: string; cells: KitCell[]; /** filter 视图(cols 排布):排布引擎的筛选区投影(档位 + 字段 [最小, 理想, 最大] 宽的类串 + 动作区 / 占位 / 提示条类),见 filter-plan.ts */ filterProjection?: import('./filter-plan').KitFilterProjection }
|
|
762
822
|
| { kind: 'rows'; wrapClass: string; rowClass: string; rows: KitCell[][] }
|
|
763
823
|
| { kind: 'flex'; wrapClass: string; cells: KitCell[] }
|
|
764
824
|
/** summary.groups:每节 = 小标题 + 一个单对象排布(grid / rows / flex) */
|
|
@@ -793,7 +853,7 @@ export type KitLayoutIR =
|
|
|
793
853
|
headClass: string;
|
|
794
854
|
head: KitHeadCell[];
|
|
795
855
|
rowClass: string;
|
|
796
|
-
/** 行样式档位取自的行字段名(view.list.rowTone: row
|
|
856
|
+
/** 行样式档位取自的行字段名(view.list.rowTone: row.<字段>);table(含树表 / 虚拟滚动表)与 cards / stack 都有 */
|
|
797
857
|
rowTone?: string;
|
|
798
858
|
cells: KitCell[];
|
|
799
859
|
rowActions: KitAction[];
|
|
@@ -802,6 +862,8 @@ export type KitLayoutIR =
|
|
|
802
862
|
selectClass: string;
|
|
803
863
|
actionsClass: string;
|
|
804
864
|
pager: KitPagerIR | null;
|
|
865
|
+
/** collection.count: false 才有(关闭标题旁的「共 N 条」);缺省不写 */
|
|
866
|
+
showCount?: boolean;
|
|
805
867
|
/** 有可排序列:表头发射成 KitTableHead */
|
|
806
868
|
sort: boolean;
|
|
807
869
|
stickyHeader: boolean;
|
|
@@ -846,11 +908,20 @@ export type KitLayoutIR =
|
|
|
846
908
|
itemClass: string;
|
|
847
909
|
inner: KitLayoutIR;
|
|
848
910
|
rowActions: KitAction[];
|
|
911
|
+
/** 行样式档位取自的行字段名(view.list.rowTone: row.<字段>);走 itemToneTiers(描边 / 透明度,不改底色) */
|
|
912
|
+
rowTone?: string;
|
|
849
913
|
/** 声明了 page 才有分页器(M1-2);缺省不分页 */
|
|
850
914
|
pager: KitPagerIR | null;
|
|
915
|
+
/** collection.count: false 才有(关闭标题旁的「共 N 条」);缺省不写 */
|
|
916
|
+
showCount?: boolean;
|
|
851
917
|
state: KitStateIR | null;
|
|
852
918
|
/** 右键菜单动作(Q 波 G6,已解析;空 / 缺省 = 无) */
|
|
853
919
|
contextMenu?: KitAction[];
|
|
920
|
+
/**
|
|
921
|
+
* 紧凑列表(collection.type: compact-list):仍是 stack 形态(事件 / 分页 / 三态 / 右键菜单全走 stack 的路径),
|
|
922
|
+
* 条目换成「主标题 + 次要信息」两行:title = 主标题字段,meta = 次要字段(枚举 / 状态字段以圆点 + 文字呈现),见 collection.ts compactListOf
|
|
923
|
+
*/
|
|
924
|
+
compact?: { title: KitCell; meta: KitCell[] };
|
|
854
925
|
}
|
|
855
926
|
| {
|
|
856
927
|
kind: 'static'; component: string; accept: 'single' | 'list'; map: Record<string, string>; class: string; chart?: KitChartDecl;
|
|
@@ -903,13 +974,13 @@ export interface KitFormOpts {
|
|
|
903
974
|
scrollToError?: boolean;
|
|
904
975
|
/** 必填星号在标签前(缺省在后) */
|
|
905
976
|
requiredMark?: 'start';
|
|
906
|
-
/** filter
|
|
907
|
-
collapsible?: boolean;
|
|
908
|
-
collapsedRows?: number;
|
|
909
|
-
defaultCollapsedCount?: number;
|
|
910
|
-
/** filter 字段数 > 4(或 > defaultCollapsedCount)时自动开启的更多筛选溢出标记 */
|
|
911
|
-
filterOverflow?: boolean;
|
|
977
|
+
/** filter:触发方式(即时生效档由排布引擎选定后为 change) */
|
|
912
978
|
trigger?: 'submit' | 'change';
|
|
979
|
+
/** filter:排布引擎选定的档位(instant / submit / more)与更多档钉住的字段数 */
|
|
980
|
+
filterMode?: 'instant' | 'submit' | 'more';
|
|
981
|
+
pinned?: number;
|
|
982
|
+
/** filter:页面键对档位的显式覆盖(formOptsOf 产出,render-object 选档后即删,不进最终 IR) */
|
|
983
|
+
filterOverride?: import('./filter-plan').KitFilterOverride;
|
|
913
984
|
/** groupsAs: tabs(form 的 groups 平铺成页签) */
|
|
914
985
|
groupTabs?: boolean;
|
|
915
986
|
/** 底栏动作 id(已校验为字符串数组;是否 request / download 动作在 emit 阶段核对) */
|