@nocobase/client-v2 2.2.0-beta.6 → 2.2.0-beta.8
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/PluginSettingsManager.d.ts +33 -0
- package/es/flow/actions/afterSuccess.d.ts +8 -1
- package/es/flow/actions/index.d.ts +1 -1
- package/es/flow/admin-shell/admin-layout/AdminLayoutSlotModels.d.ts +1 -0
- package/es/flow/models/blocks/form/submitHandler.d.ts +1 -1
- package/es/flow/models/blocks/form/value-runtime/runtime.d.ts +9 -0
- package/es/flow/models/blocks/js-block/JSBlock.d.ts +1 -0
- package/es/flow/models/blocks/table/TableActionsColumnModel.d.ts +1 -0
- package/es/flow/models/blocks/table/TableBlockModel.d.ts +1 -0
- package/es/flow/models/blocks/table/dragSort/dragSortHooks.d.ts +1 -1
- package/es/flow/models/blocks/table/dragSort/dragSortSettings.d.ts +2 -1
- package/es/flow/models/blocks/table/dragSort/dragSortUtils.d.ts +6 -4
- package/es/flow/resolveViewParamsToViewList.d.ts +1 -1
- package/es/index.mjs +105 -89
- package/lib/index.js +106 -90
- package/package.json +7 -7
- package/src/PluginSettingsManager.ts +53 -0
- package/src/__tests__/PluginSettingsManager.test.ts +13 -0
- package/src/__tests__/plugin-manager.test.tsx +44 -2
- package/src/__tests__/settings-center.test.tsx +7 -1
- package/src/collection-manager/field-configure.ts +1 -1
- package/src/collection-manager/interfaces/id.ts +1 -1
- package/src/collection-manager/interfaces/m2m.tsx +2 -2
- package/src/collection-manager/interfaces/m2o.tsx +2 -2
- package/src/collection-manager/interfaces/nanoid.ts +1 -1
- package/src/collection-manager/interfaces/o2m.tsx +2 -2
- package/src/collection-manager/interfaces/obo.tsx +2 -2
- package/src/collection-manager/interfaces/oho.tsx +2 -2
- package/src/collection-manager/interfaces/properties/index.ts +2 -2
- package/src/collection-manager/interfaces/uuid.ts +1 -1
- package/src/flow/__tests__/getKey.test.ts +7 -0
- package/src/flow/__tests__/resolveViewParamsToViewList.test.ts +34 -0
- package/src/flow/actions/__tests__/afterSuccess.test.ts +73 -0
- package/src/flow/actions/__tests__/dataScopeFilter.test.ts +58 -0
- package/src/flow/actions/__tests__/openView.defineProps.route.test.tsx +104 -0
- package/src/flow/actions/afterSuccess.tsx +142 -3
- package/src/flow/actions/dataScopeFilter.ts +10 -0
- package/src/flow/actions/index.ts +1 -1
- package/src/flow/actions/openView.tsx +38 -4
- package/src/flow/admin-shell/BaseLayoutModel.tsx +25 -3
- package/src/flow/admin-shell/BaseLayoutRouteCoordinator.ts +5 -2
- package/src/flow/admin-shell/__tests__/AdminLayoutRouteCoordinator.test.ts +13 -0
- package/src/flow/admin-shell/admin-layout/AdminLayoutComponent.tsx +1 -0
- package/src/flow/admin-shell/admin-layout/AdminLayoutSlotModels.tsx +5 -4
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutModel.test.tsx +82 -0
- package/src/flow/components/FieldAssignRulesEditor.tsx +66 -9
- package/src/flow/components/__tests__/FieldAssignRulesEditor.test.tsx +427 -0
- package/src/flow/components/__tests__/fieldAssignOptions.test.ts +151 -3
- package/src/flow/components/fieldAssignOptions.ts +155 -27
- package/src/flow/getViewDiffAndUpdateHidden.tsx +1 -0
- package/src/flow/models/base/ActionModelCore.tsx +6 -4
- package/src/flow/models/base/__tests__/ActionModelCore.render.test.tsx +37 -0
- package/src/flow/models/blocks/filter-form/fields/FilterFormCustomFieldModel.tsx +1 -1
- package/src/flow/models/blocks/form/FormActionModel.tsx +1 -1
- package/src/flow/models/blocks/form/__tests__/submitHandler.test.ts +54 -1
- package/src/flow/models/blocks/form/submitHandler.ts +17 -3
- package/src/flow/models/blocks/form/value-runtime/__tests__/runtime.test.ts +87 -0
- package/src/flow/models/blocks/form/value-runtime/runtime.ts +91 -0
- package/src/flow/models/blocks/js-block/JSBlock.tsx +223 -2
- package/src/flow/models/blocks/js-block/__tests__/JSBlockModel.test.tsx +150 -0
- package/src/flow/models/blocks/table/TableActionsColumnModel.tsx +35 -12
- package/src/flow/models/blocks/table/TableBlockModel.tsx +25 -14
- package/src/flow/models/blocks/table/__tests__/TableActionsColumnModel.test.tsx +57 -1
- package/src/flow/models/blocks/table/__tests__/TableBlockModel.dragSort.test.ts +127 -0
- package/src/flow/models/blocks/table/__tests__/TableBlockModel.rowSelection.test.tsx +1 -0
- package/src/flow/models/blocks/table/dragSort/dragSortHooks.tsx +28 -17
- package/src/flow/models/blocks/table/dragSort/dragSortSettings.ts +13 -6
- package/src/flow/models/blocks/table/dragSort/dragSortUtils.ts +15 -2
- package/src/flow/resolveViewParamsToViewList.tsx +11 -3
- package/src/nocobase-buildin-plugin/index.tsx +0 -2
- package/src/settings-center/SystemSettingsPage.tsx +1 -2
- package/src/settings-center/plugin-manager/PluginCard.tsx +2 -2
- package/src/settings-center/utils.tsx +0 -6
|
@@ -86,6 +86,7 @@ interface InternalPageItemRecord extends PluginSettingsPageItemOptions {
|
|
|
86
86
|
export declare class PluginSettingsManager<TApp extends BaseApplication<any> = BaseApplication<any>> {
|
|
87
87
|
protected menus: Record<string, InternalMenuItemRecord>;
|
|
88
88
|
protected pages: Record<string, InternalPageItemRecord>;
|
|
89
|
+
protected pluginSettingsLinks: Record<string, string>;
|
|
89
90
|
protected aclSnippets: string[];
|
|
90
91
|
app: TApp;
|
|
91
92
|
private cachedList;
|
|
@@ -165,6 +166,38 @@ export declare class PluginSettingsManager<TApp extends BaseApplication<any> = B
|
|
|
165
166
|
* @returns {boolean} 是否已注册
|
|
166
167
|
*/
|
|
167
168
|
has(name: string): boolean;
|
|
169
|
+
/**
|
|
170
|
+
* 绑定插件管理列表中的 plugin name 到实际 settings 入口。
|
|
171
|
+
*
|
|
172
|
+
* 插件管理列表使用 applicationPlugins.name 判断是否显示 Settings 入口,
|
|
173
|
+
* 但部分插件会把设置页挂到共享菜单或历史路径下。
|
|
174
|
+
*
|
|
175
|
+
* @param pluginName 插件管理列表中的插件名
|
|
176
|
+
* @param settingsName menu 或 page 名称
|
|
177
|
+
* @returns {void}
|
|
178
|
+
*/
|
|
179
|
+
setPluginSettingsLink(pluginName: string, settingsName: string): void;
|
|
180
|
+
/**
|
|
181
|
+
* 获取插件管理列表中的 plugin name 对应的 settings 名称。
|
|
182
|
+
*
|
|
183
|
+
* @param pluginName 插件管理列表中的插件名
|
|
184
|
+
* @returns {string} settings 名称
|
|
185
|
+
*/
|
|
186
|
+
getPluginSettingsName(pluginName: string): string;
|
|
187
|
+
/**
|
|
188
|
+
* 判断插件管理列表中的插件是否有可跳转的 settings 入口。
|
|
189
|
+
*
|
|
190
|
+
* @param pluginName 插件管理列表中的插件名
|
|
191
|
+
* @returns {boolean} 是否已注册 settings 入口
|
|
192
|
+
*/
|
|
193
|
+
hasPluginSettings(pluginName: string): boolean;
|
|
194
|
+
/**
|
|
195
|
+
* 获取插件管理列表中的插件对应的 settings 路径。
|
|
196
|
+
*
|
|
197
|
+
* @param pluginName 插件管理列表中的插件名
|
|
198
|
+
* @returns {string} settings 绝对路径
|
|
199
|
+
*/
|
|
200
|
+
getPluginSettingsRoutePath(pluginName: string): string;
|
|
168
201
|
/**
|
|
169
202
|
* 获取单个 menu 或 page 的只读快照。
|
|
170
203
|
*
|
|
@@ -6,4 +6,11 @@
|
|
|
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
|
-
|
|
9
|
+
import { FlowContext, type FlowRuntimeContext, type MetaTreeNode } from '@nocobase/flow-engine';
|
|
10
|
+
type ResponseRecordPlainStepContext = {
|
|
11
|
+
steps?: FlowRuntimeContext['steps'];
|
|
12
|
+
};
|
|
13
|
+
export declare function getAfterSuccessResponseRecord(ctx: FlowContext | ResponseRecordPlainStepContext): any;
|
|
14
|
+
export declare function getMetaTreeWithResponseRecord(ctx: FlowRuntimeContext): MetaTreeNode[];
|
|
15
|
+
export declare const afterSuccess: import("@nocobase/flow-engine").ActionDefinition<import("@nocobase/flow-engine").FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
16
|
+
export {};
|
|
@@ -6,7 +6,7 @@
|
|
|
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
|
-
export
|
|
9
|
+
export { afterSuccess } from './afterSuccess';
|
|
10
10
|
export * from './confirm';
|
|
11
11
|
export * from './dataScope';
|
|
12
12
|
export * from './openView';
|
|
@@ -6,4 +6,4 @@
|
|
|
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
|
-
export declare function submitHandler(ctx: any, params: any, cb?: (values?: any, filterByTk?: any) => void): Promise<
|
|
9
|
+
export declare function submitHandler(ctx: any, params: any, cb?: (values?: any, filterByTk?: any) => void): Promise<unknown>;
|
|
@@ -12,6 +12,10 @@ import type { FormAssignRuleItem, NamePath, Patch, SetOptions } from './types';
|
|
|
12
12
|
type FormBlockModel = FlowModel & {
|
|
13
13
|
getAclActionName?: () => string;
|
|
14
14
|
};
|
|
15
|
+
export type FormValuePatch = {
|
|
16
|
+
path: NamePath;
|
|
17
|
+
value: unknown;
|
|
18
|
+
};
|
|
15
19
|
export declare class FormValueRuntime {
|
|
16
20
|
private readonly model;
|
|
17
21
|
private readonly getForm;
|
|
@@ -50,6 +54,8 @@ export declare class FormValueRuntime {
|
|
|
50
54
|
syncAssignRules(items: FormAssignRuleItem[]): void;
|
|
51
55
|
get formValues(): any;
|
|
52
56
|
getFormValuesSnapshot(): any;
|
|
57
|
+
getUserEditedValuePatches(): FormValuePatch[];
|
|
58
|
+
getUserEditedValuesSnapshot(): Record<string, unknown>;
|
|
53
59
|
private toMirrorSnapshot;
|
|
54
60
|
canApplyDefaultValuePatch(namePath: NamePath, resolved: any): boolean;
|
|
55
61
|
canApplyOverrideValuePatch(namePath: NamePath): boolean;
|
|
@@ -111,6 +117,9 @@ export declare class FormValueRuntime {
|
|
|
111
117
|
private isExplicit;
|
|
112
118
|
private findExplicitHit;
|
|
113
119
|
private findUserEditedHit;
|
|
120
|
+
private findLatestWriteMeta;
|
|
121
|
+
private isCurrentUserEditedPath;
|
|
122
|
+
private omitNonUserDescendantValues;
|
|
114
123
|
private isDescendantPathKey;
|
|
115
124
|
}
|
|
116
125
|
export {};
|
|
@@ -10,6 +10,7 @@ import React from 'react';
|
|
|
10
10
|
import { BlockModel } from '../../base';
|
|
11
11
|
export declare class JSBlockModel extends BlockModel {
|
|
12
12
|
private _mountedOnce;
|
|
13
|
+
get showBlockCard(): boolean;
|
|
13
14
|
renderComponent(): React.ReactNode;
|
|
14
15
|
render(): React.JSX.Element;
|
|
15
16
|
protected onMount(): void;
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import { TableCustomColumnModel } from './TableCustomColumnModel';
|
|
11
|
+
export declare const tableRowActionsClassName: string;
|
|
11
12
|
export declare class TableActionsColumnModel extends TableCustomColumnModel {
|
|
12
13
|
afterAddAsSubModel(): Promise<void>;
|
|
13
14
|
getColumnProps(): {
|
|
@@ -64,6 +64,7 @@ export declare class TableBlockModel extends CollectionBlockModel<TableBlockMode
|
|
|
64
64
|
isRowSelectionEnabled(): boolean;
|
|
65
65
|
isShowIndexEnabled(): boolean;
|
|
66
66
|
getRecordIndex(record: Record<string, unknown>, index: number): string | number;
|
|
67
|
+
getDragSortFieldName(): string | undefined;
|
|
67
68
|
getLeftAuxiliaryColumn(): {
|
|
68
69
|
key: string;
|
|
69
70
|
width: number;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import type { TableBlockModel } from '../TableBlockModel';
|
|
11
|
-
export declare function useDragSortBodyWrapper(model: TableBlockModel, dataSourceRef: React.MutableRefObject<any>, getRowKeyFunc: (record: any) => string | number): (props: any) => React.JSX.Element;
|
|
11
|
+
export declare function useDragSortBodyWrapper(model: TableBlockModel, dataSourceRef: React.MutableRefObject<any>, getRowKeyFunc: (record: any) => string | number, dragSortFieldName?: string): (props: any) => React.JSX.Element;
|
|
12
12
|
export declare function useDragSortRowComponent(dragSort: boolean): React.FC<{
|
|
13
13
|
[key: string]: any;
|
|
14
14
|
rowIndex?: number;
|
|
@@ -15,7 +15,7 @@ export declare const dragSortSettings: {
|
|
|
15
15
|
defaultParams: {
|
|
16
16
|
dragSort: boolean;
|
|
17
17
|
};
|
|
18
|
-
handler(ctx: any, params: any):
|
|
18
|
+
handler(ctx: any, params: any): void;
|
|
19
19
|
};
|
|
20
20
|
export declare const dragSortBySettings: {
|
|
21
21
|
title: string;
|
|
@@ -29,6 +29,7 @@ export declare const dragSortBySettings: {
|
|
|
29
29
|
value: any;
|
|
30
30
|
disabled: any;
|
|
31
31
|
}[];
|
|
32
|
+
allowClear: boolean;
|
|
32
33
|
placeholder: any;
|
|
33
34
|
};
|
|
34
35
|
};
|
|
@@ -6,25 +6,27 @@
|
|
|
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 { Collection } from '@nocobase/flow-engine';
|
|
9
|
+
import type { Collection, CollectionField } from '@nocobase/flow-engine';
|
|
10
10
|
/**
|
|
11
11
|
* 从 collection 中获取所有 sort 类型的字段
|
|
12
12
|
* @param collection - 集合对象
|
|
13
13
|
* @returns 排序字段数组
|
|
14
14
|
*/
|
|
15
|
-
export declare function getSortFields(collection: Collection | undefined):
|
|
15
|
+
export declare function getSortFields(collection: Collection | undefined): CollectionField[];
|
|
16
|
+
export declare function getSortField(collection: Collection | undefined, fieldName?: string | null): CollectionField | undefined;
|
|
17
|
+
export declare function hasSortField(collection: Collection | undefined, fieldName?: string | null): boolean;
|
|
16
18
|
/**
|
|
17
19
|
* 获取 collection 中第一个可用的 sort 字段
|
|
18
20
|
* @param collection - 集合对象
|
|
19
21
|
* @returns 第一个排序字段,如果没有则返回 undefined
|
|
20
22
|
*/
|
|
21
|
-
export declare function getFirstSortField(collection: Collection | undefined):
|
|
23
|
+
export declare function getFirstSortField(collection: Collection | undefined): CollectionField;
|
|
22
24
|
/**
|
|
23
25
|
* 将 sort 字段转换为选项格式
|
|
24
26
|
* @param fields - 字段数组
|
|
25
27
|
* @returns 选项数组
|
|
26
28
|
*/
|
|
27
|
-
export declare function convertFieldsToOptions(fields:
|
|
29
|
+
export declare function convertFieldsToOptions(fields: CollectionField[]): {
|
|
28
30
|
label: any;
|
|
29
31
|
value: any;
|
|
30
32
|
disabled: any;
|
|
@@ -17,4 +17,4 @@ export interface ViewItem {
|
|
|
17
17
|
index: number;
|
|
18
18
|
}
|
|
19
19
|
export declare function resolveViewParamsToViewList(flowEngine: FlowEngine, viewParams: ViewParam[], routeModel: FlowModel): ViewItem[];
|
|
20
|
-
export declare function updateViewListHidden(viewItems: ViewItem[]): void;
|
|
20
|
+
export declare function updateViewListHidden(viewItems: ViewItem[], isMobileLayout?: boolean): void;
|