soma-kit 0.1.14 → 0.1.16
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 +1 -1
- package/package.json +8 -5
- package/packs/ai/model-card.ts +3 -3
- package/packs/finance/reconcile-desk/compile.ts +1 -1
- package/packs/finance/reconcile-desk/shell.ts +1 -1
- package/packs/ops/error-budget-card.ts +3 -3
- package/packs/ops/release-readiness-card.ts +3 -3
- package/packs/security/control-evidence-card.ts +3 -3
- package/packs/security/finding-card.ts +3 -2
- package/packs/shared/card-util.ts +17 -0
- package/spec/generated/kit-app.schema.json +2148 -338
- package/spec/generated/kit-page.schema.json +1152 -87
- package/spec/kit-grammar.json +1084 -136
- package/spec/kit-grammar.schema.json +167 -26
- package/src/app/app-config.ts +220 -187
- package/src/app/component-gate.ts +2 -2
- package/src/app/compose-apps.ts +5 -2
- package/src/app/define-kit-actions.ts +200 -22
- package/src/app/define-kit-app.ts +54 -8
- package/src/app/define-kit-view.ts +1 -1
- package/src/app/index.ts +12 -7
- package/src/app/kit-view-context.ts +50 -3
- package/src/app/list-page-defaults.ts +14 -0
- package/src/app/server-pages.ts +239 -7
- package/src/app/server.ts +466 -25
- package/src/app/theme-endpoint.ts +68 -24
- package/src/app/theme-runtime.ts +421 -87
- package/src/app/theme-shards.ts +69 -0
- package/src/app/tier-compat.ts +107 -0
- package/src/base/action-busy.ts +215 -38
- package/src/base/affix.ts +137 -0
- package/src/base/alert.ts +107 -59
- package/src/base/anchored-layer.ts +8 -7
- package/src/base/avatar.ts +147 -61
- package/src/base/badge.ts +186 -0
- package/src/base/button-group.ts +227 -0
- package/src/base/button.ts +365 -53
- package/src/base/card.ts +233 -0
- package/src/base/cascader.ts +147 -32
- package/src/base/check-core.ts +196 -33
- package/src/base/checkbox.ts +67 -2
- package/src/base/choice.ts +132 -31
- package/src/base/collapse.ts +249 -0
- package/src/base/color-picker.ts +404 -28
- package/src/base/combobox.ts +6 -2
- package/src/base/command-palette.ts +155 -37
- package/src/base/context-menu.ts +26 -6
- package/src/base/countdown.ts +37 -15
- package/src/base/date-range.ts +115 -94
- package/src/base/date.ts +487 -76
- package/src/base/delta.ts +20 -11
- package/src/base/divider.ts +64 -97
- package/src/base/end-edge.ts +10 -4
- package/src/base/fab.ts +64 -23
- package/src/base/gap-value.ts +35 -16
- package/src/base/hint-tips.ts +100 -30
- package/src/base/identity-cells.ts +839 -0
- package/src/base/illustrations.ts +6 -4
- package/src/base/image.ts +40 -19
- package/src/base/index.ts +92 -24
- package/src/base/inline-error.ts +90 -0
- package/src/base/input.ts +174 -38
- package/src/base/kbd.ts +31 -17
- package/src/base/kit-contract.ts +400 -0
- package/src/base/link.ts +41 -20
- package/src/base/listbox-core.ts +324 -95
- package/src/base/loading-gate.ts +3 -0
- package/src/base/look.ts +197 -0
- package/src/base/mentions.ts +58 -22
- package/src/base/menu-button.ts +129 -42
- package/src/base/menu-core.ts +210 -26
- package/src/base/month-grid.ts +60 -3
- package/src/base/motion/aura.ts +52 -10
- package/src/base/motion/hover-3d.ts +10 -5
- package/src/base/motion/hover-gallery.ts +19 -12
- package/src/base/motion/limits.ts +10 -0
- package/src/base/motion/marquee.ts +18 -11
- package/src/base/motion/text-rotate.ts +34 -16
- package/src/base/notification.ts +292 -0
- package/src/base/number.ts +93 -12
- package/src/base/otp.ts +143 -27
- package/src/base/overlay-runtime.ts +32 -24
- package/src/base/overlay-shell.ts +186 -0
- package/src/base/period-picker.ts +868 -0
- package/src/base/popover.ts +625 -74
- package/src/base/popup.ts +219 -78
- package/src/base/portal-core.ts +99 -2
- package/src/base/price-text.ts +51 -17
- package/src/base/progress.ts +100 -18
- package/src/base/qr-code.ts +64 -17
- package/src/base/qty-stepper.ts +145 -21
- package/src/base/radio.ts +43 -2
- package/src/base/range.ts +194 -39
- package/src/base/rating.ts +117 -31
- package/src/base/reason-tip.ts +60 -18
- package/src/base/relation-cells.ts +541 -0
- package/src/{frames → base}/resize-handle.ts +6 -4
- package/src/base/row-fresh.ts +84 -0
- package/src/base/section-spy.ts +79 -0
- package/src/base/segmented.ts +99 -56
- package/src/base/select.ts +8 -2
- package/src/base/shared.ts +520 -73
- package/src/base/spinner.ts +107 -0
- package/src/base/state-panel.ts +77 -22
- package/src/base/status-tone.ts +1 -1
- package/src/base/sticky-edge.ts +96 -29
- package/src/base/swap.ts +39 -21
- package/src/base/switch.ts +158 -38
- package/src/base/tabs.ts +292 -0
- package/src/base/tag-input.ts +129 -55
- package/src/base/tag.ts +203 -91
- package/src/base/text.ts +491 -77
- package/src/base/textarea.ts +89 -40
- package/src/base/time-picker.ts +341 -57
- package/src/base/time-range.ts +846 -0
- package/src/base/tree-select.ts +346 -89
- package/src/base/upload.ts +612 -158
- package/src/base/view-transition.ts +7 -3
- package/src/base/virtual-list.ts +49 -14
- package/src/biz/approval-desk/compile.ts +98 -6
- package/src/biz/approval-desk/index.ts +2 -0
- package/src/biz/approval-desk/shell.ts +53 -13
- package/src/biz/auth-panel/compile.ts +14 -4
- package/src/biz/auth-panel/shell.ts +28 -8
- package/src/biz/category-crud/compile.ts +64 -13
- package/src/biz/category-crud/index.ts +2 -0
- package/src/biz/category-crud/shell.ts +30 -8
- package/src/biz/checkout-page/compile.ts +38 -4
- package/src/biz/checkout-page/index.ts +1 -0
- package/src/biz/checkout-page/shell.ts +28 -10
- package/src/biz/compose.ts +9 -4
- package/src/biz/data-components.ts +2 -0
- package/src/biz/define.ts +1 -1
- package/src/biz/import-wizard/compile.ts +5 -2
- package/src/biz/import-wizard/index.ts +1 -0
- package/src/biz/import-wizard/shell.ts +36 -20
- package/src/biz/index.ts +5 -4
- package/src/biz/landing-page/compile.ts +4 -3
- package/src/biz/landing-page/shell.ts +25 -5
- package/src/biz/layout-contracts.ts +918 -0
- package/src/biz/link/hub.ts +199 -8
- package/src/biz/link/shared.ts +62 -16
- package/src/biz/master-sub/compile.ts +318 -38
- package/src/biz/master-sub/detail-head.ts +145 -21
- package/src/biz/master-sub/index.ts +6 -3
- package/src/biz/master-sub/shell.ts +232 -66
- package/src/biz/multi-board/compile.ts +89 -38
- package/src/biz/multi-board/composition.ts +7 -20
- package/src/biz/multi-board/index.ts +25 -9
- package/src/biz/multi-board/prose-fold.ts +17 -13
- package/src/biz/multi-board/shell.ts +153 -38
- package/src/biz/names.ts +1 -0
- package/src/biz/notification-center/compile.ts +28 -7
- package/src/biz/notification-center/index.ts +2 -0
- package/src/biz/notification-center/shell.ts +51 -11
- package/src/biz/page-templates/domain-templates.ts +147 -20
- package/src/biz/page-templates/result-page/compile.ts +5 -2
- package/src/biz/page-templates/result-page/index.ts +1 -0
- package/src/biz/page-templates/result-page/shell.ts +20 -6
- package/src/biz/page-templates/shared.ts +1 -1
- package/src/biz/page-templates/sign-in-page/compile.ts +20 -9
- package/src/biz/page-templates/sign-in-page/index.ts +1 -0
- package/src/biz/page-templates/sign-in-page/shell.ts +30 -14
- package/src/biz/record-detail/compile.ts +43 -12
- package/src/biz/record-detail/index.ts +1 -0
- package/src/biz/record-detail/shell.ts +42 -11
- package/src/biz/settings-center/compile.ts +5 -2
- package/src/biz/settings-center/index.ts +1 -0
- package/src/biz/settings-center/shell.ts +33 -9
- package/src/biz/shared/action-host.ts +146 -48
- package/src/biz/shared/compile-helpers.ts +134 -32
- package/src/biz/shared/coordinator.ts +727 -163
- package/src/biz/shared/focus-return.ts +180 -0
- package/src/biz/shared/object-aliases.ts +7 -1
- package/src/biz/shared/overlay-compile.ts +102 -24
- package/src/biz/shared/overlay-shell.ts +97 -116
- package/src/biz/shared/page-form-actions.ts +151 -0
- package/src/biz/shared/page-form.ts +255 -0
- package/src/biz/shared/pipeline.ts +74 -0
- package/src/biz/shared/runtime-hub.ts +101 -8
- package/src/biz/shared/verbs.ts +129 -0
- package/src/biz/single-form/compile.ts +6 -4
- package/src/biz/single-form/index.ts +2 -0
- package/src/biz/single-form/shell.ts +22 -8
- package/src/biz/standard-crud/compile.ts +213 -38
- package/src/biz/standard-crud/index.ts +2 -1
- package/src/biz/standard-crud/shell.ts +90 -13
- package/src/biz/standard-crud/summary.ts +2 -35
- package/src/biz/step-form/compile.ts +13 -4
- package/src/biz/step-form/hub.ts +168 -49
- package/src/biz/step-form/index.ts +1 -0
- package/src/biz/step-form/shell.ts +35 -17
- package/src/biz/types.ts +49 -6
- package/src/cli/app-layer-check.ts +375 -0
- package/src/cli/kit-cli.ts +179 -33
- package/src/cli/kit-init.ts +152 -3
- package/src/cli/migrate/theme-map.ts +35 -28
- package/src/cli/migrate/ts-rules.ts +2 -2
- package/src/cli/migrate/types.ts +3 -3
- package/src/cli/migrate/yaml-rules.ts +11 -9
- package/src/cli/view-writes.ts +13 -0
- package/src/compile/access-gate-attach.ts +1 -1
- package/src/compile/action-host-attach.ts +1 -1
- package/src/compile/closed-set.ts +102 -6
- package/src/compile/compile-page.ts +461 -273
- package/src/compile/component-candidates.ts +58 -5
- package/src/compile/danger-tier.ts +65 -0
- package/src/compile/hints.ts +6 -59
- package/src/compile/index.ts +2 -2
- package/src/compile/info-structure.ts +155 -0
- package/src/compile/layout-lint/index.ts +4 -1
- package/src/compile/layout-lint/rules-composition.ts +44 -13
- package/src/compile/layout-lint/rules-table.ts +4 -19
- package/src/compile/look-page.ts +551 -0
- package/src/compile/look.ts +376 -0
- package/src/compile/page-composition.ts +405 -67
- package/src/compile/page-hierarchy.ts +131 -0
- package/src/compile/page-pipeline-look.ts +156 -0
- package/src/compile/page-pipeline.ts +200 -0
- package/src/compile/parse.ts +12 -11
- package/src/compile/redirect.ts +1 -1
- package/src/compile/relation-render.ts +120 -0
- package/src/compile/remove-guard.ts +115 -41
- package/src/compile/stages.ts +786 -0
- package/src/compile/styles.ts +286 -48
- package/src/compile/types.ts +63 -6
- package/src/compile/view-check.ts +190 -1
- package/src/data/access-gate.ts +17 -9
- package/src/data/amount-breakdown.ts +52 -23
- package/src/data/anchor-nav.ts +77 -16
- package/src/data/approval-flow.ts +217 -126
- package/src/data/assignment-picker.ts +182 -94
- package/src/data/async-result-panel.ts +114 -46
- package/src/data/audit-log.ts +461 -0
- package/src/data/breadcrumbs.ts +150 -24
- package/src/data/calendar.ts +436 -97
- package/src/data/card-grid.ts +319 -0
- package/src/data/carousel.ts +81 -41
- package/src/data/cell-value.ts +253 -0
- package/src/data/chart.ts +1053 -96
- package/src/data/checklist.ts +82 -38
- package/src/data/code-view.ts +296 -44
- package/src/data/comment-thread.ts +611 -86
- package/src/data/compare-view.ts +227 -0
- package/src/data/confirm-dialog.ts +250 -39
- package/src/data/context-menu.ts +95 -21
- package/src/data/d9-limits.ts +2 -0
- package/src/data/d9-util.ts +13 -5
- package/src/data/diff.ts +109 -49
- package/src/data/display-util.ts +9 -4
- package/src/data/dock.ts +38 -18
- package/src/data/embed.ts +143 -8
- package/src/data/engine-ports.ts +135 -0
- package/src/data/field-mapper.ts +116 -54
- package/src/data/file-list.ts +522 -0
- package/src/data/flow-editor.ts +695 -158
- package/src/data/flow-node-options.ts +24 -5
- package/src/data/flow-remote-options.ts +94 -19
- package/src/data/footer.ts +88 -26
- package/src/data/form-draft-registry.ts +183 -12
- package/src/data/gantt.ts +640 -117
- package/src/data/graph-view.ts +51 -0
- package/src/data/heat-calendar.ts +412 -0
- package/src/data/hero.ts +40 -13
- package/src/data/image-viewer.ts +265 -62
- package/src/data/index.ts +75 -6
- package/src/data/item-list.ts +219 -58
- package/src/data/json-view.ts +909 -0
- package/src/data/kanban.ts +346 -91
- package/src/data/kit-contract.ts +230 -0
- package/src/data/leaderboard.ts +343 -0
- package/src/data/level-class.ts +21 -0
- package/src/data/log-stream.ts +347 -0
- package/src/data/markdown-view.ts +597 -0
- package/src/data/matrix.ts +234 -120
- package/src/data/media-grid.ts +165 -38
- package/src/data/mega-menu.ts +43 -26
- package/src/data/menu-bar.ts +254 -0
- package/src/data/menu-dom.ts +55 -19
- package/src/data/menu.ts +138 -48
- package/src/data/mockup.ts +37 -25
- package/src/data/modal-dialog.ts +126 -98
- package/src/data/navbar.ts +152 -66
- package/src/data/notice-list.ts +101 -49
- package/src/data/notify-renderer.ts +80 -15
- package/src/data/object-form.ts +1504 -164
- package/src/data/org-chart.ts +544 -0
- package/src/data/outcome-watch.ts +90 -21
- package/src/data/pager.ts +129 -45
- package/src/data/panel-head.ts +238 -76
- package/src/data/permission-matrix.ts +379 -120
- package/src/data/permission-tree.ts +146 -78
- package/src/data/pricing-table.ts +112 -43
- package/src/data/prompt-dialog.ts +49 -21
- package/src/data/reaction-bar.ts +67 -32
- package/src/data/record-card.ts +245 -72
- package/src/data/record-picker.ts +61 -28
- package/src/data/redirect.ts +39 -15
- package/src/data/request-console.ts +141 -38
- package/src/data/resident.ts +11 -13
- package/src/data/result-panel.ts +65 -27
- package/src/data/rich-text.ts +260 -127
- package/src/data/row-confirm.ts +47 -0
- package/src/data/row-editor.ts +384 -105
- package/src/data/rule-builder.ts +136 -81
- package/src/data/schedule-grid.ts +238 -0
- package/src/data/segment-bar.ts +221 -0
- package/src/data/shape-util.ts +90 -36
- package/src/data/stage-flow.ts +244 -0
- package/src/data/staged-rows.ts +207 -24
- package/src/data/stat-group.ts +493 -100
- package/src/data/static-lazy.ts +21 -0
- package/src/data/static-registry.ts +46 -4
- package/src/data/status-strip.ts +171 -0
- package/src/data/steps.ts +69 -36
- package/src/data/summary-strip.ts +136 -0
- package/src/data/summary-util.ts +116 -0
- package/src/data/survey.ts +134 -47
- package/src/data/system-switcher.ts +53 -24
- package/src/data/target-progress.ts +208 -0
- package/src/data/text-action-button.ts +28 -7
- package/src/data/text-diff.ts +731 -0
- package/src/data/tile-grid.ts +343 -0
- package/src/data/timeline.ts +205 -36
- package/src/data/tour-guide.ts +113 -47
- package/src/data/transfer.ts +204 -47
- package/src/data/tree-table.ts +228 -81
- package/src/data/tree.ts +193 -69
- package/src/data/trend-line.ts +68 -12
- package/src/data/virtual-rows.ts +248 -98
- package/src/data/waterfall.ts +171 -0
- package/src/data/watermark.ts +35 -6
- package/src/data/wrap.ts +28 -6
- package/src/frames/blank-frame.ts +6 -4
- package/src/frames/index.ts +4 -4
- package/src/frames/inherited-shell.ts +219 -0
- package/src/frames/page-bar.ts +208 -28
- package/src/frames/page-status.ts +3 -2
- package/src/frames/resident-components.ts +18 -0
- package/src/frames/shared.ts +73 -26
- package/src/frames/single-frame.ts +20 -4
- package/src/frames/split-frame/shell.ts +27 -17
- package/src/frames/split-frame/wiring.ts +16 -12
- package/src/frames/tabs-frame/shell.ts +14 -7
- package/src/frames/tabs-frame/wiring.ts +2 -1
- package/src/frames/top-main-frame.ts +55 -3
- package/src/frames/types.ts +5 -2
- package/src/frames/workspace-frame/extras.ts +23 -7
- package/src/frames/workspace-frame/index.ts +1 -1
- package/src/frames/workspace-frame/pipeline-key.ts +6 -0
- package/src/frames/workspace-frame/shell.ts +24 -3
- package/src/frames/workspace-frame/state.ts +42 -8
- package/src/frames/workspace-frame/view.ts +773 -194
- package/src/generated/kit-grammar-runtime.ts +1061 -77
- package/src/generated/kit-page.ts +272 -0
- package/src/i18n/index.ts +2 -0
- package/src/i18n/kit-text.ts +210 -5
- package/src/i18n/resolve-text-refs.ts +1 -1
- package/src/object-renderer/action-group.ts +204 -22
- package/src/object-renderer/action-more.ts +66 -19
- package/src/object-renderer/arrange.ts +270 -28
- package/src/object-renderer/category-tone.ts +96 -0
- package/src/object-renderer/collapse-wiring.ts +19 -9
- package/src/object-renderer/collection-expand.ts +3 -3
- package/src/object-renderer/collection-parts.ts +459 -103
- package/src/object-renderer/collection-table.ts +406 -59
- package/src/object-renderer/collection.ts +333 -71
- package/src/object-renderer/compile-data.ts +13 -3
- package/src/object-renderer/defaults.ts +14 -5
- package/src/object-renderer/emit-events.ts +46 -20
- package/src/object-renderer/emit-object.ts +35 -6
- package/src/object-renderer/emit-static.ts +831 -153
- package/src/object-renderer/field-value.ts +12 -239
- package/src/object-renderer/filter-plan.ts +3 -3
- package/src/object-renderer/filter-toolbar.ts +190 -0
- package/src/object-renderer/form-detail.ts +87 -2
- package/src/{compile → object-renderer}/fragment.ts +2 -2
- package/src/object-renderer/index.ts +1 -1
- package/src/object-renderer/key-field.ts +21 -0
- package/src/object-renderer/layout-facts.ts +55 -7
- package/src/object-renderer/layout-plan.ts +6 -3
- package/src/object-renderer/overlay-decide.ts +124 -0
- package/src/object-renderer/pick-component.ts +8 -2
- package/src/object-renderer/pipeline-mode.ts +6 -0
- package/src/object-renderer/relation-field.ts +79 -0
- package/src/object-renderer/render-object.ts +72 -27
- package/src/object-renderer/request-actions.ts +119 -21
- package/src/object-renderer/table-actions.ts +479 -111
- package/src/object-renderer/table-gap.ts +2 -1
- package/src/object-renderer/table-reorder.ts +237 -0
- package/src/object-renderer/table-summary.ts +26 -12
- package/src/object-renderer/table-tools.ts +437 -130
- package/src/object-renderer/types.ts +100 -17
- package/src/object-renderer/value-present.ts +49 -0
- package/src/page-target/ai-surface.ts +15 -22
- package/src/page-target/compile.ts +5 -6
- package/src/page-target/drift.ts +0 -7
- package/src/page-target/intent-schema.ts +46 -43
- package/src/page-target/target.ts +4 -5
- package/src/page-target/writer-policy.ts +4 -5
- package/src/recipes/app-blocks.ts +66 -0
- package/src/recipes/chrome-surface.ts +20 -0
- package/src/recipes/code-view.ts +57 -0
- package/src/recipes/color-role.ts +442 -0
- package/src/recipes/compact-group.ts +32 -0
- package/src/recipes/composition-projector.ts +321 -0
- package/src/recipes/container.ts +93 -26
- package/src/recipes/control.ts +85 -8
- package/src/recipes/desc-list.ts +108 -0
- package/src/recipes/divider.ts +74 -0
- package/src/recipes/emphasis.ts +102 -13
- package/src/recipes/field-text.ts +72 -0
- package/src/recipes/form-section.ts +177 -0
- package/src/recipes/frame-bleed.ts +6 -5
- package/src/recipes/index.ts +39 -5
- package/src/recipes/inherited-shell.ts +43 -0
- package/src/recipes/json-view.ts +50 -0
- package/src/recipes/look.ts +56 -0
- package/src/recipes/mark.ts +138 -0
- package/src/recipes/markdown.ts +96 -0
- package/src/recipes/overlay.ts +151 -37
- package/src/recipes/page-width.ts +51 -0
- package/src/recipes/pipeline-runtime.ts +366 -0
- package/src/recipes/placeholder.ts +38 -20
- package/src/recipes/rail-grid.ts +6 -3
- package/src/recipes/self-owned.ts +59 -0
- package/src/recipes/slot-align.ts +5 -3
- package/src/recipes/stat-state.ts +6 -6
- package/src/recipes/state.ts +64 -11
- package/src/recipes/status.ts +21 -20
- package/src/recipes/strip.ts +114 -0
- package/src/recipes/surface-edge.ts +3 -1
- package/src/recipes/surface.ts +40 -7
- package/src/recipes/table-gap.ts +4 -3
- package/src/recipes/table-native-edit.ts +25 -12
- package/src/recipes/table-row.ts +56 -20
- package/src/recipes/tabs.ts +140 -31
- package/src/recipes/text-diff.ts +97 -0
- package/src/recipes/text-fit.ts +132 -0
- package/src/recipes/title-row.ts +72 -5
- package/src/recipes/typography.ts +2 -2
- package/src/shared/action-func.ts +106 -0
- package/src/shared/color-scheme.ts +127 -0
- package/src/shared/confirm-decl.ts +5 -2
- package/src/shared/danger-facts.ts +55 -0
- package/src/shared/diagnostics.ts +16 -0
- package/src/shared/dom-attrs-registry.ts +1009 -0
- package/src/shared/dom-attrs.ts +743 -0
- package/src/shared/envelope.ts +1 -1
- package/src/shared/field-kind.ts +49 -0
- package/src/shared/field-value-format.ts +292 -0
- package/src/shared/focus-ring.ts +8 -0
- package/src/shared/glyphs.ts +127 -0
- package/src/shared/hints.ts +56 -0
- package/src/{base → shared}/icons.ts +40 -1
- package/src/shared/identifier-field.ts +66 -0
- package/src/shared/kit-error.ts +1 -1
- package/src/shared/list-pager.ts +23 -0
- package/src/shared/list-title.ts +29 -0
- package/src/{object-renderer → shared}/merge-class.ts +3 -2
- package/src/shared/order-value.ts +15 -0
- package/src/shared/page-attrs-runtime.ts +327 -0
- package/src/shared/page-attrs.ts +262 -0
- package/src/shared/path-guard.ts +1 -1
- package/src/shared/pipeline-mode.ts +64 -0
- package/src/shared/primitives-types.ts +8 -0
- package/src/shared/row-key.ts +15 -0
- package/src/shared/theme-runtime-shared.ts +181 -21
- package/src/shared/theme-usage.ts +16 -0
- package/src/shared/value-table-contract.ts +68 -0
- package/src/spatial/action-func.ts +4 -0
- package/src/spatial/declared-actions.ts +116 -0
- package/src/spatial/emit.ts +660 -0
- package/src/spatial/expand.ts +1482 -0
- package/src/spatial/field-types.ts +48 -0
- package/src/spatial/index.ts +82 -0
- package/src/spatial/layout.ts +697 -0
- package/src/spatial/look-apply.ts +206 -0
- package/src/spatial/page-decl.ts +44 -0
- package/src/spatial/page-object.ts +349 -0
- package/src/spatial/recognize.ts +491 -0
- package/src/spatial/self-report.ts +571 -0
- package/src/spatial/shape.ts +205 -0
- package/src/spatial/spatial-map.ts +136 -0
- package/src/spatial/tone.ts +145 -0
- package/src/theme/index.ts +11 -2
- package/src/theme/kit-theme-text.ts +1 -1
- package/src/theme/kit-theme.css +563 -28
- package/src/theme/kit-theme.tpl +527 -28
- package/src/theme/look-carrier.ts +65 -0
- package/src/theme/nine-dim-structure.ts +538 -176
- package/src/theme/private-vars.ts +153 -0
- package/src/theme/surface-layers.ts +12 -3
- package/src/theme/theme-tokens.ts +1602 -90
- package/src/theme/theme-types.ts +38 -59
- package/src/theme/value-table.ts +2379 -0
- 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/frames/list-summary.ts +0 -100
- package/src/recipes/nowrap.ts +0 -16
- package/src/theme/block-theme.ts +0 -202
- /package/src/{base → shared}/class-candidates.ts +0 -0
package/src/data/tree-table.ts
CHANGED
|
@@ -9,55 +9,110 @@
|
|
|
9
9
|
// 懒加载:`tree.childrenFrom` 给了、行带 `tree.hasChildrenField` 真值而子行尚未给出时,首次展开才 GET `api?<param>=<id>`,
|
|
10
10
|
// 响应按 `rows` 路径取子行(失败显示重试符号),已加载的子行在数据刷新后保留。
|
|
11
11
|
// 展开状态只在本组件内流转(归本组件,不进区域切片),数据刷新后保留;新出现的节点按 `defaultExpand` 定初态。
|
|
12
|
-
// 单元格:Text(走格式化 / 选项)与 Tag
|
|
12
|
+
// 单元格:Text(走格式化 / 选项)与 Tag 两种展示,其它 component 退回 Text;值的呈现与虚拟滚动表同一个函数(cell-value.ts,页面线判定优先、否则按选项色调,与普通表格的基础件同口径);
|
|
13
|
+
// 单元格里不挂事件(字段级 action 编译期已丢弃)。
|
|
13
14
|
// 选择 / 行操作 / pickOnRow 与 KitTableActions 同载荷(row_select / row_action);排序由页面上的可排序表头(KitTableHead)负责,与本组件无关。
|
|
14
15
|
// 键盘按 treegrid:↑↓ 走可见行,→ 展开 / 进入首个子行,← 收起 / 回父行,Home / End,Enter / Space 触发行选择(无选择时触发 pickOnRow,再无则开合)。
|
|
15
16
|
// 大数据:可见行数超过 `tree.windowThreshold` 时先画前 N 行,余下由「显示更多」每次追加 windowBatch 行(阈值与批量读设计真源)。
|
|
16
17
|
// 参考老 soma-ui:data-table 的树表(缩进、整体展开 / 收起、接口子项默认折叠的初态规则)、virtual-list 的窗口思路。
|
|
17
18
|
|
|
19
|
+
import { kitApplyLevelClass } from './level-class';
|
|
18
20
|
import type { SomaComponentDefinition } from 'soma-core';
|
|
19
21
|
import { createKeyboardWiring, type CollectionItem } from 'soma-core/keyboard';
|
|
20
22
|
import { SOMA_SIZE_UNITS } from 'soma-foundation/theme';
|
|
21
|
-
import { TAG_CLASS } from '../base/tag';
|
|
22
|
-
import {
|
|
23
|
+
import { DOT_CORE, DOT_RING, DOT_ROOT, DOT_TEXT, DOT_WRAP, TAG_CLASS } from '../base/tag';
|
|
24
|
+
import { COPY_BTN_CLASS, COPY_TEXT_CLASS, setKitCopyButton } from '../base/text';
|
|
25
|
+
import { KIT_TAG_UNKNOWN_DOT_CORE, KIT_TAG_UNKNOWN_SOFT } from '../recipes/status';
|
|
26
|
+
import { permissionCheckerOf, registerLivePermissionGate } from '../base/permission-gate';
|
|
23
27
|
import { KIT_CHECK_CLASS_CANDIDATES, attachMarkEvents, createCheck, setMarkLabel } from '../base/check-core';
|
|
24
|
-
import { CLASS_PROP, bool, createKitController,
|
|
28
|
+
import { CLASS_PROP, bool, createKitController, joinClass, str, type KitSize } from '../base/shared';
|
|
29
|
+
import { kitRowKey } from '../shared/row-key';
|
|
30
|
+
import { KIT_CELL_VALUE_CLASS_CANDIDATES, kitCellValueNode, kitCellValuePlan, type KitCellValuePlan } from './cell-value';
|
|
25
31
|
import { kitLocaleAt, kitText } from '../i18n/kit-text';
|
|
26
32
|
import { setKitFace } from '../recipes';
|
|
33
|
+
import { KIT_FOCUS_RING } from '../recipes/state';
|
|
27
34
|
import { kitEmphasisButtonRecipe } from '../recipes/emphasis';
|
|
28
|
-
import { kitIcon } from '../
|
|
35
|
+
import { kitIcon } from '../shared/icons';
|
|
29
36
|
import { KIT_TREE_TABLE } from '../object-renderer/defaults';
|
|
30
37
|
import { KIT_PART_TABLE_ROW } from '../recipes/table-row';
|
|
38
|
+
import { kitStripBoundaryClasses } from '../recipes/divider';
|
|
31
39
|
import { ROW_ACTION_BUTTON_CLASS, rowActionRanks, rowBusyName, removeKeyOf } from '../object-renderer/table-actions';
|
|
32
40
|
import { KIT_ROW_TONE_CLASS, rowToneClass } from '../object-renderer/view-binding';
|
|
33
41
|
import { isKitActionBusy, onKitActionBusy } from '../base/action-busy';
|
|
34
42
|
import { provideCtxRows } from './context-menu';
|
|
35
43
|
import { KIT_ACTION_SLOT_BASE, actionSlotEmits, emitActionSlot } from '../base/action-slots';
|
|
36
|
-
import { unwrapEnvelope,
|
|
44
|
+
import { unwrapEnvelope, getKitAppEnvelope } from '../shared/envelope';
|
|
45
|
+
import {
|
|
46
|
+
KIT_ATTR_ACT, KIT_ATTR_ACTION, KIT_ATTR_COL, KIT_ATTR_COPIED_LABEL, KIT_ATTR_COPY_LABEL, KIT_ATTR_COPY_VALUE, KIT_ATTR_GRID,
|
|
47
|
+
KIT_ATTR_KEY, KIT_ATTR_MARK, KIT_ATTR_MORE, KIT_ATTR_PART, KIT_ATTR_ROW, KIT_ATTR_SEL, KIT_ATTR_SELECTED, KIT_ATTR_TOGGLE, KIT_ATTR_TREE_CTL,
|
|
48
|
+
KIT_ATTR_TREE_FOR, KIT_ATTR_TREE_OF, kitAttrSel,
|
|
49
|
+
} from '../shared/dom-attrs';
|
|
50
|
+
import {
|
|
51
|
+
kitActionPropsOf, kitFieldPropsOf, kitHasOwnAlign, kitHasOwnOverflow, kitMarkDataFacts, kitMarkLevel, kitMarkPart, kitMarkPicked, kitMergeAlignOverflow,
|
|
52
|
+
type KitRuntimeProps,
|
|
53
|
+
} from './kit-contract';
|
|
54
|
+
import { createKitRowConfirm } from './row-confirm';
|
|
55
|
+
import { mergeClass } from '../shared/merge-class';
|
|
37
56
|
|
|
38
57
|
// ── 类串表(整串字面量;候选类汇总在底部) ──
|
|
39
58
|
|
|
40
|
-
const ROOT_CLASS = 'flex flex-col';
|
|
41
|
-
const GRID_CLASS = 'flex flex-col';
|
|
42
|
-
const INDENT_CELL_CLASS = 'flex min-w-0 items-center gap-1';
|
|
43
|
-
const
|
|
44
|
-
|
|
59
|
+
const ROOT_CLASS = 'flex w-full min-w-0 flex-col';
|
|
60
|
+
const GRID_CLASS = 'flex w-full min-w-0 flex-col';
|
|
61
|
+
const INDENT_CELL_CLASS = 'flex min-w-0 items-center gap-1.5';
|
|
62
|
+
const INLINE_FLEX_RE = /(?:^|\s)inline-flex(?=\s|$)/;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* 格类串里在缺省尺寸下生效的文本对齐方向(D-11):「算不算自己的对齐类」与 base/kit-contract.ts#kitHasOwnAlign 同一判据——
|
|
66
|
+
* 只认不带响应式断点前缀的类(保留 `**:` 子代通配前缀),`md:text-end` / `@max-md:text-center` 不算(小屏不该被补 ms-auto / flex-1)。
|
|
67
|
+
* 逐个类判,最后一个为准;text-right 按止端、text-left / start / justify 按起始,与改前的取向一致。没有返回 undefined。
|
|
68
|
+
*/
|
|
69
|
+
function ownAlignOf(cls: string): 'start' | 'center' | 'end' | undefined {
|
|
70
|
+
let dir: 'start' | 'center' | 'end' | undefined;
|
|
71
|
+
for (const token of cls.split(/\s+/)) {
|
|
72
|
+
if (token === '' || !kitHasOwnAlign(token)) continue;
|
|
73
|
+
const word = token.slice(token.lastIndexOf('text-') + 'text-'.length);
|
|
74
|
+
dir = word === 'center' ? 'center' : word === 'end' || word === 'right' ? 'end' : 'start';
|
|
75
|
+
}
|
|
76
|
+
return dir;
|
|
77
|
+
}
|
|
78
|
+
const SPACER_CLASS = 'inline-flex size-5 shrink-0 items-center justify-center';
|
|
79
|
+
const TOGGLE_CLASS = 'hit-area inline-flex h-5 w-5 shrink-0 p-0 cursor-pointer items-center justify-center rounded-item text-fg-muted transition-colors hover:bg-state-layer-hover active:bg-state-layer-press hover:text-fg ' + KIT_FOCUS_RING.item;
|
|
45
80
|
// 单元格文字:块级 + min-w-0 + 单行省略(长 ID 不再压到相邻列);被截断时悬停出全文提示(表壳带 data-kit-tips,由 base/hint-tips 按需挂)
|
|
46
81
|
const TEXT_CLASS = 'block min-w-0 truncate text-sm text-fg';
|
|
82
|
+
const CELL_TEXT_SIZE_CLASS: Readonly<Record<KitSize, string>> = Object.freeze({
|
|
83
|
+
sm: 'block min-w-0 truncate text-xs text-fg',
|
|
84
|
+
md: TEXT_CLASS,
|
|
85
|
+
lg: 'block min-w-0 truncate text-base text-fg',
|
|
86
|
+
});
|
|
87
|
+
const CELL_TEXT_BASE_SIZE_CLASS: Readonly<Record<KitSize, string>> = Object.freeze({
|
|
88
|
+
sm: 'block min-w-0 text-xs text-fg',
|
|
89
|
+
md: 'block min-w-0 text-sm text-fg',
|
|
90
|
+
lg: 'block min-w-0 text-base text-fg',
|
|
91
|
+
});
|
|
92
|
+
const CELL_COPY_ROOT_CLASS: Readonly<Record<KitSize, string>> = Object.freeze({
|
|
93
|
+
sm: 'inline-flex max-w-full min-w-0 items-center gap-2 whitespace-nowrap text-xs text-fg',
|
|
94
|
+
md: 'inline-flex max-w-full min-w-0 items-center gap-2 whitespace-nowrap text-sm text-fg',
|
|
95
|
+
lg: 'inline-flex max-w-full min-w-0 items-center gap-2 whitespace-nowrap text-base text-fg',
|
|
96
|
+
});
|
|
47
97
|
const ACTIONS_CELL_CLASS = 'flex flex-nowrap items-center justify-end gap-x-4 whitespace-nowrap';
|
|
48
98
|
const MORE_WRAP_CLASS = 'flex items-center justify-center px-4 py-3';
|
|
49
99
|
const MORE_BUTTON_CLASS = kitEmphasisButtonRecipe('button.toolbar');
|
|
50
|
-
const
|
|
100
|
+
const ROW_IDLE_CLASS = 'transition-colors hover:bg-state-layer-row-hover ' + KIT_FOCUS_RING.item;
|
|
101
|
+
const ROW_FOCUS_CLASS = 'cursor-pointer transition-colors hover:bg-state-layer-row-hover ' + KIT_FOCUS_RING.item;
|
|
51
102
|
|
|
52
103
|
/** 工具位链接的原始类串(显隐切类名时据此还原) */
|
|
53
104
|
const CONTROL_CLASS = new WeakMap<HTMLElement, string>();
|
|
54
105
|
|
|
55
106
|
export const KIT_TREE_TABLE_CLASS_CANDIDATES: readonly string[] = Object.freeze([...new Set([
|
|
56
|
-
ROOT_CLASS, GRID_CLASS, INDENT_CELL_CLASS, SPACER_CLASS, TOGGLE_CLASS, TEXT_CLASS,
|
|
57
|
-
...
|
|
107
|
+
ROOT_CLASS, GRID_CLASS, INDENT_CELL_CLASS, 'flex-1', 'ms-auto', 'mx-auto', SPACER_CLASS, TOGGLE_CLASS, TEXT_CLASS,
|
|
108
|
+
...Object.values(CELL_TEXT_SIZE_CLASS), ...Object.values(CELL_COPY_ROOT_CLASS), COPY_TEXT_CLASS, COPY_BTN_CLASS,
|
|
109
|
+
...KIT_CHECK_CLASS_CANDIDATES, ACTIONS_CELL_CLASS, MORE_WRAP_CLASS, MORE_BUTTON_CLASS, ROW_IDLE_CLASS, ROW_FOCUS_CLASS,
|
|
58
110
|
...Object.values(ROW_ACTION_BUTTON_CLASS),
|
|
59
|
-
...Object.values(TAG_CLASS.
|
|
111
|
+
...Object.values(TAG_CLASS).flatMap((m) => Object.values(m)),
|
|
112
|
+
...Object.values(DOT_ROOT), ...Object.values(DOT_TEXT), ...Object.values(DOT_WRAP), ...Object.values(DOT_CORE), ...Object.values(DOT_RING),
|
|
113
|
+
...Object.values(KIT_TAG_UNKNOWN_SOFT), KIT_TAG_UNKNOWN_DOT_CORE,
|
|
60
114
|
...Object.values(KIT_ROW_TONE_CLASS),
|
|
115
|
+
...KIT_CELL_VALUE_CLASS_CANDIDATES,
|
|
61
116
|
].flatMap((s) => s.split(/\s+/).filter((c) => c !== '')))].sort());
|
|
62
117
|
|
|
63
118
|
// ── 数据规整纯函数:建树 / 可见行 / 初态 / 列与行操作解析 ──
|
|
@@ -256,17 +311,9 @@ function actionsOf(raw: unknown): ActionItem[] {
|
|
|
256
311
|
return out;
|
|
257
312
|
}
|
|
258
313
|
|
|
314
|
+
/** bordered: false 剥边界类:只经分隔线出口的剥离函数(KT-B8 第 4 点,一个决定一个出口) */
|
|
259
315
|
function stripBorderClasses(cls: string): string {
|
|
260
|
-
return cls
|
|
261
|
-
.split(/\s+/)
|
|
262
|
-
.filter((t) => t !== '' && t !== 'border' && t !== 'border-b' && t !== 'border-e' && t !== 'not-last:border-e' && !t.startsWith('border-border') && !t.startsWith('not-last:border-border'))
|
|
263
|
-
.join(' ');
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
function rowKeyOf(row: unknown, keyField: string): string {
|
|
267
|
-
if (!isRec(row)) return '';
|
|
268
|
-
const v = row[keyField];
|
|
269
|
-
return keyField !== '' && v !== undefined && v !== null ? String(v) : JSON.stringify(row);
|
|
316
|
+
return kitStripBoundaryClasses(cls);
|
|
270
317
|
}
|
|
271
318
|
|
|
272
319
|
function pickPath(data: unknown, path: string): unknown {
|
|
@@ -343,7 +390,13 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
343
390
|
templateHtml: `<div data-soma-id="root" class="${ROOT_CLASS}"></div>`,
|
|
344
391
|
controllerFactory: createKitController((api) => {
|
|
345
392
|
const P = (): Rec => api.props();
|
|
346
|
-
|
|
393
|
+
let renderedPerm = '';
|
|
394
|
+
const permStateOf = (p: Rec): string => {
|
|
395
|
+
const list = actionsOf(p.actions);
|
|
396
|
+
if (!list.some((a) => a.permission !== '')) return '';
|
|
397
|
+
const check = permissionCheckerOf(api as unknown as any);
|
|
398
|
+
return list.map((a) => (a.permission !== '' && check !== null ? (check(a.permission) ? '1' : '0') : '-')).join('');
|
|
399
|
+
};
|
|
347
400
|
let root: HTMLElement | null = null;
|
|
348
401
|
let alive = false;
|
|
349
402
|
let forest: TreeNode[] = [];
|
|
@@ -356,6 +409,7 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
356
409
|
let cursor: string | null = null;
|
|
357
410
|
let limit = 0;
|
|
358
411
|
let sig = '';
|
|
412
|
+
let dataSeq = 0;
|
|
359
413
|
let offs: Array<() => void> = [];
|
|
360
414
|
|
|
361
415
|
const cfg = (): TreeCfg => treeCfgOf(P().tree);
|
|
@@ -379,9 +433,10 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
379
433
|
const sync = (): void => {
|
|
380
434
|
const p = P();
|
|
381
435
|
let next: string;
|
|
382
|
-
try { next = JSON.stringify([p.rows, p.tree]); } catch { next = `x${
|
|
436
|
+
try { next = JSON.stringify([p.rows, p.tree]); } catch { next = `x${++dataSeq}`; }
|
|
383
437
|
if (next !== sig) {
|
|
384
438
|
sig = next;
|
|
439
|
+
dataSeq += 1;
|
|
385
440
|
rebuild();
|
|
386
441
|
limit = 0;
|
|
387
442
|
}
|
|
@@ -402,16 +457,17 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
402
457
|
return el;
|
|
403
458
|
};
|
|
404
459
|
|
|
405
|
-
const rowEls = (): HTMLElement[] => (root ? Array.from(root.querySelectorAll<HTMLElement>(
|
|
460
|
+
const rowEls = (): HTMLElement[] => (root ? Array.from(root.querySelectorAll<HTMLElement>(kitAttrSel(KIT_ATTR_KEY))) : []);
|
|
406
461
|
const focusCursor = (): void => {
|
|
407
462
|
if (cursor === null) return;
|
|
408
|
-
rowEls().find((e) => e.getAttribute(
|
|
463
|
+
rowEls().find((e) => e.getAttribute(KIT_ATTR_KEY) === cursor)?.focus();
|
|
409
464
|
};
|
|
410
465
|
|
|
411
466
|
const loadChildren = async (node: TreeNode): Promise<void> => {
|
|
412
467
|
const from = cfg().childrenFrom;
|
|
413
468
|
const http = (api.services as { http?: HttpPort } | undefined)?.http;
|
|
414
469
|
if (!from || !http || loading.has(node.key)) return;
|
|
470
|
+
const reqSeq = dataSeq;
|
|
415
471
|
loading.add(node.key);
|
|
416
472
|
failed.delete(node.key);
|
|
417
473
|
paint();
|
|
@@ -420,9 +476,13 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
420
476
|
const baseURL = typeof rawBase === 'string' ? rawBase.replace(/\/+$/, '') : '/api';
|
|
421
477
|
const apiPath = baseURL && baseURL !== '/' && from.api.startsWith(`${baseURL}/`) ? from.api.slice(baseURL.length) : from.api;
|
|
422
478
|
const res = await http.get<unknown>(apiPath, { params: { [from.param]: node.key } });
|
|
479
|
+
if (!alive || reqSeq !== dataSeq || !byKey.has(node.key)) return;
|
|
423
480
|
const env = getKitAppEnvelope(api.host);
|
|
424
481
|
const unwrapped = unwrapEnvelope(res, env);
|
|
425
|
-
if (!unwrapped.ok)
|
|
482
|
+
if (!unwrapped.ok) {
|
|
483
|
+
failed.add(node.key);
|
|
484
|
+
return;
|
|
485
|
+
}
|
|
426
486
|
const payload = unwrapped.data;
|
|
427
487
|
let list: unknown;
|
|
428
488
|
if (Array.isArray(payload)) {
|
|
@@ -443,10 +503,10 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
443
503
|
rebuild();
|
|
444
504
|
open.add(node.key);
|
|
445
505
|
} catch {
|
|
446
|
-
failed.add(node.key);
|
|
506
|
+
if (alive && reqSeq === dataSeq) failed.add(node.key);
|
|
447
507
|
} finally {
|
|
448
508
|
loading.delete(node.key);
|
|
449
|
-
if (alive) paint();
|
|
509
|
+
if (alive && reqSeq === dataSeq) paint();
|
|
450
510
|
}
|
|
451
511
|
};
|
|
452
512
|
|
|
@@ -491,11 +551,13 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
491
551
|
if (rowBusy(row)) return; // 删除在途:不抛行点击
|
|
492
552
|
api.emit('row_pick', { kit_action: 'select', id: 'select', name: '', builtin: 'select', target: '', row, ...objectPayload() });
|
|
493
553
|
};
|
|
494
|
-
const
|
|
554
|
+
const selectedSetOf = (): Set<string> => {
|
|
495
555
|
const sel = P().selected;
|
|
496
556
|
const kf = str(P().keyField);
|
|
497
|
-
|
|
557
|
+
if (!Array.isArray(sel) || sel.length === 0) return new Set();
|
|
558
|
+
return new Set(sel.map((r) => kitRowKey(r, kf)));
|
|
498
559
|
};
|
|
560
|
+
const isPicked = (row: Rec): boolean => selectedSetOf().has(kitRowKey(row, str(P().keyField)));
|
|
499
561
|
|
|
500
562
|
const activate = (key: string): void => {
|
|
501
563
|
const node = byKey.get(key);
|
|
@@ -520,24 +582,40 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
520
582
|
onCollapse: (key) => setOpen(key, false),
|
|
521
583
|
});
|
|
522
584
|
|
|
523
|
-
|
|
524
|
-
const
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
if (
|
|
528
|
-
|
|
529
|
-
|
|
585
|
+
// 值呈现:与虚拟滚动表同一个函数(data/cell-value.ts),按列算一次计划,每次重绘清空
|
|
586
|
+
const valuePlans = new Map<CellDef, KitCellValuePlan>();
|
|
587
|
+
const planOf = (cell: CellDef, fk: KitRuntimeProps): KitCellValuePlan => {
|
|
588
|
+
let plan = valuePlans.get(cell);
|
|
589
|
+
if (plan === undefined) {
|
|
590
|
+
plan = kitCellValuePlan(cell, fk, api.host, kitLocaleAt(api.host) || 'zh-CN');
|
|
591
|
+
valuePlans.set(cell, plan);
|
|
530
592
|
}
|
|
531
|
-
return
|
|
593
|
+
return plan;
|
|
594
|
+
};
|
|
595
|
+
|
|
596
|
+
/** 单元格内容:Tag 与 Text 的呈现都在 kitCellValueNode(与普通表格的基础件同口径;有页面线判定按判定,没有按选项色调) */
|
|
597
|
+
const cellContent = (cell: CellDef, row: Rec, baseCellClass: string, fk: KitRuntimeProps): HTMLElement => {
|
|
598
|
+
const plan = planOf(cell, fk);
|
|
599
|
+
const size = plan.size;
|
|
600
|
+
const ownValOverflow = kitHasOwnOverflow(cell.valueClass);
|
|
601
|
+
const ownCellOverflow = kitHasOwnOverflow(baseCellClass);
|
|
602
|
+
const textCls = ownValOverflow
|
|
603
|
+
? joinClass(CELL_TEXT_BASE_SIZE_CLASS[size], cell.valueClass)
|
|
604
|
+
: ownCellOverflow
|
|
605
|
+
? joinClass(/(?:^|\s)(?:[a-z0-9*@[\]=_/.-]+:)*truncate(?=\s|$)/.test(baseCellClass) ? CELL_TEXT_SIZE_CLASS[size] : CELL_TEXT_BASE_SIZE_CLASS[size], cell.valueClass)
|
|
606
|
+
: fk.overflow !== undefined && fk.overflow !== 'truncate' && fk.overflow !== 'middle'
|
|
607
|
+
? joinClass(kitMergeAlignOverflow(CELL_TEXT_BASE_SIZE_CLASS[size], undefined, fk.overflow), cell.valueClass)
|
|
608
|
+
: joinClass(CELL_TEXT_SIZE_CLASS[size], cell.valueClass);
|
|
609
|
+
return kitCellValueNode({ doc: doc(), host: api.host, copy: true }, plan, row[cell.field], textCls);
|
|
532
610
|
};
|
|
533
611
|
|
|
534
612
|
// ── 表格工具位里的「全部展开 / 全部收起」(页面编译放的静态链接,按对象名认领;本组件只接线与显隐)
|
|
535
|
-
const treeName = (): string => root?.closest<HTMLElement>(
|
|
613
|
+
const treeName = (): string => root?.closest<HTMLElement>(kitAttrSel(KIT_ATTR_TREE_OF))?.getAttribute(KIT_ATTR_TREE_OF) ?? '';
|
|
536
614
|
const controls = (): HTMLElement[] => {
|
|
537
615
|
const name = treeName();
|
|
538
616
|
const d = root?.ownerDocument;
|
|
539
617
|
if (d === undefined || name === '') return [];
|
|
540
|
-
return Array.from(d.querySelectorAll<HTMLElement>(
|
|
618
|
+
return Array.from(d.querySelectorAll<HTMLElement>(kitAttrSel(KIT_ATTR_TREE_CTL))).filter((el) => el.getAttribute(KIT_ATTR_TREE_FOR) === name);
|
|
541
619
|
};
|
|
542
620
|
function syncTreeControls(anyBranch: boolean): void {
|
|
543
621
|
for (const el of controls()) {
|
|
@@ -547,9 +625,9 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
547
625
|
}
|
|
548
626
|
}
|
|
549
627
|
const onControl = (event: Event): void => {
|
|
550
|
-
const t = (event.target as HTMLElement | null)?.closest<HTMLElement>(
|
|
551
|
-
if (t === null || t.getAttribute(
|
|
552
|
-
if (t.getAttribute(
|
|
628
|
+
const t = (event.target as HTMLElement | null)?.closest<HTMLElement>(kitAttrSel(KIT_ATTR_TREE_CTL)) ?? null;
|
|
629
|
+
if (t === null || t.getAttribute(KIT_ATTR_TREE_FOR) !== treeName()) return;
|
|
630
|
+
if (t.getAttribute(KIT_ATTR_TREE_CTL) === 'expand') {
|
|
553
631
|
for (const n of byKey.values()) if (n.children.length > 0) open.add(n.key);
|
|
554
632
|
} else open.clear();
|
|
555
633
|
paint();
|
|
@@ -564,6 +642,9 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
564
642
|
const all = visible();
|
|
565
643
|
root.className = joinClass(ROOT_CLASS, p.class);
|
|
566
644
|
root.replaceChildren();
|
|
645
|
+
valuePlans.clear();
|
|
646
|
+
// 数据状态自报:空树记「内容全空」(加载 / 出错由同页的集合三态面板承载,本组件只知道有没有行)
|
|
647
|
+
kitMarkDataFacts(root, { empty: list.length === 0 });
|
|
567
648
|
|
|
568
649
|
// 「全部展开 / 全部收起」不在表体里:由页面编译放进表格工具位(与刷新同一行),这里只按有没有可展开的节点显隐那两个链接
|
|
569
650
|
syncTreeControls(flattenTree(forest).some((n) => n.children.length > 0 || n.lazy));
|
|
@@ -571,25 +652,33 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
571
652
|
const grid = mk('div', GRID_CLASS);
|
|
572
653
|
grid.setAttribute('role', 'treegrid');
|
|
573
654
|
grid.setAttribute('aria-multiselectable', str(p.select) === 'multi' ? 'true' : 'false');
|
|
574
|
-
const
|
|
655
|
+
const listKeys = new Set(list.map((n) => n.key));
|
|
656
|
+
const tabbable = cursor !== null && listKeys.has(cursor) ? cursor : (list[0]?.key ?? null);
|
|
575
657
|
const cols = cells();
|
|
576
658
|
// 显式 bordered: true 的完整网格表(页面编译给每列单元格写了列间竖分隔线 not-last:border-e):外壳与本组件宿主都标 data-kit-grid,
|
|
577
659
|
// 主题结构 CSS 不对它去卡片外观;契约里 bordered 缺省是 true,不能拿它判「显式」,所以看编译产出的列类
|
|
578
660
|
const gridTable = p.bordered !== false && cols.some((col) => /(?:^|\s)not-last:border-e(?:\s|$)/.test(col.cellClass));
|
|
579
661
|
const gridHost = root.closest('[data-soma-component]');
|
|
580
662
|
if (gridTable) {
|
|
581
|
-
root.setAttribute(
|
|
582
|
-
gridHost?.setAttribute(
|
|
663
|
+
root.setAttribute(KIT_ATTR_GRID, '');
|
|
664
|
+
gridHost?.setAttribute(KIT_ATTR_GRID, '');
|
|
583
665
|
} else {
|
|
584
|
-
root.removeAttribute(
|
|
585
|
-
gridHost?.removeAttribute(
|
|
666
|
+
root.removeAttribute(KIT_ATTR_GRID);
|
|
667
|
+
gridHost?.removeAttribute(KIT_ATTR_GRID);
|
|
586
668
|
}
|
|
587
669
|
const mode = str(p.select, 'none');
|
|
670
|
+
const kf = str(p.keyField);
|
|
671
|
+
const selectedSet = Array.isArray(p.selected) && p.selected.length > 0
|
|
672
|
+
? new Set(p.selected.map((r) => kitRowKey(r, kf)))
|
|
673
|
+
: null;
|
|
674
|
+
const check = permissionCheckerOf(api as unknown as any);
|
|
675
|
+
renderedPerm = permStateOf(p);
|
|
588
676
|
const actions = actionsOf(p.actions).filter((a) => a.permission === '' || check === null || check(a.permission));
|
|
589
|
-
const
|
|
590
|
-
|
|
677
|
+
const rowBaseCls = [str(p.rowClass), str(p.stripeClass)].filter((s) => s !== '').join(' ');
|
|
678
|
+
const rowCls = mergeClass(rowBaseCls, bool(p.pickOnRow) ? ROW_FOCUS_CLASS : ROW_IDLE_CLASS);
|
|
591
679
|
const toneField = str(p.rowToneField);
|
|
592
|
-
for (
|
|
680
|
+
for (let rowIdx = 0; rowIdx < list.length; rowIdx += 1) {
|
|
681
|
+
const n = list[rowIdx]!;
|
|
593
682
|
const branch = n.children.length > 0 || n.lazy;
|
|
594
683
|
const isOpen = n.children.length > 0 && open.has(n.key);
|
|
595
684
|
// 行样式档位:每次 paint 都 replaceChildren 重建行元素,类串每行现算,无旧档位残留
|
|
@@ -597,18 +686,22 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
597
686
|
const row = mk('div', toneCls === '' ? rowCls : `${rowCls} ${toneCls}`);
|
|
598
687
|
row.setAttribute('role', 'row');
|
|
599
688
|
// 与普通表格行同一部件标记:主题的最小行高令牌(含边线正好 44,随密度档)、行分隔线、斑马纹规则都靠它命中
|
|
600
|
-
row.setAttribute(
|
|
601
|
-
|
|
602
|
-
row
|
|
689
|
+
row.setAttribute(KIT_ATTR_PART, KIT_PART_TABLE_ROW);
|
|
690
|
+
// 行 = 条目;元素部件位已被存量的 table-row 占用(主题行高 / 分隔线规则按它命中),kitMarkLevel 不覆盖它
|
|
691
|
+
kitMarkLevel(row, 'item', 'line'); kitApplyLevelClass(row);
|
|
692
|
+
row.setAttribute(KIT_ATTR_ROW, '');
|
|
693
|
+
row.setAttribute(KIT_ATTR_KEY, n.key);
|
|
603
694
|
row.setAttribute('aria-level', String(n.level + 1));
|
|
604
|
-
row.setAttribute('aria-posinset', String(
|
|
695
|
+
row.setAttribute('aria-posinset', String(rowIdx + 1));
|
|
605
696
|
row.setAttribute('aria-setsize', String(all.length));
|
|
606
697
|
if (branch) row.setAttribute('aria-expanded', isOpen ? 'true' : 'false');
|
|
607
698
|
row.tabIndex = n.key === tabbable ? 0 : -1;
|
|
608
|
-
const picked =
|
|
699
|
+
const picked = selectedSet !== null && selectedSet.has(kitRowKey(n.row, kf));
|
|
609
700
|
const busy = rowBusy(n.row);
|
|
610
701
|
if (mode !== 'none') row.setAttribute('aria-selected', picked ? 'true' : 'false');
|
|
611
|
-
if (picked) row.setAttribute(
|
|
702
|
+
if (picked) row.setAttribute(KIT_ATTR_SELECTED, '');
|
|
703
|
+
// 选中行自报交互状态;aria-selected 上一行已按选择模式写(无选择模式时 treegrid 行不该带 aria-selected,所以传 null)
|
|
704
|
+
if (picked) kitMarkPicked(row, 'selected', true, null);
|
|
612
705
|
if (busy) row.setAttribute('aria-busy', 'true');
|
|
613
706
|
|
|
614
707
|
if (mode === 'single' || mode === 'multi') {
|
|
@@ -616,16 +709,21 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
616
709
|
const cell = mk('div', selectClass);
|
|
617
710
|
cell.setAttribute('role', 'gridcell');
|
|
618
711
|
const box = createCheck(doc(), mode === 'single' ? 'radio' : 'checkbox', { checked: picked, ...(busy ? { disabled: true } : {}) });
|
|
619
|
-
box.setAttribute(
|
|
712
|
+
box.setAttribute(KIT_ATTR_SEL, '');
|
|
620
713
|
setMarkLabel(box, kitText('soma.kit.select_row_of', { key: n.key }, api.host));
|
|
621
714
|
cell.appendChild(box);
|
|
622
715
|
row.appendChild(cell);
|
|
623
716
|
}
|
|
624
717
|
cols.forEach((col) => {
|
|
625
|
-
const
|
|
718
|
+
const baseCellClass = p.bordered === false ? stripBorderClasses(col.cellClass) : col.cellClass;
|
|
719
|
+
// 字段级判定(页面线的布局 / 定形 / 配色写的 align / overflow):自有类优先(仅在缺失维度时补齐),尊重列 ellipsis: false 与显式对齐
|
|
720
|
+
const fk = kitFieldPropsOf(p, col.field);
|
|
721
|
+
const cellClass = kitMergeAlignOverflow(baseCellClass, fk.align, kitHasOwnOverflow(col.valueClass) ? undefined : fk.overflow);
|
|
626
722
|
const cell = mk('div', cellClass);
|
|
627
723
|
cell.setAttribute('role', 'gridcell');
|
|
628
|
-
|
|
724
|
+
cell.setAttribute(KIT_ATTR_COL, col.field);
|
|
725
|
+
kitMarkPart(cell, 'cell');
|
|
726
|
+
const content = cellContent(col, n.row, baseCellClass, fk);
|
|
629
727
|
if (col.field === c.indentField) {
|
|
630
728
|
const wrap = mk('div', INDENT_CELL_CLASS);
|
|
631
729
|
for (let i = 0; i < n.level; i++) {
|
|
@@ -637,7 +735,7 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
637
735
|
const tg = mk('button', TOGGLE_CLASS, '');
|
|
638
736
|
tg.appendChild(loading.has(n.key) ? kitIcon('loading', 'sm') : failed.has(n.key) ? kitIcon('refresh', 'sm') : kitIcon(isOpen ? 'chevron-down' : 'chevron-right', 'sm', 'rtl:-scale-x-100'));
|
|
639
737
|
tg.setAttribute('type', 'button');
|
|
640
|
-
tg.setAttribute(
|
|
738
|
+
tg.setAttribute(KIT_ATTR_TOGGLE, '');
|
|
641
739
|
tg.tabIndex = -1;
|
|
642
740
|
tg.setAttribute('aria-label', failed.has(n.key) ? str(p.retryLabel, kitText('soma.kit.retry_load', undefined, api.host)) : isOpen ? kitText('soma.kit.collapse', undefined, api.host) : kitText('soma.kit.expand', undefined, api.host));
|
|
643
741
|
wrap.appendChild(tg);
|
|
@@ -646,6 +744,13 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
646
744
|
sp.setAttribute('aria-hidden', 'true');
|
|
647
745
|
wrap.appendChild(sp);
|
|
648
746
|
}
|
|
747
|
+
const align = ownAlignOf(cellClass);
|
|
748
|
+
if (align === 'center' || align === 'end') {
|
|
749
|
+
content.className = joinClass(
|
|
750
|
+
content.className,
|
|
751
|
+
INLINE_FLEX_RE.test(content.className) ? (align === 'end' ? 'ms-auto' : 'mx-auto') : 'flex-1',
|
|
752
|
+
);
|
|
753
|
+
}
|
|
649
754
|
wrap.appendChild(content);
|
|
650
755
|
cell.appendChild(wrap);
|
|
651
756
|
} else {
|
|
@@ -656,13 +761,18 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
656
761
|
if (actions.length > 0) {
|
|
657
762
|
const cell = mk('div', str(p.actionsClass));
|
|
658
763
|
cell.setAttribute('role', 'gridcell');
|
|
764
|
+
kitMarkPart(cell, 'cell');
|
|
659
765
|
const box = mk('div', ACTIONS_CELL_CLASS);
|
|
660
766
|
const ranks = rowActionRanks(actions);
|
|
661
767
|
for (const [at, a] of actions.entries()) {
|
|
662
|
-
|
|
768
|
+
// 动作级判定的语义色调(配色写):只升不降——页面线判危险时升为危险档,否则保持动作自己的 tone 推的档
|
|
769
|
+
// (页面线对常规动作也写色调 none,不能把作者声明的危险档降成普通档,SCON-128 B4;与 object-renderer/table-actions 的行操作件一致)
|
|
770
|
+
const rank = kitActionPropsOf(p, a.id).tone === 'danger' ? 'danger' : ranks[at]!;
|
|
771
|
+
const btn = mk('button', ROW_ACTION_BUTTON_CLASS[rank], a.name) as HTMLButtonElement;
|
|
663
772
|
btn.setAttribute('type', 'button');
|
|
773
|
+
kitMarkPart(btn, 'action');
|
|
664
774
|
// 行动作:文字链接形态(无面,不标 raised)
|
|
665
|
-
btn.setAttribute(
|
|
775
|
+
btn.setAttribute(KIT_ATTR_ACT, a.id);
|
|
666
776
|
if (busy) {
|
|
667
777
|
btn.disabled = true;
|
|
668
778
|
btn.setAttribute('aria-disabled', 'true');
|
|
@@ -678,10 +788,12 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
678
788
|
|
|
679
789
|
if (all.length > list.length) {
|
|
680
790
|
const wrap = mk('div', MORE_WRAP_CLASS);
|
|
791
|
+
// 「显示更多」尾行 = 集合的底部工具行
|
|
792
|
+
kitMarkLevel(wrap, 'foot'); kitApplyLevelClass(wrap);
|
|
681
793
|
const more = mk('button', MORE_BUTTON_CLASS, kitText('soma.kit.more_rows', { label: str(p.moreLabel, kitText('soma.kit.show_more', undefined, api.host)), n: all.length - list.length }, api.host));
|
|
682
794
|
more.setAttribute('type', 'button');
|
|
683
795
|
setKitFace(more, 'raised');
|
|
684
|
-
more.setAttribute(
|
|
796
|
+
more.setAttribute(KIT_ATTR_MORE, '');
|
|
685
797
|
wrap.appendChild(more);
|
|
686
798
|
root.appendChild(wrap);
|
|
687
799
|
}
|
|
@@ -693,49 +805,75 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
693
805
|
root = rootEl;
|
|
694
806
|
alive = true;
|
|
695
807
|
const r = root;
|
|
808
|
+
const copyTimers = new Map<HTMLElement, ReturnType<typeof setTimeout>>();
|
|
809
|
+
const rowConfirm = createKitRowConfirm(() => alive && api.isCurrent());
|
|
696
810
|
const onClick = (event: Event): void => {
|
|
697
811
|
const t = event.target as HTMLElement | null;
|
|
698
812
|
if (!t) return;
|
|
699
|
-
|
|
813
|
+
const copyBtn = t.closest<HTMLElement>(kitAttrSel(KIT_ATTR_ACTION, 'copy'));
|
|
814
|
+
if (copyBtn && r.contains(copyBtn)) {
|
|
815
|
+
event.stopPropagation();
|
|
816
|
+
const copyVal = copyBtn.closest(kitAttrSel(KIT_ATTR_COPY_VALUE))?.getAttribute(KIT_ATTR_COPY_VALUE) ?? '';
|
|
817
|
+
const clip = typeof navigator !== 'undefined' ? navigator.clipboard : undefined;
|
|
818
|
+
if (clip && typeof clip.writeText === 'function') {
|
|
819
|
+
void clip.writeText(copyVal).then(() => {
|
|
820
|
+
if (!alive) return;
|
|
821
|
+
const copiedLabel = copyBtn.getAttribute(KIT_ATTR_COPIED_LABEL) || kitText('soma.kit.copied', undefined, r);
|
|
822
|
+
const copyLabel = copyBtn.getAttribute(KIT_ATTR_COPY_LABEL) || kitText('soma.kit.copy', undefined, r);
|
|
823
|
+
setKitCopyButton(copyBtn, copiedLabel, true);
|
|
824
|
+
const prev = copyTimers.get(copyBtn);
|
|
825
|
+
if (prev !== undefined) clearTimeout(prev);
|
|
826
|
+
copyTimers.set(copyBtn, setTimeout(() => {
|
|
827
|
+
copyTimers.delete(copyBtn);
|
|
828
|
+
if (alive && copyBtn.isConnected) setKitCopyButton(copyBtn, copyLabel, false);
|
|
829
|
+
}, 1500));
|
|
830
|
+
}, () => undefined);
|
|
831
|
+
}
|
|
832
|
+
return;
|
|
833
|
+
}
|
|
834
|
+
if (t.closest(kitAttrSel(KIT_ATTR_MORE))) {
|
|
700
835
|
limit = (limit > 0 ? limit : cfg().windowThreshold) + KIT_TREE_TABLE.windowBatch;
|
|
701
836
|
paint();
|
|
702
837
|
return;
|
|
703
838
|
}
|
|
704
|
-
const rowEl = t.closest<HTMLElement>(
|
|
705
|
-
const key = rowEl?.getAttribute(
|
|
839
|
+
const rowEl = t.closest<HTMLElement>(kitAttrSel(KIT_ATTR_KEY));
|
|
840
|
+
const key = rowEl?.getAttribute(KIT_ATTR_KEY) ?? null;
|
|
706
841
|
if (!rowEl || key === null || !r.contains(rowEl)) return;
|
|
707
842
|
const node = byKey.get(key);
|
|
708
843
|
if (!node) return;
|
|
709
844
|
cursor = key;
|
|
710
|
-
const act = t.closest<HTMLElement>(
|
|
845
|
+
const act = t.closest<HTMLElement>(kitAttrSel(KIT_ATTR_ACT));
|
|
711
846
|
if (act) {
|
|
712
847
|
const list = actionsOf(P().actions);
|
|
713
|
-
const idx = list.findIndex((x) => x.id === act.getAttribute(
|
|
848
|
+
const idx = list.findIndex((x) => x.id === act.getAttribute(KIT_ATTR_ACT));
|
|
714
849
|
const a = list[idx];
|
|
715
|
-
|
|
850
|
+
// 页面线对危险动作下发的二次确认(props.kit.actions[动作].confirm):确认通过才抛槽位事件,没有判定时同步抛
|
|
851
|
+
if (a && !rowBusy(node.row)) rowConfirm.guard(P(), a.id, act, a.name, () => emitActionSlot((n, p) => api.emit(n, p), KIT_ACTION_SLOT_BASE.row, idx, { kit_action: a.id, id: a.id, name: a.name, builtin: a.builtin, target: a.target, row: node.row, ...objectPayload(), ...rowBusyPayload(node.row) }), key);
|
|
716
852
|
return;
|
|
717
853
|
}
|
|
718
|
-
if (t.closest(
|
|
854
|
+
if (t.closest(kitAttrSel(KIT_ATTR_TOGGLE))) {
|
|
719
855
|
setOpen(key, failed.has(key) ? true : !open.has(key));
|
|
720
856
|
return;
|
|
721
857
|
}
|
|
722
|
-
if (t.closest(
|
|
858
|
+
if (t.closest(kitAttrSel(KIT_ATTR_SEL))) return; // change 事件处理
|
|
723
859
|
if (t.closest('button, a, input, select, textarea, label')) return;
|
|
860
|
+
const sel = typeof window !== 'undefined' && typeof window.getSelection === 'function' ? window.getSelection() : null;
|
|
861
|
+
if (sel !== null && !sel.isCollapsed && sel.toString() !== '') return;
|
|
724
862
|
if (bool(P().pickOnRow)) emitPick(node.row);
|
|
725
863
|
paint();
|
|
726
864
|
};
|
|
727
865
|
// 选择框是自绘勾选标记(base/check-core.ts):点击 / 空格 -> 抛选择
|
|
728
866
|
const offMark = attachMarkEvents(r, (mark, next) => {
|
|
729
|
-
if (mark.getAttribute(
|
|
730
|
-
const key = mark.closest<HTMLElement>(
|
|
867
|
+
if (mark.getAttribute(KIT_ATTR_SEL) === null) return;
|
|
868
|
+
const key = mark.closest<HTMLElement>(kitAttrSel(KIT_ATTR_KEY))?.getAttribute(KIT_ATTR_KEY) ?? null;
|
|
731
869
|
const node = key === null ? undefined : byKey.get(key);
|
|
732
870
|
if (node) emitSelect(node.row, next);
|
|
733
871
|
});
|
|
734
872
|
const onKeydown = (event: KeyboardEvent): void => {
|
|
735
873
|
const t = event.target as HTMLElement | null;
|
|
736
|
-
if (!t || t.closest(
|
|
874
|
+
if (!t || t.closest(`input, select, textarea, ${kitAttrSel(KIT_ATTR_MARK)}, ${kitAttrSel(KIT_ATTR_ACT)}, ${kitAttrSel(KIT_ATTR_MORE)}`)) return;
|
|
737
875
|
if (cursor === null) {
|
|
738
|
-
const first = t.closest<HTMLElement>(
|
|
876
|
+
const first = t.closest<HTMLElement>(kitAttrSel(KIT_ATTR_KEY))?.getAttribute(KIT_ATTR_KEY);
|
|
739
877
|
if (first) cursor = first;
|
|
740
878
|
}
|
|
741
879
|
if (wiring.onKeydown(event)) event.preventDefault();
|
|
@@ -747,12 +885,18 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
747
885
|
const offBusy = onKitActionBusy(() => {
|
|
748
886
|
if (!alive) return;
|
|
749
887
|
for (const el of rowEls()) {
|
|
750
|
-
const node = byKey.get(el.getAttribute(
|
|
888
|
+
const node = byKey.get(el.getAttribute(KIT_ATTR_KEY) ?? '');
|
|
751
889
|
if (node && (el.getAttribute('aria-busy') === 'true') !== rowBusy(node.row)) { api.refresh(); return; }
|
|
752
890
|
}
|
|
753
891
|
});
|
|
892
|
+
const offPerm = registerLivePermissionGate(() => {
|
|
893
|
+
if (!alive) return;
|
|
894
|
+
if (permStateOf(P()) !== renderedPerm) api.refresh();
|
|
895
|
+
});
|
|
754
896
|
offs = [
|
|
755
897
|
offBusy,
|
|
898
|
+
offPerm,
|
|
899
|
+
() => { renderedPerm = ''; },
|
|
756
900
|
() => r.removeEventListener('click', onClick),
|
|
757
901
|
() => r.ownerDocument.removeEventListener('click', onControl),
|
|
758
902
|
offMark,
|
|
@@ -762,6 +906,9 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
762
906
|
];
|
|
763
907
|
return () => {
|
|
764
908
|
alive = false;
|
|
909
|
+
rowConfirm.dispose();
|
|
910
|
+
for (const timer of copyTimers.values()) clearTimeout(timer);
|
|
911
|
+
copyTimers.clear();
|
|
765
912
|
for (const off of offs) off();
|
|
766
913
|
offs = [];
|
|
767
914
|
root = null;
|