@nocobase/client-v2 2.2.0-beta.8 → 2.2.0
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/APIClient.d.ts +13 -3
- package/es/BaseApplication.d.ts +3 -0
- package/es/RouteRepository.d.ts +8 -0
- 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/category-tabs/SortableCategoryTabs.d.ts +55 -0
- package/es/components/category-tabs/index.d.ts +9 -0
- package/es/components/form/ScanInput/useCodeScanner.d.ts +3 -2
- package/es/components/form/TypedVariableInput.d.ts +31 -5
- package/es/components/form/filter/CollectionFilter.d.ts +2 -0
- package/es/components/form/filter/CollectionFilterItem.d.ts +11 -1
- package/es/components/form/filter/CollectionFilterPanel.d.ts +2 -0
- package/es/components/form/filter/index.d.ts +2 -0
- package/es/components/form/filter/useFilterActionProps.d.ts +2 -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/index.d.ts +1 -1
- package/es/flow/actions/linkageRules.d.ts +27 -0
- 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/AdminLayoutMenuModels.d.ts +1 -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/useApplications.d.ts +7 -2
- package/es/flow/components/FieldAssignExactDatePicker.d.ts +1 -0
- package/es/flow/components/FieldAssignValueInput.d.ts +7 -24
- package/es/flow/components/FlowRoute.d.ts +2 -2
- package/es/flow/components/RunJSValueEditor.d.ts +1 -0
- package/es/flow/components/field-value-variable/DateVariableEditor.d.ts +24 -0
- package/es/flow/components/field-value-variable/FieldValueVariableInput.d.ts +31 -0
- package/es/flow/components/field-value-variable/dateValue.d.ts +36 -0
- package/es/flow/components/field-value-variable/index.d.ts +11 -0
- package/es/flow/components/filter/FilterGroup.d.ts +1 -0
- package/es/flow/components/filter/VariableFilterItem.d.ts +6 -1
- package/es/flow/components/placeholders/BlockPlaceholder.d.ts +1 -0
- package/es/flow/index.d.ts +1 -0
- package/es/flow/internal/registerDeviceTypeContext.d.ts +10 -0
- package/es/flow/internal/utils/operatorSchemaHelper.d.ts +2 -2
- package/es/flow/models/actions/UpdateRecordActionUtils.d.ts +8 -2
- package/es/flow/models/base/ActionModelCore.d.ts +6 -2
- package/es/flow/models/base/BlockGridModel.d.ts +3 -0
- package/es/flow/models/base/CollectionBlockModel.d.ts +3 -0
- package/es/flow/models/base/PageModel/PageModel.d.ts +12 -0
- package/es/flow/models/base/PageModel/PageModelTabBar.d.ts +22 -0
- package/es/flow/models/base/PageModel/PageTabModel.d.ts +12 -0
- package/es/flow/models/blocks/details/DetailsBlockModel.d.ts +3 -0
- package/es/flow/models/blocks/filter-form/FilterFormGridModel.d.ts +1 -0
- package/es/flow/models/blocks/filter-form/FilterFormSubmitActionModel.d.ts +3 -1
- package/es/flow/models/blocks/form/FormBlockModel.d.ts +7 -0
- package/es/flow/models/blocks/form/FormGridModel.d.ts +6 -0
- package/es/flow/models/blocks/form/QuickEditFormModel.d.ts +17 -2
- package/es/flow/models/blocks/form/value-runtime/rules.d.ts +1 -0
- package/es/flow/models/blocks/table/JSColumnModel.d.ts +2 -0
- package/es/flow/models/blocks/table/TableBlockModel.d.ts +1 -0
- package/es/flow/models/blocks/table/TableColumnModel.d.ts +12 -0
- package/es/flow/models/blocks/table/utils.d.ts +1 -0
- package/es/flow/models/fields/AssociationFieldModel/RecordPickerFieldModel.d.ts +2 -1
- package/es/flow/models/fields/AssociationFieldModel/RecordSelectFieldModel.d.ts +0 -17
- package/es/flow/models/fields/AssociationFieldModel/recordSelectShared.d.ts +41 -0
- package/es/flow/models/fields/DateTimeFieldModel/dateLimit.d.ts +15 -7
- package/es/flow/routeTransientInputArgs.d.ts +14 -0
- package/es/flow-compat/fieldValidationConstants.d.ts +1 -1
- package/es/flow-compat/passwordUtils.d.ts +1 -1
- package/es/flow-compat/routeTypes.d.ts +1 -0
- package/es/index.d.ts +7 -0
- package/es/index.mjs +301 -177
- package/es/ui-operation/index.d.ts +15 -0
- package/es/ui-operation/ui-operation-codec.d.ts +10 -0
- package/es/utils/getRouteRuntimeVersion.d.ts +23 -0
- package/es/utils/index.d.ts +1 -0
- package/es/utils/markdownSanitize.d.ts +11 -0
- package/lib/index.js +313 -189
- package/lib/locale/languageCodes.js +3 -1
- package/package.json +9 -7
- package/src/APIClient.ts +90 -7
- package/src/Application.tsx +7 -1
- package/src/BaseApplication.tsx +13 -6
- package/src/RouteRepository.ts +25 -0
- package/src/RouterManager.tsx +142 -1
- package/src/__tests__/APIClient.test.tsx +58 -0
- package/src/__tests__/RouteRepository.test.ts +23 -0
- package/src/__tests__/RouterManager.test.ts +125 -0
- package/src/__tests__/app.test.tsx +73 -0
- package/src/__tests__/authRedirect.test.ts +17 -0
- package/src/__tests__/browserChecker.test.ts +61 -0
- package/src/__tests__/getRouteRuntimeVersion.test.ts +68 -0
- package/src/__tests__/nocobase-buildin-plugin-auth.test.tsx +35 -2
- package/src/__tests__/settings-center.test.tsx +270 -6
- package/src/acl/ACLProvider.tsx +2 -0
- package/src/acl/__tests__/ACLProvider.test.tsx +92 -0
- 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-validation.ts +1 -1
- package/src/components/README.md +7 -1
- package/src/components/README.zh-CN.md +6 -1
- package/src/components/category-tabs/SortableCategoryTabs.tsx +210 -0
- package/src/components/category-tabs/index.ts +10 -0
- package/src/components/form/JsonTextArea.tsx +4 -0
- package/src/components/form/ScanInput/CodeScanner.tsx +79 -35
- package/src/components/form/ScanInput/__tests__/CodeScanner.test.tsx +101 -0
- package/src/components/form/ScanInput/__tests__/useCodeScanner.test.tsx +284 -11
- package/src/components/form/ScanInput/useCodeScanner.ts +332 -24
- package/src/components/form/TypedVariableInput.tsx +452 -101
- package/src/components/form/__tests__/TypedVariableInput.test.tsx +364 -12
- package/src/components/form/filter/CollectionFilter.tsx +4 -0
- package/src/components/form/filter/CollectionFilterItem.tsx +36 -9
- package/src/components/form/filter/CollectionFilterPanel.tsx +4 -0
- package/src/components/form/filter/__tests__/CollectionFilterItem.test.tsx +55 -0
- package/src/components/form/filter/__tests__/useFilterActionProps.test.tsx +95 -0
- package/src/components/form/filter/index.ts +2 -0
- package/src/components/form/filter/useFilterActionProps.ts +37 -6
- package/src/components/form/table/Table.tsx +81 -6
- package/src/components/form/table/__tests__/Table.columnWidth.test.tsx +433 -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 +675 -12
- package/src/flow/__tests__/PluginFlowEngine.test.ts +58 -0
- package/src/flow/actions/__tests__/actionLinkageRules.forkProps.test.ts +314 -0
- package/src/flow/actions/__tests__/dataScopeFilter.test.ts +62 -0
- package/src/flow/actions/__tests__/dataScopeFormValueClear.test.ts +102 -0
- package/src/flow/actions/__tests__/linkageRules.actionStates.test.ts +33 -0
- package/src/flow/actions/__tests__/linkageRules.subFormSetFieldProps.test.ts +72 -0
- package/src/flow/actions/__tests__/linkageRules.tab.test.ts +171 -0
- package/src/flow/actions/__tests__/linkageRulesRefresh.test.ts +7 -3
- package/src/flow/actions/__tests__/openView.defineProps.route.test.tsx +80 -20
- package/src/flow/actions/dataScopeFilter.ts +10 -1
- package/src/flow/actions/dateTimeFormat.tsx +2 -2
- package/src/flow/actions/index.ts +2 -0
- package/src/flow/actions/linkageRules.tsx +144 -26
- package/src/flow/actions/linkageRulesRefresh.tsx +2 -6
- package/src/flow/actions/openView.tsx +21 -1
- package/src/flow/admin-shell/BaseLayoutModel.tsx +124 -0
- package/src/flow/admin-shell/BaseLayoutRouteCoordinator.ts +184 -42
- package/src/flow/admin-shell/__tests__/AdminLayoutRouteCoordinator.test.ts +1016 -119
- package/src/flow/admin-shell/admin-layout/AdminLayoutComponent.tsx +41 -5
- package/src/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.test.tsx +177 -1
- package/src/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.tsx +20 -0
- package/src/flow/admin-shell/admin-layout/AdminLayoutMenuUtils.tsx +78 -59
- 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/__tests__/AdminLayoutComponent.test.tsx +253 -6
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutMenuModels.test.ts +228 -0
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutModel.test.tsx +436 -2
- package/src/flow/admin-shell/admin-layout/__tests__/TopbarActionsBar.test.tsx +48 -0
- package/src/flow/admin-shell/admin-layout/index.ts +1 -0
- 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/common/Markdown/style.ts +4 -0
- package/src/flow/components/BlockItemCard.tsx +2 -2
- package/src/flow/components/FieldAssignExactDatePicker.tsx +25 -11
- package/src/flow/components/FieldAssignValueInput.tsx +72 -584
- package/src/flow/components/FlowRoute.tsx +204 -46
- package/src/flow/components/RunJSValueEditor.tsx +9 -1
- package/src/flow/components/__tests__/FieldAssignValueInput.context.test.tsx +216 -0
- package/src/flow/components/field-value-variable/DateVariableEditor.tsx +181 -0
- package/src/flow/components/field-value-variable/FieldValueVariableInput.tsx +326 -0
- package/src/flow/components/field-value-variable/__tests__/FieldValueVariableInput.test.tsx +380 -0
- package/src/flow/components/field-value-variable/dateValue.ts +223 -0
- package/src/flow/components/field-value-variable/index.ts +12 -0
- package/src/flow/components/filter/FilterGroup.tsx +33 -5
- package/src/flow/components/filter/VariableFilterItem.tsx +170 -13
- package/src/flow/components/filter/__tests__/FilterGroup.test.tsx +45 -0
- package/src/flow/components/filter/__tests__/VariableFilterItem.leftMetaTree.test.tsx +9 -0
- package/src/flow/components/filter/__tests__/VariableFilterItem.test.tsx +195 -1
- package/src/flow/components/placeholders/BlockPlaceholder.tsx +70 -23
- package/src/flow/components/placeholders/__tests__/BlockPlaceholder.test.tsx +57 -7
- package/src/flow/index.ts +3 -0
- package/src/flow/internal/components/Markdown/util.ts +2 -1
- package/src/flow/internal/registerDeviceTypeContext.ts +39 -0
- package/src/flow/internal/utils/operatorSchemaHelper.ts +3 -2
- package/src/flow/models/actions/UpdateRecordActionModel.tsx +18 -1
- package/src/flow/models/actions/UpdateRecordActionUtils.ts +18 -6
- package/src/flow/models/actions/__tests__/UpdateRecordActionModel.test.ts +76 -4
- package/src/flow/models/base/ActionModel.tsx +10 -8
- package/src/flow/models/base/ActionModelCore.tsx +16 -2
- package/src/flow/models/base/BlockGridModel.tsx +26 -0
- package/src/flow/models/base/CollectionBlockModel.tsx +38 -3
- package/src/flow/models/base/PageModel/PageModel.tsx +387 -53
- package/src/flow/models/base/PageModel/PageModelTabBar.tsx +114 -0
- package/src/flow/models/base/PageModel/PageTabModel.tsx +249 -18
- package/src/flow/models/base/PageModel/__tests__/PageModel.test.ts +790 -10
- package/src/flow/models/base/PageModel/__tests__/PageModelTabBar.module-isolation.test.tsx +130 -0
- package/src/flow/models/base/PageModel/__tests__/PageModelTabBar.test.tsx +118 -0
- package/src/flow/models/base/PageModel/__tests__/PageTabModel.test.ts +1075 -7
- package/src/flow/models/base/__tests__/ActionModelCore.render.test.tsx +49 -0
- package/src/flow/models/base/__tests__/BlockGridModel.selectSceneActivation.test.ts +124 -0
- package/src/flow/models/base/__tests__/CollectionBlockModel.addAppends.test.ts +41 -0
- package/src/flow/models/base/__tests__/CollectionBlockModel.initialBeforeRenderRefresh.test.ts +125 -9
- package/src/flow/models/blocks/assign-form/AssignFormItemModel.tsx +28 -53
- package/src/flow/models/blocks/details/DetailsBlockModel.tsx +8 -3
- package/src/flow/models/blocks/details/__tests__/DetailsBlockModel.initialPaginationChangeRefresh.test.ts +32 -1
- package/src/flow/models/blocks/filter-form/FilterFormBlockModel.tsx +28 -3
- package/src/flow/models/blocks/filter-form/FilterFormGridModel.tsx +36 -5
- package/src/flow/models/blocks/filter-form/FilterFormItemModel.tsx +155 -25
- package/src/flow/models/blocks/filter-form/FilterFormSubmitActionModel.tsx +57 -4
- package/src/flow/models/blocks/filter-form/__tests__/FilterFormGridModel.onModelCreated.test.ts +174 -1
- package/src/flow/models/blocks/filter-form/__tests__/FilterFormItemModel.defineChildren.test.ts +395 -1
- package/src/flow/models/blocks/filter-form/__tests__/FilterFormItemModel.getFilterValue.test.ts +72 -0
- package/src/flow/models/blocks/filter-form/__tests__/FilterFormSubmitActionModel.lifecycle.test.ts +90 -0
- package/src/flow/models/blocks/filter-form/__tests__/defaultValues.wiring.test.ts +66 -4
- package/src/flow/models/blocks/filter-manager/FilterManager.ts +5 -0
- package/src/flow/models/blocks/filter-manager/__tests__/FilterManager.test.ts +40 -0
- package/src/flow/models/blocks/form/FormBlockModel.tsx +47 -0
- package/src/flow/models/blocks/form/FormGridModel.tsx +4 -0
- package/src/flow/models/blocks/form/QuickEditFormModel.tsx +189 -36
- package/src/flow/models/blocks/form/__tests__/FormBlockModel.test.tsx +8 -2
- package/src/flow/models/blocks/form/__tests__/QuickEditFormModel.quickEdit.test.ts +350 -2
- package/src/flow/models/blocks/form/__tests__/runJsFormSubmit.test.ts +131 -0
- package/src/flow/models/blocks/form/value-runtime/__tests__/runtime.test.ts +435 -0
- package/src/flow/models/blocks/form/value-runtime/rules.ts +67 -14
- package/src/flow/models/blocks/form/value-runtime/runtime.ts +43 -19
- package/src/flow/models/blocks/js-block/JSBlock.tsx +1 -1
- package/src/flow/models/blocks/table/JSColumnModel.tsx +10 -1
- package/src/flow/models/blocks/table/TableActionsColumnModel.tsx +2 -1
- package/src/flow/models/blocks/table/TableBlockModel.tsx +29 -3
- package/src/flow/models/blocks/table/TableColumnModel.tsx +54 -11
- package/src/flow/models/blocks/table/__tests__/JSColumnModel.test.tsx +52 -5
- package/src/flow/models/blocks/table/__tests__/TableBlockModel.filterReset.test.ts +78 -0
- package/src/flow/models/blocks/table/__tests__/TableBlockModel.quickEditRefresh.test.ts +12 -0
- package/src/flow/models/blocks/table/__tests__/TableColumnModel.test.tsx +84 -0
- package/src/flow/models/blocks/table/utils.ts +7 -0
- package/src/flow/models/fields/AssociationFieldModel/CascadeSelectFieldModel.tsx +33 -1
- package/src/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableFieldModel.tsx +10 -1
- package/src/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/__tests__/popupContext.test.ts +120 -0
- package/src/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/PopupSubTableEditActionModel.tsx +10 -2
- package/src/flow/models/fields/AssociationFieldModel/RecordPickerFieldModel.tsx +24 -1
- package/src/flow/models/fields/AssociationFieldModel/RecordSelectFieldModel.tsx +54 -149
- package/src/flow/models/fields/AssociationFieldModel/__tests__/RecordPickerFieldModel.itemContext.test.ts +167 -3
- package/src/flow/models/fields/AssociationFieldModel/recordSelectShared.tsx +156 -0
- package/src/flow/models/fields/DateTimeFieldModel/__tests__/DateTimeNoTzFieldModel.dateLimit.test.tsx +149 -0
- package/src/flow/models/fields/DateTimeFieldModel/dateLimit.ts +149 -113
- package/src/flow/models/fields/DisplayNumberFieldModel.tsx +1 -1
- package/src/flow/models/fields/JsonFieldModel.tsx +31 -8
- package/src/flow/models/fields/NumberFieldModel.tsx +1 -1
- package/src/flow/models/fields/TextareaFieldModel.tsx +42 -19
- package/src/flow/models/fields/VariableFieldFormModel.tsx +3 -3
- package/src/flow/models/fields/__tests__/DisplayNumberFieldModel.test.ts +33 -0
- package/src/flow/models/fields/__tests__/JsonFieldModel.test.ts +82 -0
- package/src/flow/models/fields/__tests__/NumberFieldModel.test.tsx +47 -0
- package/src/flow/models/fields/__tests__/TextareaFieldModel.test.tsx +32 -1
- package/src/flow/models/fields/__tests__/VariableFieldFormModel.test.tsx +51 -0
- package/src/flow/models/fields/mobile-components/MobileLazySelect.tsx +26 -10
- package/src/flow/models/fields/mobile-components/MobileSelect.tsx +51 -14
- package/src/flow/models/fields/mobile-components/__tests__/MobileSelect.test.tsx +139 -13
- package/src/flow/models/topbar/TopbarActionModel.tsx +78 -3
- package/src/flow/routeTransientInputArgs.ts +27 -0
- package/src/flow/utils/__tests__/dateTimeFormat.test.ts +42 -0
- package/src/flow/utils/dataScopeFormValueClear.ts +4 -3
- package/src/flow-compat/fieldValidationConstants.ts +1 -1
- package/src/flow-compat/routeTypes.ts +1 -0
- package/src/index.ts +7 -0
- package/src/layout-manager/LayoutContentRoute.tsx +2 -1
- package/src/layout-manager/LayoutRoute.tsx +2 -1
- package/src/layout-manager/__tests__/LayoutRoute.test.tsx +87 -1
- package/src/locale/languageCodes.ts +3 -1
- package/src/nocobase-buildin-plugin/index.tsx +19 -1
- package/src/settings-center/AdminSettingsLayout.tsx +23 -2
- package/src/ui-operation/index.ts +33 -0
- package/src/ui-operation/ui-operation-codec.ts +54 -0
- package/src/utils/getRouteRuntimeVersion.ts +185 -0
- package/src/utils/index.tsx +1 -0
- package/src/utils/markdownSanitize.ts +88 -0
package/es/APIClient.d.ts
CHANGED
|
@@ -6,11 +6,21 @@
|
|
|
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 { APIClient as APIClientSDK
|
|
9
|
+
import { APIClient as APIClientSDK } from '@nocobase/sdk';
|
|
10
|
+
import type { NotificationInstance } from 'antd/es/notification/interface';
|
|
11
|
+
interface APIClientApplication {
|
|
12
|
+
getName?: () => string | undefined;
|
|
13
|
+
context?: {
|
|
14
|
+
notification?: NotificationInstance;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
10
17
|
export declare class APIClient extends APIClientSDK {
|
|
11
|
-
|
|
12
|
-
|
|
18
|
+
app?: APIClientApplication;
|
|
19
|
+
get notification(): NotificationInstance;
|
|
13
20
|
getHostname(): string;
|
|
14
21
|
getHeaders(): {};
|
|
15
22
|
interceptors(): void;
|
|
23
|
+
handleNotificationError(error: unknown): void;
|
|
24
|
+
useNotificationMiddleware(): void;
|
|
16
25
|
}
|
|
26
|
+
export {};
|
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(): string;
|
|
144
147
|
getPublicPath(): string;
|
|
145
148
|
getApiUrl(pathname?: string): string;
|
|
146
149
|
getRouteUrl(pathname: string): string;
|
package/es/RouteRepository.d.ts
CHANGED
|
@@ -124,6 +124,13 @@ export declare class RouteRepository {
|
|
|
124
124
|
* @returns 匹配到的路由节点
|
|
125
125
|
*/
|
|
126
126
|
getRouteBySchemaUid(schemaUid: string): NocoBaseDesktopRoute | undefined;
|
|
127
|
+
/**
|
|
128
|
+
* 通过路由 id 反查对应路由节点。
|
|
129
|
+
*
|
|
130
|
+
* @param routeId 桌面路由主键
|
|
131
|
+
* @returns 匹配到的路由节点
|
|
132
|
+
*/
|
|
133
|
+
getRouteById(routeId: string | number): NocoBaseDesktopRoute | undefined;
|
|
127
134
|
protected getAPIClient(): APIClient;
|
|
128
135
|
protected getResource(collectionName: string): import("@nocobase/sdk").IResource;
|
|
129
136
|
protected emitChange(layoutUid?: string): void;
|
|
@@ -135,5 +142,6 @@ export declare class RouteRepository {
|
|
|
135
142
|
private nextRefreshRequestId;
|
|
136
143
|
private getRefreshRequestId;
|
|
137
144
|
private findRoute;
|
|
145
|
+
private findRouteById;
|
|
138
146
|
}
|
|
139
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(): {
|
|
@@ -0,0 +1,55 @@
|
|
|
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 React from 'react';
|
|
10
|
+
/**
|
|
11
|
+
* A category descriptor for {@link SortableCategoryTabs}. The component is
|
|
12
|
+
* i18n-agnostic: `label` is rendered verbatim, so consumers pass an
|
|
13
|
+
* already-compiled/translated node. `color` is an antd preset color name or a
|
|
14
|
+
* hex string; `'default'` / `undefined` renders no badge color.
|
|
15
|
+
*/
|
|
16
|
+
export type SortableCategoryTabItem = {
|
|
17
|
+
id: string | number;
|
|
18
|
+
label: React.ReactNode;
|
|
19
|
+
color?: string;
|
|
20
|
+
};
|
|
21
|
+
export type SortableCategoryTabsProps = {
|
|
22
|
+
activeKey: string;
|
|
23
|
+
onChange: (key: string) => void;
|
|
24
|
+
/** Draggable category tabs (the fixed leading tab is configured via `allTab`). */
|
|
25
|
+
categories: SortableCategoryTabItem[];
|
|
26
|
+
/** The fixed, non-draggable leading tab, e.g. "All". */
|
|
27
|
+
allTab: {
|
|
28
|
+
key: string;
|
|
29
|
+
label: React.ReactNode;
|
|
30
|
+
};
|
|
31
|
+
/** Show the "+" add button and handle its click. */
|
|
32
|
+
onAdd?: () => void;
|
|
33
|
+
/** Per-category edit menu item handler; menu is hidden when omitted. */
|
|
34
|
+
onEdit?: (id: string | number) => void;
|
|
35
|
+
/** Per-category delete menu item handler; menu is hidden when omitted. */
|
|
36
|
+
onDelete?: (id: string | number) => void;
|
|
37
|
+
/** Reorder handler. Receives the dragged and dropped category ids. */
|
|
38
|
+
onSort?: (sourceId: string | number, targetId: string | number) => void | Promise<void>;
|
|
39
|
+
/** Consumer-translated labels for the per-category dropdown menu. */
|
|
40
|
+
menuLabels?: {
|
|
41
|
+
edit?: string;
|
|
42
|
+
delete?: string;
|
|
43
|
+
};
|
|
44
|
+
className?: string;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* A draggable, editable category tab bar. Renders only the tab bar (no content
|
|
48
|
+
* panes) — the page renders its content below and reacts to `activeKey`.
|
|
49
|
+
*
|
|
50
|
+
* Shared by settings pages that group records under reorderable categories
|
|
51
|
+
* (data-source collections, workflows, …). Drag-to-reorder is powered by
|
|
52
|
+
* `@dnd-kit`; the "+" / per-tab edit-delete affordances are optional.
|
|
53
|
+
*/
|
|
54
|
+
export declare function SortableCategoryTabs(props: SortableCategoryTabsProps): React.JSX.Element;
|
|
55
|
+
export default SortableCategoryTabs;
|
|
@@ -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 './SortableCategoryTabs';
|
|
@@ -15,17 +15,18 @@ type UseCodeScannerOptions = {
|
|
|
15
15
|
enabled: boolean;
|
|
16
16
|
elementId: string;
|
|
17
17
|
formatsToSupport?: CodeFormatsToSupport;
|
|
18
|
-
scanBoxSize?: ScannerSize;
|
|
19
18
|
onScannerSizeChanged?: (size: ScannerSize) => void;
|
|
20
19
|
onScanSuccess: (text: string) => void;
|
|
21
20
|
onScanFailure?: () => void;
|
|
21
|
+
onCameraStartFailure?: (error: unknown) => void;
|
|
22
22
|
};
|
|
23
23
|
export declare const DEFAULT_CODE_FORMATS: CodeFormatsToSupport;
|
|
24
24
|
export declare function getCodeScanBoxSize(width: number, height: number): {
|
|
25
25
|
width: number;
|
|
26
26
|
height: number;
|
|
27
27
|
};
|
|
28
|
-
export declare function
|
|
28
|
+
export declare function scanQrVideoFrame(video: HTMLVideoElement, canvas: HTMLCanvasElement): string;
|
|
29
|
+
export declare function useCodeScanner({ enabled, elementId, formatsToSupport, onScannerSizeChanged, onScanSuccess, onScanFailure, onCameraStartFailure, }: UseCodeScannerOptions): {
|
|
29
30
|
startScanFile: (file: File) => Promise<void>;
|
|
30
31
|
};
|
|
31
32
|
export {};
|
|
@@ -10,11 +10,11 @@ import { type MetaTreeNode } from '@nocobase/flow-engine';
|
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { type VariableDelimiters } from './VariableInput';
|
|
12
12
|
/**
|
|
13
|
-
* Constant types this input can edit.
|
|
14
|
-
* `useTypedConstant`
|
|
15
|
-
*
|
|
13
|
+
* Constant types this input can edit. Matches v1 `Variable.Input`
|
|
14
|
+
* `useTypedConstant` minus `'null'` (handled by the dedicated `nullable` prop).
|
|
15
|
+
* `'object'` renders an inline JSON editor (textarea).
|
|
16
16
|
*/
|
|
17
|
-
export type TypedConstantType = 'string' | 'number' | 'boolean' | 'date';
|
|
17
|
+
export type TypedConstantType = 'string' | 'number' | 'boolean' | 'date' | 'object';
|
|
18
18
|
/**
|
|
19
19
|
* One allowed constant type. Either a bare type name (`'number'`) or a
|
|
20
20
|
* `[type, editorProps]` pair (`['number', { min: 1, max: 65535 }]`) where
|
|
@@ -33,25 +33,51 @@ export interface TypedVariableInputProps {
|
|
|
33
33
|
* Allowed constant types. The `Constant` switcher entry always exposes a
|
|
34
34
|
* typed submenu (matching v1 `Variable.Input`) so users can see what type
|
|
35
35
|
* the constant is, even when only one type is permitted. Default: all four
|
|
36
|
-
* supported types.
|
|
36
|
+
* supported types. Passing `[]` switches the component into a variable-only
|
|
37
|
+
* mode: constants/null are hidden, the empty state becomes a readonly
|
|
38
|
+
* placeholder, and clearing a selected variable resets to `null`.
|
|
37
39
|
*/
|
|
38
40
|
types?: TypedConstantSpec[];
|
|
39
41
|
/**
|
|
40
42
|
* Restrict the variable picker to specific top-level meta-tree namespaces
|
|
41
43
|
* (e.g. `['$env']`). When omitted, every registered top-level property is
|
|
42
44
|
* exposed — matching `VariableInput`'s default behaviour.
|
|
45
|
+
*
|
|
46
|
+
* Ignored when `metaTree` is supplied (an explicit tree wins).
|
|
43
47
|
*/
|
|
44
48
|
namespaces?: string[];
|
|
45
49
|
/** Additional leaves appended to the picker after the namespace-filtered nodes. */
|
|
46
50
|
extraNodes?: MetaTreeNode[];
|
|
51
|
+
/**
|
|
52
|
+
* Provide the variable tree explicitly instead of reading the global
|
|
53
|
+
* FlowContext meta tree. When set, `namespaces`/`extraNodes` are ignored and
|
|
54
|
+
* this tree is used verbatim — use for context-scoped variable sources that
|
|
55
|
+
* are not part of the global registry (e.g. a workflow node's upstream
|
|
56
|
+
* outputs). Lazy `children` thunks are resolved on demand as the user
|
|
57
|
+
* expands the cascader.
|
|
58
|
+
*/
|
|
59
|
+
metaTree?: MetaTreeNode[];
|
|
47
60
|
/**
|
|
48
61
|
* When true (default), the switcher exposes a `Null` option that resets the
|
|
49
62
|
* value to `null`. When false, the value is constrained to one of the
|
|
50
63
|
* allowed types or a variable reference.
|
|
51
64
|
*/
|
|
52
65
|
nullable?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Opt-in: when the incoming `value` is `undefined`, initialize the editor to
|
|
68
|
+
* the first allowed constant type instead of rendering the null-mode
|
|
69
|
+
* placeholder. `null` still keeps its explicit null semantics; only
|
|
70
|
+
* `undefined` triggers this path.
|
|
71
|
+
*/
|
|
72
|
+
defaultToFirstConstantTypeWhenUndefined?: boolean;
|
|
53
73
|
/** Variable-token delimiters. Default `['{{', '}}']` — see `VariableInput`. */
|
|
54
74
|
delimiters?: VariableDelimiters;
|
|
75
|
+
/**
|
|
76
|
+
* Hide variable choices from the switcher. In variable-only mode this hides
|
|
77
|
+
* the selector button entirely; in mixed constant/variable mode it keeps the
|
|
78
|
+
* null/constant choices but removes variable entries.
|
|
79
|
+
*/
|
|
80
|
+
hideVariable?: boolean;
|
|
55
81
|
disabled?: boolean;
|
|
56
82
|
placeholder?: string;
|
|
57
83
|
style?: React.CSSProperties;
|
|
@@ -15,6 +15,8 @@ export interface CollectionFilterProps {
|
|
|
15
15
|
collection: Collection | undefined;
|
|
16
16
|
/** Previously compiled filter param used to seed the editable filter group. */
|
|
17
17
|
initialValue?: CompiledFilter;
|
|
18
|
+
/** Default compiled filter used both for initial empty state and Reset. */
|
|
19
|
+
defaultValue?: CompiledFilter;
|
|
18
20
|
/** Called on Submit or Reset with the compiled NocoBase filter param (`undefined` when cleared). */
|
|
19
21
|
onChange: (filter: CompiledFilter) => void;
|
|
20
22
|
/** Translator. Defaults to identity. */
|
|
@@ -37,6 +37,16 @@ export interface CollectionFilterItemProps {
|
|
|
37
37
|
app?: {
|
|
38
38
|
getComponent?: (name: string) => React.ComponentType<any> | undefined;
|
|
39
39
|
};
|
|
40
|
+
/** Optional override for the left field picker placeholder. */
|
|
41
|
+
fieldPlaceholder?: string;
|
|
42
|
+
/** Optional override for the operator picker placeholder. */
|
|
43
|
+
operatorPlaceholder?: string;
|
|
44
|
+
/** Optional override for the value input placeholder. Pass `null` to suppress it. */
|
|
45
|
+
valuePlaceholder?: string | null;
|
|
46
|
+
/** Optional override for the left field picker width. Defaults to v2's original 200px. */
|
|
47
|
+
fieldWidth?: number;
|
|
48
|
+
/** Optional override for the operator picker min-width. Defaults to v2's original 120px. */
|
|
49
|
+
operatorMinWidth?: number;
|
|
40
50
|
}
|
|
41
51
|
/**
|
|
42
52
|
* Filter row bound directly to a `Collection`, with no `FlowModel` dependency. Use this from settings pages or other surfaces that need a filter UI but don't have (and shouldn't synthesise) a block model just to satisfy `FilterItem`. Pair with `FilterContainer` via either an inline wrapper or `createCollectionFilterItem(collection)`.
|
|
@@ -47,7 +57,7 @@ export declare const CollectionFilterItem: FC<CollectionFilterItemProps>;
|
|
|
47
57
|
/**
|
|
48
58
|
* Convenience factory returning a `FilterContainer`-compatible `FilterItem` component bound to a specific collection. Avoids creating an inline closure on every parent render, which would otherwise reset any focused inner antd control.
|
|
49
59
|
*/
|
|
50
|
-
export declare function createCollectionFilterItem(collection: Collection, bound?: Pick<CollectionFilterItemProps, 'filterableFieldNames' | 'nonfilterableFieldNames' | 'noIgnore' | 't' | 'app'>): React.FC<{
|
|
60
|
+
export declare function createCollectionFilterItem(collection: Collection, bound?: Pick<CollectionFilterItemProps, 'filterableFieldNames' | 'nonfilterableFieldNames' | 'noIgnore' | 't' | 'app' | 'fieldPlaceholder' | 'operatorPlaceholder' | 'valuePlaceholder' | 'fieldWidth' | 'operatorMinWidth'>): React.FC<{
|
|
51
61
|
value: CollectionFilterItemValue;
|
|
52
62
|
}>;
|
|
53
63
|
export default CollectionFilterItem;
|
|
@@ -18,6 +18,8 @@ export interface CollectionFilterPanelProps {
|
|
|
18
18
|
collection: Collection | undefined;
|
|
19
19
|
/** Previously compiled filter param used to seed the editable filter group. */
|
|
20
20
|
initialValue?: CompiledFilter;
|
|
21
|
+
/** Default compiled filter used both for initial empty state and Reset. */
|
|
22
|
+
defaultValue?: CompiledFilter;
|
|
21
23
|
/** Called when the condition group structure changes or `reset()` is invoked. */
|
|
22
24
|
onChange?: (filter: CompiledFilter) => void;
|
|
23
25
|
/** Translator. Defaults to identity. */
|
|
@@ -9,5 +9,7 @@
|
|
|
9
9
|
export { CollectionFilter } from './CollectionFilter';
|
|
10
10
|
export type { CollectionFilterProps } from './CollectionFilter';
|
|
11
11
|
export { CollectionFilterPanel } from './CollectionFilterPanel';
|
|
12
|
+
export { CollectionFilterItem } from './CollectionFilterItem';
|
|
13
|
+
export type { CollectionFilterItemValue } from './CollectionFilterItem';
|
|
12
14
|
export type { CollectionFilterPanelProps, CollectionFilterPanelRef } from './CollectionFilterPanel';
|
|
13
15
|
export type { CompiledFilter } from './useFilterActionProps';
|
|
@@ -46,6 +46,8 @@ export interface UseFilterActionPropsArgs extends UseFilterOptionsArgs {
|
|
|
46
46
|
collection: Collection | undefined;
|
|
47
47
|
/** Previously compiled filter param used to seed the editable filter group. */
|
|
48
48
|
initialValue?: CompiledFilter;
|
|
49
|
+
/** Default compiled filter used both for initial empty state and Reset. */
|
|
50
|
+
defaultValue?: CompiledFilter;
|
|
49
51
|
/**
|
|
50
52
|
* Called when the user submits or resets the filter popover. Receives the compiled filter param (`undefined` when cleared) and which footer button triggered the call. Typical implementation: `(filter, action) => { listRequest.run(filter); if (action === 'submit') closePopover(); }`.
|
|
51
53
|
*/
|
package/es/components/index.d.ts
CHANGED
|
@@ -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';
|
|
@@ -35,7 +35,7 @@ export * from './formAssignRules';
|
|
|
35
35
|
export * from './filterFormDefaultValues';
|
|
36
36
|
export * from './linkageRulesRefresh';
|
|
37
37
|
export * from './blockHeight';
|
|
38
|
-
export { fieldLinkageRules, subFormFieldLinkageRules, detailsFieldLinkageRules, linkageSetDetailsFieldProps, actionLinkageRules, menuLinkageRules, blockLinkageRules, linkageSetBlockProps, linkageSetActionProps, linkageSetMenuItemProps, linkageSetFieldProps, subFormLinkageSetFieldProps, linkageAssignField, linkageRunjs, subFormLinkageAssignField, } from './linkageRules';
|
|
38
|
+
export { fieldLinkageRules, subFormFieldLinkageRules, detailsFieldLinkageRules, linkageSetDetailsFieldProps, actionLinkageRules, menuLinkageRules, tabLinkageRules, blockLinkageRules, linkageSetBlockProps, linkageSetActionProps, linkageSetMenuItemProps, linkageSetTabProps, linkageSetFieldProps, subFormLinkageSetFieldProps, linkageAssignField, linkageRunjs, subFormLinkageAssignField, } from './linkageRules';
|
|
39
39
|
export { displayFieldComponent } from './displayFieldComponent';
|
|
40
40
|
export * from './overflowMode';
|
|
41
41
|
export * from './numberFormat';
|
|
@@ -7,9 +7,34 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import { FlowContext, FlowModel } from '@nocobase/flow-engine';
|
|
10
|
+
export declare function updateLinkageRules<T>(rules: T[], updater: (nextRules: T[]) => void): T[];
|
|
10
11
|
export declare const linkageSetBlockProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
12
|
+
declare const ACTION_LINKAGE_STATE_OPTIONS: readonly [{
|
|
13
|
+
readonly label: "Visible";
|
|
14
|
+
readonly value: "visible";
|
|
15
|
+
}, {
|
|
16
|
+
readonly label: "Hidden";
|
|
17
|
+
readonly value: "hidden";
|
|
18
|
+
}, {
|
|
19
|
+
readonly label: "Hidden text";
|
|
20
|
+
readonly value: "hiddenText";
|
|
21
|
+
}, {
|
|
22
|
+
readonly label: "Enabled";
|
|
23
|
+
readonly value: "enabled";
|
|
24
|
+
}, {
|
|
25
|
+
readonly label: "Disabled";
|
|
26
|
+
readonly value: "disabled";
|
|
27
|
+
}];
|
|
28
|
+
type ActionLinkageState = (typeof ACTION_LINKAGE_STATE_OPTIONS)[number]['value'];
|
|
29
|
+
export declare function getActionLinkageStateOptions(model: {
|
|
30
|
+
supportedActionLinkageStates?: readonly ActionLinkageState[];
|
|
31
|
+
}, t: (key: string) => string): {
|
|
32
|
+
label: string;
|
|
33
|
+
value: "hidden" | "visible" | "disabled" | "enabled" | "hiddenText";
|
|
34
|
+
}[];
|
|
11
35
|
export declare const linkageSetActionProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
12
36
|
export declare const linkageSetMenuItemProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
37
|
+
export declare const linkageSetTabProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
13
38
|
export declare const linkageSetFieldProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
14
39
|
export declare const subFormLinkageSetFieldProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
15
40
|
export declare const linkageSetDetailsFieldProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
@@ -20,6 +45,8 @@ export declare const linkageRunjs: import("@nocobase/flow-engine").ActionDefinit
|
|
|
20
45
|
export declare const blockLinkageRules: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
21
46
|
export declare const actionLinkageRules: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
22
47
|
export declare const menuLinkageRules: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
48
|
+
export declare const tabLinkageRules: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
23
49
|
export declare const fieldLinkageRules: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
24
50
|
export declare const subFormFieldLinkageRules: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
25
51
|
export declare const detailsFieldLinkageRules: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
52
|
+
export {};
|
|
@@ -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;
|
|
@@ -32,6 +32,7 @@ export declare class AdminLayoutMenuItemModel extends FlowModel<AdminLayoutMenuI
|
|
|
32
32
|
buildRouteOptionsWithPersistedFlowFlag(hasPersistedMenuInstanceFlow: boolean): {
|
|
33
33
|
[x: string]: any;
|
|
34
34
|
hasPersistedMenuInstanceFlow?: boolean;
|
|
35
|
+
hasPersistedPageTabFlowModel?: boolean;
|
|
35
36
|
};
|
|
36
37
|
syncPersistedFlowRouteFlag(): Promise<void>;
|
|
37
38
|
destroyPersistedState(): Promise<void>;
|
|
@@ -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';
|
|
@@ -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
|
};
|
|
@@ -19,5 +19,6 @@ export interface FieldAssignExactDatePickerProps {
|
|
|
19
19
|
isRange?: boolean;
|
|
20
20
|
onChange?: (value: ExactDatePickerValue) => void;
|
|
21
21
|
style?: React.CSSProperties;
|
|
22
|
+
disabled?: boolean;
|
|
22
23
|
}
|
|
23
24
|
export declare const FieldAssignExactDatePicker: React.FC<FieldAssignExactDatePickerProps>;
|