@nexia/sdk 0.6.5 → 0.6.6
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/host.d.ts +3 -1
- package/dist/host.js +3 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -0
- package/dist/resources/draft-field.d.ts +9 -0
- package/dist/resources/draft-field.js +22 -0
- package/dist/resources/resource-information.d.ts +15 -0
- package/dist/shell.d.ts +48 -0
- package/package.json +1 -1
package/dist/host.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { ApprovalBusinessFormRegistrar, ApprovalBusinessFormRegistry } from
|
|
|
5
5
|
import type { ContextQueryResult, PermissionsQueryResult } from './context';
|
|
6
6
|
import type { DataMigrationBackgroundOperationClient, DataMigrationRegistrar, DataMigrationRegistry } from './data-migration';
|
|
7
7
|
import type { ProcessUserTaskFormRegistrar, ProcessUserTaskFormRegistry } from './process';
|
|
8
|
-
import type { AppRouteFrameProps, AutoRegisterPackageSurfacesOptions, FormFieldErrors, InspectorActionProps, InspectorResourceActionsProps, MessageApi, MutationFormError, NxAdaptiveSplitProps, NxActionButtonProps, NxAlertProps, NxButtonProps, NxLinkButtonProps, NxIconButtonProps, NxIconLinkProps, NxCanonicalRoutePaneProps, NxCheckboxProps, NxColumnBrowserProps, NxColumnPickerProps, NxComboboxProps, NxDatePickerProps, NxDateRangePickerProps, NxDetailRowProps, NxEmptyViewProps, NxFieldGroupProps, NxFieldLegendProps, NxFieldsetProps, NxFileDropzoneProps, NxFormFieldProps, NxFormSectionProps, NxDropdownMenuProps, NxInsightFilterBarProps, NxInsightSurfaceProps, NxHelpTooltipProps, NxOverviewBandProps, InsightFilterControls, UseInsightFilterStateOptions, NxLoadingBlockProps, NxModalDialogProps, NxOrgChartProps, NxMissingRequiredReferencesAlertProps, NxPageFrameProps, NxPaginationProps, NxRadioGroupProps, NxRadioProps, NxRefreshControlProps, NxSearchFieldProps, NxSectionCardProps, NxSectionStackProps, NxResponsiveRegionProps, NxSelectProps, NxStatCardProps, NxStatusBadgeProps, NxTabNavProps, NxTextAreaProps, NxTextInputProps, NxTooltipProps, OpenResourceWorkTab, ResourceCreateCompletion, ResourceCreateReceiverRegistration, ResourceInspectorAdapterRegistry, ResourceInspectorAdapterRegistrar, ResourceInspectorPanelProps, ResourceInspectorStackHostProps, ResourceInspectorStackProviderProps, ResourceInspectorStateProps, ResourceLinkProps, ResourceListParams, ResourceListParamsControls, ResourceListToolbarMoreMenuProps, ResourcePrimaryCellProps, ResourceRowActionsMenuProps, ResourceStatusBadgeProps, ResourceTableProps, ResourceTableSort, ResourceTextCellProps, UseRegisterListLocateActionOptions, UseResourceListParamsOptions, TabContextActionRegistration, ToastOptions, WorkSectionProps, FavoriteTarget, WorkSurfaceLabelInput, WorkSurfaceLabels, WorkSurfaceProps } from './shell';
|
|
8
|
+
import type { AppRouteFrameProps, AutoRegisterPackageSurfacesOptions, FormFieldErrors, InspectorActionProps, InspectorResourceActionsProps, MessageApi, MutationFormError, NxAdaptiveSplitProps, NxActionButtonProps, NxAlertProps, NxButtonProps, NxLinkButtonProps, NxIconButtonProps, NxIconLinkProps, NxCanonicalRoutePaneProps, NxCheckboxProps, NxColumnBrowserProps, NxColumnPickerProps, NxComboboxProps, NxDatePickerProps, NxDateRangePickerProps, NxDetailRowProps, NxEmptyViewProps, NxFieldGroupProps, NxFieldLegendProps, NxFieldsetProps, NxFileDropzoneProps, NxFormFieldProps, NxFormSectionProps, NxDropdownMenuProps, NxInsightFilterBarProps, NxInsightSurfaceProps, NxHelpTooltipProps, NxOverviewBandProps, InsightFilterControls, UseInsightFilterStateOptions, NxLoadingBlockProps, NxModalDialogProps, NxOrgChartProps, NxMissingRequiredReferencesAlertProps, NxPageFrameProps, NxPaginationProps, NxRadioGroupProps, NxRadioProps, NxRefreshControlProps, NxSearchFieldProps, NxSectionCardProps, NxSectionStackProps, NxResponsiveRegionProps, NxSelectProps, NxStatCardProps, NxStatusBadgeProps, NxTabNavProps, NxTextAreaProps, NxTextInputProps, NxTooltipProps, OpenResourceWorkTab, ResourceCreateCompletion, ResourceCreateReceiverRegistration, ResourceInspectorAdapterRegistry, ResourceInspectorAdapterRegistrar, ResourceInspectorPanelProps, ResourceInspectorStackHostProps, ResourceInspectorStackProviderProps, ResourceInspectorStateProps, ResourceLinkProps, ResourceListParams, ResourceListParamsControls, ResourceListToolbarMoreMenuProps, ResourcePrimaryCellProps, ResourceRowActionsMenuProps, ResourceStatusBadgeProps, ResourceTableProps, ResourceTableSort, ResourceTextCellProps, UseRegisterListLocateActionOptions, UseResourceListParamsOptions, TabContextActionRegistration, RegisterDraftActionOptions, ToastOptions, WorkSectionProps, FavoriteTarget, WorkSurfaceLabelInput, WorkSurfaceLabels, WorkSurfaceProps } from './shell';
|
|
9
9
|
import type { AgentComponentRenderer, AttachmentDeleteResult, AttachmentQueryResult, AttachmentUploadOptions, AttachmentUploadResult, ApprovalRoutePoliciesQueryResult, ApprovalSharedLinesQueryResult, DashboardWidgetAutoHeightRef, LegalEntityMemberListParams, LegalEntityMemberQueryResult, LegalEntityApplicabilityQueryResult, LegalEntityQueryResult, MediaUploadResult, OperatingUnitQueryResult, OperatingUnitQueryScope, OperatingUnitScopeFieldProps, OperatingUnitScopeResult, OperatingUnitSelectionResult, PartyListParams, PartyQueryResult, TrustedAssetListParams, TrustedAssetsQueryResult, UploadFileClient } from './platform';
|
|
10
10
|
import type { NxOrganizationTargetSelectorProps, NxOperatingUnitSelectorProps, OrganizationListScopeMode, OrganizationListScopeResult, OrganizationTargetQuery, OrganizationTargetQueryResult } from './organization-target';
|
|
11
11
|
import type { NxCalendarProps, NxResourceSchedulerProps, ResourceBoardProps, ResourceScheduleProps } from './resources/resource-projections';
|
|
@@ -275,6 +275,7 @@ export interface NexiaAppFrontendHostBindings {
|
|
|
275
275
|
usePermissionsQuery: (tenantId: string | undefined, legalEntityPublicId: string | null | undefined, operatingUnitPublicId?: string | null, enabled?: boolean) => PermissionsQueryResult;
|
|
276
276
|
useResourceProjectionChange: (subscription: ResourceProjectionChangeSubscription) => void;
|
|
277
277
|
useRegisterTabActions: (actions: TabContextActionRegistration[] | null) => void;
|
|
278
|
+
useRegisterDraftAction: (options: RegisterDraftActionOptions) => void;
|
|
278
279
|
useRegisterListLocateAction: <Row>(options: UseRegisterListLocateActionOptions<Row>) => void;
|
|
279
280
|
useResourceListParams: (options?: UseResourceListParamsOptions) => ResourceListParamsControls;
|
|
280
281
|
useTrustedAssetsQuery: (tenantId: string | undefined, legalEntityPublicId: string | null | undefined, params: TrustedAssetListParams, enabled?: boolean) => TrustedAssetsQueryResult;
|
|
@@ -567,6 +568,7 @@ export declare function useResourceCreateCompletion(): ResourceCreateCompletion;
|
|
|
567
568
|
export declare function useMarkTabDirty(dirty: boolean, snapshot?: string, initialSnapshot?: string): void;
|
|
568
569
|
export declare function useClearTabDirty(): () => void;
|
|
569
570
|
export declare function useRegisterTabActions(actions: TabContextActionRegistration[] | null): void;
|
|
571
|
+
export declare function useRegisterDraftAction(options: RegisterDraftActionOptions): void;
|
|
570
572
|
export declare function useWorkTabLabel(label: string | null | undefined): void;
|
|
571
573
|
export declare function useWorkSurfaceLabels(input: WorkSurfaceLabelInput): WorkSurfaceLabels;
|
|
572
574
|
export declare function autoRegisterPackageSurfaces(options: AutoRegisterPackageSurfacesOptions): void;
|
package/dist/host.js
CHANGED
|
@@ -697,6 +697,9 @@ export function useClearTabDirty() {
|
|
|
697
697
|
export function useRegisterTabActions(actions) {
|
|
698
698
|
host().hooks.useRegisterTabActions(actions);
|
|
699
699
|
}
|
|
700
|
+
export function useRegisterDraftAction(options) {
|
|
701
|
+
host().hooks.useRegisterDraftAction(options);
|
|
702
|
+
}
|
|
700
703
|
export function useWorkTabLabel(label) {
|
|
701
704
|
host().hooks.useWorkTabLabel(label);
|
|
702
705
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type { ResourceListFilterableEntry, ResourceListSchema, } from "./resources/resource-list";
|
|
2
|
+
export { draftStringField } from './resources/draft-field';
|
|
2
3
|
export { defineResourceInformationSchema, resourceInformationValue, } from "./resources/resource-information";
|
|
3
|
-
export type { NxResourceInformationFormProps, NxResourceInformationViewProps, ResourceFormLegalEntity, NxResourceFormLegalEntityFieldProps, ResourceInformationControlProjection, ResourceInformationControlSlot, ResourceInformationCustomProjection, ResourceInformationEditProjection, ResourceInformationEditRenderContext, ResourceInformationField, ResourceInformationFieldSpan, ResourceInformationMode, ResourceInformationReadOnlyProjection, ResourceInformationRequirement, ResourceInformationSchema, ResourceInformationSection, ResourceInformationTranslator, ResourceInformationValue, } from "./resources/resource-information";
|
|
4
|
+
export type { NxResourceInformationFormProps, NxResourceInformationViewProps, ResourceFormLegalEntity, ResourceFormBinding, NxResourceFormLegalEntityFieldProps, ResourceInformationControlProjection, ResourceInformationControlSlot, ResourceInformationCustomProjection, ResourceInformationEditProjection, ResourceInformationEditRenderContext, ResourceInformationField, ResourceInformationFieldSpan, ResourceInformationMode, ResourceInformationReadOnlyProjection, ResourceInformationRequirement, ResourceInformationSchema, ResourceInformationSection, ResourceInformationTranslator, ResourceInformationValue, } from "./resources/resource-information";
|
|
4
5
|
export type { DatasetImportConfirmationSummary, ResourceImportPreview, ResourceImportPreviewRow, ResourceImportResponse, ResourceImportRun, ResourceImportRunStatus, ResourceImportSummary, ResourceTransferFormat, ResourceTransferMessage, ResourceTransferMeta, NxResourceImportDialogProps, NxResourceTransferActionsProps, NxDatasetImportWorkspaceProps, NxDatasetExportWorkspaceProps, } from "./resources/resource-transfer";
|
|
5
6
|
export type { NxCalendarActionBinding, NxCalendarActionCommand, NxCalendarActionResult, NxCalendarInteraction, NxCalendarOccurrence, NxCalendarProps, NxCalendarRange, NxCalendarSelection, NxCalendarTemporalRange, NxCalendarView, NxResourceSchedulerActionBinding, NxResourceSchedulerActionCommand, NxResourceSchedulerActionResult, NxResourceSchedulerInteraction, NxResourceSchedulerOccurrence, NxResourceSchedulerProps, NxResourceSchedulerResource, NxResourceSchedulerSelection, NxResourceSchedulerView, ResourceBoardCard, ResourceBoardLabels, ResourceBoardLane, ResourceBoardLoadState, ResourceBoardMoveCommand, ResourceBoardMutationResult, ResourceBoardProjection, ResourceBoardProps, ResourceBoardSummaryField, ResourceProjectionReference, ResourceScheduleActionBinding, ResourceScheduleActionCommand, ResourceScheduleDatePair, ResourceScheduleDateSemantics, ResourceScheduleDependency, ResourceScheduleDependencyType, ResourceScheduleInteraction, ResourceScheduleItem, ResourceScheduleItemType, ResourceScheduleLoadState, ResourceScheduleMutationResult, ResourceScheduleProjection, ResourceScheduleProps, ResourceScheduleTimeUnit, ResourceScheduleView, } from "./resources/resource-projections";
|
|
6
7
|
export type { ContextQueryResult, ContextResponse, LegalEntityContext, PermissionsQueryResult, PermissionsResponse, TenantContext, UserContext, WorkspaceContext, } from "./context";
|
|
@@ -35,7 +36,7 @@ export type { ApprovalActor, ApprovalBodySnapshot, ApprovalBusinessFormControlle
|
|
|
35
36
|
export { APPROVAL_STATES, APPROVAL_STEP_KINDS } from "./approval";
|
|
36
37
|
export type { BpmnEditorDocument, BpmnEditorElement, BpmnEditorNodeType, BpmnEditorProcess, DmnEditorDocument, DmnEditorHitPolicy, DmnEditorInputClause, DmnEditorOutputClause, DmnEditorRule, DmnEditorValueType, ProcessUserTaskFormController, ProcessUserTaskFormRegistrar, ProcessUserTaskFormRegistration, ProcessUserTaskFormRegistry, ProcessUserTaskFormSlotPropsV1, ProcessUserTaskFormWidgetLoader, ProcessUserTaskResourceRef, } from "./process";
|
|
37
38
|
export { DMN_EDITOR_HIT_POLICIES } from "./process";
|
|
38
|
-
export type { AppRouteFrameProps, AppRoutePrefetchContext, AppRoutePrefetcher, AutoRegisterPackageSurfacesOptions, PackageSurfaceLoader, PackageSurfaceOverride, PackageSurfaceOverrideRegistration, FormFieldErrors, InspectorActionProps, InspectorResourceActionsProps, ListLocateRecord, MessageApi, MutationFormError, NxCanonicalRoutePaneProps, NxActionKind, NxIconButtonProps, NxComboboxOption, NxComboboxProps, NxRefreshControlProps, NxColumnBrowserLabels, NxColumnBrowserProps, NxColumnNode, NxColumnPickerLabels, NxColumnPickerProps, NxDatePickerLabels, NxDatePickerProps, NxDateRangePickerProps, NxDateRangeValue, NxDropdownMenuItem, NxHelpTooltipProps, InsightFilterControls, InsightFilterState, InsightQueryLike, InsightRangePreset, UseInsightFilterStateOptions, NxOverviewBandCard, NxSelectOption, NxStatDelta, NxStatDeltaDirection, NxStatDeltaTone, NxTabNavItem, NxTabNavProps, NxTooltipAlign, NxTooltipProps, NxTooltipSide, OpenResourceWorkTab, OpenResourceWorkTabOptions, ResourceCreateCompletion, ResourceCreateCompletionInput, ResourceCreateContinuationTarget, ResourceCreateReceiverRegistration, ResourceInspectorAdapter, ResourceInspectorAdapterLoader, ResourceInspectorAdapterProps, ResourceInspectorAdapterRegistry, ResourceInspectorPanelProps, ResourceInspectorStack, ResourceInspectorStackHostProps, ResourceInspectorStackProviderProps, ResourceInspectorStateProps, ResourceLinkProps, ResourceListFilters, ResourceListFilterValue, ResourceListFooterConfig, ResourceListParams, ResourceListParamsControls, ResourceListRefreshConfig, ResourceListToolbarConfig, ResourceListToolbarMoreMenuProps, ResourceListToolbarViewOption, ResourcePrimaryCellProps, ResourceActionDescriptor, ResourceRef, ResourceRowActionsMenuProps, ResourceStatusBadgeProps, ResourceTableColumn, ResourceTableAccess, ResourceTableDensity, ResourceTableProps, ResourceTableStyle, ResourceTableSummaryRow, ResourceTableSort, TabContextActionContext, TabContextActionRegistration, TabContextActionResult, ResourceTextCellProps, ToastOptions, ToastSource, UseRegisterListLocateActionOptions, UseResourceListParamsOptions, WorkSectionProps, FavoriteTarget, WorkTabRef, WorkSurfaceAction, WorkSurfaceLabelInput, WorkSurfaceLabels, WorkSurfaceProps, } from "./shell";
|
|
39
|
+
export type { AppRouteFrameProps, AppRoutePrefetchContext, AppRoutePrefetcher, AutoRegisterPackageSurfacesOptions, PackageSurfaceLoader, PackageSurfaceOverride, PackageSurfaceOverrideRegistration, FormFieldErrors, InspectorActionProps, InspectorResourceActionsProps, ListLocateRecord, MessageApi, MutationFormError, NxCanonicalRoutePaneProps, NxActionKind, NxIconButtonProps, NxComboboxOption, NxComboboxProps, NxRefreshControlProps, NxColumnBrowserLabels, NxColumnBrowserProps, NxColumnNode, NxColumnPickerLabels, NxColumnPickerProps, NxDatePickerLabels, NxDatePickerProps, NxDateRangePickerProps, NxDateRangeValue, NxDropdownMenuItem, NxHelpTooltipProps, InsightFilterControls, InsightFilterState, InsightQueryLike, InsightRangePreset, UseInsightFilterStateOptions, NxOverviewBandCard, NxSelectOption, NxStatDelta, NxStatDeltaDirection, NxStatDeltaTone, NxTabNavItem, NxTabNavProps, NxTooltipAlign, NxTooltipProps, NxTooltipSide, OpenResourceWorkTab, OpenResourceWorkTabOptions, ResourceCreateCompletion, ResourceCreateCompletionInput, ResourceCreateContinuationTarget, ResourceCreateReceiverRegistration, ResourceInspectorAdapter, ResourceInspectorAdapterLoader, ResourceInspectorAdapterProps, ResourceInspectorAdapterRegistry, ResourceInspectorPanelProps, ResourceInspectorStack, ResourceInspectorStackHostProps, ResourceInspectorStackProviderProps, ResourceInspectorStateProps, ResourceLinkProps, ResourceListFilters, ResourceListFilterValue, ResourceListFooterConfig, ResourceListParams, ResourceListParamsControls, ResourceListRefreshConfig, ResourceListToolbarConfig, ResourceListToolbarMoreMenuProps, ResourceListToolbarViewOption, ResourcePrimaryCellProps, ResourceActionDescriptor, ResourceRef, ResourceRowActionsMenuProps, ResourceStatusBadgeProps, ResourceTableColumn, ResourceTableAccess, ResourceTableDensity, ResourceTableProps, ResourceTableStyle, ResourceTableSummaryRow, ResourceTableSort, TabContextActionContext, TabContextActionRegistration, DraftFieldBinding, RegisterDraftActionOptions, TabContextActionResult, ResourceTextCellProps, ToastOptions, ToastSource, UseRegisterListLocateActionOptions, UseResourceListParamsOptions, WorkSectionProps, FavoriteTarget, WorkTabRef, WorkSurfaceAction, WorkSurfaceLabelInput, WorkSurfaceLabels, WorkSurfaceProps, } from "./shell";
|
|
39
40
|
export { FavoriteButton } from "./host";
|
|
40
41
|
export type { FavoriteButtonProps } from "./host";
|
|
41
42
|
export { createSpreadsheetWorkbook } from "./spreadsheet";
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { draftStringField } from './resources/draft-field.js';
|
|
1
2
|
export { defineResourceInformationSchema, resourceInformationValue, } from "./resources/resource-information.js";
|
|
2
3
|
export { createDataMigrationSessionCheckpointStore, dataMigrationUploadAccept, dataMigrationRunPublicId, isDataMigrationOperationAccepted, } from "./data-migration.js";
|
|
3
4
|
export { projectSignatureCapabilityCatalog, signatureCapabilityIdentity, } from "./signature.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DraftFieldBinding } from '../shell';
|
|
2
|
+
/** Binds one App-owned text/choice state to a draft action without submitting it. */
|
|
3
|
+
export declare function draftStringField<T extends string>(value: T, initialValue: T, apply: (value: T) => void, rules: {
|
|
4
|
+
maxLength: number;
|
|
5
|
+
minLength?: number;
|
|
6
|
+
trim?: boolean;
|
|
7
|
+
values?: readonly T[];
|
|
8
|
+
pattern?: string;
|
|
9
|
+
}): DraftFieldBinding;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Binds one App-owned text/choice state to a draft action without submitting it. */
|
|
2
|
+
export function draftStringField(value, initialValue, apply, rules) {
|
|
3
|
+
return {
|
|
4
|
+
value, initialValue,
|
|
5
|
+
inputSchema: { type: 'string', maxLength: rules.maxLength,
|
|
6
|
+
...(rules.minLength === undefined ? {} : { minLength: rules.minLength }),
|
|
7
|
+
...(rules.pattern === undefined ? {} : { pattern: rules.pattern }),
|
|
8
|
+
...(rules.values === undefined ? {} : { enum: rules.values }) },
|
|
9
|
+
parse(input) {
|
|
10
|
+
if (typeof input !== 'string')
|
|
11
|
+
throw new Error('Expected text');
|
|
12
|
+
const parsed = rules.trim ? input.trim() : input;
|
|
13
|
+
const length = Array.from(parsed).length;
|
|
14
|
+
if (length > rules.maxLength || length < (rules.minLength ?? 0)
|
|
15
|
+
|| (rules.pattern !== undefined && !new RegExp(rules.pattern, 'u').test(parsed))
|
|
16
|
+
|| (rules.values && !rules.values.includes(parsed)))
|
|
17
|
+
throw new Error('Invalid field value');
|
|
18
|
+
return parsed;
|
|
19
|
+
},
|
|
20
|
+
apply: next => apply(next),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -60,6 +60,8 @@ export interface ResourceInformationField<TViewContext, TEditContext> {
|
|
|
60
60
|
/** Short domain definition rendered from the field label. */
|
|
61
61
|
definitionKey?: string;
|
|
62
62
|
requirement?: ResourceInformationRequirement;
|
|
63
|
+
/** Personal/secret values are excluded from automated form discovery and writes. */
|
|
64
|
+
sensitive?: boolean;
|
|
63
65
|
span?: ResourceInformationFieldSpan;
|
|
64
66
|
/** Defaults to all projections. Omissions must be deliberate and explicit. */
|
|
65
67
|
modes?: readonly ResourceInformationMode[];
|
|
@@ -109,6 +111,8 @@ export interface NxResourceInformationFormProps<TViewContext, TEditContext> {
|
|
|
109
111
|
schema: ResourceInformationSchema<TViewContext, TEditContext>;
|
|
110
112
|
context: TEditContext;
|
|
111
113
|
mode: "create" | "edit";
|
|
114
|
+
/** Explicit owner and effect of this form; control writers remain public callbacks. */
|
|
115
|
+
binding?: ResourceFormBinding;
|
|
112
116
|
/** First field of the first schema section, full row width. Omit for tenant-owned forms.
|
|
113
117
|
* Use `stored` on edit; the host never renders an editable owner in edit mode.
|
|
114
118
|
* Do not also declare the Legal Entity field in the form schema.
|
|
@@ -118,6 +122,17 @@ export interface NxResourceInformationFormProps<TViewContext, TEditContext> {
|
|
|
118
122
|
emptyValue: ReactNode;
|
|
119
123
|
testIdPrefix?: string;
|
|
120
124
|
}
|
|
125
|
+
export interface ResourceFormBinding {
|
|
126
|
+
/** Omit identity inside a declared Resource route; the host supplies it. */
|
|
127
|
+
resourceKey?: string;
|
|
128
|
+
resourceId?: string | null;
|
|
129
|
+
/** Additional form-owned scope; otherwise use the pane-local route scope. */
|
|
130
|
+
scopeKey?: string;
|
|
131
|
+
effect: "draft" | "autosave";
|
|
132
|
+
disabled?: boolean;
|
|
133
|
+
/** Pure cross-field preflight; return rejected keys before any value writer runs. */
|
|
134
|
+
validateBatch?: (values: Readonly<Record<string, unknown>>) => readonly string[];
|
|
135
|
+
}
|
|
121
136
|
/**
|
|
122
137
|
* Checks a schema once, then deliberately widens it to the stable host
|
|
123
138
|
* contract. Keeping every App field as one deep literal union makes a
|
package/dist/shell.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { QueryClient } from "@tanstack/react-query";
|
|
|
3
3
|
import type { PermissionsResponse } from "./context";
|
|
4
4
|
import type { ResourcePickerRevalidation, ResourceReferenceIdentity } from "./resource-reference";
|
|
5
5
|
import type { ResourceListSchema } from "./resources/resource-list";
|
|
6
|
+
import type { ResourceFormBinding } from "./resources/resource-information";
|
|
6
7
|
import type { ResourceTransferMeta } from "./resources/resource-transfer";
|
|
7
8
|
/** A server-authorized, durable favorite identity. */
|
|
8
9
|
export type FavoriteTarget = {
|
|
@@ -232,6 +233,11 @@ interface NxComboboxBaseProps<TValue extends string | number> {
|
|
|
232
233
|
emptyLabel?: ReactNode;
|
|
233
234
|
searchValue?: string;
|
|
234
235
|
onSearchChange?: (query: string) => void;
|
|
236
|
+
/** Await an authorized query using the same source as the displayed options. */
|
|
237
|
+
searchOptions?: {
|
|
238
|
+
scopeKey: string;
|
|
239
|
+
search: (query: string, signal?: AbortSignal) => Promise<readonly NxComboboxOption<TValue>[]>;
|
|
240
|
+
};
|
|
235
241
|
loading?: boolean;
|
|
236
242
|
id?: string;
|
|
237
243
|
describedBy?: string;
|
|
@@ -614,6 +620,7 @@ export interface NxIconLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorEle
|
|
|
614
620
|
className?: string;
|
|
615
621
|
}
|
|
616
622
|
export interface NxCheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type"> {
|
|
623
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
617
624
|
inputSize?: "sm" | "md";
|
|
618
625
|
indeterminate?: boolean;
|
|
619
626
|
label?: string;
|
|
@@ -732,6 +739,9 @@ export interface NxOrgChartProps {
|
|
|
732
739
|
testId?: string;
|
|
733
740
|
}
|
|
734
741
|
export interface NxFormFieldProps {
|
|
742
|
+
/** Canonical field identity; schema forms already supply it and must not repeat it. */
|
|
743
|
+
fieldKey?: string;
|
|
744
|
+
sensitive?: boolean;
|
|
735
745
|
label: ReactNode;
|
|
736
746
|
labelTooltip?: ReactNode;
|
|
737
747
|
children: (context: {
|
|
@@ -749,6 +759,8 @@ export interface NxFormFieldProps {
|
|
|
749
759
|
className?: string;
|
|
750
760
|
}
|
|
751
761
|
export interface NxFormSectionProps {
|
|
762
|
+
/** Explicit unsaved semantics for composed forms; uses published route identity. */
|
|
763
|
+
binding?: ResourceFormBinding;
|
|
752
764
|
id?: string;
|
|
753
765
|
children: ReactNode;
|
|
754
766
|
onSubmit?: (event: FormEvent<HTMLFormElement>) => void;
|
|
@@ -1022,12 +1034,15 @@ export interface NxTextAreaProps extends Omit<TextareaHTMLAttributes<HTMLTextAre
|
|
|
1022
1034
|
invalid?: boolean;
|
|
1023
1035
|
autoResize?: boolean;
|
|
1024
1036
|
resizable?: boolean;
|
|
1037
|
+
onValueChange?: (value: string) => void;
|
|
1025
1038
|
}
|
|
1026
1039
|
export interface NxTextInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
1027
1040
|
inputSize?: "md" | "lg";
|
|
1028
1041
|
appearance?: "field" | "title";
|
|
1029
1042
|
mono?: boolean;
|
|
1030
1043
|
invalid?: boolean;
|
|
1044
|
+
/** Controlled value writer shared by direct editing and form integrations. */
|
|
1045
|
+
onValueChange?: (value: string) => void;
|
|
1031
1046
|
}
|
|
1032
1047
|
export interface NxDatePickerLabels {
|
|
1033
1048
|
calendar: string;
|
|
@@ -1165,12 +1180,36 @@ export interface TabContextActionContext {
|
|
|
1165
1180
|
signal?: AbortSignal;
|
|
1166
1181
|
}
|
|
1167
1182
|
export interface TabContextActionRegistration {
|
|
1183
|
+
/** Declares read or local draft work; neither saves nor submits. */
|
|
1184
|
+
effect?: "read" | "draft";
|
|
1168
1185
|
type: string;
|
|
1169
1186
|
label: string;
|
|
1170
1187
|
description?: string;
|
|
1171
1188
|
inputSchema?: Record<string, unknown>;
|
|
1172
1189
|
run: (payload: Record<string, unknown>, context: TabContextActionContext) => TabContextActionResult | Promise<TabContextActionResult>;
|
|
1173
1190
|
}
|
|
1191
|
+
/** Explicit form-owner binding. Reference resolution and field rules stay in the App. */
|
|
1192
|
+
export interface DraftFieldBinding {
|
|
1193
|
+
value: unknown;
|
|
1194
|
+
initialValue: unknown;
|
|
1195
|
+
inputSchema: Record<string, unknown>;
|
|
1196
|
+
/** Return a canonical value or throw for invalid/unresolved input. */
|
|
1197
|
+
parse: (input: unknown) => unknown;
|
|
1198
|
+
apply: (value: unknown) => void;
|
|
1199
|
+
}
|
|
1200
|
+
export interface RegisterDraftActionOptions {
|
|
1201
|
+
actionType: string;
|
|
1202
|
+
label: string;
|
|
1203
|
+
description?: string;
|
|
1204
|
+
resourceKey: string;
|
|
1205
|
+
resourceId: string | null;
|
|
1206
|
+
/** Local form context identity (for example tenant and selected create owner); never grants authority. */
|
|
1207
|
+
scopeKey?: string;
|
|
1208
|
+
enabled: boolean;
|
|
1209
|
+
fields: Record<string, DraftFieldBinding>;
|
|
1210
|
+
/** Return invalid field keys for App-owned cross-field constraints, before any writer runs. */
|
|
1211
|
+
validateBatch?: (values: Readonly<Record<string, unknown>>) => readonly string[];
|
|
1212
|
+
}
|
|
1174
1213
|
export interface WorkSurfaceLabelInput {
|
|
1175
1214
|
action: WorkSurfaceAction;
|
|
1176
1215
|
resourceLabel: string;
|
|
@@ -1227,12 +1266,21 @@ export interface ListLocateRecord {
|
|
|
1227
1266
|
hint?: string;
|
|
1228
1267
|
showUrl?: string;
|
|
1229
1268
|
editUrl?: string;
|
|
1269
|
+
/** Authorized edit destination's draft-only action; the host still verifies
|
|
1270
|
+
* the mounted action, record and completion before reporting success. */
|
|
1271
|
+
editDraft?: {
|
|
1272
|
+
resourceKey: string;
|
|
1273
|
+
action: string;
|
|
1274
|
+
inputSchema: Record<string, unknown>;
|
|
1275
|
+
};
|
|
1230
1276
|
}
|
|
1231
1277
|
export interface UseRegisterListLocateActionOptions<Row> {
|
|
1232
1278
|
actionType: string;
|
|
1233
1279
|
label: string;
|
|
1234
1280
|
description?: string;
|
|
1235
1281
|
enabled: boolean;
|
|
1282
|
+
/** Tenant/authority/organization identity; exclude ordinary search text. */
|
|
1283
|
+
scopeKey?: string;
|
|
1236
1284
|
schema: ResourceListSchema | undefined;
|
|
1237
1285
|
params: Pick<ResourceListParamsControls, "setParams" | "perPage">;
|
|
1238
1286
|
fetchPage: (params: ResourceListParams) => Promise<{
|