soma-kit 0.1.15 → 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/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 -340
- package/spec/generated/kit-page.schema.json +1134 -139
- package/spec/kit-grammar.json +934 -92
- package/spec/kit-grammar.schema.json +167 -2
- package/src/app/app-config.ts +219 -186
- package/src/app/define-kit-actions.ts +126 -20
- package/src/app/define-kit-app.ts +49 -4
- package/src/app/index.ts +5 -0
- package/src/app/kit-view-context.ts +39 -1
- 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 +67 -23
- package/src/app/theme-runtime.ts +414 -85
- 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 +104 -59
- package/src/base/anchored-layer.ts +7 -6
- 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 +347 -50
- package/src/base/card.ts +233 -0
- package/src/base/cascader.ts +143 -32
- package/src/base/check-core.ts +193 -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 +399 -27
- package/src/base/combobox.ts +6 -2
- package/src/base/command-palette.ts +148 -36
- package/src/base/context-menu.ts +23 -6
- package/src/base/countdown.ts +37 -15
- package/src/base/date-range.ts +114 -96
- package/src/base/date.ts +481 -74
- package/src/base/delta.ts +16 -9
- package/src/base/divider.ts +51 -33
- package/src/base/end-edge.ts +10 -4
- package/src/base/fab.ts +57 -21
- package/src/base/gap-value.ts +34 -15
- package/src/base/hint-tips.ts +99 -29
- 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 +79 -22
- package/src/base/inline-error.ts +13 -7
- package/src/base/input.ts +135 -35
- package/src/base/kbd.ts +30 -17
- package/src/base/kit-contract.ts +400 -0
- package/src/base/link.ts +41 -20
- package/src/base/listbox-core.ts +282 -101
- package/src/base/loading-gate.ts +3 -0
- package/src/base/look.ts +197 -0
- package/src/base/mentions.ts +55 -22
- package/src/base/menu-button.ts +73 -22
- package/src/base/menu-core.ts +201 -24
- package/src/base/month-grid.ts +60 -3
- package/src/base/motion/aura.ts +52 -10
- package/src/base/motion/hover-3d.ts +7 -5
- package/src/base/motion/hover-gallery.ts +16 -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 +139 -27
- package/src/base/overlay-runtime.ts +30 -23
- package/src/base/overlay-shell.ts +59 -14
- package/src/base/period-picker.ts +868 -0
- package/src/base/popover.ts +624 -73
- package/src/base/popup.ts +187 -52
- 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 +141 -22
- 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 +58 -16
- package/src/base/relation-cells.ts +541 -0
- package/src/base/resize-handle.ts +5 -3
- package/src/base/row-fresh.ts +84 -0
- package/src/base/section-spy.ts +79 -0
- package/src/base/segmented.ts +70 -26
- package/src/base/select.ts +8 -3
- package/src/base/shared.ts +482 -71
- package/src/base/spinner.ts +107 -0
- package/src/base/state-panel.ts +77 -22
- 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 +123 -54
- package/src/base/tag.ts +184 -66
- package/src/base/text.ts +461 -71
- package/src/base/textarea.ts +88 -39
- package/src/base/time-picker.ts +335 -55
- package/src/base/time-range.ts +846 -0
- package/src/base/tree-select.ts +342 -88
- package/src/base/upload.ts +604 -158
- package/src/base/view-transition.ts +7 -3
- package/src/base/virtual-list.ts +49 -14
- package/src/biz/approval-desk/compile.ts +70 -5
- package/src/biz/approval-desk/index.ts +2 -0
- package/src/biz/approval-desk/shell.ts +52 -12
- package/src/biz/auth-panel/compile.ts +13 -3
- package/src/biz/auth-panel/shell.ts +27 -7
- package/src/biz/category-crud/compile.ts +51 -13
- package/src/biz/category-crud/index.ts +2 -0
- package/src/biz/category-crud/shell.ts +29 -9
- package/src/biz/checkout-page/compile.ts +37 -3
- package/src/biz/checkout-page/index.ts +1 -0
- package/src/biz/checkout-page/shell.ts +26 -9
- package/src/biz/compose.ts +6 -1
- package/src/biz/data-components.ts +2 -0
- package/src/biz/import-wizard/compile.ts +4 -1
- package/src/biz/import-wizard/index.ts +1 -0
- package/src/biz/import-wizard/shell.ts +32 -18
- package/src/biz/index.ts +1 -1
- package/src/biz/landing-page/compile.ts +3 -2
- package/src/biz/landing-page/shell.ts +22 -3
- package/src/biz/layout-contracts.ts +918 -0
- package/src/biz/link/hub.ts +199 -8
- package/src/biz/link/shared.ts +54 -15
- package/src/biz/master-sub/compile.ts +194 -57
- package/src/biz/master-sub/detail-head.ts +141 -18
- package/src/biz/master-sub/index.ts +3 -0
- package/src/biz/master-sub/shell.ts +186 -57
- package/src/biz/multi-board/compile.ts +87 -36
- package/src/biz/multi-board/composition.ts +7 -20
- package/src/biz/multi-board/index.ts +3 -2
- package/src/biz/multi-board/prose-fold.ts +15 -11
- package/src/biz/multi-board/shell.ts +148 -37
- package/src/biz/notification-center/compile.ts +20 -6
- package/src/biz/notification-center/index.ts +2 -0
- package/src/biz/notification-center/shell.ts +43 -10
- package/src/biz/page-templates/domain-templates.ts +145 -22
- package/src/biz/page-templates/result-page/compile.ts +4 -1
- package/src/biz/page-templates/result-page/index.ts +1 -0
- package/src/biz/page-templates/result-page/shell.ts +17 -4
- package/src/biz/page-templates/sign-in-page/compile.ts +19 -8
- package/src/biz/page-templates/sign-in-page/index.ts +1 -0
- package/src/biz/page-templates/sign-in-page/shell.ts +28 -12
- package/src/biz/record-detail/compile.ts +39 -11
- package/src/biz/record-detail/index.ts +1 -0
- package/src/biz/record-detail/shell.ts +41 -10
- package/src/biz/settings-center/compile.ts +4 -1
- package/src/biz/settings-center/index.ts +1 -0
- package/src/biz/settings-center/shell.ts +30 -9
- package/src/biz/shared/action-host.ts +137 -46
- package/src/biz/shared/compile-helpers.ts +130 -28
- package/src/biz/shared/coordinator.ts +628 -147
- 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 +58 -10
- package/src/biz/shared/overlay-shell.ts +40 -10
- 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 +4 -2
- package/src/biz/single-form/index.ts +2 -0
- package/src/biz/single-form/shell.ts +21 -11
- package/src/biz/standard-crud/compile.ts +206 -38
- package/src/biz/standard-crud/index.ts +2 -1
- package/src/biz/standard-crud/shell.ts +82 -22
- package/src/biz/standard-crud/summary.ts +2 -37
- package/src/biz/step-form/compile.ts +12 -3
- package/src/biz/step-form/hub.ts +165 -50
- package/src/biz/step-form/index.ts +1 -0
- package/src/biz/step-form/shell.ts +31 -15
- package/src/biz/types.ts +40 -4
- package/src/cli/kit-cli.ts +145 -26
- package/src/cli/kit-init.ts +3 -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/closed-set.ts +102 -6
- package/src/compile/compile-page.ts +446 -53
- package/src/compile/component-candidates.ts +56 -4
- package/src/compile/danger-tier.ts +65 -0
- package/src/compile/hints.ts +1 -1
- package/src/compile/info-structure.ts +155 -0
- package/src/compile/layout-lint/rules-composition.ts +2 -1
- 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 +382 -46
- 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/relation-render.ts +120 -0
- package/src/compile/remove-guard.ts +115 -41
- package/src/compile/stages.ts +645 -28
- package/src/compile/styles.ts +226 -26
- package/src/compile/types.ts +62 -5
- package/src/compile/view-check.ts +190 -1
- package/src/data/access-gate.ts +17 -9
- package/src/data/amount-breakdown.ts +49 -22
- package/src/data/anchor-nav.ts +73 -15
- package/src/data/approval-flow.ts +210 -124
- package/src/data/assignment-picker.ts +163 -85
- package/src/data/async-result-panel.ts +110 -46
- package/src/data/audit-log.ts +461 -0
- package/src/data/breadcrumbs.ts +141 -19
- package/src/data/calendar.ts +434 -96
- package/src/data/card-grid.ts +319 -0
- package/src/data/carousel.ts +72 -38
- package/src/data/cell-value.ts +253 -0
- package/src/data/chart.ts +904 -77
- package/src/data/checklist.ts +78 -35
- package/src/data/code-view.ts +106 -48
- package/src/data/comment-thread.ts +607 -87
- package/src/data/compare-view.ts +227 -0
- package/src/data/confirm-dialog.ts +198 -30
- 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 +107 -50
- package/src/data/display-util.ts +9 -4
- package/src/data/dock.ts +33 -17
- package/src/data/embed.ts +142 -7
- package/src/data/engine-ports.ts +13 -4
- package/src/data/field-mapper.ts +104 -48
- package/src/data/file-list.ts +522 -0
- package/src/data/flow-editor.ts +603 -142
- package/src/data/flow-node-options.ts +24 -5
- package/src/data/flow-remote-options.ts +94 -19
- package/src/data/footer.ts +85 -27
- package/src/data/form-draft-registry.ts +183 -12
- package/src/data/gantt.ts +637 -117
- package/src/data/graph-view.ts +51 -0
- package/src/data/heat-calendar.ts +412 -0
- package/src/data/hero.ts +38 -15
- package/src/data/image-viewer.ts +261 -62
- package/src/data/index.ts +63 -1
- package/src/data/item-list.ts +217 -57
- package/src/data/json-view.ts +165 -100
- package/src/data/kanban.ts +339 -87
- 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 +155 -45
- package/src/data/matrix.ts +217 -112
- package/src/data/media-grid.ts +162 -38
- package/src/data/mega-menu.ts +39 -23
- package/src/data/menu-bar.ts +254 -0
- package/src/data/menu-dom.ts +50 -15
- package/src/data/menu.ts +131 -47
- package/src/data/mockup.ts +30 -22
- package/src/data/modal-dialog.ts +90 -13
- package/src/data/navbar.ts +143 -61
- package/src/data/notice-list.ts +100 -48
- package/src/data/notify-renderer.ts +61 -7
- package/src/data/object-form.ts +1389 -130
- package/src/data/org-chart.ts +544 -0
- package/src/data/outcome-watch.ts +90 -21
- package/src/data/pager.ts +122 -42
- package/src/data/panel-head.ts +237 -75
- package/src/data/permission-matrix.ts +371 -119
- package/src/data/permission-tree.ts +135 -80
- package/src/data/pricing-table.ts +106 -42
- package/src/data/prompt-dialog.ts +49 -21
- package/src/data/reaction-bar.ts +63 -31
- package/src/data/record-card.ts +239 -70
- package/src/data/record-picker.ts +56 -27
- package/src/data/redirect.ts +39 -15
- package/src/data/request-console.ts +131 -41
- package/src/data/resident.ts +11 -1
- package/src/data/result-panel.ts +65 -27
- package/src/data/rich-text.ts +206 -35
- package/src/data/row-confirm.ts +47 -0
- package/src/data/row-editor.ts +376 -102
- package/src/data/rule-builder.ts +129 -80
- package/src/data/schedule-grid.ts +238 -0
- package/src/data/segment-bar.ts +221 -0
- package/src/data/shape-util.ts +86 -43
- package/src/data/stage-flow.ts +244 -0
- package/src/data/staged-rows.ts +207 -24
- package/src/data/stat-group.ts +438 -86
- package/src/data/static-lazy.ts +18 -0
- package/src/data/static-registry.ts +38 -2
- package/src/data/status-strip.ts +171 -0
- package/src/data/steps.ts +63 -34
- package/src/data/summary-strip.ts +136 -0
- package/src/data/summary-util.ts +116 -0
- package/src/data/survey.ts +128 -47
- package/src/data/system-switcher.ts +40 -20
- package/src/data/target-progress.ts +208 -0
- package/src/data/text-action-button.ts +28 -7
- package/src/data/text-diff.ts +99 -31
- package/src/data/tile-grid.ts +343 -0
- package/src/data/timeline.ts +205 -36
- package/src/data/tour-guide.ts +110 -47
- package/src/data/transfer.ts +195 -47
- package/src/data/tree-table.ts +194 -112
- package/src/data/tree.ts +191 -70
- package/src/data/trend-line.ts +68 -12
- package/src/data/virtual-rows.ts +242 -102
- package/src/data/waterfall.ts +171 -0
- package/src/data/watermark.ts +35 -6
- package/src/data/wrap.ts +26 -4
- package/src/frames/blank-frame.ts +6 -4
- package/src/frames/index.ts +1 -2
- package/src/frames/inherited-shell.ts +54 -13
- package/src/frames/page-bar.ts +205 -27
- package/src/frames/page-status.ts +3 -2
- package/src/frames/resident-components.ts +0 -2
- package/src/frames/shared.ts +64 -21
- package/src/frames/single-frame.ts +20 -4
- package/src/frames/split-frame/shell.ts +11 -7
- package/src/frames/split-frame/wiring.ts +14 -10
- package/src/frames/tabs-frame/shell.ts +3 -2
- package/src/frames/tabs-frame/wiring.ts +2 -1
- package/src/frames/top-main-frame.ts +55 -3
- package/src/frames/types.ts +2 -0
- package/src/frames/workspace-frame/extras.ts +5 -3
- 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 +22 -2
- package/src/frames/workspace-frame/state.ts +42 -14
- package/src/frames/workspace-frame/view.ts +697 -167
- package/src/generated/kit-grammar-runtime.ts +1015 -53
- package/src/generated/kit-page.ts +272 -0
- package/src/i18n/index.ts +2 -0
- package/src/i18n/kit-text.ts +96 -3
- package/src/object-renderer/action-group.ts +175 -23
- package/src/object-renderer/action-more.ts +48 -17
- package/src/object-renderer/arrange.ts +241 -29
- 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 +432 -107
- package/src/object-renderer/collection-table.ts +347 -45
- package/src/object-renderer/collection.ts +291 -62
- package/src/object-renderer/compile-data.ts +12 -2
- package/src/object-renderer/defaults.ts +6 -5
- package/src/object-renderer/emit-events.ts +45 -19
- package/src/object-renderer/emit-object.ts +35 -9
- package/src/object-renderer/emit-static.ts +734 -159
- package/src/object-renderer/filter-plan.ts +3 -3
- package/src/object-renderer/filter-toolbar.ts +105 -18
- package/src/object-renderer/form-detail.ts +87 -2
- package/src/object-renderer/key-field.ts +21 -0
- package/src/object-renderer/layout-facts.ts +18 -2
- package/src/object-renderer/layout-plan.ts +6 -3
- package/src/object-renderer/overlay-decide.ts +44 -2
- 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 +71 -26
- package/src/object-renderer/request-actions.ts +119 -21
- package/src/object-renderer/table-actions.ts +424 -103
- 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 +428 -128
- package/src/object-renderer/types.ts +91 -2
- 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/chrome-surface.ts +20 -0
- package/src/recipes/code-view.ts +15 -14
- package/src/recipes/color-role.ts +442 -0
- package/src/recipes/compact-group.ts +3 -2
- package/src/recipes/composition-projector.ts +321 -0
- package/src/recipes/container.ts +76 -19
- package/src/recipes/control.ts +64 -5
- package/src/recipes/desc-list.ts +101 -7
- package/src/recipes/divider.ts +30 -9
- package/src/recipes/emphasis.ts +90 -5
- package/src/recipes/field-text.ts +72 -0
- package/src/recipes/form-section.ts +177 -0
- package/src/recipes/frame-bleed.ts +3 -2
- package/src/recipes/index.ts +28 -4
- package/src/recipes/inherited-shell.ts +21 -15
- package/src/recipes/json-view.ts +6 -5
- package/src/recipes/look.ts +56 -0
- package/src/recipes/mark.ts +138 -0
- package/src/recipes/markdown.ts +16 -6
- package/src/recipes/overlay.ts +47 -19
- package/src/recipes/page-width.ts +31 -0
- package/src/recipes/pipeline-runtime.ts +366 -0
- package/src/recipes/placeholder.ts +37 -19
- 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 +5 -5
- package/src/recipes/state.ts +54 -3
- package/src/recipes/status.ts +14 -14
- package/src/recipes/strip.ts +47 -5
- package/src/recipes/surface-edge.ts +3 -1
- package/src/recipes/surface.ts +33 -4
- package/src/recipes/table-gap.ts +3 -2
- package/src/recipes/table-native-edit.ts +22 -9
- package/src/recipes/table-row.ts +45 -12
- package/src/recipes/tabs.ts +54 -22
- package/src/recipes/text-diff.ts +15 -8
- package/src/recipes/text-fit.ts +132 -0
- package/src/recipes/title-row.ts +68 -3
- 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/dom-attrs-registry.ts +1009 -0
- package/src/shared/dom-attrs.ts +743 -0
- package/src/shared/field-kind.ts +49 -0
- package/src/shared/field-value-format.ts +58 -12
- package/src/shared/glyphs.ts +127 -0
- package/src/shared/icons.ts +28 -1
- package/src/shared/identifier-field.ts +66 -0
- package/src/shared/list-pager.ts +23 -0
- package/src/shared/list-title.ts +29 -0
- 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/pipeline-mode.ts +64 -0
- package/src/shared/row-key.ts +15 -0
- package/src/shared/theme-runtime-shared.ts +165 -24
- 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 +527 -16
- package/src/theme/kit-theme.tpl +491 -16
- package/src/theme/look-carrier.ts +65 -0
- package/src/theme/nine-dim-structure.ts +522 -185
- package/src/theme/private-vars.ts +153 -0
- package/src/theme/surface-layers.ts +3 -2
- package/src/theme/theme-tokens.ts +1601 -93
- package/src/theme/theme-types.ts +38 -59
- package/src/theme/value-table.ts +2379 -0
- package/src/frames/list-summary.ts +0 -123
- package/src/recipes/nowrap.ts +0 -16
- package/src/theme/block-theme.ts +0 -202
package/src/data/tree-table.ts
CHANGED
|
@@ -9,24 +9,28 @@
|
|
|
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
23
|
import { DOT_CORE, DOT_RING, DOT_ROOT, DOT_TEXT, DOT_WRAP, TAG_CLASS } from '../base/tag';
|
|
22
|
-
import { COPY_BTN_CLASS, COPY_TEXT_CLASS } from '../base/text';
|
|
23
|
-
import { KIT_TIPS_SCOPE_ATTR } from '../base/hint-tips';
|
|
24
|
+
import { COPY_BTN_CLASS, COPY_TEXT_CLASS, setKitCopyButton } from '../base/text';
|
|
24
25
|
import { KIT_TAG_UNKNOWN_DOT_CORE, KIT_TAG_UNKNOWN_SOFT } from '../recipes/status';
|
|
25
|
-
import { permissionCheckerOf } from '../base/permission-gate';
|
|
26
|
+
import { permissionCheckerOf, registerLivePermissionGate } from '../base/permission-gate';
|
|
26
27
|
import { KIT_CHECK_CLASS_CANDIDATES, attachMarkEvents, createCheck, setMarkLabel } from '../base/check-core';
|
|
27
|
-
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';
|
|
28
31
|
import { kitLocaleAt, kitText } from '../i18n/kit-text';
|
|
29
32
|
import { setKitFace } from '../recipes';
|
|
33
|
+
import { KIT_FOCUS_RING } from '../recipes/state';
|
|
30
34
|
import { kitEmphasisButtonRecipe } from '../recipes/emphasis';
|
|
31
35
|
import { kitIcon } from '../shared/icons';
|
|
32
36
|
import { KIT_TREE_TABLE } from '../object-renderer/defaults';
|
|
@@ -37,15 +41,42 @@ import { KIT_ROW_TONE_CLASS, rowToneClass } from '../object-renderer/view-bindin
|
|
|
37
41
|
import { isKitActionBusy, onKitActionBusy } from '../base/action-busy';
|
|
38
42
|
import { provideCtxRows } from './context-menu';
|
|
39
43
|
import { KIT_ACTION_SLOT_BASE, actionSlotEmits, emitActionSlot } from '../base/action-slots';
|
|
40
|
-
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';
|
|
41
56
|
|
|
42
57
|
// ── 类串表(整串字面量;候选类汇总在底部) ──
|
|
43
58
|
|
|
44
|
-
const ROOT_CLASS = 'flex flex-col';
|
|
45
|
-
const GRID_CLASS = 'flex flex-col';
|
|
46
|
-
const INDENT_CELL_CLASS = 'flex min-w-0 items-center gap-1';
|
|
47
|
-
const
|
|
48
|
-
|
|
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;
|
|
49
80
|
// 单元格文字:块级 + min-w-0 + 单行省略(长 ID 不再压到相邻列);被截断时悬停出全文提示(表壳带 data-kit-tips,由 base/hint-tips 按需挂)
|
|
50
81
|
const TEXT_CLASS = 'block min-w-0 truncate text-sm text-fg';
|
|
51
82
|
const CELL_TEXT_SIZE_CLASS: Readonly<Record<KitSize, string>> = Object.freeze({
|
|
@@ -53,6 +84,11 @@ const CELL_TEXT_SIZE_CLASS: Readonly<Record<KitSize, string>> = Object.freeze({
|
|
|
53
84
|
md: TEXT_CLASS,
|
|
54
85
|
lg: 'block min-w-0 truncate text-base text-fg',
|
|
55
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
|
+
});
|
|
56
92
|
const CELL_COPY_ROOT_CLASS: Readonly<Record<KitSize, string>> = Object.freeze({
|
|
57
93
|
sm: 'inline-flex max-w-full min-w-0 items-center gap-2 whitespace-nowrap text-xs text-fg',
|
|
58
94
|
md: 'inline-flex max-w-full min-w-0 items-center gap-2 whitespace-nowrap text-sm text-fg',
|
|
@@ -61,20 +97,22 @@ const CELL_COPY_ROOT_CLASS: Readonly<Record<KitSize, string>> = Object.freeze({
|
|
|
61
97
|
const ACTIONS_CELL_CLASS = 'flex flex-nowrap items-center justify-end gap-x-4 whitespace-nowrap';
|
|
62
98
|
const MORE_WRAP_CLASS = 'flex items-center justify-center px-4 py-3';
|
|
63
99
|
const MORE_BUTTON_CLASS = kitEmphasisButtonRecipe('button.toolbar');
|
|
64
|
-
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;
|
|
65
102
|
|
|
66
103
|
/** 工具位链接的原始类串(显隐切类名时据此还原) */
|
|
67
104
|
const CONTROL_CLASS = new WeakMap<HTMLElement, string>();
|
|
68
105
|
|
|
69
106
|
export const KIT_TREE_TABLE_CLASS_CANDIDATES: readonly string[] = Object.freeze([...new Set([
|
|
70
|
-
ROOT_CLASS, GRID_CLASS, INDENT_CELL_CLASS, SPACER_CLASS, TOGGLE_CLASS, TEXT_CLASS,
|
|
107
|
+
ROOT_CLASS, GRID_CLASS, INDENT_CELL_CLASS, 'flex-1', 'ms-auto', 'mx-auto', SPACER_CLASS, TOGGLE_CLASS, TEXT_CLASS,
|
|
71
108
|
...Object.values(CELL_TEXT_SIZE_CLASS), ...Object.values(CELL_COPY_ROOT_CLASS), COPY_TEXT_CLASS, COPY_BTN_CLASS,
|
|
72
|
-
...KIT_CHECK_CLASS_CANDIDATES, ACTIONS_CELL_CLASS, MORE_WRAP_CLASS, MORE_BUTTON_CLASS, ROW_FOCUS_CLASS,
|
|
109
|
+
...KIT_CHECK_CLASS_CANDIDATES, ACTIONS_CELL_CLASS, MORE_WRAP_CLASS, MORE_BUTTON_CLASS, ROW_IDLE_CLASS, ROW_FOCUS_CLASS,
|
|
73
110
|
...Object.values(ROW_ACTION_BUTTON_CLASS),
|
|
74
111
|
...Object.values(TAG_CLASS).flatMap((m) => Object.values(m)),
|
|
75
112
|
...Object.values(DOT_ROOT), ...Object.values(DOT_TEXT), ...Object.values(DOT_WRAP), ...Object.values(DOT_CORE), ...Object.values(DOT_RING),
|
|
76
113
|
...Object.values(KIT_TAG_UNKNOWN_SOFT), KIT_TAG_UNKNOWN_DOT_CORE,
|
|
77
114
|
...Object.values(KIT_ROW_TONE_CLASS),
|
|
115
|
+
...KIT_CELL_VALUE_CLASS_CANDIDATES,
|
|
78
116
|
].flatMap((s) => s.split(/\s+/).filter((c) => c !== '')))].sort());
|
|
79
117
|
|
|
80
118
|
// ── 数据规整纯函数:建树 / 可见行 / 初态 / 列与行操作解析 ──
|
|
@@ -278,12 +316,6 @@ function stripBorderClasses(cls: string): string {
|
|
|
278
316
|
return kitStripBoundaryClasses(cls);
|
|
279
317
|
}
|
|
280
318
|
|
|
281
|
-
function rowKeyOf(row: unknown, keyField: string): string {
|
|
282
|
-
if (!isRec(row)) return '';
|
|
283
|
-
const v = row[keyField];
|
|
284
|
-
return keyField !== '' && v !== undefined && v !== null ? String(v) : JSON.stringify(row);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
319
|
function pickPath(data: unknown, path: string): unknown {
|
|
288
320
|
let cur: unknown = data;
|
|
289
321
|
for (const seg of path.split('.')) {
|
|
@@ -358,7 +390,13 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
358
390
|
templateHtml: `<div data-soma-id="root" class="${ROOT_CLASS}"></div>`,
|
|
359
391
|
controllerFactory: createKitController((api) => {
|
|
360
392
|
const P = (): Rec => api.props();
|
|
361
|
-
|
|
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
|
+
};
|
|
362
400
|
let root: HTMLElement | null = null;
|
|
363
401
|
let alive = false;
|
|
364
402
|
let forest: TreeNode[] = [];
|
|
@@ -371,6 +409,7 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
371
409
|
let cursor: string | null = null;
|
|
372
410
|
let limit = 0;
|
|
373
411
|
let sig = '';
|
|
412
|
+
let dataSeq = 0;
|
|
374
413
|
let offs: Array<() => void> = [];
|
|
375
414
|
|
|
376
415
|
const cfg = (): TreeCfg => treeCfgOf(P().tree);
|
|
@@ -394,9 +433,10 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
394
433
|
const sync = (): void => {
|
|
395
434
|
const p = P();
|
|
396
435
|
let next: string;
|
|
397
|
-
try { next = JSON.stringify([p.rows, p.tree]); } catch { next = `x${
|
|
436
|
+
try { next = JSON.stringify([p.rows, p.tree]); } catch { next = `x${++dataSeq}`; }
|
|
398
437
|
if (next !== sig) {
|
|
399
438
|
sig = next;
|
|
439
|
+
dataSeq += 1;
|
|
400
440
|
rebuild();
|
|
401
441
|
limit = 0;
|
|
402
442
|
}
|
|
@@ -417,16 +457,17 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
417
457
|
return el;
|
|
418
458
|
};
|
|
419
459
|
|
|
420
|
-
const rowEls = (): HTMLElement[] => (root ? Array.from(root.querySelectorAll<HTMLElement>(
|
|
460
|
+
const rowEls = (): HTMLElement[] => (root ? Array.from(root.querySelectorAll<HTMLElement>(kitAttrSel(KIT_ATTR_KEY))) : []);
|
|
421
461
|
const focusCursor = (): void => {
|
|
422
462
|
if (cursor === null) return;
|
|
423
|
-
rowEls().find((e) => e.getAttribute(
|
|
463
|
+
rowEls().find((e) => e.getAttribute(KIT_ATTR_KEY) === cursor)?.focus();
|
|
424
464
|
};
|
|
425
465
|
|
|
426
466
|
const loadChildren = async (node: TreeNode): Promise<void> => {
|
|
427
467
|
const from = cfg().childrenFrom;
|
|
428
468
|
const http = (api.services as { http?: HttpPort } | undefined)?.http;
|
|
429
469
|
if (!from || !http || loading.has(node.key)) return;
|
|
470
|
+
const reqSeq = dataSeq;
|
|
430
471
|
loading.add(node.key);
|
|
431
472
|
failed.delete(node.key);
|
|
432
473
|
paint();
|
|
@@ -435,9 +476,13 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
435
476
|
const baseURL = typeof rawBase === 'string' ? rawBase.replace(/\/+$/, '') : '/api';
|
|
436
477
|
const apiPath = baseURL && baseURL !== '/' && from.api.startsWith(`${baseURL}/`) ? from.api.slice(baseURL.length) : from.api;
|
|
437
478
|
const res = await http.get<unknown>(apiPath, { params: { [from.param]: node.key } });
|
|
479
|
+
if (!alive || reqSeq !== dataSeq || !byKey.has(node.key)) return;
|
|
438
480
|
const env = getKitAppEnvelope(api.host);
|
|
439
481
|
const unwrapped = unwrapEnvelope(res, env);
|
|
440
|
-
if (!unwrapped.ok)
|
|
482
|
+
if (!unwrapped.ok) {
|
|
483
|
+
failed.add(node.key);
|
|
484
|
+
return;
|
|
485
|
+
}
|
|
441
486
|
const payload = unwrapped.data;
|
|
442
487
|
let list: unknown;
|
|
443
488
|
if (Array.isArray(payload)) {
|
|
@@ -458,10 +503,10 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
458
503
|
rebuild();
|
|
459
504
|
open.add(node.key);
|
|
460
505
|
} catch {
|
|
461
|
-
failed.add(node.key);
|
|
506
|
+
if (alive && reqSeq === dataSeq) failed.add(node.key);
|
|
462
507
|
} finally {
|
|
463
508
|
loading.delete(node.key);
|
|
464
|
-
if (alive) paint();
|
|
509
|
+
if (alive && reqSeq === dataSeq) paint();
|
|
465
510
|
}
|
|
466
511
|
};
|
|
467
512
|
|
|
@@ -506,11 +551,13 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
506
551
|
if (rowBusy(row)) return; // 删除在途:不抛行点击
|
|
507
552
|
api.emit('row_pick', { kit_action: 'select', id: 'select', name: '', builtin: 'select', target: '', row, ...objectPayload() });
|
|
508
553
|
};
|
|
509
|
-
const
|
|
554
|
+
const selectedSetOf = (): Set<string> => {
|
|
510
555
|
const sel = P().selected;
|
|
511
556
|
const kf = str(P().keyField);
|
|
512
|
-
|
|
557
|
+
if (!Array.isArray(sel) || sel.length === 0) return new Set();
|
|
558
|
+
return new Set(sel.map((r) => kitRowKey(r, kf)));
|
|
513
559
|
};
|
|
560
|
+
const isPicked = (row: Rec): boolean => selectedSetOf().has(kitRowKey(row, str(P().keyField)));
|
|
514
561
|
|
|
515
562
|
const activate = (key: string): void => {
|
|
516
563
|
const node = byKey.get(key);
|
|
@@ -535,53 +582,40 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
535
582
|
onCollapse: (key) => setOpen(key, false),
|
|
536
583
|
});
|
|
537
584
|
|
|
538
|
-
|
|
539
|
-
const
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
const isUnknown = rawTone === 'unknown';
|
|
546
|
-
const tone = toneOf(rawTone, 'neutral');
|
|
547
|
-
if (str(cell.props.variant) === 'dot') {
|
|
548
|
-
const rootCls = isUnknown ? `${DOT_ROOT[size]} text-fg-muted` : `${DOT_ROOT[size]} ${DOT_TEXT[tone]}`;
|
|
549
|
-
const el = mk('span', rootCls);
|
|
550
|
-
const dot = mk('span', DOT_WRAP[size]);
|
|
551
|
-
dot.setAttribute('aria-hidden', 'true');
|
|
552
|
-
if (!isUnknown && bool(cell.props.pulse)) dot.appendChild(mk('span', DOT_RING[tone]));
|
|
553
|
-
dot.appendChild(mk('span', isUnknown ? KIT_TAG_UNKNOWN_DOT_CORE : DOT_CORE[tone]));
|
|
554
|
-
el.append(dot, document.createTextNode(text));
|
|
555
|
-
return el;
|
|
556
|
-
}
|
|
557
|
-
if (isUnknown) return mk('span', KIT_TAG_UNKNOWN_SOFT[size], text);
|
|
558
|
-
return mk('span', TAG_CLASS[size][tone], text);
|
|
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);
|
|
559
592
|
}
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
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);
|
|
576
610
|
};
|
|
577
611
|
|
|
578
612
|
// ── 表格工具位里的「全部展开 / 全部收起」(页面编译放的静态链接,按对象名认领;本组件只接线与显隐)
|
|
579
|
-
const treeName = (): string => root?.closest<HTMLElement>(
|
|
613
|
+
const treeName = (): string => root?.closest<HTMLElement>(kitAttrSel(KIT_ATTR_TREE_OF))?.getAttribute(KIT_ATTR_TREE_OF) ?? '';
|
|
580
614
|
const controls = (): HTMLElement[] => {
|
|
581
615
|
const name = treeName();
|
|
582
616
|
const d = root?.ownerDocument;
|
|
583
617
|
if (d === undefined || name === '') return [];
|
|
584
|
-
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);
|
|
585
619
|
};
|
|
586
620
|
function syncTreeControls(anyBranch: boolean): void {
|
|
587
621
|
for (const el of controls()) {
|
|
@@ -591,9 +625,9 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
591
625
|
}
|
|
592
626
|
}
|
|
593
627
|
const onControl = (event: Event): void => {
|
|
594
|
-
const t = (event.target as HTMLElement | null)?.closest<HTMLElement>(
|
|
595
|
-
if (t === null || t.getAttribute(
|
|
596
|
-
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') {
|
|
597
631
|
for (const n of byKey.values()) if (n.children.length > 0) open.add(n.key);
|
|
598
632
|
} else open.clear();
|
|
599
633
|
paint();
|
|
@@ -608,6 +642,9 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
608
642
|
const all = visible();
|
|
609
643
|
root.className = joinClass(ROOT_CLASS, p.class);
|
|
610
644
|
root.replaceChildren();
|
|
645
|
+
valuePlans.clear();
|
|
646
|
+
// 数据状态自报:空树记「内容全空」(加载 / 出错由同页的集合三态面板承载,本组件只知道有没有行)
|
|
647
|
+
kitMarkDataFacts(root, { empty: list.length === 0 });
|
|
611
648
|
|
|
612
649
|
// 「全部展开 / 全部收起」不在表体里:由页面编译放进表格工具位(与刷新同一行),这里只按有没有可展开的节点显隐那两个链接
|
|
613
650
|
syncTreeControls(flattenTree(forest).some((n) => n.children.length > 0 || n.lazy));
|
|
@@ -615,25 +652,33 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
615
652
|
const grid = mk('div', GRID_CLASS);
|
|
616
653
|
grid.setAttribute('role', 'treegrid');
|
|
617
654
|
grid.setAttribute('aria-multiselectable', str(p.select) === 'multi' ? 'true' : 'false');
|
|
618
|
-
const
|
|
655
|
+
const listKeys = new Set(list.map((n) => n.key));
|
|
656
|
+
const tabbable = cursor !== null && listKeys.has(cursor) ? cursor : (list[0]?.key ?? null);
|
|
619
657
|
const cols = cells();
|
|
620
658
|
// 显式 bordered: true 的完整网格表(页面编译给每列单元格写了列间竖分隔线 not-last:border-e):外壳与本组件宿主都标 data-kit-grid,
|
|
621
659
|
// 主题结构 CSS 不对它去卡片外观;契约里 bordered 缺省是 true,不能拿它判「显式」,所以看编译产出的列类
|
|
622
660
|
const gridTable = p.bordered !== false && cols.some((col) => /(?:^|\s)not-last:border-e(?:\s|$)/.test(col.cellClass));
|
|
623
661
|
const gridHost = root.closest('[data-soma-component]');
|
|
624
662
|
if (gridTable) {
|
|
625
|
-
root.setAttribute(
|
|
626
|
-
gridHost?.setAttribute(
|
|
663
|
+
root.setAttribute(KIT_ATTR_GRID, '');
|
|
664
|
+
gridHost?.setAttribute(KIT_ATTR_GRID, '');
|
|
627
665
|
} else {
|
|
628
|
-
root.removeAttribute(
|
|
629
|
-
gridHost?.removeAttribute(
|
|
666
|
+
root.removeAttribute(KIT_ATTR_GRID);
|
|
667
|
+
gridHost?.removeAttribute(KIT_ATTR_GRID);
|
|
630
668
|
}
|
|
631
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);
|
|
632
676
|
const actions = actionsOf(p.actions).filter((a) => a.permission === '' || check === null || check(a.permission));
|
|
633
|
-
const
|
|
634
|
-
|
|
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);
|
|
635
679
|
const toneField = str(p.rowToneField);
|
|
636
|
-
for (
|
|
680
|
+
for (let rowIdx = 0; rowIdx < list.length; rowIdx += 1) {
|
|
681
|
+
const n = list[rowIdx]!;
|
|
637
682
|
const branch = n.children.length > 0 || n.lazy;
|
|
638
683
|
const isOpen = n.children.length > 0 && open.has(n.key);
|
|
639
684
|
// 行样式档位:每次 paint 都 replaceChildren 重建行元素,类串每行现算,无旧档位残留
|
|
@@ -641,18 +686,22 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
641
686
|
const row = mk('div', toneCls === '' ? rowCls : `${rowCls} ${toneCls}`);
|
|
642
687
|
row.setAttribute('role', 'row');
|
|
643
688
|
// 与普通表格行同一部件标记:主题的最小行高令牌(含边线正好 44,随密度档)、行分隔线、斑马纹规则都靠它命中
|
|
644
|
-
row.setAttribute(
|
|
645
|
-
|
|
646
|
-
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);
|
|
647
694
|
row.setAttribute('aria-level', String(n.level + 1));
|
|
648
|
-
row.setAttribute('aria-posinset', String(
|
|
695
|
+
row.setAttribute('aria-posinset', String(rowIdx + 1));
|
|
649
696
|
row.setAttribute('aria-setsize', String(all.length));
|
|
650
697
|
if (branch) row.setAttribute('aria-expanded', isOpen ? 'true' : 'false');
|
|
651
698
|
row.tabIndex = n.key === tabbable ? 0 : -1;
|
|
652
|
-
const picked =
|
|
699
|
+
const picked = selectedSet !== null && selectedSet.has(kitRowKey(n.row, kf));
|
|
653
700
|
const busy = rowBusy(n.row);
|
|
654
701
|
if (mode !== 'none') row.setAttribute('aria-selected', picked ? 'true' : 'false');
|
|
655
|
-
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);
|
|
656
705
|
if (busy) row.setAttribute('aria-busy', 'true');
|
|
657
706
|
|
|
658
707
|
if (mode === 'single' || mode === 'multi') {
|
|
@@ -660,16 +709,21 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
660
709
|
const cell = mk('div', selectClass);
|
|
661
710
|
cell.setAttribute('role', 'gridcell');
|
|
662
711
|
const box = createCheck(doc(), mode === 'single' ? 'radio' : 'checkbox', { checked: picked, ...(busy ? { disabled: true } : {}) });
|
|
663
|
-
box.setAttribute(
|
|
712
|
+
box.setAttribute(KIT_ATTR_SEL, '');
|
|
664
713
|
setMarkLabel(box, kitText('soma.kit.select_row_of', { key: n.key }, api.host));
|
|
665
714
|
cell.appendChild(box);
|
|
666
715
|
row.appendChild(cell);
|
|
667
716
|
}
|
|
668
717
|
cols.forEach((col) => {
|
|
669
|
-
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);
|
|
670
722
|
const cell = mk('div', cellClass);
|
|
671
723
|
cell.setAttribute('role', 'gridcell');
|
|
672
|
-
|
|
724
|
+
cell.setAttribute(KIT_ATTR_COL, col.field);
|
|
725
|
+
kitMarkPart(cell, 'cell');
|
|
726
|
+
const content = cellContent(col, n.row, baseCellClass, fk);
|
|
673
727
|
if (col.field === c.indentField) {
|
|
674
728
|
const wrap = mk('div', INDENT_CELL_CLASS);
|
|
675
729
|
for (let i = 0; i < n.level; i++) {
|
|
@@ -681,7 +735,7 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
681
735
|
const tg = mk('button', TOGGLE_CLASS, '');
|
|
682
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'));
|
|
683
737
|
tg.setAttribute('type', 'button');
|
|
684
|
-
tg.setAttribute(
|
|
738
|
+
tg.setAttribute(KIT_ATTR_TOGGLE, '');
|
|
685
739
|
tg.tabIndex = -1;
|
|
686
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));
|
|
687
741
|
wrap.appendChild(tg);
|
|
@@ -690,6 +744,13 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
690
744
|
sp.setAttribute('aria-hidden', 'true');
|
|
691
745
|
wrap.appendChild(sp);
|
|
692
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
|
+
}
|
|
693
754
|
wrap.appendChild(content);
|
|
694
755
|
cell.appendChild(wrap);
|
|
695
756
|
} else {
|
|
@@ -700,13 +761,18 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
700
761
|
if (actions.length > 0) {
|
|
701
762
|
const cell = mk('div', str(p.actionsClass));
|
|
702
763
|
cell.setAttribute('role', 'gridcell');
|
|
764
|
+
kitMarkPart(cell, 'cell');
|
|
703
765
|
const box = mk('div', ACTIONS_CELL_CLASS);
|
|
704
766
|
const ranks = rowActionRanks(actions);
|
|
705
767
|
for (const [at, a] of actions.entries()) {
|
|
706
|
-
|
|
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;
|
|
707
772
|
btn.setAttribute('type', 'button');
|
|
773
|
+
kitMarkPart(btn, 'action');
|
|
708
774
|
// 行动作:文字链接形态(无面,不标 raised)
|
|
709
|
-
btn.setAttribute(
|
|
775
|
+
btn.setAttribute(KIT_ATTR_ACT, a.id);
|
|
710
776
|
if (busy) {
|
|
711
777
|
btn.disabled = true;
|
|
712
778
|
btn.setAttribute('aria-disabled', 'true');
|
|
@@ -722,10 +788,12 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
722
788
|
|
|
723
789
|
if (all.length > list.length) {
|
|
724
790
|
const wrap = mk('div', MORE_WRAP_CLASS);
|
|
791
|
+
// 「显示更多」尾行 = 集合的底部工具行
|
|
792
|
+
kitMarkLevel(wrap, 'foot'); kitApplyLevelClass(wrap);
|
|
725
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));
|
|
726
794
|
more.setAttribute('type', 'button');
|
|
727
795
|
setKitFace(more, 'raised');
|
|
728
|
-
more.setAttribute(
|
|
796
|
+
more.setAttribute(KIT_ATTR_MORE, '');
|
|
729
797
|
wrap.appendChild(more);
|
|
730
798
|
root.appendChild(wrap);
|
|
731
799
|
}
|
|
@@ -737,70 +805,75 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
737
805
|
root = rootEl;
|
|
738
806
|
alive = true;
|
|
739
807
|
const r = root;
|
|
740
|
-
const copyTimers = new
|
|
808
|
+
const copyTimers = new Map<HTMLElement, ReturnType<typeof setTimeout>>();
|
|
809
|
+
const rowConfirm = createKitRowConfirm(() => alive && api.isCurrent());
|
|
741
810
|
const onClick = (event: Event): void => {
|
|
742
811
|
const t = event.target as HTMLElement | null;
|
|
743
812
|
if (!t) return;
|
|
744
|
-
const copyBtn = t.closest<HTMLElement>('
|
|
813
|
+
const copyBtn = t.closest<HTMLElement>(kitAttrSel(KIT_ATTR_ACTION, 'copy'));
|
|
745
814
|
if (copyBtn && r.contains(copyBtn)) {
|
|
746
815
|
event.stopPropagation();
|
|
747
|
-
const copyVal = copyBtn.closest(
|
|
816
|
+
const copyVal = copyBtn.closest(kitAttrSel(KIT_ATTR_COPY_VALUE))?.getAttribute(KIT_ATTR_COPY_VALUE) ?? '';
|
|
748
817
|
const clip = typeof navigator !== 'undefined' ? navigator.clipboard : undefined;
|
|
749
818
|
if (clip && typeof clip.writeText === 'function') {
|
|
750
819
|
void clip.writeText(copyVal).then(() => {
|
|
751
|
-
|
|
752
|
-
const
|
|
753
|
-
copyBtn.
|
|
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);
|
|
754
824
|
const prev = copyTimers.get(copyBtn);
|
|
755
825
|
if (prev !== undefined) clearTimeout(prev);
|
|
756
826
|
copyTimers.set(copyBtn, setTimeout(() => {
|
|
757
|
-
copyBtn.textContent = copyLabel;
|
|
758
827
|
copyTimers.delete(copyBtn);
|
|
828
|
+
if (alive && copyBtn.isConnected) setKitCopyButton(copyBtn, copyLabel, false);
|
|
759
829
|
}, 1500));
|
|
760
830
|
}, () => undefined);
|
|
761
831
|
}
|
|
762
832
|
return;
|
|
763
833
|
}
|
|
764
|
-
if (t.closest(
|
|
834
|
+
if (t.closest(kitAttrSel(KIT_ATTR_MORE))) {
|
|
765
835
|
limit = (limit > 0 ? limit : cfg().windowThreshold) + KIT_TREE_TABLE.windowBatch;
|
|
766
836
|
paint();
|
|
767
837
|
return;
|
|
768
838
|
}
|
|
769
|
-
const rowEl = t.closest<HTMLElement>(
|
|
770
|
-
const key = rowEl?.getAttribute(
|
|
839
|
+
const rowEl = t.closest<HTMLElement>(kitAttrSel(KIT_ATTR_KEY));
|
|
840
|
+
const key = rowEl?.getAttribute(KIT_ATTR_KEY) ?? null;
|
|
771
841
|
if (!rowEl || key === null || !r.contains(rowEl)) return;
|
|
772
842
|
const node = byKey.get(key);
|
|
773
843
|
if (!node) return;
|
|
774
844
|
cursor = key;
|
|
775
|
-
const act = t.closest<HTMLElement>(
|
|
845
|
+
const act = t.closest<HTMLElement>(kitAttrSel(KIT_ATTR_ACT));
|
|
776
846
|
if (act) {
|
|
777
847
|
const list = actionsOf(P().actions);
|
|
778
|
-
const idx = list.findIndex((x) => x.id === act.getAttribute(
|
|
848
|
+
const idx = list.findIndex((x) => x.id === act.getAttribute(KIT_ATTR_ACT));
|
|
779
849
|
const a = list[idx];
|
|
780
|
-
|
|
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);
|
|
781
852
|
return;
|
|
782
853
|
}
|
|
783
|
-
if (t.closest(
|
|
854
|
+
if (t.closest(kitAttrSel(KIT_ATTR_TOGGLE))) {
|
|
784
855
|
setOpen(key, failed.has(key) ? true : !open.has(key));
|
|
785
856
|
return;
|
|
786
857
|
}
|
|
787
|
-
if (t.closest(
|
|
858
|
+
if (t.closest(kitAttrSel(KIT_ATTR_SEL))) return; // change 事件处理
|
|
788
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;
|
|
789
862
|
if (bool(P().pickOnRow)) emitPick(node.row);
|
|
790
863
|
paint();
|
|
791
864
|
};
|
|
792
865
|
// 选择框是自绘勾选标记(base/check-core.ts):点击 / 空格 -> 抛选择
|
|
793
866
|
const offMark = attachMarkEvents(r, (mark, next) => {
|
|
794
|
-
if (mark.getAttribute(
|
|
795
|
-
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;
|
|
796
869
|
const node = key === null ? undefined : byKey.get(key);
|
|
797
870
|
if (node) emitSelect(node.row, next);
|
|
798
871
|
});
|
|
799
872
|
const onKeydown = (event: KeyboardEvent): void => {
|
|
800
873
|
const t = event.target as HTMLElement | null;
|
|
801
|
-
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;
|
|
802
875
|
if (cursor === null) {
|
|
803
|
-
const first = t.closest<HTMLElement>(
|
|
876
|
+
const first = t.closest<HTMLElement>(kitAttrSel(KIT_ATTR_KEY))?.getAttribute(KIT_ATTR_KEY);
|
|
804
877
|
if (first) cursor = first;
|
|
805
878
|
}
|
|
806
879
|
if (wiring.onKeydown(event)) event.preventDefault();
|
|
@@ -812,12 +885,18 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
812
885
|
const offBusy = onKitActionBusy(() => {
|
|
813
886
|
if (!alive) return;
|
|
814
887
|
for (const el of rowEls()) {
|
|
815
|
-
const node = byKey.get(el.getAttribute(
|
|
888
|
+
const node = byKey.get(el.getAttribute(KIT_ATTR_KEY) ?? '');
|
|
816
889
|
if (node && (el.getAttribute('aria-busy') === 'true') !== rowBusy(node.row)) { api.refresh(); return; }
|
|
817
890
|
}
|
|
818
891
|
});
|
|
892
|
+
const offPerm = registerLivePermissionGate(() => {
|
|
893
|
+
if (!alive) return;
|
|
894
|
+
if (permStateOf(P()) !== renderedPerm) api.refresh();
|
|
895
|
+
});
|
|
819
896
|
offs = [
|
|
820
897
|
offBusy,
|
|
898
|
+
offPerm,
|
|
899
|
+
() => { renderedPerm = ''; },
|
|
821
900
|
() => r.removeEventListener('click', onClick),
|
|
822
901
|
() => r.ownerDocument.removeEventListener('click', onControl),
|
|
823
902
|
offMark,
|
|
@@ -827,6 +906,9 @@ export function createKitTreeTable(): SomaComponentDefinition {
|
|
|
827
906
|
];
|
|
828
907
|
return () => {
|
|
829
908
|
alive = false;
|
|
909
|
+
rowConfirm.dispose();
|
|
910
|
+
for (const timer of copyTimers.values()) clearTimeout(timer);
|
|
911
|
+
copyTimers.clear();
|
|
830
912
|
for (const off of offs) off();
|
|
831
913
|
offs = [];
|
|
832
914
|
root = null;
|