soma-kit 0.1.11 → 0.1.13
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 +106 -112
- package/bin/soma-kit.mjs +32 -2
- package/bin/soma.mjs +22 -0
- package/package.json +14 -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 +929 -37
- package/spec/generated/kit-page.schema.json +1684 -161
- package/spec/kit-grammar.json +1176 -584
- package/spec/kit-grammar.schema.json +1971 -393
- package/src/app/app-config.ts +449 -347
- package/src/app/component-gate.ts +283 -28
- package/src/app/compose-apps.ts +79 -8
- package/src/app/define-kit-actions.ts +245 -41
- package/src/app/define-kit-app.ts +176 -33
- package/src/app/define-kit-view.ts +104 -0
- package/src/app/dev-diagnostic.ts +5 -0
- package/src/app/envelope.ts +1 -161
- package/src/app/index.ts +29 -6
- package/src/app/kit-view-context.ts +439 -0
- package/src/app/notify-renderer.ts +1 -115
- package/src/app/paged-list-adapter.ts +1 -240
- package/src/app/render-ports.ts +18 -0
- package/src/app/server-pages.ts +11 -3
- package/src/app/server.ts +530 -103
- 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 +667 -0
- package/src/base/action-busy.ts +103 -6
- package/src/base/action-gate.ts +4 -255
- package/src/base/action-slots.ts +58 -0
- package/src/base/alert.ts +5 -3
- package/src/base/anchored-layer.ts +50 -0
- package/src/base/avatar.ts +2 -2
- package/src/base/button.ts +99 -37
- package/src/base/cascader.ts +11 -12
- package/src/base/check-core.ts +9 -1
- package/src/base/checkbox.ts +2 -1
- package/src/base/choice.ts +49 -28
- package/src/base/class-candidates.ts +17 -0
- package/src/base/color-picker.ts +16 -11
- package/src/base/combobox.ts +5 -3
- package/src/base/command-palette.ts +10 -6
- package/src/base/context-menu.ts +10 -7
- package/src/base/countdown.ts +1 -1
- package/src/base/date-range.ts +32 -18
- package/src/base/date.ts +135 -28
- package/src/base/delta.ts +72 -0
- package/src/base/divider.ts +2 -2
- package/src/base/end-edge.ts +49 -0
- package/src/base/fab.ts +12 -5
- package/src/base/gap-value.ts +148 -0
- package/src/base/hint-tips.ts +170 -0
- package/src/base/icons.ts +8 -0
- package/src/base/illustrations.ts +94 -0
- package/src/base/image.ts +1 -1
- package/src/base/index.ts +35 -11
- 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 +56 -35
- package/src/base/loading-gate.ts +186 -0
- package/src/base/mentions.ts +7 -6
- package/src/base/menu-button.ts +28 -12
- package/src/base/menu-core.ts +41 -8
- package/src/base/motion/aura.ts +2 -2
- package/src/base/motion/hover-3d.ts +3 -3
- package/src/base/motion/hover-gallery.ts +2 -2
- package/src/base/motion/marquee.ts +3 -3
- package/src/base/motion/text-rotate.ts +2 -2
- package/src/base/number.ts +93 -80
- package/src/base/otp.ts +9 -5
- package/src/base/overlay-runtime.ts +235 -0
- package/src/base/permission-gate.ts +6 -0
- package/src/base/popover.ts +48 -16
- package/src/base/popup.ts +143 -19
- package/src/base/portal-core.ts +4 -0
- 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 +14 -8
- package/src/base/radio.ts +2 -1
- package/src/base/range.ts +21 -4
- package/src/base/rating.ts +12 -7
- package/src/base/reason-tip.ts +150 -0
- package/src/base/segmented.ts +27 -21
- package/src/base/select.ts +4 -3
- package/src/base/shared.ts +387 -49
- package/src/base/state-panel.ts +346 -0
- package/src/base/status-tone.ts +27 -0
- package/src/base/sticky-edge.ts +116 -0
- package/src/base/swap.ts +10 -7
- package/src/base/switch.ts +11 -6
- package/src/base/tag-input.ts +20 -16
- package/src/base/tag.ts +68 -34
- package/src/base/text.ts +80 -18
- package/src/base/textarea.ts +37 -11
- package/src/base/time-picker.ts +18 -13
- package/src/base/tree-select.ts +21 -12
- package/src/base/trend-tone.ts +9 -0
- package/src/base/upload.ts +48 -14
- package/src/base/view-transition.ts +77 -0
- package/src/base/virtual-list.ts +107 -1
- package/src/biz/approval-desk/compile.ts +23 -41
- package/src/biz/approval-desk/shell.ts +11 -8
- package/src/biz/auth-panel/compile.ts +37 -52
- package/src/biz/auth-panel/index.ts +1 -1
- package/src/biz/auth-panel/shell.ts +5 -4
- package/src/biz/category-crud/compile.ts +23 -37
- package/src/biz/category-crud/shell.ts +2 -1
- package/src/biz/checkout-page/compile.ts +22 -5
- package/src/biz/checkout-page/shell.ts +4 -3
- 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 +5 -4
- package/src/biz/index.ts +3 -3
- package/src/biz/landing-page/compile.ts +19 -3
- package/src/biz/link/hub.ts +69 -22
- package/src/biz/link/shared.ts +127 -119
- package/src/biz/master-sub/compile.ts +127 -48
- package/src/biz/master-sub/index.ts +5 -2
- package/src/biz/master-sub/shell.ts +95 -18
- package/src/biz/multi-board/compile.ts +38 -50
- package/src/biz/multi-board/index.ts +18 -1
- package/src/biz/multi-board/shell.ts +32 -20
- package/src/biz/notification-center/compile.ts +21 -33
- package/src/biz/notification-center/shell.ts +6 -4
- 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/result-page/shell.ts +2 -1
- package/src/biz/page-templates/shared.ts +34 -36
- package/src/biz/page-templates/sign-in-page/shell.ts +2 -2
- package/src/biz/record-detail/compile.ts +48 -43
- package/src/biz/record-detail/index.ts +11 -1
- package/src/biz/record-detail/shell.ts +8 -6
- package/src/biz/settings-center/compile.ts +7 -5
- package/src/biz/settings-center/shell.ts +6 -4
- package/src/biz/shared/action-host.ts +97 -211
- package/src/biz/shared/compile-helpers.ts +98 -0
- package/src/biz/shared/coordinator.ts +472 -92
- package/src/biz/shared/index.ts +13 -2
- package/src/biz/shared/object-aliases.ts +154 -0
- package/src/biz/shared/overlay-compile.ts +239 -0
- package/src/biz/shared/overlay-shell.ts +209 -0
- package/src/biz/shared/pipes.ts +50 -31
- package/src/biz/shared/remove-wire.ts +14 -0
- package/src/biz/shared/runtime-hub.ts +226 -24
- package/src/biz/single-form/compile.ts +16 -37
- package/src/biz/single-form/shell.ts +4 -3
- package/src/biz/standard-crud/compile.ts +72 -255
- package/src/biz/standard-crud/shell.ts +21 -99
- package/src/biz/step-form/compile.ts +26 -97
- package/src/biz/step-form/hub.ts +34 -41
- package/src/biz/step-form/shell.ts +5 -5
- package/src/biz/types.ts +4 -3
- package/src/cli/core-imports.ts +54 -0
- package/src/cli/kit-cli.ts +254 -25
- package/src/cli/kit-init.ts +227 -0
- 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/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 +761 -0
- package/src/compile/action-host-attach.ts +21 -29
- package/src/compile/closed-set.ts +570 -0
- package/src/compile/compile-page.ts +267 -76
- package/src/compile/component-candidates.ts +13 -2
- 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/layout-lint/engine.ts +82 -0
- package/src/compile/layout-lint/index.ts +55 -0
- package/src/compile/layout-lint/rules-composition.ts +218 -0
- package/src/compile/layout-lint/rules-form.ts +192 -0
- package/src/compile/layout-lint/rules-table.ts +194 -0
- package/src/compile/layout-lint/score.ts +52 -0
- package/src/compile/layout-lint/types.ts +51 -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/remove-guard.ts +10 -7
- package/src/compile/styles.ts +63 -2
- package/src/compile/types.ts +31 -3
- package/src/compile/view-check.ts +284 -0
- package/src/data/amount-breakdown.ts +8 -3
- package/src/data/anchor-nav.ts +2 -2
- package/src/data/approval-flow.ts +3 -3
- package/src/data/assignment-picker.ts +92 -55
- package/src/data/async-result-panel.ts +111 -9
- package/src/data/breadcrumbs.ts +5 -4
- package/src/data/calendar.ts +24 -27
- package/src/data/carousel.ts +13 -8
- package/src/data/chart.ts +183 -44
- package/src/data/checklist.ts +20 -7
- package/src/data/code-view.ts +12 -6
- package/src/data/comment-thread.ts +7 -4
- package/src/data/confirm-dialog.ts +81 -18
- 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 +3 -3
- package/src/data/embed.ts +233 -30
- package/src/data/field-mapper.ts +35 -30
- package/src/data/flow-editor-contract.ts +8 -1
- package/src/data/flow-editor.ts +113 -108
- package/src/data/flow-node-options.ts +120 -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 +19 -19
- package/src/data/hero.ts +4 -3
- package/src/data/image-viewer.ts +27 -30
- package/src/data/index.ts +5 -2
- package/src/data/item-list.ts +48 -31
- package/src/data/kanban.ts +82 -52
- package/src/data/media-grid.ts +20 -20
- package/src/data/mega-menu.ts +6 -4
- package/src/data/menu-dom.ts +4 -2
- package/src/data/menu.ts +47 -15
- package/src/data/mockup.ts +10 -6
- package/src/data/modal-dialog.ts +49 -25
- package/src/data/navbar.ts +12 -7
- package/src/data/notice-list.ts +268 -0
- package/src/data/notify-renderer.ts +250 -0
- package/src/data/object-form.ts +1360 -666
- package/src/data/outcome-watch.ts +61 -2
- package/src/data/pager.ts +80 -34
- package/src/data/permission-matrix.ts +52 -31
- package/src/data/permission-tree.ts +71 -44
- package/src/data/pricing-table.ts +30 -14
- package/src/data/prompt-dialog.ts +124 -194
- package/src/data/reaction-bar.ts +83 -92
- package/src/data/read-rollback.ts +73 -0
- package/src/data/record-card.ts +26 -5
- package/src/data/record-picker.ts +104 -55
- 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 +8 -4
- package/src/data/rich-text.ts +61 -55
- package/src/data/row-editor.ts +362 -76
- package/src/data/rule-builder.ts +26 -20
- package/src/data/shape-util.ts +27 -9
- package/src/data/stat-group.ts +392 -109
- package/src/data/static-lazy.ts +1 -0
- package/src/data/static-registry.ts +24 -11
- package/src/data/steps.ts +10 -5
- package/src/data/survey.ts +27 -32
- package/src/data/system-switcher.ts +3 -3
- package/src/data/text-action-button.ts +17 -0
- package/src/data/timeline.ts +19 -8
- package/src/data/tour-guide.ts +23 -30
- package/src/data/transfer.ts +62 -38
- package/src/data/tree-table.ts +152 -78
- package/src/data/tree.ts +49 -36
- package/src/data/trend-line.ts +6 -24
- package/src/data/virtual-rows.ts +133 -82
- package/src/data/watermark.ts +2 -2
- package/src/data/wrap.ts +63 -38
- package/src/data/wrapped-candidates.ts +10 -0
- package/src/frames/blank-frame.ts +1 -0
- package/src/frames/index.ts +2 -2
- package/src/frames/page-bar.ts +26 -24
- package/src/frames/page-header.ts +14 -5
- package/src/frames/page-status.ts +9 -7
- package/src/frames/shared.ts +36 -25
- package/src/frames/single-frame.ts +1 -0
- package/src/frames/split-frame/shell.ts +6 -6
- package/src/frames/split-frame/wiring.ts +2 -2
- package/src/frames/tabs-frame/shell.ts +4 -14
- package/src/frames/tabs-frame/wiring.ts +5 -8
- package/src/frames/top-main-frame.ts +3 -2
- package/src/frames/types.ts +13 -2
- package/src/frames/workspace-frame/extras.ts +21 -5
- package/src/frames/workspace-frame/index.ts +1 -1
- package/src/frames/workspace-frame/shell.ts +3 -2
- package/src/frames/workspace-frame/state.ts +13 -6
- package/src/frames/workspace-frame/view.ts +250 -48
- package/src/generated/kit-grammar-runtime.ts +645 -397
- package/src/generated/page-origin.ts +0 -11
- package/src/i18n/kit-text.ts +84 -29
- package/src/i18n/resolve-text-refs.ts +22 -6
- package/src/index.ts +2 -1
- package/src/object-renderer/action-gate.ts +11 -147
- package/src/object-renderer/arrange.ts +112 -84
- 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 +401 -104
- package/src/object-renderer/collection-table.ts +287 -45
- package/src/object-renderer/collection.ts +258 -104
- package/src/object-renderer/compile-data.ts +112 -102
- package/src/object-renderer/crud-bridge.ts +32 -0
- package/src/object-renderer/defaults.ts +38 -16
- package/src/object-renderer/display-checks.ts +4 -25
- package/src/object-renderer/emit-events.ts +224 -176
- package/src/object-renderer/emit-object.ts +15 -2
- package/src/object-renderer/emit-static.ts +533 -151
- 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 +111 -2
- package/src/object-renderer/form-notify.ts +45 -0
- package/src/object-renderer/index.ts +26 -0
- package/src/object-renderer/key-field.ts +12 -0
- package/src/object-renderer/layout-facts.ts +386 -0
- package/src/object-renderer/layout-plan.ts +132 -0
- package/src/object-renderer/layout-plan.types.ts +22 -0
- package/src/object-renderer/linkage.ts +7 -270
- package/src/object-renderer/merge-class.ts +18 -1
- package/src/object-renderer/parts.ts +252 -1
- package/src/object-renderer/path-pick.ts +27 -0
- package/src/object-renderer/render-object.ts +456 -89
- package/src/object-renderer/request-actions.ts +232 -249
- package/src/object-renderer/skeleton.ts +58 -19
- package/src/object-renderer/table-actions.ts +319 -111
- package/src/object-renderer/table-summary.ts +2 -2
- package/src/object-renderer/table-tools.ts +429 -94
- package/src/object-renderer/types.ts +204 -127
- package/src/object-renderer/view-binding.ts +393 -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 +165 -28
- package/src/page-target/target.ts +262 -51
- package/src/page-target/writer-policy.ts +14 -3
- package/src/recipes/container.ts +210 -0
- package/src/recipes/control.ts +277 -0
- package/src/recipes/index.ts +312 -0
- package/src/recipes/nowrap.ts +16 -0
- package/src/recipes/overlay.ts +240 -0
- package/src/recipes/placeholder.ts +79 -0
- package/src/recipes/rail-grid.ts +45 -0
- package/src/recipes/slot-align.ts +56 -0
- package/src/recipes/state.ts +99 -0
- package/src/recipes/status.ts +139 -0
- package/src/recipes/surface.ts +40 -0
- package/src/recipes/table-row.ts +88 -0
- package/src/recipes/title-row.ts +37 -0
- package/src/recipes/typography.ts +99 -0
- package/src/shared/action-field-guard.ts +41 -0
- package/src/shared/confirm-decl.ts +118 -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 +15 -0
- package/src/shared/path-guard.ts +127 -0
- package/src/shared/theme-runtime-shared.ts +180 -0
- package/src/shared/view-info.ts +10 -0
- package/src/theme/index.ts +13 -0
- package/src/theme/kit-theme-text.ts +1 -1
- package/src/theme/kit-theme.css +407 -10
- package/src/theme/kit-theme.tpl +407 -10
- package/src/theme/nine-dim-structure.ts +247 -0
- package/src/theme/surface-layers.ts +101 -0
- package/src/theme/theme-tokens.ts +130 -84
- package/src/theme/theme-types.ts +103 -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/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 -1473
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
// 单对象排布:KitArrange + 字段引用 -> KitLayoutIR(grid / rows / flex)。
|
|
2
2
|
|
|
3
3
|
import { KIT_CLASS_DEFAULTS, KIT_SUMMARY_EMPTY, KIT_TYPES, KIT_WIDTH } from './defaults';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { KIT_METRIC_HIGHLIGHT_CLASS, resolveFieldEmphasisClass } from './form-detail';
|
|
5
|
+
import { kitTypographyRecipe } from '../recipes/typography';
|
|
6
|
+
|
|
7
|
+
const DEFAULT_CELL_LABEL_CLASS = kitTypographyRecipe('label');
|
|
8
|
+
const DEFAULT_CELL_VALUE_CLASS = KIT_CLASS_DEFAULTS.value;
|
|
9
|
+
import { builtinEmitsOf, optionsFromOf, staticOptionsOf } from './linkage';
|
|
6
10
|
import { checkClasses, mergeClass } from './merge-class';
|
|
11
|
+
import { hintOf, nameSuggestion } from '../compile/hints';
|
|
7
12
|
import { pickComponent } from './pick-component';
|
|
13
|
+
import { kitText } from '../i18n/kit-text';
|
|
8
14
|
import {
|
|
9
15
|
colsLevels,
|
|
10
16
|
gridColsClasses,
|
|
11
17
|
gridLevels,
|
|
12
18
|
isColsAllowed,
|
|
19
|
+
filterActionSpanClasses,
|
|
20
|
+
filterFlowOf,
|
|
21
|
+
filterPackOf,
|
|
22
|
+
KIT_FILTER_PACK_DIVIDER,
|
|
23
|
+
filterLevelsWithActionRoom,
|
|
13
24
|
partsAtKeyTiers,
|
|
14
25
|
partsOverflow,
|
|
15
26
|
rowSpanClasses,
|
|
@@ -42,14 +53,14 @@ export interface KitCellEnv {
|
|
|
42
53
|
path: string;
|
|
43
54
|
/** summary 的空值口径:hide = 整格不渲染(hideEmpty);text = 空值显示文案(Text / Tag 的 placeholder)。只在 summary 视图的 env 上设 */
|
|
44
55
|
empty?: { hide: boolean; text: string };
|
|
45
|
-
/** 当前视图槽位(字段联动键
|
|
56
|
+
/** 当前视图槽位(字段联动键 when 按槽位判定可用性) */
|
|
46
57
|
slot?: 'list' | 'summary' | 'filter' | 'form';
|
|
47
58
|
/** 必填星号位置(view.form.requiredMark,缺省 end) */
|
|
48
59
|
requiredMark?: 'start' | 'end';
|
|
49
|
-
/** 字段策略表(view.form.policy 规整后的结果,只在 form 视图的 env 上设) */
|
|
50
|
-
policy?: KitFieldPolicyIR;
|
|
51
60
|
/** 页面语言(布尔列缺省「是 / 否」等编译期文案);缺省取 zh-CN */
|
|
52
61
|
locale?: string;
|
|
62
|
+
/** 写死形状组件(FlowEditor / RowEditor 等作字段控件)的契约 props 键;给了才核 fields[].props 的键(闭集,不静默透传) */
|
|
63
|
+
staticPropKeys?: (component: string) => readonly string[] | undefined;
|
|
53
64
|
}
|
|
54
65
|
|
|
55
66
|
export function normalizeRef(item: string | KitFieldRef | KitDividerItem): KitFieldRef {
|
|
@@ -76,12 +87,26 @@ export function normalizeRef(item: string | KitFieldRef | KitDividerItem): KitFi
|
|
|
76
87
|
return item as KitFieldRef;
|
|
77
88
|
}
|
|
78
89
|
|
|
90
|
+
const DATE_LIKE_NAMES: ReadonlySet<string> = new Set(['date', 'datetime', 'time', 'month', 'daterange']);
|
|
91
|
+
|
|
92
|
+
/** 字段是日期时间类:type 或 format(取冒号前的种类)属日期族 */
|
|
93
|
+
export function isDateLikeField(field: KitFieldSchema): boolean {
|
|
94
|
+
const fmt = typeof field.format === 'string' ? field.format.split(':')[0]! : '';
|
|
95
|
+
return DATE_LIKE_NAMES.has(field.type) || DATE_LIKE_NAMES.has(fmt);
|
|
96
|
+
}
|
|
97
|
+
|
|
79
98
|
function fieldProps(field: KitFieldSchema, ref: KitFieldRef, mode: KitMode): Record<string, unknown> {
|
|
80
99
|
const props: Record<string, unknown> = {};
|
|
81
100
|
const staticOptions = staticOptionsOf(field);
|
|
82
101
|
if (staticOptions && staticOptions.length > 0) props.options = staticOptions;
|
|
83
|
-
const format = field.format ?? (mode === 'show' ? KIT_TYPES[field.type]?.format : undefined);
|
|
102
|
+
const format = field.format ?? (mode === 'show' ? (KIT_TYPES[field.type]?.format ?? (field.type === 'daterange' ? 'daterange' : undefined)) : undefined);
|
|
84
103
|
if (format && mode === 'show') props.format = format;
|
|
104
|
+
const rawField = field as unknown as Record<string, unknown>;
|
|
105
|
+
const rawRef = ref as unknown as Record<string, unknown>;
|
|
106
|
+
const unit = typeof rawRef.unit === 'string' && rawRef.unit !== '' ? rawRef.unit : typeof rawField.unit === 'string' && rawField.unit !== '' ? rawField.unit : undefined;
|
|
107
|
+
const currency = typeof rawRef.currency === 'string' && rawRef.currency !== '' ? rawRef.currency : typeof rawField.currency === 'string' && rawField.currency !== '' ? rawField.currency : undefined;
|
|
108
|
+
if (unit !== undefined) props.unit = unit;
|
|
109
|
+
if (currency !== undefined) props.currency = currency;
|
|
85
110
|
// K-3:逐视图占位文案只在编辑态生效(只读组件没有 placeholder)
|
|
86
111
|
if (mode === 'edit' && typeof ref.placeholder === 'string' && ref.placeholder !== '') props.placeholder = ref.placeholder;
|
|
87
112
|
return { ...props, ...(ref.props ?? {}) };
|
|
@@ -102,8 +127,15 @@ function dividerCell(ref: KitFieldRef, env: KitCellEnv, index: number, spanClass
|
|
|
102
127
|
if (typeof d.label === 'string' && d.label !== '') props.label = d.label;
|
|
103
128
|
if (d.vertical === true) props.direction = 'vertical';
|
|
104
129
|
if (d.dashed === true) props.dashed = true;
|
|
105
|
-
if (d.align
|
|
106
|
-
|
|
130
|
+
if (d.align !== undefined) {
|
|
131
|
+
if (d.align === 'start' || d.align === 'end') props.align = d.align;
|
|
132
|
+
else if (d.align !== 'center') env.diagnostics.push({ code: 'KIT-OBJ-009', path: `${where}.divider.align`, message: 'divider.align 只许 start / center / end' });
|
|
133
|
+
}
|
|
134
|
+
if (d.tone !== undefined) {
|
|
135
|
+
const allowedTones = ['neutral', 'primary', 'info', 'success', 'warning', 'danger'];
|
|
136
|
+
if (typeof d.tone === 'string' && allowedTones.includes(d.tone)) props.tone = d.tone;
|
|
137
|
+
else env.diagnostics.push({ code: 'KIT-OBJ-009', path: `${where}.divider.tone`, message: `divider.tone 只许 ${allowedTones.join(' / ')}` });
|
|
138
|
+
}
|
|
107
139
|
return {
|
|
108
140
|
field: ref.name === DIVIDER_FIELD ? `${DIVIDER_FIELD}_${index}` : ref.name,
|
|
109
141
|
component: 'KitDivider',
|
|
@@ -122,7 +154,7 @@ function dividerCell(ref: KitFieldRef, env: KitCellEnv, index: number, spanClass
|
|
|
122
154
|
|
|
123
155
|
/** 自带变体前景色的基础组件:未显式传 valueClass 时不注入纯文本默认色 text-fg,以免盖掉组件自身的变体文字色 */
|
|
124
156
|
const SELF_COLORED_COMPONENTS: ReadonlySet<string> = new Set([
|
|
125
|
-
'Button', 'Tag', 'Alert', 'TextRotate', 'Aura', 'Fab', 'MenuButton', 'PriceText',
|
|
157
|
+
'Button', 'Tag', 'Alert', 'TextRotate', 'Aura', 'Fab', 'MenuButton', 'PriceText', 'GapValue',
|
|
126
158
|
]);
|
|
127
159
|
|
|
128
160
|
/** 造一个格。字段不在 schema 里报 KIT-OBJ-001 并返回 null。 */
|
|
@@ -139,35 +171,51 @@ export function buildCell(
|
|
|
139
171
|
const field = env.schema[ref.name];
|
|
140
172
|
const where = `${env.path}.fields[${index}]`;
|
|
141
173
|
if (!field) {
|
|
142
|
-
env.diagnostics.push({ code: 'KIT-OBJ-001', path: where, message: `view 引用了 schema 中不存在的字段 ${ref.name}
|
|
174
|
+
env.diagnostics.push({ code: 'KIT-OBJ-001', path: where, message: `view 引用了 schema 中不存在的字段 ${ref.name}`, ...hintOf(nameSuggestion(ref.name, Object.keys(env.schema))) });
|
|
143
175
|
return null;
|
|
144
176
|
}
|
|
145
177
|
const mode = env.modeFor(field);
|
|
146
|
-
// 场景显隐(字段项 when):只读视图(list / summary / 只读 form)只看 view;可编辑 form 按 add / edit 在运行期求值(cell.scenes);filter 不接受
|
|
147
|
-
let scenes: Array<'add' | 'edit'> | undefined;
|
|
148
|
-
if (ref.when !== undefined) {
|
|
149
|
-
const list = scenesOf(ref.when, `${where}.when`, env.diagnostics);
|
|
150
|
-
if (list === null) return null;
|
|
151
|
-
if (env.slot === 'filter') {
|
|
152
|
-
env.diagnostics.push({ code: 'KIT-FORM-001', path: `${where}.when`, message: 'filter 视图的字段不接受场景 when(筛选条件与新建 / 编辑无关)' });
|
|
153
|
-
} else if (mode === 'edit') {
|
|
154
|
-
scenes = list.filter((s): s is 'add' | 'edit' => s !== KIT_COND.viewScene);
|
|
155
|
-
if (scenes.length === 0) return null;
|
|
156
|
-
if (scenes.length === 2) scenes = undefined;
|
|
157
|
-
} else if (!list.includes(KIT_COND.viewScene as 'view')) {
|
|
158
|
-
return null;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
178
|
const pick = pickComponent(field, ref, mode, env.registered);
|
|
162
179
|
if (pick.unknownType) {
|
|
163
180
|
env.diagnostics.push({ code: 'KIT-TYPE-001', path: where, message: `字段 ${ref.name} 的 type ${field.type} 未在 types 表登记` });
|
|
164
181
|
} else if (pick.unregistered) {
|
|
165
182
|
env.diagnostics.push({ code: 'KIT-COMP-001', path: where, message: `字段 ${ref.name} 选出的组件 ${pick.component} 未登记` });
|
|
166
183
|
}
|
|
184
|
+
const contractKeys = env.staticPropKeys?.(pick.component);
|
|
185
|
+
if (contractKeys !== undefined && ref.props !== null && typeof ref.props === 'object') {
|
|
186
|
+
for (const k of Object.keys(ref.props)) {
|
|
187
|
+
if (!contractKeys.includes(k)) {
|
|
188
|
+
env.diagnostics.push({ code: 'KIT-STATIC-001', path: `${where}.props.${k}`, message: `组件 ${pick.component} 没有 prop ${k}(契约 props:${contractKeys.join(' / ')})` });
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
167
192
|
for (const [k, v] of [['class', ref.class], ['labelClass', ref.labelClass], ['valueClass', ref.valueClass]] as const) {
|
|
168
193
|
env.diagnostics.push(...checkClasses(v, `${where}.${k}`));
|
|
169
194
|
}
|
|
170
|
-
const
|
|
195
|
+
const rawEmphasis = ref.emphasis ?? field.emphasis;
|
|
196
|
+
let fieldEmphasis: 'strong' | 'muted' | undefined;
|
|
197
|
+
if (rawEmphasis !== undefined) {
|
|
198
|
+
if (rawEmphasis === 'strong' || rawEmphasis === 'muted') {
|
|
199
|
+
fieldEmphasis = rawEmphasis;
|
|
200
|
+
} else {
|
|
201
|
+
env.diagnostics.push({ code: 'KIT-OBJ-009', path: `${where}.emphasis`, message: `字段 ${ref.name} 的 emphasis 只许 strong / muted,收到 "${String(rawEmphasis)}"` });
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
const rawHighlight = ref.highlight ?? field.highlight;
|
|
205
|
+
let fieldHighlight = false;
|
|
206
|
+
if (rawHighlight !== undefined) {
|
|
207
|
+
if (typeof rawHighlight === 'boolean') {
|
|
208
|
+
fieldHighlight = rawHighlight;
|
|
209
|
+
} else {
|
|
210
|
+
env.diagnostics.push({ code: 'KIT-OBJ-009', path: `${where}.highlight`, message: `字段 ${ref.name} 的 highlight 必须是布尔值` });
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
const baseWithHighlight = fieldHighlight ? mergeClass(`${spanClass} ${extraBase}`.trim(), KIT_METRIC_HIGHLIGHT_CLASS) : `${spanClass} ${extraBase}`.trim();
|
|
214
|
+
const base = mergeClass(baseWithHighlight, view.cellClass, view.replaceClass);
|
|
215
|
+
const baseValRaw = SELF_COLORED_COMPONENTS.has(pick.component) ? '' : DEFAULT_CELL_VALUE_CLASS;
|
|
216
|
+
// 日期时间类值(type 或 format 属日期族)只读展示时整段不折行:2026-11-13 不在连字符处断开,列宽不足交给单元格既有的省略 / 提示机制
|
|
217
|
+
const baseVal = mode === 'show' && isDateLikeField(field) ? mergeClass(baseValRaw, 'whitespace-nowrap tabular-nums') : baseValRaw;
|
|
218
|
+
const valWithEmphasis = fieldEmphasis !== undefined ? mergeClass(baseVal, resolveFieldEmphasisClass(fieldEmphasis)) : baseVal;
|
|
171
219
|
const cell: KitCell = {
|
|
172
220
|
field: ref.name,
|
|
173
221
|
component: pick.component,
|
|
@@ -178,13 +226,17 @@ export function buildCell(
|
|
|
178
226
|
props: fieldProps(field, ref, mode),
|
|
179
227
|
parts,
|
|
180
228
|
cellClass: mergeClass(base, ref.class),
|
|
181
|
-
labelClass: mergeClass(
|
|
182
|
-
valueClass:
|
|
229
|
+
labelClass: mergeClass(DEFAULT_CELL_LABEL_CLASS, ref.labelClass),
|
|
230
|
+
valueClass: mergeClass(valWithEmphasis, ref.valueClass),
|
|
183
231
|
errorClass: KIT_CLASS_DEFAULTS.error,
|
|
232
|
+
...(fieldEmphasis !== undefined ? { emphasis: fieldEmphasis } : {}),
|
|
233
|
+
...(fieldHighlight ? { highlight: true } : {}),
|
|
184
234
|
};
|
|
235
|
+
// 下拉没写占位文案、又没有值时的默认占位:筛选栏「全部」(不筛选),表单「请选择」;字段 / 视图自己写了 placeholder 的不动
|
|
236
|
+
if (mode === 'edit' && pick.component === 'Select' && cell.props.placeholder === undefined && (env.slot === 'filter' || env.slot === 'form')) {
|
|
237
|
+
cell.props.placeholder = kitText(env.slot === 'filter' ? 'soma.kit.filter_all_option' : 'soma.kit.please_select', undefined, env.locale ?? '');
|
|
238
|
+
}
|
|
185
239
|
if (ref.action) cell.action = ref.action;
|
|
186
|
-
// GB6:派生展示字段(form 视图的只读格)——KitObjectForm 按草稿渲染模板文字作为值;写法由 collectFieldValues 统一核
|
|
187
|
-
if (env.slot === 'form' && mode === 'show' && typeof field.derive?.template === 'string') cell.derive = { template: field.derive.template };
|
|
188
240
|
// 字段 action 绑定的事件(fields[].on):闭集 = 该内置组件契约 emits 里的事件名;缺省 Button / Link 绑 click、其余绑 change
|
|
189
241
|
if (ref.on !== undefined) {
|
|
190
242
|
const emits = builtinEmitsOf(pick.component);
|
|
@@ -198,22 +250,22 @@ export function buildCell(
|
|
|
198
250
|
cell.event = ref.on;
|
|
199
251
|
}
|
|
200
252
|
}
|
|
201
|
-
|
|
202
|
-
const fill = fillOf(ref.fill, ref.name, env.schema, `${where}.fill`, env.diagnostics, 'KIT-FORM-003');
|
|
203
|
-
if (fill !== null && Object.keys(fill).length > 0) cell.fill = fill;
|
|
204
|
-
}
|
|
205
|
-
linkCell(cell, field, ref, mode, scenes, env, where);
|
|
253
|
+
linkCell(cell, field, ref, mode, env, where);
|
|
206
254
|
if (ref.help !== undefined) {
|
|
207
255
|
if (typeof ref.help !== 'string') {
|
|
208
|
-
env.diagnostics.push({ code: 'KIT-OBJ-009', path: `${where}.help`, message: 'help
|
|
209
|
-
} else if (ref.help !== ''
|
|
210
|
-
cell.help
|
|
256
|
+
env.diagnostics.push({ code: 'KIT-OBJ-009', path: `${where}.help`, message: 'help 必须是字符串' });
|
|
257
|
+
} else if (ref.help !== '') {
|
|
258
|
+
// 编辑态:控件下的说明行(cell.help);只读(列表列头 / 摘要标签旁):「i」说明气泡(cell.helpTip),悬停 / 聚焦显示
|
|
259
|
+
if (mode === 'edit') cell.help = ref.help;
|
|
260
|
+
else cell.helpTip = ref.help;
|
|
211
261
|
}
|
|
212
262
|
}
|
|
213
263
|
if (env.empty !== undefined && mode === 'show') {
|
|
214
264
|
if (env.empty.hide) {
|
|
215
|
-
//
|
|
216
|
-
|
|
265
|
+
// 发射成纯路径绑定 show[id].when = 字段值路径(只判真值),数字 / 布尔字段的 0 / false 会被误隐,故不许 hideEmpty
|
|
266
|
+
if (KIT_SUMMARY_EMPTY.hideEmptyForbiddenTypes.includes(field.type)) {
|
|
267
|
+
env.diagnostics.push({ code: 'KIT-OBJ-008', path: `${where}`, message: `字段 ${ref.name} 的类型 ${field.type} 不许 hideEmpty(0 / false 是有值)` });
|
|
268
|
+
} else cell.hideEmpty = true;
|
|
217
269
|
} else if (env.empty.text !== '' && KIT_SUMMARY_EMPTY.placeholderComponents.includes(pick.component) && cell.props.placeholder === undefined) {
|
|
218
270
|
cell.props.placeholder = env.empty.text;
|
|
219
271
|
}
|
|
@@ -266,23 +318,35 @@ export function arrange(input: KitArrangeInput, refs: KitFieldRef[], view: KitVi
|
|
|
266
318
|
if ('cols' in a) {
|
|
267
319
|
let n = a.cols;
|
|
268
320
|
if (!isColsAllowed(n)) {
|
|
269
|
-
env.diagnostics.push({ code: 'KIT-OBJ-003', path: `${path}.cols`, message: `cols: ${n} 不是 12
|
|
321
|
+
env.diagnostics.push({ code: 'KIT-OBJ-003', path: `${path}.cols`, message: `cols: ${n} 不是 12 的约数` });
|
|
270
322
|
n = 1;
|
|
271
323
|
}
|
|
272
|
-
const
|
|
324
|
+
const isFullRow = (r: KitFieldRef): boolean => r.divider !== undefined && r.divider.vertical !== true && r.span === undefined;
|
|
325
|
+
const baseLevels = colsLevels(n);
|
|
326
|
+
// 筛选栏:声明的 cols 把末行排满时该档多分一列,给「查询 / 重置」让出同一行(见 filterLevelsWithActionRoom);整行分隔线占满任何列数
|
|
327
|
+
const levels = env.slot === 'filter' && refs.length > 0
|
|
328
|
+
? filterLevelsWithActionRoom(baseLevels, refs.map((r) => (isFullRow(r) ? KIT_WIDTH.totalParts : (r.span ?? 1))))
|
|
329
|
+
: baseLevels;
|
|
273
330
|
const cells: KitCell[] = [];
|
|
331
|
+
const perTierSpans: number[][] = [];
|
|
274
332
|
refs.forEach((r, i) => {
|
|
275
333
|
// 横向分隔线缺省跨满整行;竖线占一格
|
|
276
|
-
const fullRow = r
|
|
277
|
-
const sp = spanClasses(levels, fullRow ?
|
|
334
|
+
const fullRow = isFullRow(r);
|
|
335
|
+
const sp = spanClasses(levels, fullRow ? KIT_WIDTH.totalParts : r.span);
|
|
278
336
|
const c = buildCell(r, env, i, sp.classes, partsAtKeyTiers(sp.perTier), view);
|
|
279
|
-
if (c) cells.push(c);
|
|
337
|
+
if (c) { cells.push(c); perTierSpans.push(sp.perTier); }
|
|
280
338
|
});
|
|
281
339
|
return {
|
|
282
340
|
kind: 'grid',
|
|
283
341
|
wrapClass: KIT_WIDTH.containerClass,
|
|
284
342
|
gridClass: gridClassOf(`${KIT_WIDTH.gridClass} ${gap}`, view, env),
|
|
285
343
|
cells,
|
|
344
|
+
// 筛选栏:动作区(查询 / 重置)与字段同一栅格,末行放得下就同行靠右(见 filterActionSpanClasses)
|
|
345
|
+
...(env.slot === 'filter' && cells.length > 0 ? { actionsClass: filterActionSpanClasses(perTierSpans) } : {}),
|
|
346
|
+
// 同时给出定宽流式版式(字段定宽 + 查询 / 重置紧跟其后):不折叠的筛选栏在发射时用它替换上面的栅格跨度(折叠搜索区按栅格份数折行,仍走栅格)
|
|
347
|
+
...(env.slot === 'filter' && cells.length > 0 ? { filterFlow: filterFlowOf(cells.map((c) => env.schema[c.field]?.type)) } : {}),
|
|
348
|
+
// 按字段数装行的版式(不折叠的筛选栏发射时用它:列等分行宽、动作区当一格参与装行,绝不孤行靠左);折叠搜索区仍走上面的流式版式
|
|
349
|
+
...(env.slot === 'filter' && cells.length > 0 ? { filterPack: filterPackOf(cells.map((c) => (c.divider === true ? KIT_FILTER_PACK_DIVIDER : env.schema[c.field]?.type))) } : {}),
|
|
286
350
|
};
|
|
287
351
|
}
|
|
288
352
|
|
|
@@ -298,7 +362,7 @@ export function arrange(input: KitArrangeInput, refs: KitFieldRef[], view: KitVi
|
|
|
298
362
|
const slots = rowsN * C;
|
|
299
363
|
let use = refs;
|
|
300
364
|
if (refs.length > slots) {
|
|
301
|
-
env.diagnostics.push({ code: 'KIT-OBJ-002', path: `${path}.matrix`, message: `字段个数 ${refs.length} 超过矩阵 ${rowsN} x ${C} 的容量 ${slots}
|
|
365
|
+
env.diagnostics.push({ code: 'KIT-OBJ-002', path: `${path}.matrix`, message: `字段个数 ${refs.length} 超过矩阵 ${rowsN} x ${C} 的容量 ${slots}` });
|
|
302
366
|
use = refs.slice(0, slots);
|
|
303
367
|
}
|
|
304
368
|
const levels = gridLevels(C);
|
|
@@ -363,46 +427,10 @@ function requiredOf(label: string, field: { rules?: Array<{ required?: boolean }
|
|
|
363
427
|
}
|
|
364
428
|
|
|
365
429
|
/**
|
|
366
|
-
*
|
|
367
|
-
* 场景 when 已在上面过滤;远程选项只给可编辑格。写法不对记 KIT-FORM-001 / 003 并忽略该键。
|
|
430
|
+
* 字段联动(M 波 G3):远程选项只给可编辑格。写法不对记 KIT-FORM-003 并忽略该键。
|
|
368
431
|
*/
|
|
369
|
-
function linkCell(cell: KitCell, field: KitFieldSchema, ref: KitFieldRef, mode: KitMode,
|
|
370
|
-
const names = new Set(Object.keys(env.schema));
|
|
432
|
+
function linkCell(cell: KitCell, field: KitFieldSchema, ref: KitFieldRef, mode: KitMode, env: KitCellEnv, where: string): void {
|
|
371
433
|
const editable = mode === 'edit';
|
|
372
|
-
const pred = (key: 'showWhen' | 'disabledWhen' | 'requiredWhen', allowed: boolean, why: string): void => {
|
|
373
|
-
const raw = ref[key];
|
|
374
|
-
if (raw === undefined) return;
|
|
375
|
-
if (!allowed) {
|
|
376
|
-
env.diagnostics.push({ code: 'KIT-FORM-001', path: `${where}.${key}`, message: `${key} ${why}` });
|
|
377
|
-
return;
|
|
378
|
-
}
|
|
379
|
-
const core = predicateToCore(raw, `${where}.${key}`, names, env.diagnostics);
|
|
380
|
-
if (core !== null) cell[key] = core;
|
|
381
|
-
};
|
|
382
|
-
if (!editable && ref.showWhen !== undefined) {
|
|
383
|
-
// 只读视图:编成 Show 的对象谓词 when(core 已支持),只许单个叶子条件
|
|
384
|
-
const core = predicateToCore(ref.showWhen, `${where}.showWhen`, names, env.diagnostics);
|
|
385
|
-
if (core !== null) {
|
|
386
|
-
if ('field' in core) cell.showWhen = core;
|
|
387
|
-
else env.diagnostics.push({ code: 'KIT-FORM-001', path: `${where}.showWhen`, message: '只读视图的 showWhen 只许单个条件 { field, op, value? },不支持 all / any 组合' });
|
|
388
|
-
}
|
|
389
|
-
} else {
|
|
390
|
-
pred('showWhen', editable, '只用于 form / filter / 只读视图');
|
|
391
|
-
}
|
|
392
|
-
pred('disabledWhen', editable, '只用于可编辑的 form / filter 视图');
|
|
393
|
-
pred('requiredWhen', editable && env.slot === 'form', '只用于可编辑的 form 视图');
|
|
394
|
-
// 字段策略表(view.form.policy):并入三个条件,与字段上另写的同名条件叠加
|
|
395
|
-
if (editable && env.slot === 'form' && env.policy !== undefined) {
|
|
396
|
-
const extra = policyConditions(env.policy, ref.name);
|
|
397
|
-
for (const key of ['showWhen', 'disabledWhen', 'requiredWhen'] as const) {
|
|
398
|
-
const add = extra[key];
|
|
399
|
-
if (add === undefined) continue;
|
|
400
|
-
const merged = andPredicate(cell[key], add);
|
|
401
|
-
if (merged === null) env.diagnostics.push({ code: 'KIT-FORM-008', path: `${where}.${key}`, message: `字段上的 ${key} 是 any 组合,无法与字段策略表叠加;请改写成 all 或拆开` });
|
|
402
|
-
else cell[key] = merged;
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
if (scenes !== undefined) cell.scenes = scenes;
|
|
406
434
|
if (!Array.isArray(field.options) && field.options !== undefined) {
|
|
407
435
|
if (!editable) return;
|
|
408
436
|
const ir = optionsFromOf(field.options, ref.name, field.type, env.schema, `${where}.options`, env.diagnostics, cell.component);
|
|
@@ -55,7 +55,7 @@ export function createKitCollapseWiring(): SomaComponentDefinition {
|
|
|
55
55
|
},
|
|
56
56
|
},
|
|
57
57
|
templateHtml: '<div data-soma-id="root" hidden></div>',
|
|
58
|
-
controllerFactory: createKitController({
|
|
58
|
+
controllerFactory: createKitController(() => ({
|
|
59
59
|
attach(root, api) {
|
|
60
60
|
const prev = api.host.previousElementSibling;
|
|
61
61
|
const scope: HTMLElement | null = prev !== null && prev.hasAttribute('data-kit-collapse-root')
|
|
@@ -94,6 +94,6 @@ export function createKitCollapseWiring(): SomaComponentDefinition {
|
|
|
94
94
|
const state = STATES.get(root);
|
|
95
95
|
if (state) state.accordion = bool(p.accordion);
|
|
96
96
|
},
|
|
97
|
-
}),
|
|
97
|
+
})),
|
|
98
98
|
};
|
|
99
99
|
}
|
|
@@ -71,8 +71,8 @@ export function parseExpandDecl(decl: unknown, path: string, env: ExpandParseEnv
|
|
|
71
71
|
if (extra.length > 0) return bad(`expand 的 list 形只认 list / link,多出:${extra.join(' / ')}`);
|
|
72
72
|
if (typeof decl.list !== 'string' || !IDENT.test(decl.list)) return bad('expand.list 必须是同产品里子对象的名字(标识符)');
|
|
73
73
|
if (typeof decl.link !== 'string' || !IDENT.test(decl.link)) return bad('expand.link 必须是子对象读接口的关联参数名(标识符)');
|
|
74
|
-
if (env.expandHosts === undefined) return bad('expand.list 目前只能用在 StandardCrud 的 entity 列表里(需要协调组件,子对象写在 objects.overlays 里 kind: expand
|
|
75
|
-
if (env.scroll) return bad('expand.list 暂不支持滚动模式(固定列 / min / toolbar.columns / columnGroups / resizable
|
|
74
|
+
if (env.expandHosts === undefined) return bad('expand.list 目前只能用在 StandardCrud 的 entity 列表里(需要协调组件,子对象写在 objects.overlays 里 kind: expand);当前位置不支持');
|
|
75
|
+
if (env.scroll) return bad('expand.list 暂不支持滚动模式(固定列 / min / toolbar.columns / columnGroups / resizable 会进入滚动模式)');
|
|
76
76
|
if (!env.expandHosts.has(decl.list)) {
|
|
77
77
|
return bad(`expand.list "${decl.list}" 不是已声明的子对象(须在 product.objects.overlays 里写 kind: expand 的同名对象)`);
|
|
78
78
|
}
|