@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
|
@@ -47,50 +47,7 @@ export declare class UpdatedAtFieldInterface extends CollectionFieldInterface {
|
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
49
|
filterable: {
|
|
50
|
-
operators:
|
|
51
|
-
label: string;
|
|
52
|
-
value: string;
|
|
53
|
-
selected: boolean;
|
|
54
|
-
schema: {
|
|
55
|
-
'x-component': string;
|
|
56
|
-
'x-component-props': {
|
|
57
|
-
isRange: boolean;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
onlyFilterAction: boolean;
|
|
61
|
-
noValue?: undefined;
|
|
62
|
-
} | {
|
|
63
|
-
label: string;
|
|
64
|
-
value: string;
|
|
65
|
-
schema: {
|
|
66
|
-
'x-component': string;
|
|
67
|
-
'x-component-props': {
|
|
68
|
-
isRange: boolean;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
onlyFilterAction: boolean;
|
|
72
|
-
selected?: undefined;
|
|
73
|
-
noValue?: undefined;
|
|
74
|
-
} | {
|
|
75
|
-
label: string;
|
|
76
|
-
value: string;
|
|
77
|
-
schema: {
|
|
78
|
-
'x-component': string;
|
|
79
|
-
'x-component-props': {
|
|
80
|
-
isRange: boolean;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
selected?: undefined;
|
|
84
|
-
onlyFilterAction?: undefined;
|
|
85
|
-
noValue?: undefined;
|
|
86
|
-
} | {
|
|
87
|
-
label: string;
|
|
88
|
-
value: string;
|
|
89
|
-
noValue: boolean;
|
|
90
|
-
selected?: undefined;
|
|
91
|
-
schema?: undefined;
|
|
92
|
-
onlyFilterAction?: undefined;
|
|
93
|
-
})[];
|
|
50
|
+
operators: string;
|
|
94
51
|
};
|
|
95
52
|
titleUsable: boolean;
|
|
96
53
|
}
|
|
@@ -6,7 +6,6 @@
|
|
|
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 { ISchema } from '@formily/react';
|
|
10
9
|
import { CollectionFieldInterface } from '../../collection-field-interface/CollectionFieldInterface';
|
|
11
10
|
export declare class UpdatedByFieldInterface extends CollectionFieldInterface {
|
|
12
11
|
name: string;
|
|
@@ -56,8 +55,5 @@ export declare class UpdatedByFieldInterface extends CollectionFieldInterface {
|
|
|
56
55
|
nested: boolean;
|
|
57
56
|
children: any[];
|
|
58
57
|
};
|
|
59
|
-
schemaInitialize(schema: ISchema, { block }: {
|
|
60
|
-
block: any;
|
|
61
|
-
}): void;
|
|
62
58
|
description: string;
|
|
63
59
|
}
|
|
@@ -6,7 +6,6 @@
|
|
|
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 { ISchema } from '@formily/react';
|
|
10
9
|
import { CollectionFieldInterface } from '../../collection-field-interface/CollectionFieldInterface';
|
|
11
10
|
export declare class UrlFieldInterface extends CollectionFieldInterface {
|
|
12
11
|
name: string;
|
|
@@ -26,9 +25,6 @@ export declare class UrlFieldInterface extends CollectionFieldInterface {
|
|
|
26
25
|
value: string;
|
|
27
26
|
}[];
|
|
28
27
|
availableTypes: string[];
|
|
29
|
-
schemaInitialize(schema: ISchema, { block }: {
|
|
30
|
-
block: any;
|
|
31
|
-
}): void;
|
|
32
28
|
validationType: string;
|
|
33
29
|
availableValidationOptions: string[];
|
|
34
30
|
properties: {
|
|
@@ -52,21 +48,6 @@ export declare class UrlFieldInterface extends CollectionFieldInterface {
|
|
|
52
48
|
};
|
|
53
49
|
titleUsable: boolean;
|
|
54
50
|
filterable: {
|
|
55
|
-
operators:
|
|
56
|
-
label: string;
|
|
57
|
-
value: string;
|
|
58
|
-
selected: boolean;
|
|
59
|
-
noValue?: undefined;
|
|
60
|
-
} | {
|
|
61
|
-
label: string;
|
|
62
|
-
value: string;
|
|
63
|
-
selected?: undefined;
|
|
64
|
-
noValue?: undefined;
|
|
65
|
-
} | {
|
|
66
|
-
label: string;
|
|
67
|
-
value: string;
|
|
68
|
-
noValue: boolean;
|
|
69
|
-
selected?: undefined;
|
|
70
|
-
})[];
|
|
51
|
+
operators: string;
|
|
71
52
|
};
|
|
72
53
|
}
|
|
@@ -69,15 +69,6 @@ export declare class UUIDFieldInterface extends CollectionFieldInterface {
|
|
|
69
69
|
'x-decorator': string;
|
|
70
70
|
'x-component': string;
|
|
71
71
|
'x-disabled': string;
|
|
72
|
-
'x-reactions': {
|
|
73
|
-
dependencies: string[];
|
|
74
|
-
when: string;
|
|
75
|
-
fulfill: {
|
|
76
|
-
state: {
|
|
77
|
-
value: boolean;
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
}[];
|
|
81
72
|
};
|
|
82
73
|
unique: {
|
|
83
74
|
type: string;
|
|
@@ -85,36 +76,12 @@ export declare class UUIDFieldInterface extends CollectionFieldInterface {
|
|
|
85
76
|
'x-decorator': string;
|
|
86
77
|
'x-component': string;
|
|
87
78
|
'x-disabled': string;
|
|
88
|
-
'x-reactions': {
|
|
89
|
-
dependencies: string[];
|
|
90
|
-
when: string;
|
|
91
|
-
fulfill: {
|
|
92
|
-
state: {
|
|
93
|
-
value: boolean;
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
}[];
|
|
97
79
|
};
|
|
98
80
|
};
|
|
99
81
|
};
|
|
100
82
|
};
|
|
101
83
|
filterable: {
|
|
102
|
-
operators:
|
|
103
|
-
label: string;
|
|
104
|
-
value: string;
|
|
105
|
-
selected: boolean;
|
|
106
|
-
noValue?: undefined;
|
|
107
|
-
} | {
|
|
108
|
-
label: string;
|
|
109
|
-
value: string;
|
|
110
|
-
selected?: undefined;
|
|
111
|
-
noValue?: undefined;
|
|
112
|
-
} | {
|
|
113
|
-
label: string;
|
|
114
|
-
value: string;
|
|
115
|
-
noValue: boolean;
|
|
116
|
-
selected?: undefined;
|
|
117
|
-
})[];
|
|
84
|
+
operators: string;
|
|
118
85
|
};
|
|
119
86
|
titleUsable: boolean;
|
|
120
87
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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 { ReactNode } from 'react';
|
|
10
|
+
export interface CollectionTemplateFieldOption {
|
|
11
|
+
label: ReactNode;
|
|
12
|
+
value: string | number | boolean;
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
export interface CollectionTemplateField {
|
|
16
|
+
name: string;
|
|
17
|
+
interface?: string;
|
|
18
|
+
type?: string;
|
|
19
|
+
title?: ReactNode;
|
|
20
|
+
options?: CollectionTemplateFieldOption[];
|
|
21
|
+
component?: string;
|
|
22
|
+
componentProps?: Record<string, unknown>;
|
|
23
|
+
uiSchema?: Record<string, unknown>;
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
}
|
|
26
|
+
interface FieldInterfaceConfigureLike {
|
|
27
|
+
default?: {
|
|
28
|
+
uiSchema?: Record<string, unknown>;
|
|
29
|
+
[key: string]: unknown;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
interface FieldInterfaceLike {
|
|
33
|
+
default?: {
|
|
34
|
+
uiSchema?: Record<string, unknown>;
|
|
35
|
+
[key: string]: unknown;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export interface CollectionTemplateFieldNormalizeManager {
|
|
39
|
+
getFieldInterfaceConfigure?: (name: string, collectionInfo?: Record<string, unknown>) => FieldInterfaceConfigureLike | undefined;
|
|
40
|
+
getFieldInterface?: (name: string) => FieldInterfaceLike | undefined;
|
|
41
|
+
}
|
|
42
|
+
export interface NormalizeCollectionTemplateFieldOptions {
|
|
43
|
+
collectionInfo?: Record<string, unknown>;
|
|
44
|
+
}
|
|
45
|
+
export declare function normalizeCollectionTemplateField(field: CollectionTemplateField, manager?: CollectionTemplateFieldNormalizeManager, options?: NormalizeCollectionTemplateFieldOptions): {
|
|
46
|
+
[key: string]: unknown;
|
|
47
|
+
uiSchema?: Record<string, unknown>;
|
|
48
|
+
} & CollectionTemplateField;
|
|
49
|
+
export declare function normalizeCollectionTemplateFields(fields?: CollectionTemplateField[], manager?: CollectionTemplateFieldNormalizeManager, options?: NormalizeCollectionTemplateFieldOptions): ({
|
|
50
|
+
[key: string]: unknown;
|
|
51
|
+
uiSchema?: Record<string, unknown>;
|
|
52
|
+
} & CollectionTemplateField)[];
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
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, { FC } from 'react';
|
|
10
|
+
export declare const KeepAliveProvider: FC<{
|
|
11
|
+
active: boolean;
|
|
12
|
+
parentActive: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const useKeepAlive: () => {
|
|
15
|
+
active: boolean;
|
|
16
|
+
};
|
|
17
|
+
interface KeepAliveProps {
|
|
18
|
+
uid: string;
|
|
19
|
+
children: (uid: string) => React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
export declare const KeepAlive: FC<KeepAliveProps>;
|
|
22
|
+
export {};
|
|
@@ -7,7 +7,16 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import { Application } from '../Application';
|
|
10
|
+
type LayoutMatchLike = {
|
|
11
|
+
id: string;
|
|
12
|
+
pathname: string;
|
|
13
|
+
};
|
|
14
|
+
type LayoutDefinitionLike = {
|
|
15
|
+
routeName: string;
|
|
16
|
+
};
|
|
17
|
+
export declare function findDeepestLayoutMatch(layouts?: LayoutDefinitionLike[], matches?: LayoutMatchLike[]): LayoutMatchLike;
|
|
10
18
|
export declare function useRouterSync(app: Application): void;
|
|
11
19
|
export declare function RouterBridge({ app }: {
|
|
12
20
|
app: any;
|
|
13
21
|
}): any;
|
|
22
|
+
export {};
|
|
@@ -12,17 +12,9 @@ export interface DialogFormLayoutProps {
|
|
|
12
12
|
title: React.ReactNode;
|
|
13
13
|
/** Form body — typically a `<Form>` wrapping `<Form.Item>` fields. */
|
|
14
14
|
children: React.ReactNode;
|
|
15
|
-
/**
|
|
16
|
-
* Called before the dialog is closed by the Cancel button or the
|
|
17
|
-
* top-right close (X) icon. Use for "discard changes" confirmations.
|
|
18
|
-
*/
|
|
15
|
+
/** Called before the dialog is closed by the Cancel button or the top-right close (X) icon. Use for "discard changes" confirmations. */
|
|
19
16
|
onCancel?: () => void | Promise<void>;
|
|
20
|
-
/**
|
|
21
|
-
* Called when the Submit button is clicked. Caller owns validation
|
|
22
|
-
* + the actual API call; the dialog is closed automatically when
|
|
23
|
-
* `onSubmit` resolves. Throw from `onSubmit` to keep the dialog open
|
|
24
|
-
* (e.g. on a validation error).
|
|
25
|
-
*/
|
|
17
|
+
/** Called when the Submit button is clicked. Caller owns validation + the actual API call; the dialog is closed automatically when `onSubmit` resolves. Throw from `onSubmit` to keep the dialog open (e.g. on a validation error). */
|
|
26
18
|
onSubmit?: () => void | Promise<void>;
|
|
27
19
|
/** Drives the Submit button's loading state. */
|
|
28
20
|
submitting?: boolean;
|
|
@@ -30,29 +22,13 @@ export interface DialogFormLayoutProps {
|
|
|
30
22
|
submitText?: React.ReactNode;
|
|
31
23
|
/** Override the Cancel button label. Defaults to "Cancel". */
|
|
32
24
|
cancelText?: React.ReactNode;
|
|
33
|
-
/**
|
|
34
|
-
* Full override of the footer content. When provided, the default
|
|
35
|
-
* Cancel + Submit buttons are replaced. Useful for forms that need
|
|
36
|
-
* extra actions (e.g. Preview, Save draft).
|
|
37
|
-
*/
|
|
25
|
+
/** Full override of the footer content. When provided, the default Cancel + Submit buttons are replaced. Useful for forms that need extra actions (e.g. Preview, Save draft). */
|
|
38
26
|
footer?: React.ReactNode;
|
|
39
27
|
}
|
|
40
28
|
/**
|
|
41
|
-
* Standard layout for dialog-hosted forms — the dialog counterpart of
|
|
42
|
-
* `DrawerFormLayout`. Title sits left-aligned in the dialog's native
|
|
43
|
-
* header (no inline close icon — the dialog provides its own X in the
|
|
44
|
-
* top-right when opened with `viewer.dialog({ closable: true, ... })`),
|
|
45
|
-
* the form body fills the middle, and a Cancel + Submit footer sits
|
|
46
|
-
* at the bottom.
|
|
29
|
+
* Standard layout for dialog-hosted forms — the dialog counterpart of `DrawerFormLayout`. Title sits left-aligned in the dialog's native header, the form body fills the middle, and a Cancel + Submit footer sits at the bottom. Neither this layout nor `DrawerFormLayout` renders a close icon — both rely on the caller passing `closable: true` at the `viewer.dialog` / `viewer.drawer` call site to surface antd Modal's native top-right X (Dialog) or antd Drawer's native left-side X (Drawer).
|
|
47
30
|
*
|
|
48
|
-
*
|
|
49
|
-
* `<CloseOutlined>` button next to the title — that's the drawer
|
|
50
|
-
* visual contract (close lives near the title in a side panel). In a
|
|
51
|
-
* centered dialog the native top-right close button is the expected
|
|
52
|
-
* affordance, so a separate layout keeps the visual contract clean.
|
|
53
|
-
*
|
|
54
|
-
* Callers own the `<Form>` instance, validation, and the actual API
|
|
55
|
-
* call. This component only handles the chrome and close behaviour.
|
|
31
|
+
* Callers own the `<Form>` instance, validation, and the actual API call. This component only handles the chrome and close behaviour.
|
|
56
32
|
*
|
|
57
33
|
* Example:
|
|
58
34
|
*
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { type MetaTreeNode } from '@nocobase/flow-engine';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { type VariableDelimiters } from './VariableInput';
|
|
12
|
+
/**
|
|
13
|
+
* Constant types this input can edit. Subset of v1 `Variable.Input`
|
|
14
|
+
* `useTypedConstant` — drops `'object'` (no v2 JSON editor yet) and `'null'`
|
|
15
|
+
* (handled by the dedicated `nullable` prop).
|
|
16
|
+
*/
|
|
17
|
+
export type TypedConstantType = 'string' | 'number' | 'boolean' | 'date';
|
|
18
|
+
/**
|
|
19
|
+
* One allowed constant type. Either a bare type name (`'number'`) or a
|
|
20
|
+
* `[type, editorProps]` pair (`['number', { min: 1, max: 65535 }]`) where
|
|
21
|
+
* `editorProps` is forwarded to the antd editor for that type — same
|
|
22
|
+
* shape as v1 `useTypedConstant`.
|
|
23
|
+
*/
|
|
24
|
+
export type TypedConstantSpec = TypedConstantType | [TypedConstantType, Record<string, unknown>];
|
|
25
|
+
export interface TypedVariableInputProps {
|
|
26
|
+
/**
|
|
27
|
+
* Stored value. A `{{ ... }}` string is treated as a variable reference;
|
|
28
|
+
* anything else is a constant of the inferred type.
|
|
29
|
+
*/
|
|
30
|
+
value?: unknown;
|
|
31
|
+
onChange?: (next: unknown) => void;
|
|
32
|
+
/**
|
|
33
|
+
* Allowed constant types. The `Constant` switcher entry always exposes a
|
|
34
|
+
* typed submenu (matching v1 `Variable.Input`) so users can see what type
|
|
35
|
+
* the constant is, even when only one type is permitted. Default: all four
|
|
36
|
+
* supported types.
|
|
37
|
+
*/
|
|
38
|
+
types?: TypedConstantSpec[];
|
|
39
|
+
/**
|
|
40
|
+
* Restrict the variable picker to specific top-level meta-tree namespaces
|
|
41
|
+
* (e.g. `['$env']`). When omitted, every registered top-level property is
|
|
42
|
+
* exposed — matching `VariableInput`'s default behaviour.
|
|
43
|
+
*/
|
|
44
|
+
namespaces?: string[];
|
|
45
|
+
/** Additional leaves appended to the picker after the namespace-filtered nodes. */
|
|
46
|
+
extraNodes?: MetaTreeNode[];
|
|
47
|
+
/**
|
|
48
|
+
* When true (default), the switcher exposes a `Null` option that resets the
|
|
49
|
+
* value to `null`. When false, the value is constrained to one of the
|
|
50
|
+
* allowed types or a variable reference.
|
|
51
|
+
*/
|
|
52
|
+
nullable?: boolean;
|
|
53
|
+
/** Variable-token delimiters. Default `['{{', '}}']` — see `VariableInput`. */
|
|
54
|
+
delimiters?: VariableDelimiters;
|
|
55
|
+
disabled?: boolean;
|
|
56
|
+
placeholder?: string;
|
|
57
|
+
style?: React.CSSProperties;
|
|
58
|
+
className?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Constant-or-variable input. Port of v1 `Variable.Input` typed-constant
|
|
62
|
+
* Cascader pattern (the `[Null | Constant<type> | Variable<…namespaces>]`
|
|
63
|
+
* switcher). Use this when a field can accept either a typed literal
|
|
64
|
+
* (number, boolean, date, string) or a variable reference like
|
|
65
|
+
* `{{ $env.SMTP_PORT }}` — see `plugin-notification-email`'s port / secure
|
|
66
|
+
* fields for the canonical example.
|
|
67
|
+
*
|
|
68
|
+
* Pure literal fields should keep using the antd primitive
|
|
69
|
+
* (`InputNumber`, `Select`, `DatePicker`). Pure variable fields should keep
|
|
70
|
+
* using `EnvVariableInput` / `VariableInput`. This component carries the
|
|
71
|
+
* Cascader switcher overhead, so reach for it only when the field
|
|
72
|
+
* genuinely accepts both shapes.
|
|
73
|
+
*/
|
|
74
|
+
export declare function TypedVariableInput(props: TypedVariableInputProps): React.JSX.Element;
|
|
75
|
+
export default TypedVariableInput;
|
|
@@ -8,8 +8,45 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { type MetaTreeNode, type VariableHybridInputConverters } from '@nocobase/flow-engine';
|
|
10
10
|
import React from 'react';
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The flow-engine defaults emit `{{ ctx.$X.Y }}` and only parse the same
|
|
13
|
+
* shape back into a path — but NocoBase server templates (and v1 stored
|
|
14
|
+
* values) use the bare `{{$X.Y}}` form without the `ctx.` prefix. These
|
|
15
|
+
* converters keep the picker's output stable against v1 and let already-
|
|
16
|
+
* stored values round-trip to a labelled pill instead of falling back to a
|
|
17
|
+
* raw `{{…}}` literal.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Variable delimiters: opening + closing tokens. Default `['{{', '}}']`
|
|
21
|
+
* matches NocoBase server template convention (Handlebars HTML-escaped
|
|
22
|
+
* output). Pass `['{{{', '}}}']` to switch to Handlebars' raw/unescaped
|
|
23
|
+
* form — required for fields whose content is rendered as HTML (e.g.
|
|
24
|
+
* in-app message body) so the variable expansion bypasses HTML escaping.
|
|
25
|
+
*
|
|
26
|
+
* Restrict to literal-token pairs, since the regex builder escapes them
|
|
27
|
+
* verbatim.
|
|
28
|
+
*/
|
|
29
|
+
export type VariableDelimiters = readonly [string, string];
|
|
30
|
+
/**
|
|
31
|
+
* Factory: returns a `parseValueToPath` bound to the given delimiters.
|
|
32
|
+
* Anchored (`^…$`) — only treats the whole input as a single variable
|
|
33
|
+
* reference, matching the v1 single-line picker behaviour.
|
|
34
|
+
*/
|
|
35
|
+
export declare function makeParseVariablePath(delimiters?: VariableDelimiters): (value?: string) => string[] | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Factory: returns a `formatPathToValue` bound to the given delimiters.
|
|
38
|
+
* No inner spaces — matches the v1 storage shape exactly so round-trips
|
|
39
|
+
* through the API stay byte-stable.
|
|
40
|
+
*/
|
|
41
|
+
export declare function makeFormatVariablePath(delimiters?: VariableDelimiters): (meta?: MetaTreeNode) => string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Factory: returns a global regex matching every occurrence of the
|
|
44
|
+
* variable token within a longer string. Used by `VariableHybridInput`
|
|
45
|
+
* to render embedded variables as pills.
|
|
46
|
+
*/
|
|
47
|
+
export declare function makeVariableRegExp(delimiters?: VariableDelimiters): RegExp;
|
|
48
|
+
export declare const parseVariablePath: (value?: string) => string[] | undefined;
|
|
49
|
+
export declare const formatVariablePath: (meta?: MetaTreeNode) => string | undefined;
|
|
13
50
|
/**
|
|
14
51
|
* Resolve the meta tree the variable picker should expose. Filters the global
|
|
15
52
|
* meta tree by `namespaces` (top-level property names like `'$env'`,
|
|
@@ -48,8 +85,22 @@ export interface VariableInputProps {
|
|
|
48
85
|
* Override the converters used by the underlying `VariableHybridInput`.
|
|
49
86
|
* Mostly useful when the caller wants to constrain `formatPathToValue` to a
|
|
50
87
|
* specific namespace (see `EnvVariableInput` for that pattern).
|
|
88
|
+
*
|
|
89
|
+
* Takes precedence over `delimiters` when both are set on the same field
|
|
90
|
+
* (an explicit converter wins over the delimiter-derived one).
|
|
51
91
|
*/
|
|
52
92
|
converters?: VariableHybridInputConverters;
|
|
93
|
+
/**
|
|
94
|
+
* Token pair wrapping variable references in the stored string. Defaults
|
|
95
|
+
* to `['{{', '}}']` — the standard NocoBase server-template form,
|
|
96
|
+
* HTML-escaped by Handlebars. Pass `['{{{', '}}}']` for fields rendered
|
|
97
|
+
* as HTML where escaping would corrupt the variable value (e.g. the
|
|
98
|
+
* in-app message body).
|
|
99
|
+
*
|
|
100
|
+
* Ignored when `converters` is also supplied — caller-provided converters
|
|
101
|
+
* win.
|
|
102
|
+
*/
|
|
103
|
+
delimiters?: VariableDelimiters;
|
|
53
104
|
className?: string;
|
|
54
105
|
style?: React.CSSProperties;
|
|
55
106
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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 { Collection } from '@nocobase/flow-engine';
|
|
10
|
+
import { type ButtonProps, type PopoverProps } from 'antd';
|
|
11
|
+
import React, { FC } from 'react';
|
|
12
|
+
import { CompiledFilter } from './useFilterActionProps';
|
|
13
|
+
export interface CollectionFilterProps {
|
|
14
|
+
/** Collection whose fields drive the filter row's field picker. */
|
|
15
|
+
collection: Collection | undefined;
|
|
16
|
+
/** Called on Submit or Reset with the compiled NocoBase filter param (`undefined` when cleared). */
|
|
17
|
+
onChange: (filter: CompiledFilter) => void;
|
|
18
|
+
/** Translator. Defaults to identity. */
|
|
19
|
+
t?: (key: string, options?: Record<string, any>) => string;
|
|
20
|
+
/** Whitelist of root-level field names to expose. */
|
|
21
|
+
filterableFieldNames?: string[];
|
|
22
|
+
/**
|
|
23
|
+
* Blacklist of root-level field names to drop. Mirrors v1's `nonfilterable: [...]` on `Filter.Action`. When both `filterableFieldNames` and this prop are supplied, both apply (final = whitelist ∩ ¬blacklist).
|
|
24
|
+
*/
|
|
25
|
+
nonfilterableFieldNames?: string[];
|
|
26
|
+
/**
|
|
27
|
+
* Bypass the `filterableFieldNames` whitelist.
|
|
28
|
+
*
|
|
29
|
+
* Legacy escape hatch — prefer adjusting `filterableFieldNames` / `nonfilterableFieldNames` instead.
|
|
30
|
+
*/
|
|
31
|
+
noIgnore?: boolean;
|
|
32
|
+
/** Override the trigger button's label. Defaults to `t('Filter')`, or the v1-style `t('{{count}} filter items', { count })` when conditions are present. */
|
|
33
|
+
buttonText?: React.ReactNode;
|
|
34
|
+
/** Swap the default `t('Filter')` label for v1's `t('{{count}} filter items', { count })` when conditions are present. Defaults to `true`. */
|
|
35
|
+
showCount?: boolean;
|
|
36
|
+
/** Pass-through props for the antd `<Popover>`. */
|
|
37
|
+
popoverProps?: Omit<PopoverProps, 'open' | 'onOpenChange' | 'content' | 'children'>;
|
|
38
|
+
/** Pass-through props for the trigger `<Button>`. */
|
|
39
|
+
buttonProps?: Omit<ButtonProps, 'icon' | 'type' | 'children' | 'onClick'>;
|
|
40
|
+
/** Min-width applied to the popover body. Defaults to `520`. */
|
|
41
|
+
popoverMinWidth?: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Filter button bound to a collection. Renders an antd `<Popover>` over a `<Button>`; the popover hosts a multi-condition filter form (field picker, operator, value). Submit dismisses the popover and emits the compiled filter via `onChange`; Reset keeps the popover open and emits `undefined`.
|
|
45
|
+
*
|
|
46
|
+
* Pair with `<ExtendCollectionsProvider>` when the target collection is client-only (e.g. a `schema-only` server collection that isn't auto-published to the v2 data source).
|
|
47
|
+
*/
|
|
48
|
+
export declare const CollectionFilter: FC<CollectionFilterProps>;
|
|
49
|
+
export default CollectionFilter;
|
|
@@ -0,0 +1,49 @@
|
|
|
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 React, { FC } from 'react';
|
|
11
|
+
export interface CollectionFilterItemValue {
|
|
12
|
+
path: string;
|
|
13
|
+
operator: string;
|
|
14
|
+
/** Operator-dependent — string for default ops, descriptor for $date*, etc. */
|
|
15
|
+
value: any;
|
|
16
|
+
}
|
|
17
|
+
export interface CollectionFilterItemProps {
|
|
18
|
+
/** Reactive filter row managed by the parent `FilterContainer`. */
|
|
19
|
+
value: CollectionFilterItemValue;
|
|
20
|
+
/** Target collection whose fields populate the field selector. */
|
|
21
|
+
collection: Collection;
|
|
22
|
+
/** Whitelist of field names to expose; empty/undefined means all filterable fields. */
|
|
23
|
+
filterableFieldNames?: string[];
|
|
24
|
+
/**
|
|
25
|
+
* Blacklist of field names to drop. Mirrors v1's `nonfilterable: [...]` on `Filter.Action`. When both whitelist and blacklist are supplied, both apply (final = whitelist ∩ ¬blacklist).
|
|
26
|
+
*/
|
|
27
|
+
nonfilterableFieldNames?: string[];
|
|
28
|
+
/**
|
|
29
|
+
* Bypass the `filterableFieldNames` whitelist (matches the legacy FilterItem `noIgnore`).
|
|
30
|
+
*
|
|
31
|
+
* Legacy escape hatch — prefer adjusting `filterableFieldNames` / `nonfilterableFieldNames` instead.
|
|
32
|
+
*/
|
|
33
|
+
noIgnore?: boolean;
|
|
34
|
+
/** Translator; defaults to identity so callers can omit it. */
|
|
35
|
+
t?: (key: string) => string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* 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)`.
|
|
39
|
+
*
|
|
40
|
+
* The field selector is an antd `Cascader`, mirroring v1's `Filter.Action` so association fields (belongsTo / m2o / etc.) can be drilled into — picking `user.username` is a first-class action. The value renderer is delegated to `FilterValueInput`, which dispatches to interface-specific controls (the smart date picker for `$date*` operators, tag-mode Select for array/enum, etc.) the same way v1's `DynamicComponent` did.
|
|
41
|
+
*/
|
|
42
|
+
export declare const CollectionFilterItem: FC<CollectionFilterItemProps>;
|
|
43
|
+
/**
|
|
44
|
+
* 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.
|
|
45
|
+
*/
|
|
46
|
+
export declare function createCollectionFilterItem(collection: Collection, bound?: Pick<CollectionFilterItemProps, 'filterableFieldNames' | 'nonfilterableFieldNames' | 'noIgnore' | 't'>): React.FC<{
|
|
47
|
+
value: CollectionFilterItemValue;
|
|
48
|
+
}>;
|
|
49
|
+
export default CollectionFilterItem;
|
|
@@ -0,0 +1,57 @@
|
|
|
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 Dayjs } from 'dayjs';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
/**
|
|
12
|
+
* Value shape used by NocoBase's `$date*` filter operators. Two flavours:
|
|
13
|
+
*
|
|
14
|
+
* - For "Exact day" mode: a **formatted string** at the granularity of the picker — `"2026-02-15"` (date), `"2026-02"` (month), `"2026"` (year), `"2026-Q1"` (quarter). For `$dateBetween` (`isRange`), a `[string, string]` tuple. Strings (not Dayjs) so the value serializes verbatim into the query string the same way v1 does (`filter=%7B%22$and%22:[%7B%22lockedTs%22:%7B%22$dateOn%22:%222026-02%22%7D%7D]%7D`).
|
|
15
|
+
* - For relative modes (Today / Past 3 days / This Week / …): a `{ type, number?, unit? }` descriptor that the server resolves to a concrete range at query time.
|
|
16
|
+
*/
|
|
17
|
+
export type DateFilterValue = string | [string, string] | {
|
|
18
|
+
type: string;
|
|
19
|
+
number?: number;
|
|
20
|
+
unit?: 'day' | 'week' | 'month' | 'year';
|
|
21
|
+
} | null | undefined;
|
|
22
|
+
export interface DateFilterDynamicComponentProps {
|
|
23
|
+
value?: DateFilterValue;
|
|
24
|
+
onChange?: (value: DateFilterValue) => void;
|
|
25
|
+
/** `true` for `$dateBetween`; renders a `DatePicker.RangePicker`. */
|
|
26
|
+
isRange?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Translator. Defaults to identity so callers can omit it when running outside a translation context (tests, storybook).
|
|
29
|
+
*/
|
|
30
|
+
t?: (key: string) => string;
|
|
31
|
+
}
|
|
32
|
+
type PickerMode = 'date' | 'month' | 'quarter' | 'year';
|
|
33
|
+
/**
|
|
34
|
+
* The exact format strings NocoBase's `$date*` server operators expect per picker granularity. Mirrors v1's `getPickerFormat` output under `underFilter=true`, so the URL-encoded query stays identical.
|
|
35
|
+
*
|
|
36
|
+
* Exported for unit tests and for downstream callers that need to parse / format `$date*` values outside this component.
|
|
37
|
+
*/
|
|
38
|
+
export declare const FORMAT_BY_PICKER: Record<PickerMode, string>;
|
|
39
|
+
/**
|
|
40
|
+
* Parse a granularity-formatted string back into a `Dayjs`. Returns `null` on missing or unparseable input so the DatePicker's controlled-value contract stays clean.
|
|
41
|
+
*/
|
|
42
|
+
export declare const parseDateFilterValue: (value: string | undefined, picker: PickerMode) => Dayjs | null;
|
|
43
|
+
/**
|
|
44
|
+
* Format a `Dayjs` (typically from `DatePicker.onChange`) into the server-facing string at the active picker's granularity. Returns `undefined` for empty input so callers can drop the value entirely.
|
|
45
|
+
*/
|
|
46
|
+
export declare const formatDateFilterValue: (value: Dayjs | null | undefined, picker: PickerMode) => string | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* v2 port of v1's `DateFilterDynamicComponent` — a multi-mode value input for the `$date*` operator family. Three sub-controls glued in a `Space.Compact` row:
|
|
49
|
+
*
|
|
50
|
+
* 1. Mode select — `Exact day` / `Past` / `Next` / `Today` / `This Week` / … Picking a relative mode emits a `{ type, number?, unit? }` descriptor that the server resolves at query time; picking `Exact day` emits a raw `Dayjs` instead.
|
|
51
|
+
* 2. Picker granularity — only when mode is `Exact day`: `Date` / `Month` / `Quarter` / `Year`. Controls the antd `DatePicker`'s `picker` mode so admins can filter to e.g. "any day in 2026-03".
|
|
52
|
+
* 3. Date input — antd `DatePicker` for single dates, or `DatePicker.RangePicker` when `isRange` is true (used by `$dateBetween`).
|
|
53
|
+
*
|
|
54
|
+
* v1 wired its own `<DatePicker.FilterWithPicker>` for the third slot; v2 inlines the picker-granularity selector here so we don't have to fork antd's DatePicker. Drops v1's `@emotion/css` (uses antd token spacing) and the `useCompile` schema-template chain (call sites pass a plain `t` translator).
|
|
55
|
+
*/
|
|
56
|
+
export declare const DateFilterDynamicComponent: React.FC<DateFilterDynamicComponentProps>;
|
|
57
|
+
export default DateFilterDynamicComponent;
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
import type { FilterOperator, FilterOption } from '../../../flow/components/filter/useFilterOptions';
|
|
11
|
+
export interface FilterValueInputProps {
|
|
12
|
+
/** The currently selected leaf field option from the field picker. */
|
|
13
|
+
field?: FilterOption;
|
|
14
|
+
/** The currently selected operator (full object, not just `.value`). */
|
|
15
|
+
operator?: FilterOperator;
|
|
16
|
+
/** Current value. Shape depends on operator/field. */
|
|
17
|
+
value: any;
|
|
18
|
+
/** Notify the parent when the user edits the value. */
|
|
19
|
+
onChange: (value: any) => void;
|
|
20
|
+
/** Translator used by sub-renderers. */
|
|
21
|
+
t?: (key: string) => string;
|
|
22
|
+
/** Optional placeholder for the fallback `Input`. */
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Interface-aware value renderer for filter rows. Returns `null` for `noValue` operators (`$empty`, `$notEmpty`). Otherwise dispatches the effective `x-component` (operator schema > field uiSchema > Input) to a small registry of antd controls.
|
|
27
|
+
*/
|
|
28
|
+
export declare const FilterValueInput: React.FC<FilterValueInputProps>;
|
|
29
|
+
export default FilterValueInput;
|
|
@@ -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
|
+
export { CollectionFilter } from './CollectionFilter';
|
|
10
|
+
export type { CollectionFilterProps } from './CollectionFilter';
|
|
11
|
+
export type { CompiledFilter } from './useFilterActionProps';
|