@declarion/react 0.38.1 → 0.39.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-lib/{DraggableChildrenTable-CI5a0Emm.js → DraggableChildrenTable-DziCVhq6.js} +1 -1
- package/dist-lib/{Grid-BZEMUmjI.js → Grid-BTX2tkCT.js} +2 -2
- package/dist-lib/{LayoutRenderer-CnKUYh8M.js → LayoutRenderer-CwMERoPJ.js} +387 -285
- package/dist-lib/{MarkdownRenderer-DNmOqp_M.js → MarkdownRenderer-dHOTEhUa.js} +1 -1
- package/dist-lib/{RefreshControl-DsEXi6WF.js → RefreshControl--UAgflh7.js} +257 -175
- package/dist-lib/{SmartDetailPage.impl-DhSpZTLw.js → SmartDetailPage.impl-Bj7MtHxi.js} +474 -414
- package/dist-lib/{SmartRecordListPage.impl-Bi_FPbGy.js → SmartRecordListPage.impl-CZXzVhPC.js} +164 -164
- package/dist-lib/api/params.d.ts +12 -11
- package/dist-lib/components/columns/ColumnPicker.d.ts +11 -1
- package/dist-lib/components/detail-layout/EvidenceBlock.d.ts +6 -0
- package/dist-lib/components/detail-layout/useManualColumnResize.d.ts +25 -0
- package/dist-lib/components/list/QuickPeek.d.ts +11 -2
- package/dist-lib/components/pages/list/{ListBulkBar.d.ts → ListFloatbar.d.ts} +3 -3
- package/dist-lib/components/pages/list/RowActionsCell.d.ts +8 -10
- package/dist-lib/components/pages/list/RowContextMenu.d.ts +29 -0
- package/dist-lib/components/pages/list/SaveViewDialog.d.ts +5 -1
- package/dist-lib/components/pages/list/cardProjection.d.ts +1 -1
- package/dist-lib/components/pages/list/column-sizing.d.ts +15 -0
- package/dist-lib/components/pages/list/columns.d.ts +3 -0
- package/dist-lib/components/pages/list/useHeaderReorder.d.ts +26 -0
- package/dist-lib/components/pages/list/useRowMenu.d.ts +47 -0
- package/dist-lib/components/pages/profile/Profile.d.ts +3 -0
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.d.ts +2 -0
- package/dist-lib/components/params/ParamsBlock.d.ts +25 -0
- package/dist-lib/components/params/param-editors.d.ts +28 -0
- package/dist-lib/components/primitives/Dropdown.d.ts +10 -1
- package/dist-lib/components/shared/ActionDialog.d.ts +2 -2
- package/dist-lib/components/shared/ActionRunner.d.ts +15 -0
- package/dist-lib/components/shared/ResponsiveActionBar.d.ts +45 -23
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/hooks/useParams.d.ts +45 -1
- package/dist-lib/index.d.ts +0 -2
- package/dist-lib/index.js +3074 -2189
- package/dist-lib/lib/actions.d.ts +17 -3
- package/dist-lib/lib/evidence-verdict.d.ts +11 -0
- package/dist-lib/lib/rowClickGesture.d.ts +14 -0
- package/dist-lib/{registry-B_AmhRdj.js → registry-DXNFRlbB.js} +780 -559
- package/dist-lib/stores/list-layout.d.ts +86 -0
- package/dist-lib/testing.js +1 -1
- package/dist-lib/types/api.d.ts +29 -1
- package/dist-lib/types/schema.d.ts +15 -0
- package/dist-lib/{useCurrentScreen-CcsD2NAk.js → useCurrentScreen-BA2lb-d7.js} +860 -835
- package/dist-lib/{useProperties-CPtQIWXp.js → useProperties-Br2DeOQh.js} +81 -81
- package/dist-lib/{value-BCjHI_Ai.js → value-C91loRXp.js} +1 -1
- package/package.json +1 -1
- package/dist-lib/components/list/RowMenu.d.ts +0 -23
package/dist-lib/api/params.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ParamLookup, PublicParamsResponse } from "../types/api";
|
|
1
|
+
import type { ParamLookup, PublicParamsResponse, ResolvedParam } from "../types/api";
|
|
2
2
|
/**
|
|
3
3
|
* Fetches the full pre-login envelope from /api/params/public:
|
|
4
4
|
* {parameters, accents, meta}. Used by AuthShell to theme
|
|
@@ -13,15 +13,16 @@ export declare function fetchPublicParams(): Promise<PublicParamsResponse>;
|
|
|
13
13
|
*/
|
|
14
14
|
export declare function fetchParam(code: string): Promise<ParamLookup>;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* §1.2 the wire envelope is FLAT: `object_ids` is the only reserved key, and
|
|
20
|
-
* `entity` + `fields` sit at the top level (decoded into DataUpdateParams via
|
|
21
|
-
* JSON tags). subresource.ExtractSubResources routes the $params array to
|
|
22
|
-
* declarion.object_params at write time.
|
|
16
|
+
* Fetches the bulk effective-value view: every declared parameter the caller
|
|
17
|
+
* may see (disclosure-tiered server-side), each carrying its declaration facets
|
|
18
|
+
* (scopes / structure / choices) so the admin UIs are self-sufficient.
|
|
23
19
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
20
|
+
* `resolution: "tenant"` returns the TENANT BASELINE (yaml/env/tenant sources
|
|
21
|
+
* only, no role/user overlays) - the lens the tenant Parameters screen edits.
|
|
22
|
+
* Omit it for the caller's full personal resolution (Profile / attachment).
|
|
23
|
+
*
|
|
24
|
+
* NOTE: there is deliberately NO partial-write helper. Parameter overrides are
|
|
25
|
+
* written through the carrier entity's `__update` action with a FULL `$params`
|
|
26
|
+
* set (see ParamsBlock); a single-code write would delete every other override.
|
|
26
27
|
*/
|
|
27
|
-
export declare function
|
|
28
|
+
export declare function fetchAllParams(resolution?: "tenant"): Promise<ResolvedParam[]>;
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
interface ColumnPickerProps {
|
|
2
|
+
/** Full column pool for the screen (data columns; never `_select`/`_actions`). */
|
|
2
3
|
availableColumns: string[];
|
|
4
|
+
/** Ordered visible columns (the `?columns` array). Order is meaningful. */
|
|
3
5
|
visibleColumns: string[];
|
|
4
6
|
onToggle: (col: string) => void;
|
|
7
|
+
/** Move a visible column one slot up/down in the order (the drag-free,
|
|
8
|
+
* keyboard + touch reorder path - WCAG 2.2 SC 2.5.7). Optional: when
|
|
9
|
+
* omitted, the reorder controls are not rendered (additive SDK evolution). */
|
|
10
|
+
onMove?: (col: string, dir: "up" | "down") => void;
|
|
5
11
|
onReset: () => void;
|
|
6
12
|
onShowAll: () => void;
|
|
13
|
+
/** Reset this device's column widths for the screen to the YAML defaults.
|
|
14
|
+
* Widths are a separate, device-local lifecycle from order/visibility.
|
|
15
|
+
* Optional: omitting it hides the width-reset item. */
|
|
16
|
+
onResetWidths?: () => void;
|
|
7
17
|
columnLabel?: (code: string) => string;
|
|
8
18
|
}
|
|
9
|
-
export declare function ColumnPicker({ availableColumns, visibleColumns, onToggle, onReset, onShowAll, columnLabel, }: ColumnPickerProps): import("react").JSX.Element;
|
|
19
|
+
export declare function ColumnPicker({ availableColumns, visibleColumns, onToggle, onMove, onReset, onShowAll, onResetWidths, columnLabel, }: ColumnPickerProps): import("react").JSX.Element;
|
|
10
20
|
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type CSSProperties, type MouseEvent as ReactMouseEvent } from "react";
|
|
2
|
+
/** Device-store scope key for a detail child table. Stable per (parent entity,
|
|
3
|
+
* child entity, foreign key) so a widened child column sticks across reloads
|
|
4
|
+
* and across every detail record of that parent. */
|
|
5
|
+
export declare function childLayoutKey(parentEntity: string, childEntity: string, foreignKey: string): string;
|
|
6
|
+
export interface ManualColumnResize {
|
|
7
|
+
/** Inline style for a resizable header cell (adds position + width). */
|
|
8
|
+
headerStyle: (colId: string, base: CSSProperties) => CSSProperties;
|
|
9
|
+
/** Inline style for a body cell (adds width + truncation once resized). */
|
|
10
|
+
cellStyle: (colId: string, base: CSSProperties) => CSSProperties;
|
|
11
|
+
/** Attach to a right-edge handle's `onMouseDown` to start a resize drag. */
|
|
12
|
+
onHandleMouseDown: (colId: string, e: ReactMouseEvent<HTMLElement>) => void;
|
|
13
|
+
/** True when this table has any stored width overrides (show the reset). */
|
|
14
|
+
hasWidths: boolean;
|
|
15
|
+
/** Clear all width overrides for this table (back to natural widths). */
|
|
16
|
+
resetWidths: () => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function useManualColumnResize(scopeKey: string | null): ManualColumnResize;
|
|
19
|
+
/** A right-edge resize handle for a manually-resized `<th>`. Rendered inside a
|
|
20
|
+
* `position: relative` header cell; stops click propagation so it never fires
|
|
21
|
+
* a header action. */
|
|
22
|
+
export declare function ManualResizeHandle({ colId, onMouseDown, }: {
|
|
23
|
+
colId: string;
|
|
24
|
+
onMouseDown: (colId: string, e: ReactMouseEvent<HTMLElement>) => void;
|
|
25
|
+
}): import("react").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import { type Action, type Entity, type EntityField, type Screen } from "../../types/schema";
|
|
3
3
|
import type { Refs } from "../../components/fields";
|
|
4
|
+
import { type ResolvedActionLayoutNode } from "../../lib/actions";
|
|
4
5
|
export interface QuickPeekRegularFieldSpec {
|
|
5
6
|
key: string;
|
|
6
7
|
label: string;
|
|
@@ -25,10 +26,18 @@ export interface QuickPeekProps<R extends Record<string, unknown> = Record<strin
|
|
|
25
26
|
fields: QuickPeekFieldSpec[];
|
|
26
27
|
/** $refs payload from the list/detail API; used by RefField-style renderers. */
|
|
27
28
|
refs?: Refs;
|
|
28
|
-
/** Full screen YAML — honors `screen.quick_peek.width
|
|
29
|
+
/** Full screen YAML — honors `screen.quick_peek.width`. */
|
|
29
30
|
screen?: Screen;
|
|
30
31
|
/** All actions available on this record. */
|
|
31
32
|
actions: Record<string, Action>;
|
|
33
|
+
/**
|
|
34
|
+
* Resolved action_layout (screen overrides entity). The peek footer renders
|
|
35
|
+
* the `quick_peek` slot through the SAME ResponsiveActionBar as the list
|
|
36
|
+
* toolbar and detail header: declared top-level actions are buttons, the rest
|
|
37
|
+
* collapse into the overflow menu. One mechanism everywhere.
|
|
38
|
+
*/
|
|
39
|
+
screenActionLayout?: ResolvedActionLayoutNode[];
|
|
40
|
+
entityActionLayout?: ResolvedActionLayoutNode[];
|
|
32
41
|
executeAction: (code: string, action: Action, params: Record<string, unknown>) => Promise<unknown>;
|
|
33
42
|
/**
|
|
34
43
|
* Close the peek.
|
|
@@ -42,7 +51,7 @@ export interface QuickPeekProps<R extends Record<string, unknown> = Record<strin
|
|
|
42
51
|
/** Fires once per explicit user commit — never on keystroke. */
|
|
43
52
|
onSave?: (next: R) => void;
|
|
44
53
|
}
|
|
45
|
-
export declare function QuickPeek<R extends Record<string, unknown>>({ entity, entityCode, record, title, recordId, avatarName, fields, refs, screen, actions, executeAction, onClose, onOpen, onSave, }: QuickPeekProps<R>): import("react").JSX.Element;
|
|
54
|
+
export declare function QuickPeek<R extends Record<string, unknown>>({ entity, entityCode, record, title, recordId, avatarName, fields, refs, screen, actions, screenActionLayout, entityActionLayout, executeAction, onClose, onOpen, onSave, }: QuickPeekProps<R>): import("react").JSX.Element;
|
|
46
55
|
export interface QEFieldProps {
|
|
47
56
|
label: string;
|
|
48
57
|
children: ReactNode;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ResolvedActionLayoutNode } from "../../../lib/actions";
|
|
2
2
|
import { type WidgetContext } from "../../../components/shared/ResponsiveActionBar";
|
|
3
3
|
import type { Action } from "../../../types/schema";
|
|
4
|
-
export interface
|
|
4
|
+
export interface ListFloatbarProps {
|
|
5
5
|
selectedIds: string[];
|
|
6
|
-
/** Actions whose visibility includes `list_floatbar` - the
|
|
6
|
+
/** Actions whose visibility includes `list_floatbar` - the floatbar slot.
|
|
7
7
|
* Reason: the parent owns slot filtering via `getScreenActions(...)`;
|
|
8
8
|
* passing `toolbarActions` (list_toolbar slice) here silently dropped
|
|
9
9
|
* __delete (which is list_floatbar/list_row/detail, NOT list_toolbar)
|
|
@@ -24,4 +24,4 @@ export interface ListBulkBarProps {
|
|
|
24
24
|
/** Dispatch surface threaded into ResponsiveActionBar (plan §8 Task 10). */
|
|
25
25
|
widgetContext: WidgetContext;
|
|
26
26
|
}
|
|
27
|
-
export declare function
|
|
27
|
+
export declare function ListFloatbar({ selectedIds, floatbarActions, screenActionLayout, entityActionLayout, data, rowKey, entityCode, onClear, onActionSuccess, widgetContext, }: ListFloatbarProps): import("react").JSX.Element | null;
|
|
@@ -14,14 +14,6 @@ export interface RowActionsCellProps {
|
|
|
14
14
|
fullScreen: Screen;
|
|
15
15
|
entity: Entity;
|
|
16
16
|
entityCode?: string;
|
|
17
|
-
/** Gate flags that determine whether the kebab column renders at all.
|
|
18
|
-
* After the unified-toolbar Phase 1 cleanup the kebab's Edit/Delete
|
|
19
|
-
* affordances come from the __edit / __delete platform-default actions
|
|
20
|
-
* (injected server-side at load), so these flags now only control
|
|
21
|
-
* column visibility - the legacy trailing-item content they once
|
|
22
|
-
* feed has been removed. */
|
|
23
|
-
hasDefaultEditAction: boolean;
|
|
24
|
-
hasDefaultDeleteAction: boolean;
|
|
25
17
|
rowActions: {
|
|
26
18
|
code: string;
|
|
27
19
|
action: Action;
|
|
@@ -31,8 +23,14 @@ export interface RowActionsCellProps {
|
|
|
31
23
|
icon?: string;
|
|
32
24
|
search?: string;
|
|
33
25
|
}) => void;
|
|
34
|
-
|
|
26
|
+
/** Peek availability for this surface (screen quick_peek + not phone). */
|
|
27
|
+
peekAllowed: boolean;
|
|
28
|
+
/** Whether the entity has a detail route (drives __open availability). */
|
|
29
|
+
hasDetailTarget: boolean;
|
|
30
|
+
/** Opens the Quick peek drawer for the row (used by both the __peek menu
|
|
31
|
+
* item and the hover eye button). */
|
|
32
|
+
onPeek: (row: Record<string, unknown>) => void;
|
|
35
33
|
/** Active UI locale, forwarded into the row-scoped WidgetContext. */
|
|
36
34
|
locale: string;
|
|
37
35
|
}
|
|
38
|
-
export declare function RowActionsCell({ row, rowId, screen, fullScreen, entity, entityCode,
|
|
36
|
+
export declare function RowActionsCell({ row, rowId, screen, fullScreen, entity, entityCode, rowActions, tabNavigate, peekAllowed, hasDetailTarget, onPeek, locale, }: RowActionsCellProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Action, Entity, Screen } from "../../../types/schema";
|
|
2
|
+
export interface RowContextMenuProps {
|
|
3
|
+
/** Cursor coordinates from the contextmenu event. */
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
row: Record<string, unknown>;
|
|
7
|
+
rowId: string;
|
|
8
|
+
screen: {
|
|
9
|
+
detail_screen?: string;
|
|
10
|
+
};
|
|
11
|
+
fullScreen: Screen;
|
|
12
|
+
entity: Entity;
|
|
13
|
+
entityCode?: string;
|
|
14
|
+
rowActions: {
|
|
15
|
+
code: string;
|
|
16
|
+
action: Action;
|
|
17
|
+
}[];
|
|
18
|
+
tabNavigate: (href: string, opts?: {
|
|
19
|
+
title?: string;
|
|
20
|
+
icon?: string;
|
|
21
|
+
search?: string;
|
|
22
|
+
}) => void;
|
|
23
|
+
locale: string;
|
|
24
|
+
peekAllowed: boolean;
|
|
25
|
+
hasDetailTarget: boolean;
|
|
26
|
+
onPeek: (row: Record<string, unknown>) => void;
|
|
27
|
+
onClose: () => void;
|
|
28
|
+
}
|
|
29
|
+
export declare function RowContextMenu({ x, y, row, rowId, screen, fullScreen, entity, entityCode, rowActions, tabNavigate, locale, peekAllowed, hasDetailTarget, onPeek, onClose, }: RowContextMenuProps): import("react").JSX.Element | null;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
export declare function SaveViewDialog({ open, pending, onClose, onSave, }: {
|
|
1
|
+
export declare function SaveViewDialog({ open, pending, onClose, onSave, overwriteViewName, onOverwrite, }: {
|
|
2
2
|
open: boolean;
|
|
3
3
|
pending: boolean;
|
|
4
4
|
onClose: () => void;
|
|
5
5
|
onSave: (name: string) => Promise<void>;
|
|
6
|
+
/** Name of the currently-active OWNED view, when an overwrite is offered. */
|
|
7
|
+
overwriteViewName?: string | null;
|
|
8
|
+
/** Overwrite the active owned view with the current layout (widths excluded). */
|
|
9
|
+
onOverwrite?: () => Promise<void>;
|
|
6
10
|
}): import("react").JSX.Element | null;
|
|
@@ -28,7 +28,7 @@ export interface ResolveCardArgs {
|
|
|
28
28
|
screen: Screen | undefined;
|
|
29
29
|
savedViewColumns?: readonly string[];
|
|
30
30
|
}
|
|
31
|
-
export type ProjectionReason = "render" | "display" | "display_template" | "condition" | "identity" | "sort" | "detail_handoff" | "quick_peek" | "ref_expand" | "status_expand" | "property_expand" | "file_metadata";
|
|
31
|
+
export type ProjectionReason = "render" | "display" | "display_template" | "condition" | "identity" | "sort" | "detail_handoff" | "quick_peek" | "ref_expand" | "status_expand" | "property_expand" | "evidence_expand" | "file_metadata";
|
|
32
32
|
export interface ProjectionReasons {
|
|
33
33
|
fields: Record<string, ProjectionReason[]>;
|
|
34
34
|
expand: Record<string, ProjectionReason[]>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Table } from "@tanstack/react-table";
|
|
2
|
+
import type { RowData } from "../../../types/api";
|
|
3
|
+
/** CSS custom-property name for a header's width. */
|
|
4
|
+
export declare function headerSizeVar(headerId: string): string;
|
|
5
|
+
/** CSS custom-property name for a column's (cell) width. */
|
|
6
|
+
export declare function colSizeVar(columnId: string): string;
|
|
7
|
+
/** `width` value that reads a size variable, e.g. for a `<th>`/`<td>` style. */
|
|
8
|
+
export declare function sizeFromVar(varName: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Compute the full set of `--header-*-size` / `--col-*-size` variables from the
|
|
11
|
+
* table's current sizing. Reading `columnSizingInfo` + `columnSizing` here
|
|
12
|
+
* establishes the reactivity so the object recomputes on every resize frame;
|
|
13
|
+
* memoize it on those two state slices in the component.
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildColumnSizeVars(table: Table<RowData>): Record<string, number>;
|
|
@@ -25,6 +25,9 @@ export interface BuildListColumnsArgs {
|
|
|
25
25
|
canUpdate: boolean;
|
|
26
26
|
canDelete: boolean;
|
|
27
27
|
peekEnabled: boolean;
|
|
28
|
+
/** True when the entity has a detail route; drives __open availability in the
|
|
29
|
+
* row menu (composite-PK entities have no detail page). */
|
|
30
|
+
hasDetailTarget: boolean;
|
|
28
31
|
userLocale: string;
|
|
29
32
|
tabNavigate: (href: string, opts?: {
|
|
30
33
|
title?: string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type MouseEvent as ReactMouseEvent, type RefObject } from "react";
|
|
2
|
+
export interface HeaderReorder {
|
|
3
|
+
/** The column currently being dragged, or null. */
|
|
4
|
+
dragColId: string | null;
|
|
5
|
+
/** Insertion index among `visibleCols` where a drop would land, or null. */
|
|
6
|
+
dropIndex: number | null;
|
|
7
|
+
/** True while an actual drag is in progress (threshold crossed). */
|
|
8
|
+
isDragging: boolean;
|
|
9
|
+
/** Attach to a data `<th>`'s `onMouseDown` to arm a potential drag. */
|
|
10
|
+
onHeaderMouseDown: (colId: string, e: ReactMouseEvent) => void;
|
|
11
|
+
/** Call at the top of the header's `onClick`; returns true (and resets) when
|
|
12
|
+
* the click concludes a drag, so the caller skips the sort. */
|
|
13
|
+
consumeDragSuppression: () => boolean;
|
|
14
|
+
}
|
|
15
|
+
interface UseHeaderReorderArgs {
|
|
16
|
+
/** Ordered visible data columns (the `?columns` array). */
|
|
17
|
+
visibleCols: string[];
|
|
18
|
+
/** Commit a new order (writes URL + working layout). */
|
|
19
|
+
onReorder: (nextCols: string[]) => void;
|
|
20
|
+
/** The horizontal scroll container (for edge auto-scroll). */
|
|
21
|
+
scrollElRef: RefObject<HTMLElement | null>;
|
|
22
|
+
/** The `<thead>` element, to measure data-column boundaries at drag start. */
|
|
23
|
+
theadRef: RefObject<HTMLElement | null>;
|
|
24
|
+
}
|
|
25
|
+
export declare function useHeaderReorder({ visibleCols, onReorder, scrollElRef, theadRef, }: UseHeaderReorderArgs): HeaderReorder;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type ResolvedActionLayoutNode } from "../../../lib/actions";
|
|
2
|
+
import type { ActionRunHandler, WidgetContext } from "../../../components/shared/ResponsiveActionBar";
|
|
3
|
+
import type { Action, Entity, Screen } from "../../../types/schema";
|
|
4
|
+
export interface UseRowMenuArgs {
|
|
5
|
+
row: Record<string, unknown>;
|
|
6
|
+
rowId: string;
|
|
7
|
+
/** detail_screen for row navigation; also carries the server-resolved
|
|
8
|
+
* action_layout wire tree (read via cast, per RowActionsCell's note). */
|
|
9
|
+
screen: {
|
|
10
|
+
detail_screen?: string;
|
|
11
|
+
};
|
|
12
|
+
/** Full Screen for the row-scoped WidgetContext (href/widget dispatch). */
|
|
13
|
+
fullScreen: Screen;
|
|
14
|
+
entity: Entity;
|
|
15
|
+
entityCode?: string;
|
|
16
|
+
/** list_row-slot actions resolved by getScreenActions (includes the injected
|
|
17
|
+
* __peek/__open/__edit/__delete defaults). */
|
|
18
|
+
rowActions: {
|
|
19
|
+
code: string;
|
|
20
|
+
action: Action;
|
|
21
|
+
}[];
|
|
22
|
+
tabNavigate: (href: string, opts?: {
|
|
23
|
+
title?: string;
|
|
24
|
+
icon?: string;
|
|
25
|
+
search?: string;
|
|
26
|
+
}) => void;
|
|
27
|
+
locale: string;
|
|
28
|
+
/** Peek availability for THIS surface (screen quick_peek enabled + not phone).
|
|
29
|
+
* Drives __peek suppression and the openPeek client verb. */
|
|
30
|
+
peekAllowed: boolean;
|
|
31
|
+
/** Whether the entity has a detail route. Drives __open suppression
|
|
32
|
+
* (composite-PK entities have no detail page). */
|
|
33
|
+
hasDetailTarget: boolean;
|
|
34
|
+
/** Opens the Quick peek drawer for the given row. */
|
|
35
|
+
onPeek: (row: Record<string, unknown>) => void;
|
|
36
|
+
}
|
|
37
|
+
export interface RowMenu {
|
|
38
|
+
/** Row-stated + nav-suppressed layout, ready for RowMenuContent. */
|
|
39
|
+
layout: ResolvedActionLayoutNode[];
|
|
40
|
+
entityActions: Record<string, Action>;
|
|
41
|
+
runRowAction: ActionRunHandler;
|
|
42
|
+
widgetContext: WidgetContext;
|
|
43
|
+
/** True when a __peek leaf survives resolution + suppression - the single
|
|
44
|
+
* source of truth for whether the hover eye button renders (Invariant 7). */
|
|
45
|
+
hasPeek: boolean;
|
|
46
|
+
}
|
|
47
|
+
export declare function useRowMenu({ row, rowId, screen, fullScreen, entity, entityCode, rowActions, tabNavigate, locale, peekAllowed, hasDetailTarget, onPeek, }: UseRowMenuArgs): RowMenu;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* ParamsBlock is the GENERIC, reusable parameter-editing block attached to a
|
|
4
|
+
* carrier row (a user's Profile, a tenant, or a business entity row). It is
|
|
5
|
+
* declaration-driven: it renders exactly the parameters whose `scopes:` include
|
|
6
|
+
* the carrier's scope, and nothing when that attachable set is empty (so an
|
|
7
|
+
* unrelated entity gets no block - the platform's anti-pollution rule).
|
|
8
|
+
*
|
|
9
|
+
* The single dangerous trap it defends: `$params` is a FULL-SET write. The
|
|
10
|
+
* current override set is ALWAYS sourced from the carrier's PK-detail response
|
|
11
|
+
* (`$params`); a missing `$params` key is a HARD ERROR here, never treated as an
|
|
12
|
+
* empty set (which would delete every override). Every save/reset composes the
|
|
13
|
+
* complete new set client-side and writes it through `<carrier>.__update`.
|
|
14
|
+
*/
|
|
15
|
+
export interface ParamsBlockProps {
|
|
16
|
+
/** Carrier entity code (the write target, e.g. "profile", "my_tenant"). */
|
|
17
|
+
carrierEntityCode: string;
|
|
18
|
+
/** Carrier scope for attachment = entity.params_scope ?? entity.code. */
|
|
19
|
+
carrierScope: string;
|
|
20
|
+
/** Carrier row id ($params writes ride object_ids: [rowId]). */
|
|
21
|
+
rowId: string;
|
|
22
|
+
title?: string;
|
|
23
|
+
icon?: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export declare function ParamsBlock({ carrierEntityCode, carrierScope, rowId, title, icon }: ParamsBlockProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ResolvedParam } from "../../types/api";
|
|
2
|
+
export declare function ErrorLine({ text }: {
|
|
3
|
+
text: string;
|
|
4
|
+
}): import("react").JSX.Element;
|
|
5
|
+
/** Compact one-line preview: scalars inline; json/structure as a summary chip. */
|
|
6
|
+
export declare function ValuePreview({ type, value, structure }: {
|
|
7
|
+
type: string;
|
|
8
|
+
value: unknown;
|
|
9
|
+
structure?: string;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* EditParamDialog renders the typed editor for one parameter and calls onSave
|
|
13
|
+
* with the parsed, typed value (throwing invalid input inline before onSave).
|
|
14
|
+
* The caller composes the full `$params` set and performs the write.
|
|
15
|
+
*/
|
|
16
|
+
export declare function EditParamDialog({ param, current, error, onCancel, onSave }: {
|
|
17
|
+
param: ResolvedParam;
|
|
18
|
+
current: unknown;
|
|
19
|
+
error: string | null;
|
|
20
|
+
onCancel: () => void;
|
|
21
|
+
onSave: (value: unknown) => Promise<void> | void;
|
|
22
|
+
}): import("react").JSX.Element;
|
|
23
|
+
/**
|
|
24
|
+
* paramTenantEditable reports whether a param is editable at TENANT scope:
|
|
25
|
+
* empty scopes AND non-server category, OR scopes explicitly admits `tenant`
|
|
26
|
+
* (the server-category waiver case, e.g. mailer_backend). Others are read-only.
|
|
27
|
+
*/
|
|
28
|
+
export declare function paramTenantEditable(param: ResolvedParam): boolean;
|
|
@@ -3,9 +3,18 @@ export type DropdownProps = {
|
|
|
3
3
|
open: boolean;
|
|
4
4
|
onClose?: () => void;
|
|
5
5
|
anchor: HTMLElement | null;
|
|
6
|
+
/**
|
|
7
|
+
* Cursor-point anchoring for context menus: when set (and `anchor` is null),
|
|
8
|
+
* the menu opens at the point and gets the same viewport clamping / above-
|
|
9
|
+
* flip as element anchoring. One positioning engine for every popover.
|
|
10
|
+
*/
|
|
11
|
+
anchorPoint?: {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
};
|
|
6
15
|
align?: "start" | "end";
|
|
7
16
|
width?: number;
|
|
8
17
|
style?: CSSProperties;
|
|
9
18
|
children?: ReactNode;
|
|
10
19
|
};
|
|
11
|
-
export declare function Dropdown({ open, onClose, anchor, children, align, width, style }: DropdownProps): import("react").ReactPortal | null;
|
|
20
|
+
export declare function Dropdown({ open, onClose, anchor, anchorPoint, children, align, width, style }: DropdownProps): import("react").ReactPortal | null;
|
|
@@ -8,10 +8,10 @@ interface ActionDialogProps {
|
|
|
8
8
|
isPending: boolean;
|
|
9
9
|
row?: Record<string, unknown>;
|
|
10
10
|
/**
|
|
11
|
-
* Bulk selection when invoked from a list
|
|
11
|
+
* Bulk selection when invoked from a list floatbar. Used by two
|
|
12
12
|
* param renderings: (1) `id_array` typed params are auto-filled with
|
|
13
13
|
* the selection's PKs and hidden from the form, matching the
|
|
14
|
-
*
|
|
14
|
+
* floatbar auto-fill contract; (2) `entity_patch` params feed the
|
|
15
15
|
* selection into PropertyGridEditor for same-value pre-fill.
|
|
16
16
|
*/
|
|
17
17
|
bulkSelection?: ReadonlyArray<Record<string, unknown>>;
|
|
@@ -28,6 +28,21 @@ export interface RunActionOptions {
|
|
|
28
28
|
* action invocations.
|
|
29
29
|
*/
|
|
30
30
|
bulkSelection?: ReadonlyArray<Record<string, unknown>>;
|
|
31
|
+
/**
|
|
32
|
+
* The record the action is bound to, for single-row invocations
|
|
33
|
+
* (detail header/toolbar, list row, quick peek). Forwarded to
|
|
34
|
+
* ActionDialog so `$row.*` param defaults resolve against it -
|
|
35
|
+
* without it every schema-declared prefill silently renders the
|
|
36
|
+
* param's empty state. Omit for global and bulk invocations.
|
|
37
|
+
*/
|
|
38
|
+
row?: Record<string, unknown>;
|
|
39
|
+
/**
|
|
40
|
+
* Acted-entity override for the post-outcome query invalidation. Normally
|
|
41
|
+
* the runner reads `action.entity`; pass this when the dispatched action
|
|
42
|
+
* may lack its binding (e.g. a platform-default bulk action resolved from
|
|
43
|
+
* screen context).
|
|
44
|
+
*/
|
|
45
|
+
entity?: string;
|
|
31
46
|
}
|
|
32
47
|
interface ActionRunnerContextValue {
|
|
33
48
|
/**
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
* Renders as a single kebab "⋮" dropdown. No inline measurement.
|
|
24
24
|
* Destructive items land at the bottom of the dropdown with a separator.
|
|
25
25
|
*/
|
|
26
|
-
import type { ReactNode } from "react";
|
|
27
26
|
import type { Action, Entity, Screen } from "../../types/schema";
|
|
28
27
|
import type { ResolvedActionLayoutNode, ResolvedActionLeaf } from "../../lib/actions";
|
|
29
28
|
/**
|
|
@@ -75,6 +74,14 @@ export interface WidgetContext {
|
|
|
75
74
|
tabNavigate: (url: string, meta?: TabMeta) => void;
|
|
76
75
|
/** Invokes a server action and returns its response envelope. */
|
|
77
76
|
runActionApi: (code: string, params: unknown) => Promise<unknown>;
|
|
77
|
+
/**
|
|
78
|
+
* Opens the Quick peek drawer for `row`. Present only where peek is available
|
|
79
|
+
* (list surfaces that pass it); the `__peek` platform default dispatches
|
|
80
|
+
* through here as a pure client verb - the mode-less counterpart of `__open`'s
|
|
81
|
+
* href navigation. Absent surfaces never receive a `__peek` leaf, so a missing
|
|
82
|
+
* callback is never invoked.
|
|
83
|
+
*/
|
|
84
|
+
openPeek?: (row: Record<string, unknown> | undefined) => void;
|
|
78
85
|
}
|
|
79
86
|
/**
|
|
80
87
|
* Telemetry payload emitted on every action click. Stays scalar by design -
|
|
@@ -86,8 +93,9 @@ export interface WidgetContext {
|
|
|
86
93
|
export interface ActionClickPayload {
|
|
87
94
|
code: string;
|
|
88
95
|
entity: string;
|
|
89
|
-
/** Dispatch mode chosen by ResponsiveActionBar based on which field was set.
|
|
90
|
-
|
|
96
|
+
/** Dispatch mode chosen by ResponsiveActionBar based on which field was set.
|
|
97
|
+
* "peek" is the mode-less `__peek` client verb (opens the Quick peek drawer). */
|
|
98
|
+
mode: "handler" | "association" | "widget" | "href" | "ui_steps" | "peek" | "unknown";
|
|
91
99
|
/** PK of the row the click was bound to, when row-scoped. Empty otherwise. */
|
|
92
100
|
rowId: string;
|
|
93
101
|
}
|
|
@@ -151,25 +159,6 @@ export interface ResponsiveActionBarProps {
|
|
|
151
159
|
globalActions?: Record<string, Action>;
|
|
152
160
|
/** aria-label for the toolbar root. Defaults to "Actions". */
|
|
153
161
|
ariaLabel?: string;
|
|
154
|
-
/**
|
|
155
|
-
* Platform-default kebab affordances appended to row mode after schema items.
|
|
156
|
-
* Used by SmartListPage's row kebab to surface Edit (navigation) and Delete
|
|
157
|
-
* (mutation) without rendering a second kebab next to the schema-defined one.
|
|
158
|
-
* Plan §11: each row exposes ONE kebab "⋮"; schema actions own the rendering,
|
|
159
|
-
* platform defaults integrate as trailing items.
|
|
160
|
-
*
|
|
161
|
-
* - normal: rendered after schema-normal items, before any separator. Used
|
|
162
|
-
* for Edit (or schema-declared type=edit actions).
|
|
163
|
-
* - destructive: rendered in the destructive trailing section, after any
|
|
164
|
-
* schema-destructive items. Used for Delete (or schema-declared
|
|
165
|
-
* type=delete actions). Triggers the destructive separator just like
|
|
166
|
-
* schema-destructive leaves do.
|
|
167
|
-
*
|
|
168
|
-
* Only honored when kind="row". Other kinds ignore these (detail/toolbar
|
|
169
|
-
* place edit/delete in their own dedicated UI slots).
|
|
170
|
-
*/
|
|
171
|
-
trailingNormalItems?: ReactNode;
|
|
172
|
-
trailingDestructiveItems?: ReactNode;
|
|
173
162
|
/**
|
|
174
163
|
* Dispatch surface for client-side action modes (`href` today, `widget` in
|
|
175
164
|
* Phase 2). When omitted, every action falls through to `onRun`.
|
|
@@ -187,6 +176,39 @@ export interface ResponsiveActionBarProps {
|
|
|
187
176
|
*/
|
|
188
177
|
onActionClick?: (payload: ActionClickPayload) => void;
|
|
189
178
|
}
|
|
179
|
+
export interface RowMenuContentProps {
|
|
180
|
+
/**
|
|
181
|
+
* Row-stated + nav-suppressed layout. BOTH triggers pass the identical shape:
|
|
182
|
+
* the kebab (anchored) and the right-click menu (at the cursor) compose the
|
|
183
|
+
* same leaves so their menus are structurally identical (Invariant 1).
|
|
184
|
+
*/
|
|
185
|
+
layout: ResolvedActionLayoutNode[];
|
|
186
|
+
entityActions: Record<string, Action> | undefined;
|
|
187
|
+
globalActions?: Record<string, Action> | undefined;
|
|
188
|
+
/**
|
|
189
|
+
* Action runner, already wrapped by the caller to close its own popover on
|
|
190
|
+
* click. Kept caller-owned so the kebab and the right-click site each dismiss
|
|
191
|
+
* their own surface while sharing this one dispatch path.
|
|
192
|
+
*/
|
|
193
|
+
onRun: ActionRunHandler;
|
|
194
|
+
/** Controlled loading code so a trigger (the kebab button) can spin too. */
|
|
195
|
+
loading: string | null;
|
|
196
|
+
onLoadingChange: (code: string | null) => void;
|
|
197
|
+
row?: Record<string, unknown>;
|
|
198
|
+
widgetContext?: WidgetContext;
|
|
199
|
+
onActionClick?: (payload: ActionClickPayload) => void;
|
|
200
|
+
ariaLabel?: string;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* RowMenuContent is the ONE renderer of Row Menu body content, shared by the
|
|
204
|
+
* kebab and the right-click menu (plan 2026-07-19-unified-row-menu, Invariant
|
|
205
|
+
* 1). It partitions destructive-last, draws a divider after the leading
|
|
206
|
+
* navigation run (__peek / __open), and renders every leaf through the same
|
|
207
|
+
* DropdownLeafItem / DropdownGroupSection path used everywhere else - so the two
|
|
208
|
+
* triggers cannot structurally diverge. It renders no chrome and owns no
|
|
209
|
+
* open/close state; the caller wraps it (anchored Dropdown or cursor container).
|
|
210
|
+
*/
|
|
211
|
+
export declare function RowMenuContent({ layout, entityActions, globalActions, onRun, loading, onLoadingChange, row, widgetContext, onActionClick, ariaLabel, }: RowMenuContentProps): import("react").JSX.Element;
|
|
190
212
|
/**
|
|
191
213
|
* Layout decision computed by the measurement pass. Three pinned groups
|
|
192
214
|
* (primary / inline / destructive) plus the overflow bucket that lives
|
|
@@ -213,5 +235,5 @@ export declare function computeLayout(nodes: ResolvedActionLayoutNode[], contain
|
|
|
213
235
|
* kind="row": single kebab "⋮" with all actions in dropdown.
|
|
214
236
|
* kind default: "toolbar".
|
|
215
237
|
*/
|
|
216
|
-
export declare function ResponsiveActionBar({ layout, row, rowSelection, onRun, reservedRightWidth, kind, align, constrain, measurementOverride, entityActions, globalActions, ariaLabel,
|
|
238
|
+
export declare function ResponsiveActionBar({ layout, row, rowSelection, onRun, reservedRightWidth, kind, align, constrain, measurementOverride, entityActions, globalActions, ariaLabel, widgetContext, onActionClick, }: ResponsiveActionBarProps): import("react").JSX.Element | null;
|
|
217
239
|
export {};
|