@cohesivesystems/presentation-core 0.1.0-alpha.1
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/LICENSE +55 -0
- package/dist/api-scope-request.d.ts +43 -0
- package/dist/api-scope-request.d.ts.map +1 -0
- package/dist/api-scope-request.js +96 -0
- package/dist/api-scope-request.js.map +1 -0
- package/dist/collection-chrome-icons.d.ts +18 -0
- package/dist/collection-chrome-icons.d.ts.map +1 -0
- package/dist/collection-chrome-icons.js +57 -0
- package/dist/collection-chrome-icons.js.map +1 -0
- package/dist/collection-chrome-runtime.d.ts +25 -0
- package/dist/collection-chrome-runtime.d.ts.map +1 -0
- package/dist/collection-chrome-runtime.js +72 -0
- package/dist/collection-chrome-runtime.js.map +1 -0
- package/dist/collection-chrome-slot-renderer-registry.d.ts +110 -0
- package/dist/collection-chrome-slot-renderer-registry.d.ts.map +1 -0
- package/dist/collection-chrome-slot-renderer-registry.js +136 -0
- package/dist/collection-chrome-slot-renderer-registry.js.map +1 -0
- package/dist/collection-selection-state.d.ts +18 -0
- package/dist/collection-selection-state.d.ts.map +1 -0
- package/dist/collection-selection-state.js +2 -0
- package/dist/collection-selection-state.js.map +1 -0
- package/dist/data-source-projection.d.ts +475 -0
- package/dist/data-source-projection.d.ts.map +1 -0
- package/dist/data-source-projection.js +880 -0
- package/dist/data-source-projection.js.map +1 -0
- package/dist/data-source-query-lowering.d.ts +35 -0
- package/dist/data-source-query-lowering.d.ts.map +1 -0
- package/dist/data-source-query-lowering.js +104 -0
- package/dist/data-source-query-lowering.js.map +1 -0
- package/dist/date-time-filter-model.d.ts +20 -0
- package/dist/date-time-filter-model.d.ts.map +1 -0
- package/dist/date-time-filter-model.js +115 -0
- package/dist/date-time-filter-model.js.map +1 -0
- package/dist/document-badge-icons.d.ts +4 -0
- package/dist/document-badge-icons.d.ts.map +1 -0
- package/dist/document-badge-icons.js +4 -0
- package/dist/document-badge-icons.js.map +1 -0
- package/dist/document-module.d.ts +268 -0
- package/dist/document-module.d.ts.map +1 -0
- package/dist/document-module.js +347 -0
- package/dist/document-module.js.map +1 -0
- package/dist/document-summary-model.d.ts +2 -0
- package/dist/document-summary-model.d.ts.map +1 -0
- package/dist/document-summary-model.js +2 -0
- package/dist/document-summary-model.js.map +1 -0
- package/dist/document-workspace-chrome-projection.d.ts +18 -0
- package/dist/document-workspace-chrome-projection.d.ts.map +1 -0
- package/dist/document-workspace-chrome-projection.js +35 -0
- package/dist/document-workspace-chrome-projection.js.map +1 -0
- package/dist/document-workspace-surface-slots.d.ts +75 -0
- package/dist/document-workspace-surface-slots.d.ts.map +1 -0
- package/dist/document-workspace-surface-slots.js +268 -0
- package/dist/document-workspace-surface-slots.js.map +1 -0
- package/dist/endpoint-executor.d.ts +62 -0
- package/dist/endpoint-executor.d.ts.map +1 -0
- package/dist/endpoint-executor.js +35 -0
- package/dist/endpoint-executor.js.map +1 -0
- package/dist/field-display-resolution.d.ts +5 -0
- package/dist/field-display-resolution.d.ts.map +1 -0
- package/dist/field-display-resolution.js +50 -0
- package/dist/field-display-resolution.js.map +1 -0
- package/dist/index.d.ts +90 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +89 -0
- package/dist/index.js.map +1 -0
- package/dist/module.d.ts +48 -0
- package/dist/module.d.ts.map +1 -0
- package/dist/module.js +108 -0
- package/dist/module.js.map +1 -0
- package/dist/navigation-shell-frame-renderer-registry.d.ts +12 -0
- package/dist/navigation-shell-frame-renderer-registry.d.ts.map +1 -0
- package/dist/navigation-shell-frame-renderer-registry.js +29 -0
- package/dist/navigation-shell-frame-renderer-registry.js.map +1 -0
- package/dist/navigation-shell-layout-runtime.d.ts +29 -0
- package/dist/navigation-shell-layout-runtime.d.ts.map +1 -0
- package/dist/navigation-shell-layout-runtime.js +50 -0
- package/dist/navigation-shell-layout-runtime.js.map +1 -0
- package/dist/navigation-shell-region-component-registry.d.ts +96 -0
- package/dist/navigation-shell-region-component-registry.d.ts.map +1 -0
- package/dist/navigation-shell-region-component-registry.js +108 -0
- package/dist/navigation-shell-region-component-registry.js.map +1 -0
- package/dist/navigation-shell-runtime.d.ts +48 -0
- package/dist/navigation-shell-runtime.d.ts.map +1 -0
- package/dist/navigation-shell-runtime.js +457 -0
- package/dist/navigation-shell-runtime.js.map +1 -0
- package/dist/navigation-shell-slot-renderer-registry.d.ts +15 -0
- package/dist/navigation-shell-slot-renderer-registry.d.ts.map +1 -0
- package/dist/navigation-shell-slot-renderer-registry.js +48 -0
- package/dist/navigation-shell-slot-renderer-registry.js.map +1 -0
- package/dist/navigation.d.ts +84 -0
- package/dist/navigation.d.ts.map +1 -0
- package/dist/navigation.js +167 -0
- package/dist/navigation.js.map +1 -0
- package/dist/object-path.d.ts +23 -0
- package/dist/object-path.d.ts.map +1 -0
- package/dist/object-path.js +63 -0
- package/dist/object-path.js.map +1 -0
- package/dist/page-host-renderer-registry.d.ts +119 -0
- package/dist/page-host-renderer-registry.d.ts.map +1 -0
- package/dist/page-host-renderer-registry.js +305 -0
- package/dist/page-host-renderer-registry.js.map +1 -0
- package/dist/presentation-action-endpoint-request-projection.d.ts +23 -0
- package/dist/presentation-action-endpoint-request-projection.d.ts.map +1 -0
- package/dist/presentation-action-endpoint-request-projection.js +117 -0
- package/dist/presentation-action-endpoint-request-projection.js.map +1 -0
- package/dist/presentation-action-endpoint.d.ts +24 -0
- package/dist/presentation-action-endpoint.d.ts.map +1 -0
- package/dist/presentation-action-endpoint.js +56 -0
- package/dist/presentation-action-endpoint.js.map +1 -0
- package/dist/presentation-action-icons.d.ts +4 -0
- package/dist/presentation-action-icons.d.ts.map +1 -0
- package/dist/presentation-action-icons.js +4 -0
- package/dist/presentation-action-icons.js.map +1 -0
- package/dist/presentation-action-result-state.d.ts +48 -0
- package/dist/presentation-action-result-state.d.ts.map +1 -0
- package/dist/presentation-action-result-state.js +109 -0
- package/dist/presentation-action-result-state.js.map +1 -0
- package/dist/presentation-action-runtime-binding.d.ts +48 -0
- package/dist/presentation-action-runtime-binding.d.ts.map +1 -0
- package/dist/presentation-action-runtime-binding.js +52 -0
- package/dist/presentation-action-runtime-binding.js.map +1 -0
- package/dist/presentation-action-runtime-diagnostics.d.ts +18 -0
- package/dist/presentation-action-runtime-diagnostics.d.ts.map +1 -0
- package/dist/presentation-action-runtime-diagnostics.js +69 -0
- package/dist/presentation-action-runtime-diagnostics.js.map +1 -0
- package/dist/presentation-action-runtime-labels.d.ts +15 -0
- package/dist/presentation-action-runtime-labels.d.ts.map +1 -0
- package/dist/presentation-action-runtime-labels.js +28 -0
- package/dist/presentation-action-runtime-labels.js.map +1 -0
- package/dist/presentation-action-runtime-projection.d.ts +17 -0
- package/dist/presentation-action-runtime-projection.d.ts.map +1 -0
- package/dist/presentation-action-runtime-projection.js +31 -0
- package/dist/presentation-action-runtime-projection.js.map +1 -0
- package/dist/presentation-badge-resolution.d.ts +8 -0
- package/dist/presentation-badge-resolution.d.ts.map +1 -0
- package/dist/presentation-badge-resolution.js +73 -0
- package/dist/presentation-badge-resolution.js.map +1 -0
- package/dist/presentation-collection-pagination.d.ts +32 -0
- package/dist/presentation-collection-pagination.d.ts.map +1 -0
- package/dist/presentation-collection-pagination.js +275 -0
- package/dist/presentation-collection-pagination.js.map +1 -0
- package/dist/presentation-content-diagnostics.d.ts +17 -0
- package/dist/presentation-content-diagnostics.d.ts.map +1 -0
- package/dist/presentation-content-diagnostics.js +61 -0
- package/dist/presentation-content-diagnostics.js.map +1 -0
- package/dist/presentation-content-resolution.d.ts +9 -0
- package/dist/presentation-content-resolution.d.ts.map +1 -0
- package/dist/presentation-content-resolution.js +19 -0
- package/dist/presentation-content-resolution.js.map +1 -0
- package/dist/presentation-data-source-binding-model.d.ts +81 -0
- package/dist/presentation-data-source-binding-model.d.ts.map +1 -0
- package/dist/presentation-data-source-binding-model.js +56 -0
- package/dist/presentation-data-source-binding-model.js.map +1 -0
- package/dist/presentation-data-source-runtime.d.ts +62 -0
- package/dist/presentation-data-source-runtime.d.ts.map +1 -0
- package/dist/presentation-data-source-runtime.js +80 -0
- package/dist/presentation-data-source-runtime.js.map +1 -0
- package/dist/presentation-design-intent-diagnostics.d.ts +25 -0
- package/dist/presentation-design-intent-diagnostics.d.ts.map +1 -0
- package/dist/presentation-design-intent-diagnostics.js +55 -0
- package/dist/presentation-design-intent-diagnostics.js.map +1 -0
- package/dist/presentation-icon-diagnostics.d.ts +45 -0
- package/dist/presentation-icon-diagnostics.d.ts.map +1 -0
- package/dist/presentation-icon-diagnostics.js +235 -0
- package/dist/presentation-icon-diagnostics.js.map +1 -0
- package/dist/presentation-icon-registry.d.ts +36 -0
- package/dist/presentation-icon-registry.d.ts.map +1 -0
- package/dist/presentation-icon-registry.js +81 -0
- package/dist/presentation-icon-registry.js.map +1 -0
- package/dist/presentation-navigation-action-runtime-bindings.d.ts +13 -0
- package/dist/presentation-navigation-action-runtime-bindings.d.ts.map +1 -0
- package/dist/presentation-navigation-action-runtime-bindings.js +29 -0
- package/dist/presentation-navigation-action-runtime-bindings.js.map +1 -0
- package/dist/presentation-pagination.d.ts +98 -0
- package/dist/presentation-pagination.d.ts.map +1 -0
- package/dist/presentation-pagination.js +427 -0
- package/dist/presentation-pagination.js.map +1 -0
- package/dist/presentation-projection-coverage.d.ts +38 -0
- package/dist/presentation-projection-coverage.d.ts.map +1 -0
- package/dist/presentation-projection-coverage.js +2429 -0
- package/dist/presentation-projection-coverage.js.map +1 -0
- package/dist/presentation-projection-diagnostics.d.ts +33 -0
- package/dist/presentation-projection-diagnostics.d.ts.map +1 -0
- package/dist/presentation-projection-diagnostics.js +17 -0
- package/dist/presentation-projection-diagnostics.js.map +1 -0
- package/dist/presentation-projection-trace.d.ts +97 -0
- package/dist/presentation-projection-trace.d.ts.map +1 -0
- package/dist/presentation-projection-trace.js +110 -0
- package/dist/presentation-projection-trace.js.map +1 -0
- package/dist/presentation-query-form-state.d.ts +15 -0
- package/dist/presentation-query-form-state.d.ts.map +1 -0
- package/dist/presentation-query-form-state.js +20 -0
- package/dist/presentation-query-form-state.js.map +1 -0
- package/dist/presentation-renderer-registry.d.ts +86 -0
- package/dist/presentation-renderer-registry.d.ts.map +1 -0
- package/dist/presentation-renderer-registry.js +108 -0
- package/dist/presentation-renderer-registry.js.map +1 -0
- package/dist/presentation-semantics.d.ts +288 -0
- package/dist/presentation-semantics.d.ts.map +1 -0
- package/dist/presentation-semantics.js +560 -0
- package/dist/presentation-semantics.js.map +1 -0
- package/dist/presentation-standards.d.ts +8 -0
- package/dist/presentation-standards.d.ts.map +1 -0
- package/dist/presentation-standards.js +9 -0
- package/dist/presentation-standards.js.map +1 -0
- package/dist/presentation-test-selectors.d.ts +146 -0
- package/dist/presentation-test-selectors.d.ts.map +1 -0
- package/dist/presentation-test-selectors.js +113 -0
- package/dist/presentation-test-selectors.js.map +1 -0
- package/dist/presentation-value-formatting.d.ts +12 -0
- package/dist/presentation-value-formatting.d.ts.map +1 -0
- package/dist/presentation-value-formatting.js +33 -0
- package/dist/presentation-value-formatting.js.map +1 -0
- package/dist/presentation-value-resolution.d.ts +7 -0
- package/dist/presentation-value-resolution.d.ts.map +1 -0
- package/dist/presentation-value-resolution.js +69 -0
- package/dist/presentation-value-resolution.js.map +1 -0
- package/dist/presentation-view-tree.d.ts +6 -0
- package/dist/presentation-view-tree.d.ts.map +1 -0
- package/dist/presentation-view-tree.js +15 -0
- package/dist/presentation-view-tree.js.map +1 -0
- package/dist/process-task-model.d.ts +80 -0
- package/dist/process-task-model.d.ts.map +1 -0
- package/dist/process-task-model.js +52 -0
- package/dist/process-task-model.js.map +1 -0
- package/dist/process-task-projection.d.ts +46 -0
- package/dist/process-task-projection.d.ts.map +1 -0
- package/dist/process-task-projection.js +233 -0
- package/dist/process-task-projection.js.map +1 -0
- package/dist/projected-action-status-projection.d.ts +18 -0
- package/dist/projected-action-status-projection.d.ts.map +1 -0
- package/dist/projected-action-status-projection.js +19 -0
- package/dist/projected-action-status-projection.js.map +1 -0
- package/dist/projected-activity-state-model.d.ts +22 -0
- package/dist/projected-activity-state-model.d.ts.map +1 -0
- package/dist/projected-activity-state-model.js +87 -0
- package/dist/projected-activity-state-model.js.map +1 -0
- package/dist/projected-collection-action-runtime-bindings.d.ts +12 -0
- package/dist/projected-collection-action-runtime-bindings.d.ts.map +1 -0
- package/dist/projected-collection-action-runtime-bindings.js +37 -0
- package/dist/projected-collection-action-runtime-bindings.js.map +1 -0
- package/dist/projected-collection-action-runtime-diagnostics.d.ts +23 -0
- package/dist/projected-collection-action-runtime-diagnostics.d.ts.map +1 -0
- package/dist/projected-collection-action-runtime-diagnostics.js +168 -0
- package/dist/projected-collection-action-runtime-diagnostics.js.map +1 -0
- package/dist/projected-collection-runtime.d.ts +475 -0
- package/dist/projected-collection-runtime.d.ts.map +1 -0
- package/dist/projected-collection-runtime.js +832 -0
- package/dist/projected-collection-runtime.js.map +1 -0
- package/dist/projected-document-action-diagnostics.d.ts +16 -0
- package/dist/projected-document-action-diagnostics.d.ts.map +1 -0
- package/dist/projected-document-action-diagnostics.js +113 -0
- package/dist/projected-document-action-diagnostics.js.map +1 -0
- package/dist/projected-document-action-enablements.d.ts +25 -0
- package/dist/projected-document-action-enablements.d.ts.map +1 -0
- package/dist/projected-document-action-enablements.js +38 -0
- package/dist/projected-document-action-enablements.js.map +1 -0
- package/dist/projected-document-action-projection.d.ts +45 -0
- package/dist/projected-document-action-projection.d.ts.map +1 -0
- package/dist/projected-document-action-projection.js +201 -0
- package/dist/projected-document-action-projection.js.map +1 -0
- package/dist/projected-document-action-runtime-profile-diagnostics.d.ts +16 -0
- package/dist/projected-document-action-runtime-profile-diagnostics.d.ts.map +1 -0
- package/dist/projected-document-action-runtime-profile-diagnostics.js +168 -0
- package/dist/projected-document-action-runtime-profile-diagnostics.js.map +1 -0
- package/dist/projected-document-action-runtime-profile.d.ts +64 -0
- package/dist/projected-document-action-runtime-profile.d.ts.map +1 -0
- package/dist/projected-document-action-runtime-profile.js +33 -0
- package/dist/projected-document-action-runtime-profile.js.map +1 -0
- package/dist/projected-document-action-status-notice-diagnostics.d.ts +10 -0
- package/dist/projected-document-action-status-notice-diagnostics.d.ts.map +1 -0
- package/dist/projected-document-action-status-notice-diagnostics.js +64 -0
- package/dist/projected-document-action-status-notice-diagnostics.js.map +1 -0
- package/dist/projected-document-badge-formatting.d.ts +2 -0
- package/dist/projected-document-badge-formatting.d.ts.map +1 -0
- package/dist/projected-document-badge-formatting.js +7 -0
- package/dist/projected-document-badge-formatting.js.map +1 -0
- package/dist/projected-document-editor-model.d.ts +4 -0
- package/dist/projected-document-editor-model.d.ts.map +1 -0
- package/dist/projected-document-editor-model.js +2 -0
- package/dist/projected-document-editor-model.js.map +1 -0
- package/dist/projected-document-field-navigation.d.ts +72 -0
- package/dist/projected-document-field-navigation.d.ts.map +1 -0
- package/dist/projected-document-field-navigation.js +143 -0
- package/dist/projected-document-field-navigation.js.map +1 -0
- package/dist/projected-document-field-semantics.d.ts +5 -0
- package/dist/projected-document-field-semantics.d.ts.map +1 -0
- package/dist/projected-document-field-semantics.js +16 -0
- package/dist/projected-document-field-semantics.js.map +1 -0
- package/dist/projected-document-workspace-data-source-bindings.d.ts +69 -0
- package/dist/projected-document-workspace-data-source-bindings.d.ts.map +1 -0
- package/dist/projected-document-workspace-data-source-bindings.js +81 -0
- package/dist/projected-document-workspace-data-source-bindings.js.map +1 -0
- package/dist/projected-document-workspace-notice-diagnostics.d.ts +12 -0
- package/dist/projected-document-workspace-notice-diagnostics.d.ts.map +1 -0
- package/dist/projected-document-workspace-notice-diagnostics.js +13 -0
- package/dist/projected-document-workspace-notice-diagnostics.js.map +1 -0
- package/dist/projected-input-form-runtime.d.ts +62 -0
- package/dist/projected-input-form-runtime.d.ts.map +1 -0
- package/dist/projected-input-form-runtime.js +2 -0
- package/dist/projected-input-form-runtime.js.map +1 -0
- package/dist/projected-process-task-notice-diagnostics.d.ts +13 -0
- package/dist/projected-process-task-notice-diagnostics.d.ts.map +1 -0
- package/dist/projected-process-task-notice-diagnostics.js +170 -0
- package/dist/projected-process-task-notice-diagnostics.js.map +1 -0
- package/dist/projected-query-form-runtime.d.ts +46 -0
- package/dist/projected-query-form-runtime.d.ts.map +1 -0
- package/dist/projected-query-form-runtime.js +2 -0
- package/dist/projected-query-form-runtime.js.map +1 -0
- package/dist/prompt-document-preview-projection.d.ts +46 -0
- package/dist/prompt-document-preview-projection.d.ts.map +1 -0
- package/dist/prompt-document-preview-projection.js +173 -0
- package/dist/prompt-document-preview-projection.js.map +1 -0
- package/dist/prompt-icons.d.ts +4 -0
- package/dist/prompt-icons.d.ts.map +1 -0
- package/dist/prompt-icons.js +4 -0
- package/dist/prompt-icons.js.map +1 -0
- package/dist/prompt-status-message-resolution.d.ts +18 -0
- package/dist/prompt-status-message-resolution.d.ts.map +1 -0
- package/dist/prompt-status-message-resolution.js +83 -0
- package/dist/prompt-status-message-resolution.js.map +1 -0
- package/dist/query-form-lowering.d.ts +16 -0
- package/dist/query-form-lowering.d.ts.map +1 -0
- package/dist/query-form-lowering.js +38 -0
- package/dist/query-form-lowering.js.map +1 -0
- package/dist/query-form-url-state.d.ts +44 -0
- package/dist/query-form-url-state.d.ts.map +1 -0
- package/dist/query-form-url-state.js +197 -0
- package/dist/query-form-url-state.js.map +1 -0
- package/dist/query-offset-page.d.ts +13 -0
- package/dist/query-offset-page.d.ts.map +1 -0
- package/dist/query-offset-page.js +24 -0
- package/dist/query-offset-page.js.map +1 -0
- package/dist/relation-query-input-form-target.d.ts +10 -0
- package/dist/relation-query-input-form-target.d.ts.map +1 -0
- package/dist/relation-query-input-form-target.js +30 -0
- package/dist/relation-query-input-form-target.js.map +1 -0
- package/dist/scope-selection.d.ts +94 -0
- package/dist/scope-selection.d.ts.map +1 -0
- package/dist/scope-selection.js +95 -0
- package/dist/scope-selection.js.map +1 -0
- package/dist/target-bindings.d.ts +39 -0
- package/dist/target-bindings.d.ts.map +1 -0
- package/dist/target-bindings.js +40 -0
- package/dist/target-bindings.js.map +1 -0
- package/dist/view-chrome-content-diagnostics.d.ts +8 -0
- package/dist/view-chrome-content-diagnostics.d.ts.map +1 -0
- package/dist/view-chrome-content-diagnostics.js +84 -0
- package/dist/view-chrome-content-diagnostics.js.map +1 -0
- package/dist/view-chrome-icons.d.ts +12 -0
- package/dist/view-chrome-icons.d.ts.map +1 -0
- package/dist/view-chrome-icons.js +50 -0
- package/dist/view-chrome-icons.js.map +1 -0
- package/dist/view-chrome-slot-renderer-registry.d.ts +19 -0
- package/dist/view-chrome-slot-renderer-registry.d.ts.map +1 -0
- package/dist/view-chrome-slot-renderer-registry.js +62 -0
- package/dist/view-chrome-slot-renderer-registry.js.map +1 -0
- package/package.json +53 -0
- package/src/api-scope-request.ts +186 -0
- package/src/collection-chrome-icons.ts +89 -0
- package/src/collection-chrome-runtime.ts +151 -0
- package/src/collection-chrome-slot-renderer-registry.ts +227 -0
- package/src/collection-selection-state.ts +32 -0
- package/src/data-source-projection.ts +2149 -0
- package/src/data-source-query-lowering.ts +217 -0
- package/src/date-time-filter-model.ts +156 -0
- package/src/document-badge-icons.ts +3 -0
- package/src/document-module.ts +741 -0
- package/src/document-summary-model.ts +1 -0
- package/src/document-workspace-chrome-projection.ts +62 -0
- package/src/document-workspace-surface-slots.ts +458 -0
- package/src/endpoint-executor.ts +122 -0
- package/src/field-display-resolution.ts +99 -0
- package/src/index.ts +104 -0
- package/src/module.ts +281 -0
- package/src/navigation-shell-frame-renderer-registry.ts +65 -0
- package/src/navigation-shell-layout-runtime.ts +124 -0
- package/src/navigation-shell-region-component-registry.ts +242 -0
- package/src/navigation-shell-runtime.ts +579 -0
- package/src/navigation-shell-slot-renderer-registry.ts +94 -0
- package/src/navigation.ts +364 -0
- package/src/object-path.ts +99 -0
- package/src/page-host-renderer-registry.ts +615 -0
- package/src/presentation-action-endpoint-request-projection.ts +223 -0
- package/src/presentation-action-endpoint.ts +130 -0
- package/src/presentation-action-icons.ts +3 -0
- package/src/presentation-action-result-state.ts +189 -0
- package/src/presentation-action-runtime-binding.ts +177 -0
- package/src/presentation-action-runtime-diagnostics.ts +120 -0
- package/src/presentation-action-runtime-labels.ts +57 -0
- package/src/presentation-action-runtime-projection.ts +67 -0
- package/src/presentation-badge-resolution.ts +138 -0
- package/src/presentation-collection-pagination.ts +436 -0
- package/src/presentation-content-diagnostics.ts +121 -0
- package/src/presentation-content-resolution.ts +46 -0
- package/src/presentation-data-source-binding-model.ts +140 -0
- package/src/presentation-data-source-runtime.ts +190 -0
- package/src/presentation-design-intent-diagnostics.ts +104 -0
- package/src/presentation-icon-diagnostics.ts +368 -0
- package/src/presentation-icon-registry.ts +181 -0
- package/src/presentation-navigation-action-runtime-bindings.ts +54 -0
- package/src/presentation-pagination.ts +694 -0
- package/src/presentation-projection-coverage.ts +3257 -0
- package/src/presentation-projection-diagnostics.ts +71 -0
- package/src/presentation-projection-trace.ts +293 -0
- package/src/presentation-query-form-state.ts +54 -0
- package/src/presentation-renderer-registry.ts +269 -0
- package/src/presentation-semantics.ts +1028 -0
- package/src/presentation-standards.ts +14 -0
- package/src/presentation-test-selectors.ts +312 -0
- package/src/presentation-value-formatting.ts +65 -0
- package/src/presentation-value-resolution.ts +100 -0
- package/src/presentation-view-tree.ts +33 -0
- package/src/process-task-model.ts +158 -0
- package/src/process-task-projection.ts +398 -0
- package/src/projected-action-status-projection.ts +43 -0
- package/src/projected-activity-state-model.ts +123 -0
- package/src/projected-collection-action-runtime-bindings.ts +76 -0
- package/src/projected-collection-action-runtime-diagnostics.ts +289 -0
- package/src/projected-collection-runtime.ts +1772 -0
- package/src/projected-document-action-diagnostics.ts +196 -0
- package/src/projected-document-action-enablements.ts +99 -0
- package/src/projected-document-action-projection.ts +464 -0
- package/src/projected-document-action-runtime-profile-diagnostics.ts +250 -0
- package/src/projected-document-action-runtime-profile.ts +133 -0
- package/src/projected-document-action-status-notice-diagnostics.ts +116 -0
- package/src/projected-document-badge-formatting.ts +7 -0
- package/src/projected-document-editor-model.ts +7 -0
- package/src/projected-document-field-navigation.ts +300 -0
- package/src/projected-document-field-semantics.ts +27 -0
- package/src/projected-document-workspace-data-source-bindings.ts +182 -0
- package/src/projected-document-workspace-notice-diagnostics.ts +41 -0
- package/src/projected-input-form-runtime.ts +86 -0
- package/src/projected-process-task-notice-diagnostics.ts +283 -0
- package/src/projected-query-form-runtime.ts +62 -0
- package/src/prompt-document-preview-projection.ts +345 -0
- package/src/prompt-icons.ts +3 -0
- package/src/prompt-status-message-resolution.ts +158 -0
- package/src/query-form-lowering.ts +77 -0
- package/src/query-form-url-state.ts +346 -0
- package/src/query-offset-page.ts +50 -0
- package/src/relation-query-input-form-target.ts +61 -0
- package/src/scope-selection.ts +201 -0
- package/src/target-bindings.ts +123 -0
- package/src/view-chrome-content-diagnostics.ts +139 -0
- package/src/view-chrome-icons.ts +81 -0
- package/src/view-chrome-slot-renderer-registry.ts +128 -0
|
@@ -0,0 +1,1772 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ActionDefinition,
|
|
3
|
+
CollectionChromeDefinition,
|
|
4
|
+
CollectionChromeSlotDefinition,
|
|
5
|
+
CollectionChromeSlotPlacement,
|
|
6
|
+
CollectionColumnDefinition,
|
|
7
|
+
CollectionRowActionDefinition,
|
|
8
|
+
CollectionRowActionParameterBindingDefinition,
|
|
9
|
+
CollectionSelectionActionDefinition,
|
|
10
|
+
CollectionSelectionMode,
|
|
11
|
+
FieldPresentationDefinition,
|
|
12
|
+
PresentationModuleDefinition,
|
|
13
|
+
ViewDefinition,
|
|
14
|
+
} from './module'
|
|
15
|
+
import type {
|
|
16
|
+
CollectionChromeRuntime,
|
|
17
|
+
} from './collection-chrome-runtime'
|
|
18
|
+
import {
|
|
19
|
+
createCollectionChromeRuntime,
|
|
20
|
+
matchesCollectionChromeSlotPlacement,
|
|
21
|
+
resolveCollectionChromeSlots,
|
|
22
|
+
} from './collection-chrome-runtime'
|
|
23
|
+
import {
|
|
24
|
+
findPresentationAction,
|
|
25
|
+
findPresentationField,
|
|
26
|
+
} from './module'
|
|
27
|
+
import {
|
|
28
|
+
getPresentationViewProjectedActions,
|
|
29
|
+
type PresentationViewProjectedActionRef,
|
|
30
|
+
} from './presentation-semantics'
|
|
31
|
+
import type {
|
|
32
|
+
CollectionSelectionStateEntry,
|
|
33
|
+
} from './collection-selection-state'
|
|
34
|
+
import type {
|
|
35
|
+
NavigationRouteParameters,
|
|
36
|
+
} from './navigation'
|
|
37
|
+
import {
|
|
38
|
+
readObjectPath,
|
|
39
|
+
readObjectProperty,
|
|
40
|
+
} from './object-path'
|
|
41
|
+
import {
|
|
42
|
+
resolvePresentationPageInfo,
|
|
43
|
+
type PresentationPaginationBinding,
|
|
44
|
+
type PresentationPaginationRuntime,
|
|
45
|
+
type PresentationPaginationState,
|
|
46
|
+
type ResolvedPresentationPageInfo,
|
|
47
|
+
} from './presentation-pagination'
|
|
48
|
+
import type {
|
|
49
|
+
PresentationActionRuntimeRegistry,
|
|
50
|
+
} from './presentation-action-runtime-projection'
|
|
51
|
+
import {
|
|
52
|
+
collectionDetailActivations,
|
|
53
|
+
collectionChromeSlotPlacements,
|
|
54
|
+
collectionRowActionKinds,
|
|
55
|
+
collectionSelectionActionParameterSources,
|
|
56
|
+
collectionSelectionModes,
|
|
57
|
+
presentationValueKinds,
|
|
58
|
+
} from '@cohesivesystems/presentation-contracts'
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Collection definition projected from a presentation view.
|
|
62
|
+
*/
|
|
63
|
+
export type ProjectedCollectionDefinition = NonNullable<ViewDefinition['Collection']>
|
|
64
|
+
type ProjectedCollectionRowActionDefinition = CollectionRowActionDefinition
|
|
65
|
+
type ProjectedCollectionSelectionActionDefinition = CollectionSelectionActionDefinition
|
|
66
|
+
type ProjectedCollectionParameterDefinition = ActionDefinition['Parameters'][number]
|
|
67
|
+
type ProjectedCollectionModuleDefinition =
|
|
68
|
+
Pick<PresentationModuleDefinition, 'Actions' | 'Fields' | 'Targets'>
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Annotation name used on collection chrome definitions to describe how the
|
|
72
|
+
* chrome was projected.
|
|
73
|
+
*/
|
|
74
|
+
export const collectionChromeProjectionAnnotationName =
|
|
75
|
+
'cohesive.presentation.collection-chrome.projection'
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Annotation name used on collection chrome slot definitions to describe how a
|
|
79
|
+
* specific slot was projected.
|
|
80
|
+
*/
|
|
81
|
+
export const collectionChromeSlotProjectionAnnotationName =
|
|
82
|
+
'cohesive.presentation.collection-chrome.slot.projection'
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Projection-mode tokens emitted by compatibility and declared collection
|
|
86
|
+
* chrome projection paths.
|
|
87
|
+
*/
|
|
88
|
+
export const collectionChromeProjectionModes = {
|
|
89
|
+
compatibilitySynthesized: 'compatibility-synthesized',
|
|
90
|
+
declared: 'declared',
|
|
91
|
+
mixed: 'mixed',
|
|
92
|
+
} as const
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Supported collection chrome projection modes.
|
|
96
|
+
*/
|
|
97
|
+
export type CollectionChromeProjectionMode =
|
|
98
|
+
typeof collectionChromeProjectionModes[keyof typeof collectionChromeProjectionModes]
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Minimal action placement shape shared by row and selection action projections.
|
|
102
|
+
*/
|
|
103
|
+
export interface ProjectedActionPlacementLike {
|
|
104
|
+
/** Action identifier resolved against the containing presentation module. */
|
|
105
|
+
readonly ActionId: string
|
|
106
|
+
|
|
107
|
+
/** Optional icon override projected onto the placement. */
|
|
108
|
+
readonly Icon?: string | null
|
|
109
|
+
|
|
110
|
+
/** Optional label override projected onto the placement. */
|
|
111
|
+
readonly Label?: string | null
|
|
112
|
+
|
|
113
|
+
/** Optional region or surface hint for placement-specific rendering. */
|
|
114
|
+
readonly Region?: string | null
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Row action resolved from a view action reference and module action
|
|
119
|
+
* definition.
|
|
120
|
+
*/
|
|
121
|
+
export interface ResolvedProjectedCollectionRowAction {
|
|
122
|
+
/** Concrete action definition invoked by the row action. */
|
|
123
|
+
readonly action: ActionDefinition
|
|
124
|
+
|
|
125
|
+
/** View-level projected action reference that introduced the action. */
|
|
126
|
+
readonly actionRef: PresentationViewProjectedActionRef
|
|
127
|
+
|
|
128
|
+
/** Collection row action placement metadata. */
|
|
129
|
+
readonly rowAction: CollectionRowActionDefinition
|
|
130
|
+
|
|
131
|
+
/** Chrome slot that owns the action, when known. */
|
|
132
|
+
readonly slotId?: string | null
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Selection action resolved from a view action reference and module action
|
|
137
|
+
* definition.
|
|
138
|
+
*/
|
|
139
|
+
export interface ResolvedProjectedCollectionSelectionAction {
|
|
140
|
+
/** Concrete action definition invoked by the selection action. */
|
|
141
|
+
readonly action: ActionDefinition
|
|
142
|
+
|
|
143
|
+
/** View-level projected action reference that introduced the action. */
|
|
144
|
+
readonly actionRef: PresentationViewProjectedActionRef
|
|
145
|
+
|
|
146
|
+
/** Collection selection action placement metadata. */
|
|
147
|
+
readonly selectionAction: CollectionSelectionActionDefinition
|
|
148
|
+
|
|
149
|
+
/** Chrome slot that owns the action, when known. */
|
|
150
|
+
readonly slotId?: string | null
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Render-ready row action item for a specific collection row.
|
|
155
|
+
*/
|
|
156
|
+
export interface ProjectedCollectionRowActionItem<TData extends object> {
|
|
157
|
+
/** Concrete action definition invoked by this item. */
|
|
158
|
+
readonly action: ActionDefinition
|
|
159
|
+
|
|
160
|
+
/** Execution context bound to the row. */
|
|
161
|
+
readonly actionContext: ProjectedRowActionExecutionContext<TData>
|
|
162
|
+
|
|
163
|
+
/** View-level projected action reference. */
|
|
164
|
+
readonly actionRef: PresentationViewProjectedActionRef
|
|
165
|
+
|
|
166
|
+
/** Whether the action passes semantic predicates and host runtime checks. */
|
|
167
|
+
readonly isEnabled: boolean
|
|
168
|
+
|
|
169
|
+
/** Row action placement metadata. */
|
|
170
|
+
readonly rowAction: CollectionRowActionDefinition
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Render-ready selection action item for the current collection selection.
|
|
175
|
+
*/
|
|
176
|
+
export interface ProjectedCollectionSelectionActionItem<TData extends object> {
|
|
177
|
+
/** Concrete action definition invoked by this item. */
|
|
178
|
+
readonly action: ActionDefinition
|
|
179
|
+
|
|
180
|
+
/** Execution context bound to the current selection. */
|
|
181
|
+
readonly actionContext: ProjectedSelectionActionExecutionContext<TData>
|
|
182
|
+
|
|
183
|
+
/** View-level projected action reference. */
|
|
184
|
+
readonly actionRef: PresentationViewProjectedActionRef
|
|
185
|
+
|
|
186
|
+
/** Whether the action passes semantic predicates and host runtime checks. */
|
|
187
|
+
readonly isEnabled: boolean
|
|
188
|
+
|
|
189
|
+
/** Selection action placement metadata. */
|
|
190
|
+
readonly selectionAction: CollectionSelectionActionDefinition
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Discriminator for action execution contexts created by the projected
|
|
195
|
+
* collection runtime.
|
|
196
|
+
*/
|
|
197
|
+
export type ProjectedCollectionActionContextKind =
|
|
198
|
+
| 'collection-row'
|
|
199
|
+
| 'collection-selection'
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Union of row-scoped and selection-scoped collection action contexts.
|
|
203
|
+
*/
|
|
204
|
+
export type ProjectedCollectionActionExecutionContext<TData extends object> =
|
|
205
|
+
| ProjectedRowActionExecutionContext<TData>
|
|
206
|
+
| ProjectedSelectionActionExecutionContext<TData>
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Host action runtime registry keyed by action identifier.
|
|
210
|
+
*/
|
|
211
|
+
export type ProjectedCollectionActionRuntimeRegistry<TData extends object> =
|
|
212
|
+
PresentationActionRuntimeRegistry<
|
|
213
|
+
ProjectedCollectionActionExecutionContext<TData>,
|
|
214
|
+
unknown
|
|
215
|
+
>
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Execution context for an action bound to a single collection row.
|
|
219
|
+
*/
|
|
220
|
+
export interface ProjectedRowActionExecutionContext<TData extends object> {
|
|
221
|
+
/** Concrete action definition to execute. */
|
|
222
|
+
readonly action: ActionDefinition
|
|
223
|
+
|
|
224
|
+
/** View-level projected action reference. */
|
|
225
|
+
readonly actionRef: PresentationViewProjectedActionRef
|
|
226
|
+
|
|
227
|
+
/** Context discriminator for runtime dispatch. */
|
|
228
|
+
readonly contextKind: 'collection-row'
|
|
229
|
+
|
|
230
|
+
/** Navigation href derived from the action route and bound parameters. */
|
|
231
|
+
readonly href: string | null
|
|
232
|
+
|
|
233
|
+
/** Route or action parameters derived from the row. */
|
|
234
|
+
readonly parameters: NavigationRouteParameters
|
|
235
|
+
|
|
236
|
+
/** Row that the action targets. */
|
|
237
|
+
readonly row: TData
|
|
238
|
+
|
|
239
|
+
/** Row action placement metadata. */
|
|
240
|
+
readonly rowAction: CollectionRowActionDefinition
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Execution context for an action bound to the current collection selection.
|
|
245
|
+
*/
|
|
246
|
+
export interface ProjectedSelectionActionExecutionContext<TData extends object> {
|
|
247
|
+
/** Concrete action definition to execute. */
|
|
248
|
+
readonly action: ActionDefinition
|
|
249
|
+
|
|
250
|
+
/** View-level projected action reference. */
|
|
251
|
+
readonly actionRef: PresentationViewProjectedActionRef
|
|
252
|
+
|
|
253
|
+
/** Context discriminator for runtime dispatch. */
|
|
254
|
+
readonly contextKind: 'collection-selection'
|
|
255
|
+
|
|
256
|
+
/** Navigation href derived from the action route and bound parameters. */
|
|
257
|
+
readonly href: string | null
|
|
258
|
+
|
|
259
|
+
/** Route or action parameters derived from selected rows. */
|
|
260
|
+
readonly parameters: NavigationRouteParameters
|
|
261
|
+
|
|
262
|
+
/** Stable identities for the selected rows. */
|
|
263
|
+
readonly selectedRowIds: readonly string[]
|
|
264
|
+
|
|
265
|
+
/** Data objects for selected rows currently visible to the runtime. */
|
|
266
|
+
readonly selectedRows: readonly TData[]
|
|
267
|
+
|
|
268
|
+
/** Selection action placement metadata. */
|
|
269
|
+
readonly selectionAction: CollectionSelectionActionDefinition
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Action runtime projected from collection row and selection action semantics.
|
|
274
|
+
*/
|
|
275
|
+
export interface ProjectedCollectionActionRuntime<TData extends object> {
|
|
276
|
+
/** Row action invoked by row activation, such as row click, when configured. */
|
|
277
|
+
readonly activatedRowAction: ResolvedProjectedCollectionRowAction | null
|
|
278
|
+
|
|
279
|
+
/** Checks whether a row or selection action can be invoked by host runtime. */
|
|
280
|
+
readonly canInvokeAction: (
|
|
281
|
+
context: ProjectedCollectionActionExecutionContext<TData>,
|
|
282
|
+
actionRuntimes?: ProjectedCollectionActionRuntimeRegistry<TData>,
|
|
283
|
+
) => boolean
|
|
284
|
+
|
|
285
|
+
/** Checks whether a row action can be invoked by host runtime. */
|
|
286
|
+
readonly canInvokeRowAction: (
|
|
287
|
+
context: ProjectedRowActionExecutionContext<TData>,
|
|
288
|
+
actionRuntimes?: ProjectedCollectionActionRuntimeRegistry<TData>,
|
|
289
|
+
) => boolean
|
|
290
|
+
|
|
291
|
+
/** Checks whether a selection action can be invoked by host runtime. */
|
|
292
|
+
readonly canInvokeSelectionAction: (
|
|
293
|
+
context: ProjectedSelectionActionExecutionContext<TData>,
|
|
294
|
+
actionRuntimes?: ProjectedCollectionActionRuntimeRegistry<TData>,
|
|
295
|
+
) => boolean
|
|
296
|
+
|
|
297
|
+
/** Row actions intended for contextual surfaces such as menus. */
|
|
298
|
+
readonly contextRowActions: readonly ResolvedProjectedCollectionRowAction[]
|
|
299
|
+
|
|
300
|
+
/** Creates an execution context for a resolved row action and row. */
|
|
301
|
+
readonly createRowActionContext: (
|
|
302
|
+
resolvedAction: ResolvedProjectedCollectionRowAction,
|
|
303
|
+
row: TData,
|
|
304
|
+
) => ProjectedRowActionExecutionContext<TData>
|
|
305
|
+
|
|
306
|
+
/** Invokes a row or selection action through the supplied host runtimes. */
|
|
307
|
+
readonly invokeAction: (
|
|
308
|
+
context: ProjectedCollectionActionExecutionContext<TData>,
|
|
309
|
+
actionRuntimes?: ProjectedCollectionActionRuntimeRegistry<TData>,
|
|
310
|
+
) => Promise<void>
|
|
311
|
+
|
|
312
|
+
/** Invokes a row action through the supplied host runtimes. */
|
|
313
|
+
readonly invokeRowAction: (
|
|
314
|
+
context: ProjectedRowActionExecutionContext<TData>,
|
|
315
|
+
actionRuntimes?: ProjectedCollectionActionRuntimeRegistry<TData>,
|
|
316
|
+
) => Promise<void>
|
|
317
|
+
|
|
318
|
+
/** Invokes a selection action through the supplied host runtimes. */
|
|
319
|
+
readonly invokeSelectionAction: (
|
|
320
|
+
context: ProjectedSelectionActionExecutionContext<TData>,
|
|
321
|
+
actionRuntimes?: ProjectedCollectionActionRuntimeRegistry<TData>,
|
|
322
|
+
) => Promise<void>
|
|
323
|
+
|
|
324
|
+
/** Row actions intended for primary inline affordances. */
|
|
325
|
+
readonly primaryRowActions: readonly ResolvedProjectedCollectionRowAction[]
|
|
326
|
+
|
|
327
|
+
/** Resolves render-ready row action items for a specific row. */
|
|
328
|
+
readonly resolveRowActionItems: (
|
|
329
|
+
row: TData,
|
|
330
|
+
rowActions: readonly ResolvedProjectedCollectionRowAction[],
|
|
331
|
+
options?: ProjectedCollectionRowActionItemOptions<TData>,
|
|
332
|
+
) => readonly ProjectedCollectionRowActionItem<TData>[]
|
|
333
|
+
|
|
334
|
+
/** Resolves render-ready selection action items for current selection. */
|
|
335
|
+
readonly resolveSelectionActionItems: (
|
|
336
|
+
options?: ProjectedCollectionSelectionActionItemOptions<TData>,
|
|
337
|
+
) => readonly ProjectedCollectionSelectionActionItem<TData>[]
|
|
338
|
+
|
|
339
|
+
/** All resolved row actions declared for the collection view. */
|
|
340
|
+
readonly rowActions: readonly ResolvedProjectedCollectionRowAction[]
|
|
341
|
+
|
|
342
|
+
/** All resolved selection actions declared for the collection view. */
|
|
343
|
+
readonly selectionActions: readonly ResolvedProjectedCollectionSelectionAction[]
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Options for resolving row action items.
|
|
348
|
+
*/
|
|
349
|
+
export interface ProjectedCollectionRowActionItemOptions<TData extends object> {
|
|
350
|
+
/** Optional host-level predicate layered after semantic visibility checks. */
|
|
351
|
+
readonly canExecuteAction?: (
|
|
352
|
+
context: ProjectedCollectionActionExecutionContext<TData>,
|
|
353
|
+
) => boolean
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Options for resolving selection action items.
|
|
358
|
+
*/
|
|
359
|
+
export interface ProjectedCollectionSelectionActionItemOptions<TData extends object> {
|
|
360
|
+
/** Optional host-level predicate layered after semantic visibility checks. */
|
|
361
|
+
readonly canExecuteAction?: (
|
|
362
|
+
context: ProjectedCollectionActionExecutionContext<TData>,
|
|
363
|
+
) => boolean
|
|
364
|
+
|
|
365
|
+
/** Optional subset of selection actions to resolve. */
|
|
366
|
+
readonly selectionActions?: readonly ResolvedProjectedCollectionSelectionAction[]
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Host callback used to navigate to an already-created href.
|
|
371
|
+
*/
|
|
372
|
+
export type ProjectedNavigateHref = (href: string) => void
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Runtime representation of a projected collection column.
|
|
376
|
+
*/
|
|
377
|
+
export interface ProjectedCollectionColumnRuntime<TData extends object> {
|
|
378
|
+
/** Column declaration from the body chrome slot. */
|
|
379
|
+
readonly column: CollectionColumnDefinition
|
|
380
|
+
|
|
381
|
+
/** Field definition resolved from the presentation module. */
|
|
382
|
+
readonly field: FieldPresentationDefinition
|
|
383
|
+
|
|
384
|
+
/** Header label to render for the column. */
|
|
385
|
+
readonly header: string
|
|
386
|
+
|
|
387
|
+
/** Stable column identifier. */
|
|
388
|
+
readonly id: string
|
|
389
|
+
|
|
390
|
+
/** Reads this column's value from a row. */
|
|
391
|
+
readonly readValue: (row: TData) => unknown
|
|
392
|
+
|
|
393
|
+
/** Object path used to read row values for the column. */
|
|
394
|
+
readonly valuePath: string
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Runtime collection chrome shape shared with the core chrome resolver.
|
|
399
|
+
*/
|
|
400
|
+
export type ProjectedCollectionChromeRuntime = CollectionChromeRuntime
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Inputs used to bind collection pagination chrome to a concrete pagination
|
|
404
|
+
* runtime and data-source response.
|
|
405
|
+
*/
|
|
406
|
+
export interface ProjectedCollectionPaginationInput {
|
|
407
|
+
/** Whether the data source backing the collection is currently fetching. */
|
|
408
|
+
readonly isFetching?: boolean
|
|
409
|
+
|
|
410
|
+
/** Reads a data source result by identifier for pagination metadata. */
|
|
411
|
+
readonly readDataSource?: (dataSourceId: string) => unknown
|
|
412
|
+
|
|
413
|
+
/** Current response from the paged data source. */
|
|
414
|
+
readonly response?: unknown
|
|
415
|
+
|
|
416
|
+
/** Host pagination runtime for changing page state. */
|
|
417
|
+
readonly runtime?: PresentationPaginationRuntime | null
|
|
418
|
+
|
|
419
|
+
/** Explicit total count override when the response does not carry one. */
|
|
420
|
+
readonly totalCount?: number | null
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Runtime pagination state projected from collection chrome and host paging
|
|
425
|
+
* runtime.
|
|
426
|
+
*/
|
|
427
|
+
export interface ProjectedCollectionPaginationRuntime {
|
|
428
|
+
/** Data source identifier named by the pagination slot, when present. */
|
|
429
|
+
readonly dataSourceId: string | null
|
|
430
|
+
|
|
431
|
+
/** Pagination slot definition, when pagination is declared. */
|
|
432
|
+
readonly definition: CollectionChromeSlotDefinition | null
|
|
433
|
+
|
|
434
|
+
/** Whether the collection declares a pagination slot. */
|
|
435
|
+
readonly isEnabled: boolean
|
|
436
|
+
|
|
437
|
+
/** Whether the backing data source is currently fetching. */
|
|
438
|
+
readonly isFetching: boolean
|
|
439
|
+
|
|
440
|
+
/** Whether pagination should render in footer chrome. */
|
|
441
|
+
readonly isFooterEnabled: boolean
|
|
442
|
+
|
|
443
|
+
/** Declared pagination slot placement. */
|
|
444
|
+
readonly placement: CollectionChromeSlotDefinition['Placement'] | null
|
|
445
|
+
|
|
446
|
+
/** Pagination slot definition, when pagination is declared. */
|
|
447
|
+
readonly slot: CollectionChromeSlotDefinition | null
|
|
448
|
+
|
|
449
|
+
/** Active paging window when a host runtime and page info are available. */
|
|
450
|
+
readonly window: ProjectedCollectionWindowRuntime | null
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Page navigation window exposed to collection chrome renderers.
|
|
455
|
+
*/
|
|
456
|
+
export interface ProjectedCollectionWindowRuntime {
|
|
457
|
+
/** Pagination binding that describes the paging strategy. */
|
|
458
|
+
readonly binding: PresentationPaginationBinding
|
|
459
|
+
|
|
460
|
+
/** Whether a next page can be requested. */
|
|
461
|
+
readonly canGoNextPage: boolean
|
|
462
|
+
|
|
463
|
+
/** Whether a previous page can be requested. */
|
|
464
|
+
readonly canGoPreviousPage: boolean
|
|
465
|
+
|
|
466
|
+
/** Data source controlled by this pagination window. */
|
|
467
|
+
readonly dataSourceId: string
|
|
468
|
+
|
|
469
|
+
/** Navigates to the first page. */
|
|
470
|
+
readonly goToFirstPage: () => void
|
|
471
|
+
|
|
472
|
+
/** Navigates to the next page using the current response as cursor context. */
|
|
473
|
+
readonly goToNextPage: () => void
|
|
474
|
+
|
|
475
|
+
/** Navigates to the previous page. */
|
|
476
|
+
readonly goToPreviousPage: () => void
|
|
477
|
+
|
|
478
|
+
/** Zero-based page index. */
|
|
479
|
+
readonly pageIndex: number
|
|
480
|
+
|
|
481
|
+
/** Resolved page metadata for labels and navigation state. */
|
|
482
|
+
readonly pageInfo: ResolvedPresentationPageInfo
|
|
483
|
+
|
|
484
|
+
/** Current page size. */
|
|
485
|
+
readonly pageSize: number
|
|
486
|
+
|
|
487
|
+
/** Mutable pagination state owned by the host runtime. */
|
|
488
|
+
readonly state: PresentationPaginationState
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* Inputs required to project a collection runtime from view IR and concrete
|
|
493
|
+
* data.
|
|
494
|
+
*/
|
|
495
|
+
export interface ProjectedCollectionRuntimeOptions<TData extends object> {
|
|
496
|
+
/** Optional href factory for navigation actions. */
|
|
497
|
+
readonly createHref?: (
|
|
498
|
+
routeId: string,
|
|
499
|
+
parameters?: NavigationRouteParameters,
|
|
500
|
+
) => string | null
|
|
501
|
+
|
|
502
|
+
/** Data rows currently visible in the collection. */
|
|
503
|
+
readonly data: readonly TData[]
|
|
504
|
+
|
|
505
|
+
/** Presentation module used to resolve fields and actions. */
|
|
506
|
+
readonly module?: ProjectedCollectionModuleDefinition | null
|
|
507
|
+
|
|
508
|
+
/** Optional pagination bridge for collection pagination chrome. */
|
|
509
|
+
readonly pagination?: ProjectedCollectionPaginationInput | null
|
|
510
|
+
|
|
511
|
+
/** Optional mutable selection state shared across projected runtimes. */
|
|
512
|
+
readonly selectionState?: CollectionSelectionStateEntry | null
|
|
513
|
+
|
|
514
|
+
/** View definition containing the collection IR to project. */
|
|
515
|
+
readonly view?: ViewDefinition | null
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Runtime projection of a collection view over concrete row data.
|
|
520
|
+
*
|
|
521
|
+
* The runtime keeps backend-declared collection semantics as the source of
|
|
522
|
+
* truth for columns, chrome, actions, selection, detail, and pagination while
|
|
523
|
+
* exposing host-friendly functions for rendering and execution.
|
|
524
|
+
*/
|
|
525
|
+
export interface ProjectedCollectionRuntime<TData extends object> {
|
|
526
|
+
/** Projected row and selection action runtime. */
|
|
527
|
+
readonly actions: ProjectedCollectionActionRuntime<TData>
|
|
528
|
+
|
|
529
|
+
/** Resolved collection chrome slots and slot shortcuts. */
|
|
530
|
+
readonly chrome: ProjectedCollectionChromeRuntime
|
|
531
|
+
|
|
532
|
+
/** Visible body columns resolved against module fields. */
|
|
533
|
+
readonly columns: readonly ProjectedCollectionColumnRuntime<TData>[]
|
|
534
|
+
|
|
535
|
+
/** Collection definition from the view, when present. */
|
|
536
|
+
readonly collection: ProjectedCollectionDefinition | null
|
|
537
|
+
|
|
538
|
+
/** Data rows currently visible in the collection. */
|
|
539
|
+
readonly data: readonly TData[]
|
|
540
|
+
|
|
541
|
+
/** Detail projection state derived from selection and detail chrome. */
|
|
542
|
+
readonly detail: ProjectedCollectionDetailRuntime<TData>
|
|
543
|
+
|
|
544
|
+
/** Reads a stable row identity when the body slot declares one. */
|
|
545
|
+
readonly getRowId?: (row: TData, index: number) => string
|
|
546
|
+
|
|
547
|
+
/** Pagination runtime projected from pagination chrome. */
|
|
548
|
+
readonly pagination: ProjectedCollectionPaginationRuntime
|
|
549
|
+
|
|
550
|
+
/** Reads the best available row label for display and accessibility. */
|
|
551
|
+
readonly readRowLabel: (row: TData) => string | null
|
|
552
|
+
|
|
553
|
+
/** Raw row action declarations resolved from the collection. */
|
|
554
|
+
readonly rowActions: readonly ProjectedCollectionRowActionDefinition[]
|
|
555
|
+
|
|
556
|
+
/** Selection runtime projected from collection selection semantics. */
|
|
557
|
+
readonly selection: ProjectedCollectionSelectionRuntime<TData>
|
|
558
|
+
|
|
559
|
+
/** Raw selection action declarations resolved from the collection. */
|
|
560
|
+
readonly selectionActions: readonly ProjectedCollectionSelectionActionDefinition[]
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Runtime selection state and operations for a projected collection.
|
|
565
|
+
*/
|
|
566
|
+
export interface ProjectedCollectionSelectionRuntime<TData extends object> {
|
|
567
|
+
/** Activates a row according to the collection selection mode. */
|
|
568
|
+
readonly activateRow: (row: TData, index: number) => void
|
|
569
|
+
|
|
570
|
+
/** Whether row selection is enabled. */
|
|
571
|
+
readonly isEnabled: boolean
|
|
572
|
+
|
|
573
|
+
/** Whether the selection mode supports multiple rows. */
|
|
574
|
+
readonly isMultiple: boolean
|
|
575
|
+
|
|
576
|
+
/** Tests whether a row is currently selected, when row identity is available. */
|
|
577
|
+
readonly isRowSelected?: (row: TData, index: number) => boolean
|
|
578
|
+
|
|
579
|
+
/** Declared collection selection mode. */
|
|
580
|
+
readonly mode: CollectionSelectionMode
|
|
581
|
+
|
|
582
|
+
/** Removes selected row ids that are no longer visible when configured. */
|
|
583
|
+
readonly pruneToVisibleRows: () => void
|
|
584
|
+
|
|
585
|
+
/** First selected visible row, used by single-row detail projections. */
|
|
586
|
+
readonly selectedRow: TData | null
|
|
587
|
+
|
|
588
|
+
/** Set view of selected row identities for efficient membership checks. */
|
|
589
|
+
readonly selectedRowIdSet: ReadonlySet<string>
|
|
590
|
+
|
|
591
|
+
/** Selected row identities from the active selection state. */
|
|
592
|
+
readonly selectedRowIds: readonly string[]
|
|
593
|
+
|
|
594
|
+
/** Selected rows that are currently visible in `data`. */
|
|
595
|
+
readonly selectedRows: readonly TData[]
|
|
596
|
+
|
|
597
|
+
/** Active mutable selection state, or `null` when selection is disabled. */
|
|
598
|
+
readonly state: CollectionSelectionStateEntry | null
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Runtime state for the detail surface associated with the selected row.
|
|
603
|
+
*/
|
|
604
|
+
export interface ProjectedCollectionDetailRuntime<TData extends object> {
|
|
605
|
+
/** Selected row data shown by the detail surface. */
|
|
606
|
+
readonly data: TData | null
|
|
607
|
+
|
|
608
|
+
/** Message to show when no detail row is selected. */
|
|
609
|
+
readonly emptyMessage?: string | null
|
|
610
|
+
|
|
611
|
+
/** Whether the detail slot has enough semantic information to render. */
|
|
612
|
+
readonly isRenderable: boolean
|
|
613
|
+
|
|
614
|
+
/** Declared detail slot placement. */
|
|
615
|
+
readonly placement?: CollectionChromeSlotPlacement | null
|
|
616
|
+
|
|
617
|
+
/** Detail surface title. */
|
|
618
|
+
readonly title?: string | null
|
|
619
|
+
|
|
620
|
+
/** Detail view identifier projected for the selected row. */
|
|
621
|
+
readonly viewId: string | null
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* Creates the host-facing runtime for a projected collection.
|
|
626
|
+
*
|
|
627
|
+
* @param options View IR, data, module metadata, selection state, pagination,
|
|
628
|
+
* and navigation hooks used to bind collection semantics to runtime behavior.
|
|
629
|
+
*/
|
|
630
|
+
export function createProjectedCollectionRuntime<TData extends object>({
|
|
631
|
+
createHref,
|
|
632
|
+
data,
|
|
633
|
+
module,
|
|
634
|
+
pagination: paginationInput,
|
|
635
|
+
selectionState = null,
|
|
636
|
+
view,
|
|
637
|
+
}: ProjectedCollectionRuntimeOptions<TData>): ProjectedCollectionRuntime<TData> {
|
|
638
|
+
const collection = view?.Collection ?? null
|
|
639
|
+
const chrome = createProjectedCollectionChromeRuntime(collection)
|
|
640
|
+
const bodySlot = chrome.bodySlot
|
|
641
|
+
const selectionMode = resolveProjectedCollectionSelectionMode(collection)
|
|
642
|
+
const selectionEnabled = isCollectionSelectionEnabled(selectionMode)
|
|
643
|
+
const activeSelectionState = selectionEnabled ? selectionState : null
|
|
644
|
+
const rowIdentityPath = bodySlot?.RowIdentityPath ?? null
|
|
645
|
+
const rowLabelPath = bodySlot?.RowLabelPath ?? null
|
|
646
|
+
const getRowId = rowIdentityPath
|
|
647
|
+
? (row: TData, index: number) =>
|
|
648
|
+
readProjectedCollectionRowIdentity(row, rowIdentityPath, index)
|
|
649
|
+
: undefined
|
|
650
|
+
const selectedRowIds = activeSelectionState?.selectedRowIds ?? []
|
|
651
|
+
const selectedRowIdSet = new Set(selectedRowIds)
|
|
652
|
+
const selectedRows = getRowId && selectedRowIds.length > 0
|
|
653
|
+
? data.filter((row, index) => selectedRowIdSet.has(getRowId(row, index)))
|
|
654
|
+
: []
|
|
655
|
+
const selectedRow = selectedRows[0] ?? null
|
|
656
|
+
const detailSlot = chrome.detailSlot
|
|
657
|
+
const detailIsRenderable = isRenderableCollectionDetailSlot(detailSlot)
|
|
658
|
+
const columns = createProjectedCollectionColumnRuntime<TData>({
|
|
659
|
+
bodySlot,
|
|
660
|
+
module,
|
|
661
|
+
})
|
|
662
|
+
const projectedActionRefs = getPresentationViewProjectedActions(view ?? null)
|
|
663
|
+
const rowActions = resolveProjectedCollectionRowActions(module, projectedActionRefs)
|
|
664
|
+
const selectionActions = resolveProjectedCollectionSelectionActions(module, projectedActionRefs)
|
|
665
|
+
const actionRuntime = createProjectedCollectionActionRuntime({
|
|
666
|
+
createHref,
|
|
667
|
+
rowActions,
|
|
668
|
+
selectionActions,
|
|
669
|
+
bodySlot,
|
|
670
|
+
selectedRowIds,
|
|
671
|
+
selectedRows,
|
|
672
|
+
})
|
|
673
|
+
const pagination = createProjectedCollectionPaginationRuntime({
|
|
674
|
+
chrome,
|
|
675
|
+
input: paginationInput,
|
|
676
|
+
itemCount: data.length,
|
|
677
|
+
})
|
|
678
|
+
|
|
679
|
+
return {
|
|
680
|
+
actions: actionRuntime,
|
|
681
|
+
chrome,
|
|
682
|
+
columns,
|
|
683
|
+
collection,
|
|
684
|
+
data,
|
|
685
|
+
detail: {
|
|
686
|
+
data: selectedRow,
|
|
687
|
+
emptyMessage: detailSlot?.EmptyMessage,
|
|
688
|
+
isRenderable: detailIsRenderable,
|
|
689
|
+
placement: detailSlot?.Placement,
|
|
690
|
+
title: detailSlot?.Title,
|
|
691
|
+
viewId: detailIsRenderable
|
|
692
|
+
? detailSlot?.DetailViewId ?? null
|
|
693
|
+
: null,
|
|
694
|
+
},
|
|
695
|
+
getRowId,
|
|
696
|
+
pagination,
|
|
697
|
+
readRowLabel(row) {
|
|
698
|
+
return readProjectedCollectionRowLabel(row, rowLabelPath)
|
|
699
|
+
},
|
|
700
|
+
rowActions: rowActions.map(({ rowAction }) => rowAction),
|
|
701
|
+
selection: {
|
|
702
|
+
activateRow(row, index) {
|
|
703
|
+
const rowId = getRowId?.(row, index) ?? null
|
|
704
|
+
if (!rowId || !activeSelectionState) {
|
|
705
|
+
return
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
if (isMultipleCollectionSelection(selectionMode)) {
|
|
709
|
+
activeSelectionState.toggleRowId(rowId, selectionMode)
|
|
710
|
+
return
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
activeSelectionState.selectRowId(rowId, selectionMode)
|
|
714
|
+
},
|
|
715
|
+
isEnabled: selectionEnabled,
|
|
716
|
+
isMultiple: isMultipleCollectionSelection(selectionMode),
|
|
717
|
+
isRowSelected: activeSelectionState && getRowId
|
|
718
|
+
? (row, index) => selectedRowIdSet.has(getRowId(row, index))
|
|
719
|
+
: undefined,
|
|
720
|
+
mode: selectionMode,
|
|
721
|
+
pruneToVisibleRows() {
|
|
722
|
+
if (
|
|
723
|
+
!bodySlot?.ClearSelectionOnQueryChange ||
|
|
724
|
+
!activeSelectionState ||
|
|
725
|
+
!getRowId ||
|
|
726
|
+
selectedRowIds.length === 0
|
|
727
|
+
) {
|
|
728
|
+
return
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
const visibleRowIds = new Set(data.map((row, index) => getRowId(row, index)))
|
|
732
|
+
const visibleSelectedRowIds = selectedRowIds.filter((rowId) => visibleRowIds.has(rowId))
|
|
733
|
+
if (visibleSelectedRowIds.length !== selectedRowIds.length) {
|
|
734
|
+
activeSelectionState.setSelectedRowIds(visibleSelectedRowIds)
|
|
735
|
+
}
|
|
736
|
+
},
|
|
737
|
+
selectedRow,
|
|
738
|
+
selectedRowIdSet,
|
|
739
|
+
selectedRowIds,
|
|
740
|
+
selectedRows,
|
|
741
|
+
state: activeSelectionState,
|
|
742
|
+
},
|
|
743
|
+
selectionActions: selectionActions.map(({ selectionAction }) => selectionAction),
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
/**
|
|
748
|
+
* Creates the collection chrome runtime for a projected collection definition.
|
|
749
|
+
*/
|
|
750
|
+
export function createProjectedCollectionChromeRuntime(
|
|
751
|
+
collection: ProjectedCollectionDefinition | null | undefined,
|
|
752
|
+
): ProjectedCollectionChromeRuntime {
|
|
753
|
+
return createCollectionChromeRuntime(collection)
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* Resolves all collection chrome slots from a collection definition.
|
|
758
|
+
*/
|
|
759
|
+
export function resolveProjectedCollectionChromeSlots(
|
|
760
|
+
collection: ProjectedCollectionDefinition | null | undefined,
|
|
761
|
+
): readonly CollectionChromeSlotDefinition[] {
|
|
762
|
+
return resolveCollectionChromeSlots(collection)
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
/**
|
|
766
|
+
* Resolves the selection state identifier implied by collection chrome.
|
|
767
|
+
*
|
|
768
|
+
* Body state is preferred, followed by selection actions and detail state.
|
|
769
|
+
*/
|
|
770
|
+
export function resolveProjectedCollectionSelectionStateId(
|
|
771
|
+
collection: ProjectedCollectionDefinition | null | undefined,
|
|
772
|
+
) {
|
|
773
|
+
const chrome = createProjectedCollectionChromeRuntime(collection)
|
|
774
|
+
return chrome.bodySlot?.StateId ??
|
|
775
|
+
chrome.selectionActionsSlot?.StateId ??
|
|
776
|
+
chrome.detailSlot?.StateId ??
|
|
777
|
+
null
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
/**
|
|
781
|
+
* Resolves the collection selection mode, defaulting to `none` when no body
|
|
782
|
+
* slot declares selection.
|
|
783
|
+
*/
|
|
784
|
+
export function resolveProjectedCollectionSelectionMode(
|
|
785
|
+
collection: ProjectedCollectionDefinition | null | undefined,
|
|
786
|
+
) {
|
|
787
|
+
return createProjectedCollectionChromeRuntime(collection).bodySlot?.SelectionMode ??
|
|
788
|
+
collectionSelectionModes.none
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
/**
|
|
792
|
+
* Reads the projection mode annotation from collection chrome.
|
|
793
|
+
*/
|
|
794
|
+
export function readCollectionChromeProjectionMode(
|
|
795
|
+
chrome: Pick<CollectionChromeDefinition, 'Annotations'> | null | undefined,
|
|
796
|
+
): CollectionChromeProjectionMode | null {
|
|
797
|
+
return readCollectionChromeProjectionModeAnnotation(
|
|
798
|
+
chrome?.Annotations,
|
|
799
|
+
collectionChromeProjectionAnnotationName,
|
|
800
|
+
)
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
/**
|
|
804
|
+
* Reads the projection mode annotation from a collection chrome slot.
|
|
805
|
+
*/
|
|
806
|
+
export function readCollectionChromeSlotProjectionMode(
|
|
807
|
+
slot: Pick<CollectionChromeSlotDefinition, 'Annotations'> | null | undefined,
|
|
808
|
+
): CollectionChromeProjectionMode | null {
|
|
809
|
+
return readCollectionChromeProjectionModeAnnotation(
|
|
810
|
+
slot?.Annotations,
|
|
811
|
+
collectionChromeSlotProjectionAnnotationName,
|
|
812
|
+
)
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
/**
|
|
816
|
+
* Checks whether a collection chrome slot carries a specific projection mode.
|
|
817
|
+
*/
|
|
818
|
+
export function isCollectionChromeSlotProjectionMode(
|
|
819
|
+
slot: Pick<CollectionChromeSlotDefinition, 'Annotations'> | null | undefined,
|
|
820
|
+
mode: CollectionChromeProjectionMode,
|
|
821
|
+
) {
|
|
822
|
+
return readCollectionChromeSlotProjectionMode(slot) === mode
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* Resolves the first data source identifier attached to the collection
|
|
827
|
+
* pagination slot.
|
|
828
|
+
*/
|
|
829
|
+
export function resolveProjectedCollectionPaginationDataSourceId(
|
|
830
|
+
collection: ProjectedCollectionDefinition | null | undefined,
|
|
831
|
+
) {
|
|
832
|
+
const paginationSlot = createProjectedCollectionChromeRuntime(collection).paginationSlot
|
|
833
|
+
return paginationSlot?.DataSourceIds[0] ?? null
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
/**
|
|
837
|
+
* Checks whether collection pagination chrome is declared.
|
|
838
|
+
*/
|
|
839
|
+
export function isProjectedCollectionPaginationEnabled(
|
|
840
|
+
collection: ProjectedCollectionDefinition | null | undefined,
|
|
841
|
+
) {
|
|
842
|
+
return Boolean(createProjectedCollectionChromeRuntime(collection).paginationSlot)
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
/**
|
|
846
|
+
* Checks whether collection pagination is declared for footer placement.
|
|
847
|
+
*/
|
|
848
|
+
export function isProjectedCollectionPaginationFooterEnabled(
|
|
849
|
+
collection: ProjectedCollectionDefinition | null | undefined,
|
|
850
|
+
) {
|
|
851
|
+
const chrome = createProjectedCollectionChromeRuntime(collection)
|
|
852
|
+
return Boolean(chrome.paginationFooterSlot)
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
/**
|
|
856
|
+
* Creates the pagination runtime by combining declared pagination chrome with a
|
|
857
|
+
* host pagination runtime and the current data-source response.
|
|
858
|
+
*/
|
|
859
|
+
function createProjectedCollectionPaginationRuntime({
|
|
860
|
+
chrome,
|
|
861
|
+
input,
|
|
862
|
+
itemCount,
|
|
863
|
+
}: {
|
|
864
|
+
readonly chrome: ProjectedCollectionChromeRuntime
|
|
865
|
+
readonly input?: ProjectedCollectionPaginationInput | null
|
|
866
|
+
readonly itemCount: number
|
|
867
|
+
}): ProjectedCollectionPaginationRuntime {
|
|
868
|
+
const slot = chrome.paginationSlot
|
|
869
|
+
const definition = slot
|
|
870
|
+
const isEnabled = Boolean(slot)
|
|
871
|
+
const dataSourceId = slot?.DataSourceIds[0] ?? null
|
|
872
|
+
const placement = slot?.Placement ?? null
|
|
873
|
+
const runtime = input?.runtime ?? null
|
|
874
|
+
const pageInfo = runtime
|
|
875
|
+
? resolvePresentationPageInfo({
|
|
876
|
+
binding: runtime.binding,
|
|
877
|
+
itemCount,
|
|
878
|
+
readDataSource: input?.readDataSource,
|
|
879
|
+
response: input?.response,
|
|
880
|
+
state: runtime.state,
|
|
881
|
+
totalCount: input?.totalCount,
|
|
882
|
+
})
|
|
883
|
+
: null
|
|
884
|
+
|
|
885
|
+
return {
|
|
886
|
+
dataSourceId,
|
|
887
|
+
definition,
|
|
888
|
+
isEnabled,
|
|
889
|
+
isFetching: Boolean(input?.isFetching),
|
|
890
|
+
isFooterEnabled: isEnabled && isCollectionChromeFooterPlacement(slot?.Placement ?? null),
|
|
891
|
+
placement,
|
|
892
|
+
slot,
|
|
893
|
+
window: runtime && pageInfo
|
|
894
|
+
? {
|
|
895
|
+
binding: runtime.binding,
|
|
896
|
+
canGoNextPage: pageInfo.hasNextPage,
|
|
897
|
+
canGoPreviousPage: runtime.canGoPreviousPage,
|
|
898
|
+
dataSourceId: runtime.dataSourceId,
|
|
899
|
+
goToFirstPage: runtime.goToFirstPage,
|
|
900
|
+
goToNextPage: () => runtime.goToNextPage(input?.response),
|
|
901
|
+
goToPreviousPage: runtime.goToPreviousPage,
|
|
902
|
+
pageIndex: runtime.pageIndex,
|
|
903
|
+
pageInfo,
|
|
904
|
+
pageSize: runtime.pageSize,
|
|
905
|
+
state: runtime.state,
|
|
906
|
+
}
|
|
907
|
+
: null,
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
/**
|
|
912
|
+
* Reads and validates collection chrome projection-mode annotations.
|
|
913
|
+
*/
|
|
914
|
+
function readCollectionChromeProjectionModeAnnotation(
|
|
915
|
+
annotations: readonly CollectionChromeDefinition['Annotations'][number][] | null | undefined,
|
|
916
|
+
annotationName: string,
|
|
917
|
+
): CollectionChromeProjectionMode | null {
|
|
918
|
+
const annotation = annotations?.find((candidate) =>
|
|
919
|
+
candidate.Name.toLocaleLowerCase() === annotationName)
|
|
920
|
+
if (!annotation) {
|
|
921
|
+
return null
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
const value = annotation.Value
|
|
925
|
+
const mode = typeof value === 'string'
|
|
926
|
+
? value
|
|
927
|
+
: value && typeof value === 'object'
|
|
928
|
+
? (value as Readonly<Record<string, unknown>>).mode
|
|
929
|
+
: null
|
|
930
|
+
|
|
931
|
+
return isCollectionChromeProjectionMode(mode) ? mode : null
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
/**
|
|
935
|
+
* Checks whether an arbitrary annotation value is a known projection mode.
|
|
936
|
+
*/
|
|
937
|
+
function isCollectionChromeProjectionMode(
|
|
938
|
+
value: unknown,
|
|
939
|
+
): value is CollectionChromeProjectionMode {
|
|
940
|
+
return value === collectionChromeProjectionModes.declared ||
|
|
941
|
+
value === collectionChromeProjectionModes.compatibilitySynthesized ||
|
|
942
|
+
value === collectionChromeProjectionModes.mixed
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
/**
|
|
946
|
+
* Checks whether a slot placement is semantically the footer placement.
|
|
947
|
+
*/
|
|
948
|
+
function isCollectionChromeFooterPlacement(
|
|
949
|
+
placement: CollectionChromeSlotPlacement | null,
|
|
950
|
+
) {
|
|
951
|
+
return matchesCollectionChromeSlotPlacement(
|
|
952
|
+
placement,
|
|
953
|
+
collectionChromeSlotPlacements.footer,
|
|
954
|
+
)
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
/**
|
|
958
|
+
* Builds visible column runtimes by resolving body-slot column declarations
|
|
959
|
+
* against field definitions in the presentation module.
|
|
960
|
+
*/
|
|
961
|
+
function createProjectedCollectionColumnRuntime<TData extends object>({
|
|
962
|
+
bodySlot,
|
|
963
|
+
module,
|
|
964
|
+
}: {
|
|
965
|
+
readonly bodySlot?: CollectionChromeSlotDefinition | null
|
|
966
|
+
readonly module?: ProjectedCollectionModuleDefinition | null
|
|
967
|
+
}): readonly ProjectedCollectionColumnRuntime<TData>[] {
|
|
968
|
+
if (!module || !bodySlot) {
|
|
969
|
+
return []
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
return resolveCollectionBodyColumns(bodySlot).flatMap((column) => {
|
|
973
|
+
const field = findPresentationField<FieldPresentationDefinition>(module, column.FieldId)
|
|
974
|
+
if (!field) {
|
|
975
|
+
return []
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
const valuePath = column.ValuePath ?? field.Field
|
|
979
|
+
return [{
|
|
980
|
+
column,
|
|
981
|
+
field,
|
|
982
|
+
header: field.Label,
|
|
983
|
+
id: column.Id || field.Id,
|
|
984
|
+
readValue: (row: TData) => readProjectedCollectionValue(row, valuePath),
|
|
985
|
+
valuePath,
|
|
986
|
+
}]
|
|
987
|
+
})
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
/**
|
|
991
|
+
* Returns visible body columns in declared order.
|
|
992
|
+
*/
|
|
993
|
+
function resolveCollectionBodyColumns(
|
|
994
|
+
bodySlot: CollectionChromeSlotDefinition,
|
|
995
|
+
): readonly CollectionColumnDefinition[] {
|
|
996
|
+
return bodySlot.Columns
|
|
997
|
+
.filter((column) => column.IsVisible)
|
|
998
|
+
.sort((left, right) => left.Order - right.Order)
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
/**
|
|
1002
|
+
* Creates the action runtime that resolves row and selection action items,
|
|
1003
|
+
* builds execution contexts, and delegates invocation to host action runtimes.
|
|
1004
|
+
*/
|
|
1005
|
+
function createProjectedCollectionActionRuntime<TData extends object>({
|
|
1006
|
+
bodySlot,
|
|
1007
|
+
createHref,
|
|
1008
|
+
rowActions,
|
|
1009
|
+
selectionActions,
|
|
1010
|
+
selectedRowIds,
|
|
1011
|
+
selectedRows,
|
|
1012
|
+
}: {
|
|
1013
|
+
readonly bodySlot: CollectionChromeSlotDefinition | null
|
|
1014
|
+
readonly createHref?: (
|
|
1015
|
+
routeId: string,
|
|
1016
|
+
parameters?: NavigationRouteParameters,
|
|
1017
|
+
) => string | null
|
|
1018
|
+
readonly rowActions: readonly ResolvedProjectedCollectionRowAction[]
|
|
1019
|
+
readonly selectionActions: readonly ResolvedProjectedCollectionSelectionAction[]
|
|
1020
|
+
readonly selectedRowIds: readonly string[]
|
|
1021
|
+
readonly selectedRows: readonly TData[]
|
|
1022
|
+
}): ProjectedCollectionActionRuntime<TData> {
|
|
1023
|
+
const primaryRowActions = rowActions.filter(({ rowAction }) =>
|
|
1024
|
+
isPrimaryCollectionRowAction(rowAction))
|
|
1025
|
+
const contextRowActions = rowActions.filter(({ rowAction }) =>
|
|
1026
|
+
isContextMenuCollectionRowAction(rowAction))
|
|
1027
|
+
const activatedRowAction = resolveActivatedCollectionRowAction(
|
|
1028
|
+
bodySlot,
|
|
1029
|
+
rowActions,
|
|
1030
|
+
)
|
|
1031
|
+
|
|
1032
|
+
return {
|
|
1033
|
+
activatedRowAction,
|
|
1034
|
+
canInvokeAction: canInvokeProjectedCollectionAction,
|
|
1035
|
+
canInvokeRowAction: canInvokeProjectedRowAction,
|
|
1036
|
+
canInvokeSelectionAction: canInvokeProjectedSelectionAction,
|
|
1037
|
+
contextRowActions,
|
|
1038
|
+
createRowActionContext(resolvedAction, row) {
|
|
1039
|
+
return createProjectedRowActionExecutionContext(resolvedAction, row, createHref)
|
|
1040
|
+
},
|
|
1041
|
+
invokeAction: invokeProjectedCollectionAction,
|
|
1042
|
+
invokeRowAction: invokeProjectedRowAction,
|
|
1043
|
+
invokeSelectionAction: invokeProjectedSelectionAction,
|
|
1044
|
+
primaryRowActions,
|
|
1045
|
+
resolveRowActionItems(row, resolvedActions, options) {
|
|
1046
|
+
return resolvedActions.flatMap((resolvedAction) => {
|
|
1047
|
+
const { action, actionRef, rowAction } = resolvedAction
|
|
1048
|
+
if (!evaluateProjectedRowActionPredicate(rowAction.IsVisible, row, true)) {
|
|
1049
|
+
return []
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
const actionContext = createProjectedRowActionExecutionContext(
|
|
1053
|
+
resolvedAction,
|
|
1054
|
+
row,
|
|
1055
|
+
createHref,
|
|
1056
|
+
)
|
|
1057
|
+
const isEnabled =
|
|
1058
|
+
evaluateProjectedRowActionPredicate(rowAction.IsEnabled, row, true) &&
|
|
1059
|
+
(options?.canExecuteAction?.(actionContext) ?? true)
|
|
1060
|
+
return [{
|
|
1061
|
+
action,
|
|
1062
|
+
actionContext,
|
|
1063
|
+
actionRef,
|
|
1064
|
+
isEnabled,
|
|
1065
|
+
rowAction,
|
|
1066
|
+
}]
|
|
1067
|
+
})
|
|
1068
|
+
},
|
|
1069
|
+
resolveSelectionActionItems(options) {
|
|
1070
|
+
if (selectedRowIds.length === 0) {
|
|
1071
|
+
return []
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
return (options?.selectionActions ?? selectionActions)
|
|
1075
|
+
.slice()
|
|
1076
|
+
.sort((left, right) => left.selectionAction.Order - right.selectionAction.Order)
|
|
1077
|
+
.flatMap((resolvedAction) => {
|
|
1078
|
+
const { action, actionRef, selectionAction } = resolvedAction
|
|
1079
|
+
if (!evaluateProjectedSelectionActionPredicate(
|
|
1080
|
+
selectionAction.IsVisible,
|
|
1081
|
+
selectedRows,
|
|
1082
|
+
true,
|
|
1083
|
+
)) {
|
|
1084
|
+
return []
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
const actionContext = createProjectedSelectionActionExecutionContext(
|
|
1088
|
+
resolvedAction,
|
|
1089
|
+
selectedRows,
|
|
1090
|
+
selectedRowIds,
|
|
1091
|
+
createHref,
|
|
1092
|
+
)
|
|
1093
|
+
const isEnabled =
|
|
1094
|
+
isSelectionActionSelectionCountEnabled(selectionAction, selectedRowIds.length) &&
|
|
1095
|
+
evaluateProjectedSelectionActionPredicate(
|
|
1096
|
+
selectionAction.IsEnabled,
|
|
1097
|
+
selectedRows,
|
|
1098
|
+
true,
|
|
1099
|
+
) &&
|
|
1100
|
+
(options?.canExecuteAction?.(actionContext) ?? true)
|
|
1101
|
+
return [{
|
|
1102
|
+
action,
|
|
1103
|
+
actionContext,
|
|
1104
|
+
actionRef,
|
|
1105
|
+
isEnabled,
|
|
1106
|
+
selectionAction,
|
|
1107
|
+
}]
|
|
1108
|
+
})
|
|
1109
|
+
},
|
|
1110
|
+
rowActions,
|
|
1111
|
+
selectionActions,
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
/**
|
|
1116
|
+
* Resolves row action references to concrete module actions.
|
|
1117
|
+
*/
|
|
1118
|
+
function resolveProjectedCollectionRowActions(
|
|
1119
|
+
module: ProjectedCollectionModuleDefinition | null | undefined,
|
|
1120
|
+
actionRefs: readonly PresentationViewProjectedActionRef[],
|
|
1121
|
+
): readonly ResolvedProjectedCollectionRowAction[] {
|
|
1122
|
+
return sortResolvedCollectionRowActions(actionRefs.flatMap((actionRef) => {
|
|
1123
|
+
if (actionRef.contextKind !== 'collection-row' || !actionRef.rowAction) {
|
|
1124
|
+
return []
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
const action = findPresentationAction<ActionDefinition>(
|
|
1128
|
+
module ?? null,
|
|
1129
|
+
actionRef.actionId,
|
|
1130
|
+
)
|
|
1131
|
+
|
|
1132
|
+
return action
|
|
1133
|
+
? [{
|
|
1134
|
+
action,
|
|
1135
|
+
actionRef,
|
|
1136
|
+
rowAction: actionRef.rowAction,
|
|
1137
|
+
slotId: actionRef.slotId ?? null,
|
|
1138
|
+
}]
|
|
1139
|
+
: []
|
|
1140
|
+
}))
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
/**
|
|
1144
|
+
* Resolves selection action references to concrete module actions.
|
|
1145
|
+
*/
|
|
1146
|
+
function resolveProjectedCollectionSelectionActions(
|
|
1147
|
+
module: ProjectedCollectionModuleDefinition | null | undefined,
|
|
1148
|
+
actionRefs: readonly PresentationViewProjectedActionRef[],
|
|
1149
|
+
): readonly ResolvedProjectedCollectionSelectionAction[] {
|
|
1150
|
+
return sortResolvedCollectionSelectionActions(actionRefs.flatMap((actionRef) => {
|
|
1151
|
+
if (actionRef.contextKind !== 'collection-selection' || !actionRef.selectionAction) {
|
|
1152
|
+
return []
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
const action = findPresentationAction<ActionDefinition>(
|
|
1156
|
+
module ?? null,
|
|
1157
|
+
actionRef.actionId,
|
|
1158
|
+
)
|
|
1159
|
+
|
|
1160
|
+
return action
|
|
1161
|
+
? [{
|
|
1162
|
+
action,
|
|
1163
|
+
actionRef,
|
|
1164
|
+
selectionAction: actionRef.selectionAction,
|
|
1165
|
+
slotId: actionRef.slotId ?? null,
|
|
1166
|
+
}]
|
|
1167
|
+
: []
|
|
1168
|
+
}))
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
/**
|
|
1172
|
+
* Sorts resolved row actions by declared action order.
|
|
1173
|
+
*/
|
|
1174
|
+
function sortResolvedCollectionRowActions(
|
|
1175
|
+
actions: readonly ResolvedProjectedCollectionRowAction[],
|
|
1176
|
+
) {
|
|
1177
|
+
return actions.slice().sort((left, right) => left.rowAction.Order - right.rowAction.Order)
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
/**
|
|
1181
|
+
* Sorts resolved selection actions by declared action order.
|
|
1182
|
+
*/
|
|
1183
|
+
function sortResolvedCollectionSelectionActions(
|
|
1184
|
+
actions: readonly ResolvedProjectedCollectionSelectionAction[],
|
|
1185
|
+
) {
|
|
1186
|
+
return actions
|
|
1187
|
+
.slice()
|
|
1188
|
+
.sort((left, right) => left.selectionAction.Order - right.selectionAction.Order)
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
/**
|
|
1192
|
+
* Resolves the row action invoked by row activation.
|
|
1193
|
+
*
|
|
1194
|
+
* An explicit activated-row action wins; otherwise the first primary row action
|
|
1195
|
+
* is used when row activation is enabled.
|
|
1196
|
+
*/
|
|
1197
|
+
function resolveActivatedCollectionRowAction(
|
|
1198
|
+
bodySlot: CollectionChromeSlotDefinition | null,
|
|
1199
|
+
rowActions: readonly ResolvedProjectedCollectionRowAction[],
|
|
1200
|
+
) {
|
|
1201
|
+
if (!bodySlot?.ActivateOnRowClick) {
|
|
1202
|
+
return null
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
return bodySlot.ActivatedRowActionId
|
|
1206
|
+
? rowActions.find(({ rowAction }) =>
|
|
1207
|
+
rowAction.Id === bodySlot.ActivatedRowActionId ||
|
|
1208
|
+
rowAction.ActionId === bodySlot.ActivatedRowActionId) ?? null
|
|
1209
|
+
: rowActions.find(({ rowAction }) => isPrimaryCollectionRowAction(rowAction)) ?? null
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
/**
|
|
1213
|
+
* Checks whether a row action is intended for the primary action surface.
|
|
1214
|
+
*/
|
|
1215
|
+
function isPrimaryCollectionRowAction(rowAction: CollectionRowActionDefinition) {
|
|
1216
|
+
return matchesProjectionEnum(rowAction.Kind, collectionRowActionKinds.primary, 'primary')
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
/**
|
|
1220
|
+
* Checks whether a row action is intended for contextual menu surfaces.
|
|
1221
|
+
*/
|
|
1222
|
+
function isContextMenuCollectionRowAction(rowAction: CollectionRowActionDefinition) {
|
|
1223
|
+
return matchesProjectionEnum(rowAction.Kind, collectionRowActionKinds.contextMenu, 'contextMenu')
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
/**
|
|
1227
|
+
* Creates a row action execution context with row-bound parameters and optional
|
|
1228
|
+
* navigation href.
|
|
1229
|
+
*/
|
|
1230
|
+
function createProjectedRowActionExecutionContext<TData extends object>(
|
|
1231
|
+
resolvedAction: ResolvedProjectedCollectionRowAction,
|
|
1232
|
+
row: TData,
|
|
1233
|
+
createHref:
|
|
1234
|
+
| ((routeId: string, parameters?: NavigationRouteParameters) => string | null)
|
|
1235
|
+
| undefined,
|
|
1236
|
+
): ProjectedRowActionExecutionContext<TData> {
|
|
1237
|
+
const { action, actionRef, rowAction } = resolvedAction
|
|
1238
|
+
const parameters = createProjectedRowActionParameters(actionRef, action, row)
|
|
1239
|
+
return {
|
|
1240
|
+
action,
|
|
1241
|
+
actionRef,
|
|
1242
|
+
contextKind: 'collection-row',
|
|
1243
|
+
href: createProjectedActionHrefFromParameters(action, parameters, createHref),
|
|
1244
|
+
parameters,
|
|
1245
|
+
row,
|
|
1246
|
+
rowAction,
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
/**
|
|
1251
|
+
* Creates a selection action execution context with selection-bound parameters
|
|
1252
|
+
* and optional navigation href.
|
|
1253
|
+
*/
|
|
1254
|
+
function createProjectedSelectionActionExecutionContext<TData extends object>(
|
|
1255
|
+
resolvedAction: ResolvedProjectedCollectionSelectionAction,
|
|
1256
|
+
selectedRows: readonly TData[],
|
|
1257
|
+
selectedRowIds: readonly string[],
|
|
1258
|
+
createHref:
|
|
1259
|
+
| ((routeId: string, parameters?: NavigationRouteParameters) => string | null)
|
|
1260
|
+
| undefined,
|
|
1261
|
+
): ProjectedSelectionActionExecutionContext<TData> {
|
|
1262
|
+
const { action, actionRef, selectionAction } = resolvedAction
|
|
1263
|
+
const parameters = createProjectedSelectionActionParameters(
|
|
1264
|
+
actionRef,
|
|
1265
|
+
selectedRows,
|
|
1266
|
+
selectedRowIds,
|
|
1267
|
+
)
|
|
1268
|
+
return {
|
|
1269
|
+
action,
|
|
1270
|
+
actionRef,
|
|
1271
|
+
contextKind: 'collection-selection',
|
|
1272
|
+
href: createProjectedActionHrefFromParameters(action, parameters, createHref),
|
|
1273
|
+
parameters,
|
|
1274
|
+
selectedRowIds,
|
|
1275
|
+
selectedRows,
|
|
1276
|
+
selectionAction,
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
/**
|
|
1281
|
+
* Builds a navigation href for actions that target a route.
|
|
1282
|
+
*/
|
|
1283
|
+
function createProjectedActionHrefFromParameters(
|
|
1284
|
+
action: ActionDefinition,
|
|
1285
|
+
parameters: NavigationRouteParameters,
|
|
1286
|
+
createHref:
|
|
1287
|
+
| ((routeId: string, parameters?: NavigationRouteParameters) => string | null)
|
|
1288
|
+
| undefined,
|
|
1289
|
+
) {
|
|
1290
|
+
const routeId = action.Binding?.RouteId ?? action.Result?.NavigateToRouteId ?? null
|
|
1291
|
+
if (!routeId || !createHref) {
|
|
1292
|
+
return null
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
return createHref(routeId, parameters)
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
/**
|
|
1299
|
+
* Creates row action parameters from explicit row-action bindings when present,
|
|
1300
|
+
* otherwise from action parameter names read directly from the row.
|
|
1301
|
+
*/
|
|
1302
|
+
function createProjectedRowActionParameters<TData extends object>(
|
|
1303
|
+
actionRef: PresentationViewProjectedActionRef,
|
|
1304
|
+
action: ActionDefinition,
|
|
1305
|
+
row: TData,
|
|
1306
|
+
) {
|
|
1307
|
+
const rowAction = actionRef.rowAction
|
|
1308
|
+
if (!rowAction) {
|
|
1309
|
+
return createProjectedActionParameters(row, action.Parameters ?? [])
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
return rowAction.Parameters.length > 0
|
|
1313
|
+
? createProjectedBoundActionParameters(row, rowAction.Parameters)
|
|
1314
|
+
: createProjectedActionParameters(row, action.Parameters ?? [])
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
/**
|
|
1318
|
+
* Creates route parameters for a selection action from its declared selection
|
|
1319
|
+
* parameter bindings.
|
|
1320
|
+
*/
|
|
1321
|
+
function createProjectedSelectionActionParameters<TData extends object>(
|
|
1322
|
+
actionRef: PresentationViewProjectedActionRef,
|
|
1323
|
+
selectedRows: readonly TData[],
|
|
1324
|
+
selectedRowIds: readonly string[],
|
|
1325
|
+
) {
|
|
1326
|
+
const selectionAction = actionRef.selectionAction
|
|
1327
|
+
if (!selectionAction) {
|
|
1328
|
+
return {}
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
const routeParameters: NavigationRouteParameters = {}
|
|
1332
|
+
for (const binding of selectionAction.Parameters) {
|
|
1333
|
+
const value = readProjectedSelectionActionParameterValue(
|
|
1334
|
+
binding,
|
|
1335
|
+
selectedRows,
|
|
1336
|
+
selectedRowIds,
|
|
1337
|
+
)
|
|
1338
|
+
if (value === null || value === undefined || isEmptySelectionParameterValue(value)) {
|
|
1339
|
+
if (!binding.OmitWhenEmpty) {
|
|
1340
|
+
routeParameters[binding.Name] = ''
|
|
1341
|
+
}
|
|
1342
|
+
continue
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
routeParameters[binding.Name] = Array.isArray(value)
|
|
1346
|
+
? value.map(toRouteParameterValue).join(',')
|
|
1347
|
+
: toRouteParameterValue(value)
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
return routeParameters
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
/**
|
|
1354
|
+
* Reads the raw value for a selection action parameter binding.
|
|
1355
|
+
*/
|
|
1356
|
+
function readProjectedSelectionActionParameterValue<TData extends object>(
|
|
1357
|
+
binding: CollectionSelectionActionDefinition['Parameters'][number],
|
|
1358
|
+
selectedRows: readonly TData[],
|
|
1359
|
+
selectedRowIds: readonly string[],
|
|
1360
|
+
) {
|
|
1361
|
+
if (matchesCollectionSelectionActionParameterSource(binding.Source, 'selectedRowIdentity')) {
|
|
1362
|
+
return selectedRowIds[0]
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
if (matchesCollectionSelectionActionParameterSource(binding.Source, 'selectedRowIdentityList')) {
|
|
1366
|
+
return selectedRowIds
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
if (matchesCollectionSelectionActionParameterSource(binding.Source, 'selectedRowValue')) {
|
|
1370
|
+
return binding.ValuePath && selectedRows[0]
|
|
1371
|
+
? readProjectedCollectionValue(selectedRows[0], binding.ValuePath)
|
|
1372
|
+
: undefined
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
if (matchesCollectionSelectionActionParameterSource(binding.Source, 'selectedRowValueList')) {
|
|
1376
|
+
return binding.ValuePath
|
|
1377
|
+
? selectedRows.map((row) => readProjectedCollectionValue(row, binding.ValuePath ?? ''))
|
|
1378
|
+
: []
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
if (matchesCollectionSelectionActionParameterSource(binding.Source, 'selectionCount')) {
|
|
1382
|
+
return selectedRowIds.length
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
return undefined
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
/**
|
|
1389
|
+
* Matches generated enum values and string fallback keys for selection action
|
|
1390
|
+
* parameter sources.
|
|
1391
|
+
*/
|
|
1392
|
+
function matchesCollectionSelectionActionParameterSource(
|
|
1393
|
+
source: CollectionSelectionActionDefinition['Parameters'][number]['Source'],
|
|
1394
|
+
key: keyof typeof collectionSelectionActionParameterSources,
|
|
1395
|
+
) {
|
|
1396
|
+
return source === collectionSelectionActionParameterSources[key] ||
|
|
1397
|
+
String(source).toLocaleLowerCase() === key.toLocaleLowerCase()
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
/**
|
|
1401
|
+
* Checks whether a selection parameter should be treated as empty.
|
|
1402
|
+
*/
|
|
1403
|
+
function isEmptySelectionParameterValue(value: unknown) {
|
|
1404
|
+
return Array.isArray(value) && value.length === 0
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
/**
|
|
1408
|
+
* Creates route parameters from row action parameter bindings.
|
|
1409
|
+
*/
|
|
1410
|
+
function createProjectedBoundActionParameters<TData extends object>(
|
|
1411
|
+
row: TData,
|
|
1412
|
+
bindings: readonly CollectionRowActionParameterBindingDefinition[],
|
|
1413
|
+
) {
|
|
1414
|
+
const routeParameters: NavigationRouteParameters = {}
|
|
1415
|
+
for (const binding of bindings) {
|
|
1416
|
+
const value = readProjectedCollectionValue(row, binding.ValuePath)
|
|
1417
|
+
if (value === null || value === undefined) {
|
|
1418
|
+
if (!binding.OmitWhenNull) {
|
|
1419
|
+
routeParameters[binding.Name] = ''
|
|
1420
|
+
}
|
|
1421
|
+
continue
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
routeParameters[binding.Name] = toRouteParameterValue(value)
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
return routeParameters
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
/**
|
|
1431
|
+
* Creates route parameters by reading action parameter names from a row object.
|
|
1432
|
+
*/
|
|
1433
|
+
function createProjectedActionParameters<TData extends object>(
|
|
1434
|
+
row: TData,
|
|
1435
|
+
parameters: readonly ProjectedCollectionParameterDefinition[],
|
|
1436
|
+
) {
|
|
1437
|
+
const routeParameters: NavigationRouteParameters = {}
|
|
1438
|
+
for (const parameter of parameters) {
|
|
1439
|
+
const value = readObjectProperty(row, parameter.Name)
|
|
1440
|
+
if (value === null || value === undefined) {
|
|
1441
|
+
continue
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
routeParameters[parameter.Name] = toRouteParameterValue(value)
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
return routeParameters
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
/**
|
|
1451
|
+
* Checks host runtime visibility, disabled state, and optional `canExecute`
|
|
1452
|
+
* before allowing action invocation.
|
|
1453
|
+
*/
|
|
1454
|
+
function canInvokeProjectedCollectionAction<TData extends object>(
|
|
1455
|
+
context: ProjectedCollectionActionExecutionContext<TData>,
|
|
1456
|
+
actionRuntimes?: ProjectedCollectionActionRuntimeRegistry<TData>,
|
|
1457
|
+
) {
|
|
1458
|
+
const runtime = resolveProjectedCollectionActionRuntime(actionRuntimes, context)
|
|
1459
|
+
if (runtime?.isHidden || runtime?.isDisabled) {
|
|
1460
|
+
return false
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
if (runtime?.execute) {
|
|
1464
|
+
return runtime.canExecute?.(context) ?? true
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
return false
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
/**
|
|
1471
|
+
* Row-action convenience wrapper around generic collection action invocation
|
|
1472
|
+
* checks.
|
|
1473
|
+
*/
|
|
1474
|
+
function canInvokeProjectedRowAction<TData extends object>(
|
|
1475
|
+
context: ProjectedRowActionExecutionContext<TData>,
|
|
1476
|
+
actionRuntimes?: ProjectedCollectionActionRuntimeRegistry<TData>,
|
|
1477
|
+
) {
|
|
1478
|
+
return canInvokeProjectedCollectionAction(context, actionRuntimes)
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
/**
|
|
1482
|
+
* Invokes an action through the host action runtime when it is executable.
|
|
1483
|
+
*/
|
|
1484
|
+
async function invokeProjectedCollectionAction<TData extends object>(
|
|
1485
|
+
context: ProjectedCollectionActionExecutionContext<TData>,
|
|
1486
|
+
actionRuntimes?: ProjectedCollectionActionRuntimeRegistry<TData>,
|
|
1487
|
+
) {
|
|
1488
|
+
const runtime = resolveProjectedCollectionActionRuntime(actionRuntimes, context)
|
|
1489
|
+
if (
|
|
1490
|
+
runtime?.execute &&
|
|
1491
|
+
!runtime.isHidden &&
|
|
1492
|
+
!runtime.isDisabled &&
|
|
1493
|
+
(runtime.canExecute?.(context) ?? true)
|
|
1494
|
+
) {
|
|
1495
|
+
await runtime.execute(context)
|
|
1496
|
+
return
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
/**
|
|
1501
|
+
* Row-action convenience wrapper around generic collection action invocation.
|
|
1502
|
+
*/
|
|
1503
|
+
async function invokeProjectedRowAction<TData extends object>(
|
|
1504
|
+
context: ProjectedRowActionExecutionContext<TData>,
|
|
1505
|
+
actionRuntimes?: ProjectedCollectionActionRuntimeRegistry<TData>,
|
|
1506
|
+
) {
|
|
1507
|
+
await invokeProjectedCollectionAction(context, actionRuntimes)
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
/**
|
|
1511
|
+
* Selection-action convenience wrapper around generic collection action
|
|
1512
|
+
* invocation checks.
|
|
1513
|
+
*/
|
|
1514
|
+
function canInvokeProjectedSelectionAction<TData extends object>(
|
|
1515
|
+
context: ProjectedSelectionActionExecutionContext<TData>,
|
|
1516
|
+
actionRuntimes?: ProjectedCollectionActionRuntimeRegistry<TData>,
|
|
1517
|
+
) {
|
|
1518
|
+
return canInvokeProjectedCollectionAction(context, actionRuntimes)
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
/**
|
|
1522
|
+
* Selection-action convenience wrapper around generic collection action
|
|
1523
|
+
* invocation.
|
|
1524
|
+
*/
|
|
1525
|
+
async function invokeProjectedSelectionAction<TData extends object>(
|
|
1526
|
+
context: ProjectedSelectionActionExecutionContext<TData>,
|
|
1527
|
+
actionRuntimes?: ProjectedCollectionActionRuntimeRegistry<TData>,
|
|
1528
|
+
) {
|
|
1529
|
+
await invokeProjectedCollectionAction(context, actionRuntimes)
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
/**
|
|
1533
|
+
* Resolves the host action runtime by action identifier.
|
|
1534
|
+
*/
|
|
1535
|
+
function resolveProjectedCollectionActionRuntime<TData extends object>(
|
|
1536
|
+
actionRuntimes: ProjectedCollectionActionRuntimeRegistry<TData> | undefined,
|
|
1537
|
+
context: ProjectedCollectionActionExecutionContext<TData>,
|
|
1538
|
+
) {
|
|
1539
|
+
return actionRuntimes?.[context.action.Id] ?? null
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
/**
|
|
1543
|
+
* Checks whether the current selection count is inside an action's declared
|
|
1544
|
+
* min/max bounds.
|
|
1545
|
+
*/
|
|
1546
|
+
function isSelectionActionSelectionCountEnabled(
|
|
1547
|
+
selectionAction: CollectionSelectionActionDefinition,
|
|
1548
|
+
selectionCount: number,
|
|
1549
|
+
) {
|
|
1550
|
+
return selectionCount >= selectionAction.MinimumSelectionCount &&
|
|
1551
|
+
(
|
|
1552
|
+
selectionAction.MaximumSelectionCount === null ||
|
|
1553
|
+
selectionAction.MaximumSelectionCount === undefined ||
|
|
1554
|
+
selectionCount <= selectionAction.MaximumSelectionCount
|
|
1555
|
+
)
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
/**
|
|
1559
|
+
* Evaluates row action visibility or enablement predicates against a row.
|
|
1560
|
+
*/
|
|
1561
|
+
function evaluateProjectedRowActionPredicate<TData extends object>(
|
|
1562
|
+
predicate: CollectionRowActionDefinition['IsEnabled'],
|
|
1563
|
+
row: TData,
|
|
1564
|
+
fallback: boolean,
|
|
1565
|
+
) {
|
|
1566
|
+
if (!predicate) {
|
|
1567
|
+
return fallback
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
if (
|
|
1571
|
+
predicate.Kind === presentationValueKinds.literal ||
|
|
1572
|
+
String(predicate.Kind).toLocaleLowerCase() === 'literal'
|
|
1573
|
+
) {
|
|
1574
|
+
return coercePredicateValue(predicate.Literal, fallback)
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
if (
|
|
1578
|
+
predicate.Field &&
|
|
1579
|
+
(
|
|
1580
|
+
predicate.Kind === presentationValueKinds.field ||
|
|
1581
|
+
String(predicate.Kind).toLocaleLowerCase() === 'field'
|
|
1582
|
+
)
|
|
1583
|
+
) {
|
|
1584
|
+
return coercePredicateValue(readProjectedCollectionValue(row, predicate.Field), fallback)
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
return fallback
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
/**
|
|
1591
|
+
* Evaluates selection action visibility or enablement predicates against the
|
|
1592
|
+
* first selected row.
|
|
1593
|
+
*/
|
|
1594
|
+
function evaluateProjectedSelectionActionPredicate<TData extends object>(
|
|
1595
|
+
predicate: CollectionSelectionActionDefinition['IsEnabled'],
|
|
1596
|
+
selectedRows: readonly TData[],
|
|
1597
|
+
fallback: boolean,
|
|
1598
|
+
) {
|
|
1599
|
+
if (!predicate) {
|
|
1600
|
+
return fallback
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
if (
|
|
1604
|
+
predicate.Kind === presentationValueKinds.literal ||
|
|
1605
|
+
String(predicate.Kind).toLocaleLowerCase() === 'literal'
|
|
1606
|
+
) {
|
|
1607
|
+
return coercePredicateValue(predicate.Literal, fallback)
|
|
1608
|
+
}
|
|
1609
|
+
|
|
1610
|
+
if (
|
|
1611
|
+
predicate.Field &&
|
|
1612
|
+
selectedRows[0] &&
|
|
1613
|
+
(
|
|
1614
|
+
predicate.Kind === presentationValueKinds.field ||
|
|
1615
|
+
String(predicate.Kind).toLocaleLowerCase() === 'field'
|
|
1616
|
+
)
|
|
1617
|
+
) {
|
|
1618
|
+
return coercePredicateValue(
|
|
1619
|
+
readProjectedCollectionValue(selectedRows[0], predicate.Field),
|
|
1620
|
+
fallback,
|
|
1621
|
+
)
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
return fallback
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
/**
|
|
1628
|
+
* Coerces presentation predicate values into booleans while preserving the
|
|
1629
|
+
* caller-provided fallback for unsupported values.
|
|
1630
|
+
*/
|
|
1631
|
+
function coercePredicateValue(value: unknown, fallback: boolean) {
|
|
1632
|
+
if (value === null || value === undefined) {
|
|
1633
|
+
return fallback
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
if (typeof value === 'boolean') {
|
|
1637
|
+
return value
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
if (typeof value === 'number') {
|
|
1641
|
+
return value !== 0
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
if (typeof value === 'string') {
|
|
1645
|
+
const normalized = value.trim().toLocaleLowerCase()
|
|
1646
|
+
if (normalized === 'true' || normalized === '1' || normalized === 'yes') {
|
|
1647
|
+
return true
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
if (normalized === 'false' || normalized === '0' || normalized === 'no' || normalized === '') {
|
|
1651
|
+
return false
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1655
|
+
return fallback
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
/**
|
|
1659
|
+
* Converts arbitrary parameter values into route parameter primitives.
|
|
1660
|
+
*/
|
|
1661
|
+
function toRouteParameterValue(value: unknown) {
|
|
1662
|
+
return typeof value === 'boolean' || typeof value === 'number' || typeof value === 'string'
|
|
1663
|
+
? value
|
|
1664
|
+
: String(value)
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
/**
|
|
1668
|
+
* Reads a projected collection value from a row.
|
|
1669
|
+
*
|
|
1670
|
+
* Exact object-path lookup is attempted first. If it is missing, the final path
|
|
1671
|
+
* segment is used as a direct property fallback for flatter data shapes.
|
|
1672
|
+
*/
|
|
1673
|
+
export function readProjectedCollectionValue<TData extends object>(
|
|
1674
|
+
row: TData,
|
|
1675
|
+
fieldPath: string,
|
|
1676
|
+
) {
|
|
1677
|
+
const exactValue = readObjectPath(row, fieldPath)
|
|
1678
|
+
if (exactValue !== undefined) {
|
|
1679
|
+
return exactValue
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
const fieldName = fieldPath.split('.').at(-1) ?? fieldPath
|
|
1683
|
+
return readObjectProperty(row, fieldName)
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
/**
|
|
1687
|
+
* Reads a stable row identity from a row, falling back to the visible row index
|
|
1688
|
+
* when the declared identity path is missing.
|
|
1689
|
+
*/
|
|
1690
|
+
export function readProjectedCollectionRowIdentity<TData extends object>(
|
|
1691
|
+
row: TData,
|
|
1692
|
+
rowIdentityPath: string,
|
|
1693
|
+
index: number,
|
|
1694
|
+
) {
|
|
1695
|
+
const value = readProjectedCollectionValue(row, rowIdentityPath)
|
|
1696
|
+
return value === null || value === undefined ? String(index) : String(value)
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
/**
|
|
1700
|
+
* Reads a display label for a row.
|
|
1701
|
+
*
|
|
1702
|
+
* The declared label path is preferred, followed by conventional `Name` and
|
|
1703
|
+
* `Id` properties.
|
|
1704
|
+
*/
|
|
1705
|
+
export function readProjectedCollectionRowLabel<TData extends object>(
|
|
1706
|
+
row: TData,
|
|
1707
|
+
rowLabelPath: string | null | undefined,
|
|
1708
|
+
) {
|
|
1709
|
+
const pathValue = rowLabelPath
|
|
1710
|
+
? readObjectPath(row, rowLabelPath)
|
|
1711
|
+
: undefined
|
|
1712
|
+
const value = pathValue ??
|
|
1713
|
+
readObjectProperty(row, 'Name') ??
|
|
1714
|
+
readObjectProperty(row, 'Id')
|
|
1715
|
+
return value === null || value === undefined ? null : String(value)
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
/**
|
|
1719
|
+
* Checks whether a collection selection mode enables any row selection.
|
|
1720
|
+
*/
|
|
1721
|
+
export function isCollectionSelectionEnabled(mode: CollectionSelectionMode) {
|
|
1722
|
+
return matchesProjectionEnum(mode, collectionSelectionModes.single, 'single') ||
|
|
1723
|
+
matchesProjectionEnum(mode, collectionSelectionModes.multiple, 'multiple')
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
/**
|
|
1727
|
+
* Checks whether a collection selection mode allows multiple selected rows.
|
|
1728
|
+
*/
|
|
1729
|
+
export function isMultipleCollectionSelection(mode: CollectionSelectionMode) {
|
|
1730
|
+
return matchesProjectionEnum(mode, collectionSelectionModes.multiple, 'multiple')
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
/**
|
|
1734
|
+
* Checks whether a detail slot can render as a persistent detail surface.
|
|
1735
|
+
*/
|
|
1736
|
+
function isRenderableCollectionDetailSlot(
|
|
1737
|
+
slot: CollectionChromeSlotDefinition | null,
|
|
1738
|
+
) {
|
|
1739
|
+
return Boolean(
|
|
1740
|
+
slot?.DetailViewId &&
|
|
1741
|
+
!isCollectionDetailActivationNone(slot.DetailActivation) &&
|
|
1742
|
+
!isCollectionDetailActivationHover(slot.DetailActivation),
|
|
1743
|
+
)
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
/**
|
|
1747
|
+
* Checks whether detail activation is explicitly disabled.
|
|
1748
|
+
*/
|
|
1749
|
+
function isCollectionDetailActivationNone(activation: unknown) {
|
|
1750
|
+
return matchesProjectionEnum(activation, collectionDetailActivations.none, 'none')
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
/**
|
|
1754
|
+
* Checks whether detail activation is hover-only and therefore not renderable
|
|
1755
|
+
* as the selected-row detail surface.
|
|
1756
|
+
*/
|
|
1757
|
+
function isCollectionDetailActivationHover(activation: unknown) {
|
|
1758
|
+
return matchesProjectionEnum(activation, collectionDetailActivations.hover, 'hover')
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
/**
|
|
1762
|
+
* Matches generated enum values while tolerating string fallback keys from
|
|
1763
|
+
* non-generated or serialized projection inputs.
|
|
1764
|
+
*/
|
|
1765
|
+
function matchesProjectionEnum(
|
|
1766
|
+
value: unknown,
|
|
1767
|
+
generatedValue: unknown,
|
|
1768
|
+
fallbackKey: string,
|
|
1769
|
+
) {
|
|
1770
|
+
return value === generatedValue ||
|
|
1771
|
+
String(value).toLocaleLowerCase() === fallbackKey.toLocaleLowerCase()
|
|
1772
|
+
}
|