@uibot/renderer-react 0.0.0-stage → 0.2.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/HtmlSourceEditor.d.ts +60 -0
- package/dist/collection-activity.d.ts +12 -0
- package/dist/collection-ai.d.ts +17 -0
- package/dist/collection-application.d.ts +5 -0
- package/dist/collection-application.js +25 -0
- package/dist/collection-approval.d.ts +7 -0
- package/dist/collection-attachments.d.ts +10 -0
- package/dist/collection-automation.d.ts +10 -0
- package/dist/collection-calendar-view.d.ts +2 -0
- package/dist/collection-computed.d.ts +4 -0
- package/dist/collection-conversion.d.ts +6 -0
- package/dist/collection-editors.d.ts +40 -0
- package/dist/collection-editors.js +10 -0
- package/dist/collection-form-view.d.ts +2 -0
- package/dist/collection-formula/evaluate.d.ts +18 -0
- package/dist/collection-formula/index.d.ts +1 -0
- package/dist/collection-gallery-view.d.ts +2 -0
- package/dist/collection-grid/cell-display.d.ts +24 -0
- package/dist/collection-grid/cells.d.ts +29 -0
- package/dist/collection-grid/column-color.d.ts +5 -0
- package/dist/collection-grid/date-value.d.ts +13 -0
- package/dist/collection-grid/features.d.ts +76 -0
- package/dist/collection-grid/field-format.d.ts +17 -0
- package/dist/collection-grid/fill.d.ts +10 -0
- package/dist/collection-grid/filter-labels.d.ts +6 -0
- package/dist/collection-grid/footer-aggregate.d.ts +6 -0
- package/dist/collection-grid/footer-stats.d.ts +5 -0
- package/dist/collection-grid/grouping.d.ts +51 -0
- package/dist/collection-grid/index.d.ts +9 -0
- package/dist/collection-grid/paged-field-input.d.ts +22 -0
- package/dist/collection-grid/paged-locale.d.ts +3 -0
- package/dist/collection-grid/paged-model.d.ts +25 -0
- package/dist/collection-grid/relation-editor.d.ts +14 -0
- package/dist/collection-grid/relation-options.d.ts +4 -0
- package/dist/collection-grid/selection.d.ts +4 -0
- package/dist/collection-interaction-state.d.ts +26 -0
- package/dist/collection-kanban-view.d.ts +2 -0
- package/dist/collection-live-changes.d.ts +8 -0
- package/dist/collection-relations.d.ts +20 -0
- package/dist/collection-sharing.d.ts +10 -0
- package/dist/collection-table-view.d.ts +2 -0
- package/dist/collection-transfer.d.ts +12 -0
- package/dist/collection-ui.d.ts +152 -0
- package/dist/collection-views/aggregate.d.ts +39 -0
- package/dist/collection-views/ai-fill-drawer.d.ts +28 -0
- package/dist/collection-views/ai-fill-model.d.ts +35 -0
- package/dist/collection-views/board.d.ts +2 -0
- package/dist/collection-views/calendar.d.ts +4 -0
- package/dist/collection-views/field-config.d.ts +16 -0
- package/dist/collection-views/filter-builder.d.ts +23 -0
- package/dist/collection-views/gallery.d.ts +2 -0
- package/dist/collection-views/icons.d.ts +43 -0
- package/dist/collection-views/menu.d.ts +16 -0
- package/dist/collection-views/model.d.ts +22 -0
- package/dist/collection-views/record-creator.d.ts +31 -0
- package/dist/collection-views/schema-editor.d.ts +38 -0
- package/dist/collection-views/schema-field-settings.d.ts +22 -0
- package/dist/collection-views/schema-styles.d.ts +4 -0
- package/dist/collection-views/shared.d.ts +110 -0
- package/dist/collection-views/table-nav.d.ts +52 -0
- package/dist/collection-views/toolbar-popover.d.ts +24 -0
- package/dist/collection-views/ui.d.ts +45 -0
- package/dist/collection-views/view-settings-sections.d.ts +39 -0
- package/dist/collection-views/view-tabs.d.ts +35 -0
- package/dist/collection-views.d.ts +35 -0
- package/dist/collection-views.js +10 -0
- package/dist/collection-workspace.d.ts +128 -0
- package/dist/collection-workspace.js +26 -0
- package/dist/define-component.d.ts +35 -0
- package/dist/document-collection.d.ts +30 -0
- package/dist/document-view.d.ts +1 -0
- package/dist/html-source-editor.css +84 -0
- package/dist/index.d.ts +121 -0
- package/dist/index.js +25 -0
- package/dist/live-renderer.d.ts +60 -0
- package/dist/paged-collection-grid.d.ts +95 -0
- package/dist/paged-collection-grid.js +25 -0
- package/dist/paged-collection-views.d.ts +15 -0
- package/dist/renderer.d.ts +20 -0
- package/package.json +69 -4
- package/README.md +0 -3
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { PagedCollectionCapabilities, PagedCollectionApprovalRequired, PagedCollectionAggregateClient, PagedCollectionAiFillClient, PagedCollectionMutationRequest, PagedCollectionClient, PagedCollectionDescriptor, PagedCollectionRecord, PagedCollectionTransferClient, PagedCollectionView } from "@uibot/contracts";
|
|
3
|
+
import { type PagedCollectionLocale } from "./collection-grid/paged-locale.js";
|
|
4
|
+
import type { CollectionUiSlots } from "./collection-ui.js";
|
|
5
|
+
import { type PagedCollectionSchemaEditorProps } from "./collection-views.js";
|
|
6
|
+
import { type PagedCollectionGridProps } from "./paged-collection-grid.js";
|
|
7
|
+
export interface PagedWorkspaceContext {
|
|
8
|
+
table: PagedCollectionDescriptor | undefined;
|
|
9
|
+
view: PagedCollectionView | undefined;
|
|
10
|
+
selection: {
|
|
11
|
+
recordIds: string[];
|
|
12
|
+
fieldIds: string[];
|
|
13
|
+
};
|
|
14
|
+
/** The records currently loaded in the grid (one page). */
|
|
15
|
+
rows: PagedCollectionRecord[];
|
|
16
|
+
/** Reload rows after the host changed data outside the grid. */
|
|
17
|
+
reload(): void;
|
|
18
|
+
}
|
|
19
|
+
export type PagedWorkspaceClient = PagedCollectionClient;
|
|
20
|
+
export interface PagedCollectionWorkspaceProps {
|
|
21
|
+
client: PagedWorkspaceClient;
|
|
22
|
+
locale?: PagedCollectionLocale;
|
|
23
|
+
/** Grid and view feature flags; the workspace defaults to the `full` preset. */
|
|
24
|
+
features?: PagedCollectionGridProps["features"];
|
|
25
|
+
ui?: CollectionUiSlots;
|
|
26
|
+
/** Controlled table selection; omit to let the workspace pick the first table. */
|
|
27
|
+
tableId?: string;
|
|
28
|
+
onTableChange?(id: string): void;
|
|
29
|
+
/** View to open first when the table has it (for example from a route). */
|
|
30
|
+
initialViewId?: string;
|
|
31
|
+
/** Exact controlled view selection. Unknown IDs never fall back to another view. */
|
|
32
|
+
viewId?: string;
|
|
33
|
+
/** Selection request, initialization or save acknowledgement; the host accepts by updating viewId. */
|
|
34
|
+
onViewChange?(view: PagedCollectionView, reason: "initialize" | "select" | "create" | "save" | "delete"): void;
|
|
35
|
+
/** Synchronous host veto before user navigation. External prop changes remain host-owned. */
|
|
36
|
+
onBeforeNavigate?(target: {
|
|
37
|
+
tableId: string;
|
|
38
|
+
viewId?: string;
|
|
39
|
+
}): boolean;
|
|
40
|
+
/** Unique IDs for unsaved default, new and copied views. Omit to retain legacy ID generation. */
|
|
41
|
+
createViewId?(tableId: string): string;
|
|
42
|
+
/** Hide the table title row (hosts that render their own page title); toolbar actions stay. */
|
|
43
|
+
hideHeader?: boolean;
|
|
44
|
+
/** Reports every active view/schema/table/record draft and unconfirmed mutation. */
|
|
45
|
+
onDirtyChange?(dirty: boolean): void;
|
|
46
|
+
/** Reports any original mutation Promise in flight across the workspace. */
|
|
47
|
+
onBusyChange?(busy: boolean): void;
|
|
48
|
+
/** Show the table list on the left. Default true. */
|
|
49
|
+
showTableList?: boolean;
|
|
50
|
+
/** Overrides `client.capabilities`. Absent on both means the actor can do everything. */
|
|
51
|
+
capabilities?: PagedCollectionCapabilities;
|
|
52
|
+
/** Allow creating tables through `client.create`. Default follows `capabilities.schema`. */
|
|
53
|
+
allowCreateTable?: boolean;
|
|
54
|
+
pageSize?: number;
|
|
55
|
+
renderCellEditor?: PagedCollectionGridProps["renderCellEditor"];
|
|
56
|
+
getRelationOptions?: PagedCollectionGridProps["getRelationOptions"];
|
|
57
|
+
/** Enables the sum bar: pick a number field and the whole filtered query is totalled server-side. */
|
|
58
|
+
aggregateClient?: PagedCollectionAggregateClient;
|
|
59
|
+
/** Disable the new footer protocol for legacy count/sum-only hosts. */
|
|
60
|
+
serverFooterStats?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Handles hosts that answer a destructive mutation with `approval_required`: show the impact,
|
|
63
|
+
* ask the user, and return the approval receipt id, or undefined to cancel. The workspace then
|
|
64
|
+
* retries the same request with `approvalReceiptId`.
|
|
65
|
+
*/
|
|
66
|
+
requestApproval?(details: PagedCollectionApprovalRequired, request: PagedCollectionMutationRequest): Promise<string | undefined>;
|
|
67
|
+
/** Field types offered in the schema editor. Default: the editor's seven basic types. */
|
|
68
|
+
schemaFieldTypes?: PagedCollectionSchemaEditorProps["fieldTypes"];
|
|
69
|
+
/** Offer the full filter operator set and date modes. Default true; off for hosts that cannot run them. */
|
|
70
|
+
advancedFilters?: boolean;
|
|
71
|
+
/** Which per-field settings the schema editor offers. Hosts whose storage cannot keep a setting turn it off. */
|
|
72
|
+
schemaSettings?: PagedCollectionSchemaEditorProps["settings"];
|
|
73
|
+
/**
|
|
74
|
+
* Teable-style toolbar: hidden fields, filter, group and sort open as popovers next to search
|
|
75
|
+
* instead of living in the view settings panel (which keeps name, type and row height).
|
|
76
|
+
*/
|
|
77
|
+
inlineViewControls?: boolean;
|
|
78
|
+
/** Suspend view toolbar edits, including portal content, without changing actor permissions. */
|
|
79
|
+
viewControlsDisabled?: boolean;
|
|
80
|
+
/** Success confirmations ("View saved") go here (e.g. a toast) instead of an inline status line; errors stay inline. */
|
|
81
|
+
onNotify?(message: string): void;
|
|
82
|
+
/** Existing fields can be renamed but not retyped or deleted; only new fields may be added. */
|
|
83
|
+
addOnlySchema?: boolean;
|
|
84
|
+
/** Show links between related tables (forward relations, and inverse records of the selected record). Default true. */
|
|
85
|
+
relationNavigation?: boolean;
|
|
86
|
+
/** Host menu wrapper for record actions in the grid. */
|
|
87
|
+
renderRecordContextMenu?: PagedCollectionGridProps["renderRecordContextMenu"];
|
|
88
|
+
/** Host dialogs and drawers rendered inside the workspace with the live context (for example a table info sheet). */
|
|
89
|
+
renderOverlay?(context: PagedWorkspaceContext): ReactNode;
|
|
90
|
+
/** Replaces the message shown when the table list cannot be loaded (for example before access is granted). */
|
|
91
|
+
renderListError?(error: {
|
|
92
|
+
code: string | undefined;
|
|
93
|
+
message: string;
|
|
94
|
+
}, retry: () => void): ReactNode;
|
|
95
|
+
/** Enables CSV import and export controls. */
|
|
96
|
+
transferClient?: PagedCollectionTransferClient;
|
|
97
|
+
/**
|
|
98
|
+
* Enables AI fill: a toolbar entry opens a right-hand drawer that previews per-cell suggestions
|
|
99
|
+
* from the host's model and applies the accepted ones by record version.
|
|
100
|
+
*/
|
|
101
|
+
aiFillClient?: PagedCollectionAiFillClient;
|
|
102
|
+
/** Extra toolbar content (refresh, permissions, AI toggle, …). */
|
|
103
|
+
toolbarActions?: ReactNode;
|
|
104
|
+
/** Right-hand panel owned by the host (for example an AI assistant). */
|
|
105
|
+
sidePanel?: ReactNode;
|
|
106
|
+
/** Like `sidePanel`, but receives the live table, view and grid selection (for example to scope an AI prompt). */
|
|
107
|
+
renderSidePanel?(context: PagedWorkspaceContext): ReactNode;
|
|
108
|
+
/**
|
|
109
|
+
* Hosts with their own drawer render the settings and schema panels in it. Call `onClose`
|
|
110
|
+
* when the user finishes. Default: inline panels.
|
|
111
|
+
*/
|
|
112
|
+
renderPanel?(panel: {
|
|
113
|
+
kind: "settings" | "schema" | "add" | "record";
|
|
114
|
+
/** The draft has unsaved edits; ask before calling `onClose`. */
|
|
115
|
+
dirty: boolean;
|
|
116
|
+
/** A save is in flight: keep the panel open. */
|
|
117
|
+
busy: boolean;
|
|
118
|
+
title: string;
|
|
119
|
+
content: ReactNode;
|
|
120
|
+
onClose(): void;
|
|
121
|
+
}): ReactNode;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Complete collection workspace: table list, title, view tabs, toolbar, settings and schema
|
|
125
|
+
* panels, add-record form and every view type. It talks only to a `PagedCollectionClient`;
|
|
126
|
+
* routing, caching, permissions and persistence stay with the host.
|
|
127
|
+
*/
|
|
128
|
+
export declare function PagedCollectionWorkspace(props: PagedCollectionWorkspaceProps): import("react").JSX.Element;
|