@nocobase/client-v2 2.2.0-beta.1 → 2.2.0-beta.10
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/BaseApplication.d.ts +3 -0
- package/es/PluginSettingsManager.d.ts +33 -0
- package/es/RouteRepository.d.ts +29 -6
- package/es/RouterManager.d.ts +15 -0
- package/es/authRedirect.d.ts +1 -0
- package/es/collection-field-interface/CollectionFieldInterface.d.ts +1 -0
- package/es/collection-field-interface/CollectionFieldInterfaceManager.d.ts +1 -0
- package/es/components/form/JsonTextArea.d.ts +2 -1
- package/es/components/form/VariableJsonTextArea.d.ts +19 -0
- package/es/components/form/index.d.ts +1 -0
- package/es/components/index.d.ts +1 -0
- package/es/entry-actions/EntryActionManager.d.ts +24 -0
- package/es/entry-actions/index.d.ts +9 -0
- package/es/flow/actions/afterSuccess.d.ts +8 -1
- package/es/flow/actions/index.d.ts +1 -1
- package/es/flow/admin-shell/BaseLayoutModel.d.ts +6 -0
- package/es/flow/admin-shell/BaseLayoutRouteCoordinator.d.ts +7 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.d.ts +2 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutMenuFlowUtils.d.ts +2 -1
- package/es/flow/admin-shell/admin-layout/AdminLayoutMenuModels.d.ts +2 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutMenuUtils.d.ts +3 -2
- package/es/flow/admin-shell/admin-layout/AdminLayoutSlotModels.d.ts +5 -0
- package/es/flow/admin-shell/admin-layout/AppListRender.d.ts +2 -1
- package/es/flow/admin-shell/admin-layout/AppSwitcherActionPanelModel.d.ts +24 -0
- package/es/flow/admin-shell/admin-layout/index.d.ts +1 -0
- package/es/flow/admin-shell/admin-layout/resolveAdminRouteRuntimeTarget.d.ts +6 -0
- package/es/flow/admin-shell/admin-layout/useApplications.d.ts +7 -2
- package/es/flow/components/FieldAssignRulesEditor.d.ts +3 -1
- package/es/flow/models/base/ActionModelCore.d.ts +2 -0
- package/es/flow/models/base/GridModel.d.ts +1 -1
- package/es/flow/models/blocks/filter-form/FilterFormBlockModel.d.ts +5 -0
- package/es/flow/models/blocks/form/FormBlockModel.d.ts +4 -0
- package/es/flow/models/blocks/form/QuickEditFormModel.d.ts +17 -2
- package/es/flow/models/blocks/form/submitHandler.d.ts +1 -1
- package/es/flow/models/blocks/form/value-runtime/rules.d.ts +21 -0
- package/es/flow/models/blocks/form/value-runtime/runtime.d.ts +30 -0
- package/es/flow/models/blocks/form/value-runtime/types.d.ts +2 -2
- 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/models/fields/AssociationFieldModel/RecordSelectFieldModel.d.ts +2 -0
- package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.d.ts +6 -0
- package/es/flow/resolveViewParamsToViewList.d.ts +1 -1
- package/es/flow/routeTransientInputArgs.d.ts +14 -0
- package/es/flow/utils/dataScopeRowSnapshot.d.ts +59 -0
- package/es/flow/utils/dateTimeDisplayProps.d.ts +49 -0
- package/es/flow/utils/formValueDeps.d.ts +32 -0
- package/es/flow-compat/FieldValidation.d.ts +2 -1
- package/es/index.d.ts +4 -1
- package/es/index.mjs +305 -157
- package/es/utils/markdownSanitize.d.ts +11 -0
- package/lib/index.js +305 -157
- package/package.json +7 -7
- package/src/BaseApplication.tsx +6 -0
- package/src/PluginSettingsManager.ts +53 -0
- package/src/RouteRepository.ts +151 -24
- package/src/RouterManager.tsx +142 -1
- package/src/__tests__/PluginSettingsManager.test.ts +13 -0
- package/src/__tests__/RouteRepository.test.ts +239 -0
- package/src/__tests__/RouterManager.test.ts +125 -0
- package/src/__tests__/authRedirect.test.ts +17 -0
- package/src/__tests__/exports.test.ts +16 -0
- package/src/__tests__/nocobase-buildin-plugin-auth.test.tsx +199 -0
- package/src/__tests__/plugin-manager.test.tsx +44 -2
- package/src/__tests__/settings-center.test.tsx +40 -1
- package/src/authRedirect.ts +38 -0
- package/src/collection-field-interface/CollectionFieldInterface.ts +1 -0
- package/src/collection-field-interface/CollectionFieldInterfaceManager.ts +1 -0
- 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/components/AppComponents.tsx +19 -3
- package/src/components/form/JsonTextArea.tsx +21 -11
- package/src/components/form/VariableJsonTextArea.tsx +175 -0
- package/src/components/form/__tests__/JsonTextArea.test.tsx +43 -0
- package/src/components/form/__tests__/VariableJsonTextArea.test.tsx +86 -0
- package/src/components/form/index.tsx +1 -0
- package/src/components/index.ts +1 -0
- package/src/entry-actions/EntryActionManager.ts +76 -0
- package/src/entry-actions/index.ts +10 -0
- package/src/flow/FlowPage.tsx +38 -3
- package/src/flow/__tests__/FlowPage.test.tsx +201 -27
- package/src/flow/__tests__/FlowRoute.test.tsx +1088 -105
- 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 +120 -0
- package/src/flow/actions/__tests__/dataScopeFormValueClear.test.ts +1022 -0
- package/src/flow/actions/__tests__/fieldLinkageRules.scopeDepth.test.ts +150 -1
- package/src/flow/actions/__tests__/linkageAssignField.legacy.test.ts +135 -0
- package/src/flow/actions/__tests__/linkageRules.hiddenSync.restore.test.ts +19 -5
- package/src/flow/actions/__tests__/linkageRules.subFormSetFieldProps.test.ts +92 -0
- package/src/flow/actions/__tests__/openView.defineProps.route.test.tsx +164 -0
- package/src/flow/actions/__tests__/subFormFieldLinkageRules.inputArgs.test.ts +2 -2
- package/src/flow/actions/afterSuccess.tsx +142 -3
- package/src/flow/actions/customVariable.tsx +1 -2
- package/src/flow/actions/dataScopeFilter.ts +20 -1
- package/src/flow/actions/dateTimeFormat.tsx +42 -28
- package/src/flow/actions/index.ts +1 -1
- package/src/flow/actions/linkageRules.tsx +123 -35
- package/src/flow/actions/linkageRulesFormValueRefresh.ts +22 -130
- package/src/flow/actions/openView.tsx +59 -5
- package/src/flow/actions/runjs.tsx +2 -14
- package/src/flow/actions/validation.tsx +62 -30
- package/src/flow/admin-shell/BaseLayoutModel.tsx +149 -3
- package/src/flow/admin-shell/BaseLayoutRouteCoordinator.ts +187 -42
- package/src/flow/admin-shell/__tests__/AdminLayoutRouteCoordinator.test.ts +1020 -110
- package/src/flow/admin-shell/admin-layout/AdminLayoutComponent.tsx +74 -13
- package/src/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.test.tsx +486 -0
- package/src/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.tsx +64 -8
- package/src/flow/admin-shell/admin-layout/AdminLayoutMenuFlowUtils.ts +5 -3
- package/src/flow/admin-shell/admin-layout/AdminLayoutMenuModels.tsx +61 -9
- package/src/flow/admin-shell/admin-layout/AdminLayoutMenuUtils.tsx +71 -8
- package/src/flow/admin-shell/admin-layout/AdminLayoutModel.tsx +1 -1
- package/src/flow/admin-shell/admin-layout/AdminLayoutSlotModels.tsx +23 -9
- package/src/flow/admin-shell/admin-layout/AppListRender.tsx +13 -2
- package/src/flow/admin-shell/admin-layout/AppSwitcherActionPanelModel.tsx +289 -0
- package/src/flow/admin-shell/admin-layout/HelpLite.tsx +1 -3
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutComponent.test.tsx +188 -0
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutMenuModels.test.ts +99 -0
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutModel.test.tsx +518 -2
- package/src/flow/admin-shell/admin-layout/__tests__/TopbarActionsBar.test.tsx +214 -2
- package/src/flow/admin-shell/admin-layout/index.ts +1 -0
- package/src/flow/admin-shell/admin-layout/resolveAdminRouteRuntimeTarget.test.ts +20 -0
- package/src/flow/admin-shell/admin-layout/resolveAdminRouteRuntimeTarget.ts +33 -5
- package/src/flow/admin-shell/admin-layout/useApplications.tsx +81 -12
- package/src/flow/common/Markdown/Display.tsx +14 -3
- package/src/flow/common/Markdown/Edit.tsx +19 -7
- package/src/flow/components/DefaultValue.tsx +1 -2
- package/src/flow/components/DynamicFlowsIcon.tsx +447 -126
- package/src/flow/components/FieldAssignRulesEditor.tsx +128 -21
- package/src/flow/components/FieldAssignValueInput.tsx +15 -11
- package/src/flow/components/FlowRoute.tsx +186 -25
- package/src/flow/components/__tests__/DynamicFlowsIcon.test.tsx +148 -2
- package/src/flow/components/__tests__/FieldAssignRulesEditor.test.tsx +508 -4
- package/src/flow/components/__tests__/FieldAssignValueInput.context.test.tsx +134 -0
- package/src/flow/components/__tests__/fieldAssignOptions.test.ts +151 -3
- package/src/flow/components/code-editor/__tests__/useCodeRunner.test.tsx +2 -17
- package/src/flow/components/code-editor/hooks/useCodeRunner.ts +2 -14
- package/src/flow/components/code-editor/runjsDiagnostics.ts +8 -45
- package/src/flow/components/fieldAssignOptions.ts +155 -27
- package/src/flow/flows/editMarkdownFlow.tsx +1 -1
- package/src/flow/getViewDiffAndUpdateHidden.tsx +1 -0
- package/src/flow/index.ts +1 -1
- package/src/flow/internal/components/Markdown/util.ts +2 -1
- package/src/flow/internal/utils/operatorSchemaHelper.ts +15 -1
- package/src/flow/models/actions/JSActionModel.tsx +2 -7
- package/src/flow/models/actions/JSCollectionActionModel.tsx +2 -7
- package/src/flow/models/actions/JSItemActionModel.tsx +2 -7
- package/src/flow/models/actions/JSRecordActionModel.tsx +2 -7
- package/src/flow/models/base/ActionModel.tsx +21 -8
- package/src/flow/models/base/ActionModelCore.tsx +11 -4
- package/src/flow/models/base/GridModel.tsx +38 -7
- package/src/flow/models/base/PageModel/PageModel.tsx +4 -1
- package/src/flow/models/base/PageModel/__tests__/PageModel.test.ts +28 -4
- package/src/flow/models/base/__tests__/ActionModel.test.ts +83 -0
- package/src/flow/models/base/__tests__/ActionModelCore.render.test.tsx +37 -0
- package/src/flow/models/base/__tests__/GridModel.dragSnapshotContainer.test.ts +239 -1
- package/src/flow/models/base/__tests__/transformRowsToSingleColumn.test.ts +48 -0
- package/src/flow/models/blocks/filter-form/FilterFormBlockModel.tsx +32 -3
- package/src/flow/models/blocks/filter-form/FilterFormItemModel.tsx +27 -12
- package/src/flow/models/blocks/filter-form/FilterFormJSActionModel.tsx +2 -7
- package/src/flow/models/blocks/filter-form/__tests__/FilterFormItemModel.defineChildren.test.ts +36 -0
- package/src/flow/models/blocks/filter-form/__tests__/defaultValues.wiring.test.ts +111 -0
- package/src/flow/models/blocks/filter-form/fields/FilterFormCustomFieldModel.tsx +1 -1
- package/src/flow/models/blocks/filter-manager/flow-actions/__tests__/customizeFilterRender.test.tsx +56 -1
- package/src/flow/models/blocks/form/EditFormModel.tsx +1 -0
- package/src/flow/models/blocks/form/FormActionModel.tsx +1 -1
- package/src/flow/models/blocks/form/FormBlockModel.tsx +7 -0
- package/src/flow/models/blocks/form/JSFormActionModel.tsx +2 -7
- package/src/flow/models/blocks/form/QuickEditFormModel.tsx +189 -36
- package/src/flow/models/blocks/form/__tests__/FormBlockModel.test.tsx +17 -0
- package/src/flow/models/blocks/form/__tests__/QuickEditFormModel.quickEdit.test.ts +350 -2
- 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 +940 -75
- package/src/flow/models/blocks/form/value-runtime/rules.ts +445 -13
- package/src/flow/models/blocks/form/value-runtime/runtime.ts +348 -13
- package/src/flow/models/blocks/form/value-runtime/types.ts +2 -2
- package/src/flow/models/blocks/js-block/JSBlock.tsx +225 -9
- package/src/flow/models/blocks/js-block/__tests__/JSBlockModel.test.tsx +150 -0
- package/src/flow/models/blocks/table/JSColumnModel.tsx +1 -9
- package/src/flow/models/blocks/table/TableActionsColumnModel.tsx +36 -13
- package/src/flow/models/blocks/table/TableBlockModel.tsx +38 -17
- package/src/flow/models/blocks/table/TableColumnModel.tsx +42 -5
- package/src/flow/models/blocks/table/__tests__/TableActionsColumnModel.test.tsx +111 -1
- package/src/flow/models/blocks/table/__tests__/TableBlockModel.dragSort.test.ts +127 -0
- package/src/flow/models/blocks/table/__tests__/TableBlockModel.mobileSettingsButtons.test.tsx +78 -0
- package/src/flow/models/blocks/table/__tests__/TableBlockModel.rowSelection.test.tsx +1 -0
- package/src/flow/models/blocks/table/__tests__/TableColumnModel.test.tsx +210 -1
- 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/models/fields/AssociationFieldModel/AssociationFieldModel.tsx +1 -1
- package/src/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableFieldModel.tsx +30 -6
- package/src/flow/models/fields/AssociationFieldModel/RecordSelectFieldModel.tsx +61 -17
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.tsx +141 -19
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableField.tsx +13 -1
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/__tests__/SubTableColumnModel.rowRecord.test.ts +197 -0
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/__tests__/SubTableFieldModel.reset.test.ts +180 -0
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/index.tsx +6 -4
- package/src/flow/models/fields/AssociationFieldModel/__tests__/AssociationFieldModel.updateAssociation.test.ts +72 -0
- package/src/flow/models/fields/AssociationFieldModel/__tests__/RecordPickerFieldModel.itemContext.test.ts +23 -0
- package/src/flow/models/fields/ClickableFieldModel.tsx +5 -0
- package/src/flow/models/fields/DisplayDateTimeFieldModel.tsx +29 -1
- package/src/flow/models/fields/InputFieldModel.tsx +40 -2
- package/src/flow/models/fields/JSEditableFieldModel.tsx +2 -11
- package/src/flow/models/fields/JSFieldModel.tsx +2 -7
- package/src/flow/models/fields/JSItemModel.tsx +2 -14
- package/src/flow/models/fields/SelectFieldModel.tsx +6 -4
- package/src/flow/models/fields/TextareaFieldModel.tsx +72 -3
- package/src/flow/models/fields/__tests__/DisplayDateTimeFieldModel.test.tsx +96 -0
- package/src/flow/models/fields/__tests__/InputFieldModel.test.tsx +117 -1
- package/src/flow/models/fields/__tests__/SelectFieldModel.test.tsx +43 -0
- package/src/flow/models/fields/__tests__/TextareaFieldModel.test.tsx +131 -0
- package/src/flow/models/fields/mobile-components/MobileLazySelect.tsx +20 -10
- package/src/flow/models/fields/mobile-components/MobileSelect.tsx +24 -12
- package/src/flow/models/topbar/TopbarActionModel.tsx +168 -10
- package/src/flow/resolveViewParamsToViewList.tsx +11 -3
- package/src/flow/routeTransientInputArgs.ts +27 -0
- package/src/flow/utils/__tests__/dateTimeFormat.test.ts +300 -0
- package/src/flow/utils/dataScopeFormValueClear.ts +218 -81
- package/src/flow/utils/dataScopeRowSnapshot.ts +616 -0
- package/src/flow/utils/dateTimeDisplayProps.ts +135 -0
- package/src/flow/utils/formValueDeps.ts +170 -0
- package/src/flow-compat/FieldValidation.tsx +122 -60
- package/src/flow-compat/Popover.tsx +43 -4
- package/src/flow-compat/__tests__/Popover.test.tsx +34 -0
- package/src/index.ts +10 -1
- package/src/layout-manager/__tests__/LayoutRoute.test.tsx +41 -1
- package/src/nocobase-buildin-plugin/index.tsx +51 -15
- package/src/settings-center/AdminSettingsLayout.tsx +10 -2
- package/src/settings-center/SystemSettingsPage.tsx +1 -2
- package/src/settings-center/plugin-manager/PluginCard.tsx +2 -2
- package/src/settings-center/plugin-manager/index.tsx +3 -0
- package/src/settings-center/utils.tsx +0 -6
- package/src/utils/markdownSanitize.ts +88 -0
package/es/BaseApplication.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import type { i18n as i18next } from 'i18next';
|
|
|
12
12
|
import React, { ReactElement, ReactNode } from 'react';
|
|
13
13
|
import type { AppListProps } from '@ant-design/pro-layout/es/components/AppsLogoComponents/types';
|
|
14
14
|
import { AIManager } from './ai';
|
|
15
|
+
import { EntryActionManager } from './entry-actions';
|
|
15
16
|
import { SystemSettingsSource } from './flow/system-settings';
|
|
16
17
|
import { LayoutManager } from './layout-manager/LayoutManager';
|
|
17
18
|
import type { PluginClass, PluginManager, PluginType } from './PluginManager';
|
|
@@ -75,6 +76,7 @@ export declare abstract class BaseApplication<TOptions extends BaseApplicationOp
|
|
|
75
76
|
pluginManager: TPluginManager;
|
|
76
77
|
pluginSettingsManager: TPluginSettingsManager;
|
|
77
78
|
layoutManager: LayoutManager<this>;
|
|
79
|
+
entryActionManager: EntryActionManager;
|
|
78
80
|
aiManager: AIManager;
|
|
79
81
|
devDynamicImport?: DevDynamicImport;
|
|
80
82
|
requirejs: RequireJS;
|
|
@@ -141,6 +143,7 @@ export declare abstract class BaseApplication<TOptions extends BaseApplicationOp
|
|
|
141
143
|
setMaintaining(maintaining: boolean): void;
|
|
142
144
|
getOptions(): TOptions;
|
|
143
145
|
getName(): string;
|
|
146
|
+
getCdnUrl(): any;
|
|
144
147
|
getPublicPath(): string;
|
|
145
148
|
getApiUrl(pathname?: string): string;
|
|
146
149
|
getRouteUrl(pathname: string): string;
|
|
@@ -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
|
*
|
package/es/RouteRepository.d.ts
CHANGED
|
@@ -11,6 +11,9 @@ import type { NocoBaseDesktopRoute } from './flow-compat';
|
|
|
11
11
|
type RouteSubscriber = () => void;
|
|
12
12
|
type RouteCreateValues = Partial<NocoBaseDesktopRoute>;
|
|
13
13
|
type RouteUpdateValues = Partial<NocoBaseDesktopRoute>;
|
|
14
|
+
type RouteLayoutLike = {
|
|
15
|
+
uid?: unknown;
|
|
16
|
+
};
|
|
14
17
|
type RouteMutationOptions = {
|
|
15
18
|
refreshAfterMutation?: boolean;
|
|
16
19
|
};
|
|
@@ -28,18 +31,22 @@ export declare class RouteRepository {
|
|
|
28
31
|
api?: APIClient;
|
|
29
32
|
};
|
|
30
33
|
routes: NocoBaseDesktopRoute[];
|
|
31
|
-
protected subscribers:
|
|
32
|
-
protected
|
|
33
|
-
|
|
34
|
+
protected subscribers: Map<RouteSubscriber, string>;
|
|
35
|
+
protected accessibleLoadingPromises: Map<string, Promise<NocoBaseDesktopRoute[]>>;
|
|
36
|
+
private layoutActivations;
|
|
37
|
+
private routeCaches;
|
|
38
|
+
private refreshRequestIds;
|
|
39
|
+
private notifiedLayoutUid;
|
|
34
40
|
constructor(ctx: {
|
|
35
41
|
api?: APIClient;
|
|
36
42
|
});
|
|
43
|
+
activateLayout(layout?: RouteLayoutLike): () => void;
|
|
37
44
|
/**
|
|
38
45
|
* 同步当前可访问桌面路由,并通知订阅方刷新。
|
|
39
46
|
*
|
|
40
47
|
* @param routes 最新的桌面路由树
|
|
41
48
|
*/
|
|
42
|
-
setRoutes(routes: NocoBaseDesktopRoute[]): void;
|
|
49
|
+
setRoutes(routes: NocoBaseDesktopRoute[], layoutUid?: string): void;
|
|
43
50
|
/**
|
|
44
51
|
* 读取当前缓存的桌面路由树。
|
|
45
52
|
*
|
|
@@ -58,12 +65,13 @@ export declare class RouteRepository {
|
|
|
58
65
|
* @returns 最新的路由数组
|
|
59
66
|
*/
|
|
60
67
|
refreshAccessible(): Promise<any>;
|
|
68
|
+
private refreshAccessibleByLayout;
|
|
61
69
|
/**
|
|
62
70
|
* 确保当前用户可访问的桌面路由至少完成一次初始化加载。
|
|
63
71
|
*
|
|
64
72
|
* @returns 当前可访问的路由数组
|
|
65
73
|
*/
|
|
66
|
-
ensureAccessibleLoaded(): Promise<
|
|
74
|
+
ensureAccessibleLoaded(): Promise<any>;
|
|
67
75
|
/**
|
|
68
76
|
* 订阅路由缓存变化,用于驱动 React 上下文刷新。
|
|
69
77
|
*
|
|
@@ -116,9 +124,24 @@ export declare class RouteRepository {
|
|
|
116
124
|
* @returns 匹配到的路由节点
|
|
117
125
|
*/
|
|
118
126
|
getRouteBySchemaUid(schemaUid: string): NocoBaseDesktopRoute | undefined;
|
|
127
|
+
/**
|
|
128
|
+
* 通过路由 id 反查对应路由节点。
|
|
129
|
+
*
|
|
130
|
+
* @param routeId 桌面路由主键
|
|
131
|
+
* @returns 匹配到的路由节点
|
|
132
|
+
*/
|
|
133
|
+
getRouteById(routeId: string | number): NocoBaseDesktopRoute | undefined;
|
|
119
134
|
protected getAPIClient(): APIClient;
|
|
120
135
|
protected getResource(collectionName: string): import("@nocobase/sdk").IResource;
|
|
121
|
-
protected emitChange(): void;
|
|
136
|
+
protected emitChange(layoutUid?: string): void;
|
|
137
|
+
private getCurrentLayoutUid;
|
|
138
|
+
private normalizeLayoutUid;
|
|
139
|
+
private getReadableLayoutUid;
|
|
140
|
+
private getRouteCache;
|
|
141
|
+
private syncRoutesProperty;
|
|
142
|
+
private nextRefreshRequestId;
|
|
143
|
+
private getRefreshRequestId;
|
|
122
144
|
private findRoute;
|
|
145
|
+
private findRouteById;
|
|
123
146
|
}
|
|
124
147
|
export {};
|
package/es/RouterManager.d.ts
CHANGED
|
@@ -40,9 +40,18 @@ export type RenderComponentType = (Component: ComponentTypeAndString, props?: an
|
|
|
40
40
|
export type RouterComponentType = React.FC<{
|
|
41
41
|
BaseLayout?: ComponentType;
|
|
42
42
|
}>;
|
|
43
|
+
type AdminRouteNavigationTarget = {
|
|
44
|
+
currentPathname?: string;
|
|
45
|
+
targetPathname: unknown;
|
|
46
|
+
basePath?: string;
|
|
47
|
+
adminRoutePath?: string;
|
|
48
|
+
replace?: boolean;
|
|
49
|
+
};
|
|
50
|
+
export declare function shouldOpenAdminRouteInNewWindow(options: AdminRouteNavigationTarget): boolean;
|
|
43
51
|
export declare class RouterManager<TApp extends BaseApplication<any> = BaseApplication<any>> {
|
|
44
52
|
protected routes: Record<string, RouteType>;
|
|
45
53
|
protected options: RouterOptions;
|
|
54
|
+
private routerNavigate?;
|
|
46
55
|
app: TApp;
|
|
47
56
|
router: Router;
|
|
48
57
|
get basename(): string;
|
|
@@ -52,6 +61,11 @@ export declare class RouterManager<TApp extends BaseApplication<any> = BaseAppli
|
|
|
52
61
|
(to: import("react-router").To, opts?: import("@remix-run/router").RouterNavigateOptions): Promise<void>;
|
|
53
62
|
};
|
|
54
63
|
constructor(options: RouterOptions, app: TApp);
|
|
64
|
+
private navigateWithPortalPolicy;
|
|
65
|
+
private shouldOpenAdminRouteInNewWindow;
|
|
66
|
+
private getRuntimeBasePath;
|
|
67
|
+
private getAdminRoutePath;
|
|
68
|
+
private getAdminRouteNavigationHref;
|
|
55
69
|
protected resolveLoadedComponent(moduleOrComponent: ComponentLoaderResult): ComponentTypeAndString | undefined;
|
|
56
70
|
protected createRouteLazyComponent(componentLoader: ComponentLoader): ComponentType;
|
|
57
71
|
/**
|
|
@@ -73,3 +87,4 @@ export declare class RouterManager<TApp extends BaseApplication<any> = BaseAppli
|
|
|
73
87
|
has(name: string): boolean;
|
|
74
88
|
remove(name: string): void;
|
|
75
89
|
}
|
|
90
|
+
export {};
|
package/es/authRedirect.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export declare function getModernClientPrefix(): string;
|
|
|
31
31
|
export declare function stripModernClientPrefix(publicPath?: string): string;
|
|
32
32
|
export declare function getV2EffectiveBasePath(app: AppLike): string;
|
|
33
33
|
declare function getDefaultV2AdminRedirectPath(app: AppLike): string;
|
|
34
|
+
export declare function normalizeV2RedirectPath(app: AppLike, target?: string | null, fallbackPath?: string): string;
|
|
34
35
|
/**
|
|
35
36
|
* 将当前 v2 页面地址转换为根相对 redirect 路径。
|
|
36
37
|
*
|
|
@@ -98,6 +98,7 @@ export declare abstract class CollectionFieldInterface {
|
|
|
98
98
|
titleUsable?: boolean;
|
|
99
99
|
usePathOptions?(field: any): any;
|
|
100
100
|
hidden?: boolean;
|
|
101
|
+
creatable?: boolean;
|
|
101
102
|
addComponentOption(componentOption: CollectionFieldInterfaceComponentOption): void;
|
|
102
103
|
getConfigureFormProperties(collectionInfo?: any): Record<string, ISchema>;
|
|
103
104
|
getDefaultValueProperty(): {
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import type { TextAreaProps } from 'antd/es/input';
|
|
10
|
+
import type { TextAreaRef } from 'antd/es/input/TextArea';
|
|
10
11
|
import React from 'react';
|
|
11
12
|
export interface JsonTextAreaProps extends Omit<TextAreaProps, 'value' | 'onChange'> {
|
|
12
13
|
value?: unknown;
|
|
@@ -15,4 +16,4 @@ export interface JsonTextAreaProps extends Omit<TextAreaProps, 'value' | 'onChan
|
|
|
15
16
|
json5?: boolean;
|
|
16
17
|
showError?: boolean;
|
|
17
18
|
}
|
|
18
|
-
export declare const JsonTextArea: React.MemoExoticComponent<
|
|
19
|
+
export declare const JsonTextArea: React.MemoExoticComponent<React.ForwardRefExoticComponent<JsonTextAreaProps & React.RefAttributes<TextAreaRef>>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
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 MetaTreeNode } from '@nocobase/flow-engine';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { type JsonTextAreaProps } from './JsonTextArea';
|
|
12
|
+
export interface VariableJsonTextAreaProps extends JsonTextAreaProps {
|
|
13
|
+
namespaces?: string[];
|
|
14
|
+
extraNodes?: MetaTreeNode[];
|
|
15
|
+
metaTree?: MetaTreeNode[] | (() => MetaTreeNode[] | Promise<MetaTreeNode[]>);
|
|
16
|
+
formatPathToValue?: (meta: MetaTreeNode) => string | undefined;
|
|
17
|
+
}
|
|
18
|
+
export declare const VariableJsonTextArea: React.MemoExoticComponent<(props: VariableJsonTextAreaProps) => React.JSX.Element>;
|
|
19
|
+
export declare const VariableJSON: React.MemoExoticComponent<(props: VariableJsonTextAreaProps) => React.JSX.Element>;
|
package/es/components/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export * from './BlankComponent';
|
|
|
11
11
|
export * from './form/table/dnd';
|
|
12
12
|
export * from './form';
|
|
13
13
|
export * from './Icon';
|
|
14
|
+
export * from './KeepAlive';
|
|
14
15
|
export * from './PoweredBy';
|
|
15
16
|
export * from './RouterContextCleaner';
|
|
16
17
|
export * from './SwitchLanguage';
|
|
@@ -0,0 +1,24 @@
|
|
|
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, type SubModelItem, type SubModelItemsType } from '@nocobase/flow-engine';
|
|
10
|
+
export type EntryActionScope = 'action-panel' | 'app-switcher' | string;
|
|
11
|
+
export type EntryActionProvider = (ctx: FlowModelContext) => SubModelItem[] | Promise<SubModelItem[]>;
|
|
12
|
+
export declare class EntryActionManager {
|
|
13
|
+
private readonly providers;
|
|
14
|
+
revision: number;
|
|
15
|
+
constructor();
|
|
16
|
+
register(name: string, options: {
|
|
17
|
+
scope: EntryActionScope;
|
|
18
|
+
provider: EntryActionProvider;
|
|
19
|
+
sort?: number;
|
|
20
|
+
}): void;
|
|
21
|
+
unregister(name: string): void;
|
|
22
|
+
invalidate(): void;
|
|
23
|
+
getItems(scope: EntryActionScope): SubModelItemsType;
|
|
24
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
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 * from './EntryActionManager';
|
|
@@ -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';
|
|
@@ -41,6 +41,7 @@ export interface LayoutRouteLike {
|
|
|
41
41
|
id?: string;
|
|
42
42
|
name?: string;
|
|
43
43
|
pathname?: string;
|
|
44
|
+
state?: unknown;
|
|
44
45
|
params?: Record<string, string | undefined>;
|
|
45
46
|
layoutRouteName?: string;
|
|
46
47
|
layoutBasePathname?: string;
|
|
@@ -56,6 +57,7 @@ export declare class BaseLayoutModel<TStructure extends BaseLayoutStructure = Ba
|
|
|
56
57
|
currentLayoutRoute: LayoutRouteMatch | null;
|
|
57
58
|
protected routeCoordinator?: BaseLayoutRouteCoordinator;
|
|
58
59
|
private activePageUid;
|
|
60
|
+
private currentRouteState?;
|
|
59
61
|
private layoutContentElement;
|
|
60
62
|
private readonly routePageMetaMap;
|
|
61
63
|
private contextBindingsActive;
|
|
@@ -82,6 +84,10 @@ export declare class BaseLayoutModel<TStructure extends BaseLayoutStructure = Ba
|
|
|
82
84
|
private teardownRuntime;
|
|
83
85
|
private getCurrentRouteByActivePage;
|
|
84
86
|
private getCurrentCoordinatorRouteLike;
|
|
87
|
+
private restoreCurrentLayoutRouteFromRouterContext;
|
|
88
|
+
private shouldIgnoreStaleLayoutRouteCleanup;
|
|
89
|
+
private getRouterContextRouteLike;
|
|
90
|
+
private isRouteLikeOwnedByCurrentLayout;
|
|
85
91
|
}
|
|
86
92
|
/**
|
|
87
93
|
* 按固定 UID 获取或创建 Layout host model。
|
|
@@ -25,6 +25,7 @@ interface RouteLike {
|
|
|
25
25
|
name?: string;
|
|
26
26
|
};
|
|
27
27
|
pathname?: string;
|
|
28
|
+
state?: unknown;
|
|
28
29
|
pageUid?: string;
|
|
29
30
|
layoutBasePathname?: string;
|
|
30
31
|
layoutRoute?: {
|
|
@@ -46,6 +47,7 @@ export declare class BaseLayoutRouteCoordinator {
|
|
|
46
47
|
private basePathname;
|
|
47
48
|
private readonly runtimes;
|
|
48
49
|
private layoutContentElement;
|
|
50
|
+
private lastNonNullLayoutContentElement;
|
|
49
51
|
constructor(flowEngine: FlowEngine, options?: BaseLayoutRouteCoordinatorOptions);
|
|
50
52
|
setLayoutContentElement(element: HTMLElement | null): void;
|
|
51
53
|
registerPage(pageUid: string, meta: RoutePageMeta): RouteModel<import("@nocobase/flow-engine").DefaultStructure>;
|
|
@@ -62,6 +64,11 @@ export declare class BaseLayoutRouteCoordinator {
|
|
|
62
64
|
private shouldStepNavigate;
|
|
63
65
|
private scheduleInitialDeepLinkReplay;
|
|
64
66
|
private stepNavigate;
|
|
67
|
+
private replayActiveRuntimeViewsAfterLayoutContentElementChange;
|
|
68
|
+
private invalidatePendingRuntimeViewOpens;
|
|
69
|
+
private resetRuntimeViewStateForLayoutContentElementChange;
|
|
70
|
+
private markPendingOpenViews;
|
|
71
|
+
private clearPendingOpenViews;
|
|
65
72
|
private handleOpenViews;
|
|
66
73
|
private openViews;
|
|
67
74
|
private ensureRouteModelContext;
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import React, { type FC } from 'react';
|
|
10
|
+
import type { AdminLayoutModel } from './AdminLayoutModel';
|
|
10
11
|
export declare const AdminLayoutEntryGuard: FC<{
|
|
11
12
|
children: React.ReactNode;
|
|
13
|
+
model?: AdminLayoutModel;
|
|
12
14
|
}>;
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import type { FlowSettingsContext } from '@nocobase/flow-engine';
|
|
10
10
|
import { type NocoBaseDesktopRoute } from '../../../flow-compat';
|
|
11
11
|
import { AdminLayoutMenuCreationMeta, AdminLayoutMenuCreationParams, AdminLayoutMenuCreationType, AdminLayoutMenuInsertPosition, getAdminLayoutMenuMovePositionOptions } from './AdminLayoutMenuUtils';
|
|
12
|
+
import { type AdminLayoutRoutePathLike } from './resolveAdminRouteRuntimeTarget';
|
|
12
13
|
declare const buildLinkSettingSchema: (t: (title: any) => any) => {
|
|
13
14
|
href: {
|
|
14
15
|
title: any;
|
|
@@ -99,7 +100,7 @@ export declare const createInsertMenuStep: (options: {
|
|
|
99
100
|
export declare const toTreeSelectItems: (routes: NocoBaseDesktopRoute[], ctx: Pick<FlowSettingsContext<any>, 'resolveJsonTemplate' | 't'>) => any;
|
|
100
101
|
export declare const findPrevSiblingRoute: (routes: NocoBaseDesktopRoute[], currentRoute: NocoBaseDesktopRoute | undefined) => any;
|
|
101
102
|
export declare const findNextSiblingRoute: (routes: NocoBaseDesktopRoute[], currentRoute: NocoBaseDesktopRoute | undefined) => any;
|
|
102
|
-
export declare const matchesRoutePath: (route: NocoBaseDesktopRoute | undefined, pathname: string, basename?: string) => boolean;
|
|
103
|
+
export declare const matchesRoutePath: (route: NocoBaseDesktopRoute | undefined, pathname: string, basename?: string, layout?: AdminLayoutRoutePathLike | null) => boolean;
|
|
103
104
|
export declare const buildInsertRouteSchema: (menuType: AdminLayoutMenuCreationType, pageSchemaUid: string, tabSchemaUid: string, tabSchemaName: string) => {
|
|
104
105
|
type: string;
|
|
105
106
|
'x-component': string;
|
|
@@ -10,6 +10,7 @@ import React from 'react';
|
|
|
10
10
|
import { FlowModel } from '@nocobase/flow-engine';
|
|
11
11
|
import { type NocoBaseDesktopRoute } from '../../../flow-compat';
|
|
12
12
|
import { AdminLayoutMenuCreationMeta, AdminLayoutMenuCreationParams, AdminLayoutMenuInsertPosition, AdminLayoutMenuItemStructure, AdminLayoutMenuNode, AdminLayoutMenuRouteOptions } from './AdminLayoutMenuUtils';
|
|
13
|
+
import { type AdminLayoutRoutePathLike } from './resolveAdminRouteRuntimeTarget';
|
|
13
14
|
export * from './AdminLayoutMenuUtils';
|
|
14
15
|
export declare class AdminLayoutMenuItemModel extends FlowModel<AdminLayoutMenuItemStructure> {
|
|
15
16
|
private creationPersisted;
|
|
@@ -23,6 +24,7 @@ export declare class AdminLayoutMenuItemModel extends FlowModel<AdminLayoutMenuI
|
|
|
23
24
|
isCreationSession(): boolean;
|
|
24
25
|
shouldHydratePersistedState(): boolean;
|
|
25
26
|
getRouteRepository(): any;
|
|
27
|
+
getLayout(): AdminLayoutRoutePathLike | undefined;
|
|
26
28
|
hasPersistedMenuInstanceFlowFlag(route?: NocoBaseDesktopRoute): boolean;
|
|
27
29
|
getCurrentPersistedInstanceFlowCount(): number;
|
|
28
30
|
hasPersistableMenuLinkageRules(): boolean;
|
|
@@ -11,6 +11,7 @@ import React, { FC } from 'react';
|
|
|
11
11
|
import { type NavigateFunction } from 'react-router-dom';
|
|
12
12
|
import { type NocoBaseDesktopRoute } from '../../../flow-compat';
|
|
13
13
|
import type { AdminLayoutMenuItemModel } from './AdminLayoutMenuModels';
|
|
14
|
+
import { type AdminLayoutRoutePathLike } from './resolveAdminRouteRuntimeTarget';
|
|
14
15
|
export type AdminLayoutMenuRenderType = 'item' | 'group';
|
|
15
16
|
export type AdminLayoutMenuRenderOptions = {
|
|
16
17
|
isMobile?: boolean;
|
|
@@ -81,7 +82,7 @@ type AdminLayoutMenuItemsParent = FlowModel & {
|
|
|
81
82
|
* @param identity 节点身份
|
|
82
83
|
* @returns 唯一占位路径
|
|
83
84
|
*/
|
|
84
|
-
export declare const getAdminLayoutMenuVirtualPath: (type: 'link' | 'designer', identity: string | number) => string;
|
|
85
|
+
export declare const getAdminLayoutMenuVirtualPath: (type: 'link' | 'designer', identity: string | number, layout?: AdminLayoutRoutePathLike | null) => string;
|
|
85
86
|
/**
|
|
86
87
|
* 仅在模板表达式内部兼容历史菜单变量写法,避免误改普通文本。
|
|
87
88
|
* @param template 原始模板字符串
|
|
@@ -159,7 +160,7 @@ export declare const AdminLayoutMenuModelRenderer: FC<{
|
|
|
159
160
|
renderType: AdminLayoutMenuRenderType;
|
|
160
161
|
options?: AdminLayoutMenuRenderOptions;
|
|
161
162
|
}>;
|
|
162
|
-
export declare function getAdminLayoutMenuInitializerButton(testId: string, launcherModel: FlowModel, parentRoute?: NocoBaseDesktopRoute): AdminLayoutMenuNode;
|
|
163
|
+
export declare function getAdminLayoutMenuInitializerButton(testId: string, launcherModel: FlowModel, parentRoute?: NocoBaseDesktopRoute, layout?: AdminLayoutRoutePathLike | null): AdminLayoutMenuNode;
|
|
163
164
|
export declare const buildMenuTitleWithIcon: (route: NocoBaseDesktopRoute, t: (title: any) => any, showIconInTitle: boolean) => {
|
|
164
165
|
name: any;
|
|
165
166
|
icon: React.JSX.Element;
|
|
@@ -7,8 +7,13 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import { FC } from 'react';
|
|
10
|
+
import { type AdminLayoutRoutePathLike } from './resolveAdminRouteRuntimeTarget';
|
|
10
11
|
type AdminLayoutContentProps = {
|
|
11
12
|
onContentElementChange?: (element: HTMLDivElement | null) => void;
|
|
13
|
+
layout?: (AdminLayoutRoutePathLike & {
|
|
14
|
+
routeName?: string;
|
|
15
|
+
}) | null;
|
|
16
|
+
designable?: boolean;
|
|
12
17
|
};
|
|
13
18
|
/**
|
|
14
19
|
* AdminLayout 内部使用的内容区容器。
|
|
@@ -8,4 +8,5 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { AppListProps } from '@ant-design/pro-layout/es/components/AppsLogoComponents/types';
|
|
10
10
|
import React from 'react';
|
|
11
|
-
|
|
11
|
+
import type { AppSwitcherActionPanelModel } from './AppSwitcherActionPanelModel';
|
|
12
|
+
export declare function useAppListRender(appSwitcherModel?: AppSwitcherActionPanelModel): (appList: AppListProps) => React.JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
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 { ActionModel } from '../../models/base';
|
|
10
|
+
import { FlowModel, type SubModelItemsType } from '@nocobase/flow-engine';
|
|
11
|
+
import React from 'react';
|
|
12
|
+
type AppSwitcherActionPanelStructure = {
|
|
13
|
+
subModels: {
|
|
14
|
+
actions?: ActionModel[];
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export declare class AppSwitcherActionPanelModel extends FlowModel<AppSwitcherActionPanelStructure> {
|
|
18
|
+
getConfigureActionsItems(): SubModelItemsType;
|
|
19
|
+
renderConfigureActions(): React.JSX.Element;
|
|
20
|
+
private getRenderableActions;
|
|
21
|
+
hasActions(): boolean;
|
|
22
|
+
renderContent(): React.JSX.Element;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export * from './AdminLayoutComponent';
|
|
10
10
|
export * from './AdminLayoutModel';
|
|
11
|
+
export * from './AppSwitcherActionPanelModel';
|
|
11
12
|
export * from '../BaseLayoutModel';
|
|
12
13
|
export * from '../BaseLayoutRouteCoordinator';
|
|
13
14
|
export * from './AdminLayoutSlotModels';
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { BaseApplication } from '../../../BaseApplication';
|
|
10
10
|
import { type NocoBaseDesktopRoute } from '../../../flow-compat';
|
|
11
|
+
import type { LayoutDefinition } from '../../../layout-manager/types';
|
|
11
12
|
export type AdminRouteNavigationMode = 'spa' | 'document';
|
|
12
13
|
export type AdminRouteRuntimeTargetReason = 'ok' | 'missingSchemaUid' | 'unsupportedV2Runtime' | 'emptyGroup' | 'unsupportedRouteType';
|
|
13
14
|
export type AdminRouteRuntimeTarget = {
|
|
@@ -21,6 +22,7 @@ type LocationLike = {
|
|
|
21
22
|
search?: string;
|
|
22
23
|
hash?: string;
|
|
23
24
|
};
|
|
25
|
+
export type AdminLayoutRoutePathLike = Pick<LayoutDefinition, 'routePath'>;
|
|
24
26
|
type ResolveAdminRouteRuntimeTargetOptions = {
|
|
25
27
|
app: Pick<BaseApplication<any>, 'getPublicPath'> & {
|
|
26
28
|
router?: {
|
|
@@ -28,10 +30,14 @@ type ResolveAdminRouteRuntimeTargetOptions = {
|
|
|
28
30
|
};
|
|
29
31
|
};
|
|
30
32
|
route?: NocoBaseDesktopRoute;
|
|
33
|
+
layout?: AdminLayoutRoutePathLike;
|
|
31
34
|
location?: LocationLike;
|
|
32
35
|
preserveLocationState?: boolean;
|
|
33
36
|
log?: (message?: any, ...optionalParams: any[]) => void;
|
|
34
37
|
};
|
|
38
|
+
export declare const DEFAULT_ADMIN_LAYOUT_ROUTE_PATH = "/admin";
|
|
39
|
+
export declare function getAdminLayoutRoutePath(layout?: AdminLayoutRoutePathLike | null): string;
|
|
40
|
+
export declare function joinAdminLayoutRoutePath(layout: AdminLayoutRoutePathLike | null | undefined, pathname?: string | number | null): string;
|
|
35
41
|
export declare function isV2AdminRuntime(app?: ResolveAdminRouteRuntimeTargetOptions['app']): boolean;
|
|
36
42
|
export declare function toRouterNavigationPath(pathname: string, basename?: string): string;
|
|
37
43
|
export declare function isV2MenuRoute(route: NocoBaseDesktopRoute | undefined): boolean;
|
|
@@ -6,8 +6,13 @@
|
|
|
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 { AppListProps } from '@ant-design/pro-layout/es/components/AppsLogoComponents/types';
|
|
9
10
|
import React from 'react';
|
|
10
|
-
|
|
11
|
+
import type { AdminLayoutModel } from './AdminLayoutModel';
|
|
12
|
+
import type { AppSwitcherActionPanelModel } from './AppSwitcherActionPanelModel';
|
|
13
|
+
export declare const APP_SWITCHER_ACTION_PANEL_MODEL_UID: string;
|
|
14
|
+
export declare const useApplications: (adminLayoutModel?: AdminLayoutModel) => {
|
|
11
15
|
Component: React.JSXElementConstructor<any> | React.ExoticComponent<any>;
|
|
12
|
-
appList:
|
|
16
|
+
appList: AppListProps;
|
|
17
|
+
appSwitcherModel: AppSwitcherActionPanelModel;
|
|
13
18
|
};
|
|
@@ -10,7 +10,7 @@ import type { FilterGroupType } from '@nocobase/utils/client';
|
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { FieldAssignValueInput } from './FieldAssignValueInput';
|
|
12
12
|
import { type FieldAssignCascaderOption } from './fieldAssignOptions';
|
|
13
|
-
export type AssignMode = 'default' | 'assign';
|
|
13
|
+
export type AssignMode = 'default' | 'assign' | 'override';
|
|
14
14
|
type CollectionFieldLike = {
|
|
15
15
|
name?: unknown;
|
|
16
16
|
title?: unknown;
|
|
@@ -53,6 +53,8 @@ export interface FieldAssignRulesEditorProps {
|
|
|
53
53
|
defaultMode?: AssignMode;
|
|
54
54
|
/** 固定 mode:用于“仅默认值/仅赋值”的场景 */
|
|
55
55
|
fixedMode?: AssignMode;
|
|
56
|
+
/** 可选 mode 列表;fixedMode 优先级更高 */
|
|
57
|
+
allowedModes?: AssignMode[];
|
|
56
58
|
/** 是否显示 condition */
|
|
57
59
|
showCondition?: boolean;
|
|
58
60
|
/** 是否显示 enable 开关 */
|
|
@@ -30,6 +30,7 @@ export declare class ActionModel<T extends DefaultStructure = DefaultStructure>
|
|
|
30
30
|
enableEditTooltip: boolean;
|
|
31
31
|
enableEditTitle: boolean;
|
|
32
32
|
enableEditIcon: boolean;
|
|
33
|
+
enableEditIconOnly: boolean;
|
|
33
34
|
enableEditType: boolean;
|
|
34
35
|
enableEditDanger: boolean;
|
|
35
36
|
enableEditColor: boolean;
|
|
@@ -44,6 +45,7 @@ export declare class ActionModel<T extends DefaultStructure = DefaultStructure>
|
|
|
44
45
|
getInputArgs(): Record<string, any>;
|
|
45
46
|
onClick(event: any): void;
|
|
46
47
|
getTitle(): string;
|
|
48
|
+
getTitleFieldDescription(): any;
|
|
47
49
|
getIcon(): React.ReactNode;
|
|
48
50
|
renderButton(): React.JSX.Element;
|
|
49
51
|
render(): React.JSX.Element;
|
|
@@ -91,7 +91,7 @@ export declare class GridModel<T extends {
|
|
|
91
91
|
/**
|
|
92
92
|
* 将多列栅格 rows 转换为移动端单列 rows。
|
|
93
93
|
* 遍历原 rows 的行与列顺序,把每个原列(过滤空白列后)变成一个新行(仅一列)。
|
|
94
|
-
* 行 key
|
|
94
|
+
* 行 key 使用原 rowId 与 columnIndex 生成,避免每次渲染产生随机 key 导致移动端滚动位置丢失。
|
|
95
95
|
* @param rows 原始多列 rows
|
|
96
96
|
* @returns 单列 rows
|
|
97
97
|
*/
|
|
@@ -24,6 +24,7 @@ export declare class FilterFormBlockModel extends FilterBlockModel<{
|
|
|
24
24
|
private initialDefaultsPromise?;
|
|
25
25
|
private initialRefreshHandledTargetIds;
|
|
26
26
|
private lastDefaultValueByFieldName;
|
|
27
|
+
private userEditedFieldNames;
|
|
27
28
|
private defaultValuesRefreshSeq;
|
|
28
29
|
get form(): any;
|
|
29
30
|
get title(): string;
|
|
@@ -39,6 +40,10 @@ export declare class FilterFormBlockModel extends FilterBlockModel<{
|
|
|
39
40
|
markInitialTargetRefreshHandled(targetId: string): void;
|
|
40
41
|
private ensureFilterItemsBeforeRender;
|
|
41
42
|
private canApplyFormDefaultValue;
|
|
43
|
+
private canApplyFormOverrideValue;
|
|
44
|
+
private normalizeFieldValueMode;
|
|
45
|
+
private markFilterFormUserEditedFields;
|
|
46
|
+
private resetFilterFormUserEditedFields;
|
|
42
47
|
private matchDefaultValueCondition;
|
|
43
48
|
applyFormDefaultValues(options?: {
|
|
44
49
|
force?: boolean;
|
|
@@ -51,6 +51,10 @@ export declare class FormBlockModel<T extends DefaultCollectionBlockModelStructu
|
|
|
51
51
|
* @internal
|
|
52
52
|
*/
|
|
53
53
|
resetUserModifiedFields(): void;
|
|
54
|
+
/**
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
resetRuntimeUserEditedState(): void;
|
|
54
58
|
onDispatchEventStart(eventName: string, options?: any, inputArgs?: Record<string, any>): Promise<void>;
|
|
55
59
|
getStepParams(flowKey: string, stepKey: string): any | undefined;
|
|
56
60
|
getStepParams(flowKey: string): Record<string, any> | undefined;
|