soma-kit 0.1.13 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/packs/finance/reconcile-desk/compile.ts +1 -1
- package/packs/finance/reconcile-desk/shell.ts +1 -1
- package/spec/generated/kit-app.schema.json +18 -2
- package/spec/generated/kit-page.schema.json +95 -0
- package/spec/kit-grammar.json +332 -75
- package/spec/kit-grammar.schema.json +1 -27
- package/src/app/app-config.ts +11 -5
- package/src/app/component-gate.ts +2 -2
- package/src/app/compose-apps.ts +5 -2
- package/src/app/define-kit-actions.ts +82 -10
- package/src/app/define-kit-app.ts +6 -5
- package/src/app/define-kit-view.ts +1 -1
- package/src/app/index.ts +20 -8
- package/src/app/kit-view-context.ts +30 -4
- package/src/app/server-pages.ts +5 -1
- package/src/app/server.ts +15 -5
- package/src/app/theme-endpoint.ts +1 -1
- package/src/app/theme-runtime.ts +7 -2
- package/src/base/alert.ts +23 -20
- package/src/base/anchored-layer.ts +1 -1
- package/src/base/button.ts +34 -17
- package/src/base/cascader.ts +8 -4
- package/src/base/check-core.ts +9 -6
- package/src/base/color-picker.ts +10 -6
- package/src/base/command-palette.ts +10 -4
- package/src/base/context-menu.ts +5 -2
- package/src/base/date-range.ts +9 -6
- package/src/base/date.ts +10 -6
- package/src/base/delta.ts +4 -2
- package/src/base/divider.ts +15 -66
- package/src/base/end-edge.ts +14 -2
- package/src/base/fab.ts +11 -6
- package/src/base/gap-value.ts +25 -5
- package/src/base/hint-tips.ts +1 -1
- package/src/base/illustrations.ts +2 -1
- package/src/base/index.ts +20 -4
- package/src/base/inline-error.ts +84 -0
- package/src/base/input.ts +54 -18
- package/src/base/kbd.ts +4 -3
- package/src/base/link.ts +1 -1
- package/src/base/listbox-core.ts +70 -22
- package/src/base/mentions.ts +6 -3
- package/src/base/menu-button.ts +73 -50
- package/src/base/menu-core.ts +9 -2
- package/src/base/motion/hover-3d.ts +4 -1
- package/src/base/motion/hover-gallery.ts +4 -1
- package/src/base/otp.ts +7 -3
- package/src/base/overlay-runtime.ts +3 -2
- package/src/base/overlay-shell.ts +141 -0
- package/src/base/popover.ts +7 -6
- package/src/base/popup.ts +47 -41
- package/src/base/qty-stepper.ts +14 -9
- package/src/base/reason-tip.ts +2 -2
- package/src/{frames → base}/resize-handle.ts +1 -1
- package/src/base/segmented.ts +44 -35
- package/src/base/select.ts +1 -0
- package/src/base/shared.ts +52 -18
- package/src/base/state-panel.ts +34 -13
- package/src/base/status-tone.ts +1 -1
- package/src/base/tag-input.ts +13 -8
- package/src/base/tag.ts +56 -57
- package/src/base/text.ts +38 -14
- package/src/base/textarea.ts +1 -1
- package/src/base/time-picker.ts +9 -5
- package/src/base/tree-select.ts +12 -9
- package/src/base/upload.ts +26 -17
- package/src/biz/approval-desk/compile.ts +28 -1
- package/src/biz/approval-desk/shell.ts +10 -9
- package/src/biz/auth-panel/compile.ts +1 -1
- package/src/biz/auth-panel/shell.ts +7 -6
- package/src/biz/category-crud/compile.ts +20 -6
- package/src/biz/category-crud/shell.ts +10 -7
- package/src/biz/checkout-page/compile.ts +1 -1
- package/src/biz/checkout-page/shell.ts +15 -13
- package/src/biz/compose.ts +5 -5
- package/src/biz/data-components.ts +4 -0
- package/src/biz/define.ts +1 -1
- package/src/biz/import-wizard/compile.ts +1 -1
- package/src/biz/import-wizard/shell.ts +17 -13
- package/src/biz/index.ts +4 -3
- package/src/biz/landing-page/compile.ts +1 -1
- package/src/biz/landing-page/shell.ts +6 -5
- package/src/biz/link/shared.ts +8 -1
- package/src/biz/master-sub/compile.ts +269 -27
- package/src/biz/master-sub/detail-head.ts +62 -0
- package/src/biz/master-sub/index.ts +5 -4
- package/src/biz/master-sub/shell.ts +138 -69
- package/src/biz/multi-board/compile.ts +166 -11
- package/src/biz/multi-board/composition.ts +58 -0
- package/src/biz/multi-board/index.ts +25 -10
- package/src/biz/multi-board/prose-fold.ts +143 -0
- package/src/biz/multi-board/shell.ts +96 -24
- package/src/biz/names.ts +1 -0
- package/src/biz/notification-center/compile.ts +9 -2
- package/src/biz/notification-center/shell.ts +15 -7
- package/src/biz/page-templates/domain-templates.ts +7 -3
- package/src/biz/page-templates/result-page/compile.ts +1 -1
- package/src/biz/page-templates/result-page/shell.ts +5 -4
- package/src/biz/page-templates/shared.ts +1 -1
- package/src/biz/page-templates/sign-in-page/compile.ts +1 -1
- package/src/biz/page-templates/sign-in-page/shell.ts +18 -18
- package/src/biz/record-detail/compile.ts +5 -2
- package/src/biz/record-detail/shell.ts +12 -11
- package/src/biz/settings-center/compile.ts +1 -1
- package/src/biz/settings-center/shell.ts +14 -10
- package/src/biz/shared/action-host.ts +12 -5
- package/src/biz/shared/compile-helpers.ts +83 -4
- package/src/biz/shared/coordinator.ts +104 -21
- package/src/biz/shared/overlay-compile.ts +76 -4
- package/src/biz/shared/overlay-shell.ts +65 -112
- package/src/biz/single-form/compile.ts +2 -2
- package/src/biz/single-form/shell.ts +13 -7
- package/src/biz/standard-crud/compile.ts +24 -4
- package/src/biz/standard-crud/shell.ts +38 -30
- package/src/biz/standard-crud/summary.ts +42 -0
- package/src/biz/step-form/compile.ts +1 -1
- package/src/biz/step-form/hub.ts +4 -0
- package/src/biz/step-form/shell.ts +16 -12
- package/src/biz/types.ts +15 -3
- package/src/cli/app-layer-check.ts +375 -0
- package/src/cli/kit-cli.ts +35 -8
- package/src/cli/kit-init.ts +149 -0
- package/src/cli/layout-cli.ts +7 -7
- package/src/compile/access-gate-attach.ts +27 -0
- package/src/compile/action-host-attach.ts +1 -1
- package/src/compile/compile-page.ts +36 -230
- package/src/compile/component-candidates.ts +4 -1
- package/src/compile/hints.ts +5 -58
- package/src/compile/index.ts +2 -2
- package/src/compile/layout-lint/index.ts +4 -1
- package/src/compile/layout-lint/rules-composition.ts +97 -18
- package/src/compile/layout-lint/rules-form.ts +6 -7
- package/src/compile/layout-lint/rules-table.ts +98 -14
- package/src/compile/page-composition.ts +191 -0
- package/src/compile/parse.ts +4 -0
- package/src/compile/producer-fingerprint.ts +56 -0
- package/src/compile/redirect.ts +1 -1
- package/src/compile/stages.ts +169 -0
- package/src/compile/styles.ts +80 -32
- package/src/compile/types.ts +5 -3
- package/src/data/access-gate.ts +112 -0
- package/src/data/amount-breakdown.ts +6 -2
- package/src/data/anchor-nav.ts +4 -1
- package/src/data/approval-flow.ts +13 -5
- package/src/data/assignment-picker.ts +35 -20
- package/src/data/async-result-panel.ts +7 -3
- package/src/data/breadcrumbs.ts +13 -9
- package/src/data/calendar.ts +10 -4
- package/src/data/carousel.ts +13 -5
- package/src/data/chart.ts +745 -48
- package/src/data/checklist.ts +9 -5
- package/src/data/code-view.ts +220 -26
- package/src/data/comment-thread.ts +9 -3
- package/src/data/confirm-dialog.ts +57 -20
- package/src/data/diff.ts +4 -1
- package/src/data/dock.ts +5 -1
- package/src/data/embed.ts +1 -1
- package/src/data/engine-ports.ts +126 -0
- package/src/data/field-mapper.ts +16 -7
- package/src/data/flow-editor.ts +106 -29
- package/src/data/footer.ts +8 -2
- package/src/data/gantt.ts +192 -27
- package/src/data/hero.ts +8 -2
- package/src/data/image-viewer.ts +7 -3
- package/src/data/index.ts +22 -8
- package/src/data/item-list.ts +11 -3
- package/src/data/json-view.ts +844 -0
- package/src/data/kanban.ts +13 -8
- package/src/data/markdown-view.ts +487 -0
- package/src/data/matrix.ts +400 -0
- package/src/data/media-grid.ts +5 -2
- package/src/data/mega-menu.ts +4 -3
- package/src/data/menu-dom.ts +9 -8
- package/src/data/menu.ts +35 -17
- package/src/data/mockup.ts +12 -8
- package/src/data/modal-dialog.ts +108 -57
- package/src/data/navbar.ts +13 -7
- package/src/data/notice-list.ts +53 -20
- package/src/data/notify-renderer.ts +21 -10
- package/src/data/object-form.ts +248 -151
- package/src/data/pager.ts +15 -10
- package/src/data/panel-head.ts +406 -0
- package/src/data/permission-matrix.ts +19 -9
- package/src/data/permission-tree.ts +30 -13
- package/src/data/pricing-table.ts +10 -4
- package/src/data/reaction-bar.ts +6 -3
- package/src/data/record-card.ts +30 -14
- package/src/data/record-picker.ts +8 -4
- package/src/data/redirect.ts +1 -1
- package/src/data/request-console.ts +20 -7
- package/src/data/resident.ts +6 -10
- package/src/data/result-panel.ts +2 -2
- package/src/data/rich-text.ts +58 -96
- package/src/data/row-editor.ts +12 -7
- package/src/data/rule-builder.ts +22 -11
- package/src/data/shape-util.ts +26 -14
- package/src/data/stat-group.ts +369 -84
- package/src/data/static-lazy.ts +7 -0
- package/src/data/static-registry.ts +14 -2
- package/src/data/steps.ts +6 -2
- package/src/data/survey.ts +13 -4
- package/src/data/system-switcher.ts +17 -7
- package/src/data/text-diff.ts +663 -0
- package/src/data/timeline.ts +1 -1
- package/src/data/tour-guide.ts +8 -4
- package/src/data/transfer.ts +24 -11
- package/src/data/tree-table.ts +84 -17
- package/src/data/tree.ts +6 -3
- package/src/data/virtual-rows.ts +22 -11
- package/src/data/wrap.ts +2 -2
- package/src/data/wrapped-candidates.ts +22 -1
- package/src/frames/index.ts +4 -2
- package/src/frames/inherited-shell.ts +178 -0
- package/src/frames/list-summary.ts +123 -0
- package/src/frames/page-bar.ts +10 -16
- package/src/frames/resident-components.ts +20 -0
- package/src/frames/shared.ts +37 -17
- package/src/frames/split-frame/shell.ts +17 -11
- package/src/frames/split-frame/wiring.ts +2 -2
- package/src/frames/tabs-frame/shell.ts +17 -9
- package/src/frames/top-main-frame.ts +1 -1
- package/src/frames/types.ts +6 -3
- package/src/frames/workspace-frame/extras.ts +19 -5
- package/src/frames/workspace-frame/shell.ts +4 -3
- package/src/frames/workspace-frame/state.ts +8 -2
- package/src/frames/workspace-frame/tab-scroll.ts +28 -0
- package/src/frames/workspace-frame/view.ts +156 -91
- package/src/generated/kit-grammar-runtime.ts +227 -58
- package/src/i18n/kit-text.ts +141 -2
- package/src/i18n/resolve-text-refs.ts +1 -1
- package/src/object-renderer/action-group.ts +169 -0
- package/src/object-renderer/action-more.ts +160 -0
- package/src/object-renderer/arrange.ts +86 -26
- package/src/object-renderer/candidates.ts +4 -0
- package/src/object-renderer/collection-parts.ts +72 -20
- package/src/object-renderer/collection-table.ts +178 -65
- package/src/object-renderer/collection.ts +129 -83
- package/src/object-renderer/compile-data.ts +1 -1
- package/src/object-renderer/defaults.ts +10 -5
- package/src/object-renderer/emit-events.ts +1 -1
- package/src/object-renderer/emit-object.ts +7 -0
- package/src/object-renderer/emit-static.ts +243 -87
- package/src/object-renderer/field-value.ts +12 -239
- package/src/object-renderer/filter-plan.ts +84 -0
- package/src/object-renderer/filter-toolbar.ts +103 -0
- package/src/{compile → object-renderer}/fragment.ts +13 -2
- package/src/object-renderer/index.ts +6 -1
- package/src/object-renderer/layout-facts.ts +46 -6
- package/src/object-renderer/layout-plan.ts +136 -43
- package/src/object-renderer/layout-plan.types.ts +42 -5
- package/src/object-renderer/overlay-decide.ts +82 -0
- package/src/object-renderer/parts.ts +7 -259
- package/src/object-renderer/render-object.ts +60 -47
- package/src/object-renderer/table-actions.ts +135 -56
- package/src/object-renderer/table-gap.ts +37 -0
- package/src/object-renderer/table-tools.ts +63 -25
- package/src/object-renderer/types.ts +16 -22
- package/src/recipes/app-blocks.ts +66 -0
- package/src/recipes/code-view.ts +56 -0
- package/src/recipes/compact-group.ts +31 -0
- package/src/recipes/container.ts +54 -13
- package/src/recipes/control.ts +77 -157
- package/src/recipes/desc-list.ts +14 -0
- package/src/recipes/divider.ts +53 -0
- package/src/recipes/emphasis.ts +60 -0
- package/src/recipes/frame-bleed.ts +33 -0
- package/src/recipes/index.ts +34 -1
- package/src/recipes/inherited-shell.ts +37 -0
- package/src/recipes/json-view.ts +49 -0
- package/src/recipes/markdown.ts +86 -0
- package/src/recipes/overlay.ts +149 -18
- package/src/recipes/page-width.ts +20 -0
- package/src/recipes/placeholder.ts +21 -5
- package/src/recipes/rail-grid.ts +3 -0
- package/src/recipes/stat-state.ts +65 -0
- package/src/recipes/state.ts +20 -28
- package/src/recipes/status.ts +17 -8
- package/src/recipes/strip.ts +72 -0
- package/src/recipes/surface-edge.ts +16 -0
- package/src/recipes/surface.ts +10 -6
- package/src/recipes/table-gap.ts +80 -0
- package/src/recipes/table-native-edit.ts +242 -0
- package/src/recipes/table-row.ts +120 -11
- package/src/recipes/tabs.ts +126 -0
- package/src/recipes/text-diff.ts +90 -0
- package/src/recipes/title-row.ts +7 -5
- package/src/recipes/typography.ts +24 -43
- package/src/shared/diagnostics.ts +16 -0
- package/src/shared/envelope.ts +1 -1
- package/src/shared/field-value-format.ts +246 -0
- package/src/shared/focus-ring.ts +8 -0
- package/src/shared/hints.ts +56 -0
- package/src/{base → shared}/icons.ts +12 -0
- package/src/shared/kit-error.ts +1 -1
- package/src/{object-renderer → shared}/merge-class.ts +3 -2
- package/src/shared/path-guard.ts +1 -1
- package/src/shared/primitives-types.ts +8 -0
- package/src/shared/theme-runtime-shared.ts +19 -0
- package/src/theme/kit-theme-text.ts +1 -1
- package/src/theme/kit-theme.css +49 -14
- package/src/theme/kit-theme.tpl +49 -14
- package/src/theme/nine-dim-structure.ts +129 -37
- package/src/theme/surface-layers.ts +17 -4
- package/src/theme/theme-tokens.ts +16 -5
- package/src/theme/typography.ts +21 -17
- package/src/app/envelope.ts +0 -1
- package/src/app/notify-renderer.ts +0 -1
- package/src/app/paged-list-adapter.ts +0 -1
- package/src/app/theme-runtime-shared.ts +0 -1
- package/src/compile/kit-error.ts +0 -1
- /package/src/{base → shared}/class-candidates.ts +0 -0
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import type { SomaComponentDefinition } from 'soma-core';
|
|
12
12
|
import { CLASS_PROP, createKitController, joinClass, str, type KitApi, type KitProps } from '../base/shared';
|
|
13
13
|
import { permissionCheckerOf } from '../base/permission-gate';
|
|
14
|
-
import { kitIcon } from '../
|
|
14
|
+
import { kitIcon } from '../shared/icons';
|
|
15
15
|
import { KIT_CHECK_CLASS_CANDIDATES, attachMarkEvents, createCheck, isMark, markInput, setMarkLabel } from '../base/check-core';
|
|
16
16
|
import { wireMenu, type MenuClasses, type MenuHandle } from '../base/menu-core';
|
|
17
17
|
import { KIT_POPUP_PLACE_CLASS_CANDIDATES, type PopPlace } from '../base/popup';
|
|
@@ -19,14 +19,16 @@ import { KIT_MENU_BUTTON_CLASS_CANDIDATES, KIT_MENU_ITEM_CLASSES, KIT_MENU_PANEL
|
|
|
19
19
|
import { createPanelPortal, KIT_PANEL_PORTAL_CLASS_CANDIDATES } from '../data/overlay-portal';
|
|
20
20
|
import { expandKeyOf, moveExpandChild, returnExpandChild } from './collection-expand';
|
|
21
21
|
import { kitText } from '../i18n/kit-text';
|
|
22
|
-
import {
|
|
22
|
+
import { kitEmphasisButtonRecipe, kitRowActionRecipe, type KitRowActionRank } from '../recipes/emphasis';
|
|
23
23
|
import { KIT_ACTION_SLOT_BASE, actionSlotEmits, emitActionSlot } from '../base/action-slots';
|
|
24
24
|
import { KIT_ITEM_TONE_CLASS, KIT_ROW_TONE_CLASS, disabledReasonOf, rowActionState, rowToneClass } from './view-binding';
|
|
25
25
|
import { isKitActionBusy, onKitActionBusy } from '../base/action-busy';
|
|
26
26
|
import { KIT_REASON_TIP_CLASS_CANDIDATES, releaseReasonTipsIn, syncReasonTip } from '../base/reason-tip';
|
|
27
27
|
import { kitDisabledRecipe } from '../recipes';
|
|
28
|
-
import { kitRowActionsNarrowCap, kitRowActionsNarrowTier } from 'soma-foundation/kit-layout';
|
|
28
|
+
import { kitRowActionsNarrowCap, kitRowActionsNarrowTier, kitRuleTableOf } from 'soma-foundation/kit-layout';
|
|
29
29
|
import { watchEndEdge } from '../base/end-edge';
|
|
30
|
+
import { KIT_ACTION_GROUP_CLASS_CANDIDATES, menuOrderDangerLast, planActionGroup } from './action-group';
|
|
31
|
+
import { KIT_ARRANGE } from 'soma-foundation/arrange';
|
|
30
32
|
|
|
31
33
|
/** 行操作所在的表格容器(窄档判定用):普通表 / 虚拟表的外壳;不在表格里(cards / stack 条目等)= 无,按宽档 */
|
|
32
34
|
const TABLE_CONTAINER = '[data-kit-part="table"], [data-kit-vscroll]';
|
|
@@ -36,24 +38,32 @@ const MORE_ROOT_CLASS = 'relative inline-block shrink-0';
|
|
|
36
38
|
// 窄档折叠的容器查询档名读 design(type-presentation#/action/maxInline.narrowBelowTier),与表格窄栅格同一档;
|
|
37
39
|
// 次要行内操作窄档隐藏,宽档全部行内时「更多」触发器只在窄档显示(容器查询变体 `@max-<档>:`,本文件不写数字)
|
|
38
40
|
const NARROW_TIER = kitRowActionsNarrowTier();
|
|
41
|
+
const DANGER_SEPARATOR_CLASS = `ms-${Math.round(KIT_ARRANGE.actionGroup.dangerSeparatorRem * 4)}`;
|
|
39
42
|
const ROW_ACTION_SECONDARY_CLASS = `@max-${NARROW_TIER}:hidden`;
|
|
40
43
|
const MORE_ROOT_NARROW_ONLY_CLASS = `relative shrink-0 hidden @max-${NARROW_TIER}:inline-block`;
|
|
44
|
+
// 紧凑列表(主从窄栏):列表自身是容器,窄档线是另一条(kit-arrange#actionGroup.compactNarrowTier),条目里的行操作按列表宽收起次要项
|
|
45
|
+
const COMPACT_TIER = KIT_ARRANGE.actionGroup.compactNarrowTier;
|
|
46
|
+
const COMPACT_SECONDARY_CLASS = `@max-${COMPACT_TIER}:hidden`;
|
|
47
|
+
const COMPACT_MORE_ROOT_NARROW_ONLY_CLASS = `relative shrink-0 hidden @max-${COMPACT_TIER}:inline-block`;
|
|
41
48
|
// 外观只有一份:触发钮 / 面板 / 菜单项类全部取自 base/menu-button(KIT_MENU_PANEL、KIT_MENU_ITEM_CLASSES),这里不再手抄
|
|
42
|
-
//
|
|
43
|
-
const MORE_TRIGGER_CLASS =
|
|
44
|
-
const MORE_PLACE: PopPlace = { side: 'bottom', align: '
|
|
45
|
-
const MORE_MENU_SHOWN = KIT_MENU_PANEL.
|
|
49
|
+
// 「更多」触发器与行内操作同为文字链接形态(次级动作秩 rest:弱化色文字 + 下拉箭头)
|
|
50
|
+
const MORE_TRIGGER_CLASS = kitRowActionRecipe('rest');
|
|
51
|
+
const MORE_PLACE: PopPlace = { side: 'bottom', align: 'start' };
|
|
52
|
+
const MORE_MENU_SHOWN = KIT_MENU_PANEL.classForTextTrigger(MORE_PLACE);
|
|
46
53
|
export const MORE_MENU_CLASSES: MenuClasses = KIT_MENU_ITEM_CLASSES;
|
|
47
|
-
/**
|
|
48
|
-
|
|
54
|
+
/**
|
|
55
|
+
* 默认内联上限(超过则把多出的折叠进「更多」):读真源 type-presentation#/action/maxInline/wide(经 kit-layout 规则表),不写字面量。
|
|
56
|
+
* 第二轮真实使用测试发现:这里原写死 3,表格行没传 maxInline 时宽档封顶没有随裁决改成 2(KT-K-table-4)
|
|
57
|
+
*/
|
|
58
|
+
const DEFAULT_MAX_INLINE = kitRuleTableOf().rowActions.maxInline.wide;
|
|
49
59
|
|
|
50
60
|
type ActionTone = 'primary' | 'neutral' | 'danger';
|
|
51
61
|
|
|
52
|
-
//
|
|
62
|
+
// 工具栏 / 批量条按钮:控件引擎的按钮配方 + 工具条宿主选项(tight:横向内边距降一档);变体按强调等级取(区域主动作 = 实心、次级 = 色调、危险 = 透明底危险文字)
|
|
53
63
|
export const ACTION_BUTTON_CLASS: Record<ActionTone, string> = {
|
|
54
|
-
primary: '
|
|
55
|
-
neutral: '
|
|
56
|
-
danger: '
|
|
64
|
+
primary: kitEmphasisButtonRecipe('button.region', { tight: true }),
|
|
65
|
+
neutral: kitEmphasisButtonRecipe('button.toolbar', { tight: true }),
|
|
66
|
+
danger: kitEmphasisButtonRecipe('button.danger', { tight: true }),
|
|
57
67
|
};
|
|
58
68
|
|
|
59
69
|
/**
|
|
@@ -61,15 +71,36 @@ export const ACTION_BUTTON_CLASS: Record<ActionTone, string> = {
|
|
|
61
71
|
* 无底无描边,点击热区仍是 h-8、行里占高收回到一行文字,悬停下划线,焦点环保留。2026-11-17 推翻「danger 与 neutral 同形的描边按钮」旧口径。
|
|
62
72
|
* 工具栏 / 批量条仍用 ACTION_BUTTON_CLASS。
|
|
63
73
|
*/
|
|
64
|
-
export const ROW_ACTION_BUTTON_CLASS: Record<
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
danger:
|
|
74
|
+
export const ROW_ACTION_BUTTON_CLASS: Record<KitRowActionRank, string> = {
|
|
75
|
+
lead: kitRowActionRecipe('lead'),
|
|
76
|
+
rest: kitRowActionRecipe('rest'),
|
|
77
|
+
danger: kitRowActionRecipe('danger'),
|
|
68
78
|
};
|
|
69
79
|
|
|
80
|
+
/** 详情头动作区(look: button):秩 → 按钮配方(主 = 区域主动作实心、次 = 描边中性、危险 = 透明底灰字悬停变危险色);「更多」是安静按钮 */
|
|
81
|
+
const HEAD_BUTTON_CLASS: Record<KitRowActionRank, string> = {
|
|
82
|
+
lead: ACTION_BUTTON_CLASS.primary,
|
|
83
|
+
rest: ACTION_BUTTON_CLASS.neutral,
|
|
84
|
+
danger: ACTION_BUTTON_CLASS.danger,
|
|
85
|
+
};
|
|
86
|
+
const HEAD_MORE_TRIGGER_CLASS = kitEmphasisButtonRecipe('button.quiet', { tight: true });
|
|
87
|
+
const HEAD_ROOT_CLASS = 'flex flex-wrap items-center justify-end gap-2';
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* 行内动作的秩(强调等级 R12):危险动作 = danger(保持危险色、与前者隔开);其余里「显式 primary 的动作,没有则第一个」= lead(品牌色),其余 = rest(弱化色)。
|
|
91
|
+
* 一眼分出主次:一行里只有一个品牌色动作。取值(语气)只在真源 kit-limits#emphasis.roles.rowAction.*。
|
|
92
|
+
*/
|
|
93
|
+
export function rowActionRanks(items: readonly { readonly tone?: ActionTone }[]): KitRowActionRank[] {
|
|
94
|
+
const calm = items.map((i) => i.tone !== 'danger');
|
|
95
|
+
const lead = items.findIndex((i, n) => calm[n] && i.tone === 'primary');
|
|
96
|
+
const leadAt = lead >= 0 ? lead : calm.indexOf(true);
|
|
97
|
+
return items.map((_i, n) => (!calm[n] ? 'danger' : n === leadAt ? 'lead' : 'rest'));
|
|
98
|
+
}
|
|
99
|
+
|
|
70
100
|
// 行操作根:链接不收缩、不折行(flex-nowrap + whitespace-nowrap,行高保持一行),项间距 16px(gap-x-4);放不下的由切分(splitRowActions)并入「更多」,不靠换行;
|
|
71
101
|
// 窄容器下超出窄档行内上限的动作标次要、由容器查询隐藏并在「更多」菜单打开时现算并入,操作列按内容定宽(见 collection 的窄栅格列轨)
|
|
72
|
-
|
|
102
|
+
// 操作列恒贴尾侧:动作右对齐,末尾动作的文字右缘 = 操作列右缘(列表页右轴:页头主按钮 / 操作列末尾 / 分页右端同一条线);表头「操作」同向右对齐
|
|
103
|
+
const ROOT_CLASS = 'flex flex-nowrap items-center justify-end gap-x-4 whitespace-nowrap';
|
|
73
104
|
/** 展开行开关按钮(文字钮,不带底色) */
|
|
74
105
|
const EXPAND_BUTTON_CLASS = 'inline-flex items-center text-xs text-fg-muted hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring';
|
|
75
106
|
/** 整行点击不响应的行内交互元素(它们有自己的事件):按钮 / 链接 / 输入 / 菜单 / 勾选列 / 就地编辑格 */
|
|
@@ -98,6 +129,13 @@ function elementId(el: Element | null): number {
|
|
|
98
129
|
|
|
99
130
|
type SelectMode = 'none' | 'single' | 'multi';
|
|
100
131
|
|
|
132
|
+
/** 已选行:数组原样;单个对象(主从页的选中行镜像)= 只选了这一行(空对象 = 没选);其它 = 没有已选行镜像(null) */
|
|
133
|
+
function selectedRowsOf(raw: unknown): readonly unknown[] | null {
|
|
134
|
+
if (Array.isArray(raw)) return raw;
|
|
135
|
+
if (raw !== null && typeof raw === 'object') return Object.keys(raw as Record<string, unknown>).length > 0 ? [raw] : [];
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
|
|
101
139
|
function rowKeyOf(row: unknown, keyField: string): string {
|
|
102
140
|
if (row === null || typeof row !== 'object') return '';
|
|
103
141
|
const v = (row as Record<string, unknown>)[keyField];
|
|
@@ -130,9 +168,11 @@ export const KIT_TABLE_ACTIONS_CLASS_CANDIDATES: readonly string[] = [
|
|
|
130
168
|
EXPAND_BUTTON_CLASS,
|
|
131
169
|
...Object.values(ACTION_BUTTON_CLASS),
|
|
132
170
|
...Object.values(ROW_ACTION_BUTTON_CLASS),
|
|
171
|
+
HEAD_ROOT_CLASS, HEAD_MORE_TRIGGER_CLASS, ...Object.values(HEAD_BUTTON_CLASS),
|
|
133
172
|
...Object.values(KIT_ROW_TONE_CLASS),
|
|
134
173
|
...Object.values(KIT_ITEM_TONE_CLASS),
|
|
135
|
-
|
|
174
|
+
...KIT_ACTION_GROUP_CLASS_CANDIDATES, DANGER_SEPARATOR_CLASS,
|
|
175
|
+
MORE_ROOT_CLASS, MORE_ROOT_NARROW_ONLY_CLASS, ROW_ACTION_SECONDARY_CLASS, COMPACT_MORE_ROOT_NARROW_ONLY_CLASS, COMPACT_SECONDARY_CLASS, MORE_TRIGGER_CLASS, MORE_MENU_SHOWN, 'hidden', ...Object.values(MORE_MENU_CLASSES), ...KIT_MENU_BUTTON_CLASS_CANDIDATES,
|
|
136
176
|
...KIT_POPUP_PLACE_CLASS_CANDIDATES,
|
|
137
177
|
...KIT_PANEL_PORTAL_CLASS_CANDIDATES,
|
|
138
178
|
...KIT_REASON_TIP_CLASS_CANDIDATES, kitDisabledRecipe('aria'),
|
|
@@ -152,27 +192,33 @@ export interface KitTableActionItem {
|
|
|
152
192
|
}
|
|
153
193
|
|
|
154
194
|
/**
|
|
155
|
-
* 行内 /
|
|
156
|
-
* -
|
|
157
|
-
* -
|
|
158
|
-
*
|
|
195
|
+
* 行内 / 「更多」切分(纯函数,排布引擎的行操作投影):shown = 已过权限与行级隐藏的动作(声明序)。
|
|
196
|
+
* 保留序、危险动作折叠都取自排布引擎(action-group.ts#planActionGroup,行操作 `dangerFold`):
|
|
197
|
+
* - 危险动作默认收进「更多」:动作数达到真源阈值(kit-arrange#actionGroup.dangerFoldMinActions)且还有非危险动作时,危险项恒进更多;
|
|
198
|
+
* - 宽档:其余非 more 动作按引擎保留序取前 maxInline 个行内(第一个 primary 恒在行内),其余并入更多;more: true 的恒进更多;
|
|
199
|
+
* - 窄档(容器低于 design 窄档线,行内上限取 design maxInline.narrow,且不超过 maxInline):最多保留 cap 个,同一保留序;
|
|
200
|
+
* 保留者仍按声明序排列;进更多的项:普通项在前、危险项置末(菜单渲染时用 menuOrderDangerLast 加分隔线)。
|
|
159
201
|
* 进更多的每一项,置灰与置灰原因仍由菜单项读 actionState / disabledReason(见 render 的 items),不在此丢失。
|
|
160
202
|
*/
|
|
161
203
|
export function splitRowActions(
|
|
162
204
|
shown: readonly KitTableActionItem[], maxInline: number, narrow: boolean,
|
|
163
|
-
): { inline: KitTableActionItem[]; folded: KitTableActionItem[] } {
|
|
205
|
+
): { inline: KitTableActionItem[]; folded: KitTableActionItem[]; separated: Set<string> } {
|
|
164
206
|
const forced = shown.filter((i) => i.more === true);
|
|
165
|
-
const
|
|
207
|
+
const candidates = shown.filter((i) => i.more !== true);
|
|
166
208
|
const cap = narrow ? Math.max(1, Math.min(maxInline, kitRowActionsNarrowCap())) : maxInline;
|
|
167
|
-
|
|
168
|
-
//
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
209
|
+
// 静态切分整个交给引擎(inlineCap):保留序、危险折叠、内联危险项置末并分隔。
|
|
210
|
+
// 「被收起的只有 1 项时直接内联」不再用于行内动作:常驻至多 cap 个是硬上限(KT-K-table-4,2026-11-25 裁决;
|
|
211
|
+
// 第二轮真实使用测试见 talent 我的风险 3 个动作全常驻——cap 2 + 只溢出 1 项被这条豁免放回行内)
|
|
212
|
+
const plan = planActionGroup(candidates.map((i) => ({ id: i.id, label: i.name, importance: i.tone === 'primary' ? 'primary' : i.tone === 'danger' ? 'danger' : 'secondary' })), { dangerFold: true, inlineCap: cap, loneInline: false });
|
|
213
|
+
const byId = new Map(candidates.map((i) => [i.id, i] as const));
|
|
214
|
+
const pick = (ids: readonly string[]): KitTableActionItem[] => ids.flatMap((id) => { const it = byId.get(id); return it === undefined ? [] : [it]; });
|
|
215
|
+
const foldedIds = new Set(plan.rowFolded);
|
|
216
|
+
return {
|
|
217
|
+
inline: pick(plan.rowInline),
|
|
218
|
+
// 进更多:声明序,more: true 的排在最后(菜单渲染再统一危险置末加分隔线)
|
|
219
|
+
folded: [...candidates.filter((i) => foldedIds.has(i.id)), ...forced],
|
|
220
|
+
separated: new Set(plan.separated.filter((id) => plan.rowInline.includes(id))),
|
|
221
|
+
};
|
|
176
222
|
}
|
|
177
223
|
|
|
178
224
|
export function itemsOf(raw: unknown): KitTableActionItem[] {
|
|
@@ -230,10 +276,12 @@ export function createKitTableActions(): SomaComponentDefinition {
|
|
|
230
276
|
rowTone: { type: 'string', default: '', desc: '行样式档位名(行字段取值,业务对象逐行给出):属于语法真源 viewObject.rowState.toneTiers 闭集时,给所在行容器(data-kit-row)加该档位的类串;不在闭集不加类(rowToneSet 为 item 时取 itemToneTiers)' },
|
|
231
277
|
rowToneSet: { type: 'string', default: 'row', desc: '行样式档位用哪张闭集表:row = toneTiers(表格行底色);item = itemToneTiers(cards / stack 条目自带底色与边框,只用描边 / 透明度);其它值按 row' },
|
|
232
278
|
row: { type: 'object', default: {}, desc: '当前行数据,原样随 row_action 上抛' },
|
|
279
|
+
look: { type: 'string', default: 'link', desc: '外观:link = 行内文字链接(表格 / 条目的行操作);button = 按钮组(主从页右窗格详情头:主动作实心、次级描边、「更多」安静灰字、危险平时灰字悬停变红;详情头窄于窄档线时次要按钮收进「更多」)' },
|
|
233
280
|
pickOnRow: { type: 'boolean', default: false, desc: '开启后点击所在行(data-kit-row 容器)抛 row_pick,builtin 为 select' },
|
|
234
281
|
selectMode: { type: 'string', default: 'none', desc: '勾选列模式 none / single / multi;非 none 时渲染选择框并抛 row_select' },
|
|
235
282
|
selected: { type: 'array', default: [], desc: '已选行数组(协调组件 focus 切片 sel 的镜像);选择框的勾选态与所在行(data-kit-row)的 data-kit-selected 选中高亮由它推出' },
|
|
236
283
|
keyField: { type: 'string', default: '', desc: '行主键字段名(比对已选行;空 = 按整行内容)' },
|
|
284
|
+
bulkLock: { type: 'boolean', default: false, desc: '表格有批量动作时为真:已有选中行(批量条出现)期间本行的行内操作整体禁用' },
|
|
237
285
|
removeScope: { type: 'string', default: '', desc: '行在途判断用(内置删除与具名行动作共用):协调组件的作用域 id;本行在途(经忙闲通道登记)时,本行全部操作置灰、容器挂 aria-busy;空 = 不读' },
|
|
238
286
|
removeObject: { type: 'string', default: '', desc: '行在途判断用(内置删除与具名行动作共用):对象名,须与协调组件的主对象同名,空 = 不读' },
|
|
239
287
|
removeKeyField: { type: 'string', default: '', desc: '行在途判断用(内置删除与具名行动作共用):行主键字段名(与协调组件登记忙态的键同一规则:显式主键 → id → 空串;独立于 keyField,不受选择 / 展开影响)' },
|
|
@@ -372,7 +420,20 @@ export function createKitTableActions(): SomaComponentDefinition {
|
|
|
372
420
|
};
|
|
373
421
|
// 键盘:行本身有焦点时 Enter 等同点行(行内按钮 / 输入框上的 Enter 归它们自己)
|
|
374
422
|
const onRowKey = (event: KeyboardEvent): void => {
|
|
375
|
-
if (!pickOn() || event.
|
|
423
|
+
if (!pickOn() || event.target !== rowEl) return;
|
|
424
|
+
// 条目列表(主从页左窗格):↑ ↓ 把焦点与选中移到相邻条目(点击相邻条目的同一条路径:焦点跟着走、抛 row_pick)
|
|
425
|
+
if ((event.key === 'ArrowDown' || event.key === 'ArrowUp') && rowEl?.hasAttribute('data-kit-compact')) {
|
|
426
|
+
const side = event.key === 'ArrowDown' ? 'nextElementSibling' : 'previousElementSibling';
|
|
427
|
+
let near = rowEl[side] as HTMLElement | null;
|
|
428
|
+
while (near !== null && !near.hasAttribute('data-kit-row')) near = near[side] as HTMLElement | null;
|
|
429
|
+
if (near !== null) {
|
|
430
|
+
event.preventDefault();
|
|
431
|
+
near.focus();
|
|
432
|
+
near.click();
|
|
433
|
+
}
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
if (event.key !== 'Enter') return;
|
|
376
437
|
event.preventDefault();
|
|
377
438
|
emitSelect();
|
|
378
439
|
};
|
|
@@ -409,6 +470,8 @@ export function createKitTableActions(): SomaComponentDefinition {
|
|
|
409
470
|
render(root: HTMLElement, p: KitProps, api: KitApi): void {
|
|
410
471
|
const busy = removeBusyOf(p);
|
|
411
472
|
renderedBusy = busy;
|
|
473
|
+
// 批量条出现期间(表格有批量动作且已有选中行)行内操作整体禁用:批量条替换了工具条,此时单行操作不与批量操作并行(排布规则:选中期间行内操作禁用);勾选框不受影响
|
|
474
|
+
const locked = p.bulkLock === true && Array.isArray(p.selected) && p.selected.length > 0;
|
|
412
475
|
// 跳过判定的签名 = props(已选集合只并入「本行是否被选中」)+ 渲染另外读取的 DOM / 权限输入:
|
|
413
476
|
// 所在行元素身份、展开行容器身份与展开体显隐、每个动作的权限判定结果;任一变化即重绘
|
|
414
477
|
// 只依赖 props / 权限的部分:每次渲染只序列化一次;依赖 DOM 的部分在渲染后重算
|
|
@@ -419,7 +482,7 @@ export function createKitTableActions(): SomaComponentDefinition {
|
|
|
419
482
|
const keyF = str(p.keyField);
|
|
420
483
|
const selState = Array.isArray(p.selected) ? (p.selected.some((r) => rowKeyOf(r, keyF) === rowKeyOf(p.row, keyF)) ? 1 : 0) : -1;
|
|
421
484
|
const perms = itemsOf(p.actions).map((item) => (item.permission !== undefined && check !== null ? (check(item.permission) ? 1 : 0) : -1));
|
|
422
|
-
return JSON.stringify([rest, selState, perms]) + (busy ? '|busy' : '');
|
|
485
|
+
return JSON.stringify([rest, selState, perms]) + (busy ? '|busy' : '') + (locked ? '|lock' : '');
|
|
423
486
|
} catch {
|
|
424
487
|
return null; // 含环等不可序列化:不跳过
|
|
425
488
|
}
|
|
@@ -451,7 +514,8 @@ export function createKitTableActions(): SomaComponentDefinition {
|
|
|
451
514
|
// 旧按钮的原因气泡可能正挂在浮层根里:整片重画前先摘(锚点随旧树丢弃)
|
|
452
515
|
releaseReasonTipsIn(root);
|
|
453
516
|
const items = itemsOf(p.actions);
|
|
454
|
-
|
|
517
|
+
const asButton = p.look === 'button';
|
|
518
|
+
root.className = joinClass(asButton ? HEAD_ROOT_CLASS : ROOT_CLASS, p.class);
|
|
455
519
|
root.replaceChildren();
|
|
456
520
|
if (busy) root.setAttribute('aria-busy', 'true');
|
|
457
521
|
else root.removeAttribute('aria-busy');
|
|
@@ -500,11 +564,12 @@ export function createKitTableActions(): SomaComponentDefinition {
|
|
|
500
564
|
}
|
|
501
565
|
const mode = str(p.selectMode, 'none') as SelectMode;
|
|
502
566
|
const keyField = str(p.keyField);
|
|
503
|
-
const
|
|
567
|
+
const selectedRows = selectedRowsOf(p.selected);
|
|
568
|
+
const picked = selectedRows !== null && selectedRows.some((r) => rowKeyOf(r, keyField) === rowKeyOf(p.row, keyField));
|
|
504
569
|
// 选中行高亮:给所在行容器(data-kit-row)标 data-kit-selected,行类里的 data-kit-selected 变体生效(静态类,不拼类名);
|
|
505
570
|
// 表格是无 role 的 div,不写 aria-selected(它只在 grid / treegrid 的 row 上合法);已选语义由勾选列 checkbox / radio 承担。
|
|
506
571
|
// 勾选列实例与 pickOnRow 实例都读同一份已选行镜像,结论一致
|
|
507
|
-
if (
|
|
572
|
+
if (selectedRows !== null) {
|
|
508
573
|
const rowEl = root.closest<HTMLElement>('[data-kit-row]');
|
|
509
574
|
if (rowEl) {
|
|
510
575
|
if (picked) rowEl.setAttribute('data-kit-selected', '');
|
|
@@ -519,9 +584,15 @@ export function createKitTableActions(): SomaComponentDefinition {
|
|
|
519
584
|
setMarkLabel(box, keyVal !== '' ? kitText('soma.kit.select_row_of', { key: keyVal }, root) : kitText('soma.kit.select_this_row', undefined, root));
|
|
520
585
|
root.appendChild(box);
|
|
521
586
|
}
|
|
522
|
-
// K1-2:无权限的动作不渲染(check 为 null =
|
|
523
|
-
|
|
524
|
-
|
|
587
|
+
// K1-2:无权限的动作不渲染(check 为 null = 未装配权限,保持渲染);
|
|
588
|
+
// 本行不可用的动作(actionState 的 hidden 或 disabled)一律隐藏而不是置灰(knowledge/Kit主题规则与算法.md KT-K-table-4,2026-11-25 裁决);
|
|
589
|
+
// 例外:作者为置灰写了原因(disabledReason 求值非空)——「为什么不能点」本身是要告诉用户的信息,保留置灰 + 原因气泡(AC07);
|
|
590
|
+
// 删除在途 / 批量锁定这类短暂的忙态仍是整行置灰(不是「不可用」)
|
|
591
|
+
const shown = items.filter((item) => {
|
|
592
|
+
const st = rowActionState(p.actionState, item.id);
|
|
593
|
+
const unexplained = st.disabled === true && disabledReasonOf(p.actionState, item) === '';
|
|
594
|
+
return !(item.permission !== undefined && check !== null && !check(item.permission)) && !st.hidden && !unexplained;
|
|
595
|
+
});
|
|
525
596
|
const maxRaw = Number(p.maxInline);
|
|
526
597
|
const maxInline = Number.isFinite(maxRaw) && maxRaw >= 1 ? Math.floor(maxRaw) : DEFAULT_MAX_INLINE;
|
|
527
598
|
if (offEdge === null) {
|
|
@@ -536,28 +607,35 @@ export function createKitTableActions(): SomaComponentDefinition {
|
|
|
536
607
|
};
|
|
537
608
|
if (typeof requestAnimationFrame === 'function') requestAnimationFrame(recheck); else queueMicrotask(recheck);
|
|
538
609
|
// 宽档切分:前 maxInline 个行内,其余并入「更多」。窄档保留者(primary 优先,上限取 design maxInline.narrow)取自宽档行内项,其余行内项标次要
|
|
539
|
-
const { inline, folded } = splitRowActions(shown, maxInline, false);
|
|
540
|
-
const
|
|
610
|
+
const { inline, folded, separated } = splitRowActions(shown, maxInline, false);
|
|
611
|
+
const inCompact = !asButton && !renderedInTable && root.closest('[data-kit-compact]') !== null;
|
|
612
|
+
// 详情头按钮组(look: button)也按容器窄档收起次要项:查询容器是详情头(biz/master-sub/shell detailHead 带 @container),
|
|
613
|
+
// 窄于窄档线时只留主动作 +「更多」,次要按钮进菜单——不再整组换行后仍向右溢出被裁(look6 mcp 接口配置 @320)
|
|
614
|
+
const narrowKeep = asButton || renderedInTable || inCompact ? new Set(splitRowActions(inline, maxInline, true).inline) : new Set(inline);
|
|
541
615
|
const secondary = inline.filter((i) => !narrowKeep.has(i));
|
|
542
616
|
const secondaryButtons = new Map<string, HTMLButtonElement>();
|
|
543
|
-
|
|
617
|
+
const ranks = rowActionRanks(inline);
|
|
618
|
+
for (const [at, item] of inline.entries()) {
|
|
544
619
|
const btn = root.ownerDocument.createElement('button');
|
|
545
620
|
btn.setAttribute('type', 'button');
|
|
546
621
|
btn.setAttribute('data-kit-act', item.id);
|
|
547
|
-
btn.className =
|
|
622
|
+
btn.className = asButton ? HEAD_BUTTON_CLASS[ranks[at]!] : ROW_ACTION_BUTTON_CLASS[ranks[at]!];
|
|
623
|
+
// 内联的危险动作置末并与前一项分隔:在项间距(gap-x-4)之外再加大一截(取值 kit-arrange#actionGroup.dangerSeparatorRem);按钮形态(详情头)按钮自带轮廓,不加
|
|
624
|
+
if (!asButton && separated.has(item.id)) btn.className = `${btn.className} ${DANGER_SEPARATOR_CLASS}`;
|
|
548
625
|
if (!narrowKeep.has(item)) {
|
|
549
626
|
btn.setAttribute('data-kit-act-secondary', '');
|
|
550
|
-
btn.className = `${btn.className} ${ROW_ACTION_SECONDARY_CLASS}`;
|
|
627
|
+
btn.className = `${btn.className} ${inCompact ? COMPACT_SECONDARY_CLASS : ROW_ACTION_SECONDARY_CLASS}`;
|
|
551
628
|
secondaryButtons.set(item.id, btn);
|
|
552
629
|
}
|
|
553
630
|
// 文字链接形态:无面(不标 raised)
|
|
554
631
|
btn.textContent = item.name;
|
|
555
632
|
// 置灰原因(动作置灰且原因非空,本行没在删除在途):不用原生 disabled,只留 aria-disabled 保持可聚焦,原因经气泡 + aria-describedby 给出;点击由 onClick 的置灰判断拦下
|
|
556
|
-
const reason = busy ? '' : disabledReasonOf(p.actionState, item);
|
|
633
|
+
const reason = busy || locked ? '' : disabledReasonOf(p.actionState, item);
|
|
557
634
|
if (reason !== '') {
|
|
558
635
|
btn.setAttribute('aria-disabled', 'true');
|
|
559
|
-
|
|
560
|
-
|
|
636
|
+
// 置灰是静态类(与 cursor-pointer 同特异度,谁在样式表里靠后谁赢):先摘掉可点光标,光标只剩 not-allowed
|
|
637
|
+
btn.className = `${btn.className.split(/\s+/).filter((c) => c !== 'cursor-pointer').join(' ')} ${kitDisabledRecipe('aria')}`;
|
|
638
|
+
} else if (busy || locked || rowActionState(p.actionState, item.id).disabled) {
|
|
561
639
|
btn.disabled = true;
|
|
562
640
|
btn.setAttribute('aria-disabled', 'true');
|
|
563
641
|
}
|
|
@@ -568,13 +646,13 @@ export function createKitTableActions(): SomaComponentDefinition {
|
|
|
568
646
|
const doc = root.ownerDocument;
|
|
569
647
|
const wrap = doc.createElement('div');
|
|
570
648
|
// 没有常驻折叠项(宽档全部行内)时触发器只在窄档出现;有常驻折叠项时恒显示
|
|
571
|
-
wrap.className = folded.length > 0 ? MORE_ROOT_CLASS : MORE_ROOT_NARROW_ONLY_CLASS;
|
|
649
|
+
wrap.className = folded.length > 0 ? MORE_ROOT_CLASS : inCompact ? COMPACT_MORE_ROOT_NARROW_ONLY_CLASS : MORE_ROOT_NARROW_ONLY_CLASS;
|
|
572
650
|
wrap.setAttribute('data-kit-more-root', folded.length > 0 ? '' : 'narrow');
|
|
573
651
|
const trigger = doc.createElement('button');
|
|
574
652
|
trigger.setAttribute('type', 'button');
|
|
575
653
|
trigger.setAttribute('aria-haspopup', 'menu');
|
|
576
654
|
trigger.setAttribute('aria-label', kitText('soma.kit.more_actions', undefined, root));
|
|
577
|
-
trigger.className = MORE_TRIGGER_CLASS;
|
|
655
|
+
trigger.className = asButton ? HEAD_MORE_TRIGGER_CLASS : MORE_TRIGGER_CLASS;
|
|
578
656
|
trigger.setAttribute('data-kit-more', '');
|
|
579
657
|
const win = doc.defaultView;
|
|
580
658
|
const menuEntries = (): KitTableActionItem[] => {
|
|
@@ -590,8 +668,8 @@ export function createKitTableActions(): SomaComponentDefinition {
|
|
|
590
668
|
menu.className = 'hidden';
|
|
591
669
|
wrap.append(trigger, menu);
|
|
592
670
|
root.appendChild(wrap);
|
|
593
|
-
//
|
|
594
|
-
if (busy) {
|
|
671
|
+
// 本行删除在途 / 批量条出现期间:「更多」触发钮置灰,菜单不接线(打不开)
|
|
672
|
+
if (busy || locked) {
|
|
595
673
|
trigger.disabled = true;
|
|
596
674
|
trigger.setAttribute('aria-disabled', 'true');
|
|
597
675
|
} else moreMenu = wireMenu({
|
|
@@ -602,11 +680,12 @@ export function createKitTableActions(): SomaComponentDefinition {
|
|
|
602
680
|
hiddenClass: 'hidden',
|
|
603
681
|
// 挂到浮层根下,不被表格外层 overflow 裁切;定位仍走 popup 的贴边翻转
|
|
604
682
|
portal: createPanelPortal(trigger),
|
|
605
|
-
fitted: () => ({ pref: MORE_PLACE, classFor: KIT_MENU_PANEL.
|
|
683
|
+
fitted: () => ({ pref: MORE_PLACE, classFor: KIT_MENU_PANEL.classForTextTrigger }),
|
|
606
684
|
classes: MORE_MENU_CLASSES,
|
|
607
685
|
// 置灰项的原因作为该项的描述文字(可见的第二段文字 + aria-describedby),菜单项本身是 aria-disabled 的 div,读屏可取到
|
|
608
686
|
// 菜单内容在打开 / 取项时现算:常驻折叠项 + 当前被容器查询隐藏的次要行内项(display:none 即不可见),次序 = 隐藏的次要项(声明序)→ 常驻折叠的普通项 → more:true 项
|
|
609
|
-
|
|
687
|
+
// 危险项置末并与前面的项以分隔线隔开(动作组统一规则,menuOrderDangerLast)
|
|
688
|
+
items: () => menuOrderDangerLast(menuEntries().map((i) => ({ key: i.id, label: i.name, icon: '', disabled: rowActionState(p.actionState, i.id).disabled, danger: i.tone === 'danger', divider: false, reason: disabledReasonOf(p.actionState, i) }))),
|
|
610
689
|
locked: () => false,
|
|
611
690
|
onPick: (picked) => {
|
|
612
691
|
const hit = menuEntries().find((i) => i.id === picked.key);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// KitTableGap:静态表头(不可排序的表格)的缺失值接线件(数据层小组件,不画任何东西)。
|
|
2
|
+
//
|
|
3
|
+
// 表格有「缺失原因字段」约定的列(`<字段>_reason`,见 recipes/table-gap)由编译期收成 `fields`;本组件按当前页行数据判定各列
|
|
4
|
+
// (soma-foundation 的 analyzeTableGaps),整列同因的列在列头旁写一次原因(次级标注)。可排序表头由 KitTableHead 自己做同一件事。
|
|
5
|
+
// 宿主挂在表格内层容器里(表头之前),表头格靠 `data-kit-head-field` 标记被找到。
|
|
6
|
+
|
|
7
|
+
import type { SomaComponentDefinition } from 'soma-core';
|
|
8
|
+
import { createKitController, type KitProps } from '../base/shared';
|
|
9
|
+
import { analyzeTableGaps, paintTableGapNotes } from '../recipes/table-gap';
|
|
10
|
+
import { KIT_PART_TABLE } from '../recipes/table-row';
|
|
11
|
+
|
|
12
|
+
function fieldsOf(raw: unknown): string[] {
|
|
13
|
+
return Array.isArray(raw) ? raw.filter((x): x is string => typeof x === 'string' && x !== '') : [];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function createKitTableGap(): SomaComponentDefinition {
|
|
17
|
+
return {
|
|
18
|
+
contract: {
|
|
19
|
+
name: 'KitTableGap',
|
|
20
|
+
layer: 'data',
|
|
21
|
+
props: {
|
|
22
|
+
rows: { type: 'array', default: [], desc: '当前页行数组' },
|
|
23
|
+
fields: { type: 'array', default: [], desc: '有缺失原因约定的列(字段名)' },
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
templateHtml: '<div data-soma-id="root" hidden></div>',
|
|
27
|
+
controllerFactory: createKitController(() => ({
|
|
28
|
+
render(root, p: KitProps) {
|
|
29
|
+
const rows = Array.isArray(p.rows) ? p.rows : [];
|
|
30
|
+
const fields = fieldsOf(p.fields);
|
|
31
|
+
// 宿主 -> 所属表格外壳(表头与行都在里面)
|
|
32
|
+
const scope = root.closest<HTMLElement>(`[data-kit-part="${KIT_PART_TABLE}"]`) ?? root.parentElement ?? root.ownerDocument;
|
|
33
|
+
paintTableGapNotes(scope, analyzeTableGaps(rows, fields));
|
|
34
|
+
},
|
|
35
|
+
})),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -13,7 +13,13 @@
|
|
|
13
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 { kitSurfaceRecipe } from '../recipes/surface';
|
|
19
|
+
import { kitTabRecipe } from '../recipes/tabs';
|
|
20
|
+
import { KIT_DIVIDER_FOOT_CLASS } from '../recipes/divider';
|
|
21
|
+
import { mergeClass } from '../shared/merge-class';
|
|
22
|
+
import { measureEdges } from '../base/end-edge';
|
|
17
23
|
import { CLASS_PROP, createKitController, num, str } from '../base/shared';
|
|
18
24
|
import { KIT_DROPDOWN_CLASS_CANDIDATES, onOutsidePress, overlayVerdict, releaseDropdownsIn, syncDropdown } from '../base/popup';
|
|
19
25
|
import { permissionCheckerOf } from '../base/permission-gate';
|
|
@@ -24,33 +30,38 @@ import { KIT_LISTBOX_CLASS_CANDIDATES } from '../base/listbox-core';
|
|
|
24
30
|
import { createKitEmbedBag, mountKitSelectField, type KitEmbedHandle } from '../data/embed';
|
|
25
31
|
import { KIT_TABLE_ACTIONS_CLASS_CANDIDATES, ACTION_BUTTON_CLASS } from './table-actions';
|
|
26
32
|
import { KIT_TABLE_DENSITIES, KIT_TABLE_DENSITY_DEFAULT, KIT_TABLE_EXT, type KitTableDensity } from './defaults';
|
|
27
|
-
import { attachResizeHandle, type ResizeHandle } from '../
|
|
33
|
+
import { attachResizeHandle, type ResizeHandle } from '../base/resize-handle';
|
|
28
34
|
import { kitText, type KitTextKey } from '../i18n/kit-text';
|
|
29
35
|
import { KIT_ACTION_SLOT_BASE, actionSlotEmits, emitActionSlot } from '../base/action-slots';
|
|
30
36
|
import { isKitActionBusy, onKitActionBusy } from '../base/action-busy';
|
|
37
|
+
import { KIT_ACTION_MORE_CLASS_CANDIDATES, buildActionGroup, type DomActionEntry } from './action-more';
|
|
31
38
|
|
|
32
39
|
/** 按语气取质感标记:primary 实心 / neutral 描边有面;danger 是透明底幽灵钮,无面不标 */
|
|
33
40
|
const faceOfTone = (tone: 'primary' | 'danger' | 'neutral'): KitFaceKind | null => (tone === 'danger' ? null : KIT_FACE_RAISED);
|
|
34
41
|
|
|
35
42
|
// ---------------------------------------------------------------- 类(整串字面量)
|
|
36
43
|
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const
|
|
44
|
+
// 工具条 / 批量条里的成组动作恒单行(action-group.ts:排布引擎投影):根与组都不换行,放不下的次要动作收进「更多」
|
|
45
|
+
const ROOT_CLASS = 'flex flex-nowrap items-center justify-between gap-2 pb-2';
|
|
46
|
+
const GROUP_CLASS = 'flex min-w-0 flex-1 flex-nowrap items-center justify-end gap-2';
|
|
47
|
+
// 工具条按钮 / 分段按钮 / 文字链接:控件引擎的配方(工具条宿主 tight),不再手写按钮类串
|
|
48
|
+
const TOOL_BTN_CLASS = kitEmphasisButtonRecipe('button.toolbar', { tight: true });
|
|
49
|
+
// 分段组 = 分段控件的槽(与 SegmentedSwitch 同一个出口 kitTabRecipe().segRoot:凹槽面、无描边;一种呈现一个配方,不再自画一圈灰线)
|
|
50
|
+
const SEG_GROUP_CLASS = kitTabRecipe().segRoot;
|
|
51
|
+
const SEG_BTN_CLASS = kitSegmentRecipe(false);
|
|
52
|
+
const SEG_BTN_ON_CLASS = kitSegmentRecipe(true);
|
|
53
|
+
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';
|
|
54
|
+
const BATCH_TEXT_CLASS = 'shrink-0 font-medium';
|
|
55
|
+
const LINK_BTN_CLASS = kitTextActionRecipe('primary');
|
|
46
56
|
const CHECK_TEXT_CLASS = 'text-sm text-fg';
|
|
47
57
|
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
58
|
const PANEL_CHECK_LOCKED_CLASS = 'w-full px-2 py-1 text-sm';
|
|
49
59
|
const ANCHOR_CLASS = 'relative inline-flex';
|
|
50
|
-
|
|
60
|
+
// 列设置弹层:浮起表面只取表面配方(KT-B4:双层阴影 + 发丝描边),不自写边框 / 阴影
|
|
61
|
+
const PANEL_BASE = mergeClass('absolute z-20 w-56 p-2 text-sm text-fg', kitSurfaceRecipe('raised'));
|
|
51
62
|
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
63
|
const PANEL_ITEM_LOCKED_CLASS = 'flex cursor-not-allowed items-center gap-2 rounded-md px-2 py-1 text-fg-subtle';
|
|
53
|
-
const PANEL_FOOT_CLASS = 'mt-1 flex justify-end
|
|
64
|
+
const PANEL_FOOT_CLASS = mergeClass('mt-1 flex justify-end pt-1', KIT_DIVIDER_FOOT_CLASS);
|
|
54
65
|
const NOTICE_CLASS = 'text-xs text-fg-muted';
|
|
55
66
|
const NOTICE_ERR_CLASS = 'text-xs text-danger-on-soft';
|
|
56
67
|
const EDIT_CELL_CLASS = 'cursor-text focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring';
|
|
@@ -92,7 +103,7 @@ export const KIT_TABLE_TOOLS_CLASS_CANDIDATES: readonly string[] = [
|
|
|
92
103
|
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
104
|
EDIT_CELL_CLASS, EDIT_INPUT_CLASS, EDIT_DATE_CLASS, EDIT_SELECT_CLASS, EDIT_ERR_CLASS, HIDDEN_CLASS, BUSY_TABLE_CLASS, BUSY_BTN_CLASS,
|
|
94
105
|
...KIT_DATE_CLASS_CANDIDATES, ...KIT_LISTBOX_CLASS_CANDIDATES,
|
|
95
|
-
...Object.values(ACTION_BUTTON_CLASS), ...KIT_TABLE_ACTIONS_CLASS_CANDIDATES, ...KIT_DROPDOWN_CLASS_CANDIDATES,
|
|
106
|
+
...Object.values(ACTION_BUTTON_CLASS), ...KIT_TABLE_ACTIONS_CLASS_CANDIDATES, ...KIT_DROPDOWN_CLASS_CANDIDATES, ...KIT_ACTION_MORE_CLASS_CANDIDATES,
|
|
96
107
|
].flatMap((s) => s.split(/\s+/).filter((c) => c !== ''));
|
|
97
108
|
|
|
98
109
|
// ---------------------------------------------------------------- 纯函数
|
|
@@ -392,7 +403,8 @@ export function createKitTableTools(): SomaComponentDefinition {
|
|
|
392
403
|
const pathname = (): string => (typeof location === 'undefined' ? '' : location.pathname);
|
|
393
404
|
|
|
394
405
|
const effectiveDensity = (): Density => {
|
|
395
|
-
|
|
406
|
+
// 用户没选过:以页面壳编译期给的默认为准(列表页壳标 data-kit-dense = 紧凑),否则取全局缺省
|
|
407
|
+
return density ?? (table?.hasAttribute('data-kit-dense') === true ? 'COMPACT_DENSE' : KIT_TABLE_DENSITY_DEFAULT);
|
|
396
408
|
};
|
|
397
409
|
|
|
398
410
|
// ---- 对表格外壳的作用
|
|
@@ -513,8 +525,7 @@ export function createKitTableTools(): SomaComponentDefinition {
|
|
|
513
525
|
|
|
514
526
|
const applyEdges = (): void => {
|
|
515
527
|
if (!table || P().scroll !== true) return;
|
|
516
|
-
const left = table
|
|
517
|
-
const right = table.scrollLeft + table.clientWidth < table.scrollWidth - 1;
|
|
528
|
+
const { left, right } = measureEdges(table);
|
|
518
529
|
if (left) table.setAttribute('data-kit-edge-l', ''); else table.removeAttribute('data-kit-edge-l');
|
|
519
530
|
if (right) table.setAttribute('data-kit-edge-r', ''); else table.removeAttribute('data-kit-edge-r');
|
|
520
531
|
};
|
|
@@ -777,16 +788,28 @@ export function createKitTableTools(): SomaComponentDefinition {
|
|
|
777
788
|
/** 重新读取中:读状态 loading 且当前已有行(首次加载无行,走三态骨架,不叠加) */
|
|
778
789
|
const reading = (p: Rec): boolean => str(p.readState) === 'loading' && Array.isArray(p.rows) && p.rows.length > 0;
|
|
779
790
|
|
|
791
|
+
// 动作组「更多」菜单的清理函数(每次整体重建前先清)
|
|
792
|
+
let groupOffs: Array<() => void> = [];
|
|
793
|
+
const releaseGroups = (): void => {
|
|
794
|
+
for (const off of groupOffs) off();
|
|
795
|
+
groupOffs = [];
|
|
796
|
+
};
|
|
797
|
+
|
|
798
|
+
/** 工具栏:密度分段是视图模式开关(不进动作组,恒可见);刷新 / 列设置 / 导出是动作,成组经排布引擎(恒单行,放不下的次要项收进「更多」,列设置 = 主操作恒可见) */
|
|
780
799
|
const renderToolbar = (doc: Document, items: string[], busy: boolean): HTMLElement => {
|
|
781
800
|
const group = doc.createElement('div');
|
|
782
801
|
group.className = GROUP_CLASS;
|
|
802
|
+
const entries: DomActionEntry[] = [];
|
|
783
803
|
for (const it of items) {
|
|
784
804
|
if (it === 'reload') {
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
805
|
+
entries.push({
|
|
806
|
+
id: 'reload', label: T('soma.kit.refresh'), importance: 'secondary',
|
|
807
|
+
button: btn(
|
|
808
|
+
doc, busy ? `${TOOL_BTN_CLASS} ${BUSY_BTN_CLASS}` : TOOL_BTN_CLASS, T('soma.kit.refresh'),
|
|
809
|
+
busy ? { 'data-kit-tool': 'reload', disabled: '', 'aria-busy': 'true' } : { 'data-kit-tool': 'reload' },
|
|
810
|
+
KIT_FACE_RAISED,
|
|
811
|
+
),
|
|
812
|
+
});
|
|
790
813
|
} else if (it === 'density') {
|
|
791
814
|
const seg = doc.createElement('div');
|
|
792
815
|
seg.className = SEG_GROUP_CLASS;
|
|
@@ -797,17 +820,23 @@ export function createKitTableTools(): SomaComponentDefinition {
|
|
|
797
820
|
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);
|
|
798
821
|
seg.appendChild(b);
|
|
799
822
|
}
|
|
823
|
+
seg.classList.add('shrink-0');
|
|
800
824
|
group.appendChild(seg);
|
|
801
825
|
} else if (it === 'columns') {
|
|
802
826
|
const anchor = doc.createElement('div');
|
|
803
827
|
anchor.className = ANCHOR_CLASS;
|
|
804
828
|
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));
|
|
805
829
|
if (panelOpen) anchor.appendChild(columnPanel(doc));
|
|
806
|
-
|
|
830
|
+
entries.push({ id: 'columns', label: T('soma.kit.columns'), importance: 'primary', button: anchor });
|
|
807
831
|
} else if (it === 'export') {
|
|
808
|
-
|
|
832
|
+
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) });
|
|
809
833
|
}
|
|
810
834
|
}
|
|
835
|
+
if (entries.length > 0) {
|
|
836
|
+
const built = buildActionGroup(doc, entries);
|
|
837
|
+
groupOffs.push(built.destroy);
|
|
838
|
+
group.appendChild(built.el);
|
|
839
|
+
}
|
|
811
840
|
return group;
|
|
812
841
|
};
|
|
813
842
|
|
|
@@ -884,6 +913,8 @@ export function createKitTableTools(): SomaComponentDefinition {
|
|
|
884
913
|
return bar;
|
|
885
914
|
}
|
|
886
915
|
}
|
|
916
|
+
// 批量动作成组经排布引擎:恒单行,放不下的次要动作收进「更多」(危险项置末加分隔线),主操作恒在行尾可见
|
|
917
|
+
const entries: DomActionEntry[] = [];
|
|
887
918
|
for (const b of batch) {
|
|
888
919
|
if (b.permission !== '' && check !== null && !check(b.permission)) continue;
|
|
889
920
|
const busy = isKitActionBusy(batchBusyNames(b));
|
|
@@ -894,7 +925,12 @@ export function createKitTableTools(): SomaComponentDefinition {
|
|
|
894
925
|
}
|
|
895
926
|
const button = btn(doc, ACTION_BUTTON_CLASS[b.tone], b.name, attrs, faceOfTone(b.tone));
|
|
896
927
|
if (busy) button.disabled = true;
|
|
897
|
-
|
|
928
|
+
entries.push({ id: b.id, label: b.name, importance: b.tone === 'primary' ? 'primary' : b.tone === 'danger' ? 'danger' : 'secondary', tone: b.tone, button });
|
|
929
|
+
}
|
|
930
|
+
if (entries.length > 0) {
|
|
931
|
+
const built = buildActionGroup(doc, entries);
|
|
932
|
+
groupOffs.push(built.destroy);
|
|
933
|
+
bar.appendChild(built.el);
|
|
898
934
|
}
|
|
899
935
|
return bar;
|
|
900
936
|
};
|
|
@@ -935,6 +971,7 @@ export function createKitTableTools(): SomaComponentDefinition {
|
|
|
935
971
|
// 重建会销毁旧面板;开着时由 columnPanel 重新登记,关着就保持空
|
|
936
972
|
colsPanelEl = null;
|
|
937
973
|
releaseDropdownsIn(root);
|
|
974
|
+
releaseGroups();
|
|
938
975
|
root.replaceChildren();
|
|
939
976
|
if (!liveEl || liveEl.parentElement === null) {
|
|
940
977
|
liveEl = doc.createElement('div');
|
|
@@ -1113,6 +1150,7 @@ export function createKitTableTools(): SomaComponentDefinition {
|
|
|
1113
1150
|
const offs: Array<() => void> = [];
|
|
1114
1151
|
cancelHeldRebuild = () => { rebuildHeld = false; renderHeld = false; pressing = false; disarmHeld(); };
|
|
1115
1152
|
offs.push(() => cancelHeldRebuild());
|
|
1153
|
+
offs.push(() => releaseGroups());
|
|
1116
1154
|
offs.push(onKitActionBusy(() => rebuild()));
|
|
1117
1155
|
for (const sliceName of ['filter', 'view'] as const) {
|
|
1118
1156
|
const slice = regionPort()?.slice(sliceName);
|