soma-kit 0.1.10 → 0.1.12
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 +103 -110
- package/bin/soma-kit.mjs +1 -1
- package/bin/soma.mjs +22 -0
- package/package.json +13 -7
- package/packs/finance/reconcile-board.ts +5 -2
- package/packs/finance/reconcile-desk/compile.ts +3 -2
- package/spec/generated/kit-app.schema.json +776 -38
- package/spec/generated/kit-page.schema.json +1613 -224
- package/spec/kit-grammar.json +770 -529
- package/spec/kit-grammar.schema.json +1962 -392
- package/src/app/app-config.ts +371 -347
- package/src/app/component-gate.ts +12 -15
- package/src/app/compose-apps.ts +79 -8
- package/src/app/define-kit-actions.ts +245 -41
- package/src/app/define-kit-app.ts +174 -31
- package/src/app/define-kit-view.ts +100 -0
- package/src/app/envelope.ts +1 -161
- package/src/app/index.ts +13 -2
- package/src/app/kit-view-context.ts +290 -0
- package/src/app/notify-renderer.ts +1 -115
- package/src/app/paged-list-adapter.ts +1 -240
- package/src/app/server-pages.ts +8 -2
- package/src/app/server.ts +491 -101
- package/src/app/submit.types.ts +1 -1
- package/src/app/theme-endpoint.ts +63 -0
- package/src/app/theme-runtime-shared.ts +1 -0
- package/src/app/theme-runtime.ts +663 -0
- package/src/base/action-busy.ts +2 -2
- package/src/base/action-gate.ts +4 -255
- package/src/base/action-slots.ts +47 -0
- package/src/base/alert.ts +5 -3
- package/src/base/avatar.ts +2 -2
- package/src/base/button.ts +46 -29
- package/src/base/cascader.ts +11 -12
- package/src/base/check-core.ts +1 -1
- package/src/base/choice.ts +28 -26
- package/src/base/class-candidates.ts +17 -0
- package/src/base/color-picker.ts +6 -6
- package/src/base/combobox.ts +5 -3
- package/src/base/command-palette.ts +9 -5
- package/src/base/countdown.ts +1 -1
- package/src/base/date-range.ts +25 -11
- package/src/base/date.ts +85 -17
- package/src/base/divider.ts +2 -2
- package/src/base/fab.ts +11 -4
- package/src/base/image.ts +1 -1
- package/src/base/index.ts +9 -3
- package/src/base/input.ts +42 -13
- package/src/base/kbd.ts +3 -1
- package/src/base/link.ts +4 -4
- package/src/base/listbox-core.ts +50 -30
- package/src/base/loading-gate.ts +133 -0
- package/src/base/mentions.ts +5 -5
- package/src/base/menu-button.ts +6 -1
- package/src/base/menu-core.ts +4 -0
- package/src/base/motion/aura.ts +2 -2
- package/src/base/motion/hover-3d.ts +2 -2
- package/src/base/motion/hover-gallery.ts +2 -2
- package/src/base/motion/marquee.ts +2 -2
- package/src/base/motion/text-rotate.ts +2 -2
- package/src/base/number.ts +93 -80
- package/src/base/otp.ts +4 -1
- package/src/base/permission-gate.ts +6 -0
- package/src/base/popover.ts +40 -8
- package/src/base/popup.ts +79 -14
- package/src/base/price-text.ts +2 -2
- package/src/base/progress.ts +2 -2
- package/src/base/qr-code.ts +4 -4
- package/src/base/qty-stepper.ts +9 -3
- package/src/base/range.ts +2 -2
- package/src/base/rating.ts +1 -1
- package/src/base/segmented.ts +4 -0
- package/src/base/select.ts +4 -3
- package/src/base/shared.ts +221 -29
- package/src/base/swap.ts +4 -1
- package/src/base/switch.ts +1 -1
- package/src/base/tag-input.ts +14 -10
- package/src/base/tag.ts +5 -1
- package/src/base/text.ts +39 -6
- package/src/base/textarea.ts +37 -11
- package/src/base/time-picker.ts +12 -9
- package/src/base/tree-select.ts +15 -8
- package/src/base/upload.ts +34 -5
- package/src/base/virtual-list.ts +107 -1
- package/src/biz/approval-desk/compile.ts +23 -41
- package/src/biz/auth-panel/compile.ts +37 -52
- package/src/biz/auth-panel/index.ts +1 -1
- package/src/biz/category-crud/compile.ts +22 -36
- package/src/biz/checkout-page/compile.ts +21 -5
- package/src/biz/compose.ts +13 -27
- package/src/biz/define.ts +5 -4
- package/src/biz/import-wizard/compile.ts +22 -26
- package/src/biz/import-wizard/hub.ts +126 -61
- package/src/biz/import-wizard/shell.ts +3 -3
- package/src/biz/index.ts +3 -3
- package/src/biz/landing-page/compile.ts +19 -3
- package/src/biz/link/hub.ts +49 -20
- package/src/biz/link/shared.ts +115 -118
- package/src/biz/master-sub/compile.ts +31 -44
- package/src/biz/multi-board/compile.ts +34 -49
- package/src/biz/multi-board/index.ts +18 -1
- package/src/biz/multi-board/shell.ts +24 -15
- package/src/biz/notification-center/compile.ts +21 -33
- package/src/biz/page-templates/domain-templates.ts +80 -13
- package/src/biz/page-templates/result-page/compile.ts +11 -2
- package/src/biz/page-templates/shared.ts +34 -36
- package/src/biz/record-detail/compile.ts +47 -42
- package/src/biz/record-detail/index.ts +11 -1
- package/src/biz/settings-center/compile.ts +6 -5
- package/src/biz/shared/action-host.ts +91 -211
- package/src/biz/shared/compile-helpers.ts +80 -0
- package/src/biz/shared/coordinator.ts +486 -83
- package/src/biz/shared/index.ts +8 -2
- package/src/biz/shared/overlay-shell.ts +80 -0
- package/src/biz/shared/pipes.ts +43 -30
- package/src/biz/shared/remove-key.ts +6 -0
- package/src/biz/shared/remove-wire.ts +29 -0
- package/src/biz/shared/runtime-hub.ts +216 -24
- package/src/biz/single-form/compile.ts +15 -37
- package/src/biz/standard-crud/compile.ts +62 -107
- package/src/biz/standard-crud/shell.ts +16 -66
- package/src/biz/step-form/compile.ts +26 -97
- package/src/biz/step-form/hub.ts +34 -41
- package/src/biz/types.ts +4 -3
- package/src/cli/core-imports.ts +54 -0
- package/src/cli/kit-cli.ts +130 -26
- package/src/cli/kit-init.ts +222 -0
- package/src/cli/service-endpoint-check.ts +425 -0
- package/src/cli/source-path-check.d.mts +17 -0
- package/src/cli/source-path-check.mjs +334 -0
- package/src/cli/view-writes.ts +752 -0
- package/src/compile/action-host-attach.ts +21 -29
- package/src/compile/closed-set.ts +509 -0
- package/src/compile/compile-page.ts +219 -72
- package/src/compile/component-candidates.ts +1 -1
- package/src/compile/hints.ts +30 -1
- package/src/compile/index.ts +1 -0
- package/src/compile/kit-error.ts +1 -0
- package/src/compile/locate.ts +21 -1
- package/src/compile/parse.ts +370 -41
- package/src/compile/redirect.ts +6 -2
- package/src/compile/styles.ts +35 -2
- package/src/compile/types.ts +18 -2
- package/src/compile/view-check.ts +151 -0
- package/src/data/amount-breakdown.ts +2 -2
- package/src/data/anchor-nav.ts +2 -2
- package/src/data/approval-flow.ts +2 -2
- package/src/data/assignment-picker.ts +40 -29
- package/src/data/async-result-panel.ts +62 -6
- package/src/data/breadcrumbs.ts +2 -2
- package/src/data/calendar.ts +22 -25
- package/src/data/carousel.ts +5 -2
- package/src/data/chart.ts +42 -34
- package/src/data/checklist.ts +2 -2
- package/src/data/code-view.ts +4 -2
- package/src/data/comment-thread.ts +5 -2
- package/src/data/confirm-dialog.ts +10 -0
- package/src/data/context-menu.ts +29 -37
- package/src/data/d9-util.ts +2 -18
- package/src/data/diff.ts +4 -2
- package/src/data/dock.ts +2 -2
- package/src/data/embed.ts +2 -1
- package/src/data/field-mapper.ts +31 -26
- package/src/data/flow-editor-contract.ts +1 -1
- package/src/data/flow-editor.ts +89 -100
- package/src/data/flow-node-options.ts +90 -0
- package/src/data/flow-remote-options.ts +0 -103
- package/src/data/footer.ts +2 -2
- package/src/data/form-draft-registry.ts +2 -4
- package/src/data/gantt.ts +14 -17
- package/src/data/hero.ts +2 -2
- package/src/data/image-viewer.ts +20 -26
- package/src/data/index.ts +0 -2
- package/src/data/item-list.ts +31 -22
- package/src/data/kanban.ts +43 -42
- package/src/data/media-grid.ts +14 -19
- package/src/data/menu.ts +2 -2
- package/src/data/mockup.ts +2 -2
- package/src/data/modal-dialog.ts +22 -18
- package/src/data/navbar.ts +7 -2
- package/src/data/notify-renderer.ts +235 -0
- package/src/data/object-form.ts +1036 -648
- package/src/data/pager.ts +65 -29
- package/src/data/permission-matrix.ts +20 -21
- package/src/data/permission-tree.ts +28 -26
- package/src/data/pricing-table.ts +9 -3
- package/src/data/reaction-bar.ts +77 -88
- package/src/data/read-rollback.ts +73 -0
- package/src/data/record-card.ts +3 -3
- package/src/data/record-picker.ts +93 -50
- package/src/data/redirect.ts +32 -32
- package/src/data/remote-options.ts +13 -6
- package/src/data/request-console.ts +5 -3
- package/src/data/resident.ts +2 -1
- package/src/data/result-panel.ts +4 -2
- package/src/data/rich-text.ts +45 -55
- package/src/data/row-editor.ts +285 -52
- package/src/data/rule-builder.ts +18 -12
- package/src/data/shape-util.ts +4 -0
- package/src/data/stat-group.ts +243 -101
- package/src/data/static-registry.ts +22 -11
- package/src/data/steps.ts +2 -2
- package/src/data/survey.ts +24 -29
- package/src/data/system-switcher.ts +2 -2
- package/src/data/timeline.ts +2 -2
- package/src/data/tour-guide.ts +22 -29
- package/src/data/transfer.ts +27 -23
- package/src/data/tree-table.ts +96 -48
- package/src/data/tree.ts +27 -34
- package/src/data/trend-line.ts +6 -24
- package/src/data/virtual-rows.ts +118 -76
- package/src/data/watermark.ts +2 -2
- package/src/data/wrap.ts +63 -38
- package/src/frames/blank-frame.ts +1 -0
- package/src/frames/index.ts +2 -2
- package/src/frames/page-bar.ts +12 -11
- package/src/frames/page-header.ts +14 -5
- package/src/frames/page-status.ts +2 -2
- package/src/frames/shared.ts +23 -17
- package/src/frames/single-frame.ts +1 -0
- package/src/frames/split-frame/shell.ts +5 -5
- package/src/frames/split-frame/wiring.ts +2 -2
- package/src/frames/tabs-frame/shell.ts +2 -13
- package/src/frames/tabs-frame/wiring.ts +4 -8
- package/src/frames/top-main-frame.ts +1 -0
- package/src/frames/types.ts +13 -2
- package/src/frames/workspace-frame/extras.ts +20 -4
- package/src/frames/workspace-frame/index.ts +1 -1
- package/src/frames/workspace-frame/shell.ts +1 -0
- package/src/frames/workspace-frame/state.ts +13 -6
- package/src/frames/workspace-frame/view.ts +119 -25
- package/src/generated/kit-grammar-runtime.ts +430 -366
- package/src/generated/page-origin.ts +0 -11
- package/src/i18n/kit-text.ts +23 -27
- package/src/index.ts +2 -1
- package/src/object-renderer/action-gate.ts +11 -147
- package/src/object-renderer/arrange.ts +71 -77
- package/src/object-renderer/collapse-wiring.ts +2 -2
- package/src/object-renderer/collection-expand.ts +2 -2
- package/src/object-renderer/collection-parts.ts +216 -100
- package/src/object-renderer/collection-table.ts +180 -42
- package/src/object-renderer/collection.ts +95 -79
- package/src/object-renderer/compile-data.ts +85 -100
- package/src/object-renderer/crud-bridge.ts +32 -0
- package/src/object-renderer/defaults.ts +8 -14
- package/src/object-renderer/display-checks.ts +3 -24
- package/src/object-renderer/emit-events.ts +186 -172
- package/src/object-renderer/emit-object.ts +15 -2
- package/src/object-renderer/emit-static.ts +174 -132
- package/src/object-renderer/field-value.ts +593 -396
- package/src/object-renderer/filter-reload.ts +70 -0
- package/src/object-renderer/form-detail.ts +112 -2
- package/src/object-renderer/index.ts +26 -0
- package/src/object-renderer/key-field.ts +12 -0
- package/src/object-renderer/linkage.ts +7 -270
- package/src/object-renderer/merge-class.ts +18 -1
- package/src/object-renderer/path-pick.ts +27 -0
- package/src/object-renderer/render-object.ts +405 -86
- package/src/object-renderer/request-actions.ts +230 -249
- package/src/object-renderer/table-actions.ts +195 -95
- package/src/object-renderer/table-summary.ts +2 -2
- package/src/object-renderer/table-tools.ts +418 -84
- package/src/object-renderer/types.ts +128 -122
- package/src/object-renderer/view-binding.ts +196 -0
- package/src/page-target/ai-surface.ts +37 -0
- package/src/page-target/compile.ts +48 -8
- package/src/page-target/index.ts +8 -1
- package/src/page-target/intent-schema.ts +154 -28
- package/src/page-target/target.ts +257 -50
- package/src/page-target/writer-policy.ts +14 -3
- package/src/recipes/container.ts +165 -0
- package/src/recipes/control.ts +219 -0
- package/src/recipes/index.ts +263 -0
- package/src/recipes/overlay.ts +182 -0
- package/src/recipes/state.ts +70 -0
- package/src/recipes/table-row.ts +51 -0
- package/src/recipes/typography.ts +87 -0
- package/src/shared/action-field-guard.ts +41 -0
- package/src/shared/envelope.ts +207 -0
- package/src/shared/escape.ts +57 -0
- package/src/shared/kit-error.ts +21 -0
- package/src/shared/paged-list-adapter.ts +240 -0
- package/src/shared/path-guard.ts +127 -0
- package/src/shared/theme-runtime-shared.ts +175 -0
- package/src/shared/view-info.ts +10 -0
- package/src/theme/index.ts +12 -0
- package/src/theme/kit-theme-text.ts +1 -1
- package/src/theme/kit-theme.css +38 -1
- package/src/theme/kit-theme.tpl +38 -1
- package/src/theme/nine-dim-structure.ts +77 -0
- package/src/theme/surface-layers.ts +97 -0
- package/src/theme/theme-tokens.ts +85 -79
- package/src/theme/theme-types.ts +71 -0
- package/src/theme/typography.ts +17 -17
- package/src/biz/shared/step-values.ts +0 -25
- package/src/biz/step-form/steps-ref.ts +0 -112
- package/src/data/options-bus.ts +0 -24
- package/src/data/prompt-dialog.ts +0 -235
- package/src/object-renderer/adopt-gate.ts +0 -333
- package/src/object-renderer/field-policy.ts +0 -89
- package/src/object-renderer/outcome-draft.ts +0 -61
- package/src/theme/nine-dim-palettes.ts +0 -1278
|
@@ -5,6 +5,10 @@ export type KitType =
|
|
|
5
5
|
| 'text' | 'longtext' | 'int' | 'decimal' | 'money' | 'percent' | 'bool'
|
|
6
6
|
| 'enum' | 'enums' | 'date' | 'datetime' | 'daterange';
|
|
7
7
|
export type KitPermission = 'r' | 'w' | 'create';
|
|
8
|
+
export type KitFieldAccess = 'read' | 'write' | 'create' | KitPermission;
|
|
9
|
+
export type KitFieldEmphasis = 'strong' | 'muted';
|
|
10
|
+
export type KitContainerEmphasis = 'primary' | 'normal' | 'subtle';
|
|
11
|
+
export type KitSurfaceRecipe = 'card' | 'flush' | 'plain';
|
|
8
12
|
/** 基础组件名:内置 13 个 + 应用登记的 App*。 */
|
|
9
13
|
export type KitBaseName = string;
|
|
10
14
|
export type KitMode = 'show' | 'edit';
|
|
@@ -22,34 +26,15 @@ export interface KitOptionDecl {
|
|
|
22
26
|
|
|
23
27
|
// ---------------------------------------------------------------- M 波 G3:字段联动(条件 / 后续链 / 远程选项)
|
|
24
28
|
|
|
25
|
-
/** 闭集条件叶子:{ field, op, value? }(op 取 formLinkage.conditions.ops) */
|
|
26
|
-
export interface KitCondition {
|
|
27
|
-
field: string;
|
|
28
|
-
op: string;
|
|
29
|
-
value?: unknown;
|
|
30
|
-
}
|
|
31
|
-
/** 闭集谓词:叶子,或一层 all / any 组合 */
|
|
32
|
-
export type KitPredicate = KitCondition | { all: KitCondition[] } | { any: KitCondition[] };
|
|
33
|
-
/** 字段项 `when` 的场景:新建 / 编辑 / 只读 */
|
|
34
|
-
export type KitScene = 'add' | 'edit' | 'view';
|
|
35
|
-
|
|
36
|
-
/** 动作后续链的一项:恰好一个键 */
|
|
37
|
-
export type KitThenItem =
|
|
38
|
-
| { link: string }
|
|
39
|
-
| { toast: string | { text: string; tone?: 'success' | 'info' | 'warning' | 'danger' | 'neutral' } }
|
|
40
|
-
| { reload: true };
|
|
41
|
-
|
|
42
29
|
/** schema.<字段>.options 的对象写法:远程选项 */
|
|
43
30
|
export interface KitOptionsFromDecl {
|
|
44
31
|
from: string;
|
|
45
|
-
/**
|
|
32
|
+
/** 请求参数:字面量 */
|
|
46
33
|
params?: Record<string, unknown>;
|
|
47
34
|
valueKey?: string;
|
|
48
35
|
labelKey?: string;
|
|
49
36
|
/** 响应体里行数组的路径(缺省依次试 formLinkage.optionsFrom.rowsPathCandidates) */
|
|
50
37
|
rowsPath?: string;
|
|
51
|
-
/** 所选选项行回填其它字段:{ 目标字段: 选项行的键 } */
|
|
52
|
-
fill?: Record<string, string>;
|
|
53
38
|
/** 远程搜索:搜索框(组件抛 search)的关键字作为这个参数重取 */
|
|
54
39
|
searchParam?: string;
|
|
55
40
|
/** 级联(Cascader)按层懒加载:展开节点时以 `<lazy>=<节点值>` 重取子级;根层不带该参数 */
|
|
@@ -62,17 +47,6 @@ export interface KitOptionsFromDecl {
|
|
|
62
47
|
childrenKey?: string;
|
|
63
48
|
}
|
|
64
49
|
|
|
65
|
-
/** view.form.policy:{ by: 字段名, table: { 取值: { hide | readonly | required: [字段] } } } */
|
|
66
|
-
export interface KitFieldPolicyDecl {
|
|
67
|
-
by: string;
|
|
68
|
-
table: Record<string, { hide?: string[]; readonly?: string[]; required?: string[] }>;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/** behavior.poll:对象级轮询(命中 while 的行还在,就每 every 秒重取) */
|
|
72
|
-
export interface KitPollDecl {
|
|
73
|
-
every: number;
|
|
74
|
-
while: { field: string; in: Array<string | number | boolean> };
|
|
75
|
-
}
|
|
76
50
|
/** behavior.subscribe 的一条(refresh 恒为本对象) */
|
|
77
51
|
export interface KitSubscribeDecl {
|
|
78
52
|
channel: string;
|
|
@@ -84,6 +58,8 @@ export interface KitRule {
|
|
|
84
58
|
required?: boolean;
|
|
85
59
|
max_len?: number;
|
|
86
60
|
min_len?: number;
|
|
61
|
+
maxLength?: number;
|
|
62
|
+
minLength?: number;
|
|
87
63
|
pattern?: string;
|
|
88
64
|
min?: number;
|
|
89
65
|
max?: number;
|
|
@@ -95,7 +71,15 @@ export interface KitFieldSchema {
|
|
|
95
71
|
name: string;
|
|
96
72
|
type: KitType;
|
|
97
73
|
key?: boolean;
|
|
98
|
-
permission?: KitPermission; // 缺省 'r'
|
|
74
|
+
permission?: KitPermission; // 缺省 'r'(有 write 接口的非主键字段缺省 'w')
|
|
75
|
+
/** 字段读写权限:read / write / create(与 permission 等价) */
|
|
76
|
+
access?: KitFieldAccess;
|
|
77
|
+
/** 字段显式只读标记 */
|
|
78
|
+
readonly?: boolean;
|
|
79
|
+
/** 字段级语义强调:strong(粗体高亮)/ muted(弱化文字) */
|
|
80
|
+
emphasis?: KitFieldEmphasis;
|
|
81
|
+
/** 指标项/字段格主色高亮强调 */
|
|
82
|
+
highlight?: boolean;
|
|
99
83
|
/** 静态选项数组;写成对象 { from, params?, ... } 即远程选项(M 波 G3,renderObject 规整后进 KitCell.optionsFrom) */
|
|
100
84
|
options?: KitOptionDecl[] | KitOptionsFromDecl;
|
|
101
85
|
rules?: KitRule[];
|
|
@@ -103,15 +87,15 @@ export interface KitFieldSchema {
|
|
|
103
87
|
edit?: KitBaseName; // 第二优先级(编辑态)
|
|
104
88
|
format?: string; // 覆盖 types 表的 format,如 'currency:CNY'
|
|
105
89
|
ref?: string; // 共享顶层 schema 里的同名字段
|
|
106
|
-
/** 字段初值(GB2,human-only
|
|
90
|
+
/** 字段初值(GB2,human-only):字面量;只在新建时填「空且没改过」的字段 */
|
|
107
91
|
default?: unknown;
|
|
108
92
|
/** 隐藏草稿字段(GB3,human-only):值随草稿提交但表单不画;须可提交(permission w / create),不是安全边界 */
|
|
109
93
|
hidden?: boolean;
|
|
110
|
-
/** 由草稿派生的只读展示字段(GB6,human-only):{ template },闭集模板,permission 须为 r */
|
|
111
|
-
derive?: { template: string };
|
|
112
94
|
}
|
|
113
95
|
export type KitSchema = Record<string, KitFieldSchema>;
|
|
114
96
|
|
|
97
|
+
export type KitActionTone = 'primary' | 'neutral' | 'danger' | 'ghost' | 'tonal';
|
|
98
|
+
|
|
115
99
|
export interface KitAction {
|
|
116
100
|
id: string;
|
|
117
101
|
name: string;
|
|
@@ -120,33 +104,23 @@ export interface KitAction {
|
|
|
120
104
|
builtin?: string;
|
|
121
105
|
targetOverlay?: string; // 由第 3 层业务组件解释
|
|
122
106
|
confirm?: string;
|
|
123
|
-
tone?:
|
|
107
|
+
tone?: KitActionTone;
|
|
108
|
+
/** 纯字段名提取列表(仅 request 动作允许,从当前行/上下文取纯字段名,禁止表达式) */
|
|
109
|
+
pick?: string[];
|
|
110
|
+
/** 纯字段名重命名映射(仅 request 动作允许:{ 请求体键名: 源字段名 },禁止表达式) */
|
|
111
|
+
bodyMap?: Record<string, string>;
|
|
124
112
|
/** 单个权限码;写成数组报 KIT-OBJ-006(运行期类型保持宽松以便诊断)。 */
|
|
125
113
|
permission?: string | string[];
|
|
126
|
-
/** 执行后的写死后续:`reload` = 动作成功后经协调组件重取(K-5);业务组件之外的对象直接 window-reload */
|
|
127
|
-
after?: 'reload';
|
|
128
|
-
/** 执行后的有序后续链(M 波 G3,上限 formLinkage.then.maxItems):link / toast / reload */
|
|
129
|
-
then?: KitThenItem[];
|
|
130
|
-
/** 行操作可用条件(只用于 on: row):编进 steps 前置,行字段写在叶子 field 里 */
|
|
131
|
-
when?: KitPredicate;
|
|
132
114
|
/** 行操作固定折叠进「更多」菜单(B8;超过内联上限的也自动折叠) */
|
|
133
115
|
more?: boolean;
|
|
134
116
|
/** 声明式请求动作(P1):与 submit / builtin 三选一,由页面级 KitActionHost 经 core 写通道执行 */
|
|
135
117
|
request?: KitRequestDecl;
|
|
136
118
|
/** 声明式下载动作(P1):触发浏览器下载(GET 链接 / POST 表单),不经 fetch */
|
|
137
119
|
download?: KitDownloadDecl;
|
|
138
|
-
/**
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
|
|
142
|
-
/** GA5:builtin 为 openCreate 的动作点击时预填新建表单:{ 字段: $filter.x | 字面量 } */
|
|
143
|
-
prefill?: Record<string, unknown>;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/** request.then 数组项(H1b / H1c):reload 目标(true = 主对象与附带对象 / 页面数据对象名 / 以 / 开头的 options.from 接口路径)与触发时机(缺省 success) */
|
|
147
|
-
export interface KitRequestThenItem {
|
|
148
|
-
reload: true | string;
|
|
149
|
-
on?: 'success' | 'failed' | 'always';
|
|
120
|
+
/** on: toolbar:展示对象路径 `view.<成员>`;on: row:行字段路径 `row.<字段>`。路径取值为真时动作置灰;只许纯路径,见 view-binding.ts */
|
|
121
|
+
disabled?: string;
|
|
122
|
+
/** on: row:行字段路径 `row.<字段>`,取值为真时该行不显示这个动作(业务对象逐行给出);只许纯路径 */
|
|
123
|
+
hidden?: string;
|
|
150
124
|
}
|
|
151
125
|
|
|
152
126
|
/** 按行分槽的结果命名:结果按「名字 + 行键」分开存;key 是 `$row.<主键字段>`(须是对象的 key: true 字段),行内动作的 outcome 条件默认读本行那一份 */
|
|
@@ -154,42 +128,36 @@ export interface KitIntoDecl {
|
|
|
154
128
|
name: string;
|
|
155
129
|
/** 按行分槽:`$row.<主键字段>`;写了 keyBy 时是列表项里的键字段名(拆分成 `<name>#<键值>` 的按行结果) */
|
|
156
130
|
key: string;
|
|
157
|
-
/**
|
|
131
|
+
/** 拆分:响应体里的列表路径(点路径);把一次请求的结果按列表项拆成按行结果,每项各按信封判状态 */
|
|
158
132
|
keyBy?: string;
|
|
159
133
|
}
|
|
160
134
|
|
|
161
|
-
/** request / download 的取值路径:`$row.字段` / `$focus.字段` / `$filter.字段` / `$page.page` / `$value` / `$selected.字段`;非 `$` 开头是字面量 */
|
|
162
135
|
export interface KitRequestDecl {
|
|
163
136
|
api: string;
|
|
164
137
|
method?: 'POST' | 'PUT' | 'PATCH';
|
|
165
|
-
body?: Record<string, unknown>;
|
|
166
138
|
/** 结果命名(outcome 范围名):组件用 outcome prop 订阅 pending / saved / failed 与响应 */
|
|
167
139
|
into?: string | KitIntoDecl;
|
|
168
|
-
/**
|
|
140
|
+
/** 处理中可取消:在原位置(结果槽)显示「取消」,点了真正中止请求,结果记为「已取消」(outcome 状态 cancelled,不是失败也不是成功) */
|
|
169
141
|
cancelable?: boolean;
|
|
170
|
-
/** 业务信封判定:path 取到的值不等于 equals 视为失败,message 取失败文案路径 */
|
|
171
|
-
ok?: { path?: string; equals?: unknown; message?: string };
|
|
172
142
|
/** 成功提示(词条或文案) */
|
|
173
143
|
notify?: string;
|
|
174
144
|
/** 页头状态行文案(配 page.status.follow):ok 成功后一行、failed 失败一行(可含 {字段} 插值与 {message});没写退回通用词条 */
|
|
175
145
|
status?: { ok?: string; failed?: string };
|
|
176
|
-
/**
|
|
177
|
-
then?: 'reload' | 'none' | KitRequestThenItem[];
|
|
178
|
-
/** H1d / H1e:声明该接口只读(POST 仅为带体查询);自动触发(on: mount / view.form.onChange)只许 read 的请求;read 的请求 then 缺省为 none */
|
|
146
|
+
/** H1d:声明该接口只读(POST 仅为带体查询);自动触发(on: mount)只许 read 的请求;只读请求成功后不重取(写操作成功后宿主固定重取) */
|
|
179
147
|
read?: boolean;
|
|
180
148
|
/** H1d:页面挂载时自动发一次(只许 read: true 的 POST) */
|
|
181
149
|
on?: 'mount';
|
|
182
|
-
/** GA4 请求前输入:发请求之前先弹出自绘输入表单,输入值作 $prompt 取值根 */
|
|
183
|
-
prompt?: { title?: string; submitLabel?: string; fields: Array<Record<string, unknown>> };
|
|
184
150
|
/** GA6 请求超时毫秒(区间读 core 语法真源 write.timeoutMs) */
|
|
185
151
|
timeoutMs?: number;
|
|
152
|
+
/** 纯字段名提取列表(从当前行/上下文取纯字段名,禁止表达式) */
|
|
153
|
+
pick?: string[];
|
|
154
|
+
/** 纯字段名重命名映射({ 请求体键名: 源字段名 },禁止表达式) */
|
|
155
|
+
bodyMap?: Record<string, string>;
|
|
186
156
|
}
|
|
187
157
|
|
|
188
158
|
export interface KitDownloadDecl {
|
|
189
159
|
api: string;
|
|
190
160
|
method?: 'GET' | 'POST';
|
|
191
|
-
body?: Record<string, unknown>;
|
|
192
|
-
query?: Record<string, unknown>;
|
|
193
161
|
filename?: string;
|
|
194
162
|
}
|
|
195
163
|
|
|
@@ -215,8 +183,6 @@ export interface KitBehavior {
|
|
|
215
183
|
list?: Partial<KitListShape> & { rowsPath?: string; totalPath?: string };
|
|
216
184
|
linkKey?: string;
|
|
217
185
|
actions?: KitAction[];
|
|
218
|
-
/** 对象级轮询:原样编成 core 的 data.<对象>.poll(core 运行时执行) */
|
|
219
|
-
poll?: KitPollDecl;
|
|
220
186
|
/** 地址栏同步(D8):true = 页码 / 每页条数 / 排序 / 筛选字段同步到查询串(复用 core 的 state.query) */
|
|
221
187
|
syncUrl?: boolean;
|
|
222
188
|
/** 数据变更订阅(D5):refresh 恒为本对象,编成顶层 subscribe */
|
|
@@ -225,8 +191,6 @@ export interface KitBehavior {
|
|
|
225
191
|
validateOn?: Array<'change' | 'blur' | 'submit'>;
|
|
226
192
|
/** 离开守卫(D5):草稿有改动时拦截刷新 / 关闭 / 站内链接;true 等价 confirm */
|
|
227
193
|
leaveGuard?: boolean | 'confirm' | 'none';
|
|
228
|
-
/** 接口适配(D4):{ 目标字段: 源路径 [| 管道] },原样编成 core 的 transform */
|
|
229
|
-
adapter?: Record<string, string>;
|
|
230
194
|
/** 编辑详情:打开编辑表单时先按选中行取详情,成功后详情盖行作初值(见 object-renderer/form-detail.ts,KIT-DET-001) */
|
|
231
195
|
detail?: { from: { api: string; params?: Record<string, string | number | boolean> }; unwrap?: string };
|
|
232
196
|
}
|
|
@@ -240,18 +204,8 @@ export interface KitFieldRef {
|
|
|
240
204
|
placeholder?: string;
|
|
241
205
|
/** 表单字段说明文字:只在编辑态格(form / filter)渲染在控件下;只读视图不显示 */
|
|
242
206
|
help?: string;
|
|
243
|
-
/** 条件显示(form / filter):草稿满足谓词才显示;不显示的字段不进 model、不过校验 */
|
|
244
|
-
showWhen?: KitPredicate;
|
|
245
|
-
/** 条件必填(form):编成字段 rules[].when 的必填规则,标签随条件加星号 */
|
|
246
|
-
requiredWhen?: KitPredicate;
|
|
247
|
-
/** 条件禁用(form / filter):草稿满足谓词时控件置灰(值保留、仍进 model) */
|
|
248
|
-
disabledWhen?: KitPredicate;
|
|
249
207
|
/** 字段 action 绑定的组件事件名(闭集 = 该组件契约 emits);缺省 Button / Link 绑 click、其余绑 change */
|
|
250
208
|
on?: string;
|
|
251
|
-
/** 选记录类组件(抛 pick,如 RecordPicker)的回填:{ 源记录键: 目标表单字段 },单选取 item、多选取 items */
|
|
252
|
-
fill?: Record<string, string>;
|
|
253
|
-
/** 场景显隐:只在列出的场景出现(add = 新建表单,edit = 编辑表单,view = 只读视图) */
|
|
254
|
-
when?: KitScene | KitScene[];
|
|
255
209
|
component?: KitBaseName;
|
|
256
210
|
props?: Record<string, unknown>;
|
|
257
211
|
action?: string;
|
|
@@ -276,8 +230,22 @@ export interface KitFieldRef {
|
|
|
276
230
|
class?: string;
|
|
277
231
|
labelClass?: string;
|
|
278
232
|
valueClass?: string;
|
|
233
|
+
/** 字段级语义强调:strong / muted */
|
|
234
|
+
emphasis?: KitFieldEmphasis;
|
|
235
|
+
/** 指标项/字段格高亮 */
|
|
236
|
+
highlight?: boolean;
|
|
279
237
|
/** 内部:normalizeRef 把 `{ divider }` 字段项规范成它(用户不直接写) */
|
|
280
238
|
divider?: KitDividerDecl;
|
|
239
|
+
/** 展示对象路径 `view.<成员>`(表单字段项):字段隐藏(值保留);只许纯路径,见 view-binding.ts */
|
|
240
|
+
hidden?: string;
|
|
241
|
+
/** 展示对象路径 `view.<成员>`(表单字段项):字段置灰 */
|
|
242
|
+
disabled?: string;
|
|
243
|
+
/** 展示对象路径 `view.<成员>`(表单字段项):字段必填 */
|
|
244
|
+
required?: string;
|
|
245
|
+
/** 展示对象路径 `view.<成员>`(表单字段项):候选项来源,成员是 [{ value, label }] 数组(展示对象按另一字段取数后写入);替换该字段的静态 / 远程候选 */
|
|
246
|
+
options?: string;
|
|
247
|
+
/** 展示对象路径 `view.<成员>`(表单里的画布字段 FlowEditor):节点字段候选项,成员是 { "<节点类型>.<字段键>": [{ value, label, meta? }] } 对象(整体替换引用写入);并进画布对应 select 字段的 options */
|
|
248
|
+
nodeOptions?: string;
|
|
281
249
|
}
|
|
282
250
|
|
|
283
251
|
/** 分隔线字段项的内容(对象渲染里的 `{ divider: ... }`,编成基础件 KitDivider) */
|
|
@@ -364,9 +332,9 @@ export interface KitBatchActionDecl {
|
|
|
364
332
|
submit?: string;
|
|
365
333
|
builtin?: string;
|
|
366
334
|
confirm?: string;
|
|
367
|
-
tone?:
|
|
335
|
+
tone?: KitActionTone;
|
|
368
336
|
permission?: string;
|
|
369
|
-
/** 经 `@动作id` 引用 behavior.actions 里的 request / download
|
|
337
|
+
/** 经 `@动作id` 引用 behavior.actions 里的 request / download 动作时带过来 */
|
|
370
338
|
request?: KitRequestDecl;
|
|
371
339
|
download?: KitDownloadDecl;
|
|
372
340
|
}
|
|
@@ -381,7 +349,7 @@ export interface KitColumnGroupDecl {
|
|
|
381
349
|
export type KitCollection =
|
|
382
350
|
| ({
|
|
383
351
|
type: 'table'; tree?: KitTreeDecl; select?: KitSelectDecl; rowActions?: string[]; page?: KitPageDecl; stickyHeader?: boolean; expand?: KitExpandDecl;
|
|
384
|
-
|
|
352
|
+
striped?: boolean; bordered?: boolean;
|
|
385
353
|
/** 工具栏:reload / density / columns / export(顺序即显示顺序) */
|
|
386
354
|
toolbar?: Array<'reload' | 'density' | 'columns' | 'export'>;
|
|
387
355
|
/** 批量操作:`@动作id` 引用 behavior.actions,或内联 { id, name, submit | builtin, confirm?, tone?, permission? };confirm 里 `{n}` 换成已选个数 */
|
|
@@ -399,7 +367,7 @@ export type KitCollection =
|
|
|
399
367
|
/** 列宽拖拽(Q 波 G4):true = 所有非固定列可拖(10 个预置档);字段级 resizable 可单列开关;写了视同进入滚动模式 */
|
|
400
368
|
resizable?: boolean;
|
|
401
369
|
} & KitCollectionStateDecl)
|
|
402
|
-
| ({ type: 'treeTable'; tree?: KitTreeDecl; select?: 'none' | 'single' | 'multi'; rowActions?: string[]; page?: KitPageDecl; stickyHeader?: boolean;
|
|
370
|
+
| ({ type: 'treeTable'; tree?: KitTreeDecl; select?: 'none' | 'single' | 'multi'; rowActions?: string[]; page?: KitPageDecl; stickyHeader?: boolean; striped?: boolean; bordered?: boolean; contextMenu?: string[] } & KitCollectionStateDecl)
|
|
403
371
|
| ({ type: 'cards'; cols: 1 | 2 | 3 | 4 | 6; class?: string; rowActions?: string[]; page?: KitPageDecl; contextMenu?: string[]; bordered?: boolean } & KitCollectionStateDecl)
|
|
404
372
|
| ({ type: 'stack'; class?: string; rowActions?: string[]; page?: KitPageDecl; contextMenu?: string[]; bordered?: boolean } & KitCollectionStateDecl);
|
|
405
373
|
|
|
@@ -411,14 +379,18 @@ export interface KitViewForm {
|
|
|
411
379
|
title?: string | { create?: string; edit?: string };
|
|
412
380
|
/** form 视图:提交按钮文案(K-7) */
|
|
413
381
|
submitLabel?: string;
|
|
382
|
+
/** form 视图:表单草稿变化时调用的展示对象方法名(只写方法名,编成 UI_REFRESH | page.<方法>) */
|
|
383
|
+
onDraft?: string;
|
|
384
|
+
/** form 视图:提交闸门,展示对象路径 `view.<成员>`;为真时禁用提交按钮(字段仍可编辑),如分步表单某步先验证通过才可「下一步」 */
|
|
385
|
+
submitDisabled?: string;
|
|
414
386
|
arrange?: KitArrangeInput;
|
|
415
387
|
collection?: KitCollection;
|
|
416
388
|
fields?: KitFieldItem[];
|
|
417
389
|
class?: string;
|
|
418
390
|
cellClass?: string;
|
|
419
391
|
rowClass?: string;
|
|
420
|
-
/**
|
|
421
|
-
|
|
392
|
+
/** 行样式档位:`row.<字段>`,字段取值是 viewObject.rowState.toneTiers 的档位名(业务对象逐行给出);只许纯路径,只对普通表格生效 */
|
|
393
|
+
rowTone?: string;
|
|
422
394
|
replaceClass?: boolean;
|
|
423
395
|
staticComponent?: string;
|
|
424
396
|
accept?: 'single' | 'list';
|
|
@@ -462,30 +434,30 @@ export interface KitViewForm {
|
|
|
462
434
|
inline?: boolean;
|
|
463
435
|
/** form:校验失败后滚到首个出错字段并聚焦 */
|
|
464
436
|
scrollToError?: boolean;
|
|
465
|
-
/** form
|
|
466
|
-
afterSave?: KitThenItem[];
|
|
467
|
-
/** form:字段策略表——按状态 / 角色字段的取值声明各字段的 hide / readonly / required,编成 showWhen / disabledWhen / requiredWhen */
|
|
468
|
-
policy?: KitFieldPolicyDecl;
|
|
469
|
-
/** form:采纳建议(某 request 动作的 into 返回建议值,用户点「采纳」才写进草稿,不自动提交) */
|
|
470
|
-
adopt?: { from: string; path?: string; map?: Record<string, string>; label?: string; ask?: string; askLabel?: string };
|
|
471
|
-
/** form:底栏动作——behavior.actions 里 request / download 动作的 id,在提交旁多画按钮(可带 $draft 把未保存草稿发出去) */
|
|
437
|
+
/** form:底栏动作——behavior.actions 里 request / download 动作的 id,在提交旁多画按钮 */
|
|
472
438
|
footerActions?: string[];
|
|
473
|
-
/** H1e:字段值变化时自动发 request 动作(防抖):{ 字段名: 动作 id },动作须是 request.read 的请求 */
|
|
474
|
-
onChange?: Record<string, string>;
|
|
475
439
|
/** 请求结果常驻槽(GA3):request 动作 into 的名字,或 { outcome, title? };form 视图画在字段与按钮之间,其它视图编成只展示结果的 AsyncResultPanel */
|
|
476
440
|
result?: string | { outcome: string; title?: string };
|
|
477
441
|
/** filter:折叠时保留的行数(collapsible: true 时生效,1~4) */
|
|
478
442
|
collapsedRows?: number;
|
|
443
|
+
/** filter:首屏常驻筛选字段数量上限(缺省 4;超过时自动启用折叠) */
|
|
444
|
+
defaultCollapsedCount?: number;
|
|
479
445
|
/** filter:触发方式 submit(缺省)/ change */
|
|
480
446
|
trigger?: 'submit' | 'change';
|
|
447
|
+
/** 面板/区块语义强调档位 */
|
|
448
|
+
emphasis?: KitContainerEmphasis;
|
|
449
|
+
/** 面板/视图容器表面配方 */
|
|
450
|
+
surface?: KitSurfaceRecipe;
|
|
451
|
+
/** 面板/指标块主色高亮强调 */
|
|
452
|
+
highlight?: boolean;
|
|
481
453
|
/**
|
|
482
454
|
* 写死形状数据组件的事件接线:{ 组件事件名: 动作 }。动作 = 具名动作名 / `data.orderMove` /
|
|
483
|
-
* 内置角色 `reload` `saved` `cancel` `close`(交协调组件),或 `{ action
|
|
455
|
+
* 内置角色 `reload` `saved` `cancel` `close`(交协调组件),或 `{ action }`。事件名必须在组件契约 emits 里。
|
|
484
456
|
*/
|
|
485
457
|
on?: Record<string, KitViewOnValue>;
|
|
486
458
|
}
|
|
487
|
-
/** view.on
|
|
488
|
-
export type KitViewOnValue = string | { action: string
|
|
459
|
+
/** view.on 的值:动作字符串,或 `{ action }` 对象形态(只绑一条动作管道,之后要做的事写在具名动作里) */
|
|
460
|
+
export type KitViewOnValue = string | { action: string };
|
|
489
461
|
/** view.summary.groups 的一节 */
|
|
490
462
|
export interface KitViewGroup {
|
|
491
463
|
title: string;
|
|
@@ -496,6 +468,10 @@ export interface KitViewGroup {
|
|
|
496
468
|
defaultOpen?: boolean;
|
|
497
469
|
/** 本节上方画一条分隔线;字符串即分隔线文字 */
|
|
498
470
|
divider?: string | boolean;
|
|
471
|
+
/** 本节语义强调档位 */
|
|
472
|
+
emphasis?: KitContainerEmphasis;
|
|
473
|
+
/** 本节容器表面配方 */
|
|
474
|
+
surface?: KitSurfaceRecipe;
|
|
499
475
|
}
|
|
500
476
|
/** view.<槽>.chart:{ type, x, y[], stack?, min?, max?, warnAt?, dangerAt? } */
|
|
501
477
|
export interface KitChartDecl {
|
|
@@ -519,6 +495,14 @@ export interface KitObject {
|
|
|
519
495
|
schema: KitSchema;
|
|
520
496
|
behavior: KitBehavior;
|
|
521
497
|
view?: KitView;
|
|
498
|
+
/** 对象主键字段名(缺省 'id') */
|
|
499
|
+
primaryKey?: string;
|
|
500
|
+
/** 对象级容器语义强调 */
|
|
501
|
+
emphasis?: KitContainerEmphasis;
|
|
502
|
+
/** 对象级容器表面配方 */
|
|
503
|
+
surface?: KitSurfaceRecipe;
|
|
504
|
+
/** 对象级高亮强调 */
|
|
505
|
+
highlight?: boolean;
|
|
522
506
|
}
|
|
523
507
|
|
|
524
508
|
// ---------------------------------------------------------------- 渲染上下文
|
|
@@ -530,6 +514,8 @@ export interface KitStaticContract {
|
|
|
530
514
|
emits?: readonly string[];
|
|
531
515
|
/** 组件契约 props 的键名;用于判断可写静态组件是否走内置 data.submit 通道 */
|
|
532
516
|
props?: readonly string[];
|
|
517
|
+
/** 契约 props 各键的 `type` 字段(无 type 为空串);给了才按类型做缺省绑定(如 error 为 string 时绑读状态错误文案) */
|
|
518
|
+
propTypes?: Readonly<Record<string, string>>;
|
|
533
519
|
}
|
|
534
520
|
|
|
535
521
|
export interface KitRenderContext {
|
|
@@ -552,6 +538,10 @@ export interface KitRenderContext {
|
|
|
552
538
|
* 缺省 = 本对象没有协调组件,`collection.expand.list` 报 KIT-TBL-003 并忽略
|
|
553
539
|
*/
|
|
554
540
|
expandHosts?: ReadonlySet<string>;
|
|
541
|
+
/** 应用级枚举字典(供 renderObject 直接调用时展开 $dict.*) */
|
|
542
|
+
dicts?: Readonly<Record<string, ReadonlyArray<{ value: string | number | boolean; label: string; tone?: string }>>>;
|
|
543
|
+
/** 应用级实体定义(供 renderObject 直接调用时展开 $entity.*) */
|
|
544
|
+
entities?: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
|
|
555
545
|
}
|
|
556
546
|
|
|
557
547
|
// ---------------------------------------------------------------- 诊断
|
|
@@ -611,26 +601,22 @@ export interface KitCell {
|
|
|
611
601
|
group?: KitCellGroup;
|
|
612
602
|
/** summary 的 hideEmpty:值为空时整个格不渲染(发射层给格加 show[id].when = 字段值路径) */
|
|
613
603
|
hideEmpty?: boolean;
|
|
614
|
-
/** 条件(M 波 G3 D1,form / filter 的 KitObjectForm 对草稿求值;谓词已规整成 core 形状 all_of / any_of) */
|
|
615
|
-
showWhen?: Record<string, unknown>;
|
|
616
|
-
disabledWhen?: Record<string, unknown>;
|
|
617
|
-
requiredWhen?: Record<string, unknown>;
|
|
618
604
|
/** 静态必填星号位置(编辑 / 新建态的必填字段;星号单独成红色子元素,不并入 label 文本) */
|
|
619
605
|
required?: 'start' | 'end';
|
|
620
606
|
/** 字段 action 绑定的事件名(fields[].on,已按契约 emits 校验) */
|
|
621
607
|
event?: string;
|
|
622
|
-
/** pick 回填映射(fields[].fill) */
|
|
623
|
-
fill?: Record<string, string>;
|
|
624
|
-
/** 场景显隐(form 按 mode 求值;静态视图编译期已过滤,不进这里) */
|
|
625
|
-
scenes?: Array<'add' | 'edit'>;
|
|
626
608
|
/** 远程选项(D3,form / filter) */
|
|
627
609
|
optionsFrom?: KitOptionsFromIR;
|
|
628
610
|
/** 表格列:文字单行省略(单元格带 data-kit-ellipsis,KitTableTools 补 title) */
|
|
629
611
|
ellipsis?: boolean;
|
|
630
612
|
/** 表格列:可就地编辑(单元格带 data-kit-editable,由 KitTableTools 接管) */
|
|
631
613
|
editable?: boolean;
|
|
632
|
-
/**
|
|
633
|
-
|
|
614
|
+
/** 字段级语义强调(strong / muted) */
|
|
615
|
+
emphasis?: KitFieldEmphasis;
|
|
616
|
+
/** 字段/指标格主色高亮(data-kit-highlight="true") */
|
|
617
|
+
highlight?: boolean;
|
|
618
|
+
/** filter 超过常驻上限(4 项)自动归入折叠区的溢出字段标记 */
|
|
619
|
+
overflow?: boolean;
|
|
634
620
|
}
|
|
635
621
|
|
|
636
622
|
/** 远程选项的 IR(缺省已补全) */
|
|
@@ -640,10 +626,7 @@ export interface KitOptionsFromIR {
|
|
|
640
626
|
valueKey: string;
|
|
641
627
|
labelKey: string;
|
|
642
628
|
rowsPath: string;
|
|
643
|
-
fill: Record<string, string>;
|
|
644
629
|
searchParam: string;
|
|
645
|
-
/** params 里 { field } 引用的同对象字段(依赖字段变化时清值并重取) */
|
|
646
|
-
deps: string[];
|
|
647
630
|
/** 级联:树形选项(整棵树嵌套,或按层懒加载);缺省 = 平铺选项 */
|
|
648
631
|
tree?: { childrenKey: string; leafKey: string; lazy: string; levels: number };
|
|
649
632
|
}
|
|
@@ -723,7 +706,7 @@ export interface KitTableColumnMeta {
|
|
|
723
706
|
export interface KitBatchActionIR {
|
|
724
707
|
id: string;
|
|
725
708
|
name: string;
|
|
726
|
-
tone:
|
|
709
|
+
tone: KitActionTone;
|
|
727
710
|
confirm: string;
|
|
728
711
|
permission?: string;
|
|
729
712
|
action: KitAction;
|
|
@@ -745,6 +728,8 @@ export interface KitStateIR {
|
|
|
745
728
|
error: string;
|
|
746
729
|
/** loading: skeleton -> 加载态画骨架屏(形态随集合:table 行 / cards 卡 / stack 条) */
|
|
747
730
|
skeleton: boolean;
|
|
731
|
+
/** state: false 关闭内置三态后的兜底:只在读取失败时显示失败面板(含重试),加载 / 空态一律不画;错误永不静默 */
|
|
732
|
+
errorOnly?: boolean;
|
|
748
733
|
}
|
|
749
734
|
|
|
750
735
|
/** 树表的层级 IR(collection: treeTable;全部补完缺省) */
|
|
@@ -797,6 +782,8 @@ export type KitLayoutIR =
|
|
|
797
782
|
open: boolean;
|
|
798
783
|
/** 本节上方的分隔线(false = 无;字符串 = 分隔线文字,'' = 纯线) */
|
|
799
784
|
divider: string | false;
|
|
785
|
+
emphasis?: KitContainerEmphasis;
|
|
786
|
+
surface?: KitSurfaceRecipe;
|
|
800
787
|
}>;
|
|
801
788
|
}
|
|
802
789
|
| {
|
|
@@ -806,6 +793,8 @@ export type KitLayoutIR =
|
|
|
806
793
|
headClass: string;
|
|
807
794
|
head: KitHeadCell[];
|
|
808
795
|
rowClass: string;
|
|
796
|
+
/** 行样式档位取自的行字段名(view.list.rowTone: row.<字段>);只普通表格有 */
|
|
797
|
+
rowTone?: string;
|
|
809
798
|
cells: KitCell[];
|
|
810
799
|
rowActions: KitAction[];
|
|
811
800
|
select: 'none' | 'single' | 'multi';
|
|
@@ -820,8 +809,6 @@ export type KitLayoutIR =
|
|
|
820
809
|
stripeClass: string;
|
|
821
810
|
/** 完整网格线模式(collection.bordered: true) */
|
|
822
811
|
bordered?: boolean;
|
|
823
|
-
/** 单元格内边距档位 */
|
|
824
|
-
density: 'compact' | 'standard' | 'comfortable';
|
|
825
812
|
expand: KitExpandIR | null;
|
|
826
813
|
state: KitStateIR | null;
|
|
827
814
|
/** 树表:非 null 时列表体由 KitTreeTable 渲染(表头仍按 sort 走 KitTableHead / 静态头) */
|
|
@@ -840,8 +827,6 @@ export type KitLayoutIR =
|
|
|
840
827
|
summaryCellClasses?: string[];
|
|
841
828
|
/** 滚动模式的合计行类;缺省 '' */
|
|
842
829
|
summaryRowClass?: string;
|
|
843
|
-
/** 条件行类(D9):行满足 core 谓词时在行容器上加这串类 */
|
|
844
|
-
rowClassWhen?: Array<{ when: Record<string, unknown>; class: string }>;
|
|
845
830
|
/** 表头里的选择列 / 操作列类(滚动模式有 fixed 时与行里的不同:底色随表头);缺省同 selectClass / actionsClass */
|
|
846
831
|
selectHeadClass?: string;
|
|
847
832
|
actionsHeadClass?: string;
|
|
@@ -875,6 +860,17 @@ export type KitLayoutIR =
|
|
|
875
860
|
/** 组件契约同时含 emits.submit 与 props.object 且对象声明了 write:走内置 data.submit 通道 */
|
|
876
861
|
dataSubmit?: boolean;
|
|
877
862
|
hasScopeProp?: boolean;
|
|
863
|
+
/** 组件契约声明了 loading 属性,且对象有数据来源:缺省把 loading 绑到数据对象的读状态 */
|
|
864
|
+
hasLoadingProp?: boolean;
|
|
865
|
+
/** 组件契约声明了 error_text 属性,且对象有数据来源:缺省把 error_text 绑到数据对象的 errorMessage */
|
|
866
|
+
hasErrorTextProp?: boolean;
|
|
867
|
+
/** 组件契约没有 error_text、但有 string 型的 error 属性,且对象有数据来源:缺省把 error 绑到数据对象的 errorMessage */
|
|
868
|
+
hasErrorProp?: boolean;
|
|
869
|
+
/**
|
|
870
|
+
* 读失败自动重试:已绑读取错误(hasErrorTextProp / hasErrorProp),且组件契约同时声明 emits.retry 与 props.retry_text。
|
|
871
|
+
* 发射时缺省补 retry_text 文案,并在页面没接 retry 事件时把它接到 `SCOPE | window-reload | <作用域>` 重取本对象。
|
|
872
|
+
*/
|
|
873
|
+
autoRetry?: boolean;
|
|
878
874
|
/** 右键菜单动作(B1 B 组,仅 ItemList / Tree / Kanban,已解析;空 / 缺省 = 无) */
|
|
879
875
|
contextMenu?: KitAction[];
|
|
880
876
|
};
|
|
@@ -891,6 +887,12 @@ export interface KitViewIR {
|
|
|
891
887
|
mode: KitMode | 'mixed';
|
|
892
888
|
/** 表单布局参数(form / filter,M 波 G3 D6 / D7):已校验、补全缺省 */
|
|
893
889
|
formOpts?: KitFormOpts;
|
|
890
|
+
/** 区块/视图级语义强调档位 */
|
|
891
|
+
emphasis?: KitContainerEmphasis;
|
|
892
|
+
/** 面板/视图级容器表面配方 */
|
|
893
|
+
surface?: KitSurfaceRecipe;
|
|
894
|
+
/** 视图/指标卡高亮强调 */
|
|
895
|
+
highlight?: boolean;
|
|
894
896
|
}
|
|
895
897
|
|
|
896
898
|
/** KitObjectForm 的布局 / 行为参数(IR 形态) */
|
|
@@ -904,18 +906,22 @@ export interface KitFormOpts {
|
|
|
904
906
|
/** filter:可折叠 + 折叠行数 + 触发方式 */
|
|
905
907
|
collapsible?: boolean;
|
|
906
908
|
collapsedRows?: number;
|
|
909
|
+
defaultCollapsedCount?: number;
|
|
910
|
+
/** filter 字段数 > 4(或 > defaultCollapsedCount)时自动开启的更多筛选溢出标记 */
|
|
911
|
+
filterOverflow?: boolean;
|
|
907
912
|
trigger?: 'submit' | 'change';
|
|
908
913
|
/** groupsAs: tabs(form 的 groups 平铺成页签) */
|
|
909
914
|
groupTabs?: boolean;
|
|
910
|
-
afterSave?: KitThenItem[];
|
|
911
|
-
/** 采纳建议(已校验) */
|
|
912
|
-
adopt?: { from: string; path?: string; map?: Record<string, string>; label?: string; ask?: string; askLabel?: string };
|
|
913
915
|
/** 底栏动作 id(已校验为字符串数组;是否 request / download 动作在 emit 阶段核对) */
|
|
914
916
|
footerActions?: string[];
|
|
915
|
-
/** 字段变化触发的 request 动作(已校验为 { 字段: 动作 id };是否 read 的 request 在 emit 阶段核对) */
|
|
916
|
-
onChange?: Record<string, string>;
|
|
917
917
|
/** 请求结果常驻槽(已校验):outcome 是 request 动作 into 的名字 */
|
|
918
918
|
result?: { outcome: string; title?: string };
|
|
919
|
+
/** 草稿变化时调用的展示对象方法名(已校验为标识符;是否存在由 compile/view-check 核) */
|
|
920
|
+
onDraft?: string;
|
|
921
|
+
/** 提交闸门(view.form.submitDisabled -> core 路径 page.<成员>) */
|
|
922
|
+
submitDisabled?: string;
|
|
923
|
+
/** 字段项状态绑定(hidden / disabled / required -> core 路径 page.<成员>):编成表单的 fieldState prop */
|
|
924
|
+
fieldState?: Record<string, Partial<Record<'hidden' | 'disabled' | 'required' | 'options', string>>>;
|
|
919
925
|
}
|
|
920
926
|
|
|
921
927
|
export interface KitObjectIR {
|