@nocobase/client-v2 2.1.0-beta.37 → 2.1.0-beta.40
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/Application.d.ts +7 -0
- package/es/BaseApplication.d.ts +3 -0
- package/es/RouterManager.d.ts +1 -0
- package/es/collection-field-interface/CollectionFieldInterface.d.ts +51 -15
- package/es/collection-field-interface/CollectionFieldInterfaceManager.d.ts +82 -3
- package/es/collection-manager/field-configure.d.ts +80 -0
- package/es/collection-manager/field-validation.d.ts +43 -0
- package/es/collection-manager/filter-operators/index.d.ts +46 -0
- package/es/collection-manager/filter-operators/operators.d.ts +30 -0
- package/es/collection-manager/interfaces/checkbox.d.ts +1 -41
- package/es/collection-manager/interfaces/checkboxGroup.d.ts +12 -44
- package/es/collection-manager/interfaces/collection.d.ts +12 -51
- package/es/collection-manager/interfaces/color.d.ts +1 -16
- package/es/collection-manager/interfaces/createdAt.d.ts +1 -44
- package/es/collection-manager/interfaces/createdBy.d.ts +0 -4
- package/es/collection-manager/interfaces/dateOnly.d.ts +7 -44
- package/es/collection-manager/interfaces/datetime.d.ts +1 -44
- package/es/collection-manager/interfaces/datetimeNoTz.d.ts +1 -44
- package/es/collection-manager/interfaces/email.d.ts +1 -29
- package/es/collection-manager/interfaces/id.d.ts +1 -16
- package/es/collection-manager/interfaces/index.d.ts +2 -3
- package/es/collection-manager/interfaces/input.d.ts +1 -102
- package/es/collection-manager/interfaces/integer.d.ts +1 -95
- package/es/collection-manager/interfaces/json.d.ts +16 -7
- package/es/collection-manager/interfaces/m2m.d.ts +11 -19
- package/es/collection-manager/interfaces/m2o.d.ts +11 -19
- package/es/collection-manager/interfaces/markdown.d.ts +1 -63
- package/es/collection-manager/interfaces/multipleSelect.d.ts +12 -44
- package/es/collection-manager/interfaces/nanoid.d.ts +1 -34
- package/es/collection-manager/interfaces/number.d.ts +1 -87
- package/es/collection-manager/interfaces/o2m.d.ts +12 -24
- package/es/collection-manager/interfaces/obo.d.ts +207 -0
- package/es/collection-manager/interfaces/oho.d.ts +207 -0
- package/es/collection-manager/interfaces/password.d.ts +1 -56
- package/es/collection-manager/interfaces/percent.d.ts +1 -84
- package/es/collection-manager/interfaces/phone.d.ts +1 -25
- package/es/collection-manager/interfaces/properties/index.d.ts +0 -28
- package/es/collection-manager/interfaces/radioGroup.d.ts +1 -29
- package/es/collection-manager/interfaces/richText.d.ts +1 -63
- package/es/collection-manager/interfaces/select.d.ts +12 -44
- package/es/collection-manager/interfaces/snowflake-id.d.ts +1 -34
- package/es/collection-manager/interfaces/tableoid.d.ts +1 -10
- package/es/collection-manager/interfaces/textarea.d.ts +1 -51
- package/es/collection-manager/interfaces/time.d.ts +1 -16
- package/es/collection-manager/interfaces/types.d.ts +3 -12
- package/es/collection-manager/interfaces/unixTimestamp.d.ts +1 -44
- package/es/collection-manager/interfaces/updatedAt.d.ts +1 -44
- package/es/collection-manager/interfaces/updatedBy.d.ts +0 -4
- package/es/collection-manager/interfaces/url.d.ts +1 -20
- package/es/collection-manager/interfaces/uuid.d.ts +1 -34
- package/es/collection-manager/template-fields.d.ts +53 -0
- package/es/components/KeepAlive.d.ts +22 -0
- package/es/components/RouterBridge.d.ts +9 -0
- package/es/components/form/VariableInput.d.ts +53 -2
- package/es/components/form/filter/CollectionFilter.d.ts +9 -1
- package/es/components/form/filter/CollectionFilterItem.d.ts +10 -2
- package/es/data-source/ExtendCollectionsProvider.d.ts +28 -2
- package/es/flow/FlowPage.d.ts +2 -1
- package/es/flow/admin-shell/AdminLayoutRouteCoordinator.d.ts +8 -40
- package/es/flow/admin-shell/BaseLayoutModel.d.ts +89 -0
- package/es/flow/admin-shell/BaseLayoutRouteCoordinator.d.ts +74 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.d.ts +12 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutModel.d.ts +7 -92
- package/es/flow/admin-shell/admin-layout/index.d.ts +2 -0
- package/es/flow/admin-shell/useAdminLayoutRoutePage.d.ts +2 -2
- package/es/flow/admin-shell/useLayoutRoutePage.d.ts +23 -0
- package/es/flow/components/FlowRoute.d.ts +10 -1
- package/es/flow/components/filter/useFilterOptions.d.ts +13 -1
- package/es/flow/index.d.ts +4 -0
- package/es/flow/models/base/PageModel/PageModel.d.ts +3 -1
- package/es/flow/models/blocks/assign-form/assignFieldValuesFlow.d.ts +84 -0
- package/es/flow/models/blocks/assign-form/index.d.ts +1 -0
- package/es/flow/models/blocks/form/FormActionGroupModel.d.ts +1 -0
- package/es/flow/models/blocks/form/FormActionModel.d.ts +9 -2
- package/es/flow/models/blocks/table/TableBlockModel.d.ts +10 -0
- package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/index.d.ts +1 -1
- package/es/index.d.ts +5 -0
- package/es/index.mjs +470 -460
- package/es/layout-manager/LayoutContentRoute.d.ts +14 -0
- package/es/layout-manager/LayoutManager.d.ts +22 -0
- package/es/layout-manager/LayoutRoute.d.ts +14 -0
- package/es/layout-manager/index.d.ts +13 -0
- package/es/layout-manager/types.d.ts +20 -0
- package/es/layout-manager/utils.d.ts +14 -0
- package/es/settings-center/index.d.ts +1 -1
- package/es/settings-center/plugin-manager/BulkEnableButton.d.ts +15 -0
- package/es/settings-center/plugin-manager/PluginCard.d.ts +15 -0
- package/es/settings-center/plugin-manager/PluginDetail.d.ts +16 -0
- package/es/settings-center/{PluginManagerPage.d.ts → plugin-manager/index.d.ts} +1 -7
- package/es/settings-center/plugin-manager/types.d.ts +34 -0
- package/lib/index.js +470 -460
- package/package.json +8 -7
- package/src/Application.tsx +51 -12
- package/src/BaseApplication.tsx +6 -0
- package/src/PluginSettingsManager.ts +1 -1
- package/src/RouterManager.tsx +17 -1
- package/src/__tests__/PluginSettingsManager.test.ts +41 -2
- package/src/__tests__/app.test.tsx +8 -1
- package/src/__tests__/globalDeps.test.ts +1 -0
- package/src/__tests__/nocobase-buildin-plugin-auth.test.tsx +45 -2
- package/src/__tests__/plugin-manager.test.tsx +177 -0
- package/src/__tests__/settings-center.test.tsx +24 -2
- package/src/collection-field-interface/CollectionFieldInterface.ts +71 -77
- package/src/collection-field-interface/CollectionFieldInterfaceManager.ts +201 -4
- package/src/collection-manager/field-configure.ts +548 -0
- package/src/collection-manager/field-validation.ts +195 -0
- package/src/collection-manager/filter-operators/index.ts +176 -0
- package/src/collection-manager/{interfaces/properties → filter-operators}/operators.ts +24 -13
- package/src/collection-manager/interfaces/checkbox.ts +2 -9
- package/src/collection-manager/interfaces/checkboxGroup.ts +2 -10
- package/src/collection-manager/interfaces/collection.ts +2 -15
- package/src/collection-manager/interfaces/color.ts +2 -2
- package/src/collection-manager/interfaces/createdAt.ts +2 -2
- package/src/collection-manager/interfaces/createdBy.ts +1 -12
- package/src/collection-manager/interfaces/dateOnly.ts +8 -2
- package/src/collection-manager/interfaces/datetime.ts +2 -2
- package/src/collection-manager/interfaces/datetimeNoTz.ts +2 -2
- package/src/collection-manager/interfaces/email.ts +2 -9
- package/src/collection-manager/interfaces/id.ts +1 -2
- package/src/collection-manager/interfaces/index.ts +2 -3
- package/src/collection-manager/interfaces/input.ts +2 -133
- package/src/collection-manager/interfaces/integer.ts +2 -71
- package/src/collection-manager/interfaces/json.tsx +17 -11
- package/src/collection-manager/interfaces/m2m.tsx +0 -21
- package/src/collection-manager/interfaces/m2o.tsx +0 -22
- package/src/collection-manager/interfaces/markdown.ts +2 -51
- package/src/collection-manager/interfaces/multipleSelect.ts +2 -14
- package/src/collection-manager/interfaces/nanoid.ts +2 -2
- package/src/collection-manager/interfaces/number.ts +2 -85
- package/src/collection-manager/interfaces/o2m.tsx +1 -22
- package/src/collection-manager/interfaces/obo.tsx +145 -0
- package/src/collection-manager/interfaces/oho.tsx +145 -0
- package/src/collection-manager/interfaces/password.ts +2 -44
- package/src/collection-manager/interfaces/percent.ts +2 -74
- package/src/collection-manager/interfaces/phone.ts +2 -2
- package/src/collection-manager/interfaces/properties/index.ts +0 -133
- package/src/collection-manager/interfaces/radioGroup.ts +2 -2
- package/src/collection-manager/interfaces/richText.ts +2 -51
- package/src/collection-manager/interfaces/select.ts +2 -14
- package/src/collection-manager/interfaces/snowflake-id.ts +2 -2
- package/src/collection-manager/interfaces/tableoid.ts +1 -2
- package/src/collection-manager/interfaces/textarea.ts +2 -51
- package/src/collection-manager/interfaces/time.ts +2 -2
- package/src/collection-manager/interfaces/types.ts +4 -12
- package/src/collection-manager/interfaces/unixTimestamp.tsx +2 -2
- package/src/collection-manager/interfaces/updatedAt.ts +2 -2
- package/src/collection-manager/interfaces/updatedBy.ts +1 -12
- package/src/collection-manager/interfaces/url.ts +2 -4
- package/src/collection-manager/interfaces/uuid.ts +2 -2
- package/src/collection-manager/template-fields.ts +109 -0
- package/src/components/KeepAlive.tsx +131 -0
- package/src/components/README.md +1 -0
- package/src/components/README.zh-CN.md +1 -0
- package/src/components/RouterBridge.tsx +28 -4
- package/src/components/__tests__/KeepAlive.test.tsx +63 -0
- package/src/components/__tests__/RouterBridge.test.tsx +27 -0
- package/src/components/form/VariableInput.tsx +101 -28
- package/src/components/form/__tests__/VariableInput.test.ts +85 -0
- package/src/components/form/filter/CollectionFilter.tsx +11 -1
- package/src/components/form/filter/CollectionFilterItem.tsx +12 -4
- package/src/components/form/filter/__tests__/CollectionFilterItem.test.tsx +42 -0
- package/src/components/form/filter/useFilterActionProps.ts +7 -4
- package/src/data-source/ExtendCollectionsProvider.tsx +94 -20
- package/src/data-source/__tests__/ExtendCollectionsProvider.test.tsx +264 -0
- package/src/flow/FlowPage.tsx +35 -7
- package/src/flow/__tests__/FlowPage.test.tsx +79 -0
- package/src/flow/__tests__/FlowRoute.test.tsx +529 -2
- package/src/flow/actions/__tests__/linkageRules.subFormSetFieldProps.test.ts +191 -0
- package/src/flow/actions/__tests__/openView.subModelKey.test.tsx +33 -0
- package/src/flow/actions/aclCheck.tsx +4 -0
- package/src/flow/actions/aclCheckRefresh.tsx +4 -0
- package/src/flow/actions/dateTimeFormat.tsx +12 -8
- package/src/flow/actions/linkageRules.tsx +122 -0
- package/src/flow/actions/openView.tsx +28 -4
- package/src/flow/admin-shell/AdminLayoutRouteCoordinator.ts +11 -329
- package/src/flow/admin-shell/BaseLayoutModel.tsx +455 -0
- package/src/flow/admin-shell/BaseLayoutRouteCoordinator.ts +502 -0
- package/src/flow/admin-shell/__tests__/AdminLayoutRouteCoordinator.test.ts +547 -3
- package/src/flow/admin-shell/admin-layout/AdminLayoutComponent.tsx +4 -4
- package/src/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.tsx +160 -0
- package/src/flow/admin-shell/admin-layout/AdminLayoutMenuModels.tsx +0 -12
- package/src/flow/admin-shell/admin-layout/AdminLayoutModel.tsx +28 -201
- package/src/flow/admin-shell/admin-layout/AdminLayoutSlotModels.tsx +11 -2
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutMenuModels.test.ts +1 -26
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutModel.test.tsx +149 -27
- package/src/flow/admin-shell/admin-layout/index.ts +2 -0
- package/src/flow/admin-shell/useAdminLayoutRoutePage.ts +10 -26
- package/src/flow/admin-shell/useLayoutRoutePage.ts +61 -0
- package/src/flow/components/AdminLayout.tsx +4 -154
- package/src/flow/components/FlowRoute.tsx +105 -15
- package/src/flow/components/filter/useFilterOptions.ts +27 -5
- package/src/flow/index.ts +4 -0
- package/src/flow/models/actions/UpdateRecordActionModel.tsx +14 -95
- package/src/flow/models/actions/UpdateRecordActionUtils.ts +4 -7
- package/src/flow/models/actions/__tests__/AssignFormRefill.test.ts +26 -1
- package/src/flow/models/base/ActionModel.tsx +8 -1
- package/src/flow/models/base/PageModel/PageModel.tsx +51 -18
- package/src/flow/models/base/PageModel/RootPageModel.tsx +6 -13
- package/src/flow/models/base/PageModel/__tests__/PageModel.test.ts +102 -1
- package/src/flow/models/base/RouteModel.tsx +1 -1
- package/src/flow/models/blocks/assign-form/AssignFormItemModel.tsx +63 -2
- package/src/flow/models/blocks/assign-form/assignFieldValuesFlow.tsx +206 -0
- package/src/flow/models/blocks/assign-form/index.ts +1 -0
- package/src/flow/models/blocks/form/FormActionGroupModel.tsx +14 -0
- package/src/flow/models/blocks/form/FormActionModel.tsx +30 -3
- package/src/flow/models/blocks/form/FormItemModel.tsx +8 -1
- package/src/flow/models/blocks/form/__tests__/FormActionGroupModel.test.ts +46 -0
- package/src/flow/models/blocks/form/__tests__/submitHandler.test.ts +71 -0
- package/src/flow/models/blocks/form/submitHandler.ts +8 -1
- package/src/flow/models/blocks/form/submitValues.ts +4 -1
- package/src/flow/models/blocks/table/TableBlockModel.tsx +118 -16
- package/src/flow/models/blocks/table/__tests__/TableBlockModel.rowSelection.test.tsx +114 -0
- package/src/flow/models/fields/AssociationFieldModel/SubFormFieldModel.tsx +7 -1
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableField.tsx +1 -1
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/index.tsx +6 -5
- package/src/flow/models/fields/ClickableFieldModel.tsx +9 -1
- package/src/flow/models/fields/CollectionSelectorFieldModel.tsx +8 -2
- package/src/flow/models/fields/DisplayEnumFieldModel.tsx +8 -2
- package/src/flow/models/fields/DisplayTimeFieldModel.tsx +1 -1
- package/src/flow/models/fields/TimeFieldModel.tsx +1 -1
- package/src/flow/models/fields/__tests__/TimeFieldModel.test.tsx +61 -0
- package/src/flow/models/fields/mobile-components/MobileDatePicker.tsx +19 -3
- package/src/flow/models/fields/mobile-components/__tests__/MobileDatePicker.test.tsx +94 -0
- package/src/flow/models/topbar/TopbarActionModel.tsx +1 -1
- package/src/flow/utils/__tests__/dateTimeFormat.test.ts +91 -0
- package/src/index.ts +5 -0
- package/src/layout-manager/LayoutContentRoute.tsx +90 -0
- package/src/layout-manager/LayoutManager.tsx +185 -0
- package/src/layout-manager/LayoutRoute.tsx +138 -0
- package/src/layout-manager/__tests__/LayoutManager.test.tsx +335 -0
- package/src/layout-manager/__tests__/LayoutRoute.test.tsx +473 -0
- package/src/layout-manager/index.ts +14 -0
- package/src/layout-manager/types.ts +22 -0
- package/src/layout-manager/utils.ts +37 -0
- package/src/nocobase-buildin-plugin/index.tsx +56 -48
- package/src/settings-center/index.ts +1 -1
- package/src/settings-center/plugin-manager/BulkEnableButton.tsx +111 -0
- package/src/settings-center/plugin-manager/PluginCard.tsx +270 -0
- package/src/settings-center/plugin-manager/PluginDetail.tsx +195 -0
- package/src/settings-center/plugin-manager/index.tsx +254 -0
- package/src/settings-center/plugin-manager/types.ts +35 -0
- package/src/settings-center/utils.tsx +8 -1
- package/src/theme/__tests__/globalStyles.test.ts +24 -0
- package/src/theme/globalStyles.ts +10 -0
- package/src/utils/globalDeps.ts +2 -0
- package/es/collection-manager/interfaces/linkTo.d.ts +0 -90
- package/es/collection-manager/interfaces/o2o.d.ts +0 -621
- package/es/collection-manager/interfaces/properties/operators.d.ts +0 -294
- package/es/collection-manager/interfaces/subTable.d.ts +0 -172
- package/src/collection-manager/interfaces/linkTo.ts +0 -120
- package/src/collection-manager/interfaces/o2o.tsx +0 -561
- package/src/collection-manager/interfaces/subTable.ts +0 -218
- package/src/settings-center/PluginManagerPage.tsx +0 -162
|
@@ -7,22 +7,18 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import { type FlowEngine, FlowModel } from '@nocobase/flow-engine';
|
|
10
|
+
import React from 'react';
|
|
10
11
|
import type { NocoBaseDesktopRoute } from '../../../flow-compat';
|
|
11
|
-
import {
|
|
12
|
+
import { AdminLayoutRouteCoordinator } from '../AdminLayoutRouteCoordinator';
|
|
13
|
+
import { BaseLayoutModel, type BaseLayoutStructure, type GetLayoutModelOptions } from '../BaseLayoutModel';
|
|
12
14
|
import { type AdminLayoutMenuItemModel } from './AdminLayoutMenuModels';
|
|
13
15
|
import { type AdminLayoutMenuRouteOptions } from './AdminLayoutMenuUtils';
|
|
14
|
-
|
|
15
|
-
export type AdminLayoutStructure = {
|
|
16
|
+
export type AdminLayoutStructure = BaseLayoutStructure & {
|
|
16
17
|
subModels: {
|
|
17
18
|
menuItems?: AdminLayoutMenuItemModel[];
|
|
18
19
|
};
|
|
19
20
|
};
|
|
20
|
-
type GetAdminLayoutModelOptions<TModel extends FlowModel = AdminLayoutModel> =
|
|
21
|
-
required?: boolean;
|
|
22
|
-
create?: boolean;
|
|
23
|
-
props?: any;
|
|
24
|
-
use?: new (...args: any[]) => TModel;
|
|
25
|
-
};
|
|
21
|
+
type GetAdminLayoutModelOptions<TModel extends FlowModel = AdminLayoutModel> = GetLayoutModelOptions<TModel>;
|
|
26
22
|
/**
|
|
27
23
|
* Admin Layout 的纯运行时 host model。
|
|
28
24
|
*
|
|
@@ -35,14 +31,8 @@ type GetAdminLayoutModelOptions<TModel extends FlowModel = AdminLayoutModel> = {
|
|
|
35
31
|
* model.syncMenuRoutes(routes);
|
|
36
32
|
* ```
|
|
37
33
|
*/
|
|
38
|
-
export declare class AdminLayoutModel extends
|
|
39
|
-
isMobileLayout: boolean;
|
|
34
|
+
export declare class AdminLayoutModel extends BaseLayoutModel<AdminLayoutStructure> {
|
|
40
35
|
menuRouteRefreshVersion: number;
|
|
41
|
-
private routeCoordinator?;
|
|
42
|
-
private routeDisposer?;
|
|
43
|
-
private activePageUid;
|
|
44
|
-
private layoutContentElement;
|
|
45
|
-
private readonly routePageMetaMap;
|
|
46
36
|
constructor(options: any);
|
|
47
37
|
/**
|
|
48
38
|
* 通知 Layout 重新生成 ProLayout 菜单路由。
|
|
@@ -50,29 +40,6 @@ export declare class AdminLayoutModel extends FlowModel<AdminLayoutStructure> {
|
|
|
50
40
|
* @returns {void}
|
|
51
41
|
*/
|
|
52
42
|
refreshMenuRouteTree(): void;
|
|
53
|
-
/**
|
|
54
|
-
* 注册页面运行时信息。
|
|
55
|
-
*
|
|
56
|
-
* @param {string} pageUid 页面 UID
|
|
57
|
-
* @param {RoutePageMeta} meta 页面运行时元数据
|
|
58
|
-
* @returns {FlowModel} 对应的页面模型
|
|
59
|
-
*/
|
|
60
|
-
registerRoutePage(pageUid: string, meta: RoutePageMeta): FlowModel<import("@nocobase/flow-engine").DefaultStructure>;
|
|
61
|
-
/**
|
|
62
|
-
* 更新页面运行时信息。
|
|
63
|
-
*
|
|
64
|
-
* @param {string} pageUid 页面 UID
|
|
65
|
-
* @param {Partial<RoutePageMeta>} meta 待更新的页面元数据
|
|
66
|
-
* @returns {void}
|
|
67
|
-
*/
|
|
68
|
-
updateRoutePage(pageUid: string, meta: Partial<RoutePageMeta>): void;
|
|
69
|
-
/**
|
|
70
|
-
* 注销页面运行时信息。
|
|
71
|
-
*
|
|
72
|
-
* @param {string} pageUid 页面 UID
|
|
73
|
-
* @returns {void}
|
|
74
|
-
*/
|
|
75
|
-
unregisterRoutePage(pageUid: string): void;
|
|
76
43
|
/**
|
|
77
44
|
* 使用当前可访问菜单路由刷新 Layout 菜单树。
|
|
78
45
|
*
|
|
@@ -90,59 +57,7 @@ export declare class AdminLayoutModel extends FlowModel<AdminLayoutStructure> {
|
|
|
90
57
|
path: string;
|
|
91
58
|
children: import("./AdminLayoutMenuUtils").AdminLayoutMenuNode[];
|
|
92
59
|
};
|
|
93
|
-
|
|
94
|
-
* 设置布局内容容器元素。
|
|
95
|
-
*
|
|
96
|
-
* @param {HTMLElement | null} element 布局内容容器
|
|
97
|
-
* @returns {void}
|
|
98
|
-
*/
|
|
99
|
-
setLayoutContentElement(element: HTMLElement | null): void;
|
|
100
|
-
/**
|
|
101
|
-
* 设置是否为移动端布局。
|
|
102
|
-
*
|
|
103
|
-
* @param {boolean} isMobileLayout 是否为移动端布局
|
|
104
|
-
* @returns {void}
|
|
105
|
-
*/
|
|
106
|
-
setIsMobileLayout(isMobileLayout: boolean): void;
|
|
107
|
-
protected onMount(): void;
|
|
108
|
-
protected onUnmount(): void;
|
|
109
|
-
/**
|
|
110
|
-
* 安装运行时上下文属性。
|
|
111
|
-
*
|
|
112
|
-
* @returns {void}
|
|
113
|
-
*/
|
|
114
|
-
private setupContextBindings;
|
|
115
|
-
/**
|
|
116
|
-
* 安装路由同步 reaction。
|
|
117
|
-
*
|
|
118
|
-
* @returns {void}
|
|
119
|
-
*/
|
|
120
|
-
private setupRouteReaction;
|
|
121
|
-
/**
|
|
122
|
-
* 释放运行时状态。
|
|
123
|
-
*
|
|
124
|
-
* @returns {void}
|
|
125
|
-
*/
|
|
126
|
-
private teardownRuntime;
|
|
127
|
-
/**
|
|
128
|
-
* 获取当前激活页面对应的路由对象。
|
|
129
|
-
*
|
|
130
|
-
* @returns {any} 当前激活页面对应的路由对象
|
|
131
|
-
*/
|
|
132
|
-
private getCurrentRouteByActivePage;
|
|
133
|
-
/**
|
|
134
|
-
* 根据页面 UID 获取路由对象。
|
|
135
|
-
*
|
|
136
|
-
* @param {string} pageUid 页面 UID
|
|
137
|
-
* @returns {any} 路由对象
|
|
138
|
-
*/
|
|
139
|
-
private getCurrentRouteByPageUid;
|
|
140
|
-
/**
|
|
141
|
-
* 懒加载页面路由协调器。
|
|
142
|
-
*
|
|
143
|
-
* @returns {AdminLayoutRouteCoordinator} 路由协调器实例
|
|
144
|
-
*/
|
|
145
|
-
private getCoordinator;
|
|
60
|
+
protected createRouteCoordinator(): AdminLayoutRouteCoordinator;
|
|
146
61
|
render(): React.JSX.Element;
|
|
147
62
|
}
|
|
148
63
|
/**
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export * from './AdminLayoutComponent';
|
|
10
10
|
export * from './AdminLayoutModel';
|
|
11
|
+
export * from '../BaseLayoutModel';
|
|
12
|
+
export * from '../BaseLayoutRouteCoordinator';
|
|
11
13
|
export * from './AdminLayoutSlotModels';
|
|
12
14
|
export * from './AdminLayoutMenuModels';
|
|
13
15
|
export * from './AdminLayoutMenuFlowUtils';
|
|
@@ -6,14 +6,14 @@
|
|
|
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
|
-
/// <reference types="react" />
|
|
10
9
|
import type { FlowEngine } from '@nocobase/flow-engine';
|
|
10
|
+
import type { RefObject } from 'react';
|
|
11
11
|
import { type AdminLayoutModel } from './admin-layout/AdminLayoutModel';
|
|
12
12
|
type UseAdminLayoutRoutePageOptions = {
|
|
13
13
|
flowEngine: FlowEngine;
|
|
14
14
|
pageUid: string;
|
|
15
15
|
refreshDesktopRoutes?: () => Promise<unknown>;
|
|
16
|
-
layoutContentRef:
|
|
16
|
+
layoutContentRef: RefObject<HTMLDivElement>;
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
19
|
* 把 FlowRoute 页面的生命周期桥接到 AdminLayout host model。
|
|
@@ -0,0 +1,23 @@
|
|
|
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 { FlowEngine } from '@nocobase/flow-engine';
|
|
10
|
+
import { type RefObject } from 'react';
|
|
11
|
+
import type { BaseLayoutModel } from './BaseLayoutModel';
|
|
12
|
+
export type UseLayoutRoutePageOptions<TModel extends BaseLayoutModel = BaseLayoutModel> = {
|
|
13
|
+
flowEngine: FlowEngine;
|
|
14
|
+
pageUid: string;
|
|
15
|
+
active?: boolean;
|
|
16
|
+
refreshDesktopRoutes?: () => Promise<unknown>;
|
|
17
|
+
layoutContentRef: RefObject<HTMLElement>;
|
|
18
|
+
getLayoutModel: (flowEngine: FlowEngine) => TModel | undefined;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* 把 FlowRoute 页面的生命周期桥接到指定 Layout host model。
|
|
22
|
+
*/
|
|
23
|
+
export declare function useLayoutRoutePage<TModel extends BaseLayoutModel = BaseLayoutModel>(options: UseLayoutRoutePageOptions<TModel>): TModel;
|
|
@@ -6,7 +6,16 @@
|
|
|
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 FlowEngine } from '@nocobase/flow-engine';
|
|
9
10
|
import React from 'react';
|
|
11
|
+
import { type BaseLayoutModel } from '../admin-shell/BaseLayoutModel';
|
|
12
|
+
export type LegacyPageBehavior = 'redirect' | 'notFound' | 'bridge';
|
|
13
|
+
export type FlowRouteProps = {
|
|
14
|
+
pageUid?: string;
|
|
15
|
+
active?: boolean;
|
|
16
|
+
getLayoutModel?: (flowEngine: FlowEngine) => BaseLayoutModel | undefined;
|
|
17
|
+
legacyPageBehavior?: LegacyPageBehavior;
|
|
18
|
+
};
|
|
10
19
|
/**
|
|
11
20
|
* 管理后台动态页面路由组件。
|
|
12
21
|
*
|
|
@@ -22,7 +31,7 @@ import React from 'react';
|
|
|
22
31
|
* @throws {Error} 当缺少 `route.params.name` 时抛出异常
|
|
23
32
|
*/
|
|
24
33
|
declare const FlowRoute: {
|
|
25
|
-
(): React.JSX.Element;
|
|
34
|
+
(props?: FlowRouteProps): React.JSX.Element;
|
|
26
35
|
displayName: string;
|
|
27
36
|
};
|
|
28
37
|
export default FlowRoute;
|
|
@@ -36,10 +36,22 @@ export type FilterOption = {
|
|
|
36
36
|
};
|
|
37
37
|
export interface UseFilterOptionsArgs {
|
|
38
38
|
/**
|
|
39
|
+
* **Preferred way to restrict fields**, alongside `nonfilterableFieldNames`.
|
|
40
|
+
*
|
|
39
41
|
* Whitelist of root-level field names to expose. Empty/undefined means "all filterable fields". The whitelist applies only at depth 1 — nested fields under an allowed association field are always included, matching the legacy v1 `Filter.Action` behaviour.
|
|
40
42
|
*/
|
|
41
43
|
filterableFieldNames?: string[];
|
|
42
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* **Preferred way to restrict fields**, alongside `filterableFieldNames`.
|
|
46
|
+
*
|
|
47
|
+
* Blacklist of root-level field names to drop. Mirrors v1's `nonfilterable: [...]` schema prop on `Filter.Action`. Applies at depth 1 only, same as the whitelist. When both `filterableFieldNames` and `nonfilterableFieldNames` are provided, both apply: the final field set is `(whitelist or all) minus blacklist`.
|
|
48
|
+
*/
|
|
49
|
+
nonfilterableFieldNames?: string[];
|
|
50
|
+
/**
|
|
51
|
+
* Bypass the `filterableFieldNames` whitelist (mirrors v1 `noIgnore`).
|
|
52
|
+
*
|
|
53
|
+
* Legacy escape hatch from v1 schemas — prefer adjusting `filterableFieldNames` / `nonfilterableFieldNames` instead. Kept only for parity with existing v1 schemas that already set `noIgnore`.
|
|
54
|
+
*/
|
|
43
55
|
noIgnore?: boolean;
|
|
44
56
|
/** Translator used for field/operator labels. Defaults to identity. */
|
|
45
57
|
t?: (key: string) => string;
|
package/es/flow/index.d.ts
CHANGED
|
@@ -23,7 +23,11 @@ export * from './utils';
|
|
|
23
23
|
export * from './actions';
|
|
24
24
|
export * from './system-settings';
|
|
25
25
|
export * from './admin-shell/admin-layout';
|
|
26
|
+
export * from './admin-shell/BaseLayoutModel';
|
|
27
|
+
export * from './admin-shell/BaseLayoutRouteCoordinator';
|
|
26
28
|
export * from './admin-shell/AdminLayoutRouteCoordinator';
|
|
29
|
+
export * from './admin-shell/useLayoutRoutePage';
|
|
30
|
+
export * from './admin-shell/useAdminLayoutRoutePage';
|
|
27
31
|
export * from '../settings-center';
|
|
28
32
|
export { openViewFlow } from './flows/openViewFlow';
|
|
29
33
|
export { editMarkdownFlow } from './flows/editMarkdownFlow';
|
|
@@ -32,9 +32,11 @@ export declare class PageModel extends FlowModel<PageModelStructure> {
|
|
|
32
32
|
private getEnableTabs;
|
|
33
33
|
private getActiveTabKey;
|
|
34
34
|
private scheduleActiveLifecycleRefresh;
|
|
35
|
+
activateCurrentTab(forceRefresh?: boolean): void;
|
|
36
|
+
deactivateCurrentTab(): void;
|
|
35
37
|
onMount(): void;
|
|
36
38
|
protected onUnmount(): void;
|
|
37
|
-
invokeTabModelLifecycleMethod(tabActiveKey: string, method: 'onActive' | 'onInactive', forceRefresh?: boolean): void;
|
|
39
|
+
invokeTabModelLifecycleMethod(tabActiveKey: string | undefined, method: 'onActive' | 'onInactive', forceRefresh?: boolean): void;
|
|
38
40
|
/**
|
|
39
41
|
* Resolve configured document title template and update browser tab title.
|
|
40
42
|
* Priority:
|
|
@@ -0,0 +1,84 @@
|
|
|
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 FlowModelContext } from '@nocobase/flow-engine';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { AssignFormModel } from './AssignFormModel';
|
|
12
|
+
export declare const ASSIGN_FIELD_VALUES_STEP_KEY = "assignFieldValues";
|
|
13
|
+
type AssignedValues = Record<string, unknown>;
|
|
14
|
+
type AssignFieldValuesCollection = {
|
|
15
|
+
dataSourceKey?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
};
|
|
18
|
+
type AssignFieldValuesContext = FlowModelContext & {
|
|
19
|
+
collection?: AssignFieldValuesCollection;
|
|
20
|
+
flowSettingsEnabled?: boolean;
|
|
21
|
+
};
|
|
22
|
+
type AssignFieldValuesModel = {
|
|
23
|
+
uid: string;
|
|
24
|
+
assignFormUid?: string;
|
|
25
|
+
context?: AssignFieldValuesContext;
|
|
26
|
+
getStepParams?: (flowKey: string, stepKey: string) => {
|
|
27
|
+
assignedValues?: AssignedValues;
|
|
28
|
+
} | undefined;
|
|
29
|
+
setStepParams?: (flowKey: string, stepKey: string, params: {
|
|
30
|
+
assignedValues: AssignedValues;
|
|
31
|
+
}) => void;
|
|
32
|
+
};
|
|
33
|
+
type AssignFieldValuesStepOptions = {
|
|
34
|
+
settingsFlowKey: string;
|
|
35
|
+
title?: string;
|
|
36
|
+
tipComponent?: React.ComponentType;
|
|
37
|
+
validateBeforeSave?: boolean;
|
|
38
|
+
clearRecordContext?: boolean;
|
|
39
|
+
};
|
|
40
|
+
export declare function createAssignFormSubModelOptions(ctx: AssignFieldValuesContext): {
|
|
41
|
+
async: boolean;
|
|
42
|
+
use: string;
|
|
43
|
+
stepParams: {
|
|
44
|
+
resourceSettings: {
|
|
45
|
+
init: {
|
|
46
|
+
dataSourceKey: string;
|
|
47
|
+
collectionName: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export declare function getAssignFieldValuesDefaultParams(ctx: {
|
|
53
|
+
model: Pick<AssignFieldValuesModel, 'getStepParams'>;
|
|
54
|
+
}, settingsFlowKey: string): {
|
|
55
|
+
assignedValues: AssignedValues;
|
|
56
|
+
};
|
|
57
|
+
export declare function resolveAssignFieldValues(ctx: {
|
|
58
|
+
message?: {
|
|
59
|
+
error?: (message: string) => void;
|
|
60
|
+
};
|
|
61
|
+
t?: (message: string) => string;
|
|
62
|
+
}, rawAssignedValues: unknown, logName?: string): Promise<AssignedValues | null>;
|
|
63
|
+
export declare function mergeAssignFieldValues<T extends Record<string, unknown>>(values: T, assignedValues?: AssignedValues | null): T;
|
|
64
|
+
export declare function createAssignFieldValuesStep(options: AssignFieldValuesStepOptions): {
|
|
65
|
+
title: string;
|
|
66
|
+
uiSchema(): {
|
|
67
|
+
tip: {
|
|
68
|
+
'x-decorator': string;
|
|
69
|
+
'x-component': React.ComponentType<{}>;
|
|
70
|
+
};
|
|
71
|
+
editor: {
|
|
72
|
+
'x-decorator': string;
|
|
73
|
+
'x-component': () => React.JSX.Element;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
beforeParamsSave(ctx: {
|
|
77
|
+
model: AssignFieldValuesModel;
|
|
78
|
+
engine: {
|
|
79
|
+
getModel?: (uid: string, fromRoot?: boolean) => AssignFormModel | undefined;
|
|
80
|
+
};
|
|
81
|
+
}): Promise<void>;
|
|
82
|
+
handler(): void;
|
|
83
|
+
};
|
|
84
|
+
export {};
|
|
@@ -10,4 +10,5 @@ import { ActionGroupModel } from '../../base/ActionGroupModel';
|
|
|
10
10
|
import { FormActionModel } from './FormActionModel';
|
|
11
11
|
export declare class FormActionGroupModel extends ActionGroupModel {
|
|
12
12
|
static baseClass: typeof FormActionModel;
|
|
13
|
+
static defineChildren(ctx: any): Promise<any[]>;
|
|
13
14
|
}
|
|
@@ -6,12 +6,19 @@
|
|
|
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 { DefaultStructure } from '@nocobase/flow-engine';
|
|
9
10
|
import { ButtonProps } from 'antd';
|
|
10
11
|
import { AxiosRequestConfig } from 'axios';
|
|
11
12
|
import { ActionModel } from '../../base/ActionModelCore';
|
|
12
|
-
|
|
13
|
+
import { AssignFormModel } from '../assign-form/AssignFormModel';
|
|
14
|
+
export declare class FormActionModel<T extends DefaultStructure = DefaultStructure> extends ActionModel<T> {
|
|
13
15
|
}
|
|
14
|
-
export declare class FormSubmitActionModel extends FormActionModel
|
|
16
|
+
export declare class FormSubmitActionModel extends FormActionModel<{
|
|
17
|
+
subModels: {
|
|
18
|
+
assignForm: AssignFormModel;
|
|
19
|
+
};
|
|
20
|
+
}> {
|
|
21
|
+
assignFormUid?: string;
|
|
15
22
|
defaultProps: ButtonProps;
|
|
16
23
|
/**
|
|
17
24
|
* 简化设置保存请求配置的方式
|
|
@@ -61,8 +61,18 @@ export declare class TableBlockModel extends CollectionBlockModel<TableBlockMode
|
|
|
61
61
|
cell: React.MemoExoticComponent<import("@formily/reactive-react").ReactFC<Omit<any, "ref">>>;
|
|
62
62
|
};
|
|
63
63
|
};
|
|
64
|
+
isRowSelectionEnabled(): boolean;
|
|
65
|
+
isShowIndexEnabled(): boolean;
|
|
66
|
+
getRecordIndex(record: Record<string, unknown>, index: number): string | number;
|
|
67
|
+
getLeftAuxiliaryColumn(): {
|
|
68
|
+
key: string;
|
|
69
|
+
width: number;
|
|
70
|
+
align: "center";
|
|
71
|
+
render: (_value: unknown, record: Record<string, unknown>, index: number) => React.JSX.Element;
|
|
72
|
+
};
|
|
64
73
|
renderCell: (checked: any, record: any, index: any, originNode: any) => any;
|
|
65
74
|
renderConfigureActions(): React.JSX.Element;
|
|
75
|
+
shouldRenderAction(action: ActionModel, isConfigMode: boolean): boolean;
|
|
66
76
|
pagination(): import("antd").PaginationProps;
|
|
67
77
|
renderComponent(): React.JSX.Element;
|
|
68
78
|
}
|
|
@@ -8,7 +8,7 @@ export declare class SubTableFieldModel extends AssociationFieldModel {
|
|
|
8
8
|
updateAssociation: boolean;
|
|
9
9
|
setCurrentPage: any;
|
|
10
10
|
currentPageSize: any;
|
|
11
|
-
getCurrentValue
|
|
11
|
+
getCurrentValue(): any[];
|
|
12
12
|
get collection(): any;
|
|
13
13
|
getColumns(): any;
|
|
14
14
|
render(): React.JSX.Element;
|
package/es/index.d.ts
CHANGED
|
@@ -24,12 +24,17 @@ export * from './WebSocketClient';
|
|
|
24
24
|
export * from './RouterManager';
|
|
25
25
|
export * from './PluginManager';
|
|
26
26
|
export * from './PluginSettingsManager';
|
|
27
|
+
export * from './layout-manager';
|
|
27
28
|
export * from './hooks';
|
|
28
29
|
export { default as languageCodes } from './locale/languageCodes';
|
|
29
30
|
export * from './nocobase-buildin-plugin';
|
|
30
31
|
export * from './collection-field-interface/CollectionFieldInterface';
|
|
31
32
|
export * from './collection-field-interface/CollectionFieldInterfaceManager';
|
|
33
|
+
export * from './collection-manager/field-configure';
|
|
34
|
+
export * from './collection-manager/field-validation';
|
|
35
|
+
export * from './collection-manager/filter-operators';
|
|
32
36
|
export * from './collection-manager/interfaces';
|
|
37
|
+
export * from './collection-manager/template-fields';
|
|
33
38
|
export * from './data-source';
|
|
34
39
|
export * from './flow';
|
|
35
40
|
export { DEFAULT_DATA_SOURCE_KEY, isTitleField, isTitleFieldInterface } from './flow-compat';
|