@nocobase/client-v2 2.1.0-alpha.40 → 2.1.0-alpha.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/Application.d.ts +7 -0
- package/es/BaseApplication.d.ts +13 -0
- package/es/RouterManager.d.ts +1 -0
- package/es/authRedirect.d.ts +12 -0
- package/es/collection-field-interface/CollectionFieldInterface.d.ts +51 -15
- package/es/collection-field-interface/CollectionFieldInterfaceManager.d.ts +82 -3
- package/es/collection-manager/field-configure.d.ts +80 -0
- package/es/collection-manager/field-validation.d.ts +43 -0
- package/es/collection-manager/filter-operators/index.d.ts +46 -0
- package/es/collection-manager/filter-operators/operators.d.ts +30 -0
- package/es/collection-manager/interfaces/checkbox.d.ts +1 -41
- package/es/collection-manager/interfaces/checkboxGroup.d.ts +12 -44
- package/es/collection-manager/interfaces/collection.d.ts +12 -51
- package/es/collection-manager/interfaces/color.d.ts +1 -16
- package/es/collection-manager/interfaces/createdAt.d.ts +1 -44
- package/es/collection-manager/interfaces/createdBy.d.ts +0 -4
- package/es/collection-manager/interfaces/dateOnly.d.ts +7 -44
- package/es/collection-manager/interfaces/datetime.d.ts +1 -44
- package/es/collection-manager/interfaces/datetimeNoTz.d.ts +1 -44
- package/es/collection-manager/interfaces/email.d.ts +1 -29
- package/es/collection-manager/interfaces/id.d.ts +1 -16
- package/es/collection-manager/interfaces/index.d.ts +2 -3
- package/es/collection-manager/interfaces/input.d.ts +1 -102
- package/es/collection-manager/interfaces/integer.d.ts +1 -95
- package/es/collection-manager/interfaces/json.d.ts +16 -7
- package/es/collection-manager/interfaces/m2m.d.ts +11 -19
- package/es/collection-manager/interfaces/m2o.d.ts +11 -19
- package/es/collection-manager/interfaces/markdown.d.ts +1 -63
- package/es/collection-manager/interfaces/multipleSelect.d.ts +12 -44
- package/es/collection-manager/interfaces/nanoid.d.ts +1 -34
- package/es/collection-manager/interfaces/number.d.ts +1 -87
- package/es/collection-manager/interfaces/o2m.d.ts +12 -24
- package/es/collection-manager/interfaces/obo.d.ts +207 -0
- package/es/collection-manager/interfaces/oho.d.ts +207 -0
- package/es/collection-manager/interfaces/password.d.ts +1 -56
- package/es/collection-manager/interfaces/percent.d.ts +1 -84
- package/es/collection-manager/interfaces/phone.d.ts +1 -25
- package/es/collection-manager/interfaces/properties/index.d.ts +0 -28
- package/es/collection-manager/interfaces/radioGroup.d.ts +1 -29
- package/es/collection-manager/interfaces/richText.d.ts +1 -63
- package/es/collection-manager/interfaces/select.d.ts +12 -44
- package/es/collection-manager/interfaces/snowflake-id.d.ts +1 -34
- package/es/collection-manager/interfaces/tableoid.d.ts +1 -10
- package/es/collection-manager/interfaces/textarea.d.ts +1 -51
- package/es/collection-manager/interfaces/time.d.ts +1 -16
- package/es/collection-manager/interfaces/types.d.ts +3 -12
- package/es/collection-manager/interfaces/unixTimestamp.d.ts +1 -44
- package/es/collection-manager/interfaces/updatedAt.d.ts +1 -44
- package/es/collection-manager/interfaces/updatedBy.d.ts +0 -4
- package/es/collection-manager/interfaces/url.d.ts +1 -20
- package/es/collection-manager/interfaces/uuid.d.ts +1 -34
- package/es/collection-manager/template-fields.d.ts +53 -0
- package/es/components/KeepAlive.d.ts +22 -0
- package/es/components/RouterBridge.d.ts +9 -0
- package/es/components/form/DialogFormLayout.d.ts +5 -29
- package/es/components/form/TypedVariableInput.d.ts +75 -0
- package/es/components/form/VariableInput.d.ts +53 -2
- package/es/components/form/filter/CollectionFilter.d.ts +49 -0
- package/es/components/form/filter/CollectionFilterItem.d.ts +49 -0
- package/es/components/form/filter/DateFilterDynamicComponent.d.ts +57 -0
- package/es/components/form/filter/FilterValueInput.d.ts +29 -0
- package/es/components/form/filter/index.d.ts +11 -0
- package/es/components/form/filter/useFilterActionProps.d.ts +96 -0
- package/es/components/form/index.d.ts +2 -0
- package/es/data-source/ExtendCollectionsProvider.d.ts +50 -0
- package/es/data-source/index.d.ts +9 -0
- package/es/flow/FlowPage.d.ts +2 -1
- package/es/flow/admin-shell/AdminLayoutRouteCoordinator.d.ts +8 -40
- package/es/flow/admin-shell/BaseLayoutModel.d.ts +89 -0
- package/es/flow/admin-shell/BaseLayoutRouteCoordinator.d.ts +74 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.d.ts +12 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutMenuModels.d.ts +1 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutModel.d.ts +7 -92
- package/es/flow/admin-shell/admin-layout/AppListRender.d.ts +11 -0
- package/es/flow/admin-shell/admin-layout/index.d.ts +3 -0
- package/es/flow/admin-shell/admin-layout/useApplications.d.ts +3 -2
- package/es/flow/admin-shell/useAdminLayoutRoutePage.d.ts +2 -2
- package/es/flow/admin-shell/useLayoutRoutePage.d.ts +23 -0
- package/es/flow/components/ConditionBuilder.d.ts +1 -0
- package/es/flow/components/FieldAssignRulesEditor.d.ts +3 -1
- package/es/flow/components/FieldAssignValueInput.d.ts +1 -0
- package/es/flow/components/FlowRoute.d.ts +10 -1
- package/es/flow/components/fieldAssignOptions.d.ts +10 -0
- package/es/flow/components/filter/LinkageFilterItem.d.ts +1 -0
- package/es/flow/components/filter/VariableFilterItem.d.ts +1 -0
- package/es/flow/components/filter/index.d.ts +2 -0
- package/es/flow/components/filter/metaTreeAssociationDepth.d.ts +13 -0
- package/es/flow/components/filter/useFilterOptions.d.ts +66 -0
- package/es/flow/index.d.ts +4 -0
- package/es/flow/models/base/AssociationFieldGroupModel.d.ts +2 -33
- package/es/flow/models/base/PageModel/PageModel.d.ts +3 -1
- package/es/flow/models/blocks/assign-form/assignFieldValuesFlow.d.ts +92 -0
- package/es/flow/models/blocks/assign-form/index.d.ts +1 -0
- package/es/flow/models/blocks/form/FormActionGroupModel.d.ts +1 -0
- package/es/flow/models/blocks/form/FormActionModel.d.ts +9 -2
- package/es/flow/models/blocks/table/TableBlockModel.d.ts +10 -0
- package/es/flow/models/blocks/table/TableColumnModel.d.ts +2 -0
- package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/index.d.ts +1 -1
- package/es/flow-compat/passwordUtils.d.ts +1 -1
- package/es/index.d.ts +6 -0
- package/es/index.mjs +552 -459
- package/es/layout-manager/LayoutContentRoute.d.ts +14 -0
- package/es/layout-manager/LayoutManager.d.ts +22 -0
- package/es/layout-manager/LayoutRoute.d.ts +14 -0
- package/es/layout-manager/index.d.ts +13 -0
- package/es/layout-manager/types.d.ts +20 -0
- package/es/layout-manager/utils.d.ts +14 -0
- package/es/nocobase-buildin-plugin/index.d.ts +3 -10
- package/es/settings-center/index.d.ts +1 -1
- package/es/settings-center/plugin-manager/BulkEnableButton.d.ts +15 -0
- package/es/settings-center/plugin-manager/PluginCard.d.ts +15 -0
- package/es/settings-center/plugin-manager/PluginDetail.d.ts +16 -0
- package/es/settings-center/{PluginManagerPage.d.ts → plugin-manager/index.d.ts} +1 -7
- package/es/settings-center/plugin-manager/types.d.ts +34 -0
- package/lib/index.js +552 -459
- package/package.json +8 -7
- package/src/Application.tsx +51 -12
- package/src/BaseApplication.tsx +32 -0
- package/src/PluginSettingsManager.ts +1 -1
- package/src/RouterManager.tsx +17 -1
- package/src/__tests__/PluginSettingsManager.test.ts +41 -2
- package/src/__tests__/app.test.tsx +17 -1
- package/src/__tests__/globalDeps.test.ts +1 -0
- package/src/__tests__/nocobase-buildin-plugin-auth.test.tsx +50 -2
- package/src/__tests__/plugin-manager.test.tsx +177 -0
- package/src/__tests__/settings-center.test.tsx +24 -2
- package/src/authRedirect.ts +43 -0
- package/src/collection-field-interface/CollectionFieldInterface.ts +71 -77
- package/src/collection-field-interface/CollectionFieldInterfaceManager.ts +201 -4
- package/src/collection-manager/field-configure.ts +548 -0
- package/src/collection-manager/field-validation.ts +195 -0
- package/src/collection-manager/filter-operators/index.ts +176 -0
- package/src/collection-manager/{interfaces/properties → filter-operators}/operators.ts +24 -13
- package/src/collection-manager/interfaces/checkbox.ts +2 -9
- package/src/collection-manager/interfaces/checkboxGroup.ts +2 -10
- package/src/collection-manager/interfaces/collection.ts +2 -15
- package/src/collection-manager/interfaces/color.ts +2 -2
- package/src/collection-manager/interfaces/createdAt.ts +2 -2
- package/src/collection-manager/interfaces/createdBy.ts +1 -12
- package/src/collection-manager/interfaces/dateOnly.ts +8 -2
- package/src/collection-manager/interfaces/datetime.ts +2 -2
- package/src/collection-manager/interfaces/datetimeNoTz.ts +2 -2
- package/src/collection-manager/interfaces/email.ts +2 -9
- package/src/collection-manager/interfaces/id.ts +1 -2
- package/src/collection-manager/interfaces/index.ts +2 -3
- package/src/collection-manager/interfaces/input.ts +2 -133
- package/src/collection-manager/interfaces/integer.ts +2 -71
- package/src/collection-manager/interfaces/json.tsx +17 -11
- package/src/collection-manager/interfaces/m2m.tsx +0 -21
- package/src/collection-manager/interfaces/m2o.tsx +0 -22
- package/src/collection-manager/interfaces/markdown.ts +2 -51
- package/src/collection-manager/interfaces/multipleSelect.ts +2 -14
- package/src/collection-manager/interfaces/nanoid.ts +2 -2
- package/src/collection-manager/interfaces/number.ts +2 -85
- package/src/collection-manager/interfaces/o2m.tsx +1 -22
- package/src/collection-manager/interfaces/obo.tsx +145 -0
- package/src/collection-manager/interfaces/oho.tsx +145 -0
- package/src/collection-manager/interfaces/password.ts +2 -44
- package/src/collection-manager/interfaces/percent.ts +2 -74
- package/src/collection-manager/interfaces/phone.ts +2 -2
- package/src/collection-manager/interfaces/properties/index.ts +0 -133
- package/src/collection-manager/interfaces/radioGroup.ts +2 -2
- package/src/collection-manager/interfaces/richText.ts +2 -51
- package/src/collection-manager/interfaces/select.ts +2 -14
- package/src/collection-manager/interfaces/snowflake-id.ts +2 -2
- package/src/collection-manager/interfaces/tableoid.ts +1 -2
- package/src/collection-manager/interfaces/textarea.ts +2 -51
- package/src/collection-manager/interfaces/time.ts +2 -2
- package/src/collection-manager/interfaces/types.ts +4 -12
- package/src/collection-manager/interfaces/unixTimestamp.tsx +2 -2
- package/src/collection-manager/interfaces/updatedAt.ts +2 -2
- package/src/collection-manager/interfaces/updatedBy.ts +1 -12
- package/src/collection-manager/interfaces/url.ts +2 -4
- package/src/collection-manager/interfaces/uuid.ts +2 -2
- package/src/collection-manager/template-fields.ts +109 -0
- package/src/components/KeepAlive.tsx +131 -0
- package/src/components/README.md +138 -6
- package/src/components/README.zh-CN.md +138 -7
- package/src/components/RouterBridge.tsx +28 -4
- package/src/components/__tests__/KeepAlive.test.tsx +63 -0
- package/src/components/__tests__/RouterBridge.test.tsx +27 -0
- package/src/components/form/DialogFormLayout.tsx +5 -29
- package/src/components/form/TypedVariableInput.tsx +441 -0
- package/src/components/form/VariableInput.tsx +101 -28
- package/src/components/form/__tests__/TypedVariableInput.test.tsx +152 -0
- package/src/components/form/__tests__/VariableInput.test.ts +85 -0
- package/src/components/form/filter/CollectionFilter.tsx +111 -0
- package/src/components/form/filter/CollectionFilterItem.tsx +184 -0
- package/src/components/form/filter/DateFilterDynamicComponent.tsx +283 -0
- package/src/components/form/filter/FilterValueInput.tsx +198 -0
- package/src/components/form/filter/__tests__/CollectionFilterItem.test.tsx +247 -0
- package/src/components/form/filter/__tests__/DateFilterDynamicComponent.test.tsx +148 -0
- package/src/components/form/filter/__tests__/FilterValueInput.test.tsx +243 -0
- package/src/components/form/filter/__tests__/compileFilterGroup.test.ts +146 -0
- package/src/components/form/filter/index.ts +13 -0
- package/src/components/form/filter/useFilterActionProps.ts +203 -0
- package/src/components/form/index.tsx +2 -0
- package/src/data-source/ExtendCollectionsProvider.tsx +144 -0
- package/src/data-source/__tests__/ExtendCollectionsProvider.test.tsx +264 -0
- package/src/data-source/index.ts +10 -0
- package/src/flow/FlowPage.tsx +35 -7
- package/src/flow/__tests__/FlowPage.test.tsx +79 -0
- package/src/flow/__tests__/FlowRoute.test.tsx +537 -3
- package/src/flow/actions/__tests__/linkageRules.hiddenSync.restore.test.ts +100 -0
- package/src/flow/actions/__tests__/linkageRules.subFormSetFieldProps.test.ts +191 -0
- package/src/flow/actions/__tests__/linkageRulesRefresh.test.ts +23 -1
- package/src/flow/actions/__tests__/openView.subModelKey.test.tsx +33 -0
- package/src/flow/actions/aclCheck.tsx +4 -0
- package/src/flow/actions/aclCheckRefresh.tsx +4 -0
- package/src/flow/actions/dataScope.tsx +8 -1
- package/src/flow/actions/dateTimeFormat.tsx +12 -8
- package/src/flow/actions/linkageRules.tsx +127 -2
- package/src/flow/actions/linkageRulesRefresh.tsx +2 -3
- package/src/flow/actions/openView.tsx +28 -4
- package/src/flow/actions/setTargetDataScope.tsx +1 -1
- package/src/flow/admin-shell/AdminLayoutRouteCoordinator.ts +11 -329
- package/src/flow/admin-shell/BaseLayoutModel.tsx +455 -0
- package/src/flow/admin-shell/BaseLayoutRouteCoordinator.ts +502 -0
- package/src/flow/admin-shell/__tests__/AdminLayoutRouteCoordinator.test.ts +547 -3
- package/src/flow/admin-shell/admin-layout/AdminLayoutComponent.tsx +35 -7
- package/src/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.tsx +160 -0
- package/src/flow/admin-shell/admin-layout/AdminLayoutMenuModels.tsx +15 -13
- package/src/flow/admin-shell/admin-layout/AdminLayoutModel.tsx +28 -201
- package/src/flow/admin-shell/admin-layout/AdminLayoutSlotModels.tsx +11 -2
- package/src/flow/admin-shell/admin-layout/AppListRender.tsx +139 -0
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutMenuModels.test.ts +76 -27
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutModel.test.tsx +149 -27
- package/src/flow/admin-shell/admin-layout/index.ts +3 -0
- package/src/flow/admin-shell/admin-layout/resolveAdminRouteRuntimeTarget.test.ts +11 -0
- package/src/flow/admin-shell/admin-layout/resolveAdminRouteRuntimeTarget.ts +2 -4
- package/src/flow/admin-shell/admin-layout/useApplications.tsx +34 -1
- package/src/flow/admin-shell/useAdminLayoutRoutePage.ts +10 -26
- package/src/flow/admin-shell/useLayoutRoutePage.ts +61 -0
- package/src/flow/common/Markdown/Edit.tsx +32 -4
- package/src/flow/components/AdminLayout.tsx +4 -154
- package/src/flow/components/ConditionBuilder.tsx +12 -2
- package/src/flow/components/FieldAssignRulesEditor.tsx +37 -46
- package/src/flow/components/FieldAssignValueInput.tsx +8 -4
- package/src/flow/components/FlowRoute.tsx +105 -15
- package/src/flow/components/__tests__/FieldAssignRulesEditor.test.tsx +112 -1
- package/src/flow/components/__tests__/fieldAssignOptions.test.ts +71 -1
- package/src/flow/components/code-editor/__tests__/runjsCompletions.test.ts +272 -27
- package/src/flow/components/code-editor/runjsCompletions.ts +490 -9
- package/src/flow/components/fieldAssignOptions.ts +23 -6
- package/src/flow/components/filter/LinkageFilterItem.tsx +22 -9
- package/src/flow/components/filter/VariableFilterItem.tsx +27 -9
- package/src/flow/components/filter/__tests__/fieldsToOptions.test.ts +48 -0
- package/src/flow/components/filter/__tests__/metaTreeAssociationDepth.test.ts +60 -0
- package/src/flow/components/filter/fieldsToOptions.ts +9 -4
- package/src/flow/components/filter/index.ts +3 -0
- package/src/flow/components/filter/metaTreeAssociationDepth.ts +69 -0
- package/src/flow/components/filter/useFilterOptions.ts +102 -0
- package/src/flow/index.ts +4 -0
- package/src/flow/models/actions/FilterActionModel.tsx +15 -3
- package/src/flow/models/actions/UpdateRecordActionModel.tsx +14 -95
- package/src/flow/models/actions/UpdateRecordActionUtils.ts +4 -7
- package/src/flow/models/actions/__tests__/AssignFormRefill.test.ts +116 -1
- package/src/flow/models/base/ActionModel.tsx +8 -1
- package/src/flow/models/base/AssociationFieldGroupModel.tsx +20 -3
- package/src/flow/models/base/GridModel.tsx +1 -1
- package/src/flow/models/base/PageModel/ChildPageModel.tsx +5 -1
- package/src/flow/models/base/PageModel/PageModel.tsx +51 -18
- package/src/flow/models/base/PageModel/RootPageModel.tsx +6 -13
- package/src/flow/models/base/PageModel/__tests__/ChildPageModel.test.ts +12 -0
- package/src/flow/models/base/PageModel/__tests__/PageModel.test.ts +102 -1
- package/src/flow/models/base/RouteModel.tsx +1 -1
- package/src/flow/models/base/__tests__/AssociationFieldGroupModel.test.ts +86 -0
- package/src/flow/models/base/__tests__/GridModel.render.test.tsx +53 -0
- package/src/flow/models/blocks/assign-form/AssignFormGridModel.tsx +12 -3
- package/src/flow/models/blocks/assign-form/AssignFormItemModel.tsx +77 -6
- package/src/flow/models/blocks/assign-form/__tests__/assignFieldValuesFlow.editor.test.tsx +216 -0
- package/src/flow/models/blocks/assign-form/assignFieldValuesFlow.tsx +308 -0
- package/src/flow/models/blocks/assign-form/index.ts +1 -0
- package/src/flow/models/blocks/filter-form/FilterFormItemModel.tsx +1 -1
- package/src/flow/models/blocks/filter-form/__tests__/FilterFormItemModel.defineChildren.test.ts +6 -1
- package/src/flow/models/blocks/filter-manager/flow-actions/connectFields.tsx +48 -6
- package/src/flow/models/blocks/form/FormActionGroupModel.tsx +14 -0
- package/src/flow/models/blocks/form/FormActionModel.tsx +30 -3
- package/src/flow/models/blocks/form/FormAssociationItemModel.tsx +9 -0
- package/src/flow/models/blocks/form/FormItemModel.tsx +17 -1
- package/src/flow/models/blocks/form/__tests__/FormActionGroupModel.test.ts +46 -0
- package/src/flow/models/blocks/form/__tests__/FormBlockModel.test.tsx +17 -0
- package/src/flow/models/blocks/form/__tests__/FormItemModel.defineChildren.test.ts +27 -2
- package/src/flow/models/blocks/form/__tests__/submitHandler.test.ts +71 -0
- package/src/flow/models/blocks/form/submitHandler.ts +8 -1
- package/src/flow/models/blocks/form/submitValues.ts +4 -1
- package/src/flow/models/blocks/form/value-runtime/__tests__/runtime.test.ts +29 -0
- package/src/flow/models/blocks/form/value-runtime/runtime.ts +5 -1
- package/src/flow/models/blocks/table/TableBlockModel.tsx +118 -16
- package/src/flow/models/blocks/table/TableColumnModel.tsx +15 -5
- package/src/flow/models/blocks/table/TableCustomColumnModel.tsx +2 -2
- package/src/flow/models/blocks/table/__tests__/TableBlockModel.rowSelection.test.tsx +114 -0
- package/src/flow/models/blocks/table/__tests__/TableColumnModel.test.tsx +18 -0
- package/src/flow/models/fields/AssociationFieldModel/SubFormFieldModel.tsx +7 -1
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.tsx +6 -7
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableField.tsx +1 -1
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/index.tsx +6 -5
- package/src/flow/models/fields/ClickableFieldModel.tsx +9 -1
- package/src/flow/models/fields/CollectionSelectorFieldModel.tsx +8 -2
- package/src/flow/models/fields/DisplayEnumFieldModel.tsx +8 -2
- package/src/flow/models/fields/DisplayTimeFieldModel.tsx +1 -1
- package/src/flow/models/fields/TimeFieldModel.tsx +1 -1
- package/src/flow/models/fields/__tests__/TimeFieldModel.test.tsx +61 -0
- package/src/flow/models/fields/mobile-components/MobileDatePicker.tsx +19 -3
- package/src/flow/models/fields/mobile-components/MobileLazySelect.tsx +5 -3
- package/src/flow/models/fields/mobile-components/__tests__/MobileDatePicker.test.tsx +94 -0
- package/src/flow/models/fields/mobile-components/__tests__/MobileSelect.test.tsx +70 -0
- package/src/flow/models/topbar/TopbarActionModel.tsx +1 -1
- package/src/flow/utils/__tests__/dateTimeFormat.test.ts +91 -0
- package/src/index.ts +6 -0
- package/src/layout-manager/LayoutContentRoute.tsx +90 -0
- package/src/layout-manager/LayoutManager.tsx +185 -0
- package/src/layout-manager/LayoutRoute.tsx +138 -0
- package/src/layout-manager/__tests__/LayoutManager.test.tsx +335 -0
- package/src/layout-manager/__tests__/LayoutRoute.test.tsx +473 -0
- package/src/layout-manager/index.ts +14 -0
- package/src/layout-manager/types.ts +22 -0
- package/src/layout-manager/utils.ts +37 -0
- package/src/nocobase-buildin-plugin/index.tsx +69 -67
- package/src/nocobase-buildin-plugin/plugins/LocalePlugin.ts +1 -0
- package/src/settings-center/index.ts +1 -1
- package/src/settings-center/plugin-manager/BulkEnableButton.tsx +111 -0
- package/src/settings-center/plugin-manager/PluginCard.tsx +270 -0
- package/src/settings-center/plugin-manager/PluginDetail.tsx +195 -0
- package/src/settings-center/plugin-manager/index.tsx +254 -0
- package/src/settings-center/plugin-manager/types.ts +35 -0
- package/src/settings-center/utils.tsx +8 -1
- package/src/theme/__tests__/globalStyles.test.ts +24 -0
- package/src/theme/globalStyles.ts +10 -0
- package/src/utils/globalDeps.ts +2 -0
- package/es/collection-manager/interfaces/linkTo.d.ts +0 -90
- package/es/collection-manager/interfaces/o2o.d.ts +0 -621
- package/es/collection-manager/interfaces/properties/operators.d.ts +0 -294
- package/es/collection-manager/interfaces/subTable.d.ts +0 -172
- package/src/collection-manager/interfaces/linkTo.ts +0 -120
- package/src/collection-manager/interfaces/o2o.tsx +0 -561
- package/src/collection-manager/interfaces/subTable.ts +0 -218
- package/src/settings-center/PluginManagerPage.tsx +0 -162
|
@@ -0,0 +1,96 @@
|
|
|
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 { Collection } from '@nocobase/flow-engine';
|
|
10
|
+
import { FilterOption, UseFilterOptionsArgs } from '../../../flow/components/filter/useFilterOptions';
|
|
11
|
+
import { CollectionFilterItemValue, createCollectionFilterItem } from './CollectionFilterItem';
|
|
12
|
+
/** A single condition row (`{ path, operator, value }`) or a nested group. */
|
|
13
|
+
export type FilterGroupItem = CollectionFilterItemValue | FilterGroupValue;
|
|
14
|
+
/**
|
|
15
|
+
* Reactive shape consumed by `FilterContainer` / `FilterGroup`. `logic` is the join (`$and` / `$or`) and `items` is a heterogeneous list of leaf conditions and nested groups.
|
|
16
|
+
*/
|
|
17
|
+
export type FilterGroupValue = {
|
|
18
|
+
logic: '$and' | '$or';
|
|
19
|
+
items: FilterGroupItem[];
|
|
20
|
+
};
|
|
21
|
+
/** Compiled filter param accepted by NocoBase resource `list`. */
|
|
22
|
+
export type CompiledFilter = Record<string, unknown> | undefined;
|
|
23
|
+
interface FilterCtxModel {
|
|
24
|
+
translate: (key: string) => string;
|
|
25
|
+
dispatchEvent: (event: 'submit' | 'reset' | (string & {})) => void;
|
|
26
|
+
}
|
|
27
|
+
export interface FilterCtx {
|
|
28
|
+
model: FilterCtxModel;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Compile a reactive filter group into the `{ $and: [{ path: { op: val } }] }` envelope accepted by NocoBase's resource `list` filter param. Returns `undefined` when the group is empty so callers can drop the param.
|
|
32
|
+
*
|
|
33
|
+
* Mirrors v1's `removeNullCondition` + filter compile path, but works on the v2 `{ logic, items }` group structure rather than v1's Formily-bracketed `$and.0.path.$eq` shape:
|
|
34
|
+
*
|
|
35
|
+
* - Rows missing `path` or `operator` are dropped (still mid-edit).
|
|
36
|
+
* - Rows whose `value` is empty (`undefined`, `''`, `[]`, `{}`) are dropped — matches v1, which sends `filter={}` for a row with only a field/operator picked. Sending `{lockedTs:{}}` would 500.
|
|
37
|
+
* - Dotted association paths (`user.createdBy.password`) are expanded into nested objects — matches v1's payload shape, which the server resolves along the association chain rather than treating the dotted string as a single key.
|
|
38
|
+
* - Empty groups (after pruning) propagate as `undefined` so the outermost caller can drop the whole `filter` param.
|
|
39
|
+
*/
|
|
40
|
+
export declare function compileFilterGroup(group: FilterGroupValue | undefined): CompiledFilter;
|
|
41
|
+
/** Which footer button triggered the apply — useful for closing a popover on Submit but keeping it open on Reset. */
|
|
42
|
+
export type FilterApplyAction = 'submit' | 'reset';
|
|
43
|
+
export interface UseFilterActionPropsArgs extends UseFilterOptionsArgs {
|
|
44
|
+
/** Collection whose fields populate the filter row's field picker. */
|
|
45
|
+
collection: Collection | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* 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(); }`.
|
|
48
|
+
*/
|
|
49
|
+
onApply: (filter: CompiledFilter, action: FilterApplyAction) => void;
|
|
50
|
+
}
|
|
51
|
+
export interface UseFilterActionPropsResult {
|
|
52
|
+
/**
|
|
53
|
+
* Reactive filter group state. Pass directly to `<FilterContent value={...}>`. Stable across renders.
|
|
54
|
+
*/
|
|
55
|
+
value: FilterGroupValue;
|
|
56
|
+
/** Field-option tree (for inspection or custom badges). */
|
|
57
|
+
options: FilterOption[];
|
|
58
|
+
/** Bound `FilterItem` component to plug into `<FilterContent FilterItem={...}>`. */
|
|
59
|
+
FilterItem: ReturnType<typeof createCollectionFilterItem> | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Ready-to-use `ctx` for `<FilterContent ctx={...}>`. Wires Submit / Reset buttons to `onSubmit` / `onReset` below.
|
|
62
|
+
*/
|
|
63
|
+
ctx: FilterCtx;
|
|
64
|
+
/** Imperative trigger — submit current group as a compiled filter. */
|
|
65
|
+
onSubmit: () => void;
|
|
66
|
+
/** Imperative trigger — clear the group and emit an empty filter. */
|
|
67
|
+
onReset: () => void;
|
|
68
|
+
/**
|
|
69
|
+
* Count of top-level condition rows. Useful for showing a badge like `Filter (3)` on the trigger button — matches v1's `field.title = t('{{count}} filter items', { count })`.
|
|
70
|
+
*/
|
|
71
|
+
conditionCount: number;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* v2 equivalent of v1's `useFilterActionProps` for non-schema surfaces (settings pages, panels, side drawers). Bundles three things v1's hook returned implicitly through schema:
|
|
75
|
+
*
|
|
76
|
+
* - A reactive `{ logic, items }` group state that `<FilterContent>` reads.
|
|
77
|
+
* - A bound `FilterItem` component (driven by `createCollectionFilterItem`).
|
|
78
|
+
* - A `ctx` object that turns `<FilterContent>`'s `dispatchEvent('submit' | 'reset')` into a compiled filter param passed to `onApply`.
|
|
79
|
+
*
|
|
80
|
+
* Pair with antd `Popover` to recreate the legacy `Filter.Action` UX:
|
|
81
|
+
*
|
|
82
|
+
* ```tsx
|
|
83
|
+
* const { value, ctx, FilterItem, onSubmit, conditionCount } = useFilterActionProps({
|
|
84
|
+
* collection,
|
|
85
|
+
* onApply: (filter) => listRequest.run(filter),
|
|
86
|
+
* t,
|
|
87
|
+
* });
|
|
88
|
+
* return (
|
|
89
|
+
* <Popover content={<FilterContent value={value} ctx={ctx} FilterItem={FilterItem} />}>
|
|
90
|
+
* <Button>{t('Filter')}{conditionCount ? ` (${conditionCount})` : ''}</Button>
|
|
91
|
+
* </Popover>
|
|
92
|
+
* );
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
export declare function useFilterActionProps(args: UseFilterActionPropsArgs): UseFilterActionPropsResult;
|
|
96
|
+
export {};
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
export * from './createFormRegistry';
|
|
10
|
+
export * from './filter';
|
|
10
11
|
export * from './DialogFormLayout';
|
|
11
12
|
export * from './DrawerFormLayout';
|
|
12
13
|
export * from './EnvVariableInput';
|
|
@@ -14,4 +15,5 @@ export * from './FileSizeInput';
|
|
|
14
15
|
export * from './JsonTextArea';
|
|
15
16
|
export * from './PasswordInput';
|
|
16
17
|
export * from './RemoteSelect';
|
|
18
|
+
export * from './TypedVariableInput';
|
|
17
19
|
export * from './VariableInput';
|
|
@@ -0,0 +1,50 @@
|
|
|
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 { CollectionOptions } from '@nocobase/flow-engine';
|
|
10
|
+
import { FC, ReactNode } from 'react';
|
|
11
|
+
export interface ExtendCollectionsProviderProps {
|
|
12
|
+
/** Data source key to extend. Defaults to `'main'`. */
|
|
13
|
+
dataSource?: string;
|
|
14
|
+
/** Collections to surface for the lifetime of this provider's subtree. */
|
|
15
|
+
collections: CollectionOptions[];
|
|
16
|
+
/**
|
|
17
|
+
* When `true`, re-sync the data source whenever the `collections` prop
|
|
18
|
+
* reference changes after mount: add entries newly present in the prop and
|
|
19
|
+
* remove entries no longer present (only those this provider registered).
|
|
20
|
+
* The diff runs in the same render as the prop change so children see the
|
|
21
|
+
* new state on their first render — at the cost of one observable mutation
|
|
22
|
+
* per change.
|
|
23
|
+
*
|
|
24
|
+
* Defaults to `false`. Most pages pass a stable (often module-level)
|
|
25
|
+
* `collections` list and don't need this; leaving it off avoids accidental
|
|
26
|
+
* re-registration when callers forget to memoize. Enable only when your
|
|
27
|
+
* collection list legitimately varies during the provider's lifetime.
|
|
28
|
+
*/
|
|
29
|
+
syncOnChange?: boolean;
|
|
30
|
+
children?: ReactNode;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Mount-scoped collection injector. Adds the given `collections` to the target
|
|
34
|
+
* data source on first render — synchronously, so children can read
|
|
35
|
+
* `getCollection(name)` on their own first render — and removes them on
|
|
36
|
+
* unmount. Survives mid-session data-source reloads via the
|
|
37
|
+
* `dataSource:loaded` event by re-registering only the names this provider
|
|
38
|
+
* owns.
|
|
39
|
+
*
|
|
40
|
+
* Use this for client-only collections — e.g. a `schema-only` server
|
|
41
|
+
* collection that isn't auto-published to the v2 data source, or a pure
|
|
42
|
+
* UI-side mirror — so downstream components (like `<CollectionFilter>`) can
|
|
43
|
+
* resolve the collection by name.
|
|
44
|
+
*
|
|
45
|
+
* Default behavior is "static-at-mount": subsequent changes to the
|
|
46
|
+
* `collections` prop are ignored. Pass `syncOnChange` to opt into diffing on
|
|
47
|
+
* prop change.
|
|
48
|
+
*/
|
|
49
|
+
export declare const ExtendCollectionsProvider: FC<ExtendCollectionsProviderProps>;
|
|
50
|
+
export default ExtendCollectionsProvider;
|
|
@@ -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 './ExtendCollectionsProvider';
|
package/es/flow/FlowPage.d.ts
CHANGED
|
@@ -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
|
-
import type { FlowModel } from '@nocobase/flow-engine';
|
|
9
|
+
import type { FlowModel, FlowModelRendererProps } from '@nocobase/flow-engine';
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import FlowRoute from './components/FlowRoute';
|
|
12
12
|
type FlowPageProps = {
|
|
@@ -14,6 +14,7 @@ type FlowPageProps = {
|
|
|
14
14
|
parentId?: string;
|
|
15
15
|
onModelLoaded?: (uid: string, model: FlowModel) => void;
|
|
16
16
|
defaultTabTitle?: string;
|
|
17
|
+
showFlowSettings?: FlowModelRendererProps['showFlowSettings'];
|
|
17
18
|
};
|
|
18
19
|
export declare const FlowPage: React.MemoExoticComponent<(props: FlowPageProps & Record<string, unknown>) => React.JSX.Element>;
|
|
19
20
|
export declare const RemoteFlowModelRenderer: (props: any) => React.JSX.Element;
|
|
@@ -6,46 +6,14 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
-
import { FlowEngine
|
|
10
|
-
|
|
11
|
-
active: boolean;
|
|
12
|
-
refreshDesktopRoutes?: () => Promise<unknown>;
|
|
13
|
-
layoutContentElement?: HTMLElement | null;
|
|
14
|
-
}
|
|
15
|
-
interface RouteLike {
|
|
16
|
-
params?: {
|
|
17
|
-
name?: string;
|
|
18
|
-
};
|
|
19
|
-
pathname?: string;
|
|
20
|
-
}
|
|
9
|
+
import type { FlowEngine } from '@nocobase/flow-engine';
|
|
10
|
+
import { BaseLayoutRouteCoordinator, type BaseLayoutRouteCoordinatorOptions } from './BaseLayoutRouteCoordinator';
|
|
21
11
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
12
|
+
* Admin Layout 路由协调器。
|
|
13
|
+
*
|
|
14
|
+
* 该类保留旧导出路径,内部复用通用 BaseLayoutRouteCoordinator。
|
|
24
15
|
*/
|
|
25
|
-
export declare class AdminLayoutRouteCoordinator {
|
|
26
|
-
|
|
27
|
-
private readonly runtimes;
|
|
28
|
-
private layoutContentElement;
|
|
29
|
-
private setRuntimeActive;
|
|
30
|
-
private getCurrentRouteByPageUid;
|
|
31
|
-
constructor(flowEngine: FlowEngine);
|
|
32
|
-
setLayoutContentElement(element: HTMLElement | null): void;
|
|
33
|
-
registerPage(pageUid: string, meta: RoutePageMeta): FlowModel<import("@nocobase/flow-engine").DefaultStructure>;
|
|
34
|
-
syncPageMeta(pageUid: string, meta: Partial<RoutePageMeta>): void;
|
|
35
|
-
unregisterPage(pageUid: string): void;
|
|
36
|
-
syncRoute(routeLike: RouteLike): void;
|
|
37
|
-
cleanupPage(pageUid: string): void;
|
|
38
|
-
destroy(): void;
|
|
39
|
-
private syncRuntimeWithPathname;
|
|
40
|
-
private shouldStepNavigate;
|
|
41
|
-
private stepNavigate;
|
|
42
|
-
private handleOpenViews;
|
|
43
|
-
private openViews;
|
|
44
|
-
private ensureRouteModelContext;
|
|
45
|
-
private getOrCreateRouteModel;
|
|
16
|
+
export declare class AdminLayoutRouteCoordinator extends BaseLayoutRouteCoordinator {
|
|
17
|
+
constructor(flowEngine: FlowEngine, options?: BaseLayoutRouteCoordinatorOptions);
|
|
46
18
|
}
|
|
47
|
-
|
|
48
|
-
* 将 pathname 解析结果和 pageUid 对齐,便于测试里复用。
|
|
49
|
-
*/
|
|
50
|
-
export declare function toViewStack(pathname: string): ViewParam[];
|
|
51
|
-
export {};
|
|
19
|
+
export { toViewStack, type BaseLayoutRouteCoordinatorOptions, type RoutePageMeta } from './BaseLayoutRouteCoordinator';
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { type FlowEngine, FlowModel, type ViewParam } from '@nocobase/flow-engine';
|
|
10
|
+
import { BaseLayoutRouteCoordinator, type BaseLayoutRouteCoordinatorOptions, type RoutePageMeta } from './BaseLayoutRouteCoordinator';
|
|
11
|
+
import type { LayoutDefinition } from '../../layout-manager/types';
|
|
12
|
+
export type BaseLayoutStructure = {
|
|
13
|
+
subModels?: Record<string, FlowModel[]>;
|
|
14
|
+
};
|
|
15
|
+
export type GetLayoutModelOptions<TModel extends FlowModel = BaseLayoutModel> = {
|
|
16
|
+
required?: boolean;
|
|
17
|
+
create?: boolean;
|
|
18
|
+
props?: any;
|
|
19
|
+
use?: new (...args: any[]) => TModel;
|
|
20
|
+
};
|
|
21
|
+
export type LayoutRouteMatch = {
|
|
22
|
+
type: 'root';
|
|
23
|
+
pathname: string;
|
|
24
|
+
basePathname: string;
|
|
25
|
+
relativePath: string;
|
|
26
|
+
} | {
|
|
27
|
+
type: 'page';
|
|
28
|
+
pathname: string;
|
|
29
|
+
basePathname: string;
|
|
30
|
+
relativePath: string;
|
|
31
|
+
pageUid: string;
|
|
32
|
+
tabUid?: string;
|
|
33
|
+
viewStack: ViewParam[];
|
|
34
|
+
} | {
|
|
35
|
+
type: 'notFound';
|
|
36
|
+
pathname: string;
|
|
37
|
+
basePathname: string;
|
|
38
|
+
relativePath: string;
|
|
39
|
+
};
|
|
40
|
+
export interface LayoutRouteLike {
|
|
41
|
+
id?: string;
|
|
42
|
+
name?: string;
|
|
43
|
+
pathname?: string;
|
|
44
|
+
params?: Record<string, string | undefined>;
|
|
45
|
+
layoutRouteName?: string;
|
|
46
|
+
layoutBasePathname?: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* 通用 Layout 运行时模型。
|
|
50
|
+
*
|
|
51
|
+
* 该模型封装页面路由桥接、弹窗路由、page tab 路由、布局容器和移动端状态,
|
|
52
|
+
* Admin、Embed 等具体 Layout 只需要继承并实现各自的渲染和专属业务能力。
|
|
53
|
+
*/
|
|
54
|
+
export declare class BaseLayoutModel<TStructure extends BaseLayoutStructure = BaseLayoutStructure> extends FlowModel<TStructure> {
|
|
55
|
+
isMobileLayout: boolean;
|
|
56
|
+
currentLayoutRoute: LayoutRouteMatch | null;
|
|
57
|
+
protected routeCoordinator?: BaseLayoutRouteCoordinator;
|
|
58
|
+
private activePageUid;
|
|
59
|
+
private layoutContentElement;
|
|
60
|
+
private readonly routePageMetaMap;
|
|
61
|
+
private contextBindingsActive;
|
|
62
|
+
constructor(options: any);
|
|
63
|
+
registerRoutePage(pageUid: string, meta: RoutePageMeta): import("..").RouteModel<import("@nocobase/flow-engine").DefaultStructure>;
|
|
64
|
+
updateRoutePage(pageUid: string, meta: Partial<RoutePageMeta>): void;
|
|
65
|
+
unregisterRoutePage(pageUid: string): void;
|
|
66
|
+
setLayoutContentElement(element: HTMLElement | null): void;
|
|
67
|
+
setIsMobileLayout(isMobileLayout: boolean): void;
|
|
68
|
+
getCurrentRouteByPageUid(pageUid: string): any;
|
|
69
|
+
get layout(): LayoutDefinition;
|
|
70
|
+
getCoordinator(): BaseLayoutRouteCoordinator;
|
|
71
|
+
protected createRouteCoordinator(): BaseLayoutRouteCoordinator;
|
|
72
|
+
protected getRouteCoordinatorOptions(): BaseLayoutRouteCoordinatorOptions;
|
|
73
|
+
protected getPageUidFromRoute(route: any): any;
|
|
74
|
+
isLayoutContentRoute(routeLike: LayoutRouteLike): boolean;
|
|
75
|
+
resolveLayoutRoute(routeLike: LayoutRouteLike): LayoutRouteMatch;
|
|
76
|
+
getPageUidFromLayoutRoute(match: LayoutRouteMatch | null | undefined): string;
|
|
77
|
+
syncLayoutRoute(routeLike: LayoutRouteLike): LayoutRouteMatch;
|
|
78
|
+
clearLayoutRoute(routeLike?: LayoutRouteLike): void;
|
|
79
|
+
protected onMount(): void;
|
|
80
|
+
protected onUnmount(): void;
|
|
81
|
+
private setupContextBindings;
|
|
82
|
+
private teardownRuntime;
|
|
83
|
+
private getCurrentRouteByActivePage;
|
|
84
|
+
private getCurrentCoordinatorRouteLike;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* 按固定 UID 获取或创建 Layout host model。
|
|
88
|
+
*/
|
|
89
|
+
export declare function getLayoutModel<TModel extends FlowModel = BaseLayoutModel>(flowEngine: FlowEngine, uid: string, options?: GetLayoutModelOptions<TModel>): TModel;
|
|
@@ -0,0 +1,74 @@
|
|
|
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 { FlowEngine, type FlowContext, type ViewParam } from '@nocobase/flow-engine';
|
|
10
|
+
import { RouteModel } from '../models/base/RouteModel';
|
|
11
|
+
import type { LayoutDefinition } from '../../layout-manager/types';
|
|
12
|
+
export interface RoutePageMeta {
|
|
13
|
+
active: boolean;
|
|
14
|
+
refreshDesktopRoutes?: () => Promise<unknown>;
|
|
15
|
+
layoutContentElement?: HTMLElement | null;
|
|
16
|
+
}
|
|
17
|
+
export interface BaseLayoutRouteCoordinatorOptions {
|
|
18
|
+
layout?: LayoutDefinition;
|
|
19
|
+
layoutContext?: FlowContext;
|
|
20
|
+
basePathname?: string;
|
|
21
|
+
}
|
|
22
|
+
interface RouteLike {
|
|
23
|
+
layoutRouteName?: string;
|
|
24
|
+
params?: {
|
|
25
|
+
name?: string;
|
|
26
|
+
};
|
|
27
|
+
pathname?: string;
|
|
28
|
+
pageUid?: string;
|
|
29
|
+
layoutBasePathname?: string;
|
|
30
|
+
layoutRoute?: {
|
|
31
|
+
type: string;
|
|
32
|
+
pageUid?: string;
|
|
33
|
+
basePathname?: string;
|
|
34
|
+
} | null;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* 通用 Layout 路由协调器。
|
|
38
|
+
*
|
|
39
|
+
* 负责把当前路由路径解析为 v2 view stack,并驱动 RouteModel 上的弹窗、抽屉和 page tab 状态。
|
|
40
|
+
* Admin、Embed 等布局只需要提供当前 Layout 的基准路径,即可复用同一套 view 编排逻辑。
|
|
41
|
+
*/
|
|
42
|
+
export declare class BaseLayoutRouteCoordinator {
|
|
43
|
+
protected readonly flowEngine: FlowEngine;
|
|
44
|
+
protected readonly layout: LayoutDefinition | undefined;
|
|
45
|
+
private readonly layoutContext?;
|
|
46
|
+
private basePathname;
|
|
47
|
+
private readonly runtimes;
|
|
48
|
+
private layoutContentElement;
|
|
49
|
+
constructor(flowEngine: FlowEngine, options?: BaseLayoutRouteCoordinatorOptions);
|
|
50
|
+
setLayoutContentElement(element: HTMLElement | null): void;
|
|
51
|
+
registerPage(pageUid: string, meta: RoutePageMeta): RouteModel<import("@nocobase/flow-engine").DefaultStructure>;
|
|
52
|
+
syncPageMeta(pageUid: string, meta: Partial<RoutePageMeta>): void;
|
|
53
|
+
unregisterPage(pageUid: string): void;
|
|
54
|
+
syncRoute(routeLike: RouteLike): void;
|
|
55
|
+
cleanupPage(pageUid: string): void;
|
|
56
|
+
destroy(): void;
|
|
57
|
+
protected getCurrentRouteByPageUid(pageUid: string): any;
|
|
58
|
+
private setRuntimeActive;
|
|
59
|
+
private notifyRuntimeActiveChange;
|
|
60
|
+
private syncRuntimeWithPathname;
|
|
61
|
+
private syncViewListVisibility;
|
|
62
|
+
private shouldStepNavigate;
|
|
63
|
+
private scheduleInitialDeepLinkReplay;
|
|
64
|
+
private stepNavigate;
|
|
65
|
+
private handleOpenViews;
|
|
66
|
+
private openViews;
|
|
67
|
+
private ensureRouteModelContext;
|
|
68
|
+
private getOrCreateRouteModel;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* 将 pathname 解析结果和 pageUid 对齐,便于测试里复用。
|
|
72
|
+
*/
|
|
73
|
+
export declare function toViewStack(pathname: string, options?: BaseLayoutRouteCoordinatorOptions): ViewParam[];
|
|
74
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
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, { type FC } from 'react';
|
|
10
|
+
export declare const AdminLayoutEntryGuard: FC<{
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}>;
|
|
@@ -45,6 +45,7 @@ export declare class AdminLayoutMenuItemModel extends FlowModel<AdminLayoutMenuI
|
|
|
45
45
|
* @returns {boolean} 是否需要走 FlowModel 默认保存链路
|
|
46
46
|
*/
|
|
47
47
|
hasPersistableInstanceFlows(): boolean;
|
|
48
|
+
serialize(): ReturnType<FlowModel['serialize']>;
|
|
48
49
|
setHidden(value: boolean): void;
|
|
49
50
|
protected renderHiddenInConfig(): React.ReactNode | undefined;
|
|
50
51
|
createMenuRoute(route: NocoBaseDesktopRoute, options?: {
|
|
@@ -7,22 +7,18 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import { type FlowEngine, FlowModel } from '@nocobase/flow-engine';
|
|
10
|
+
import React from 'react';
|
|
10
11
|
import type { NocoBaseDesktopRoute } from '../../../flow-compat';
|
|
11
|
-
import {
|
|
12
|
+
import { AdminLayoutRouteCoordinator } from '../AdminLayoutRouteCoordinator';
|
|
13
|
+
import { BaseLayoutModel, type BaseLayoutStructure, type GetLayoutModelOptions } from '../BaseLayoutModel';
|
|
12
14
|
import { type AdminLayoutMenuItemModel } from './AdminLayoutMenuModels';
|
|
13
15
|
import { type AdminLayoutMenuRouteOptions } from './AdminLayoutMenuUtils';
|
|
14
|
-
|
|
15
|
-
export type AdminLayoutStructure = {
|
|
16
|
+
export type AdminLayoutStructure = BaseLayoutStructure & {
|
|
16
17
|
subModels: {
|
|
17
18
|
menuItems?: AdminLayoutMenuItemModel[];
|
|
18
19
|
};
|
|
19
20
|
};
|
|
20
|
-
type GetAdminLayoutModelOptions<TModel extends FlowModel = AdminLayoutModel> =
|
|
21
|
-
required?: boolean;
|
|
22
|
-
create?: boolean;
|
|
23
|
-
props?: any;
|
|
24
|
-
use?: new (...args: any[]) => TModel;
|
|
25
|
-
};
|
|
21
|
+
type GetAdminLayoutModelOptions<TModel extends FlowModel = AdminLayoutModel> = GetLayoutModelOptions<TModel>;
|
|
26
22
|
/**
|
|
27
23
|
* Admin Layout 的纯运行时 host model。
|
|
28
24
|
*
|
|
@@ -35,14 +31,8 @@ type GetAdminLayoutModelOptions<TModel extends FlowModel = AdminLayoutModel> = {
|
|
|
35
31
|
* model.syncMenuRoutes(routes);
|
|
36
32
|
* ```
|
|
37
33
|
*/
|
|
38
|
-
export declare class AdminLayoutModel extends
|
|
39
|
-
isMobileLayout: boolean;
|
|
34
|
+
export declare class AdminLayoutModel extends BaseLayoutModel<AdminLayoutStructure> {
|
|
40
35
|
menuRouteRefreshVersion: number;
|
|
41
|
-
private routeCoordinator?;
|
|
42
|
-
private routeDisposer?;
|
|
43
|
-
private activePageUid;
|
|
44
|
-
private layoutContentElement;
|
|
45
|
-
private readonly routePageMetaMap;
|
|
46
36
|
constructor(options: any);
|
|
47
37
|
/**
|
|
48
38
|
* 通知 Layout 重新生成 ProLayout 菜单路由。
|
|
@@ -50,29 +40,6 @@ export declare class AdminLayoutModel extends FlowModel<AdminLayoutStructure> {
|
|
|
50
40
|
* @returns {void}
|
|
51
41
|
*/
|
|
52
42
|
refreshMenuRouteTree(): void;
|
|
53
|
-
/**
|
|
54
|
-
* 注册页面运行时信息。
|
|
55
|
-
*
|
|
56
|
-
* @param {string} pageUid 页面 UID
|
|
57
|
-
* @param {RoutePageMeta} meta 页面运行时元数据
|
|
58
|
-
* @returns {FlowModel} 对应的页面模型
|
|
59
|
-
*/
|
|
60
|
-
registerRoutePage(pageUid: string, meta: RoutePageMeta): FlowModel<import("@nocobase/flow-engine").DefaultStructure>;
|
|
61
|
-
/**
|
|
62
|
-
* 更新页面运行时信息。
|
|
63
|
-
*
|
|
64
|
-
* @param {string} pageUid 页面 UID
|
|
65
|
-
* @param {Partial<RoutePageMeta>} meta 待更新的页面元数据
|
|
66
|
-
* @returns {void}
|
|
67
|
-
*/
|
|
68
|
-
updateRoutePage(pageUid: string, meta: Partial<RoutePageMeta>): void;
|
|
69
|
-
/**
|
|
70
|
-
* 注销页面运行时信息。
|
|
71
|
-
*
|
|
72
|
-
* @param {string} pageUid 页面 UID
|
|
73
|
-
* @returns {void}
|
|
74
|
-
*/
|
|
75
|
-
unregisterRoutePage(pageUid: string): void;
|
|
76
43
|
/**
|
|
77
44
|
* 使用当前可访问菜单路由刷新 Layout 菜单树。
|
|
78
45
|
*
|
|
@@ -90,59 +57,7 @@ export declare class AdminLayoutModel extends FlowModel<AdminLayoutStructure> {
|
|
|
90
57
|
path: string;
|
|
91
58
|
children: import("./AdminLayoutMenuUtils").AdminLayoutMenuNode[];
|
|
92
59
|
};
|
|
93
|
-
|
|
94
|
-
* 设置布局内容容器元素。
|
|
95
|
-
*
|
|
96
|
-
* @param {HTMLElement | null} element 布局内容容器
|
|
97
|
-
* @returns {void}
|
|
98
|
-
*/
|
|
99
|
-
setLayoutContentElement(element: HTMLElement | null): void;
|
|
100
|
-
/**
|
|
101
|
-
* 设置是否为移动端布局。
|
|
102
|
-
*
|
|
103
|
-
* @param {boolean} isMobileLayout 是否为移动端布局
|
|
104
|
-
* @returns {void}
|
|
105
|
-
*/
|
|
106
|
-
setIsMobileLayout(isMobileLayout: boolean): void;
|
|
107
|
-
protected onMount(): void;
|
|
108
|
-
protected onUnmount(): void;
|
|
109
|
-
/**
|
|
110
|
-
* 安装运行时上下文属性。
|
|
111
|
-
*
|
|
112
|
-
* @returns {void}
|
|
113
|
-
*/
|
|
114
|
-
private setupContextBindings;
|
|
115
|
-
/**
|
|
116
|
-
* 安装路由同步 reaction。
|
|
117
|
-
*
|
|
118
|
-
* @returns {void}
|
|
119
|
-
*/
|
|
120
|
-
private setupRouteReaction;
|
|
121
|
-
/**
|
|
122
|
-
* 释放运行时状态。
|
|
123
|
-
*
|
|
124
|
-
* @returns {void}
|
|
125
|
-
*/
|
|
126
|
-
private teardownRuntime;
|
|
127
|
-
/**
|
|
128
|
-
* 获取当前激活页面对应的路由对象。
|
|
129
|
-
*
|
|
130
|
-
* @returns {any} 当前激活页面对应的路由对象
|
|
131
|
-
*/
|
|
132
|
-
private getCurrentRouteByActivePage;
|
|
133
|
-
/**
|
|
134
|
-
* 根据页面 UID 获取路由对象。
|
|
135
|
-
*
|
|
136
|
-
* @param {string} pageUid 页面 UID
|
|
137
|
-
* @returns {any} 路由对象
|
|
138
|
-
*/
|
|
139
|
-
private getCurrentRouteByPageUid;
|
|
140
|
-
/**
|
|
141
|
-
* 懒加载页面路由协调器。
|
|
142
|
-
*
|
|
143
|
-
* @returns {AdminLayoutRouteCoordinator} 路由协调器实例
|
|
144
|
-
*/
|
|
145
|
-
private getCoordinator;
|
|
60
|
+
protected createRouteCoordinator(): AdminLayoutRouteCoordinator;
|
|
146
61
|
render(): React.JSX.Element;
|
|
147
62
|
}
|
|
148
63
|
/**
|
|
@@ -0,0 +1,11 @@
|
|
|
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 { AppListProps } from '@ant-design/pro-layout/es/components/AppsLogoComponents/types';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
export declare function useAppListRender(): (appList: AppListProps) => React.JSX.Element;
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export * from './AdminLayoutComponent';
|
|
10
10
|
export * from './AdminLayoutModel';
|
|
11
|
+
export * from '../BaseLayoutModel';
|
|
12
|
+
export * from '../BaseLayoutRouteCoordinator';
|
|
11
13
|
export * from './AdminLayoutSlotModels';
|
|
12
14
|
export * from './AdminLayoutMenuModels';
|
|
13
15
|
export * from './AdminLayoutMenuFlowUtils';
|
|
@@ -15,5 +17,6 @@ export * from './resolveAdminRouteRuntimeTarget';
|
|
|
15
17
|
export * from './constants';
|
|
16
18
|
export * from './ResetThemeTokenAndKeepAlgorithm';
|
|
17
19
|
export * from './useApplications';
|
|
20
|
+
export * from './AppListRender';
|
|
18
21
|
export * from './PinnedPluginListLite';
|
|
19
22
|
export * from './mobile-layout';
|
|
@@ -6,7 +6,8 @@
|
|
|
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 React from 'react';
|
|
10
10
|
export declare const useApplications: () => {
|
|
11
|
-
Component:
|
|
11
|
+
Component: React.JSXElementConstructor<any> | React.ExoticComponent<any>;
|
|
12
|
+
appList: any[];
|
|
12
13
|
};
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
-
/// <reference types="react" />
|
|
10
9
|
import type { FlowEngine } from '@nocobase/flow-engine';
|
|
10
|
+
import type { RefObject } from 'react';
|
|
11
11
|
import { type AdminLayoutModel } from './admin-layout/AdminLayoutModel';
|
|
12
12
|
type UseAdminLayoutRoutePageOptions = {
|
|
13
13
|
flowEngine: FlowEngine;
|
|
14
14
|
pageUid: string;
|
|
15
15
|
refreshDesktopRoutes?: () => Promise<unknown>;
|
|
16
|
-
layoutContentRef:
|
|
16
|
+
layoutContentRef: RefObject<HTMLDivElement>;
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
19
|
* 把 FlowRoute 页面的生命周期桥接到 AdminLayout host model。
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import type { FlowEngine } from '@nocobase/flow-engine';
|
|
10
|
+
import { type RefObject } from 'react';
|
|
11
|
+
import type { BaseLayoutModel } from './BaseLayoutModel';
|
|
12
|
+
export type UseLayoutRoutePageOptions<TModel extends BaseLayoutModel = BaseLayoutModel> = {
|
|
13
|
+
flowEngine: FlowEngine;
|
|
14
|
+
pageUid: string;
|
|
15
|
+
active?: boolean;
|
|
16
|
+
refreshDesktopRoutes?: () => Promise<unknown>;
|
|
17
|
+
layoutContentRef: RefObject<HTMLElement>;
|
|
18
|
+
getLayoutModel: (flowEngine: FlowEngine) => TModel | undefined;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* 把 FlowRoute 页面的生命周期桥接到指定 Layout host model。
|
|
22
|
+
*/
|
|
23
|
+
export declare function useLayoutRoutePage<TModel extends BaseLayoutModel = BaseLayoutModel>(options: UseLayoutRoutePageOptions<TModel>): TModel;
|
|
@@ -13,5 +13,6 @@ export declare const ConditionBuilder: React.MemoExoticComponent<import("@formil
|
|
|
13
13
|
value: FilterGroupType;
|
|
14
14
|
onChange: (value: FilterGroupType) => void;
|
|
15
15
|
extraMetaTree?: MetaTreeNode[];
|
|
16
|
+
maxAssociationFieldDepth?: number;
|
|
16
17
|
}>>;
|
|
17
18
|
export declare const commonConditionHandler: (ctx: any, params: any) => void;
|