@uibot/renderer-react 0.18.1 → 0.20.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/collection-application.js +16 -12
- package/dist/collection-editors.d.ts +3 -2
- package/dist/collection-editors.js +10 -10
- package/dist/collection-grid/field-changes.d.ts +9 -0
- package/dist/collection-grid/paged-locale.d.ts +6 -0
- package/dist/collection-grid/relation-editor.d.ts +3 -0
- package/dist/collection-ui.d.ts +2 -0
- package/dist/collection-views/aggregate.d.ts +2 -0
- package/dist/collection-views/record-creator.d.ts +2 -1
- package/dist/collection-views/shared.d.ts +7 -1
- package/dist/collection-views.js +10 -10
- package/dist/collection-workspace.js +13 -13
- package/dist/index.d.ts +5 -0
- package/dist/index.js +16 -12
- package/dist/live-renderer.d.ts +4 -0
- package/dist/paged-collection-grid.js +12 -12
- package/dist/spec-theme.d.ts +6 -0
- package/package.json +4 -4
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PagedCollectionField, PagedCollectionMutationRequest } from "@uibot/contracts";
|
|
2
|
+
import { type PagedCollectionLocale } from "./paged-locale.js";
|
|
3
|
+
export declare function recordUpdateValues(request: PagedCollectionMutationRequest | null, recordId: string): Record<string, unknown>;
|
|
4
|
+
export declare function PagedFieldChanges({ fields, values, serverValues, locale, }: {
|
|
5
|
+
fields: readonly PagedCollectionField[];
|
|
6
|
+
values: Record<string, unknown>;
|
|
7
|
+
serverValues?: Record<string, unknown> | undefined;
|
|
8
|
+
locale?: PagedCollectionLocale | undefined;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import type { PagedCollectionError } from "@uibot/contracts";
|
|
1
2
|
/** Presentation locale only; schema identifiers and protocol tokens remain unchanged. */
|
|
2
3
|
export type PagedCollectionLocale = "en" | "zh-CN";
|
|
3
4
|
export declare function pagedText(locale?: PagedCollectionLocale): (message: string, values?: Record<string, string | number>) => string;
|
|
5
|
+
export declare function pagedMutationErrorText(error: PagedCollectionError, locale?: PagedCollectionLocale): string;
|
|
6
|
+
export declare function pagedReadErrorText({ code, message }: {
|
|
7
|
+
code?: string | undefined;
|
|
8
|
+
message: string;
|
|
9
|
+
}, locale?: PagedCollectionLocale): string;
|
|
@@ -9,6 +9,9 @@ export declare function PagedRelationEditor(props: {
|
|
|
9
9
|
getOptions?: PagedCollectionRelationOptionsProvider | undefined;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
label?: string;
|
|
12
|
+
id?: string;
|
|
13
|
+
"aria-describedby"?: string;
|
|
14
|
+
"aria-invalid"?: boolean;
|
|
12
15
|
/** Server-resolved labels for the current selection; stored values stay record ids. */
|
|
13
16
|
labels?: ReadonlyArray<PagedCollectionRelationOption> | undefined;
|
|
14
17
|
}): import("react").JSX.Element;
|
package/dist/collection-ui.d.ts
CHANGED
|
@@ -118,6 +118,8 @@ export interface CollectionUiSlots {
|
|
|
118
118
|
cancelLabel: string;
|
|
119
119
|
destructive?: boolean | undefined;
|
|
120
120
|
busy?: boolean | undefined;
|
|
121
|
+
/** Disable only confirmation; keep cancellation available when access changes. */
|
|
122
|
+
confirmDisabled?: boolean | undefined;
|
|
121
123
|
onConfirm: () => void;
|
|
122
124
|
onCancel: () => void;
|
|
123
125
|
}) => ReactNode;
|
|
@@ -4,6 +4,8 @@ export interface CollectionAggregateProps {
|
|
|
4
4
|
client: PagedCollectionAggregateClient;
|
|
5
5
|
aggregates: PagedCollectionAggregateSpec[];
|
|
6
6
|
groupBy?: string[];
|
|
7
|
+
/** Display labels only; aggregate aliases and response keys remain unchanged. */
|
|
8
|
+
labels?: Record<string, string>;
|
|
7
9
|
}
|
|
8
10
|
export declare function aggregateIssueText(issue: PagedCollectionAggregateIssue): string;
|
|
9
11
|
type AggregateWords = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PagedCollectionClient, PagedCollectionDescriptor, PagedCollectionMutationReceipt, PagedCollectionRecord } from "@uibot/contracts";
|
|
1
|
+
import type { PagedCollectionClient, PagedCollectionDescriptor, PagedCollectionMutationReceipt, PagedCollectionRecord, PagedCollectionRelationOptionsProvider } from "@uibot/contracts";
|
|
2
2
|
import { type PagedCollectionLocale } from "../collection-grid/paged-locale.js";
|
|
3
3
|
import type { CollectionUiSlots } from "../collection-ui.js";
|
|
4
4
|
export interface PagedCollectionRecordCreatorProps {
|
|
@@ -19,6 +19,7 @@ export interface PagedCollectionRecordCreatorProps {
|
|
|
19
19
|
locale?: PagedCollectionLocale;
|
|
20
20
|
ui?: CollectionUiSlots;
|
|
21
21
|
readOnly?: boolean;
|
|
22
|
+
getRelationOptions?: PagedCollectionRelationOptionsProvider;
|
|
22
23
|
autoFocus?: boolean;
|
|
23
24
|
}
|
|
24
25
|
/** Display name of a saved record: its title (or first) text field, empty when unavailable. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CSSProperties } from "react";
|
|
2
|
-
import type { PagedCollectionClient, PagedCollectionDescriptor, PagedCollectionMutationReceipt, PagedCollectionMutationRequest, PagedCollectionPage, PagedCollectionQuery, PagedCollectionRecord, PagedCollectionView } from "@uibot/contracts";
|
|
2
|
+
import type { PagedCollectionClient, PagedCollectionDescriptor, PagedCollectionMutationReceipt, PagedCollectionMutationRequest, PagedCollectionPage, PagedCollectionQuery, PagedCollectionRecord, PagedCollectionView, PagedCollectionRelationOptionsProvider } from "@uibot/contracts";
|
|
3
3
|
import { type CollectionAggregateProps } from "./aggregate.js";
|
|
4
4
|
import { pagedText, type PagedCollectionLocale } from "../collection-grid/paged-locale.js";
|
|
5
5
|
import { type PagedCollectionGridFeaturesInput } from "../collection-grid/features.js";
|
|
@@ -20,6 +20,8 @@ export interface CollectionViewProps {
|
|
|
20
20
|
ui?: CollectionUiSlots;
|
|
21
21
|
/** Feature flags shared with the grid (view types, grouping, ...). */
|
|
22
22
|
features?: PagedCollectionGridFeaturesInput;
|
|
23
|
+
/** Bounded scalar-relation choices; the host owns scope and transport. */
|
|
24
|
+
getRelationOptions?: PagedCollectionRelationOptionsProvider;
|
|
23
25
|
/** After creating a record, offer a way back to a records view. Host-owned navigation. */
|
|
24
26
|
onShowRecords?(): void;
|
|
25
27
|
}
|
|
@@ -64,6 +66,8 @@ export declare function useCollectionMutation(props: CollectionViewProps): {
|
|
|
64
66
|
reset: () => void;
|
|
65
67
|
commit: (request: PagedCollectionMutationRequest) => Promise<boolean>;
|
|
66
68
|
retryRequest: () => PagedCollectionMutationRequest | null;
|
|
69
|
+
canRetry: boolean;
|
|
70
|
+
fields: import("@uibot/contracts").PagedCollectionField[];
|
|
67
71
|
};
|
|
68
72
|
export declare function MutationFeedback({ mutation, onRetry, locale, ui, }: {
|
|
69
73
|
mutation: ReturnType<typeof useCollectionMutation>;
|
|
@@ -97,6 +101,8 @@ export declare function useRecordMove(props: CollectionViewProps): {
|
|
|
97
101
|
reset: () => void;
|
|
98
102
|
commit: (request: PagedCollectionMutationRequest) => Promise<boolean>;
|
|
99
103
|
retryRequest: () => PagedCollectionMutationRequest | null;
|
|
104
|
+
canRetry: boolean;
|
|
105
|
+
fields: import("@uibot/contracts").PagedCollectionField[];
|
|
100
106
|
};
|
|
101
107
|
move: (row: PagedCollectionRecord, values: Record<string, unknown>) => Promise<void>;
|
|
102
108
|
retry: () => Promise<void>;
|