@cosmicdrift/kumiko-renderer 0.388.0 → 0.390.0
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/dist/app/base-path-context.d.ts +9 -0
- package/dist/app/base-path-context.js +13 -0
- package/dist/app/base-path.d.ts +3 -0
- package/dist/app/base-path.js +27 -0
- package/dist/app/config-edit-body.d.ts +1 -1
- package/dist/app/config-edit-body.js +15 -6
- package/dist/app/config-edit-without-secret-fields.d.ts +2 -0
- package/dist/app/config-edit-without-secret-fields.js +28 -0
- package/dist/app/entity-list-facet-specs.d.ts +3 -0
- package/dist/app/entity-list-facet-specs.js +65 -0
- package/dist/app/entity-list-screen.js +74 -206
- package/dist/app/kumiko-screen.js +6 -14
- package/dist/app/list-bulk-actions.d.ts +18 -0
- package/dist/app/list-bulk-actions.js +54 -0
- package/dist/app/locked-screen-header.d.ts +9 -0
- package/dist/app/locked-screen-header.js +33 -0
- package/dist/app/projection-detail-body.js +59 -394
- package/dist/app/projection-detail-header-model.d.ts +11 -0
- package/dist/app/projection-detail-header-model.js +33 -0
- package/dist/app/projection-detail-header-region.d.ts +28 -0
- package/dist/app/projection-detail-header-region.js +81 -0
- package/dist/app/projection-detail-header.d.ts +29 -0
- package/dist/app/projection-detail-header.js +84 -0
- package/dist/app/projection-detail-navigation.d.ts +13 -0
- package/dist/app/projection-detail-navigation.js +91 -0
- package/dist/app/projection-detail-states.d.ts +22 -0
- package/dist/app/projection-detail-states.js +26 -0
- package/dist/app/projection-drawer-host.d.ts +12 -0
- package/dist/app/projection-drawer-host.js +10 -0
- package/dist/app/projection-list-body.d.ts +1 -1
- package/dist/app/projection-list-body.js +82 -197
- package/dist/app/projection-list-render-props.d.ts +56 -0
- package/dist/app/projection-list-render-props.js +47 -0
- package/dist/app/projection-list-render.d.ts +26 -0
- package/dist/app/projection-list-render.js +20 -0
- package/dist/app/projection-list-row-click.d.ts +12 -0
- package/dist/app/projection-list-row-click.js +14 -0
- package/dist/app/row-actions.d.ts +3 -0
- package/dist/app/row-actions.js +10 -5
- package/dist/app/screen-shared.js +9 -2
- package/dist/app/use-entity-range-facets.d.ts +24 -0
- package/dist/app/use-entity-range-facets.js +64 -0
- package/dist/app/use-projection-date-range.d.ts +12 -0
- package/dist/app/use-projection-date-range.js +21 -0
- package/dist/app/use-projection-detail-actions.d.ts +35 -0
- package/dist/app/use-projection-detail-actions.js +156 -0
- package/dist/app/use-projection-detail-data.d.ts +19 -0
- package/dist/app/use-projection-detail-data.js +47 -0
- package/dist/app/use-projection-detail-layout.d.ts +17 -0
- package/dist/app/use-projection-detail-layout.js +23 -0
- package/dist/app/use-projection-list-actions.d.ts +31 -0
- package/dist/app/use-projection-list-actions.js +73 -0
- package/dist/app/use-projection-list-data.d.ts +20 -0
- package/dist/app/use-projection-list-data.js +26 -0
- package/dist/app/use-projection-list-definitions.d.ts +11 -0
- package/dist/app/use-projection-list-definitions.js +20 -0
- package/dist/app/use-projection-list-query.d.ts +28 -0
- package/dist/app/use-projection-list-query.js +83 -0
- package/dist/app/use-screen-list-rows.d.ts +37 -0
- package/dist/app/use-screen-list-rows.js +104 -0
- package/dist/app/use-screen-list-table.d.ts +24 -0
- package/dist/app/use-screen-list-table.js +46 -0
- package/dist/components/list-group-page-bridges.d.ts +3 -0
- package/dist/components/list-group-page-bridges.js +31 -0
- package/dist/components/list-state-store.d.ts +16 -0
- package/dist/components/list-state-store.js +31 -0
- package/dist/components/related-list-section.js +37 -89
- package/dist/components/render-edit-banners.d.ts +12 -0
- package/dist/components/render-edit-banners.js +90 -0
- package/dist/components/render-edit-draft-save-helpers.d.ts +19 -0
- package/dist/components/render-edit-draft-save-helpers.js +42 -0
- package/dist/components/render-edit-field-grid.d.ts +4 -0
- package/dist/components/render-edit-field-grid.js +40 -0
- package/dist/components/render-edit-fields-section.d.ts +4 -0
- package/dist/components/render-edit-fields-section.js +76 -0
- package/dist/components/render-edit-form-actions.d.ts +4 -0
- package/dist/components/render-edit-form-actions.js +66 -0
- package/dist/components/render-edit-header-actions.d.ts +11 -0
- package/dist/components/render-edit-header-actions.js +120 -0
- package/dist/components/render-edit-layout-flags.d.ts +29 -0
- package/dist/components/render-edit-layout-flags.js +106 -0
- package/dist/components/render-edit-layout.d.ts +4 -0
- package/dist/components/render-edit-layout.js +79 -0
- package/dist/components/render-edit-render-model.d.ts +63 -0
- package/dist/components/render-edit-render-model.js +14 -0
- package/dist/components/render-edit-section-kinds.d.ts +4 -0
- package/dist/components/render-edit-section-kinds.js +115 -0
- package/dist/components/render-edit-submit-result.d.ts +8 -0
- package/dist/components/render-edit-submit-result.js +77 -0
- package/dist/components/render-edit-submit.d.ts +7 -0
- package/dist/components/render-edit-submit.js +113 -0
- package/dist/components/render-edit-titles.d.ts +17 -0
- package/dist/components/render-edit-titles.js +99 -0
- package/dist/components/render-edit-wizard-navigation.d.ts +11 -0
- package/dist/components/render-edit-wizard-navigation.js +115 -0
- package/dist/components/render-edit.d.ts +2 -2
- package/dist/components/render-edit.js +63 -1128
- package/dist/components/render-field-choice-inputs.d.ts +7 -0
- package/dist/components/render-field-choice-inputs.js +52 -0
- package/dist/components/render-field-control.d.ts +12 -0
- package/dist/components/render-field-control.js +93 -0
- package/dist/components/render-field-display-text.d.ts +4 -0
- package/dist/components/render-field-display-text.js +48 -0
- package/dist/components/render-field-fill-action.d.ts +13 -0
- package/dist/components/render-field-fill-action.js +63 -0
- package/dist/components/render-field-input-shared.d.ts +39 -0
- package/dist/components/render-field-input-shared.js +20 -0
- package/dist/components/render-field-input.d.ts +3 -0
- package/dist/components/render-field-input.js +34 -0
- package/dist/components/render-field-meta.d.ts +6 -0
- package/dist/components/render-field-meta.js +51 -0
- package/dist/components/render-field-read-only.d.ts +11 -0
- package/dist/components/render-field-read-only.js +75 -0
- package/dist/components/render-field-reference.d.ts +15 -0
- package/dist/components/render-field-reference.js +103 -0
- package/dist/components/render-field-scalar-inputs.d.ts +10 -0
- package/dist/components/render-field-scalar-inputs.js +35 -0
- package/dist/components/render-field-text-inputs.d.ts +3 -0
- package/dist/components/render-field-text-inputs.js +34 -0
- package/dist/components/render-field-values.d.ts +18 -0
- package/dist/components/render-field-values.js +111 -0
- package/dist/components/render-field-write-only.d.ts +9 -0
- package/dist/components/render-field-write-only.js +29 -0
- package/dist/components/render-field.d.ts +2 -2
- package/dist/components/render-field.js +39 -669
- package/dist/components/render-list-header-slot.d.ts +5 -0
- package/dist/components/render-list-header-slot.js +30 -0
- package/dist/components/render-list-reference-bridge.d.ts +3 -0
- package/dist/components/render-list-reference-bridge.js +25 -0
- package/dist/components/render-list-reference-columns.d.ts +25 -0
- package/dist/components/render-list-reference-columns.js +137 -0
- package/dist/components/render-list-table-props.d.ts +52 -0
- package/dist/components/render-list-table-props.js +53 -0
- package/dist/components/render-list-toolbar-action.d.ts +27 -0
- package/dist/components/render-list-toolbar-action.js +40 -0
- package/dist/components/render-list-toolbar-model.d.ts +42 -0
- package/dist/components/render-list-toolbar-model.js +82 -0
- package/dist/components/render-list-toolbar.d.ts +38 -0
- package/dist/components/render-list-toolbar.js +40 -0
- package/dist/components/render-list-types.d.ts +113 -0
- package/dist/components/render-list-types.js +1 -0
- package/dist/components/render-list.d.ts +5 -130
- package/dist/components/render-list.js +95 -319
- package/dist/components/use-reference-input-state.d.ts +20 -0
- package/dist/components/use-reference-input-state.js +85 -0
- package/dist/components/use-render-edit-controlled-sync.d.ts +3 -0
- package/dist/components/use-render-edit-controlled-sync.js +26 -0
- package/dist/components/use-render-edit-draft-save.d.ts +29 -0
- package/dist/components/use-render-edit-draft-save.js +141 -0
- package/dist/components/use-render-edit-form.d.ts +10 -0
- package/dist/components/use-render-edit-form.js +101 -0
- package/dist/components/use-render-edit-sections.d.ts +15 -0
- package/dist/components/use-render-edit-sections.js +100 -0
- package/dist/components/use-render-edit-state.d.ts +65 -0
- package/dist/components/use-render-edit-state.js +158 -0
- package/dist/components/use-render-edit-steps.d.ts +13 -0
- package/dist/components/use-render-edit-steps.js +52 -0
- package/dist/components/use-render-list-columns.d.ts +18 -0
- package/dist/components/use-render-list-columns.js +41 -0
- package/dist/components/use-render-list-search.d.ts +4 -0
- package/dist/components/use-render-list-search.js +50 -0
- package/dist/current-user.d.ts +2 -0
- package/dist/data-table-aggregate-types.d.ts +47 -0
- package/dist/data-table-aggregate-types.js +1 -0
- package/dist/data-table-bulk-types.d.ts +27 -0
- package/dist/data-table-bulk-types.js +1 -0
- package/dist/data-table-facet-types.d.ts +36 -0
- package/dist/data-table-facet-types.js +1 -0
- package/dist/data-table-view-types.d.ts +73 -0
- package/dist/data-table-view-types.js +1 -0
- package/dist/headless/view-model/edit.js +3 -1
- package/dist/headless/view-model/types.d.ts +4 -2
- package/dist/hooks/list-column-layout.d.ts +19 -0
- package/dist/hooks/list-column-layout.js +36 -0
- package/dist/hooks/list-group-pages.d.ts +26 -0
- package/dist/hooks/list-group-pages.js +37 -0
- package/dist/hooks/list-reset.d.ts +8 -0
- package/dist/hooks/list-reset.js +15 -0
- package/dist/hooks/list-server-groups.d.ts +39 -0
- package/dist/hooks/list-server-groups.js +84 -0
- package/dist/hooks/list-state-schema.d.ts +28 -0
- package/dist/hooks/list-state-schema.js +76 -0
- package/dist/hooks/use-bulk-run.d.ts +41 -0
- package/dist/hooks/use-bulk-run.js +65 -0
- package/dist/hooks/use-group-load-state.d.ts +11 -0
- package/dist/hooks/use-group-load-state.js +31 -0
- package/dist/hooks/use-list-aggregates.d.ts +38 -0
- package/dist/hooks/use-list-aggregates.js +107 -0
- package/dist/hooks/use-list-table.d.ts +38 -0
- package/dist/hooks/use-list-table.js +91 -0
- package/dist/hooks/use-list-view-state.d.ts +43 -0
- package/dist/hooks/use-list-view-state.js +161 -0
- package/dist/hooks/use-related-list-rows.d.ts +27 -0
- package/dist/hooks/use-related-list-rows.js +81 -0
- package/dist/hooks/use-related-list-state.d.ts +15 -0
- package/dist/hooks/use-related-list-state.js +31 -0
- package/dist/hooks/use-remembered-list-params.d.ts +13 -0
- package/dist/hooks/use-remembered-list-params.js +53 -0
- package/dist/hooks/use-remembered-local-list-state.d.ts +26 -0
- package/dist/hooks/use-remembered-local-list-state.js +63 -0
- package/dist/i18n-defaults.js +53 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2 -0
- package/dist/primitives.d.ts +11 -47
- package/dist/web/app/create-app.d.ts +5 -0
- package/dist/web/app/create-app.js +7 -4
- package/dist/web/app/dashboard-body.d.ts +1 -1
- package/dist/web/app/dashboard-body.js +42 -246
- package/dist/web/app/dashboard-header.d.ts +34 -0
- package/dist/web/app/dashboard-header.js +58 -0
- package/dist/web/app/dashboard-screen-controls.d.ts +11 -0
- package/dist/web/app/dashboard-screen-controls.js +42 -0
- package/dist/web/app/dashboard-screen-tiles.d.ts +8 -0
- package/dist/web/app/dashboard-screen-tiles.js +42 -0
- package/dist/web/app/dashboard-visibility.d.ts +42 -0
- package/dist/web/app/dashboard-visibility.js +102 -0
- package/dist/web/app/history-leave-guard.d.ts +6 -0
- package/dist/web/app/history-leave-guard.js +115 -0
- package/dist/web/app/list-state-store-boot.d.ts +6 -0
- package/dist/web/app/list-state-store-boot.js +15 -0
- package/dist/web/app/nav.js +7 -54
- package/dist/web/app/session-list-state-store.d.ts +15 -0
- package/dist/web/app/session-list-state-store.js +117 -0
- package/dist/web/app/use-dashboard-screen-state.d.ts +35 -0
- package/dist/web/app/use-dashboard-screen-state.js +69 -0
- package/dist/web/index.d.ts +1 -0
- package/dist/web/index.js +1 -0
- package/dist/web/lib/export-xlsx-request.d.ts +11 -0
- package/dist/web/lib/export-xlsx-request.js +46 -0
- package/dist/web/primitives/data-table/actions-column.d.ts +16 -0
- package/dist/web/primitives/data-table/actions-column.js +35 -0
- package/dist/web/primitives/data-table/bulk-selection-bar.d.ts +20 -0
- package/dist/web/primitives/data-table/bulk-selection-bar.js +37 -0
- package/dist/web/primitives/data-table/card-body.d.ts +6 -0
- package/dist/web/primitives/data-table/card-body.js +32 -0
- package/dist/web/primitives/data-table/card-row.d.ts +5 -0
- package/dist/web/primitives/data-table/card-row.js +31 -0
- package/dist/web/primitives/data-table/card-sort-select.d.ts +14 -0
- package/dist/web/primitives/data-table/card-sort-select.js +40 -0
- package/dist/web/primitives/data-table/card-view.d.ts +3 -0
- package/dist/web/primitives/data-table/card-view.js +13 -0
- package/dist/web/primitives/data-table/column-layout-mode.d.ts +5 -0
- package/dist/web/primitives/data-table/column-layout-mode.js +10 -0
- package/dist/web/primitives/data-table/column-picker-section.d.ts +7 -0
- package/dist/web/primitives/data-table/column-picker-section.js +35 -0
- package/dist/web/primitives/data-table/column-resize-handle.d.ts +14 -0
- package/dist/web/primitives/data-table/column-resize-handle.js +48 -0
- package/dist/web/primitives/data-table/data-cell-props.d.ts +7 -0
- package/dist/web/primitives/data-table/data-cell-props.js +8 -0
- package/dist/web/primitives/data-table/density.d.ts +14 -0
- package/dist/web/primitives/data-table/density.js +20 -0
- package/dist/web/primitives/data-table/export-button.d.ts +5 -0
- package/dist/web/primitives/data-table/export-button.js +37 -0
- package/dist/web/primitives/data-table/facet-cluster.d.ts +8 -0
- package/dist/web/primitives/data-table/facet-cluster.js +37 -0
- package/dist/web/primitives/data-table/group-band.d.ts +28 -0
- package/dist/web/primitives/data-table/group-band.js +53 -0
- package/dist/web/primitives/data-table/measure-value.d.ts +10 -0
- package/dist/web/primitives/data-table/measure-value.js +28 -0
- package/dist/web/primitives/data-table/pin-section.d.ts +8 -0
- package/dist/web/primitives/data-table/pin-section.js +20 -0
- package/dist/web/primitives/data-table/reset-all-button.d.ts +4 -0
- package/dist/web/primitives/data-table/reset-all-button.js +8 -0
- package/dist/web/primitives/data-table/row-render-parts.d.ts +8 -0
- package/dist/web/primitives/data-table/row-render-parts.js +35 -0
- package/dist/web/primitives/data-table/server-group-header.d.ts +11 -0
- package/dist/web/primitives/data-table/server-group-header.js +51 -0
- package/dist/web/primitives/data-table/sortable-header.d.ts +17 -0
- package/dist/web/primitives/data-table/sortable-header.js +41 -0
- package/dist/web/primitives/data-table/table-body.d.ts +3 -0
- package/dist/web/primitives/data-table/table-body.js +32 -0
- package/dist/web/primitives/data-table/table-chrome.d.ts +13 -0
- package/dist/web/primitives/data-table/table-chrome.js +30 -0
- package/dist/web/primitives/data-table/table-content.d.ts +3 -0
- package/dist/web/primitives/data-table/table-content.js +41 -0
- package/dist/web/primitives/data-table/table-data-cell.d.ts +4 -0
- package/dist/web/primitives/data-table/table-data-cell.js +25 -0
- package/dist/web/primitives/data-table/table-footer.d.ts +7 -0
- package/dist/web/primitives/data-table/table-footer.js +20 -0
- package/dist/web/primitives/data-table/table-header-row.d.ts +3 -0
- package/dist/web/primitives/data-table/table-header-row.js +21 -0
- package/dist/web/primitives/data-table/table-view.d.ts +3 -0
- package/dist/web/primitives/data-table/table-view.js +25 -0
- package/dist/web/primitives/data-table/toolbar-end-cluster.d.ts +10 -0
- package/dist/web/primitives/data-table/toolbar-end-cluster.js +13 -0
- package/dist/web/primitives/data-table/toolbar.d.ts +6 -0
- package/dist/web/primitives/data-table/toolbar.js +53 -0
- package/dist/web/primitives/data-table/totals-footer.d.ts +24 -0
- package/dist/web/primitives/data-table/totals-footer.js +48 -0
- package/dist/web/primitives/data-table/use-bulk-selection.d.ts +21 -0
- package/dist/web/primitives/data-table/use-bulk-selection.js +66 -0
- package/dist/web/primitives/data-table/use-column-pins.d.ts +32 -0
- package/dist/web/primitives/data-table/use-column-pins.js +117 -0
- package/dist/web/primitives/data-table/use-column-sizing.d.ts +22 -0
- package/dist/web/primitives/data-table/use-column-sizing.js +44 -0
- package/dist/web/primitives/data-table/use-data-table-state.d.ts +44 -0
- package/dist/web/primitives/data-table/use-data-table-state.js +123 -0
- package/dist/web/primitives/data-table/use-measured-column-widths.d.ts +15 -0
- package/dist/web/primitives/data-table/use-measured-column-widths.js +83 -0
- package/dist/web/primitives/data-table/use-row-keyboard-navigation.d.ts +22 -0
- package/dist/web/primitives/data-table/use-row-keyboard-navigation.js +65 -0
- package/dist/web/primitives/data-table/use-row-selection.d.ts +14 -0
- package/dist/web/primitives/data-table/use-row-selection.js +48 -0
- package/dist/web/primitives/data-table/use-view-columns.d.ts +6 -0
- package/dist/web/primitives/data-table/use-view-columns.js +17 -0
- package/dist/web/primitives/data-table/view-menu.d.ts +8 -0
- package/dist/web/primitives/data-table/view-menu.js +45 -0
- package/dist/web/primitives/data-table-cell.d.ts +0 -22
- package/dist/web/primitives/data-table-cell.js +1 -58
- package/dist/web/primitives/data-table.d.ts +3 -4
- package/dist/web/primitives/data-table.js +30 -272
- package/dist/web/primitives/file-value-list.d.ts +1 -1
- package/dist/web/primitives/file-value-list.js +5 -5
- package/dist/web/primitives/form-footer-parts.d.ts +25 -0
- package/dist/web/primitives/form-footer-parts.js +55 -0
- package/dist/web/primitives/form.js +33 -43
- package/dist/web/primitives/input-choice-kinds.d.ts +4 -0
- package/dist/web/primitives/input-choice-kinds.js +67 -0
- package/dist/web/primitives/input-file-kinds.d.ts +3 -0
- package/dist/web/primitives/input-file-kinds.js +6 -0
- package/dist/web/primitives/input-number-kinds.d.ts +4 -0
- package/dist/web/primitives/input-number-kinds.js +16 -0
- package/dist/web/primitives/input-optional-props.d.ts +20 -0
- package/dist/web/primitives/input-optional-props.js +24 -0
- package/dist/web/primitives/input-select-presentation.d.ts +13 -0
- package/dist/web/primitives/input-select-presentation.js +19 -0
- package/dist/web/primitives/input-shared.d.ts +22 -0
- package/dist/web/primitives/input-shared.js +10 -0
- package/dist/web/primitives/input-temporal-kinds.d.ts +5 -0
- package/dist/web/primitives/input-temporal-kinds.js +10 -0
- package/dist/web/primitives/input-text-kinds.d.ts +7 -0
- package/dist/web/primitives/input-text-kinds.js +33 -0
- package/dist/web/primitives/input.js +35 -161
- package/dist/web/primitives/number-range-facet.d.ts +7 -0
- package/dist/web/primitives/number-range-facet.js +33 -0
- package/dist/web/widgets/bounded-load-cache.d.ts +5 -1
- package/dist/web/widgets/bounded-load-cache.js +48 -26
- package/dist/web/widgets/chart-data.d.ts +35 -0
- package/dist/web/widgets/chart-data.js +37 -0
- package/dist/web/widgets/chart-markers.d.ts +26 -0
- package/dist/web/widgets/chart-markers.js +64 -0
- package/dist/web/widgets/chart-parts.d.ts +20 -0
- package/dist/web/widgets/chart-parts.js +15 -0
- package/dist/web/widgets/charts.d.ts +5 -78
- package/dist/web/widgets/charts.js +7 -485
- package/dist/web/widgets/drawer-panel-class.d.ts +3 -0
- package/dist/web/widgets/drawer-panel-class.js +40 -0
- package/dist/web/widgets/drawer-resize-controls.d.ts +11 -0
- package/dist/web/widgets/drawer-resize-controls.js +12 -0
- package/dist/web/widgets/drawer-sizing.d.ts +19 -0
- package/dist/web/widgets/drawer-sizing.js +60 -0
- package/dist/web/widgets/drawer.js +17 -116
- package/dist/web/widgets/pdf-preview.js +9 -4
- package/dist/web/widgets/stacked-area-brush.d.ts +13 -0
- package/dist/web/widgets/stacked-area-brush.js +91 -0
- package/dist/web/widgets/stacked-area-chart.d.ts +6 -0
- package/dist/web/widgets/stacked-area-chart.js +45 -0
- package/dist/web/widgets/stacked-area-chrome.d.ts +7 -0
- package/dist/web/widgets/stacked-area-chrome.js +77 -0
- package/dist/web/widgets/stacked-area-geometry.d.ts +54 -0
- package/dist/web/widgets/stacked-area-geometry.js +83 -0
- package/dist/web/widgets/stacked-area-model.d.ts +11 -0
- package/dist/web/widgets/stacked-area-model.js +1 -0
- package/dist/web/widgets/stacked-area-plot.d.ts +3 -0
- package/dist/web/widgets/stacked-area-plot.js +51 -0
- package/dist/web/widgets/stacked-area-props.d.ts +83 -0
- package/dist/web/widgets/stacked-area-props.js +16 -0
- package/dist/web/widgets/stacked-area-svg.d.ts +3 -0
- package/dist/web/widgets/stacked-area-svg.js +38 -0
- package/dist/web/widgets/stacked-area-tooltip.d.ts +3 -0
- package/dist/web/widgets/stacked-area-tooltip.js +86 -0
- package/dist/web/widgets/use-drawer-resize.d.ts +22 -0
- package/dist/web/widgets/use-drawer-resize.js +52 -0
- package/dist/web/widgets/use-stacked-area-tooltip.d.ts +9 -0
- package/dist/web/widgets/use-stacked-area-tooltip.js +34 -0
- package/dist/web/widgets/use-stacked-area-window.d.ts +20 -0
- package/dist/web/widgets/use-stacked-area-window.js +76 -0
- package/package.json +9 -9
- package/src/changes.json +163 -0
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { RenderList } from "../components/render-list.js";
|
|
2
|
+
import { ListGroupPageBridges } from "../components/list-group-page-bridges.js";
|
|
4
3
|
import { useOptionalDispatcher } from "../context/dispatcher-context.js";
|
|
5
4
|
import { useIsEmbeddedScreen } from "../context/embedded-screen-context.js";
|
|
6
5
|
import { useUserRoles } from "../context/user-roles-context.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { usePrimitives, } from "../primitives.js";
|
|
11
|
-
import { screenFillsHeight } from "../screen-fills-height.js";
|
|
12
|
-
import { DrawerHost, useDrawerAction } from "./action-form-body.js";
|
|
6
|
+
import { useTranslation } from "../i18n.js";
|
|
7
|
+
import { usePrimitives } from "../primitives.js";
|
|
8
|
+
import { useDrawerAction } from "./action-form-body.js";
|
|
13
9
|
import { useAppFeatures } from "./app-features-context.js";
|
|
14
10
|
import { useClientActionRuntime } from "./client-actions.js";
|
|
15
|
-
import { isListNarrowed, useListEmptyContent } from "./list-empty-content.js";
|
|
16
|
-
import { buildDateRangePayload, buildFilterFacets, buildFilterPayload, clampDateRange, mergeReferenceFacetOptions, readDateRange, resolveDateRangeFacets, resolveProjectionFacetSpecs, } from "./list-facets.js";
|
|
17
11
|
import { useNav } from "./nav.js";
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
12
|
+
import { renderProjectionDrawerHost } from "./projection-drawer-host.js";
|
|
13
|
+
import { renderBadShapeBanner, renderProjectionList, renderQueryRetryBanner, } from "./projection-list-render.js";
|
|
14
|
+
import { resolveWrappedRowClick } from "./projection-list-row-click.js";
|
|
15
|
+
import { QueryLoadingBanner } from "./query-state-banners.js";
|
|
20
16
|
import { ReferenceFacetBridges } from "./reference-facet-bridge.js";
|
|
21
17
|
import { useReturnHost } from "./return-to.js";
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
18
|
+
import { useProjectionListActions } from "./use-projection-list-actions.js";
|
|
19
|
+
import { useProjectionListData } from "./use-projection-list-data.js";
|
|
20
|
+
import { useProjectionListDefinitions } from "./use-projection-list-definitions.js";
|
|
21
|
+
import { useProjectionListQuery } from "./use-projection-list-query.js";
|
|
22
|
+
import { listPager } from "./use-screen-list-rows.js";
|
|
25
23
|
// ---- projection-list ----
|
|
26
24
|
// Like entityList, but the list query comes DIRECTLY from `screen.query`
|
|
27
25
|
// (instead of being derived from an entity) — cross-feature capable.
|
|
@@ -41,205 +39,92 @@ export function ProjectionListBody({ schema, screen, translate, onRowClick, }) {
|
|
|
41
39
|
const effectiveTranslate = translate ?? t;
|
|
42
40
|
const userRoles = useUserRoles();
|
|
43
41
|
const appFeatures = useAppFeatures();
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
: null;
|
|
71
|
-
const limit = urlState.pageSize ?? screen.pageSize ?? 50;
|
|
72
|
-
// Pages-mode only (see header comment) — an author-set pagination:
|
|
73
|
-
// "infinite" on a paginated projectionList is silently a no-op today.
|
|
74
|
-
const usePager = paginated && (screen.pagination ?? "pages") === "pages";
|
|
75
|
-
// Facets — a projectionList has no entity, so screen.facets is
|
|
76
|
-
// the only field inventory; resolveProjectionFacetSpecs reshapes +
|
|
77
|
-
// translates its explicit labels into the same ResolvedFacetSpec the
|
|
78
|
-
// entityList adapter produces, so both feed the same
|
|
79
|
-
// buildFilterFacets/buildFilterPayload.
|
|
80
|
-
const facetSpecs = useMemo(() => resolveProjectionFacetSpecs(screen.facets, effectiveTranslate, schema.featureName), [screen.facets, effectiveTranslate, schema.featureName]);
|
|
81
|
-
const [projectionReferenceFacetOptions, setProjectionReferenceFacetOptions] = useState({});
|
|
82
|
-
const handleProjectionFacetOptions = useCallback((field, options) => setProjectionReferenceFacetOptions((prev) => prev[field] === options ? prev : { ...prev, [field]: options }), []);
|
|
83
|
-
const resolvedFacetSpecs = useMemo(() => mergeReferenceFacetOptions(facetSpecs, projectionReferenceFacetOptions), [facetSpecs, projectionReferenceFacetOptions]);
|
|
84
|
-
const filterPayload = useMemo(() => buildFilterPayload(urlState.filters, (field) => facetSpecs.find((spec) => spec.field === field)?.type), [urlState.filters, facetSpecs]);
|
|
85
|
-
// dateRange facets bypass `filters` entirely — their two bounds
|
|
86
|
-
// become the top-level query params the facet declares, resolved from a
|
|
87
|
-
// calendar date to an instant in the viewer's zone.
|
|
88
|
-
const timeZone = useOptionalTimeZone();
|
|
89
|
-
const dateRangeSpecs = useMemo(() => resolveDateRangeFacets(screen.facets, effectiveTranslate), [screen.facets, effectiveTranslate]);
|
|
90
|
-
const dateRangePayload = useMemo(() => buildDateRangePayload(dateRangeSpecs, urlState.filters, timeZone), [dateRangeSpecs, urlState.filters, timeZone]);
|
|
91
|
-
const queryPayload = useMemo(() => {
|
|
92
|
-
const payload = buildListQueryPayload({
|
|
93
|
-
limit,
|
|
94
|
-
search: activeSearch,
|
|
95
|
-
sort: activeSort,
|
|
96
|
-
usePager,
|
|
97
|
-
page: urlState.page,
|
|
98
|
-
useInfinite: false,
|
|
99
|
-
cursor: undefined,
|
|
100
|
-
});
|
|
101
|
-
// Gated on screen.filter/screen.facets being declared (not just on
|
|
102
|
-
// urlState/filterPayload happening to carry a value) — same rule as
|
|
103
|
-
// activeSearch/activeSort above: a stale URL must not smuggle a param
|
|
104
|
-
// the bound query's Zod schema doesn't accept.
|
|
105
|
-
if (screen.filter !== undefined) {
|
|
106
|
-
payload["filter"] = screen.filter;
|
|
107
|
-
}
|
|
108
|
-
if (screen.facets !== undefined && filterPayload.length > 0) {
|
|
109
|
-
payload["filters"] = filterPayload;
|
|
110
|
-
}
|
|
111
|
-
Object.assign(payload, dateRangePayload);
|
|
112
|
-
return payload;
|
|
113
|
-
}, [
|
|
114
|
-
limit,
|
|
115
|
-
activeSearch,
|
|
116
|
-
activeSort,
|
|
117
|
-
usePager,
|
|
118
|
-
urlState.page,
|
|
119
|
-
screen.filter,
|
|
120
|
-
screen.facets,
|
|
121
|
-
filterPayload,
|
|
122
|
-
dateRangePayload,
|
|
123
|
-
]);
|
|
124
|
-
const rowsQuery = useQuery(screen.query, queryPayload, { live: true });
|
|
125
|
-
const filterFacets = useMemo(() => buildFilterFacets(resolvedFacetSpecs), [resolvedFacetSpecs]);
|
|
126
|
-
const dateRangeFacets = useMemo(() => dateRangeSpecs.map((spec) => ({
|
|
127
|
-
field: spec.field,
|
|
128
|
-
label: spec.label,
|
|
129
|
-
...readDateRange(urlState.filters, spec.field),
|
|
130
|
-
})), [dateRangeSpecs, urlState.filters]);
|
|
131
|
-
const handleDateRangeChange = useCallback((field, bound, value) => {
|
|
132
|
-
urlState.setDateRange(field, clampDateRange(readDateRange(urlState.filters, field), bound, value));
|
|
133
|
-
}, [urlState.setDateRange, urlState.filters]);
|
|
134
|
-
// Entity targets: see EntityListBody.runNavigate for why the resolution happens
|
|
135
|
-
// in the NavApi impl. Unlike there: NO row["id"]
|
|
136
|
-
// fallback — projectionList rows come from an arbitrary query projection
|
|
137
|
-
// with no guaranteed "id" field. The boot validator therefore enforces an
|
|
138
|
-
// explicit entityId for projectionList entity targets. Same helper
|
|
139
|
-
// relatedList's rowActions reuse (related-list-section.tsx) — a
|
|
140
|
-
// projectionDetail relatedList row has the identical "no guaranteed id"
|
|
141
|
-
// shape.
|
|
142
|
-
const runNavigate = useCallback((action, row) => runProjectionRowNavigate(nav, action, row, host), [nav, host]);
|
|
143
|
-
const defaultEditRowAction = useMemo(() => buildDefaultEditRowAction(defaultEditScreen), [defaultEditScreen]);
|
|
144
|
-
const rowActions = useMemo(() => buildProjectionRowActions({
|
|
145
|
-
rowActions: screen.rowActions,
|
|
146
|
-
translate: effectiveTranslate,
|
|
147
|
-
dispatcher,
|
|
148
|
-
nav,
|
|
149
|
-
refetch: rowsQuery.refetch,
|
|
150
|
-
openDrawer,
|
|
151
|
-
defaultEditRowAction,
|
|
152
|
-
host,
|
|
153
|
-
clientActions,
|
|
154
|
-
}), [
|
|
155
|
-
screen.rowActions,
|
|
42
|
+
const drawer = useDrawerAction(schema);
|
|
43
|
+
const { openDrawer } = drawer;
|
|
44
|
+
const definitions = useProjectionListDefinitions(screen, appFeatures, userRoles);
|
|
45
|
+
const { defaultEditScreen, searchable, sortable, paginated, entity } = definitions;
|
|
46
|
+
const query = useProjectionListQuery({
|
|
47
|
+
screen,
|
|
48
|
+
featureName: schema.featureName,
|
|
49
|
+
effectiveTranslate,
|
|
50
|
+
entity,
|
|
51
|
+
searchable,
|
|
52
|
+
sortable,
|
|
53
|
+
paginated,
|
|
54
|
+
});
|
|
55
|
+
const data = useProjectionListData({
|
|
56
|
+
screen,
|
|
57
|
+
featureName: schema.featureName,
|
|
58
|
+
queryPayload: query.queryPayload,
|
|
59
|
+
limit: query.limit,
|
|
60
|
+
usePager: query.usePager,
|
|
61
|
+
effectiveTranslate,
|
|
62
|
+
resolvedFacetSpecs: query.resolvedFacetSpecs,
|
|
63
|
+
});
|
|
64
|
+
const { listRows } = data;
|
|
65
|
+
const refreshRows = listRows.refreshAfterWrite;
|
|
66
|
+
const actions = useProjectionListActions({
|
|
67
|
+
screen,
|
|
156
68
|
effectiveTranslate,
|
|
157
69
|
dispatcher,
|
|
158
70
|
clientActions,
|
|
159
71
|
nav,
|
|
160
|
-
rowsQuery.refetch,
|
|
161
|
-
openDrawer,
|
|
162
|
-
defaultEditRowAction,
|
|
163
72
|
host,
|
|
164
|
-
|
|
165
|
-
const toolbarActions = useMemo(() => buildProjectionToolbarActions({
|
|
166
|
-
toolbarActions: screen.toolbarActions,
|
|
167
|
-
translate: effectiveTranslate,
|
|
168
|
-
dispatcher,
|
|
169
|
-
nav,
|
|
170
|
-
refetch: rowsQuery.refetch,
|
|
171
|
-
openDrawer,
|
|
172
|
-
host,
|
|
173
|
-
access: { appFeatures, userRoles },
|
|
174
|
-
}), [
|
|
175
|
-
screen.toolbarActions,
|
|
176
|
-
effectiveTranslate,
|
|
177
|
-
nav,
|
|
178
|
-
host,
|
|
179
|
-
dispatcher,
|
|
180
|
-
rowsQuery.refetch,
|
|
73
|
+
refreshRows,
|
|
181
74
|
openDrawer,
|
|
182
75
|
appFeatures,
|
|
183
76
|
userRoles,
|
|
184
|
-
|
|
185
|
-
const emptyContent = useListEmptyContent(screen.emptyState, effectiveTranslate, {
|
|
186
|
-
nav,
|
|
187
|
-
host,
|
|
188
|
-
dispatcher,
|
|
189
|
-
openDrawer,
|
|
190
|
-
onWriteSuccess: rowsQuery.refetch,
|
|
77
|
+
defaultEditScreen,
|
|
191
78
|
});
|
|
192
|
-
if (
|
|
79
|
+
if (listRows.firstLoad) {
|
|
193
80
|
return _jsx(QueryLoadingBanner, {});
|
|
194
81
|
}
|
|
195
|
-
if (
|
|
196
|
-
return (
|
|
82
|
+
if (listRows.error && !listRows.hasData) {
|
|
83
|
+
return renderQueryRetryBanner(listRows, listRows.error, effectiveTranslate);
|
|
197
84
|
}
|
|
198
85
|
// A failed refetch keeps the last good data on screen.
|
|
199
|
-
const refetchErrorBanner =
|
|
200
|
-
|
|
86
|
+
const refetchErrorBanner = listRows.error
|
|
87
|
+
? renderQueryRetryBanner(listRows, listRows.error, effectiveTranslate)
|
|
88
|
+
: null;
|
|
89
|
+
// listRows.page is typed as PagedRows but the query handler is free to
|
|
201
90
|
// return anything at runtime (a bare array silently rendered an empty
|
|
202
91
|
// table instead of surfacing the mismatch), so the shape is checked.
|
|
203
|
-
if (
|
|
204
|
-
return (
|
|
92
|
+
if (listRows.page !== null && !Array.isArray(listRows.page.rows)) {
|
|
93
|
+
return renderBadShapeBanner(screen, { Banner, Text });
|
|
205
94
|
}
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
:
|
|
212
|
-
|
|
213
|
-
: undefined;
|
|
95
|
+
const wrappedOnRowClick = resolveWrappedRowClick({
|
|
96
|
+
screen,
|
|
97
|
+
onRowClick,
|
|
98
|
+
entityName: definitions.listScreen.entity,
|
|
99
|
+
openDrawer,
|
|
100
|
+
runNavigate: actions.runNavigate,
|
|
101
|
+
});
|
|
214
102
|
// Same pager-construction as EntityListBody: no Pager UI until the
|
|
215
103
|
// server-provided `total` arrives (guards pagination="pages" without
|
|
216
104
|
// totalCount support).
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
closeDrawer();
|
|
243
|
-
void rowsQuery.refetch();
|
|
244
|
-
} })] }));
|
|
105
|
+
const pager = listPager({
|
|
106
|
+
usePager: query.usePager,
|
|
107
|
+
page: listRows.page,
|
|
108
|
+
limit: query.limit,
|
|
109
|
+
urlState: query.urlState,
|
|
110
|
+
});
|
|
111
|
+
return (_jsxs(_Fragment, { children: [refetchErrorBanner, _jsx(ListGroupPageBridges, { ...data.listTable.aggregates.groupPages }), _jsx(ReferenceFacetBridges, { specs: query.facetSpecs, onOptions: query.handleProjectionFacetOptions }), renderProjectionList({
|
|
112
|
+
schema,
|
|
113
|
+
screen,
|
|
114
|
+
translate,
|
|
115
|
+
effectiveTranslate,
|
|
116
|
+
isEmbeddedScreen,
|
|
117
|
+
definitions,
|
|
118
|
+
query,
|
|
119
|
+
data,
|
|
120
|
+
actions,
|
|
121
|
+
pager,
|
|
122
|
+
wrappedOnRowClick,
|
|
123
|
+
}), renderProjectionDrawerHost({
|
|
124
|
+
schema,
|
|
125
|
+
translate,
|
|
126
|
+
userRoles,
|
|
127
|
+
drawer,
|
|
128
|
+
refreshRows,
|
|
129
|
+
})] }));
|
|
245
130
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { ProjectionListScreenDefinition } from "@cosmicdrift/kumiko-framework/ui-types";
|
|
2
|
+
import type { ListRowViewModel, Translate } from "../headless/index.ts";
|
|
3
|
+
import type { ListUrlStateApi } from "../hooks/use-list-url-state.ts";
|
|
4
|
+
import type { useProjectionListActions } from "./use-projection-list-actions.ts";
|
|
5
|
+
import type { useProjectionListData } from "./use-projection-list-data.ts";
|
|
6
|
+
import type { useProjectionListDefinitions } from "./use-projection-list-definitions.ts";
|
|
7
|
+
import type { useProjectionListQuery } from "./use-projection-list-query.ts";
|
|
8
|
+
import type { listPager } from "./use-screen-list-rows.ts";
|
|
9
|
+
export declare function projectionLeadProps(screen: ProjectionListScreenDefinition, effectiveTranslate: Translate, emptyContent: ReturnType<typeof useProjectionListActions>["emptyContent"]): {
|
|
10
|
+
description?: string | undefined;
|
|
11
|
+
emptyContent?: import("../components/list-empty-state.tsx").ListEmptyStateContent | undefined;
|
|
12
|
+
};
|
|
13
|
+
export declare function projectionLayoutProps(isEmbeddedScreen: boolean, screen: ProjectionListScreenDefinition, listScreen: ReturnType<typeof useProjectionListDefinitions>["listScreen"], pager: ReturnType<typeof listPager>, rowActions: ReturnType<typeof useProjectionListActions>["rowActions"]): {
|
|
14
|
+
screenPadding: boolean;
|
|
15
|
+
chromeless: boolean;
|
|
16
|
+
scrollBody?: boolean | undefined;
|
|
17
|
+
pager?: {
|
|
18
|
+
readonly page: number;
|
|
19
|
+
readonly limit: number;
|
|
20
|
+
readonly total: number;
|
|
21
|
+
readonly onPageChange: (next: number) => void;
|
|
22
|
+
readonly pageSizeOptions?: readonly number[];
|
|
23
|
+
readonly onPageSizeChange?: (next: number) => void;
|
|
24
|
+
} | undefined;
|
|
25
|
+
rowActions?: readonly import("../primitives.tsx").DataTableRowAction[] | undefined;
|
|
26
|
+
rowActionMode?: import("@cosmicdrift/kumiko-framework/ui-types").RowActionMode | undefined;
|
|
27
|
+
} | {
|
|
28
|
+
screenPadding: boolean;
|
|
29
|
+
scrollBody?: boolean | undefined;
|
|
30
|
+
pager?: {
|
|
31
|
+
readonly page: number;
|
|
32
|
+
readonly limit: number;
|
|
33
|
+
readonly total: number;
|
|
34
|
+
readonly onPageChange: (next: number) => void;
|
|
35
|
+
readonly pageSizeOptions?: readonly number[];
|
|
36
|
+
readonly onPageSizeChange?: (next: number) => void;
|
|
37
|
+
} | undefined;
|
|
38
|
+
rowActions?: readonly import("../primitives.tsx").DataTableRowAction[] | undefined;
|
|
39
|
+
rowActionMode?: import("@cosmicdrift/kumiko-framework/ui-types").RowActionMode | undefined;
|
|
40
|
+
};
|
|
41
|
+
export declare function projectionActionProps(actions: ReturnType<typeof useProjectionListActions>, translate: Translate | undefined, wrappedOnRowClick: ((row: ListRowViewModel) => void) | undefined): {
|
|
42
|
+
bulk?: import("../data-table-bulk-types.ts").DataTableBulk | undefined;
|
|
43
|
+
toolbarActions?: readonly import("../components/render-list-toolbar-action.tsx").ToolbarActionButton[] | undefined;
|
|
44
|
+
translate?: Translate | undefined;
|
|
45
|
+
onRowClick?: ((row: ListRowViewModel) => void) | undefined;
|
|
46
|
+
};
|
|
47
|
+
export declare function projectionFacetProps(filterFacets: ReturnType<typeof useProjectionListData>["filterFacets"], dateRangeFacets: ReturnType<typeof useProjectionListQuery>["dateRangeFacets"], onDateRangeChange: ReturnType<typeof useProjectionListQuery>["handleDateRangeChange"], urlState: ListUrlStateApi): {
|
|
48
|
+
filterFacets?: import("../data-table-facet-types.ts").DataTableFacet[] | undefined;
|
|
49
|
+
onFilterChange?: ((field: string, values: readonly string[]) => void) | undefined;
|
|
50
|
+
dateRangeFacets?: import("../data-table-facet-types.ts").DataTableDateRangeFacet[] | undefined;
|
|
51
|
+
onDateRangeChange?: ((field: string, bound: "from" | "to", value: string) => void) | undefined;
|
|
52
|
+
};
|
|
53
|
+
export declare function projectionFilterStateProps(filterFacets: ReturnType<typeof useProjectionListData>["filterFacets"], dateRangeFacets: ReturnType<typeof useProjectionListQuery>["dateRangeFacets"], urlState: ListUrlStateApi): {
|
|
54
|
+
filterValues?: Readonly<Record<string, readonly string[]>> | undefined;
|
|
55
|
+
onFilterReset?: (() => void) | undefined;
|
|
56
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { screenFillsHeight } from "../screen-fills-height.js";
|
|
2
|
+
export function projectionLeadProps(screen, effectiveTranslate, emptyContent) {
|
|
3
|
+
return {
|
|
4
|
+
...(screen.description !== undefined && {
|
|
5
|
+
description: effectiveTranslate(screen.description),
|
|
6
|
+
}),
|
|
7
|
+
...(emptyContent !== undefined && { emptyContent }),
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export function projectionLayoutProps(isEmbeddedScreen, screen, listScreen, pager, rowActions) {
|
|
11
|
+
return {
|
|
12
|
+
...(isEmbeddedScreen ? { screenPadding: false, chromeless: true } : { screenPadding: true }),
|
|
13
|
+
...(screenFillsHeight(listScreen) && { scrollBody: true }),
|
|
14
|
+
...(pager !== undefined && { pager }),
|
|
15
|
+
...(rowActions !== undefined && { rowActions }),
|
|
16
|
+
...(screen.rowActionMode !== undefined && { rowActionMode: screen.rowActionMode }),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export function projectionActionProps(actions, translate, wrappedOnRowClick) {
|
|
20
|
+
const { bulk, toolbarActions } = actions;
|
|
21
|
+
return {
|
|
22
|
+
...(bulk !== undefined && { bulk }),
|
|
23
|
+
...(toolbarActions !== undefined && { toolbarActions }),
|
|
24
|
+
...(translate !== undefined && { translate }),
|
|
25
|
+
...(wrappedOnRowClick !== undefined && { onRowClick: wrappedOnRowClick }),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export function projectionFacetProps(filterFacets, dateRangeFacets, onDateRangeChange, urlState) {
|
|
29
|
+
return {
|
|
30
|
+
...(filterFacets.length > 0 && {
|
|
31
|
+
filterFacets,
|
|
32
|
+
onFilterChange: urlState.setFilter,
|
|
33
|
+
}),
|
|
34
|
+
...(dateRangeFacets.length > 0 && {
|
|
35
|
+
dateRangeFacets,
|
|
36
|
+
onDateRangeChange,
|
|
37
|
+
}),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export function projectionFilterStateProps(filterFacets, dateRangeFacets, urlState) {
|
|
41
|
+
return {
|
|
42
|
+
...((filterFacets.length > 0 || dateRangeFacets.length > 0) && {
|
|
43
|
+
filterValues: urlState.filters,
|
|
44
|
+
onFilterReset: urlState.clearFilters,
|
|
45
|
+
}),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ProjectionListScreenDefinition } from "@cosmicdrift/kumiko-framework/ui-types";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import type { ListRowViewModel, Translate } from "../headless/index.ts";
|
|
4
|
+
import type { usePrimitives } from "../primitives.tsx";
|
|
5
|
+
import type { FeatureSchema } from "./feature-schema.ts";
|
|
6
|
+
import type { useProjectionListActions } from "./use-projection-list-actions.ts";
|
|
7
|
+
import type { useProjectionListData } from "./use-projection-list-data.ts";
|
|
8
|
+
import type { useProjectionListDefinitions } from "./use-projection-list-definitions.ts";
|
|
9
|
+
import type { useProjectionListQuery } from "./use-projection-list-query.ts";
|
|
10
|
+
import type { listPager, ScreenListRows } from "./use-screen-list-rows.ts";
|
|
11
|
+
export type ProjectionListRenderModel = {
|
|
12
|
+
readonly schema: FeatureSchema;
|
|
13
|
+
readonly screen: ProjectionListScreenDefinition;
|
|
14
|
+
readonly translate: Translate | undefined;
|
|
15
|
+
readonly effectiveTranslate: Translate;
|
|
16
|
+
readonly isEmbeddedScreen: boolean;
|
|
17
|
+
readonly definitions: ReturnType<typeof useProjectionListDefinitions>;
|
|
18
|
+
readonly query: ReturnType<typeof useProjectionListQuery>;
|
|
19
|
+
readonly data: ReturnType<typeof useProjectionListData>;
|
|
20
|
+
readonly actions: ReturnType<typeof useProjectionListActions>;
|
|
21
|
+
readonly pager: ReturnType<typeof listPager>;
|
|
22
|
+
readonly wrappedOnRowClick: ((row: ListRowViewModel) => void) | undefined;
|
|
23
|
+
};
|
|
24
|
+
export declare function renderQueryRetryBanner(listRows: ScreenListRows, error: NonNullable<ScreenListRows["error"]>, effectiveTranslate: Translate): ReactNode;
|
|
25
|
+
export declare function renderBadShapeBanner(screen: ProjectionListScreenDefinition, primitives: Pick<ReturnType<typeof usePrimitives>, "Banner" | "Text">): ReactNode;
|
|
26
|
+
export declare function renderProjectionList(model: ProjectionListRenderModel): ReactNode;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { RenderList } from "../components/render-list.js";
|
|
3
|
+
import { isListNarrowed } from "./list-empty-content.js";
|
|
4
|
+
import { projectionActionProps, projectionFacetProps, projectionFilterStateProps, projectionLayoutProps, projectionLeadProps, } from "./projection-list-render-props.js";
|
|
5
|
+
import { QueryErrorBanner } from "./query-state-banners.js";
|
|
6
|
+
export function renderQueryRetryBanner(listRows, error, effectiveTranslate) {
|
|
7
|
+
return _jsx(QueryErrorBanner, { error: error, translate: effectiveTranslate, onRetry: listRows.retry });
|
|
8
|
+
}
|
|
9
|
+
export function renderBadShapeBanner(screen, primitives) {
|
|
10
|
+
const { Banner, Text } = primitives;
|
|
11
|
+
return (_jsxs(Banner, { padded: true, variant: "error", testId: "kumiko-screen-projection-list-bad-shape", children: ["Screen ", _jsx(Text, { variant: "code", children: screen.id }), " query", " ", _jsx(Text, { variant: "code", children: screen.query }), " did not return a PagedRows envelope; a projectionList query must return ", _jsx(Text, { variant: "code", children: "{ rows, nextCursor }" }), "."] }));
|
|
12
|
+
}
|
|
13
|
+
export function renderProjectionList(model) {
|
|
14
|
+
const { schema, screen, translate, effectiveTranslate, isEmbeddedScreen } = model;
|
|
15
|
+
const { definitions, query, data, actions, pager, wrappedOnRowClick } = model;
|
|
16
|
+
const { urlState } = query;
|
|
17
|
+
const { filterFacets, listRows, listTable } = data;
|
|
18
|
+
const { dateRangeFacets } = query;
|
|
19
|
+
return (_jsx(RenderList, { screen: definitions.listScreen, entity: definitions.entity, rows: listRows.rows, featureName: schema.featureName, searchable: definitions.searchable, narrowed: isListNarrowed(query.activeSearch, urlState.filters), ...projectionLeadProps(screen, effectiveTranslate, actions.emptyContent), searchValue: urlState.q, onSearchChange: urlState.setQ, sort: query.activeSort, onSortChange: urlState.setSort, ...projectionLayoutProps(isEmbeddedScreen, screen, definitions.listScreen, pager, actions.rowActions), ...projectionActionProps(actions, translate, wrappedOnRowClick), ...projectionFacetProps(filterFacets, dateRangeFacets, query.handleDateRangeChange, urlState), ...listTable.props, ...projectionFilterStateProps(filterFacets, dateRangeFacets, urlState) }));
|
|
20
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ProjectionListScreenDefinition, RowActionNavigate } from "@cosmicdrift/kumiko-framework/ui-types";
|
|
2
|
+
import type { ListRowViewModel } from "../headless/index.ts";
|
|
3
|
+
import type { useDrawerAction } from "./action-form-body.tsx";
|
|
4
|
+
type RowClickInput = {
|
|
5
|
+
readonly screen: ProjectionListScreenDefinition;
|
|
6
|
+
readonly onRowClick: ((row: ListRowViewModel, entityName: string) => void) | undefined;
|
|
7
|
+
readonly entityName: string;
|
|
8
|
+
readonly openDrawer: ReturnType<typeof useDrawerAction>["openDrawer"];
|
|
9
|
+
readonly runNavigate: (action: RowActionNavigate, row: ListRowViewModel) => unknown;
|
|
10
|
+
};
|
|
11
|
+
export declare function resolveWrappedRowClick(input: RowClickInput): ((row: ListRowViewModel) => void) | undefined;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { findRowClickAction, runDrawerRowAction } from "./row-actions.js";
|
|
2
|
+
export function resolveWrappedRowClick(input) {
|
|
3
|
+
const { screen, onRowClick, entityName, openDrawer, runNavigate } = input;
|
|
4
|
+
const rowClickAction = findRowClickAction(screen.rowActions);
|
|
5
|
+
if (rowClickAction) {
|
|
6
|
+
return (row) => rowClickAction.kind === "drawer"
|
|
7
|
+
? runDrawerRowAction(rowClickAction, openDrawer, row)
|
|
8
|
+
: runNavigate(rowClickAction, row);
|
|
9
|
+
}
|
|
10
|
+
// skip: no row-click wiring when neither the screen nor the host supplies a handler
|
|
11
|
+
if (onRowClick === undefined)
|
|
12
|
+
return undefined;
|
|
13
|
+
return (row) => onRowClick(row, entityName);
|
|
14
|
+
}
|
|
@@ -21,6 +21,9 @@ export declare function runDrawerRowAction(action: RowActionDrawer, openDrawer:
|
|
|
21
21
|
* validator allows at most one per list. */
|
|
22
22
|
export declare function findRowClickAction(rowActions: readonly RowAction[] | undefined): RowActionNavigate | RowActionDrawer | undefined;
|
|
23
23
|
export declare function buildDrawerRowAction(action: RowActionDrawer, translate: Translate, openDrawer: OpenDrawer): DataTableRowAction;
|
|
24
|
+
/** The one server write of a writeHandler row action for one row. */
|
|
25
|
+
export declare function writeRowAction(action: RowActionWriteHandler, row: ListRowViewModel, dispatcher: Dispatcher): ReturnType<Dispatcher["write"]>;
|
|
26
|
+
export declare function buildWriteHandlerRowAction(action: RowActionWriteHandler, translate: Translate, refetch: () => Promise<unknown>, dispatcher: Dispatcher): DataTableRowAction;
|
|
24
27
|
export declare function buildClientActionRowAction(action: RowActionClientAction, translate: Translate, runtime: ClientActionRuntime | undefined, refetch: () => Promise<unknown>): DataTableRowAction;
|
|
25
28
|
export declare function buildProjectionRowActions(options: {
|
|
26
29
|
readonly rowActions: readonly RowAction[] | undefined;
|
package/dist/app/row-actions.js
CHANGED
|
@@ -153,7 +153,14 @@ function mergeDefaultEditAction(rowActions, defaultEditRowAction) {
|
|
|
153
153
|
? [defaultEditRowAction, ...(rowActions ?? [])]
|
|
154
154
|
: (rowActions ?? []);
|
|
155
155
|
}
|
|
156
|
-
|
|
156
|
+
/** The one server write of a writeHandler row action for one row. */
|
|
157
|
+
export function writeRowAction(action, row, dispatcher) {
|
|
158
|
+
const payload = action.payload !== undefined
|
|
159
|
+
? evalRowExtractor(action.payload, row.values)
|
|
160
|
+
: { id: row.values["id"] };
|
|
161
|
+
return dispatcher.write(action.handler, payload);
|
|
162
|
+
}
|
|
163
|
+
export function buildWriteHandlerRowAction(action, translate, refetch, dispatcher) {
|
|
157
164
|
const writeVisible = action.visible;
|
|
158
165
|
return {
|
|
159
166
|
id: action.id,
|
|
@@ -166,10 +173,8 @@ function buildWriteHandlerRowAction(action, translate, refetch, dispatcher) {
|
|
|
166
173
|
confirmLabel: translate(action.confirmLabel),
|
|
167
174
|
}),
|
|
168
175
|
onTrigger: async (row) => {
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
: { id: row.values["id"] };
|
|
172
|
-
const result = await dispatcher.write(action.handler, payload);
|
|
176
|
+
const result = await writeRowAction(action, row, dispatcher);
|
|
177
|
+
// write() does not throw: an unthrown failure would close the confirm dialog silently.
|
|
173
178
|
if (!result.isSuccess) {
|
|
174
179
|
throw new WriteFailedError(result.error, dispatcherErrorText(result.error, translate));
|
|
175
180
|
}
|
|
@@ -130,7 +130,7 @@ export function formatSummaryParams(prefill, locale) {
|
|
|
130
130
|
}
|
|
131
131
|
// Placeholders of `successMessage`: formatted submitted values, with a
|
|
132
132
|
// reference field resolved to the chosen record's label. A lookup that fails or
|
|
133
|
-
// misses the row
|
|
133
|
+
// misses the row falls back to the raw id.
|
|
134
134
|
export async function resolveSuccessMessageParams(screen, featureName, values, dispatcher, locale) {
|
|
135
135
|
const params = formatSummaryParams(values, locale);
|
|
136
136
|
await Promise.all(Object.entries(screen.fields).map(async ([name, def]) => {
|
|
@@ -139,7 +139,14 @@ export async function resolveSuccessMessageParams(screen, featureName, values, d
|
|
|
139
139
|
return;
|
|
140
140
|
const target = parseRefTarget(def.entity, featureName);
|
|
141
141
|
const { queryQn, labelKey } = referenceLookupSource(target.featureName, target.entityName, def.labelField ?? "id");
|
|
142
|
-
|
|
142
|
+
// Ask for exactly the chosen record so it cannot fall beyond the lookup cap: `ids` is the
|
|
143
|
+
// by-id input of directory sources, `filters` that of entity list handlers. A source that
|
|
144
|
+
// knows neither returns its capped list and the scan below still finds the row if present.
|
|
145
|
+
const lookup = await dispatcher.query(queryQn, {
|
|
146
|
+
limit: REFERENCE_LIST_LOOKUP_LIMIT,
|
|
147
|
+
ids: [raw],
|
|
148
|
+
filters: [{ field: "id", op: "in", value: [raw] }],
|
|
149
|
+
});
|
|
143
150
|
if (!lookup.isSuccess)
|
|
144
151
|
return;
|
|
145
152
|
const row = lookup.data.rows.find((candidate) => candidate["id"] === raw);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { EntityListScreenDefinition } from "@cosmicdrift/kumiko-types/screen";
|
|
2
|
+
import type { DataTableRangeBound, DataTableRangeFacet } from "../data-table-aggregate-types.ts";
|
|
3
|
+
import { type Translate } from "../headless/index.ts";
|
|
4
|
+
import type { ListUrlStateApi } from "../hooks/use-list-url-state.ts";
|
|
5
|
+
export type RangeFilter = {
|
|
6
|
+
readonly field: string;
|
|
7
|
+
readonly op: "gte" | "lte";
|
|
8
|
+
readonly value: number;
|
|
9
|
+
};
|
|
10
|
+
export type EntityRangeFacets = {
|
|
11
|
+
readonly rangeFacets: readonly DataTableRangeFacet[];
|
|
12
|
+
readonly rangeFilters: readonly RangeFilter[];
|
|
13
|
+
/** Facet keys the remembered list state may keep (`<field>`, bounds hang off it). */
|
|
14
|
+
readonly rangeFields: readonly string[];
|
|
15
|
+
readonly onRangeChange: (field: string, bound: DataTableRangeBound, value: string) => void;
|
|
16
|
+
};
|
|
17
|
+
/** `display: "range"` facets of an entityList: from/to inputs sent as `gte`/`lte`. */
|
|
18
|
+
export declare function useEntityRangeFacets({ fields, screen, featureName, translate, urlState, }: {
|
|
19
|
+
readonly fields: Readonly<Record<string, unknown>>;
|
|
20
|
+
readonly screen: EntityListScreenDefinition;
|
|
21
|
+
readonly featureName: string;
|
|
22
|
+
readonly translate: Translate;
|
|
23
|
+
readonly urlState: Pick<ListUrlStateApi, "filters" | "setFilter">;
|
|
24
|
+
}): EntityRangeFacets;
|