@cosmicdrift/kumiko-renderer 0.389.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/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 +69 -189
- 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/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/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 -670
- 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-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 +4 -113
- package/dist/components/render-list.js +91 -307
- 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/primitives.d.ts +1 -1
- 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/use-dashboard-screen-state.d.ts +35 -0
- package/dist/web/app/use-dashboard-screen-state.js +69 -0
- package/dist/web/primitives/data-table/actions-column.js +6 -5
- 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-view.d.ts +3 -0
- package/dist/web/primitives/data-table/card-view.js +13 -0
- package/dist/web/primitives/data-table/column-resize-handle.js +3 -1
- 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/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/table-body.d.ts +3 -0
- package/dist/web/primitives/data-table/table-body.js +32 -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-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.d.ts +6 -0
- package/dist/web/primitives/data-table/toolbar.js +53 -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.d.ts +3 -4
- package/dist/web/primitives/data-table.js +32 -252
- package/dist/web/primitives/file-value-list.js +1 -1
- 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/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/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 +54 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import type { EntityDefinition, EntityListScreenDefinition } from "@cosmicdrift/kumiko-framework/ui-types";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import type { ListRowViewModel, Translate } from "../headless/index.ts";
|
|
4
|
+
import type { ListSort } from "../hooks/use-list-url-state.ts";
|
|
5
|
+
import type { DataTableDateRangeFacet, DataTableFacet, DataTableProps, DataTableRowAction, DataTableRowActionMode, DataTableTableBlockProps } from "../primitives.tsx";
|
|
6
|
+
import type { ListEmptyStateContent } from "./list-empty-state.tsx";
|
|
7
|
+
import type { ToolbarActionButton } from "./render-list-toolbar-action.tsx";
|
|
8
|
+
export type RenderListProps = {
|
|
9
|
+
readonly screen: EntityListScreenDefinition;
|
|
10
|
+
readonly entity: Pick<EntityDefinition, "fields" | "derivedFields">;
|
|
11
|
+
readonly rows: readonly Readonly<Record<string, unknown>>[];
|
|
12
|
+
readonly featureName: string;
|
|
13
|
+
readonly translate?: Translate;
|
|
14
|
+
readonly onRowClick?: (row: ListRowViewModel) => void;
|
|
15
|
+
/** Overrides the default empty box. When set, the automatic CTA via
|
|
16
|
+
* `onCreate` is ignored; the caller's content takes precedence. */
|
|
17
|
+
readonly emptyState?: ReactNode;
|
|
18
|
+
/** Adds a "+ New" button to the toolbar and uses it as the CTA in the
|
|
19
|
+
* default empty box. The caller provides the action (for example,
|
|
20
|
+
* navigation to the edit screen). */
|
|
21
|
+
readonly onCreate?: () => void;
|
|
22
|
+
/** Label for the + New button. Defaults to the i18n bundle key
|
|
23
|
+
* (`kumiko.actions.create`). The caller can override it. */
|
|
24
|
+
readonly createLabel?: string;
|
|
25
|
+
/** Enables a search input in the toolbar. Filtering is server-side via
|
|
26
|
+
* the caller's onSearchChange; RenderList does not filter locally. */
|
|
27
|
+
readonly searchable?: boolean;
|
|
28
|
+
/** Placeholder for the search input. Defaults to the i18n bundle key
|
|
29
|
+
* (`kumiko.list.search-placeholder`). */
|
|
30
|
+
readonly searchPlaceholder?: string;
|
|
31
|
+
/** Hint at the left of the toolbar (already translated). */
|
|
32
|
+
readonly description?: string;
|
|
33
|
+
/** Author-declared replacement for the default empty box (already translated). */
|
|
34
|
+
readonly emptyContent?: ListEmptyStateContent;
|
|
35
|
+
/** Search or filters changed the result; the empty box then says "no matches". */
|
|
36
|
+
readonly narrowed?: boolean;
|
|
37
|
+
/** Nothing was narrowed by the user, but a default filter is still on; the empty box then offers "show all" instead of "create the first one". */
|
|
38
|
+
readonly defaultFilterActive?: boolean;
|
|
39
|
+
/** Plural-forms key for the footer count noun; default is the entity's `:noun` convention key. */
|
|
40
|
+
readonly itemNounKey?: string;
|
|
41
|
+
/** Current search term (from URL state / the parent). RenderList buffers
|
|
42
|
+
* typing locally with a 300ms debounce before calling onSearchChange;
|
|
43
|
+
* otherwise every keystroke would trigger a server round trip. */
|
|
44
|
+
readonly searchValue?: string;
|
|
45
|
+
/** Called when the debounced search term changes. The caller uses it to
|
|
46
|
+
* set URL state (?<id>.q=…) and trigger a refetch. */
|
|
47
|
+
readonly onSearchChange?: (next: string) => void;
|
|
48
|
+
/** Current sorting, or null for the server's default order. */
|
|
49
|
+
readonly sort?: ListSort | null;
|
|
50
|
+
/** Called with the next sort state after a header click. */
|
|
51
|
+
readonly onSortChange?: (next: ListSort | null) => void;
|
|
52
|
+
/** Pager props for pagination="pages". If undefined, no pager UI is
|
|
53
|
+
* rendered; the default or infinite mode is used. KumikoScreen supplies
|
|
54
|
+
* this according to screen.pagination. */
|
|
55
|
+
readonly pager?: {
|
|
56
|
+
readonly page: number;
|
|
57
|
+
readonly limit: number;
|
|
58
|
+
readonly total: number;
|
|
59
|
+
readonly onPageChange: (next: number) => void;
|
|
60
|
+
};
|
|
61
|
+
/** Infinite-scroll wiring for pagination="infinite". KumikoScreen keeps
|
|
62
|
+
* the accumulated rows and cursor; RenderList passes the callbacks
|
|
63
|
+
* through to DataTable. */
|
|
64
|
+
readonly onReachEnd?: () => void;
|
|
65
|
+
readonly loadingMore?: boolean;
|
|
66
|
+
readonly hasMore?: boolean;
|
|
67
|
+
/** Per-row actions in resolved form. KumikoScreen builds them from
|
|
68
|
+
* EntityListScreenDefinition.rowActions: handler-QN becomes a dispatcher
|
|
69
|
+
* call, and i18n keys become translated strings. */
|
|
70
|
+
readonly rowActions?: readonly DataTableRowAction[];
|
|
71
|
+
/** How the row-action column renders (see `DataTableProps.rowActionMode`). KumikoScreen
|
|
72
|
+
* derives it from the actions; without it the DataTable uses its adaptive default. */
|
|
73
|
+
readonly rowActionMode?: DataTableRowActionMode;
|
|
74
|
+
/** Forwarded to `DataTableProps.bulk` / `rowTone`. */
|
|
75
|
+
readonly bulk?: DataTableProps["bulk"];
|
|
76
|
+
readonly rowTone?: DataTableProps["rowTone"];
|
|
77
|
+
/** Toolbar actions in the list header in resolved form. KumikoScreen
|
|
78
|
+
* builds them from EntityListScreenDefinition.toolbarActions:
|
|
79
|
+
* navigate targets use useNav and handler-QN uses a dispatcher call.
|
|
80
|
+
* RenderList renders the buttons on the right side of the toolbar,
|
|
81
|
+
* before "+ New". */
|
|
82
|
+
readonly toolbarActions?: readonly ToolbarActionButton[];
|
|
83
|
+
/** Faceted filter dropdowns. KumikoScreen builds them from filterable
|
|
84
|
+
* select/boolean fields; RenderList passes them through to DataTable. */
|
|
85
|
+
readonly filterFacets?: readonly DataTableFacet[];
|
|
86
|
+
/** Currently selected facet values by field (from URL state). */
|
|
87
|
+
readonly filterValues?: Readonly<Record<string, readonly string[]>>;
|
|
88
|
+
/** Toggles a facet value (sets URL state and refetches). */
|
|
89
|
+
readonly onFilterChange?: (field: string, values: readonly string[]) => void;
|
|
90
|
+
/** Reset aller aktiven Facets. */
|
|
91
|
+
readonly onFilterReset?: () => void;
|
|
92
|
+
/** Time-range filters — forwarded to the DataTable. */
|
|
93
|
+
readonly dateRangeFacets?: readonly DataTableDateRangeFacet[];
|
|
94
|
+
/** One bound changed (set URL state + refetch). */
|
|
95
|
+
readonly onDateRangeChange?: (field: string, bound: "from" | "to", value: string) => void;
|
|
96
|
+
/** Forwarded to `DataTableProps.chromeless` — drops the table's own card frame for a
|
|
97
|
+
* host that already provides one (relatedList in a tabs-mode section). Default false. */
|
|
98
|
+
readonly chromeless?: boolean;
|
|
99
|
+
/** Forwarded to `DataTableProps.scrollBody` — bounds the table height and scrolls rows
|
|
100
|
+
* internally instead of growing the page (relatedList in a tabs-mode section). Default false. */
|
|
101
|
+
readonly scrollBody?: boolean;
|
|
102
|
+
/** Forwarded to `DataTableProps.screenPadding` — `true`: the table carries
|
|
103
|
+
* the shared screen padding because it is the screen body (entityList/
|
|
104
|
+
* projectionList). Explicit `false`: no padding at all — the host already
|
|
105
|
+
* pads its own children (relatedList in a tabs-mode Card). Omitted: legacy
|
|
106
|
+
* `p-6` fallback for a standalone table with no padded host. */
|
|
107
|
+
readonly screenPadding?: boolean;
|
|
108
|
+
/** Forwarded to `DataTableProps.expandedRowIds` / `onToggleRowExpanded` /
|
|
109
|
+
* `renderExpandedRow` (entityList `expandableRow`). */
|
|
110
|
+
readonly expandedRowIds?: ReadonlySet<string>;
|
|
111
|
+
readonly onToggleRowExpanded?: (rowId: string) => void;
|
|
112
|
+
readonly renderExpandedRow?: (row: ListRowViewModel) => ReactNode;
|
|
113
|
+
} & DataTableTableBlockProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,115 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import type {
|
|
4
|
-
import type { ListSort } from "../hooks/use-list-url-state.ts";
|
|
5
|
-
import { type DataTableDateRangeFacet, type DataTableFacet, type DataTableProps, type DataTableRowAction, type DataTableRowActionMode, type DataTableTableBlockProps } from "../primitives.tsx";
|
|
6
|
-
import { type ListEmptyStateContent } from "./list-empty-state.tsx";
|
|
7
|
-
import { type ToolbarActionButton } from "./render-list-toolbar-action.tsx";
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { ToolbarActionButton } from "./render-list-toolbar-action.tsx";
|
|
3
|
+
import type { RenderListProps } from "./render-list-types.ts";
|
|
8
4
|
export type { ToolbarActionButton };
|
|
9
|
-
export type RenderListProps
|
|
10
|
-
readonly screen: EntityListScreenDefinition;
|
|
11
|
-
readonly entity: Pick<EntityDefinition, "fields" | "derivedFields">;
|
|
12
|
-
readonly rows: readonly Readonly<Record<string, unknown>>[];
|
|
13
|
-
readonly featureName: string;
|
|
14
|
-
readonly translate?: Translate;
|
|
15
|
-
readonly onRowClick?: (row: ListRowViewModel) => void;
|
|
16
|
-
/** Overrides the default empty box. When set, the automatic CTA via
|
|
17
|
-
* `onCreate` is ignored; the caller's content takes precedence. */
|
|
18
|
-
readonly emptyState?: ReactNode;
|
|
19
|
-
/** Adds a "+ New" button to the toolbar and uses it as the CTA in the
|
|
20
|
-
* default empty box. The caller provides the action (for example,
|
|
21
|
-
* navigation to the edit screen). */
|
|
22
|
-
readonly onCreate?: () => void;
|
|
23
|
-
/** Label for the + New button. Defaults to the i18n bundle key
|
|
24
|
-
* (`kumiko.actions.create`). The caller can override it. */
|
|
25
|
-
readonly createLabel?: string;
|
|
26
|
-
/** Enables a search input in the toolbar. Filtering is server-side via
|
|
27
|
-
* the caller's onSearchChange; RenderList does not filter locally. */
|
|
28
|
-
readonly searchable?: boolean;
|
|
29
|
-
/** Placeholder for the search input. Defaults to the i18n bundle key
|
|
30
|
-
* (`kumiko.list.search-placeholder`). */
|
|
31
|
-
readonly searchPlaceholder?: string;
|
|
32
|
-
/** Hint at the left of the toolbar (already translated). */
|
|
33
|
-
readonly description?: string;
|
|
34
|
-
/** Author-declared replacement for the default empty box (already translated). */
|
|
35
|
-
readonly emptyContent?: ListEmptyStateContent;
|
|
36
|
-
/** Search or filters changed the result; the empty box then says "no matches". */
|
|
37
|
-
readonly narrowed?: boolean;
|
|
38
|
-
/** Nothing was narrowed by the user, but a default filter is still on; the empty box then offers "show all" instead of "create the first one". */
|
|
39
|
-
readonly defaultFilterActive?: boolean;
|
|
40
|
-
/** Plural-forms key for the footer count noun; default is the entity's `:noun` convention key. */
|
|
41
|
-
readonly itemNounKey?: string;
|
|
42
|
-
/** Current search term (from URL state / the parent). RenderList buffers
|
|
43
|
-
* typing locally with a 300ms debounce before calling onSearchChange;
|
|
44
|
-
* otherwise every keystroke would trigger a server round trip. */
|
|
45
|
-
readonly searchValue?: string;
|
|
46
|
-
/** Called when the debounced search term changes. The caller uses it to
|
|
47
|
-
* set URL state (?<id>.q=…) and trigger a refetch. */
|
|
48
|
-
readonly onSearchChange?: (next: string) => void;
|
|
49
|
-
/** Current sorting, or null for the server's default order. */
|
|
50
|
-
readonly sort?: ListSort | null;
|
|
51
|
-
/** Called with the next sort state after a header click. */
|
|
52
|
-
readonly onSortChange?: (next: ListSort | null) => void;
|
|
53
|
-
/** Pager props for pagination="pages". If undefined, no pager UI is
|
|
54
|
-
* rendered; the default or infinite mode is used. KumikoScreen supplies
|
|
55
|
-
* this according to screen.pagination. */
|
|
56
|
-
readonly pager?: {
|
|
57
|
-
readonly page: number;
|
|
58
|
-
readonly limit: number;
|
|
59
|
-
readonly total: number;
|
|
60
|
-
readonly onPageChange: (next: number) => void;
|
|
61
|
-
};
|
|
62
|
-
/** Infinite-scroll wiring for pagination="infinite". KumikoScreen keeps
|
|
63
|
-
* the accumulated rows and cursor; RenderList passes the callbacks
|
|
64
|
-
* through to DataTable. */
|
|
65
|
-
readonly onReachEnd?: () => void;
|
|
66
|
-
readonly loadingMore?: boolean;
|
|
67
|
-
readonly hasMore?: boolean;
|
|
68
|
-
/** Per-row actions in resolved form. KumikoScreen builds them from
|
|
69
|
-
* EntityListScreenDefinition.rowActions: handler-QN becomes a dispatcher
|
|
70
|
-
* call, and i18n keys become translated strings. */
|
|
71
|
-
readonly rowActions?: readonly DataTableRowAction[];
|
|
72
|
-
/** How the row-action column renders (see `DataTableProps.rowActionMode`). KumikoScreen
|
|
73
|
-
* derives it from the actions; without it the DataTable uses its adaptive default. */
|
|
74
|
-
readonly rowActionMode?: DataTableRowActionMode;
|
|
75
|
-
/** Forwarded to `DataTableProps.bulk` / `rowTone`. */
|
|
76
|
-
readonly bulk?: DataTableProps["bulk"];
|
|
77
|
-
readonly rowTone?: DataTableProps["rowTone"];
|
|
78
|
-
/** Toolbar actions in the list header in resolved form. KumikoScreen
|
|
79
|
-
* builds them from EntityListScreenDefinition.toolbarActions:
|
|
80
|
-
* navigate targets use useNav and handler-QN uses a dispatcher call.
|
|
81
|
-
* RenderList renders the buttons on the right side of the toolbar,
|
|
82
|
-
* before "+ New". */
|
|
83
|
-
readonly toolbarActions?: readonly ToolbarActionButton[];
|
|
84
|
-
/** Faceted filter dropdowns. KumikoScreen builds them from filterable
|
|
85
|
-
* select/boolean fields; RenderList passes them through to DataTable. */
|
|
86
|
-
readonly filterFacets?: readonly DataTableFacet[];
|
|
87
|
-
/** Currently selected facet values by field (from URL state). */
|
|
88
|
-
readonly filterValues?: Readonly<Record<string, readonly string[]>>;
|
|
89
|
-
/** Toggles a facet value (sets URL state and refetches). */
|
|
90
|
-
readonly onFilterChange?: (field: string, values: readonly string[]) => void;
|
|
91
|
-
/** Reset aller aktiven Facets. */
|
|
92
|
-
readonly onFilterReset?: () => void;
|
|
93
|
-
/** Time-range filters — forwarded to the DataTable. */
|
|
94
|
-
readonly dateRangeFacets?: readonly DataTableDateRangeFacet[];
|
|
95
|
-
/** One bound changed (set URL state + refetch). */
|
|
96
|
-
readonly onDateRangeChange?: (field: string, bound: "from" | "to", value: string) => void;
|
|
97
|
-
/** Forwarded to `DataTableProps.chromeless` — drops the table's own card frame for a
|
|
98
|
-
* host that already provides one (relatedList in a tabs-mode section). Default false. */
|
|
99
|
-
readonly chromeless?: boolean;
|
|
100
|
-
/** Forwarded to `DataTableProps.scrollBody` — bounds the table height and scrolls rows
|
|
101
|
-
* internally instead of growing the page (relatedList in a tabs-mode section). Default false. */
|
|
102
|
-
readonly scrollBody?: boolean;
|
|
103
|
-
/** Forwarded to `DataTableProps.screenPadding` — `true`: the table carries
|
|
104
|
-
* the shared screen padding because it is the screen body (entityList/
|
|
105
|
-
* projectionList). Explicit `false`: no padding at all — the host already
|
|
106
|
-
* pads its own children (relatedList in a tabs-mode Card). Omitted: legacy
|
|
107
|
-
* `p-6` fallback for a standalone table with no padded host. */
|
|
108
|
-
readonly screenPadding?: boolean;
|
|
109
|
-
/** Forwarded to `DataTableProps.expandedRowIds` / `onToggleRowExpanded` /
|
|
110
|
-
* `renderExpandedRow` (entityList `expandableRow`). */
|
|
111
|
-
readonly expandedRowIds?: ReadonlySet<string>;
|
|
112
|
-
readonly onToggleRowExpanded?: (rowId: string) => void;
|
|
113
|
-
readonly renderExpandedRow?: (row: ListRowViewModel) => ReactNode;
|
|
114
|
-
} & DataTableTableBlockProps;
|
|
5
|
+
export type { RenderListProps } from "./render-list-types.ts";
|
|
115
6
|
export declare function RenderList(props: RenderListProps): ReactNode;
|