@magicvr/schema-ui-renderer 0.3.0 → 0.3.2

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.
Files changed (38) hide show
  1. package/index.js +17 -17
  2. package/package.json +6 -6
  3. package/components/account-session-toolbar.d.ts +0 -2
  4. package/components/activity-export.d.ts +0 -2
  5. package/components/cron-preview.d.ts +0 -2
  6. package/components/data-permission-scopes.d.ts +0 -2
  7. package/components/data-table.d.ts +0 -43
  8. package/components/email-identity.d.ts +0 -2
  9. package/components/force-password-change.d.ts +0 -1
  10. package/components/import-template-download.d.ts +0 -2
  11. package/components/invite-accept.d.ts +0 -6
  12. package/components/invite-issue-card.d.ts +0 -7
  13. package/components/invite-resend-dialog.d.ts +0 -9
  14. package/components/locale-switcher.d.ts +0 -23
  15. package/components/mail-admin-tab.d.ts +0 -2
  16. package/components/mfa-manager.d.ts +0 -2
  17. package/components/monitoring-auto-refresh.d.ts +0 -2
  18. package/components/notification-center.d.ts +0 -2
  19. package/components/password-policy-tab.d.ts +0 -6
  20. package/components/qr-code.d.ts +0 -16
  21. package/components/theme-toggle.d.ts +0 -10
  22. package/components/timezone-switcher.d.ts +0 -16
  23. package/components/wallet-ensure.d.ts +0 -2
  24. package/renderer/confirm.d.ts +0 -17
  25. package/renderer/custom-components.d.ts +0 -14
  26. package/renderer/form-controls.d.ts +0 -45
  27. package/renderer/form-controls.types.d.ts +0 -135
  28. package/renderer/index.d.ts +0 -13
  29. package/renderer/modal.d.ts +0 -6
  30. package/renderer/permissions.d.ts +0 -53
  31. package/renderer/reaction-engine.d.ts +0 -92
  32. package/renderer/reaction-expression.d.ts +0 -74
  33. package/renderer/reactions.d.ts +0 -64
  34. package/renderer/render.d.ts +0 -194
  35. package/renderer/render.types.d.ts +0 -289
  36. package/renderer/resource.d.ts +0 -114
  37. package/renderer/row-action.d.ts +0 -28
  38. package/renderer/schema-table.d.ts +0 -90
