@nocobase/client 2.0.9 → 2.0.11
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/collection-manager/templates/view.d.ts +11 -11
- package/es/flow/components/code-editor/runjsDiagnostics.d.ts +5 -2
- package/es/flow/components/filter/LinkageFilterItem.d.ts +23 -0
- package/es/flow/models/actions/LinkActionUtils.d.ts +34 -0
- package/es/flow/models/base/CollectionBlockModel.d.ts +1 -0
- package/es/flow/models/blocks/details/DetailsBlockModel.d.ts +1 -0
- package/es/flow/models/blocks/form/EditFormModel.d.ts +1 -0
- package/es/flow/models/blocks/form/submitValues.d.ts +8 -0
- package/es/index.mjs +2747 -2538
- package/es/schema-component/antd/association-field/Table.d.ts +0 -57
- package/lib/index.js +142 -134
- package/lib/locale/en-US.json +1 -0
- package/lib/locale/zh-CN.json +1 -0
- package/package.json +6 -6
|
@@ -18,6 +18,17 @@ export declare class ViewCollectionTemplate extends CollectionTemplate {
|
|
|
18
18
|
};
|
|
19
19
|
divider: boolean;
|
|
20
20
|
configurableProperties: {
|
|
21
|
+
filterTargetKey: {
|
|
22
|
+
title: string;
|
|
23
|
+
type: string;
|
|
24
|
+
description: string;
|
|
25
|
+
'x-decorator': string;
|
|
26
|
+
'x-component': string;
|
|
27
|
+
'x-component-props': {
|
|
28
|
+
multiple: boolean;
|
|
29
|
+
};
|
|
30
|
+
'x-reactions': string[];
|
|
31
|
+
};
|
|
21
32
|
name: any;
|
|
22
33
|
title: any;
|
|
23
34
|
description: any;
|
|
@@ -125,16 +136,5 @@ export declare class ViewCollectionTemplate extends CollectionTemplate {
|
|
|
125
136
|
};
|
|
126
137
|
};
|
|
127
138
|
};
|
|
128
|
-
filterTargetKey: {
|
|
129
|
-
title: string;
|
|
130
|
-
type: string;
|
|
131
|
-
description: string;
|
|
132
|
-
'x-decorator': string;
|
|
133
|
-
'x-component': string;
|
|
134
|
-
'x-component-props': {
|
|
135
|
-
multiple: boolean;
|
|
136
|
-
};
|
|
137
|
-
'x-reactions': string[];
|
|
138
|
-
};
|
|
139
139
|
};
|
|
140
140
|
}
|
|
@@ -37,7 +37,10 @@ export type PreviewRunJSResult = {
|
|
|
37
37
|
success: boolean;
|
|
38
38
|
message: string;
|
|
39
39
|
};
|
|
40
|
+
export type RunJSDiagnosticsOptions = {
|
|
41
|
+
version?: string;
|
|
42
|
+
};
|
|
40
43
|
export declare const MAX_MESSAGE_CHARS = 4000;
|
|
41
44
|
export declare function formatRunJSPreviewMessage(result: DiagnoseRunJSResult): string;
|
|
42
|
-
export declare function diagnoseRunJS(code: string, ctx: FlowContext): Promise<DiagnoseRunJSResult>;
|
|
43
|
-
export declare function previewRunJS(code: string, ctx: FlowContext): Promise<PreviewRunJSResult>;
|
|
45
|
+
export declare function diagnoseRunJS(code: string, ctx: FlowContext, options?: RunJSDiagnosticsOptions): Promise<DiagnoseRunJSResult>;
|
|
46
|
+
export declare function previewRunJS(code: string, ctx: FlowContext, options?: RunJSDiagnosticsOptions): Promise<PreviewRunJSResult>;
|
|
@@ -21,8 +21,31 @@ export interface LinkageFilterItemProps {
|
|
|
21
21
|
/** 向变量树额外注入节点(置于根部) */
|
|
22
22
|
extraMetaTree?: MetaTreeNode[];
|
|
23
23
|
}
|
|
24
|
+
type OperatorMeta = {
|
|
25
|
+
value: string;
|
|
26
|
+
label: string;
|
|
27
|
+
noValue?: boolean;
|
|
28
|
+
schema?: any;
|
|
29
|
+
selected?: boolean;
|
|
30
|
+
};
|
|
31
|
+
type FilterableChild = {
|
|
32
|
+
name: string;
|
|
33
|
+
title?: string;
|
|
34
|
+
schema?: any;
|
|
35
|
+
operators?: OperatorMeta[];
|
|
36
|
+
};
|
|
37
|
+
type FieldInterfaceDef = {
|
|
38
|
+
filterable?: {
|
|
39
|
+
operators?: Array<OperatorMeta & {
|
|
40
|
+
visible?: (meta: MetaTreeNode) => boolean;
|
|
41
|
+
}>;
|
|
42
|
+
children?: FilterableChild[];
|
|
43
|
+
};
|
|
44
|
+
};
|
|
24
45
|
export declare function mergeExtraMetaTreeWithBase(baseMetaTree: MetaTreeNode[] | undefined, extraMetaTree?: MetaTreeNode[]): MetaTreeNode[];
|
|
46
|
+
export declare function enhanceMetaTreeWithFilterableChildren(metaTree: MetaTreeNode[] | undefined, getFieldInterface?: (name: string) => FieldInterfaceDef | undefined): Promise<MetaTreeNode[]>;
|
|
25
47
|
/**
|
|
26
48
|
* LinkageFilterItem:左/右均为可变量输入,适用于联动规则等“前端逻辑”场景
|
|
27
49
|
*/
|
|
28
50
|
export declare const LinkageFilterItem: React.FC<LinkageFilterItemProps>;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
export declare function completeURL(url: string, origin?: string): string;
|
|
10
|
+
export declare function handleLinkNavigation(options: {
|
|
11
|
+
link: string;
|
|
12
|
+
openInNewWindow?: boolean;
|
|
13
|
+
router: {
|
|
14
|
+
navigate: (to: string, options?: {
|
|
15
|
+
replace?: boolean;
|
|
16
|
+
}) => void;
|
|
17
|
+
};
|
|
18
|
+
isExternalLink: boolean;
|
|
19
|
+
setLocationHref?: (url: string) => void;
|
|
20
|
+
openWindow?: (url?: string, target?: string) => Window | null;
|
|
21
|
+
}): void;
|
|
22
|
+
/**
|
|
23
|
+
* 判断 Link 导航后是否需要销毁当前视图
|
|
24
|
+
* @param options 判定参数
|
|
25
|
+
* @param options.openInNewWindow 是否新窗口打开
|
|
26
|
+
* @param options.isExternalLink 是否外部链接
|
|
27
|
+
* @param options.viewType 当前视图类型
|
|
28
|
+
* @returns 是否应销毁当前视图
|
|
29
|
+
*/
|
|
30
|
+
export declare function shouldDestroyViewAfterLinkNavigation(options: {
|
|
31
|
+
openInNewWindow?: boolean;
|
|
32
|
+
isExternalLink: boolean;
|
|
33
|
+
viewType?: string;
|
|
34
|
+
}): boolean;
|
|
@@ -22,6 +22,7 @@ export declare class CollectionBlockModel<T = DefaultStructure> extends DataBloc
|
|
|
22
22
|
private lastSeenDirtyVersion;
|
|
23
23
|
private dirtyRefreshing;
|
|
24
24
|
protected onMount(): void;
|
|
25
|
+
private getDirtyTrackingVersion;
|
|
25
26
|
onActive(forceRefresh?: boolean): void;
|
|
26
27
|
/**
|
|
27
28
|
* 子菜单过滤函数
|
|
@@ -29,6 +29,7 @@ export declare class DetailsBlockModel extends CollectionBlockModel<{
|
|
|
29
29
|
onInit(options: any): void;
|
|
30
30
|
isMultiRecordResource(): boolean;
|
|
31
31
|
getCurrentRecord(): any;
|
|
32
|
+
hasAvailableData(): boolean;
|
|
32
33
|
handlePageChange: (page: number) => Promise<void>;
|
|
33
34
|
refresh(): Promise<void>;
|
|
34
35
|
renderPagination(): React.JSX.Element;
|
|
@@ -16,6 +16,7 @@ export declare class EditFormModel extends FormBlockModel {
|
|
|
16
16
|
createResource(_ctx: FlowModelContext, params: any): SingleRecordResource<unknown> | MultiRecordResource<unknown>;
|
|
17
17
|
isMultiRecordResource(): boolean;
|
|
18
18
|
getCurrentRecord(): any;
|
|
19
|
+
hasAvailableData(): boolean;
|
|
19
20
|
getAclActionName(): string;
|
|
20
21
|
handlePageChange: (page: number) => Promise<void>;
|
|
21
22
|
submitHandler(ctx: any, params: any, cb?: (values?: any, filterByTk?: any) => void): Promise<void>;
|
|
@@ -6,7 +6,15 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
+
import type { NamePath } from './value-runtime/types';
|
|
9
10
|
import type { FormBlockModel } from './FormBlockModel';
|
|
11
|
+
/**
|
|
12
|
+
* 生成提交前的校验字段列表:
|
|
13
|
+
* - 在配置态下可用于绕开“联动隐藏字段”的必填校验;
|
|
14
|
+
* - 仅排除 `model.hidden=true` 的字段路径;
|
|
15
|
+
* - 返回 null 表示无法安全推断,调用方应回退到 `validateFields()` 全量校验。
|
|
16
|
+
*/
|
|
17
|
+
export declare function getValidationNamePathsExcludingHiddenModels(blockModel: FormBlockModel): NamePath[] | null;
|
|
10
18
|
/**
|
|
11
19
|
* 提交前过滤:移除当前表单 block 中被「联动规则隐藏」的字段值(`model.hidden === true`)。
|
|
12
20
|
*
|