@nocobase/client 2.1.0-alpha.13 → 2.1.0-alpha.15
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/es/ai/tools-manager/types.d.ts +7 -0
- package/es/flow/FlowModelRepository.d.ts +0 -7
- package/es/flow/models/blocks/details/DetailsItemModel.d.ts +7 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/popupSubTableBeforeClose.d.ts +25 -0
- package/es/flow/models/fields/AssociationFieldModel/RecordPickerFieldModel.d.ts +10 -0
- package/es/flow/models/fields/AssociationFieldModel/itemChain.d.ts +5 -0
- package/es/flow/models/fields/AssociationFieldModel/recordSelectShared.d.ts +2 -13
- package/es/index.mjs +84 -74
- package/es/schema-component/antd/menu/Menu.d.ts +0 -7
- package/es/schema-settings/SchemaSettings.d.ts +2 -0
- package/lib/index.js +86 -76
- package/package.json +6 -6
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import type { ComponentType } from 'react';
|
|
10
|
+
import type { ModalProps } from 'antd';
|
|
10
11
|
import type { Application } from '../../application';
|
|
11
12
|
import { Registry } from '@nocobase/utils/client';
|
|
12
13
|
export interface ToolsManager extends ToolsRegistration {
|
|
@@ -16,12 +17,18 @@ export interface ToolsManager extends ToolsRegistration {
|
|
|
16
17
|
export interface ToolsRegistration {
|
|
17
18
|
registerTools(name: string, options: ToolsOptions): void;
|
|
18
19
|
}
|
|
20
|
+
export type ToolModalProps = Pick<ModalProps, 'width' | 'styles'>;
|
|
19
21
|
export type ToolsOptions = {
|
|
20
22
|
ui?: {
|
|
21
23
|
card?: ComponentType<ToolsUIProperties>;
|
|
22
24
|
modal?: {
|
|
23
25
|
title?: string;
|
|
24
26
|
okText?: string;
|
|
27
|
+
props?: ToolModalProps;
|
|
28
|
+
footer?: ComponentType<{
|
|
29
|
+
tool: ToolCall;
|
|
30
|
+
}>;
|
|
31
|
+
hideOkButton?: boolean;
|
|
25
32
|
useOnOk?: (decisions: ToolsUIProperties['decisions'], adjustArgs: Record<string, any>) => {
|
|
26
33
|
onOk: () => void | Promise<void>;
|
|
27
34
|
};
|
|
@@ -13,7 +13,6 @@ export declare class MockFlowModelRepository implements IFlowModelRepository<Flo
|
|
|
13
13
|
constructor(prefix?: string);
|
|
14
14
|
get models(): Map<any, any>;
|
|
15
15
|
findOne(query: any): Promise<any>;
|
|
16
|
-
ensure(values: Record<string, any>): Promise<any>;
|
|
17
16
|
loadByParentId(parentId: string): Promise<any>;
|
|
18
17
|
load(uid: string): Promise<any>;
|
|
19
18
|
save(model: FlowModel): Promise<Record<string, any>>;
|
|
@@ -28,12 +27,6 @@ export declare class FlowModelRepository implements IFlowModelRepository<FlowMod
|
|
|
28
27
|
private inFlightFindOne;
|
|
29
28
|
private buildFindOneKey;
|
|
30
29
|
findOne(query: any): Promise<any>;
|
|
31
|
-
ensure(values: Record<string, any>, options?: {
|
|
32
|
-
includeAsyncNode?: boolean;
|
|
33
|
-
}): Promise<any>;
|
|
34
|
-
mutate(values: Record<string, any>, options?: {
|
|
35
|
-
includeAsyncNode?: boolean;
|
|
36
|
-
}): Promise<any>;
|
|
37
30
|
save(model: FlowModel, options?: {
|
|
38
31
|
onlyStepParams?: boolean;
|
|
39
32
|
}): Promise<any>;
|
|
@@ -17,6 +17,13 @@ import { DetailsGridModel } from './DetailsGridModel';
|
|
|
17
17
|
* @param idx Form.List 的索引
|
|
18
18
|
*/
|
|
19
19
|
export declare function getValueWithIndex(record: any, fieldPath: string, idx?: string[]): any;
|
|
20
|
+
export declare function getDetailsItemValue(options: {
|
|
21
|
+
record: any;
|
|
22
|
+
currentObject?: any;
|
|
23
|
+
fieldPath: string;
|
|
24
|
+
prefixFieldPath?: string;
|
|
25
|
+
idx?: string[];
|
|
26
|
+
}): any;
|
|
20
27
|
export declare class DetailsItemModel extends DisplayItemModel<{
|
|
21
28
|
parent: DetailsGridModel;
|
|
22
29
|
subModels: {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import type { FlowModel } from '@nocobase/flow-engine';
|
|
10
|
+
import type { HookAPI } from 'antd/es/modal/useModal';
|
|
11
|
+
type PopupBeforeClosePayload = {
|
|
12
|
+
result?: any;
|
|
13
|
+
force?: boolean;
|
|
14
|
+
ignoredDirtyFormModelUids?: string[];
|
|
15
|
+
};
|
|
16
|
+
type PopupViewLike = {
|
|
17
|
+
beforeClose?: (payload: PopupBeforeClosePayload) => Promise<boolean | void> | boolean | void;
|
|
18
|
+
};
|
|
19
|
+
export declare function bindPopupSubTableBeforeClose({ view, model, modal, t, }: {
|
|
20
|
+
view: PopupViewLike;
|
|
21
|
+
model?: FlowModel | null;
|
|
22
|
+
modal: Pick<HookAPI, 'confirm'>;
|
|
23
|
+
t: (key: string) => string;
|
|
24
|
+
}): () => void;
|
|
25
|
+
export {};
|
|
@@ -16,6 +16,16 @@ export declare function buildRecordPickerParentItemContext(ctx: any): {
|
|
|
16
16
|
parentItemResolver: ((subPath: string) => boolean) | undefined;
|
|
17
17
|
};
|
|
18
18
|
export declare function injectRecordPickerPopupContext(model: FlowModel, viewCtx: any, fieldModel?: any): void;
|
|
19
|
+
export declare function buildRecordPickerPopupContextInputArgs(ctx: any, options?: {
|
|
20
|
+
currentItemValue?: any;
|
|
21
|
+
extraInputArgs?: Record<string, any>;
|
|
22
|
+
}): {
|
|
23
|
+
parentItem: ItemChain;
|
|
24
|
+
parentItemMeta: any;
|
|
25
|
+
parentItemResolver: (subPath: string) => boolean;
|
|
26
|
+
currentItemValue: any;
|
|
27
|
+
openerUids: string[];
|
|
28
|
+
};
|
|
19
29
|
export declare function RecordPickerContent({ model, toOne }: {
|
|
20
30
|
model: any;
|
|
21
31
|
toOne?: boolean;
|
|
@@ -46,6 +46,8 @@ export declare function createItemChainMetaFactory(options: {
|
|
|
46
46
|
title: string;
|
|
47
47
|
showIndex?: boolean;
|
|
48
48
|
showParentIndex?: boolean;
|
|
49
|
+
disableValueBranch?: boolean;
|
|
50
|
+
valueBranchDisabledReason?: string;
|
|
49
51
|
collectionAccessor: () => any;
|
|
50
52
|
propertiesAccessor: (ctx: any) => any;
|
|
51
53
|
parentCollectionAccessor?: () => any;
|
|
@@ -54,6 +56,7 @@ export declare function createItemChainMetaFactory(options: {
|
|
|
54
56
|
}): any;
|
|
55
57
|
export declare function createItemChainResolver(options: {
|
|
56
58
|
collectionAccessor: () => any;
|
|
59
|
+
disableValueBranch?: boolean;
|
|
57
60
|
propertiesAccessor?: () => unknown;
|
|
58
61
|
parentCollectionAccessor?: () => any;
|
|
59
62
|
parentPropertiesAccessor?: () => unknown;
|
|
@@ -72,6 +75,8 @@ export type AssociationItemChainContextPropertyOptions = {
|
|
|
72
75
|
title: string;
|
|
73
76
|
showIndex?: boolean;
|
|
74
77
|
showParentIndex?: boolean;
|
|
78
|
+
disableValueBranch?: boolean;
|
|
79
|
+
valueBranchDisabledReason?: string;
|
|
75
80
|
collectionAccessor: () => any;
|
|
76
81
|
propertiesAccessor: (ctx: any) => any;
|
|
77
82
|
resolverPropertiesAccessor?: () => unknown;
|
|
@@ -13,6 +13,7 @@ export interface AssociationFieldNames {
|
|
|
13
13
|
label: string;
|
|
14
14
|
value: string;
|
|
15
15
|
}
|
|
16
|
+
export declare function normalizeAssociationFieldNames(fieldNames: Partial<AssociationFieldNames> | undefined, targetCollection?: any): AssociationFieldNames;
|
|
16
17
|
export type AssociationOption = Record<string, any>;
|
|
17
18
|
export type PopupScrollEvent = Parameters<NonNullable<SelectProps<any>['onPopupScroll']>>[0];
|
|
18
19
|
export declare function buildOpenerUids(ctx: FlowRuntimeContext, inputArgs?: Record<string, unknown>): string[];
|
|
@@ -43,17 +44,5 @@ export interface LabelByFieldProps {
|
|
|
43
44
|
fieldNames: AssociationFieldNames;
|
|
44
45
|
}
|
|
45
46
|
export declare function LabelByField(props: Readonly<LabelByFieldProps>): React.JSX.Element;
|
|
46
|
-
export declare function toSelectValue(record: AssociationOption | AssociationOption[] | string | string[] | number | number[] | undefined, fieldNames: AssociationFieldNames, multiple?: boolean, valueMode?: 'record' | 'value', options?: AssociationOption[]):
|
|
47
|
-
label: React.JSX.Element;
|
|
48
|
-
value: any;
|
|
49
|
-
} | {
|
|
50
|
-
label: string | number | AssociationOption;
|
|
51
|
-
value: string | number | AssociationOption;
|
|
52
|
-
} | ({
|
|
53
|
-
label: React.JSX.Element;
|
|
54
|
-
value: any;
|
|
55
|
-
} | {
|
|
56
|
-
label: string | number | AssociationOption;
|
|
57
|
-
value: string | number | AssociationOption;
|
|
58
|
-
})[];
|
|
47
|
+
export declare function toSelectValue(record: AssociationOption | AssociationOption[] | string | string[] | number | number[] | undefined, fieldNames: AssociationFieldNames, multiple?: boolean, valueMode?: 'record' | 'value', options?: AssociationOption[]): any;
|
|
59
48
|
export declare function resolveOptions(options: AssociationOption[] | undefined, value: AssociationOption | AssociationOption[] | string | string[] | number | number[] | undefined, isMultiple: boolean): AssociationOption[];
|