@cosmicdrift/kumiko-renderer 0.413.1 → 0.415.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/action-form-support.js +4 -0
- package/dist/app/content-previews.d.ts +39 -0
- package/dist/app/content-previews.js +28 -0
- package/dist/app/entity-edit-screen.js +2 -5
- package/dist/app/entity-list-screen.js +42 -59
- package/dist/app/form-schema.d.ts +1 -0
- package/dist/app/form-schema.js +24 -0
- package/dist/app/list-facets.d.ts +1 -0
- package/dist/app/list-facets.js +10 -1
- package/dist/app/list-sort-options.d.ts +4 -0
- package/dist/app/list-sort-options.js +11 -0
- package/dist/app/named-filter-facet.d.ts +16 -3
- package/dist/app/named-filter-facet.js +97 -5
- package/dist/app/projection-detail-body.d.ts +2 -4
- package/dist/app/projection-detail-body.js +7 -1
- package/dist/app/projection-detail-guidance-data.d.ts +7 -0
- package/dist/app/projection-detail-guidance-data.js +103 -0
- package/dist/app/projection-detail-guidance.d.ts +13 -0
- package/dist/app/projection-detail-guidance.js +197 -0
- package/dist/app/projection-detail-header-model.d.ts +1 -3
- package/dist/app/projection-detail-header-model.js +4 -8
- package/dist/app/projection-detail-header-region.d.ts +2 -1
- package/dist/app/projection-detail-header-region.js +63 -23
- package/dist/app/projection-detail-header.d.ts +6 -1
- package/dist/app/projection-detail-header.js +76 -18
- package/dist/app/projection-detail-navigation.d.ts +2 -0
- package/dist/app/projection-detail-navigation.js +13 -3
- package/dist/app/projection-detail-states.d.ts +3 -3
- package/dist/app/projection-list-body.js +4 -2
- package/dist/app/projection-list-render.js +3 -1
- package/dist/app/projection-list-shim.d.ts +4 -1
- package/dist/app/projection-list-shim.js +35 -8
- package/dist/app/reference-link.d.ts +3 -2
- package/dist/app/reference-link.js +19 -4
- package/dist/app/row-actions.js +3 -3
- package/dist/app/screen-access.d.ts +4 -0
- package/dist/app/screen-access.js +18 -0
- package/dist/app/screen-shared.js +3 -1
- package/dist/app/unique-label-keys.d.ts +1 -0
- package/dist/app/unique-label-keys.js +9 -0
- package/dist/app/use-entity-list-payload.d.ts +26 -0
- package/dist/app/use-entity-list-payload.js +59 -0
- package/dist/app/use-entity-range-facets.js +2 -3
- package/dist/app/use-facet-counts.d.ts +5 -0
- package/dist/app/use-facet-counts.js +7 -0
- package/dist/app/use-list-summary-row.d.ts +10 -0
- package/dist/app/use-list-summary-row.js +33 -0
- package/dist/app/use-named-filter-queue.d.ts +20 -0
- package/dist/app/use-named-filter-queue.js +9 -0
- package/dist/app/use-projection-detail-actions.d.ts +5 -4
- package/dist/app/use-projection-detail-actions.js +42 -1
- package/dist/app/use-projection-list-data.d.ts +5 -0
- package/dist/app/use-projection-list-data.js +35 -6
- package/dist/app/use-projection-list-query.d.ts +2 -0
- package/dist/app/use-projection-list-query.js +29 -16
- package/dist/app/use-related-list-tab-counts.js +5 -1
- package/dist/app/use-row-decoration.d.ts +13 -0
- package/dist/app/use-row-decoration.js +103 -0
- package/dist/app/use-screen-list-rows.d.ts +4 -1
- package/dist/app/use-screen-list-rows.js +14 -5
- package/dist/app/use-screen-list-table.d.ts +3 -1
- package/dist/app/use-screen-list-table.js +10 -1
- package/dist/app/write-failed-error.d.ts +1 -0
- package/dist/app/write-failed-error.js +10 -0
- package/dist/card-options.d.ts +25 -0
- package/dist/card-options.js +1 -0
- package/dist/compact-tap-classes.d.ts +1 -0
- package/dist/compact-tap-classes.js +3 -0
- package/dist/components/embedded-list-field.js +13 -12
- package/dist/components/list-empty-state.d.ts +13 -1
- package/dist/components/list-empty-state.js +20 -1
- package/dist/components/list-group-page-bridges.d.ts +1 -1
- package/dist/components/list-group-page-bridges.js +2 -2
- package/dist/components/related-list-section.js +4 -22
- package/dist/components/render-edit-action-button.d.ts +3 -1
- package/dist/components/render-edit-action-button.js +5 -3
- package/dist/components/render-edit-render-model.d.ts +2 -2
- package/dist/components/render-edit-types.d.ts +4 -2
- package/dist/components/render-edit.js +3 -1
- package/dist/components/render-list-hint-columns.d.ts +9 -0
- package/dist/components/render-list-hint-columns.js +87 -0
- package/dist/components/render-list-reference-columns.js +4 -2
- package/dist/components/render-list-row-tone.d.ts +3 -0
- package/dist/components/render-list-row-tone.js +10 -0
- package/dist/components/render-list-table-props.d.ts +9 -1
- package/dist/components/render-list-table-props.js +4 -1
- package/dist/components/render-list-toolbar-action.d.ts +1 -2
- package/dist/components/render-list-toolbar-model.d.ts +4 -1
- package/dist/components/render-list-toolbar-model.js +21 -6
- package/dist/components/render-list-toolbar.d.ts +3 -2
- package/dist/components/render-list-toolbar.js +8 -6
- package/dist/components/render-list-types.d.ts +6 -1
- package/dist/components/render-list.js +26 -7
- package/dist/components/use-render-edit-controlled-sync.js +3 -5
- package/dist/components/use-render-edit-draft-save.js +7 -9
- package/dist/components/use-render-edit-schema.d.ts +3 -0
- package/dist/components/use-render-edit-schema.js +15 -0
- package/dist/components/use-render-edit-state.d.ts +1 -0
- package/dist/components/use-render-edit-state.js +4 -1
- package/dist/components/use-render-edit-steps.js +2 -3
- package/dist/components/use-render-list-columns.d.ts +3 -1
- package/dist/components/use-render-list-columns.js +22 -10
- package/dist/context/screen-focus-context.d.ts +14 -0
- package/dist/context/screen-focus-context.js +28 -0
- package/dist/data-table-facet-types.d.ts +6 -0
- package/dist/data-table-view-types.d.ts +20 -1
- package/dist/headless/form/form-controller.js +3 -1
- package/dist/headless/form/zod-bridge.d.ts +7 -1
- package/dist/headless/form/zod-bridge.js +10 -0
- package/dist/headless/index.d.ts +2 -1
- package/dist/headless/index.js +1 -0
- package/dist/headless/pwa-service-worker-meta.d.ts +4 -0
- package/dist/headless/pwa-service-worker-meta.js +13 -0
- package/dist/headless/view-model/index.d.ts +1 -1
- package/dist/headless/view-model/list-file-display.js +3 -2
- package/dist/headless/view-model/list.js +16 -0
- package/dist/headless/view-model/types.d.ts +37 -0
- package/dist/hooks/list-column-layout.js +2 -1
- package/dist/hooks/list-server-groups.js +14 -1
- package/dist/hooks/list-state-schema.d.ts +1 -0
- package/dist/hooks/list-state-schema.js +9 -1
- package/dist/hooks/use-debounced-value.d.ts +1 -0
- package/dist/hooks/use-debounced-value.js +11 -0
- package/dist/hooks/use-list-aggregates.d.ts +5 -1
- package/dist/hooks/use-list-aggregates.js +9 -5
- package/dist/hooks/use-list-table.d.ts +2 -1
- package/dist/hooks/use-list-table.js +3 -9
- package/dist/hooks/use-list-url-state.d.ts +2 -0
- package/dist/hooks/use-list-url-state.js +12 -4
- package/dist/hooks/use-list-view-state.js +23 -3
- package/dist/hooks/use-reference-lookup.js +7 -2
- package/dist/hooks/use-remembered-list-params.d.ts +6 -2
- package/dist/hooks/use-remembered-list-params.js +18 -3
- package/dist/hooks/use-store.js +0 -1
- package/dist/i18n-defaults.js +39 -3
- package/dist/index.d.ts +7 -2
- package/dist/index.js +4 -1
- package/dist/live/dispatcher-live.js +2 -0
- package/dist/metric-types.d.ts +4 -0
- package/dist/primitives-record-guidance.d.ts +55 -0
- package/dist/primitives-record-guidance.js +1 -0
- package/dist/primitives.d.ts +47 -54
- package/dist/server-clock.d.ts +6 -0
- package/dist/server-clock.js +20 -0
- package/dist/session/session-ended.d.ts +1 -0
- package/dist/session/session-ended.js +2 -2
- package/dist/status-tone.d.ts +1 -0
- package/dist/status-tone.js +5 -0
- package/dist/web/app/browser-locale.js +1 -1
- package/dist/web/app/client-plugin.d.ts +6 -1
- package/dist/web/app/create-app.d.ts +2 -1
- package/dist/web/app/create-app.js +15 -5
- package/dist/web/app/dashboard-body.js +25 -11
- package/dist/web/app/dashboard-header.d.ts +2 -1
- package/dist/web/app/dashboard-header.js +19 -7
- package/dist/web/app/dashboard-list-panel.d.ts +12 -0
- package/dist/web/app/dashboard-list-panel.js +144 -0
- package/dist/web/app/dashboard-narrow-gate.d.ts +6 -0
- package/dist/web/app/dashboard-narrow-gate.js +6 -0
- package/dist/web/app/dashboard-narrow-order.d.ts +3 -0
- package/dist/web/app/dashboard-narrow-order.js +6 -0
- package/dist/web/app/dashboard-navigation-link.d.ts +12 -0
- package/dist/web/app/dashboard-navigation-link.js +21 -0
- package/dist/web/app/dashboard-panels.d.ts +7 -23
- package/dist/web/app/dashboard-panels.js +55 -123
- package/dist/web/app/dashboard-reference-list-table.d.ts +5 -1
- package/dist/web/app/dashboard-reference-list-table.js +13 -4
- package/dist/web/app/dashboard-shared.d.ts +23 -7
- package/dist/web/app/dashboard-shared.js +45 -17
- package/dist/web/app/dashboard-stat-group-panel.d.ts +14 -0
- package/dist/web/app/dashboard-stat-group-panel.js +74 -0
- package/dist/web/app/dashboard-text-panel.d.ts +12 -0
- package/dist/web/app/dashboard-text-panel.js +167 -0
- package/dist/web/app/dashboard-text.d.ts +2 -0
- package/dist/web/app/dashboard-text.js +1 -1
- package/dist/web/app/dashboard-visibility.js +1 -1
- package/dist/web/app/relative-time.js +2 -1
- package/dist/web/drawn-icons.d.ts +6 -0
- package/dist/web/drawn-icons.js +30 -0
- package/dist/web/editor/editor-footer.d.ts +28 -0
- package/dist/web/editor/editor-footer.js +23 -0
- package/dist/web/editor/editor-frame.d.ts +23 -0
- package/dist/web/editor/editor-frame.js +24 -0
- package/dist/web/editor/editor-header.d.ts +36 -0
- package/dist/web/editor/editor-header.js +30 -0
- package/dist/web/editor/editor-rail.d.ts +32 -0
- package/dist/web/editor/editor-rail.js +37 -0
- package/dist/web/editor/editor-workbench.d.ts +34 -0
- package/dist/web/editor/editor-workbench.js +19 -0
- package/dist/web/editor/index.d.ts +6 -0
- package/dist/web/editor/index.js +6 -0
- package/dist/web/editor/relative-when.d.ts +1 -0
- package/dist/web/editor/relative-when.js +18 -0
- package/dist/web/icons.js +6 -5
- package/dist/web/index.d.ts +9 -1
- package/dist/web/index.js +7 -1
- package/dist/web/layout/default-app-shell.js +6 -4
- package/dist/web/layout/focus-aware-sidebar.d.ts +4 -7
- package/dist/web/layout/focus-aware-sidebar.js +5 -7
- package/dist/web/layout/header-action-pinned.d.ts +8 -0
- package/dist/web/layout/header-action-pinned.js +25 -0
- package/dist/web/layout/nav-collapse-state.d.ts +7 -0
- package/dist/web/layout/nav-collapse-state.js +76 -0
- package/dist/web/layout/nav-tree.js +71 -28
- package/dist/web/layout/notification-bell.d.ts +7 -2
- package/dist/web/layout/notification-bell.js +16 -5
- package/dist/web/layout/page-header-slot.d.ts +2 -0
- package/dist/web/layout/page-header-slot.js +4 -0
- package/dist/web/layout/screen-focus.d.ts +8 -0
- package/dist/web/layout/screen-focus.js +42 -0
- package/dist/web/layout/shell-focus.d.ts +5 -4
- package/dist/web/layout/shell-focus.js +14 -7
- package/dist/web/layout/shell-header.d.ts +2 -1
- package/dist/web/layout/shell-header.js +84 -27
- package/dist/web/layout/shell-style.d.ts +3 -0
- package/dist/web/layout/shell-style.js +6 -0
- package/dist/web/layout/sidebar-open-state.d.ts +6 -0
- package/dist/web/layout/sidebar-open-state.js +28 -0
- package/dist/web/layout/uniform-bar-controls.d.ts +2 -2
- package/dist/web/layout/uniform-bar-controls.js +4 -3
- package/dist/web/layout/use-in-app-inbox.js +8 -1
- package/dist/web/layout/workspace-shell.d.ts +11 -1
- package/dist/web/layout/workspace-shell.js +9 -5
- package/dist/web/lib/upload-file-ref.d.ts +2 -2
- package/dist/web/lib/upload-file-ref.js +4 -9
- package/dist/web/presence/use-presence.js +7 -2
- package/dist/web/primitives/banner.d.ts +1 -1
- package/dist/web/primitives/banner.js +22 -9
- package/dist/web/primitives/calendar-day-picker.js +24 -5
- package/dist/web/primitives/card.js +18 -8
- package/dist/web/primitives/code-input.js +6 -1
- package/dist/web/primitives/data-table/actions-column.d.ts +2 -1
- package/dist/web/primitives/data-table/actions-column.js +7 -3
- package/dist/web/primitives/data-table/card-body.d.ts +6 -1
- package/dist/web/primitives/data-table/card-body.js +53 -6
- package/dist/web/primitives/data-table/card-frame.d.ts +8 -0
- package/dist/web/primitives/data-table/card-frame.js +9 -0
- package/dist/web/primitives/data-table/card-row.js +44 -7
- package/dist/web/primitives/data-table/card-sort-select.d.ts +6 -2
- package/dist/web/primitives/data-table/card-sort-select.js +10 -7
- package/dist/web/primitives/data-table/card-view.js +12 -2
- package/dist/web/primitives/data-table/column-picker-section.js +9 -2
- package/dist/web/primitives/data-table/column-resize-handle.js +3 -4
- package/dist/web/primitives/data-table/column-role.d.ts +1 -0
- package/dist/web/primitives/data-table/column-role.js +1 -0
- package/dist/web/primitives/data-table/data-cell-props.d.ts +5 -0
- package/dist/web/primitives/data-table/data-cell-props.js +5 -0
- package/dist/web/primitives/data-table/density.js +1 -0
- package/dist/web/primitives/data-table/facet-cluster.d.ts +2 -1
- package/dist/web/primitives/data-table/facet-cluster.js +2 -2
- package/dist/web/primitives/data-table/group-band.js +4 -0
- package/dist/web/primitives/data-table/hint-cell.d.ts +14 -0
- package/dist/web/primitives/data-table/hint-cell.js +68 -0
- package/dist/web/primitives/data-table/hint-column-width.d.ts +3 -0
- package/dist/web/primitives/data-table/hint-column-width.js +11 -0
- package/dist/web/primitives/data-table/measure-value.js +2 -3
- package/dist/web/primitives/data-table/row-action-column.d.ts +3 -0
- package/dist/web/primitives/data-table/row-action-column.js +4 -0
- package/dist/web/primitives/data-table/row-render-parts.d.ts +1 -1
- package/dist/web/primitives/data-table/row-render-parts.js +3 -2
- package/dist/web/primitives/data-table/sort-options-select.d.ts +22 -0
- package/dist/web/primitives/data-table/sort-options-select.js +46 -0
- package/dist/web/primitives/data-table/sortable-header.d.ts +3 -1
- package/dist/web/primitives/data-table/sortable-header.js +5 -3
- package/dist/web/primitives/data-table/table-body.d.ts +1 -1
- package/dist/web/primitives/data-table/table-body.js +5 -3
- package/dist/web/primitives/data-table/table-chrome.js +3 -1
- package/dist/web/primitives/data-table/table-content.js +12 -7
- package/dist/web/primitives/data-table/table-data-cell.js +9 -3
- package/dist/web/primitives/data-table/table-header-row.js +5 -2
- package/dist/web/primitives/data-table/table-view.js +22 -3
- package/dist/web/primitives/data-table/toolbar-end-cluster.js +1 -1
- package/dist/web/primitives/data-table/toolbar.d.ts +2 -0
- package/dist/web/primitives/data-table/toolbar.js +70 -7
- package/dist/web/primitives/data-table/totals-footer.d.ts +20 -0
- package/dist/web/primitives/data-table/totals-footer.js +41 -9
- package/dist/web/primitives/data-table/use-bulk-selection.js +2 -1
- package/dist/web/primitives/data-table/use-column-pins.js +4 -0
- package/dist/web/primitives/data-table/use-data-table-state.d.ts +1 -0
- package/dist/web/primitives/data-table/use-data-table-state.js +9 -5
- package/dist/web/primitives/data-table/use-measured-column-widths.js +5 -4
- package/dist/web/primitives/data-table/use-row-selection.js +22 -11
- package/dist/web/primitives/data-table/view-menu.js +7 -1
- package/dist/web/primitives/data-table-cell.d.ts +21 -2
- package/dist/web/primitives/data-table-cell.js +129 -26
- package/dist/web/primitives/embedded-file-cell.js +3 -2
- package/dist/web/primitives/embedded-list-cards.js +3 -4
- package/dist/web/primitives/facet-filter.d.ts +5 -3
- package/dist/web/primitives/facet-filter.js +36 -5
- package/dist/web/primitives/facet-search-filter.d.ts +2 -1
- package/dist/web/primitives/facet-search-filter.js +3 -2
- package/dist/web/primitives/facet-trigger-label.d.ts +8 -0
- package/dist/web/primitives/facet-trigger-label.js +9 -0
- package/dist/web/primitives/file-thumbnail.d.ts +6 -2
- package/dist/web/primitives/file-thumbnail.js +13 -6
- package/dist/web/primitives/file-upload.js +3 -2
- package/dist/web/primitives/file-view-action.d.ts +6 -0
- package/dist/web/primitives/file-view-action.js +22 -0
- package/dist/web/primitives/files-dropzone.js +20 -9
- package/dist/web/primitives/form-footer-parts.d.ts +0 -1
- package/dist/web/primitives/form.js +0 -1
- package/dist/web/primitives/hint-reason-row.d.ts +32 -0
- package/dist/web/primitives/hint-reason-row.js +45 -0
- package/dist/web/primitives/index.js +6 -0
- package/dist/web/primitives/layout-elements.d.ts +1 -1
- package/dist/web/primitives/layout-elements.js +3 -3
- package/dist/web/primitives/metric.js +20 -6
- package/dist/web/primitives/page-header.d.ts +1 -1
- package/dist/web/primitives/page-header.js +10 -2
- package/dist/web/primitives/pager.d.ts +3 -2
- package/dist/web/primitives/pager.js +31 -24
- package/dist/web/primitives/reason-box.d.ts +20 -0
- package/dist/web/primitives/reason-box.js +13 -0
- package/dist/web/primitives/record-breadcrumb.d.ts +3 -0
- package/dist/web/primitives/record-breadcrumb.js +11 -0
- package/dist/web/primitives/record-steps.d.ts +3 -0
- package/dist/web/primitives/record-steps.js +50 -0
- package/dist/web/primitives/record-summary.d.ts +3 -0
- package/dist/web/primitives/record-summary.js +18 -0
- package/dist/web/primitives/row-actions.d.ts +3 -1
- package/dist/web/primitives/row-actions.js +14 -5
- package/dist/web/primitives/segmented-select.js +10 -9
- package/dist/web/primitives/tabs.js +6 -1
- package/dist/web/pwa/pwa-support.d.ts +4 -0
- package/dist/web/pwa/pwa-support.js +131 -0
- package/dist/web/sse/live-events.js +2 -2
- package/dist/web/tokens.js +0 -3
- package/dist/web/ui/sidebar.d.ts +2 -1
- package/dist/web/ui/sidebar.js +4 -3
- package/dist/web/widgets/ai-text-field.js +3 -2
- package/dist/web/widgets/chart-parts.d.ts +7 -1
- package/dist/web/widgets/chart-parts.js +10 -4
- package/dist/web/widgets/collapsible-section.js +1 -1
- package/dist/web/widgets/dashboard-list-cards.d.ts +17 -0
- package/dist/web/widgets/dashboard-list-cards.js +46 -0
- package/dist/web/widgets/dashboard-list.d.ts +45 -5
- package/dist/web/widgets/dashboard-list.js +126 -25
- package/dist/web/widgets/drawer-panel-class.d.ts +1 -0
- package/dist/web/widgets/drawer-panel-class.js +9 -1
- package/dist/web/widgets/drawer-sizing.js +1 -1
- package/dist/web/widgets/drawer.js +2 -2
- package/dist/web/widgets/floating-panel.js +4 -2
- package/dist/web/widgets/index.d.ts +2 -0
- package/dist/web/widgets/index.js +2 -0
- package/dist/web/widgets/infinity-list.js +18 -11
- package/dist/web/widgets/pdf-viewer-toolbar.js +3 -2
- package/dist/web/widgets/preview-width-frame.d.ts +7 -0
- package/dist/web/widgets/preview-width-frame.js +10 -0
- package/dist/web/widgets/section-card.d.ts +1 -1
- package/dist/web/widgets/sheet-parts.js +3 -1
- package/dist/web/widgets/stacked-area-chrome.js +3 -3
- package/dist/web/widgets/stacked-area-tooltip.js +2 -10
- package/dist/web/widgets/stat-box-cell.d.ts +19 -0
- package/dist/web/widgets/stat-box-cell.js +10 -0
- package/dist/web/widgets/stat.d.ts +16 -1
- package/dist/web/widgets/stat.js +24 -7
- package/dist/web/widgets/status-badge.d.ts +7 -5
- package/dist/web/widgets/status-badge.js +2 -2
- package/dist/web/widgets/step-bar.d.ts +1 -1
- package/dist/web/widgets/step-bar.js +37 -7
- package/dist/web/widgets/step-list-row.d.ts +4 -0
- package/dist/web/widgets/step-list-row.js +22 -14
- package/dist/web/widgets/step-list.d.ts +12 -4
- package/dist/web/widgets/step-list.js +38 -20
- package/dist/web/widgets/upload-zone.d.ts +8 -1
- package/dist/web/widgets/upload-zone.js +13 -3
- package/package.json +5 -5
- package/src/changes.json +289 -0
- package/src/web/styles.css +15 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Card-Options — Verhalten/Optik, ebenfalls additiv erweiterbar. */
|
|
2
|
+
export type CardOptions = {
|
|
3
|
+
/** Body-Padding (px-6 py-6). false = randlos (Tabelle/eigene Tiles). Default true. */
|
|
4
|
+
readonly padded?: boolean;
|
|
5
|
+
/** Eckenradius. Default "xl" (= Entity-Card). */
|
|
6
|
+
readonly radius?: "lg" | "xl";
|
|
7
|
+
/** Separates the footer with `border-t` and `bg-muted/30`. Defaults to true. */
|
|
8
|
+
readonly footerBordered?: boolean;
|
|
9
|
+
/** Footer horizontal padding. false = none, so footer content aligns with the card edge. Default true. */
|
|
10
|
+
readonly footerInset?: boolean;
|
|
11
|
+
/** Joins the ancestor fillHeight flex chain — a tabs-mode
|
|
12
|
+
* relatedList table sizing to the panel instead of the page — instead of
|
|
13
|
+
* normal document-flow height. Default false. */
|
|
14
|
+
readonly fillHeight?: boolean;
|
|
15
|
+
/** false drops border, background, shadow and radius but keeps padding and
|
|
16
|
+
* header slots — a panel inside a host surface such as a tab panel. Default true. */
|
|
17
|
+
readonly framed?: boolean;
|
|
18
|
+
/** The card is the whole screen body (secretMint reveal and done phase):
|
|
19
|
+
* no frame, the shared screen insets and width of form screens, children
|
|
20
|
+
* stacked with a gap. Without it such a screen sits raw against the
|
|
21
|
+
* shell edge. Default false. */
|
|
22
|
+
readonly screenBody?: boolean;
|
|
23
|
+
/** "inline": title and subtitle on one baseline row at 16px inset, compact padding (the board's side panel). Default "stacked". */
|
|
24
|
+
readonly headerLayout?: "stacked" | "inline";
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const COMPACT_TAP_CLASSES = "relative h-8 px-2.5 text-xs max-md:min-h-0 before:absolute before:inset-x-0 before:-inset-y-1.5 before:content-['']";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// The button looks 32px high but keeps a 44px touch area: the ::before layer reaches 6px past the
|
|
2
|
+
// visible border on top and bottom. Tailwind needs the literal class string.
|
|
3
|
+
export const COMPACT_TAP_CLASSES = "relative h-8 px-2.5 text-xs max-md:min-h-0 before:absolute before:inset-x-0 before:-inset-y-1.5 before:content-['']";
|
|
@@ -4,12 +4,13 @@ import { isPlainObject } from "@cosmicdrift/kumiko-types/type-guards";
|
|
|
4
4
|
import { useState } from "react";
|
|
5
5
|
import { groupEmbeddedListIssues, sumEmbeddedListColumn, withDerivedCells, } from "../headless/index.js";
|
|
6
6
|
import { pluralKey } from "../headless/plural-key.js";
|
|
7
|
-
import { REFERENCE_COMBOBOX_LIMIT } from "../hooks/reference-limits.js";
|
|
7
|
+
import { REFERENCE_COMBOBOX_LIMIT, REFERENCE_LIST_LOOKUP_LIMIT, } from "../hooks/reference-limits.js";
|
|
8
8
|
import { useQuery } from "../hooks/use-query.js";
|
|
9
9
|
import { referenceOptionSource, storedReferenceRowsPayload, withUnlistedSelectedRows, } from "../hooks/use-reference-lookup.js";
|
|
10
10
|
import { useTranslation } from "../i18n.js";
|
|
11
11
|
import { usePrimitives } from "../primitives.js";
|
|
12
12
|
import { coerceCellValue } from "./embedded-list-paste.js";
|
|
13
|
+
import { referenceIdChunks } from "./render-list-reference-columns.js";
|
|
13
14
|
// The primitive never imports condition logic, so the per-row state is evaluated here.
|
|
14
15
|
function rowStateCallbacks(cell, derivedDef) {
|
|
15
16
|
const { visibleWhen, requiredWhen } = cell;
|
|
@@ -42,12 +43,15 @@ function cardPlacementByField(derived, cells) {
|
|
|
42
43
|
const [value, min, max] = def.from;
|
|
43
44
|
if (value === undefined || min === undefined || max === undefined)
|
|
44
45
|
continue;
|
|
46
|
+
const merge = (field, next) => {
|
|
47
|
+
placement.set(field, { ...placement.get(field), ...next });
|
|
48
|
+
};
|
|
45
49
|
if (isNotEditable(min) && isNotEditable(max)) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
merge(value, { cardLimits: { min, max } });
|
|
51
|
+
merge(min, { hiddenInCard: true });
|
|
52
|
+
merge(max, { hiddenInCard: true });
|
|
49
53
|
}
|
|
50
|
-
|
|
54
|
+
merge(target, { cardAttachedTo: value });
|
|
51
55
|
}
|
|
52
56
|
return placement;
|
|
53
57
|
}
|
|
@@ -60,14 +64,11 @@ function cardColumnProps(cell, placement) {
|
|
|
60
64
|
}),
|
|
61
65
|
};
|
|
62
66
|
}
|
|
67
|
+
// Hooks cannot be called per chunk (fixed count per mount), so only the first chunk that fits the
|
|
68
|
+
// list handler's limit is resolved; stored references beyond it keep their raw id.
|
|
63
69
|
function storedCellIds(rows, cellField) {
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
const value = row[cellField];
|
|
67
|
-
if (typeof value === "string" && value !== "")
|
|
68
|
-
ids.add(value);
|
|
69
|
-
}
|
|
70
|
-
return [...ids].sort();
|
|
70
|
+
const [firstChunk = []] = referenceIdChunks(rows, cellField, REFERENCE_LIST_LOOKUP_LIMIT);
|
|
71
|
+
return [...firstChunk].sort();
|
|
71
72
|
}
|
|
72
73
|
function withRecomputedDerived(row, derived, cells) {
|
|
73
74
|
if (derived === undefined)
|
|
@@ -5,10 +5,22 @@ export type ListEmptyStateContent = {
|
|
|
5
5
|
readonly description?: string;
|
|
6
6
|
readonly action?: RenderEditAction;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type NamedFilterEmptyContent = {
|
|
9
|
+
readonly title: string;
|
|
10
|
+
readonly description?: string;
|
|
11
|
+
/** The description needs params from a query; it renders only once the query returned an object. */
|
|
12
|
+
readonly describedByQuery?: {
|
|
13
|
+
readonly query: string;
|
|
14
|
+
readonly describe: (params: Readonly<Record<string, unknown>>) => string;
|
|
15
|
+
};
|
|
16
|
+
readonly onReset: () => void;
|
|
17
|
+
};
|
|
18
|
+
export declare function ListEmptyStateBody({ content, narrowed, namedFilterEmpty, defaultFilterActive, onShowAll, createButton, translate, }: {
|
|
9
19
|
readonly content: ListEmptyStateContent | undefined;
|
|
10
20
|
/** A search term or changed filter produced the empty result, so "create the first one" would mislead. */
|
|
11
21
|
readonly narrowed: boolean;
|
|
22
|
+
/** The active named filter has its own empty sentence; shown instead of the generic "no matches" text. */
|
|
23
|
+
readonly namedFilterEmpty?: NamedFilterEmptyContent | undefined;
|
|
12
24
|
/** A default filter is on and nothing else narrows: rows may exist outside it. */
|
|
13
25
|
readonly defaultFilterActive?: boolean;
|
|
14
26
|
readonly onShowAll?: () => void;
|
|
@@ -1,11 +1,30 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import { ErrorReference } from "../app/error-reference.js";
|
|
4
|
+
import { useQuery } from "../hooks/use-query.js";
|
|
4
5
|
import { usePrimitives } from "../primitives.js";
|
|
5
6
|
import { RenderEditActionButton } from "./render-edit-action-button.js";
|
|
6
|
-
|
|
7
|
+
function isParamsRecord(value) {
|
|
8
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
9
|
+
}
|
|
10
|
+
function QueryDescription({ query, describe, }) {
|
|
11
|
+
const { Text } = usePrimitives();
|
|
12
|
+
const result = useQuery(query, {});
|
|
13
|
+
if (!isParamsRecord(result.data))
|
|
14
|
+
return null;
|
|
15
|
+
return _jsx(Text, { variant: "small", children: describe(result.data) });
|
|
16
|
+
}
|
|
17
|
+
function NamedFilterEmptyText({ content, }) {
|
|
18
|
+
const { Text } = usePrimitives();
|
|
19
|
+
const { description, describedByQuery } = content;
|
|
20
|
+
return (_jsxs(_Fragment, { children: [_jsx(Text, { children: content.title }), description !== undefined && _jsx(Text, { variant: "small", children: description }), describedByQuery !== undefined && (_jsx(QueryDescription, { query: describedByQuery.query, describe: describedByQuery.describe }))] }));
|
|
21
|
+
}
|
|
22
|
+
export function ListEmptyStateBody({ content, narrowed, namedFilterEmpty, defaultFilterActive = false, onShowAll, createButton, translate, }) {
|
|
7
23
|
const { Text, Button, Dialog, Banner } = usePrimitives();
|
|
8
24
|
const [actionError, setActionError] = useState(null);
|
|
25
|
+
if (narrowed && namedFilterEmpty !== undefined) {
|
|
26
|
+
return (_jsxs(_Fragment, { children: [_jsx(NamedFilterEmptyText, { content: namedFilterEmpty }), _jsx(Button, { variant: "secondary", onClick: namedFilterEmpty.onReset, testId: "render-list-empty-reset-filter", children: translate("kumiko.list.empty.resetFilter") })] }));
|
|
27
|
+
}
|
|
9
28
|
if (narrowed)
|
|
10
29
|
return _jsx(Text, { children: translate("kumiko.list.empty.filtered") });
|
|
11
30
|
if (defaultFilterActive) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import type { ListGroupPagesProps } from "../hooks/use-list-aggregates.ts";
|
|
3
|
-
export declare function ListGroupPageBridges({ queryType, requests, onResult, refreshNonce, }: ListGroupPagesProps): ReactNode;
|
|
3
|
+
export declare function ListGroupPageBridges({ queryType, requests, onResult, refreshNonce, resetKey, }: ListGroupPagesProps): ReactNode;
|
|
@@ -26,6 +26,6 @@ function GroupPageBridge({ pageKey, queryType, payload, onResult, refreshNonce,
|
|
|
26
26
|
}, [refreshNonce, refetch]);
|
|
27
27
|
return null;
|
|
28
28
|
}
|
|
29
|
-
export function ListGroupPageBridges({ queryType, requests, onResult, refreshNonce, }) {
|
|
30
|
-
return (_jsx(_Fragment, { children: requests.map((request) => (_jsx(GroupPageBridge, { pageKey: request.pageKey, queryType: queryType, payload: request.payload, onResult: onResult, refreshNonce: refreshNonce }, request.pageKey))) }));
|
|
29
|
+
export function ListGroupPageBridges({ queryType, requests, onResult, refreshNonce, resetKey, }) {
|
|
30
|
+
return (_jsx(_Fragment, { children: requests.map((request) => (_jsx(GroupPageBridge, { pageKey: request.pageKey, queryType: queryType, payload: request.payload, onResult: onResult, refreshNonce: refreshNonce }, `${resetKey}|${request.pageKey}`))) }));
|
|
31
31
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { evalFieldCondition, normalizeListColumn, parseRefTarget, } from "@cosmicdrift/kumiko-framework/ui-types";
|
|
2
|
+
import { evalFieldCondition, normalizeListColumn, parseRefTarget, pickEmptyStateText, } from "@cosmicdrift/kumiko-framework/ui-types";
|
|
3
3
|
import { useCallback, useMemo, useState } from "react";
|
|
4
4
|
import { useAppFeatures } from "../app/app-features-context.js";
|
|
5
5
|
import { useClientActionRuntime } from "../app/client-actions.js";
|
|
@@ -7,7 +7,7 @@ import { ErrorReference } from "../app/error-reference.js";
|
|
|
7
7
|
import { useListBulk } from "../app/list-bulk-actions.js";
|
|
8
8
|
import { buildFilterFacets, buildFilterPayload, mergeReferenceFacetOptions, resolveProjectionFacetSpecs, } from "../app/list-facets.js";
|
|
9
9
|
import { useNav } from "../app/nav.js";
|
|
10
|
-
import {
|
|
10
|
+
import { valueTypeField } from "../app/projection-list-shim.js";
|
|
11
11
|
import { ReferenceFacetBridges, withReferenceFacetState, } from "../app/reference-facet-bridge.js";
|
|
12
12
|
import { navigateWithReturnTo, useReturnHost } from "../app/return-to.js";
|
|
13
13
|
import { buildDefaultEditRowAction, buildProjectionRowActions, buildProjectionToolbarActions, buildRecordActions, findRowClickAction, runDrawerRowAction, runProjectionRowNavigate, } from "../app/row-actions.js";
|
|
@@ -67,20 +67,6 @@ function synthesizeRelatedListEntity(columns, sourceEntity) {
|
|
|
67
67
|
...(sourceEntity?.derivedFields !== undefined && { derivedFields: sourceEntity.derivedFields }),
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
function valueTypeField(valueType, sortable) {
|
|
71
|
-
switch (valueType) {
|
|
72
|
-
case "number":
|
|
73
|
-
// decimal renders through the same number formatter; digits come from the column spec, not scale
|
|
74
|
-
case "decimal":
|
|
75
|
-
return { type: "number", sortable };
|
|
76
|
-
case "bigInt":
|
|
77
|
-
return { type: "bigInt", sortable };
|
|
78
|
-
case "money":
|
|
79
|
-
return { type: "money", sortable };
|
|
80
|
-
case undefined:
|
|
81
|
-
return { type: "text", allowPlaintext: SYNTHESIZED_FIELD_PII_REASON, sortable };
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
70
|
// Mirrors row-actions.ts's own warnDrawerActionDropped (module-private
|
|
85
71
|
// there, so not reusable directly) — a drawer-kind emptyState.action with no
|
|
86
72
|
// onOpenDrawer wired is dropped (not rendered) with a dev warning, same as a
|
|
@@ -93,11 +79,6 @@ function buildRowTone(rule) {
|
|
|
93
79
|
return undefined;
|
|
94
80
|
return (row) => (evalFieldCondition(rule, { ...row.values }) ? rule.tone : undefined);
|
|
95
81
|
}
|
|
96
|
-
function pickEmptyStateText(emptyState, record) {
|
|
97
|
-
if (emptyState === undefined)
|
|
98
|
-
return undefined;
|
|
99
|
-
return (emptyState.variants?.find((variant) => evalFieldCondition(variant.when, record)) ?? emptyState);
|
|
100
|
-
}
|
|
101
82
|
export function RelatedListSection({ section, parentId, record, featureName, translate, hideTitle, grow, onOpenDrawer, actions, anchorId, embedded, onAfterWrite, refreshToken, }) {
|
|
102
83
|
const { Banner, Section, Card, FillContainer, Text, Button, Dialog } = usePrimitives();
|
|
103
84
|
const [emptyStateActionError, setEmptyStateActionError] = useState(null);
|
|
@@ -139,7 +120,8 @@ export function RelatedListSection({ section, parentId, record, featureName, tra
|
|
|
139
120
|
}), [section.columns, listEntityName]);
|
|
140
121
|
// Local state, not URL state: a section `id` is optional, so there is no
|
|
141
122
|
// stable URL key to namespace against — the section's sort is local for the
|
|
142
|
-
// same reason.
|
|
123
|
+
// same reason. With `table.rememberState` the state is seeded from and written back to
|
|
124
|
+
// the list-state store instead, so it survives a reload.
|
|
143
125
|
const { search, filters, sort, setSearch, setFilters, setSort, listTable, groupField } = useRelatedListState(section, nav.route?.screenId);
|
|
144
126
|
const facetSpecs = useMemo(() => resolveProjectionFacetSpecs(section.facets, effectiveTranslate, featureName), [section.facets, effectiveTranslate, featureName]);
|
|
145
127
|
const [referenceFacetOptions, setReferenceFacetOptions] = useState({});
|
|
@@ -10,13 +10,15 @@ export declare function RenderEditActionConfirmDialog({ action, open, onOpenChan
|
|
|
10
10
|
readonly onConfirm: () => void | Promise<void>;
|
|
11
11
|
readonly Dialog: ReturnType<typeof usePrimitives>["Dialog"];
|
|
12
12
|
}): ReactNode;
|
|
13
|
-
export declare function RenderEditActionButton({ action, iconOnly, hideIcon, Button, Dialog, onError, }: {
|
|
13
|
+
export declare function RenderEditActionButton({ action, iconOnly, hideIcon, size, Button, Dialog, onError, }: {
|
|
14
14
|
readonly action: RenderEditAction;
|
|
15
15
|
/** Group-level collapse (see `shouldRenderActionsIconOnly`) — only takes
|
|
16
16
|
* effect when this action actually resolved an icon. */
|
|
17
17
|
readonly iconOnly?: boolean;
|
|
18
18
|
/** Record-header actions are text-only; the icon still shows when collapsed to icon-only. */
|
|
19
19
|
readonly hideIcon?: boolean;
|
|
20
|
+
/** Compact buttons for dense rows; an icon-only collapse keeps its own size. */
|
|
21
|
+
readonly size?: "sm";
|
|
20
22
|
readonly Button: ReturnType<typeof usePrimitives>["Button"];
|
|
21
23
|
readonly Dialog: ReturnType<typeof usePrimitives>["Dialog"];
|
|
22
24
|
readonly onError: (notice: ErrorNotice | null) => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import { errorNoticeOf } from "../app/error-reference.js";
|
|
4
|
+
import { COMPACT_TAP_CLASSES } from "../compact-tap-classes.js";
|
|
4
5
|
// Same rule as RowActionWriteHandler: "danger" forces a confirm even
|
|
5
6
|
// without an explicit confirm key — unless `confirmRequired` overrides it
|
|
6
7
|
// (schema-driven navigate/drawer actions, where the target form is itself
|
|
@@ -15,7 +16,7 @@ export function RenderEditActionConfirmDialog({ action, open, onOpenChange, onCo
|
|
|
15
16
|
// render-list.tsx's ToolbarActionView (each RenderEditAction is
|
|
16
17
|
// independently bound by the caller, there is no shared trigger pipeline
|
|
17
18
|
// to hook into like the built-in onDelete/onSubmit paths have).
|
|
18
|
-
export function RenderEditActionButton({ action, iconOnly = false, hideIcon = false, Button, Dialog, onError, }) {
|
|
19
|
+
export function RenderEditActionButton({ action, iconOnly = false, hideIcon = false, size, Button, Dialog, onError, }) {
|
|
19
20
|
const [busy, setBusy] = useState(false);
|
|
20
21
|
const [confirmOpen, setConfirmOpen] = useState(false);
|
|
21
22
|
const trigger = async () => {
|
|
@@ -31,9 +32,10 @@ export function RenderEditActionButton({ action, iconOnly = false, hideIcon = fa
|
|
|
31
32
|
setBusy(false);
|
|
32
33
|
}
|
|
33
34
|
};
|
|
34
|
-
|
|
35
|
+
// `display: "link"` wins over a plain style; only a danger style keeps its look.
|
|
36
|
+
const variant = action.display === "link" && action.style !== "danger" ? "link" : (action.style ?? "secondary");
|
|
35
37
|
const showIconOnly = iconOnly && action.icon !== undefined;
|
|
36
|
-
return (_jsxs(_Fragment, { children: [_jsx(Button, { type: "button", variant: variant, loading: busy, ...(action.icon !== undefined && (!hideIcon || showIconOnly) && { icon: action.icon }), ...(showIconOnly && {
|
|
38
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button, { type: "button", variant: variant, loading: busy, ...(action.icon !== undefined && (!hideIcon || showIconOnly) && { icon: action.icon }), ...(!showIconOnly && size !== undefined && { size, className: COMPACT_TAP_CLASSES }), ...(showIconOnly && {
|
|
37
39
|
size: "icon",
|
|
38
40
|
ariaLabel: action.label,
|
|
39
41
|
title: action.label,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import type { EditSectionViewModel,
|
|
2
|
+
import type { EditSectionViewModel, FormValues } from "../headless/index.ts";
|
|
3
3
|
import type { FooterFlags, LayoutFlags } from "./render-edit-layout-flags.ts";
|
|
4
4
|
import type { TitleModel } from "./render-edit-titles.ts";
|
|
5
5
|
import type { RenderEditProps } from "./render-edit-types.ts";
|
|
@@ -43,7 +43,6 @@ export type RenderEditEngine<TValues extends FormValues, TCtx = unknown> = Rende
|
|
|
43
43
|
readonly saveNow?: boolean;
|
|
44
44
|
}) => Promise<void>;
|
|
45
45
|
};
|
|
46
|
-
export type { EditSectionViewModel, EditViewModel };
|
|
47
46
|
export type RenderEditModel<TValues extends FormValues, TCtx = unknown> = {
|
|
48
47
|
readonly engine: RenderEditEngine<TValues, TCtx>;
|
|
49
48
|
readonly layout: LayoutFlags;
|
|
@@ -61,3 +60,4 @@ export type SectionRenderContext<TValues extends FormValues, TCtx = unknown> = {
|
|
|
61
60
|
export type FieldsSection = Extract<EditSectionViewModel, {
|
|
62
61
|
readonly kind: "fields";
|
|
63
62
|
}>;
|
|
63
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ActionFormFooterAction, EntityDefinition, EntityEditScreenDefinition, FormDerivationScreen, IconKey, RowAction, RowActionDrawer } from "@cosmicdrift/kumiko-framework/ui-types";
|
|
1
|
+
import type { ActionFormFooterAction, EntityDefinition, EntityEditScreenDefinition, FormDerivationScreen, IconKey, RowAction, RowActionDisplay, RowActionDrawer } from "@cosmicdrift/kumiko-framework/ui-types";
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
3
|
import type * as z from "zod";
|
|
4
4
|
import type { DispatcherError, FormSnapshot, FormValues, SubmitResult, Translate } from "../headless/index.ts";
|
|
@@ -131,7 +131,7 @@ export type RenderEditProps<TValues extends FormValues, TCtx = unknown> = {
|
|
|
131
131
|
* `controller.validate()` call) that ignores issues on hidden fields and
|
|
132
132
|
* outside the `fields` scope, like submit() does, so it does not paint field errors into
|
|
133
133
|
* the UI and can diverge from the currently rendered `snapshot.errors` —
|
|
134
|
-
*
|
|
134
|
+
* covers the required fields of the screen plus `schema`. A caller that patches a fresh object
|
|
135
135
|
* reference on every call must not do so unconditionally: `setValues` is
|
|
136
136
|
* a no-op when the merged value is reference-equal to the current one,
|
|
137
137
|
* so only a converging patch settles instead of looping. Without this
|
|
@@ -244,6 +244,8 @@ export type RenderEditAction = {
|
|
|
244
244
|
readonly label: string;
|
|
245
245
|
readonly onPress: () => void | Promise<void>;
|
|
246
246
|
readonly style?: "primary" | "secondary" | "danger";
|
|
247
|
+
/** `"link"` draws the action as a text link; `style: "danger"` keeps its colour. */
|
|
248
|
+
readonly display?: RowActionDisplay;
|
|
247
249
|
readonly confirm?: string;
|
|
248
250
|
readonly confirmLabel?: string;
|
|
249
251
|
/** Overrides the default "danger implies a confirm dialog" rule. Schema-driven
|
|
@@ -8,6 +8,7 @@ import { createWizardNavigation } from "./render-edit-wizard-navigation.js";
|
|
|
8
8
|
import { useRenderEditControlledSync } from "./use-render-edit-controlled-sync.js";
|
|
9
9
|
import { useRenderEditDraftSave } from "./use-render-edit-draft-save.js";
|
|
10
10
|
import { useRenderEditForm } from "./use-render-edit-form.js";
|
|
11
|
+
import { useEffectiveFormSchema } from "./use-render-edit-schema.js";
|
|
11
12
|
import { useRenderEditSections } from "./use-render-edit-sections.js";
|
|
12
13
|
import { useRenderEditState } from "./use-render-edit-state.js";
|
|
13
14
|
import { useRenderEditSteps } from "./use-render-edit-steps.js";
|
|
@@ -17,7 +18,8 @@ function footerSlotName(screen) {
|
|
|
17
18
|
return footerSlot !== undefined ? extensionSectionName(footerSlot) : undefined;
|
|
18
19
|
}
|
|
19
20
|
export function RenderEdit(rawProps) {
|
|
20
|
-
const
|
|
21
|
+
const effectiveSchema = useEffectiveFormSchema(rawProps);
|
|
22
|
+
const props = { ...resolveRenderEditProps(rawProps), schema: effectiveSchema };
|
|
21
23
|
const state = useRenderEditState({
|
|
22
24
|
screen: props.screen,
|
|
23
25
|
entityId: props.entityId,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { EntityListScreenDefinition, ListColumnHint } from "@cosmicdrift/kumiko-framework/ui-types";
|
|
2
|
+
import type { ListColumnHintViewModel, ListColumnViewModel, Translate } from "../headless/index.ts";
|
|
3
|
+
/** The hint's tone falls back to the list's `rowToneField`. */
|
|
4
|
+
export declare function hintViewModel(hint: ListColumnHint, rowToneField: string | undefined, translate: Translate): ListColumnHintViewModel;
|
|
5
|
+
export declare function withDisplayColumns(columns: readonly ListColumnViewModel[], screen: EntityListScreenDefinition): readonly ListColumnViewModel[];
|
|
6
|
+
export declare function withEmptyPlaceholderColumns(columns: readonly ListColumnViewModel[], screen: EntityListScreenDefinition): readonly ListColumnViewModel[];
|
|
7
|
+
export declare function withNarrowOnlyColumns(columns: readonly ListColumnViewModel[], screen: EntityListScreenDefinition): readonly ListColumnViewModel[];
|
|
8
|
+
export declare function withNarrowInlineColumns(columns: readonly ListColumnViewModel[], screen: EntityListScreenDefinition): readonly ListColumnViewModel[];
|
|
9
|
+
export declare function withHintColumns(columns: readonly ListColumnViewModel[], screen: EntityListScreenDefinition, translate: Translate): readonly ListColumnViewModel[];
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { normalizeListColumn } from "@cosmicdrift/kumiko-framework/ui-types";
|
|
2
|
+
const HINT_EMPTY_LABEL_KEY = "kumiko.list.hint.empty";
|
|
3
|
+
const HINT_REASON_LABEL_KEY = "kumiko.list.hint.reason";
|
|
4
|
+
/** The hint's tone falls back to the list's `rowToneField`. */
|
|
5
|
+
export function hintViewModel(hint, rowToneField, translate) {
|
|
6
|
+
const toneField = hint.toneField ?? rowToneField;
|
|
7
|
+
return {
|
|
8
|
+
emptyLabel: translate(hint.emptyLabel ?? HINT_EMPTY_LABEL_KEY),
|
|
9
|
+
reasonLabel: translate(HINT_REASON_LABEL_KEY),
|
|
10
|
+
...(hint.reasonField !== undefined && { reasonField: hint.reasonField }),
|
|
11
|
+
...(hint.reasonOpenField !== undefined && { reasonOpenField: hint.reasonOpenField }),
|
|
12
|
+
...(hint.reasonTitleField !== undefined && { reasonTitleField: hint.reasonTitleField }),
|
|
13
|
+
...(hint.detailField !== undefined && { detailField: hint.detailField }),
|
|
14
|
+
...(hint.narrowDetailField !== undefined && { narrowDetailField: hint.narrowDetailField }),
|
|
15
|
+
...(hint.narrowField !== undefined && { narrowField: hint.narrowField }),
|
|
16
|
+
...(hint.plainSentence === true && { plainSentence: true }),
|
|
17
|
+
...(toneField !== undefined && { toneField }),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
// Only "badge" is drawn by list tables; "button" is boot-rejected there (a row button is a rowAction) and "bar"/"datetime" are dashboard-only.
|
|
21
|
+
export function withDisplayColumns(columns, screen) {
|
|
22
|
+
const specs = new Map(screen.columns.map((spec) => [normalizeListColumn(spec).field, normalizeListColumn(spec)]));
|
|
23
|
+
return columns.map((col) => {
|
|
24
|
+
const spec = specs.get(col.field);
|
|
25
|
+
if (spec?.display !== "badge")
|
|
26
|
+
return col;
|
|
27
|
+
return {
|
|
28
|
+
...col,
|
|
29
|
+
display: spec.display,
|
|
30
|
+
...(spec.badgeToneField !== undefined && { badgeToneField: spec.badgeToneField }),
|
|
31
|
+
...(spec.badgeDot !== undefined && { badgeDot: spec.badgeDot }),
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
export function withEmptyPlaceholderColumns(columns, screen) {
|
|
36
|
+
const blank = new Set(screen.columns.flatMap((spec) => {
|
|
37
|
+
const column = normalizeListColumn(spec);
|
|
38
|
+
return column.emptyPlaceholder === false ? [column.field] : [];
|
|
39
|
+
}));
|
|
40
|
+
if (blank.size === 0)
|
|
41
|
+
return columns;
|
|
42
|
+
return columns.map((col) => (blank.has(col.field) ? { ...col, emptyPlaceholder: false } : col));
|
|
43
|
+
}
|
|
44
|
+
export function withNarrowOnlyColumns(columns, screen) {
|
|
45
|
+
const narrowOnly = new Set(screen.columns.flatMap((spec) => {
|
|
46
|
+
const column = normalizeListColumn(spec);
|
|
47
|
+
return column.showOnNarrowOnly === true ? [column.field] : [];
|
|
48
|
+
}));
|
|
49
|
+
if (narrowOnly.size === 0)
|
|
50
|
+
return columns;
|
|
51
|
+
return columns.map((col) => narrowOnly.has(col.field) ? { ...col, showOnNarrowOnly: true } : col);
|
|
52
|
+
}
|
|
53
|
+
export function withNarrowInlineColumns(columns, screen) {
|
|
54
|
+
const inline = new Set(screen.columns.flatMap((spec) => {
|
|
55
|
+
const column = normalizeListColumn(spec);
|
|
56
|
+
return column.narrowInline === true ? [column.field] : [];
|
|
57
|
+
}));
|
|
58
|
+
if (inline.size === 0)
|
|
59
|
+
return columns;
|
|
60
|
+
return columns.map((col) => (inline.has(col.field) ? { ...col, narrowInline: true } : col));
|
|
61
|
+
}
|
|
62
|
+
// The hint cell owns its rendering: DataTableCell ignores the column's renderer and links once a hint is set.
|
|
63
|
+
export function withHintColumns(columns, screen, translate) {
|
|
64
|
+
const hints = new Map();
|
|
65
|
+
const normalized = new Map();
|
|
66
|
+
for (const spec of screen.columns) {
|
|
67
|
+
const column = normalizeListColumn(spec);
|
|
68
|
+
if (column.hint === undefined)
|
|
69
|
+
continue;
|
|
70
|
+
hints.set(column.field, column.hint);
|
|
71
|
+
normalized.set(column.field, column);
|
|
72
|
+
}
|
|
73
|
+
if (hints.size === 0)
|
|
74
|
+
return columns;
|
|
75
|
+
return columns.map((col) => {
|
|
76
|
+
const hint = hints.get(col.field);
|
|
77
|
+
if (hint === undefined)
|
|
78
|
+
return col;
|
|
79
|
+
const { width, minWidth } = normalized.get(col.field) ?? {};
|
|
80
|
+
return {
|
|
81
|
+
...col,
|
|
82
|
+
hint: hintViewModel(hint, screen.rowToneField, translate),
|
|
83
|
+
...(width !== undefined && { width }),
|
|
84
|
+
...(minWidth !== undefined && { minWidth }),
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
}
|
|
@@ -119,6 +119,8 @@ function buildLinkItemsFor(lookup) {
|
|
|
119
119
|
}
|
|
120
120
|
function buildReferenceRenderer(lookup) {
|
|
121
121
|
const { col, map, labelField, unresolvedLabel } = lookup;
|
|
122
|
+
// A function renderer bypasses DataTableCell's empty path, so `emptyPlaceholder: false` is honoured here.
|
|
123
|
+
const empty = col.emptyPlaceholder === false ? "" : EMPTY_VALUE_PLACEHOLDER;
|
|
122
124
|
return (value, row) => {
|
|
123
125
|
// Server eager loading: when the server includes _refs, read the display
|
|
124
126
|
// value directly from the resolved row. This avoids a round trip
|
|
@@ -135,11 +137,11 @@ function buildReferenceRenderer(lookup) {
|
|
|
135
137
|
// Renderer-side fallback when server eager loading is not active.
|
|
136
138
|
if (Array.isArray(value)) {
|
|
137
139
|
if (value.length === 0)
|
|
138
|
-
return
|
|
140
|
+
return empty;
|
|
139
141
|
return value.map((v) => map?.get(String(v)) ?? unresolvedLabel(String(v))).join(", ");
|
|
140
142
|
}
|
|
141
143
|
if (value === null || value === undefined || value === "")
|
|
142
|
-
return
|
|
144
|
+
return empty;
|
|
143
145
|
const idStr = String(value);
|
|
144
146
|
return map?.get(idStr) ?? unresolvedLabel(idStr);
|
|
145
147
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { isSelectOptionTone } from "../status-tone.js";
|
|
2
|
+
/** Tints a row by the tone its `field` holds; other values leave the row untoned. */
|
|
3
|
+
export function rowToneFromField(field) {
|
|
4
|
+
if (field === undefined)
|
|
5
|
+
return undefined;
|
|
6
|
+
return (row) => {
|
|
7
|
+
const tone = row.values[field];
|
|
8
|
+
return isSelectOptionTone(tone) ? tone : undefined;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ListNarrowFacets } from "@cosmicdrift/kumiko-types/screen";
|
|
1
2
|
import type { ReactNode } from "react";
|
|
2
3
|
import type { RenderListProps } from "./render-list-types.ts";
|
|
3
4
|
type Pick2<K extends keyof RenderListProps> = Pick<RenderListProps, K>;
|
|
@@ -14,9 +15,16 @@ export declare function tableChromeProps(p: Pick2<"onRowClick" | "description">
|
|
|
14
15
|
toolbarEnd?: string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined;
|
|
15
16
|
itemNoun?: ((count: number) => string) | undefined;
|
|
16
17
|
};
|
|
17
|
-
export declare function tableSortPagingProps(p: Pick2<"sort" | "onSortChange" | "pager" | "onReachEnd" | "loadingMore" | "hasMore">
|
|
18
|
+
export declare function tableSortPagingProps(p: Pick2<"sort" | "onSortChange" | "sortOptions" | "toolbarSort" | "pager" | "onReachEnd" | "loadingMore" | "hasMore"> & {
|
|
19
|
+
readonly narrowFacets?: ListNarrowFacets;
|
|
20
|
+
}): {
|
|
21
|
+
narrowFacets?: "pills" | undefined;
|
|
18
22
|
sort?: import("../primitives.tsx").DataTableSort | null | undefined;
|
|
19
23
|
onSortChange?: ((next: import("../index.ts").ListSort | null) => void) | undefined;
|
|
24
|
+
sortOptions?: readonly (import("../primitives.tsx").DataTableSort & {
|
|
25
|
+
readonly label: string;
|
|
26
|
+
})[] | undefined;
|
|
27
|
+
toolbarSort?: true | undefined;
|
|
20
28
|
pager?: {
|
|
21
29
|
readonly page: number;
|
|
22
30
|
readonly limit: number;
|
|
@@ -10,10 +10,13 @@ export function tableChromeProps(p) {
|
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
export function tableSortPagingProps(p) {
|
|
13
|
-
const { sort, onSortChange, pager, onReachEnd, loadingMore, hasMore } = p;
|
|
13
|
+
const { sort, onSortChange, sortOptions, toolbarSort, pager, onReachEnd, loadingMore, hasMore } = p;
|
|
14
14
|
return {
|
|
15
|
+
...(p.narrowFacets !== undefined && { narrowFacets: p.narrowFacets }),
|
|
15
16
|
...(sort !== undefined && { sort }),
|
|
16
17
|
...(onSortChange !== undefined && { onSortChange }),
|
|
18
|
+
...(sortOptions !== undefined && { sortOptions }),
|
|
19
|
+
...(toolbarSort === true && { toolbarSort }),
|
|
17
20
|
...(pager !== undefined && { pager }),
|
|
18
21
|
...(onReachEnd !== undefined && { onReachEnd }),
|
|
19
22
|
...(loadingMore !== undefined && { loadingMore }),
|
|
@@ -12,8 +12,7 @@ export type ToolbarActionButton = {
|
|
|
12
12
|
* destructive, but the target form is the confirmation. */
|
|
13
13
|
readonly confirmRequired?: boolean;
|
|
14
14
|
readonly onTrigger: () => Promise<void> | void;
|
|
15
|
-
/**
|
|
16
|
-
* ToolbarAction has no author-declared icon field, unlike RowAction. */
|
|
15
|
+
/** The action's declared icon, else the id-derived default (ACTION_ICON_BY_ID). */
|
|
17
16
|
readonly icon?: IconKey;
|
|
18
17
|
};
|
|
19
18
|
export declare function ToolbarActionView({ action, iconOnly, Button, Dialog, Banner, }: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EntityListScreenDefinition } from "@cosmicdrift/kumiko-framework/ui-types";
|
|
1
|
+
import type { EntityListScreenDefinition, ListToolbarActionsPlacement } from "@cosmicdrift/kumiko-framework/ui-types";
|
|
2
2
|
import type { Translate } from "../headless/index.ts";
|
|
3
3
|
import { type ActionMenuItemSpec } from "../primitives.tsx";
|
|
4
4
|
import type { ToolbarActionButton } from "./render-list-toolbar-action.tsx";
|
|
@@ -8,13 +8,16 @@ type ToolbarModelInput = {
|
|
|
8
8
|
readonly pageHeaderSlotAvailable: boolean;
|
|
9
9
|
readonly pageHeaderCompact: boolean;
|
|
10
10
|
readonly createInPageHeader: boolean;
|
|
11
|
+
readonly toolbarActionsPlacement: ListToolbarActionsPlacement | undefined;
|
|
11
12
|
};
|
|
13
|
+
export declare function withPlusIconFallback(action: ToolbarActionButton, actions: readonly ToolbarActionButton[]): ToolbarActionButton;
|
|
12
14
|
export type ToolbarActionSplit = {
|
|
13
15
|
readonly toolbarIconOnly: boolean;
|
|
14
16
|
readonly promotedToolbarActions: readonly ToolbarActionButton[];
|
|
15
17
|
readonly promotedInOverflowMenu: boolean;
|
|
16
18
|
readonly toolbarActionsInToolbar: readonly ToolbarActionButton[];
|
|
17
19
|
readonly hasToolbarActionsInToolbar: boolean;
|
|
20
|
+
readonly actionsInToolbar: boolean;
|
|
18
21
|
};
|
|
19
22
|
export declare function splitToolbarActions(input: ToolbarModelInput): ToolbarActionSplit;
|
|
20
23
|
type MenuItemInput = {
|
|
@@ -5,19 +5,32 @@ import { needsActionConfirm } from "./render-edit-action-button.js";
|
|
|
5
5
|
function isHeaderPromotableToolbarAction(action) {
|
|
6
6
|
return action.style === "primary" && !needsActionConfirm(action);
|
|
7
7
|
}
|
|
8
|
+
// Several icon-less primary actions would all show the same fallback "plus" icon, so it
|
|
9
|
+
// only applies to a sole one (same reasoning as the header's overflow menu below).
|
|
10
|
+
export function withPlusIconFallback(action, actions) {
|
|
11
|
+
const isIconlessPrimary = (a) => a.style === "primary" && a.icon === undefined;
|
|
12
|
+
return isIconlessPrimary(action) && actions.filter(isIconlessPrimary).length === 1
|
|
13
|
+
? { ...action, icon: "plus" }
|
|
14
|
+
: action;
|
|
15
|
+
}
|
|
8
16
|
export function splitToolbarActions(input) {
|
|
9
|
-
const { toolbarActions, pageHeaderAvailable, pageHeaderSlotAvailable, pageHeaderCompact, createInPageHeader, } = input;
|
|
17
|
+
const { toolbarActions, pageHeaderAvailable, pageHeaderSlotAvailable, pageHeaderCompact, createInPageHeader, toolbarActionsPlacement, } = input;
|
|
18
|
+
// From md up; below it the compact header keeps the actions.
|
|
19
|
+
const actionsInToolbar = toolbarActionsPlacement === "toolbar" && !pageHeaderCompact;
|
|
10
20
|
const hasToolbarActions = toolbarActions !== undefined && toolbarActions.length > 0;
|
|
11
21
|
const toolbarIconOnly = hasToolbarActions && shouldRenderActionsIconOnly(toolbarActions);
|
|
12
22
|
// Every primary toolbar action takes the page-header slot, left of the create
|
|
13
23
|
// button (which stays the rightmost primary action): labelled on desktop, so
|
|
14
24
|
// projection lists look like entity lists. On phones an icon button, or, next to
|
|
15
|
-
// the create button, an entry in the header's overflow
|
|
16
|
-
// room for
|
|
17
|
-
const promotedToolbarActions = pageHeaderAvailable && pageHeaderSlotAvailable
|
|
25
|
+
// the create button or beside another promoted action, an entry in the header's overflow
|
|
26
|
+
// menu: the header has no room for labelled actions.
|
|
27
|
+
const promotedToolbarActions = pageHeaderAvailable && pageHeaderSlotAvailable && !actionsInToolbar
|
|
18
28
|
? (toolbarActions?.filter(isHeaderPromotableToolbarAction) ?? [])
|
|
19
29
|
: [];
|
|
20
|
-
|
|
30
|
+
// Several icon-less actions would otherwise all show the same fallback "plus" icon.
|
|
31
|
+
const promotedInOverflowMenu = pageHeaderCompact &&
|
|
32
|
+
promotedToolbarActions.length > 0 &&
|
|
33
|
+
(createInPageHeader || promotedToolbarActions.length > 1);
|
|
21
34
|
const toolbarActionsInToolbar = toolbarActions?.filter((a) => !promotedToolbarActions.includes(a)) ?? [];
|
|
22
35
|
const hasToolbarActionsInToolbar = toolbarActionsInToolbar.length > 0;
|
|
23
36
|
return {
|
|
@@ -26,6 +39,7 @@ export function splitToolbarActions(input) {
|
|
|
26
39
|
promotedInOverflowMenu,
|
|
27
40
|
toolbarActionsInToolbar,
|
|
28
41
|
hasToolbarActionsInToolbar,
|
|
42
|
+
actionsInToolbar,
|
|
29
43
|
};
|
|
30
44
|
}
|
|
31
45
|
export function buildPromotedMenuItems(input) {
|
|
@@ -65,7 +79,8 @@ export function resolveToolbarLabels(input) {
|
|
|
65
79
|
return { effectiveCreateLabel, effectiveSearchPlaceholder };
|
|
66
80
|
}
|
|
67
81
|
export function resolveItemNoun(input) {
|
|
68
|
-
const { screen, translate,
|
|
82
|
+
const { screen, translate, featureName } = input;
|
|
83
|
+
const itemNounKey = input.itemNounKey ?? screen.itemNounKey;
|
|
69
84
|
const nounKey = itemNounKey ?? `${featureName}:entity:${screen.entity}:noun`;
|
|
70
85
|
return (itemNounKey !== undefined || !screen.entity.startsWith("__")) &&
|
|
71
86
|
translate(nounKey, { count: 2 }) !== nounKey
|
|
@@ -2,8 +2,8 @@ import type { EntityListScreenDefinition } from "@cosmicdrift/kumiko-framework/u
|
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
3
|
import type { Translate } from "../headless/index.ts";
|
|
4
4
|
import type { ActionMenuItemSpec, usePrimitives } from "../primitives.tsx";
|
|
5
|
-
import { type ListEmptyStateContent } from "./list-empty-state.tsx";
|
|
6
|
-
import type
|
|
5
|
+
import { type ListEmptyStateContent, type NamedFilterEmptyContent } from "./list-empty-state.tsx";
|
|
6
|
+
import { type ToolbarActionSplit } from "./render-list-toolbar-model.ts";
|
|
7
7
|
type Primitives = ReturnType<typeof usePrimitives>;
|
|
8
8
|
export type ListToolbarModel = {
|
|
9
9
|
readonly screen: EntityListScreenDefinition;
|
|
@@ -26,6 +26,7 @@ type EmptyStateModel = {
|
|
|
26
26
|
readonly onCreate: (() => void) | undefined;
|
|
27
27
|
readonly emptyContent: ListEmptyStateContent | undefined;
|
|
28
28
|
readonly narrowed: boolean;
|
|
29
|
+
readonly namedFilterEmpty: NamedFilterEmptyContent | undefined;
|
|
29
30
|
readonly defaultFilterActive: boolean;
|
|
30
31
|
readonly onFilterReset: (() => void) | undefined;
|
|
31
32
|
readonly translate: Translate;
|