@@ -1,289 +0,0 @@
1
- import { type FormControlField, type FormControlGateError } from "@schema-ui/renderer/renderer/form-controls.types";
2
- import { type FormControlStateMap, type ReactionError } from "@schema-ui/renderer/renderer/reactions";
3
- /**
4
- * D-COMP page renderer (frozen §5 whitelist + I-PROTO-FULL-001 full registry
5
- * surface; resolve R4 F-002).
6
- *
7
- * The renderer walks a page document's node tree and dispatches whitelisted
8
- * node types to the components in this directory. It is deliberately minimal:
9
- * only the node types surfaced by the example pages are handled, and any
10
- * other type fails closed instead of rendering a silent fallback.
11
- *
12
- * A page document looks like the example pages' `PAGE_DOCUMENT`:
13
- * { meta: { protocolVersion, requiredCapabilities }, body: Node }
14
- *
15
- * Node types supported (registry surface):
16
- * - layout: grid / section / tabs
17
- * - data/action: text / table / recordView / actionButton / statCard / chart
18
- * - form: form → FormControls (with reactions applied to field state)
19
- * The form control whitelist itself is enforced by D-FORM
20
- * (isWhitelistedFormControl / checkFormCapabilities).
21
- */
22
- export type RenderNodeType = "form" | "section" | "table" | "grid" | "tabs" | "text" | "recordView" | "actionButton" | "statCard" | "chart" | "custom";
23
- export interface RenderMeta {
24
- protocolVersion: string;
25
- requiredCapabilities: string[];
26
- }
27
- export interface ReactionState {
28
- /** fieldId → control state after reactions. */
29
- state: FormControlStateMap;
30
- errors: ReactionError[];
31
- }
32
- export interface RenderFormNode {
33
- type: "form";
34
- id?: string;
35
- props: {
36
- fields: Array<Record<string, unknown>>;
37
- reactions?: unknown;
38
- submitLabel?: string;
39
- /** S2 (VP-007): i18n key resolved before `submitLabel` (local doc convention). */
40
- submitLabelKey?: string;
41
- /** Default-mode submit: the top-level action id to run on submit (S4). */
42
- submitAction?: string;
43
- /** Search-mode form: binds its fields to the target table's query (S4). */
44
- mode?: "default" | "search";
45
- targetTable?: string;
46
- /** Section heading rendered above the fields (registry form `title`/`titleKey`). */
47
- title?: string;
48
- /** i18n key resolved before `title`. */
49
- titleKey?: string;
50
- /**
51
- * ADR-0021 edit-form record GET prefill (registry since 2.1): loads current
52
- * values from a detail GET and initializes the fields via `responseMapping`
53
- * (field id → dot-path in the response). Requires capability
54
- * `form.record.load`; search-mode forms forbid it.
55
- */
56
- recordSource?: Record<string, unknown>;
57
- /** GOAL-014 D-002 §4: responsive form column count (>1 enables the grid). */
58
- columns?: number;
59
- };
60
- children?: RenderNode[];
61
- }
62
- export interface RenderSectionNode {
63
- type: "section";
64
- id?: string;
65
- props?: Record<string, unknown>;
66
- children: RenderNode[];
67
- }
68
- export interface RenderGridNode {
69
- type: "grid";
70
- id?: string;
71
- props?: Record<string, unknown>;
72
- children?: RenderNode[];
73
- }
74
- export interface RenderTabsNode {
75
- type: "tabs";
76
- id?: string;
77
- props?: Record<string, unknown>;
78
- children?: RenderNode[];
79
- }
80
- export interface RenderTextNode {
81
- type: "text";
82
- id?: string;
83
- props?: {
84
- text?: string;
85
- /** i18n key resolved before `text` (F-01 · GOAL-003 A-003 F-001). */
86
- textKey?: string;
87
- };
88
- children?: RenderNode[];
89
- }
90
- /**
91
- * v2.9 DataRef subset consumed by data nodes (ADR-0039): source:api url +
92
- * params (literal scalars or whole $context.route.query.* / params.* bindings).
93
- */
94
- export interface RenderDataRef {
95
- url: string;
96
- params?: Record<string, unknown>;
97
- }
98
- export interface RenderTableNode {
99
- type: "table";
100
- id?: string;
101
- /** v2.9 node-level DataRef (source:api). Preferred over props.dataSource. */
102
- data?: RenderDataRef;
103
- props: {
104
- columns?: Array<Record<string, unknown>>;
105
- actions?: Array<Record<string, unknown>>;
106
- toolbar?: Array<Record<string, unknown>>;
107
- dataSource?: string;
108
- /** Table heading (literal fallback for titleKey). */
109
- title?: string;
110
- /** i18n key resolved before title. */
111
- titleKey?: string;
112
- /** Direct field name of each row's unique key (F-002 · I-010-001 v0.2.0 §3; default "id"). */
113
- rowKey?: string;
114
- /** ADR-0022 multi-select model (registry; mode: multiple only). */
115
- selection?: {
116
- mode?: string;
117
- };
118
- /** Schema-driven filters (select-only; see schemaTableFilters). */
119
- filters?: Array<Record<string, unknown>>;
120
- };
121
- children?: RenderNode[];
122
- }
123
- /** Read-only field row on a recordView (registry `fields[]` since 2.4). */
124
- export interface RenderRecordViewField {
125
- key: string;
126
- label?: string;
127
- labelKey?: string;
128
- }
129
- export interface RenderRecordViewNode {
130
- type: "recordView";
131
- id?: string;
132
- props?: {
133
- record?: Record<string, unknown>;
134
- /** Detail panel heading (registry `title` since 2.4). */
135
- title?: string;
136
- /** i18n key resolved before `title`. */
137
- titleKey?: string;
138
- /** Declared display fields; when set, only these rows render. */
139
- fields?: RenderRecordViewField[];
140
- };
141
- children?: RenderNode[];
142
- }
143
- export interface RenderActionButtonNode {
144
- type: "actionButton";
145
- id?: string;
146
- props?: {
147
- label?: string;
148
- /** i18n key resolved before `label` (S3). */
149
- labelKey?: string;
150
- actionId?: string;
151
- visibleWhen?: unknown;
152
- disabledWhen?: unknown;
153
- /** Permission-intent key (ADR-0023 D4b mount); gates the button target. */
154
- permissionIntent?: string;
155
- /** Target id for the permission target / action gate (falls back to node id). */
156
- key?: string;
157
- /** Confirm message (shown before executing the referenced action). */
158
- confirm?: string;
159
- /** i18n key resolved before `confirm`. */
160
- confirmKey?: string;
161
- };
162
- children?: RenderNode[];
163
- }
164
- export interface RenderStatCardNode {
165
- type: "statCard";
166
- id?: string;
167
- /** v2.9 node-level DataRef (source:api). Preferred over props.dataSource. */
168
- data?: RenderDataRef;
169
- props?: {
170
- label?: string;
171
- /** i18n key resolved before `label` (F-01 · GOAL-003 A-003 F-001). */
172
- labelKey?: string;
173
- unit?: string;
174
- /** plain | currency | percent (registry enum). */
175
- format?: string;
176
- /** Field of the dataSource rows to display (registry, required since 0.2). */
177
- valueField?: string;
178
- /** Single-slash same-origin data path (same invariant as table.dataSource). */
179
- dataSource?: string;
180
- };
181
- children?: RenderNode[];
182
- }
183
- export interface RenderChartNode {
184
- type: "chart";
185
- id?: string;
186
- /** v2.9 node-level DataRef (source:api). Preferred over props.dataSource. */
187
- data?: RenderDataRef;
188
- props?: {
189
- /** line | bar | pie (registry enum, required). */
190
- chartType?: string;
191
- xField?: string;
192
- yField?: string;
193
- /** Single-slash same-origin data path (same invariant as table.dataSource). */
194
- dataSource?: string;
195
- };
196
- children?: RenderNode[];
197
- }
198
- export interface RenderCustomNode {
199
- type: "custom";
200
- id?: string;
201
- /** Registered component key (GOAL-018: renderer custom-component registry). */
202
- component: string;
203
- props?: Record<string, unknown>;
204
- children?: RenderNode[];
205
- }
206
- export type RenderNode = RenderFormNode | RenderSectionNode | RenderGridNode | RenderTabsNode | RenderTextNode | RenderTableNode | RenderRecordViewNode | RenderActionButtonNode | RenderStatCardNode | RenderChartNode | RenderCustomNode;
207
- /** Page-level action table entry (registry: modal | request | navigate). */
208
- export interface RenderPageAction {
209
- type: string;
210
- /** Modal content; required when type=modal. */
211
- content?: RenderNode;
212
- /** Request/navigate target URL. */
213
- url?: string;
214
- /** HTTP method for request-shaped actions. */
215
- method?: string;
216
- /** Permission intent name, gated against page-level permissionCascade. */
217
- permissionIntent?: string;
218
- }
219
- export interface RenderPageDocument {
220
- meta: RenderMeta;
221
- body: RenderNode;
222
- /** Page-level action table referenced by actionRef / actionId. */
223
- actions?: Record<string, RenderPageAction>;
224
- }
225
- export type RenderErrorCode = "RENDER_UNKNOWN_NODE_TYPE" | "RENDER_INVALID_BODY" | "RENDER_META_INVALID" | "RENDER_FORM_FIELD_INVALID";
226
- export interface RenderError {
227
- code: RenderErrorCode;
228
- path: string;
229
- message: string;
230
- }
231
- export type ActionGateErrorCode = "ACTION_GATE_EXPRESSION_INVALID";
232
- export interface ActionGateError {
233
- code: ActionGateErrorCode;
234
- path: string;
235
- message: string;
236
- }
237
- export type ActionGateResult = {
238
- kind: "ok";
239
- value: boolean;
240
- } | {
241
- kind: "error";
242
- error: ActionGateError;
243
- };
244
- export interface RenderFormFieldGate {
245
- /** Fields that passed the type whitelist and the version/capability gate. */
246
- fields: FormControlField[];
247
- /** Deterministic errors for rejected fields and gate failures. */
248
- errors: FormControlGateError[];
249
- }
250
- /** Keeps only well-formed recordView field rows (key required). */
251
- export declare function parseRecordViewFields(raw: unknown): RenderRecordViewField[];
252
- export declare function isWhitelistedNodeType(type: string): type is RenderNodeType;
253
- /**
254
- * Resolves a dot-path on a record for `form.recordSource.responseMapping`
255
- * (e.g. `"customer.name"` → record.customer.name). Missing segments or a
256
- * non-object intermediate return `undefined` (field keeps its default/empty).
257
- */
258
- export declare function resolveResponsePath(record: unknown, path: string): unknown;
259
- /** Normalizes an unknown body value into a typed RenderNode, fail-closed. */
260
- export declare function parseRenderNode(value: unknown, path: string): RenderNode | RenderError;
261
- /** Collects all form fieldIds from a page document (for reaction resolution). */
262
- export declare function collectFieldIds(node: RenderNode, into?: string[]): string[];
263
- /** Resolves the reaction state for a form node's fields. */
264
- export declare function resolveFormReactions(form: RenderFormNode, context: Record<string, unknown>): ReactionState;
265
- /**
266
- * Resolves a table action gate expression.
267
- *
268
- * Distinguishes an absent property (→ `absentDefault`) from an explicit but
269
- * invalid expression (→ fail-closed `error`, no silent default). Valid $context
270
- * expressions are evaluated against the frozen engine; booleans pass through.
271
- */
272
- export declare function resolveActionGate(expression: unknown, context: Record<string, unknown>, absentDefault: boolean, path: string): ActionGateResult;
273
- /**
274
- * Evaluates a whitelisted table action's visibility/disabled gate.
275
- * Explicit invalid expressions fail closed (hidden / disabled) and are reported.
276
- */
277
- export declare function tableActionGate(action: Record<string, unknown>, context: Record<string, unknown>): {
278
- visible: boolean;
279
- disabled: boolean;
280
- errors: ActionGateError[];
281
- };
282
- /**
283
- * Parses and gates a form node's raw fields against the D-FORM §5 whitelist
284
- * and the page meta version/capability rules (F-002 / F-003).
285
- *
286
- * Returns only the fields that pass every gate; rejected fields produce
287
- * deterministic errors instead of being silently rendered (or silently dropped).
288
- */
289
- export declare function gateRenderFormFields(metaValue: unknown, rawFields: unknown, path: string): RenderFormFieldGate;
@@ -1,114 +0,0 @@
1
- import type { SortOrder } from "@schema-ui/renderer/components/data-table";
2
- export declare const DEFAULT_PAGE_SIZE = 10;
3
- /**
4
- * Frozen list-endpoint rule (I-010-001 v0.2.0 · A-001 F-001): `table.props.dataSource`
5
- * must be a single-slash same-origin absolute path — starts with one `/`, no `//`
6
- * (no protocol-relative host), no scheme, no whitespace, backslash, `?` or `#`.
7
- * Query strings are appended by `buildResourceQuery`, never authored in dataSource;
8
- * fragments are never allowed. Validated before any (auth) fetch is attempted.
9
- * Mirrors `DataRef.url`'s `^/(?!/)[^\s\\]*$` but additionally rejects `?`/`#`.
10
- */
11
- export declare const DATASOURCE_URL_PATTERN: RegExp;
12
- /** A schema-driven resource row: any plain JSON object (no field whitelist). */
13
- export interface ResourceItem {
14
- [key: string]: unknown;
15
- }
16
- /** Unified list envelope frozen across resources: `{items,total,page,pageSize}`. */
17
- export interface ResourceList {
18
- items: ResourceItem[];
19
- total: number;
20
- page: number;
21
- pageSize: number;
22
- }
23
- /** A generic resource list query. */
24
- export interface ResourceQuery {
25
- q?: string;
26
- sort?: string;
27
- order?: SortOrder;
28
- page?: number;
29
- pageSize?: number;
30
- /** Schema-driven table filters (table node props.filters): field to value. */
31
- filters?: Record<string, string>;
32
- }
33
- /**
34
- * Shared query for display components (statCard/chart) that read the first
35
- * item + envelope of a list endpoint. The pageSize keeps the historical RPC
36
- * shape (one generous bucket); wallet-ensure uses the exact same query so its
37
- * existence probe coalesces with the statCards' request (per-page fetch cache).
38
- */
39
- export declare const DISPLAY_LIST_QUERY: ResourceQuery;
40
- /** One field-level validation failure (GOAL-014 D-002 §2.1). */
41
- export interface FieldError {
42
- field: string;
43
- reason: string;
44
- }
45
- /** A resource API failure carrying the frozen envelope `{error, message}`. */
46
- export declare class ResourceApiError extends Error {
47
- readonly code: string;
48
- readonly status: number;
49
- /** VP-007 S4: stable catalog key when the server cataloged this error. */
50
- readonly messageKey?: string;
51
- /** VP-007 S4: interpolation params for messageKey. */
52
- readonly params?: Record<string, unknown>;
53
- /** GOAL-014: field-level validation failures, when the server attached them. */
54
- readonly fieldErrors: FieldError[];
55
- /** R1 correlation identifier for support/operator lookup. */
56
- readonly correlationId?: string;
57
- constructor(status: number, code: string, message: string, messageKey?: string, params?: Record<string, unknown>, fieldErrors?: FieldError[], correlationId?: string);
58
- }
59
- /** W19: missing self-wallet is an empty surface, not a hard page error. */
60
- export declare function isWalletNotFoundError(err: unknown): boolean;
61
- export declare const EMPTY_RESOURCE_LIST: ResourceList;
62
- export type ResourceCreateBody = ResourceItem;
63
- export type ResourcePatch = Partial<ResourceItem>;
64
- /** F-001: single executable rule for a table list endpoint (fail-closed on any violation). */
65
- export declare function isValidDataSource(url: string): boolean;
66
- /** Reads the frozen error envelope from a non-OK response. */
67
- export declare function readResourceApiError(response: Response, label: string): Promise<ResourceApiError>;
68
- /** Serializes a ResourceQuery into a URL query string (query-serialization). */
69
- /**
70
- * v2.9 dataSource params resolution (ADR-0039, capability data.route-binding).
71
- * Literal scalars pass through; whole `$context.route.query.*` /
72
- * `$context.route.params.*` bindings are resolved from the route snapshot;
73
- * a missing key (or absent route) is a tombstone — the parameter is dropped
74
- * (ADR-0010 semantics, same as null values). Returns the merged query string
75
- * (empty when nothing resolves).
76
- */
77
- export declare function resolveDataParamsQuery(params: Record<string, unknown> | undefined, route: {
78
- query?: Record<string, string>;
79
- params?: Record<string, string>;
80
- }): string;
81
- export declare function buildResourceQuery(query: ResourceQuery): string;
82
- /**
83
- * Maps an unknown list payload to the unified ResourceList envelope, fail-closed
84
- * on shape drift. Items are arbitrary JSON objects (F-002 rowKey is enforced at
85
- * the table surface, not here).
86
- */
87
- export declare function parseResourceList(value: unknown): ResourceList;
88
- /**
89
- * Builds the query-string portion of a resource list request — the exact
90
- * construction `fetchResourceList` sends on the wire. `extraQuery` carries
91
- * v2.9 ADR-0039 dataSource params that already resolved to literal key=value
92
- * pairs and is merged over the standard q/sort/order/page/pageSize query.
93
- */
94
- export declare function resourceListQueryString(query: ResourceQuery, extraQuery?: string): string;
95
- /**
96
- * The final URL for a resource list request (F-001-validated baseURL + query
97
- * string). Shared by `fetchResourceList` and the renderer's per-page fetch
98
- * cache so the cache key and the wire request can never drift apart.
99
- */
100
- export declare function resourceListURL(baseURL: string, query: ResourceQuery, extraQuery?: string): string;
101
- /**
102
- * Fetches a page of a schema-driven resource list (request-construction).
103
- *
104
- * `extraQuery` carries v2.9 ADR-0039 dataSource params that already resolved
105
- * to literal key=value pairs (e.g. `dictKey=order_status` from a
106
- * `$context.route.query.*` binding). It is merged with the standard
107
- * q/sort/order/page/pageSize query; baseURL itself must stay a bare
108
- * single-slash same-origin path (F-001).
109
- */
110
- export declare function fetchResourceList(fetcher: typeof fetch, baseURL: string, query: ResourceQuery, extraQuery?: string): Promise<ResourceList>;
111
- /** Creates a resource row via POST; returns the 201 row. */
112
- export declare function createResource(fetcher: typeof fetch, baseURL: string, body: ResourceCreateBody): Promise<ResourceItem>;
113
- export declare function updateResource(fetcher: typeof fetch, baseURL: string, id: string, patch: ResourcePatch): Promise<ResourceItem>;
114
- export declare function deleteResource(fetcher: typeof fetch, baseURL: string, id: string): Promise<void>;
@@ -1,28 +0,0 @@
1
- import { type ExecutionResult } from "@schema-ui/renderer/renderer/permissions";
2
- import type { NavigationContext } from "@schema-ui/protocol/app-manifest";
3
- /**
4
- * R5 D-ACT non-batch row action execution (frozen Q1: batch excluded).
5
- *
6
- * Wraps the R4 executeAction engine so UI actions gate through the same
7
- * permission / confirm / disabled sequence as the frozen permission fixtures.
8
- * `page` is the R5 example page document; `targetId` is a table row action key.
9
- */
10
- export type RowActionOutcome = ExecutionResult["outcome"];
11
- export interface RowActionRequest {
12
- page: Record<string, unknown>;
13
- targetId: string;
14
- context: NavigationContext;
15
- /** Defaults to true; a hidden action fails closed as NOT_VISIBLE. */
16
- visible?: boolean;
17
- confirm?: boolean;
18
- confirmed?: boolean;
19
- disabled?: boolean;
20
- requiresSelection?: boolean;
21
- }
22
- export interface RowActionResult {
23
- outcome: RowActionOutcome;
24
- reason?: ExecutionResult["reason"];
25
- permissionDenied: boolean;
26
- confirmed?: boolean;
27
- }
28
- export declare function runRowAction(request: RowActionRequest): RowActionResult;
@@ -1,90 +0,0 @@
1
- import { type ResourceItem } from "@schema-ui/renderer/renderer/resource";
2
- import type { RenderTableNode } from "@schema-ui/renderer/renderer/render.types";
3
- /**
4
- * Default schema-driven table surface (R1 · GOAL-004 / D-004) + S4 CRUD wiring
5
- * + A-002 generic adapter (GOAL-010 S3).
6
- *
7
- * Renders a whitelisted table node's `props.columns` over its `props.dataSource`.
8
- * Fails closed when the node declares no columns, no (valid) data source, or a
9
- * response that violates the frozen rowKey invariant (F-001 / F-002).
10
- *
11
- * F-001 (I-010-001 v0.2.0 §2): `dataSource` must be a single-slash same-origin
12
- * path; invalid/absent sources render an observable fail-closed state and never
13
- * reach the (auth) fetcher.
14
- *
15
- * F-002 (I-010-001 v0.2.0 §3): `props.rowKey` (default `"id"`) is the direct
16
- * field name of each row's unique, non-empty scalar key (string / finite
17
- * number). A missing / empty / non-scalar / duplicate key stops rendering the
18
- * table data and forbids row actions and selection.
19
- *
20
- * S4 (GOAL-007 · I-007-003 v0.2.2 §9): when rendered inside a `RenderPage`
21
- * (which always wraps content in the SchemaCrudProvider), the table surfaces
22
- * `props.toolbar` (create trigger) and `props.actions` (row edit/delete),
23
- * participates in row selection for the page's recordView / edit-form prefill,
24
- * reads its query from the shared per-table query state (so the search-form
25
- * binding and the post-write reload both reach it), and registers its injected
26
- * fetcher so modal form submits / row actions use the same transport. All of
27
- * this is fixture-driven: no record-specific logic lives here.
28
- */
29
- export interface SchemaTableProps {
30
- node: RenderTableNode;
31
- /** Injectable fetch (defaults to `globalThis.fetch`). */
32
- fetcher?: typeof fetch;
33
- }
34
- export interface SchemaTableColumnSpec {
35
- field: string;
36
- label?: string;
37
- sortable?: boolean;
38
- /** W4 · GOAL-005: single-line truncate + title affordance for long values. */
39
- truncate?: boolean;
40
- /** Column width hint (px number or CSS length). */
41
- width?: number | string;
42
- /** Minimum column width (px number or CSS length). */
43
- minWidth?: number | string;
44
- /** W16-F04: render a cent-valued number as a localized currency string. */
45
- format?: "currency";
46
- /** W16-F09: render this cell as a colored badge using the row field value. */
47
- badgeStyleField?: string;
48
- }
49
- /** Structured row predicate used by Schema actions; malformed predicates fail closed. */
50
- export declare function rowActionDisabled(action: unknown, row: ResourceItem): boolean;
51
- /** Extracts the table node's column specs, fail-closed on malformed entries. */
52
- export declare function schemaTableColumns(node: RenderTableNode): SchemaTableColumnSpec[];
53
- /**
54
- * Resolves the table node's list endpoint (F-001). v2.9 prefers the node-level
55
- * DataRef (ADR-0039, source:api url); the legacy props.dataSource string stays
56
- * supported. Returns null when absent or not a single-slash same-origin path;
57
- * the table then fails closed and never fetches (the fixture fallback was
58
- * removed in GOAL-010 S3).
59
- */
60
- export declare function schemaTableDataSource(node: RenderTableNode): string | null;
61
- /** v2.9 node-level DataRef params (ADR-0039 route bindings), else empty. */
62
- export declare function schemaTableDataParams(node: RenderTableNode): Record<string, unknown> | undefined;
63
- /** F-002: the direct field name used as each row's unique key (default "id"). */
64
- export declare function schemaTableRowKey(node: RenderTableNode): string;
65
- /** One select option of a schema-driven table filter. */
66
- export interface SchemaTableFilterOptionSpec {
67
- value: string;
68
- label?: string;
69
- labelKey?: string;
70
- }
71
- /** A schema-driven table filter (table node `props.filters`; select-only). */
72
- export interface SchemaTableFilterSpec {
73
- field: string;
74
- type: "select";
75
- label?: string;
76
- labelKey?: string;
77
- options: SchemaTableFilterOptionSpec[];
78
- }
79
- /**
80
- * Extracts the table node's filter specs (fail-closed on malformed entries).
81
- * Only `select` filters are supported; other/unknown types are dropped so a
82
- * schema typo never renders a broken control.
83
- */
84
- export declare function schemaTableFilters(node: RenderTableNode): SchemaTableFilterSpec[];
85
- /**
86
- * Windowed pager page list: 1 … current±1 … total, with gap markers for
87
- * long page runs (stable shape for tests and a11y).
88
- */
89
- export declare function pagerPages(current: number, total: number): Array<number | "gap">;
90
- export declare function SchemaTable({ node, fetcher }: SchemaTableProps): import("react").JSX.Element;