@nocobase/client-v2 2.1.0-alpha.40 → 2.1.0-alpha.45
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/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/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 +1 -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/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/FlowRoute.d.ts +10 -1
- package/es/flow/components/filter/index.d.ts +2 -0
- package/es/flow/components/filter/useFilterOptions.d.ts +66 -0
- package/es/flow/index.d.ts +4 -0
- package/es/flow/models/base/PageModel/PageModel.d.ts +3 -1
- package/es/flow/models/blocks/assign-form/assignFieldValuesFlow.d.ts +84 -0
- package/es/flow/models/blocks/assign-form/index.d.ts +1 -0
- package/es/flow/models/blocks/form/FormActionGroupModel.d.ts +1 -0
- package/es/flow/models/blocks/form/FormActionModel.d.ts +9 -2
- package/es/flow/models/blocks/table/TableBlockModel.d.ts +10 -0
- package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/index.d.ts +1 -1
- package/es/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 +45 -2
- package/src/__tests__/plugin-manager.test.tsx +177 -0
- package/src/__tests__/settings-center.test.tsx +24 -2
- package/src/collection-field-interface/CollectionFieldInterface.ts +71 -77
- package/src/collection-field-interface/CollectionFieldInterfaceManager.ts +201 -4
- package/src/collection-manager/field-configure.ts +548 -0
- package/src/collection-manager/field-validation.ts +195 -0
- package/src/collection-manager/filter-operators/index.ts +176 -0
- package/src/collection-manager/{interfaces/properties → filter-operators}/operators.ts +24 -13
- package/src/collection-manager/interfaces/checkbox.ts +2 -9
- package/src/collection-manager/interfaces/checkboxGroup.ts +2 -10
- package/src/collection-manager/interfaces/collection.ts +2 -15
- package/src/collection-manager/interfaces/color.ts +2 -2
- package/src/collection-manager/interfaces/createdAt.ts +2 -2
- package/src/collection-manager/interfaces/createdBy.ts +1 -12
- package/src/collection-manager/interfaces/dateOnly.ts +8 -2
- package/src/collection-manager/interfaces/datetime.ts +2 -2
- package/src/collection-manager/interfaces/datetimeNoTz.ts +2 -2
- package/src/collection-manager/interfaces/email.ts +2 -9
- package/src/collection-manager/interfaces/id.ts +1 -2
- package/src/collection-manager/interfaces/index.ts +2 -3
- package/src/collection-manager/interfaces/input.ts +2 -133
- package/src/collection-manager/interfaces/integer.ts +2 -71
- package/src/collection-manager/interfaces/json.tsx +17 -11
- package/src/collection-manager/interfaces/m2m.tsx +0 -21
- package/src/collection-manager/interfaces/m2o.tsx +0 -22
- package/src/collection-manager/interfaces/markdown.ts +2 -51
- package/src/collection-manager/interfaces/multipleSelect.ts +2 -14
- package/src/collection-manager/interfaces/nanoid.ts +2 -2
- package/src/collection-manager/interfaces/number.ts +2 -85
- package/src/collection-manager/interfaces/o2m.tsx +1 -22
- package/src/collection-manager/interfaces/obo.tsx +145 -0
- package/src/collection-manager/interfaces/oho.tsx +145 -0
- package/src/collection-manager/interfaces/password.ts +2 -44
- package/src/collection-manager/interfaces/percent.ts +2 -74
- package/src/collection-manager/interfaces/phone.ts +2 -2
- package/src/collection-manager/interfaces/properties/index.ts +0 -133
- package/src/collection-manager/interfaces/radioGroup.ts +2 -2
- package/src/collection-manager/interfaces/richText.ts +2 -51
- package/src/collection-manager/interfaces/select.ts +2 -14
- package/src/collection-manager/interfaces/snowflake-id.ts +2 -2
- package/src/collection-manager/interfaces/tableoid.ts +1 -2
- package/src/collection-manager/interfaces/textarea.ts +2 -51
- package/src/collection-manager/interfaces/time.ts +2 -2
- package/src/collection-manager/interfaces/types.ts +4 -12
- package/src/collection-manager/interfaces/unixTimestamp.tsx +2 -2
- package/src/collection-manager/interfaces/updatedAt.ts +2 -2
- package/src/collection-manager/interfaces/updatedBy.ts +1 -12
- package/src/collection-manager/interfaces/url.ts +2 -4
- package/src/collection-manager/interfaces/uuid.ts +2 -2
- package/src/collection-manager/template-fields.ts +109 -0
- package/src/components/KeepAlive.tsx +131 -0
- package/src/components/README.md +90 -6
- package/src/components/README.zh-CN.md +90 -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/VariableInput.tsx +101 -28
- 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 +1 -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 +529 -2
- package/src/flow/actions/__tests__/linkageRules.subFormSetFieldProps.test.ts +191 -0
- package/src/flow/actions/__tests__/openView.subModelKey.test.tsx +33 -0
- package/src/flow/actions/aclCheck.tsx +4 -0
- package/src/flow/actions/aclCheckRefresh.tsx +4 -0
- package/src/flow/actions/dateTimeFormat.tsx +12 -8
- package/src/flow/actions/linkageRules.tsx +122 -0
- package/src/flow/actions/openView.tsx +28 -4
- package/src/flow/admin-shell/AdminLayoutRouteCoordinator.ts +11 -329
- package/src/flow/admin-shell/BaseLayoutModel.tsx +455 -0
- package/src/flow/admin-shell/BaseLayoutRouteCoordinator.ts +502 -0
- package/src/flow/admin-shell/__tests__/AdminLayoutRouteCoordinator.test.ts +547 -3
- package/src/flow/admin-shell/admin-layout/AdminLayoutComponent.tsx +35 -7
- package/src/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.tsx +160 -0
- package/src/flow/admin-shell/admin-layout/AdminLayoutMenuModels.tsx +0 -12
- package/src/flow/admin-shell/admin-layout/AdminLayoutModel.tsx +28 -201
- package/src/flow/admin-shell/admin-layout/AdminLayoutSlotModels.tsx +11 -2
- package/src/flow/admin-shell/admin-layout/AppListRender.tsx +139 -0
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutMenuModels.test.ts +1 -26
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutModel.test.tsx +149 -27
- package/src/flow/admin-shell/admin-layout/index.ts +3 -0
- 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/components/AdminLayout.tsx +4 -154
- package/src/flow/components/FlowRoute.tsx +105 -15
- package/src/flow/components/filter/index.ts +3 -0
- package/src/flow/components/filter/useFilterOptions.ts +102 -0
- package/src/flow/index.ts +4 -0
- package/src/flow/models/actions/UpdateRecordActionModel.tsx +14 -95
- package/src/flow/models/actions/UpdateRecordActionUtils.ts +4 -7
- package/src/flow/models/actions/__tests__/AssignFormRefill.test.ts +26 -1
- package/src/flow/models/base/ActionModel.tsx +8 -1
- package/src/flow/models/base/PageModel/PageModel.tsx +51 -18
- package/src/flow/models/base/PageModel/RootPageModel.tsx +6 -13
- package/src/flow/models/base/PageModel/__tests__/PageModel.test.ts +102 -1
- package/src/flow/models/base/RouteModel.tsx +1 -1
- package/src/flow/models/blocks/assign-form/AssignFormItemModel.tsx +63 -2
- package/src/flow/models/blocks/assign-form/assignFieldValuesFlow.tsx +206 -0
- package/src/flow/models/blocks/assign-form/index.ts +1 -0
- package/src/flow/models/blocks/form/FormActionGroupModel.tsx +14 -0
- package/src/flow/models/blocks/form/FormActionModel.tsx +30 -3
- package/src/flow/models/blocks/form/FormItemModel.tsx +8 -1
- package/src/flow/models/blocks/form/__tests__/FormActionGroupModel.test.ts +46 -0
- package/src/flow/models/blocks/form/__tests__/submitHandler.test.ts +71 -0
- package/src/flow/models/blocks/form/submitHandler.ts +8 -1
- package/src/flow/models/blocks/form/submitValues.ts +4 -1
- package/src/flow/models/blocks/table/TableBlockModel.tsx +118 -16
- package/src/flow/models/blocks/table/__tests__/TableBlockModel.rowSelection.test.tsx +114 -0
- package/src/flow/models/fields/AssociationFieldModel/SubFormFieldModel.tsx +7 -1
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableField.tsx +1 -1
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/index.tsx +6 -5
- package/src/flow/models/fields/ClickableFieldModel.tsx +9 -1
- package/src/flow/models/fields/CollectionSelectorFieldModel.tsx +8 -2
- package/src/flow/models/fields/DisplayEnumFieldModel.tsx +8 -2
- package/src/flow/models/fields/DisplayTimeFieldModel.tsx +1 -1
- package/src/flow/models/fields/TimeFieldModel.tsx +1 -1
- package/src/flow/models/fields/__tests__/TimeFieldModel.test.tsx +61 -0
- package/src/flow/models/fields/mobile-components/MobileDatePicker.tsx +19 -3
- package/src/flow/models/fields/mobile-components/__tests__/MobileDatePicker.test.tsx +94 -0
- package/src/flow/models/topbar/TopbarActionModel.tsx +1 -1
- package/src/flow/utils/__tests__/dateTimeFormat.test.ts +91 -0
- package/src/index.ts +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
package/es/Application.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export interface ApplicationOptions extends BaseApplicationOptions<PluginType> {
|
|
|
28
28
|
}
|
|
29
29
|
export declare class Application extends BaseApplication<ApplicationOptions, PluginManager, RouterManager, APIClient, PluginSettingsManager> {
|
|
30
30
|
dataSourceManager: any;
|
|
31
|
+
hasLoadError: boolean;
|
|
31
32
|
protected createApiClient(options: ApplicationOptions): APIClient;
|
|
32
33
|
protected configureRuntimeAdapters(): void;
|
|
33
34
|
protected createI18n(options: ApplicationOptions): i18next;
|
|
@@ -44,4 +45,10 @@ export declare class Application extends BaseApplication<ApplicationOptions, Plu
|
|
|
44
45
|
}>): any;
|
|
45
46
|
addFieldInterfaceComponentOption(fieldName: string, componentOption: any): any;
|
|
46
47
|
addFieldInterfaceOperator(name: string, operatorOption: any): any;
|
|
48
|
+
registerFieldFilterOperator(operator: any): any;
|
|
49
|
+
registerFieldFilterOperatorGroup(name: string, operators?: any[]): any;
|
|
50
|
+
addFieldFilterOperatorsToGroup(name: string, operators?: any[]): any;
|
|
51
|
+
registerFieldValidationConfigure(item: any): any;
|
|
52
|
+
registerFieldValidationConfigureGroup(name: string, items?: any[]): any;
|
|
53
|
+
addFieldValidationConfiguresToGroup(name: string, items?: any[]): any;
|
|
47
54
|
}
|
package/es/BaseApplication.d.ts
CHANGED
|
@@ -10,8 +10,10 @@ import { FlowEngine, FlowEngineContext, FlowModel } from '@nocobase/flow-engine'
|
|
|
10
10
|
import { APIClient } from '@nocobase/sdk';
|
|
11
11
|
import type { i18n as i18next } from 'i18next';
|
|
12
12
|
import React, { ReactElement, ReactNode } from 'react';
|
|
13
|
+
import type { AppListProps } from '@ant-design/pro-layout/es/components/AppsLogoComponents/types';
|
|
13
14
|
import { AIManager } from './ai';
|
|
14
15
|
import { SystemSettingsSource } from './flow/system-settings';
|
|
16
|
+
import { LayoutManager } from './layout-manager/LayoutManager';
|
|
15
17
|
import type { PluginClass, PluginManager, PluginType } from './PluginManager';
|
|
16
18
|
import { RouteRepository } from './RouteRepository';
|
|
17
19
|
import type { ComponentTypeAndString, RenderableComponentType, RouterComponentType, RouterManager, RouterOptions } from './RouterManager';
|
|
@@ -24,6 +26,7 @@ declare global {
|
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
type AnyComponent = RenderableComponentType<any>;
|
|
29
|
+
type AppListLoader = (app: BaseApplication<any>) => Promise<AppListProps> | AppListProps;
|
|
27
30
|
type AuthTokenPayload = {
|
|
28
31
|
token: string;
|
|
29
32
|
authenticator: string | null;
|
|
@@ -71,6 +74,7 @@ export declare abstract class BaseApplication<TOptions extends BaseApplicationOp
|
|
|
71
74
|
components: Record<string, AnyComponent>;
|
|
72
75
|
pluginManager: TPluginManager;
|
|
73
76
|
pluginSettingsManager: TPluginSettingsManager;
|
|
77
|
+
layoutManager: LayoutManager<this>;
|
|
74
78
|
aiManager: AIManager;
|
|
75
79
|
devDynamicImport?: DevDynamicImport;
|
|
76
80
|
requirejs: RequireJS;
|
|
@@ -102,10 +106,12 @@ export declare abstract class BaseApplication<TOptions extends BaseApplicationOp
|
|
|
102
106
|
private wsAuthorized;
|
|
103
107
|
apps: {
|
|
104
108
|
Component?: AnyComponent | null;
|
|
109
|
+
loadAppList?: AppListLoader | null;
|
|
105
110
|
};
|
|
106
111
|
get pm(): TPluginManager;
|
|
107
112
|
get disableAcl(): boolean;
|
|
108
113
|
get isWsAuthorized(): boolean;
|
|
114
|
+
setDocumentLanguage(language?: string | null): void;
|
|
109
115
|
constructor(options?: TOptions);
|
|
110
116
|
/**
|
|
111
117
|
* 注册共享 observable 状态。
|
|
@@ -150,6 +156,12 @@ export declare abstract class BaseApplication<TOptions extends BaseApplicationOp
|
|
|
150
156
|
*/
|
|
151
157
|
protected addComponent(component: AnyComponent, name?: string): void;
|
|
152
158
|
addComponents(components: Record<string, AnyComponent>): void;
|
|
159
|
+
setAppsComponent({ Component }: {
|
|
160
|
+
Component: AnyComponent;
|
|
161
|
+
}): void;
|
|
162
|
+
setAppsProvider({ loadAppList }: {
|
|
163
|
+
loadAppList: AppListLoader;
|
|
164
|
+
}): void;
|
|
153
165
|
protected getRootFallback(): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
154
166
|
getRootComponent(): React.FC<{
|
|
155
167
|
children?: React.ReactNode;
|
|
@@ -160,6 +172,7 @@ export declare abstract class BaseApplication<TOptions extends BaseApplicationOp
|
|
|
160
172
|
protected abstract createRouterManager(options: TOptions): TRouterManager;
|
|
161
173
|
protected abstract createPluginManager(options: TOptions): TPluginManager;
|
|
162
174
|
protected abstract createPluginSettingsManager(options: TOptions): TPluginSettingsManager;
|
|
175
|
+
protected createLayoutManager(_options: TOptions): LayoutManager<this>;
|
|
163
176
|
protected createWebSocketClient(options: TOptions): WebSocketClient;
|
|
164
177
|
protected getDefaultComponents(): Record<string, AnyComponent>;
|
|
165
178
|
abstract load(): Promise<void>;
|
package/es/RouterManager.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export interface RouteType extends Omit<RouteObject, 'children' | 'Component'> {
|
|
|
34
34
|
Component?: ComponentTypeAndString;
|
|
35
35
|
componentLoader?: ComponentLoader;
|
|
36
36
|
skipAuthCheck?: boolean;
|
|
37
|
+
authCheck?: boolean;
|
|
37
38
|
}
|
|
38
39
|
export type RenderComponentType = (Component: ComponentTypeAndString, props?: any) => React.ReactNode;
|
|
39
40
|
export type RouterComponentType = React.FC<{
|
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import type { ISchema } from '@formily/react';
|
|
10
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
11
|
+
import { type FieldFilterable, type FieldFilterOperator } from '../collection-manager/filter-operators';
|
|
12
|
+
import type { FieldConfigureItem } from '../collection-manager/field-configure';
|
|
10
13
|
import { CollectionFieldInterfaceManager } from './CollectionFieldInterfaceManager';
|
|
11
14
|
export type CollectionFieldInterfaceFactory = new (collectionFieldInterfaceManager: CollectionFieldInterfaceManager) => CollectionFieldInterface;
|
|
12
15
|
export interface CollectionFieldInterfaceComponentOption {
|
|
@@ -15,6 +18,50 @@ export interface CollectionFieldInterfaceComponentOption {
|
|
|
15
18
|
useVisible?: () => boolean;
|
|
16
19
|
useProps?: () => any;
|
|
17
20
|
}
|
|
21
|
+
export type FieldConfigureFormMode = 'create' | 'edit';
|
|
22
|
+
export interface FieldConfigureContext {
|
|
23
|
+
mode: FieldConfigureFormMode;
|
|
24
|
+
fieldInterface: CollectionFieldInterface | FieldInterfaceConfigure;
|
|
25
|
+
collection?: Record<string, any>;
|
|
26
|
+
field?: Record<string, any>;
|
|
27
|
+
disabledJSONB?: boolean;
|
|
28
|
+
createOnly?: boolean;
|
|
29
|
+
editMainOnly?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export type FieldConfigureFormProps = FieldConfigureContext;
|
|
32
|
+
export interface FieldConfigurePropertyComponentProps extends FieldConfigureContext {
|
|
33
|
+
name: string;
|
|
34
|
+
namePath: Array<string | number>;
|
|
35
|
+
schema: Record<string, any>;
|
|
36
|
+
form?: any;
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
collections?: Array<Record<string, any>>;
|
|
39
|
+
context: Record<string, boolean>;
|
|
40
|
+
title?: ReactNode;
|
|
41
|
+
tooltip?: ReactNode;
|
|
42
|
+
componentProps?: Record<string, any>;
|
|
43
|
+
}
|
|
44
|
+
export interface FieldInterfaceConfigure {
|
|
45
|
+
name?: string;
|
|
46
|
+
title?: ReactNode;
|
|
47
|
+
group?: string;
|
|
48
|
+
order?: number;
|
|
49
|
+
default?: Record<string, any>;
|
|
50
|
+
titleUsable?: boolean;
|
|
51
|
+
isAssociation?: boolean;
|
|
52
|
+
supportDataSourceType?: string[];
|
|
53
|
+
notSupportDataSourceType?: string[];
|
|
54
|
+
properties?: Record<string, any>;
|
|
55
|
+
items?: FieldConfigureItem[];
|
|
56
|
+
getConfigureFormProperties?: (collectionInfo?: Record<string, any>) => Record<string, any>;
|
|
57
|
+
components?: Record<string, ComponentType<FieldConfigurePropertyComponentProps>>;
|
|
58
|
+
initialize?: (values: Record<string, any>, context?: FieldConfigureContext) => void;
|
|
59
|
+
ConfigureForm?: ComponentType<FieldConfigureFormProps>;
|
|
60
|
+
Component?: ComponentType<FieldConfigureFormProps>;
|
|
61
|
+
normalizeValues?: (values: Record<string, any>, context: FieldConfigureContext) => Record<string, any>;
|
|
62
|
+
normalize?: (values: Record<string, any>, context: FieldConfigureContext) => Record<string, any>;
|
|
63
|
+
validate?: (values: Record<string, any>, context: FieldConfigureContext) => Promise<void> | void;
|
|
64
|
+
}
|
|
18
65
|
export declare abstract class CollectionFieldInterface {
|
|
19
66
|
collectionFieldInterfaceManager: CollectionFieldInterfaceManager;
|
|
20
67
|
constructor(collectionFieldInterfaceManager: CollectionFieldInterfaceManager);
|
|
@@ -37,35 +84,24 @@ export declare abstract class CollectionFieldInterface {
|
|
|
37
84
|
hasDefaultValue?: boolean;
|
|
38
85
|
componentOptions?: CollectionFieldInterfaceComponentOption[];
|
|
39
86
|
isAssociation?: boolean;
|
|
40
|
-
operators?:
|
|
87
|
+
operators?: FieldFilterOperator[];
|
|
41
88
|
properties?: any;
|
|
42
89
|
validationType?: string;
|
|
43
90
|
availableValidationOptions: string[];
|
|
91
|
+
configure?: FieldInterfaceConfigure;
|
|
44
92
|
excludeValidationOptions?: string[];
|
|
45
93
|
/**
|
|
46
94
|
* - 如果该值为空,则在 Filter 组件中该字段会被过滤掉
|
|
47
95
|
* - 如果该值为空,则不会在变量列表中看到该字段
|
|
48
96
|
*/
|
|
49
|
-
filterable?:
|
|
50
|
-
/**
|
|
51
|
-
* 字段所支持的操作符,会在 Filter 组件中显示,比如设置 `数据范围` 的时候可以看见
|
|
52
|
-
*/
|
|
53
|
-
operators?: any[];
|
|
54
|
-
/**
|
|
55
|
-
* 为当前字段添加子选项,这个子选项会在 Filter 组件中显示,比如设置 `数据范围` 的时候可以看见
|
|
56
|
-
*/
|
|
57
|
-
children?: any[];
|
|
58
|
-
[key: string]: any;
|
|
59
|
-
};
|
|
97
|
+
filterable?: FieldFilterable;
|
|
60
98
|
titleUsable?: boolean;
|
|
61
|
-
validateSchema?(fieldSchema: ISchema): Record<string, ISchema>;
|
|
62
99
|
usePathOptions?(field: any): any;
|
|
63
|
-
schemaInitialize?(schema: ISchema, data: any): void;
|
|
64
100
|
hidden?: boolean;
|
|
65
101
|
addComponentOption(componentOption: CollectionFieldInterfaceComponentOption): void;
|
|
66
102
|
getConfigureFormProperties(collectionInfo?: any): Record<string, ISchema>;
|
|
67
103
|
getDefaultValueProperty(): {
|
|
68
104
|
defaultValue: any;
|
|
69
105
|
};
|
|
70
|
-
addOperator(operatorOption:
|
|
106
|
+
addOperator(operatorOption: FieldFilterOperator): void;
|
|
71
107
|
}
|
|
@@ -6,15 +6,27 @@
|
|
|
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 FieldFilterable, type FieldFilterOperator, type FieldFilterOperatorReference } from '../collection-manager/filter-operators';
|
|
10
|
+
import { type FieldValidationConfigureInput, type FieldValidationConfigureItem } from '../collection-manager/field-validation';
|
|
11
|
+
import type { FieldInterfaceConfigure } from './CollectionFieldInterface';
|
|
12
|
+
import type { ReactNode } from 'react';
|
|
9
13
|
interface FieldInterfaceLike {
|
|
10
14
|
name?: string;
|
|
15
|
+
title?: ReactNode;
|
|
16
|
+
group?: string;
|
|
17
|
+
order?: number;
|
|
18
|
+
isAssociation?: boolean;
|
|
11
19
|
supportDataSourceType?: string[];
|
|
12
20
|
notSupportDataSourceType?: string[];
|
|
21
|
+
properties?: Record<string, any>;
|
|
22
|
+
configure?: FieldInterfaceConfigure;
|
|
23
|
+
filterable?: FieldFilterable;
|
|
13
24
|
addComponentOption?: (option: any) => void;
|
|
14
|
-
addOperator?: (option:
|
|
25
|
+
addOperator?: (option: FieldFilterOperator) => void;
|
|
26
|
+
getConfigureFormProperties?: (collectionInfo?: any) => Record<string, any>;
|
|
15
27
|
}
|
|
16
28
|
interface PendingAction {
|
|
17
|
-
type: 'addComponentOption' | 'addOperator';
|
|
29
|
+
type: 'addComponentOption' | 'addOperator' | 'registerConfigure';
|
|
18
30
|
data: any;
|
|
19
31
|
}
|
|
20
32
|
/**
|
|
@@ -60,7 +72,50 @@ export declare class CollectionFieldInterfaceManager {
|
|
|
60
72
|
* @param operatorOption 操作符配置
|
|
61
73
|
* @returns void
|
|
62
74
|
*/
|
|
63
|
-
addFieldInterfaceOperator(name: string, operatorOption:
|
|
75
|
+
addFieldInterfaceOperator(name: string, operatorOption: FieldFilterOperator): void;
|
|
76
|
+
/**
|
|
77
|
+
* 注册 v2 字段过滤操作符。
|
|
78
|
+
*
|
|
79
|
+
* 插件可通过该方法补充自己的过滤操作符,再把它们加入自定义 operator group。
|
|
80
|
+
*
|
|
81
|
+
* @param operator 过滤操作符配置
|
|
82
|
+
* @returns void
|
|
83
|
+
*/
|
|
84
|
+
registerFieldFilterOperator(operator: FieldFilterOperator): void;
|
|
85
|
+
/**
|
|
86
|
+
* 注册 v2 字段过滤操作符分组。
|
|
87
|
+
*
|
|
88
|
+
* 字段 interface 可以通过 `createFilterable(groupName)` 引用这里注册的分组。
|
|
89
|
+
*
|
|
90
|
+
* @param name 分组名
|
|
91
|
+
* @param operators 操作符配置或已注册操作符名
|
|
92
|
+
* @returns void
|
|
93
|
+
*/
|
|
94
|
+
registerFieldFilterOperatorGroup(name: string, operators?: FieldFilterOperatorReference[]): void;
|
|
95
|
+
/**
|
|
96
|
+
* 向已有 v2 字段过滤操作符分组追加操作符。
|
|
97
|
+
*
|
|
98
|
+
* @param name 分组名
|
|
99
|
+
* @param operators 操作符配置或已注册操作符名
|
|
100
|
+
* @returns void
|
|
101
|
+
*/
|
|
102
|
+
addFieldFilterOperatorsToGroup(name: string, operators?: FieldFilterOperatorReference[]): void;
|
|
103
|
+
registerFieldValidationConfigure(item: FieldValidationConfigureItem): void;
|
|
104
|
+
registerFieldValidationConfigureGroup(name: string, items?: FieldValidationConfigureInput[]): void;
|
|
105
|
+
addFieldValidationConfiguresToGroup(name: string, items?: FieldValidationConfigureInput[]): void;
|
|
106
|
+
getFieldValidationConfigureGroup(name: string): FieldValidationConfigureItem[];
|
|
107
|
+
/**
|
|
108
|
+
* 注册字段接口创建/编辑字段时的配置项。
|
|
109
|
+
*
|
|
110
|
+
* 字段插件可以把复杂配置组件、配置属性、normalize / initialize 等逻辑挂到字段接口自身。
|
|
111
|
+
* 如果字段接口尚未注册,配置会暂存并在接口注册后回放。
|
|
112
|
+
*
|
|
113
|
+
* @param options 字段接口配置
|
|
114
|
+
* @returns void
|
|
115
|
+
*/
|
|
116
|
+
registerFieldInterfaceConfigure(options: FieldInterfaceConfigure & {
|
|
117
|
+
name: string;
|
|
118
|
+
}): void;
|
|
64
119
|
/**
|
|
65
120
|
* 获取单个字段接口实例。
|
|
66
121
|
*
|
|
@@ -75,6 +130,27 @@ export declare class CollectionFieldInterfaceManager {
|
|
|
75
130
|
* @returns 字段接口实例列表
|
|
76
131
|
*/
|
|
77
132
|
getFieldInterfaces<T = FieldInterfaceLike>(dataSourceType?: string): T[];
|
|
133
|
+
/**
|
|
134
|
+
* 获取字段接口创建/编辑字段时的配置属性。
|
|
135
|
+
*
|
|
136
|
+
* 字段接口可以通过自身的 properties / getConfigureFormProperties() 定义专属配置项。
|
|
137
|
+
* 数据源管理等 v2 页面只需要通过该方法读取,不需要硬编码具体字段类型。
|
|
138
|
+
*
|
|
139
|
+
* @param name 字段接口名
|
|
140
|
+
* @param collectionInfo 当前数据表信息
|
|
141
|
+
* @returns 配置属性映射
|
|
142
|
+
*/
|
|
143
|
+
getFieldInterfaceConfigureProperties(name: string, collectionInfo?: any): Record<string, any>;
|
|
144
|
+
/**
|
|
145
|
+
* 获取字段接口配置。
|
|
146
|
+
*
|
|
147
|
+
* 返回值会合并字段接口自身声明和后注册配置;后注册配置优先。
|
|
148
|
+
*
|
|
149
|
+
* @param name 字段接口名
|
|
150
|
+
* @param collectionInfo 当前数据表信息
|
|
151
|
+
* @returns 字段接口配置
|
|
152
|
+
*/
|
|
153
|
+
getFieldInterfaceConfigure(name: string, collectionInfo?: any): FieldInterfaceConfigure;
|
|
78
154
|
/**
|
|
79
155
|
* 注册字段接口分组。
|
|
80
156
|
*
|
|
@@ -105,5 +181,8 @@ export declare class CollectionFieldInterfaceManager {
|
|
|
105
181
|
order?: number;
|
|
106
182
|
};
|
|
107
183
|
protected enqueueAction(interfaceName: string, action: PendingAction): void;
|
|
184
|
+
protected normalizeFieldInterfaceFilterables(): void;
|
|
185
|
+
protected mergeFieldInterfaceConfigure(base?: FieldInterfaceConfigure, override?: FieldInterfaceConfigure): FieldInterfaceConfigure | undefined;
|
|
186
|
+
protected mergeFieldConfigureItems(baseItems?: FieldInterfaceConfigure['items'], overrideItems?: FieldInterfaceConfigure['items']): import("../collection-manager/field-configure").FieldConfigureItem[];
|
|
108
187
|
}
|
|
109
188
|
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
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 { ComponentType, ReactNode } from 'react';
|
|
10
|
+
export type FieldConfigureComponentType = 'Input' | 'Input.TextArea' | 'InputNumber' | 'Checkbox' | 'Checkbox.Group' | 'ColorPicker' | 'DatePicker' | 'Radio.Group' | 'Select' | 'CollectionSelect' | 'RemoteSelect' | 'TargetKey' | 'SourceKey' | 'ExpiresRadio' | 'ArrayTable' | 'FieldValidation' | 'ForeignKey' | 'Input.JSON' | 'Markdown' | 'Percent' | 'RichText' | 'SourceCollection' | 'Space' | 'ThroughCollection' | 'TimePicker' | 'UnixTimestamp' | (string & {});
|
|
11
|
+
export declare const CollectionSelect = "CollectionSelect";
|
|
12
|
+
export interface FieldConfigureRuntimeContext {
|
|
13
|
+
createOnly?: boolean;
|
|
14
|
+
editMainOnly?: boolean;
|
|
15
|
+
createMainOnly?: boolean;
|
|
16
|
+
disabledJSONB?: boolean;
|
|
17
|
+
primaryKeyOnly?: boolean;
|
|
18
|
+
showReverseFieldConfig?: boolean;
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
}
|
|
21
|
+
export interface FieldConfigureRuntimeState {
|
|
22
|
+
componentProps?: Record<string, unknown>;
|
|
23
|
+
dataSource?: unknown;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
hidden?: boolean;
|
|
26
|
+
hasValue?: boolean;
|
|
27
|
+
value?: unknown;
|
|
28
|
+
}
|
|
29
|
+
export interface FieldConfigureEffectContext {
|
|
30
|
+
changedName?: string;
|
|
31
|
+
context: FieldConfigureRuntimeContext;
|
|
32
|
+
getValue: (name: string) => unknown;
|
|
33
|
+
setValue: (name: string, value: unknown) => void;
|
|
34
|
+
values: Record<string, unknown>;
|
|
35
|
+
}
|
|
36
|
+
export interface FieldConfigureItem {
|
|
37
|
+
name: string;
|
|
38
|
+
title?: ReactNode;
|
|
39
|
+
component?: FieldConfigureComponentType;
|
|
40
|
+
Component?: ComponentType<any>;
|
|
41
|
+
componentProps?: Record<string, unknown>;
|
|
42
|
+
defaultValue?: unknown;
|
|
43
|
+
description?: ReactNode;
|
|
44
|
+
hidden?: boolean | string | ((context: FieldConfigureEffectContext) => boolean);
|
|
45
|
+
disabled?: boolean | string | ((context: FieldConfigureEffectContext) => boolean);
|
|
46
|
+
options?: Array<{
|
|
47
|
+
label: ReactNode;
|
|
48
|
+
value: string | number | boolean;
|
|
49
|
+
}>;
|
|
50
|
+
required?: boolean;
|
|
51
|
+
dependencies?: string[];
|
|
52
|
+
effect?: (context: FieldConfigureEffectContext) => void;
|
|
53
|
+
schema?: Record<string, unknown>;
|
|
54
|
+
layout?: {
|
|
55
|
+
row?: string;
|
|
56
|
+
column?: string;
|
|
57
|
+
columnIndex?: number;
|
|
58
|
+
span?: number;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export declare function evaluateFieldConfigureExpression(value: unknown, context: FieldConfigureEffectContext): boolean;
|
|
62
|
+
export declare function configurePropertiesToItems(properties?: Record<string, any>, options?: {
|
|
63
|
+
components?: Record<string, ComponentType<any>>;
|
|
64
|
+
}): FieldConfigureItem[];
|
|
65
|
+
export declare function getCoreFieldConfigureState(name: string, values: Record<string, unknown>, context?: FieldConfigureRuntimeContext): FieldConfigureRuntimeState;
|
|
66
|
+
export declare function runCoreFieldConfigureEffects(options: FieldConfigureEffectContext): void;
|
|
67
|
+
export declare function indexConfigureItems(options?: {
|
|
68
|
+
autoIncrement?: boolean;
|
|
69
|
+
}): FieldConfigureItem[];
|
|
70
|
+
export declare function dateTimeFormatConfigureItems(options?: {
|
|
71
|
+
includePicker?: boolean;
|
|
72
|
+
hidden?: FieldConfigureItem['hidden'];
|
|
73
|
+
showTimeDefault?: boolean;
|
|
74
|
+
}): FieldConfigureItem[];
|
|
75
|
+
export declare function reverseFieldConfigureItems(): FieldConfigureItem[];
|
|
76
|
+
export declare const reverseFieldConfigureItem: typeof reverseFieldConfigureItems;
|
|
77
|
+
export declare function OptionsEditor(options?: {
|
|
78
|
+
name?: string;
|
|
79
|
+
title?: ReactNode;
|
|
80
|
+
}): FieldConfigureItem;
|
|
@@ -0,0 +1,43 @@
|
|
|
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 FieldValidationConfigureParam {
|
|
11
|
+
key: string;
|
|
12
|
+
label: ReactNode;
|
|
13
|
+
componentType?: 'checkbox' | 'datePicker' | 'inputNumber' | 'multipleSelect' | 'radio' | 'singleSelect' | 'text';
|
|
14
|
+
defaultValue?: unknown;
|
|
15
|
+
options?: Array<{
|
|
16
|
+
label: ReactNode;
|
|
17
|
+
value: string | number | boolean;
|
|
18
|
+
}>;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface FieldValidationConfigureItem {
|
|
22
|
+
key: string;
|
|
23
|
+
label: ReactNode;
|
|
24
|
+
hasValue?: boolean;
|
|
25
|
+
params?: FieldValidationConfigureParam[];
|
|
26
|
+
paramsType?: string;
|
|
27
|
+
}
|
|
28
|
+
export type FieldValidationConfigureInput = FieldValidationConfigureItem | string;
|
|
29
|
+
export declare function RangeValidationItems(valueKind: 'date' | 'number'): FieldValidationConfigureItem[];
|
|
30
|
+
export declare class FieldValidationConfigureRegistry {
|
|
31
|
+
protected items: Map<string, FieldValidationConfigureItem>;
|
|
32
|
+
protected groups: Map<string, FieldValidationConfigureInput[]>;
|
|
33
|
+
register(item: FieldValidationConfigureItem): void;
|
|
34
|
+
registerMany(items?: FieldValidationConfigureItem[]): void;
|
|
35
|
+
registerGroup(name: string, items?: FieldValidationConfigureInput[]): void;
|
|
36
|
+
addToGroup(name: string, items?: FieldValidationConfigureInput[]): void;
|
|
37
|
+
get(name: string): FieldValidationConfigureItem;
|
|
38
|
+
getGroup(name: string): FieldValidationConfigureItem[];
|
|
39
|
+
}
|
|
40
|
+
export declare const fieldValidationConfigureRegistry: FieldValidationConfigureRegistry;
|
|
41
|
+
export declare function registerFieldValidationConfigure(item: FieldValidationConfigureItem): void;
|
|
42
|
+
export declare function registerFieldValidationConfigureGroup(name: string, items?: FieldValidationConfigureInput[]): void;
|
|
43
|
+
export declare function addFieldValidationConfiguresToGroup(name: string, items?: FieldValidationConfigureInput[]): void;
|
|
@@ -0,0 +1,46 @@
|
|
|
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 * as standardFieldFilterOperatorGroups from './operators';
|
|
10
|
+
import type { FieldFilterOperator } from './operators';
|
|
11
|
+
export * from './operators';
|
|
12
|
+
export type FieldFilterOperatorPreset = keyof typeof standardFieldFilterOperatorGroups;
|
|
13
|
+
export type FieldFilterOperatorGroupName = FieldFilterOperatorPreset | (string & {});
|
|
14
|
+
export type FieldFilterOperatorReference<TMeta = unknown> = FieldFilterOperator<TMeta> | string;
|
|
15
|
+
export type FieldFilterOperatorList<TMeta = unknown> = FieldFilterOperator<TMeta>[] | FieldFilterOperatorGroupName;
|
|
16
|
+
export type FieldFilterable<TMeta = unknown> = {
|
|
17
|
+
operators?: FieldFilterOperatorList<TMeta>;
|
|
18
|
+
operatorGroup?: string;
|
|
19
|
+
children?: unknown[];
|
|
20
|
+
nested?: boolean;
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
};
|
|
23
|
+
export declare class FieldFilterOperatorRegistry {
|
|
24
|
+
protected operators: Record<string, FieldFilterOperator>;
|
|
25
|
+
protected groups: Record<string, FieldFilterOperator[]>;
|
|
26
|
+
constructor(groups?: Record<string, FieldFilterOperator[]>);
|
|
27
|
+
register(operator: FieldFilterOperator): this;
|
|
28
|
+
registerMany(operators?: FieldFilterOperator[]): this;
|
|
29
|
+
registerGroup(name: string, operators?: FieldFilterOperatorReference[]): this;
|
|
30
|
+
addToGroup(name: string, operators?: FieldFilterOperatorReference[]): this;
|
|
31
|
+
get(name: string): standardFieldFilterOperatorGroups.FieldFilterOperator;
|
|
32
|
+
getGroup(name: string): standardFieldFilterOperatorGroups.FieldFilterOperator[];
|
|
33
|
+
getGroups(): Record<string, standardFieldFilterOperatorGroups.FieldFilterOperator[]>;
|
|
34
|
+
resolveOperators<TMeta = unknown>(operators?: FieldFilterOperatorList<TMeta>): FieldFilterOperator<TMeta>[];
|
|
35
|
+
protected resolveOperatorReferences(operators?: FieldFilterOperatorReference[]): standardFieldFilterOperatorGroups.FieldFilterOperator[];
|
|
36
|
+
}
|
|
37
|
+
export declare const filterOperatorRegistry: FieldFilterOperatorRegistry;
|
|
38
|
+
export declare const fieldFilterOperators: Record<string, standardFieldFilterOperatorGroups.FieldFilterOperator[]> & typeof standardFieldFilterOperatorGroups;
|
|
39
|
+
export declare const fieldFilterOperatorPresets: Record<string, standardFieldFilterOperatorGroups.FieldFilterOperator[]> & typeof standardFieldFilterOperatorGroups;
|
|
40
|
+
export declare function resolveFilterOperators<TMeta = unknown>(operators?: FieldFilterOperatorList<TMeta>): FieldFilterOperator<TMeta>[];
|
|
41
|
+
export declare function normalizeFilterableOperators<TMeta = unknown>(filterable?: FieldFilterable<TMeta>): FieldFilterable<TMeta>;
|
|
42
|
+
export declare function createFilterable<TPreset extends FieldFilterOperatorGroupName>(preset: TPreset, options?: Omit<FieldFilterable, 'operators'>): FieldFilterable;
|
|
43
|
+
export declare function createTypedFilterable<TMeta = unknown>(groups: Array<{
|
|
44
|
+
types: string[];
|
|
45
|
+
operators: FieldFilterOperatorList<TMeta>;
|
|
46
|
+
}>, resolveType: (meta: TMeta) => string): FieldFilterable<TMeta>;
|
|
@@ -0,0 +1,30 @@
|
|
|
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 type FieldFilterOperator<TMeta = unknown> = {
|
|
10
|
+
label: string;
|
|
11
|
+
value: string;
|
|
12
|
+
selected?: boolean;
|
|
13
|
+
noValue?: boolean;
|
|
14
|
+
schema?: Record<string, unknown>;
|
|
15
|
+
onlyFilterAction?: boolean;
|
|
16
|
+
visible?: (meta: TMeta) => boolean;
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
};
|
|
19
|
+
export declare const string: FieldFilterOperator[];
|
|
20
|
+
export declare const array: FieldFilterOperator[];
|
|
21
|
+
export declare const object: FieldFilterOperator[];
|
|
22
|
+
export declare const datetime: FieldFilterOperator[];
|
|
23
|
+
export declare const number: FieldFilterOperator[];
|
|
24
|
+
export declare const id: FieldFilterOperator[];
|
|
25
|
+
export declare const enumType: FieldFilterOperator[];
|
|
26
|
+
export declare const time: FieldFilterOperator[];
|
|
27
|
+
export declare const boolean: FieldFilterOperator[];
|
|
28
|
+
export declare const tableoid: FieldFilterOperator[];
|
|
29
|
+
export declare const collection: FieldFilterOperator[];
|
|
30
|
+
export declare const bigField: FieldFilterOperator[];
|
|
@@ -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 CheckboxFieldInterface extends CollectionFieldInterface {
|
|
12
11
|
name: string;
|
|
@@ -43,45 +42,6 @@ export declare class CheckboxFieldInterface extends CollectionFieldInterface {
|
|
|
43
42
|
};
|
|
44
43
|
};
|
|
45
44
|
filterable: {
|
|
46
|
-
operators:
|
|
47
|
-
label: string;
|
|
48
|
-
value: string;
|
|
49
|
-
selected: boolean;
|
|
50
|
-
noValue: boolean;
|
|
51
|
-
schema: {
|
|
52
|
-
'x-component': string;
|
|
53
|
-
'x-component-props': {
|
|
54
|
-
multiple: boolean;
|
|
55
|
-
options: {
|
|
56
|
-
label: string;
|
|
57
|
-
value: boolean;
|
|
58
|
-
}[];
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
} | {
|
|
62
|
-
label: string;
|
|
63
|
-
value: string;
|
|
64
|
-
noValue: boolean;
|
|
65
|
-
schema: {
|
|
66
|
-
'x-component': string;
|
|
67
|
-
'x-component-props': {
|
|
68
|
-
multiple: boolean;
|
|
69
|
-
options: {
|
|
70
|
-
label: string;
|
|
71
|
-
value: boolean;
|
|
72
|
-
}[];
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
selected?: undefined;
|
|
76
|
-
} | {
|
|
77
|
-
label: string;
|
|
78
|
-
value: string;
|
|
79
|
-
noValue: boolean;
|
|
80
|
-
selected?: undefined;
|
|
81
|
-
schema?: undefined;
|
|
82
|
-
})[];
|
|
45
|
+
operators: string;
|
|
83
46
|
};
|
|
84
|
-
schemaInitialize(schema: ISchema, { block }: {
|
|
85
|
-
block: string;
|
|
86
|
-
}): void;
|
|
87
47
|
}
|
|
@@ -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 CheckboxGroupFieldInterface extends CollectionFieldInterface {
|
|
12
11
|
name: string;
|
|
@@ -26,19 +25,19 @@ export declare class CheckboxGroupFieldInterface extends CollectionFieldInterfac
|
|
|
26
25
|
availableTypes: string[];
|
|
27
26
|
hasDefaultValue: boolean;
|
|
28
27
|
properties: {
|
|
29
|
-
'uiSchema.enum': import("@formily/
|
|
28
|
+
'uiSchema.enum': import("@formily/json-schema").Stringify<{
|
|
30
29
|
[key: symbol]: any;
|
|
31
30
|
[key: `x-${string}`]: any;
|
|
32
31
|
[key: `x-${number}`]: any;
|
|
33
32
|
version?: string;
|
|
34
|
-
name?: import("@formily/
|
|
33
|
+
name?: import("@formily/json-schema").SchemaKey;
|
|
35
34
|
title?: any;
|
|
36
35
|
description?: any;
|
|
37
36
|
default?: any;
|
|
38
37
|
readOnly?: boolean;
|
|
39
38
|
writeOnly?: boolean;
|
|
40
|
-
type?: import("@formily/
|
|
41
|
-
enum?: import("@formily/
|
|
39
|
+
type?: import("@formily/json-schema").SchemaTypes;
|
|
40
|
+
enum?: import("@formily/json-schema").SchemaEnum<any>;
|
|
42
41
|
const?: any;
|
|
43
42
|
multipleOf?: number;
|
|
44
43
|
maximum?: number;
|
|
@@ -57,12 +56,12 @@ export declare class CheckboxGroupFieldInterface extends CollectionFieldInterfac
|
|
|
57
56
|
format?: string;
|
|
58
57
|
$ref?: string;
|
|
59
58
|
$namespace?: string;
|
|
60
|
-
definitions?: import("@formily/
|
|
61
|
-
properties?: import("@formily/
|
|
62
|
-
items?: import("@formily/
|
|
63
|
-
additionalItems?: import("@formily/
|
|
64
|
-
patternProperties?: import("@formily/
|
|
65
|
-
additionalProperties?: import("@formily/
|
|
59
|
+
definitions?: import("@formily/json-schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
60
|
+
properties?: import("@formily/json-schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
61
|
+
items?: import("@formily/json-schema").SchemaItems<any, any, any, any, any, any, any, any>;
|
|
62
|
+
additionalItems?: import("@formily/json-schema").Stringify<any>;
|
|
63
|
+
patternProperties?: import("@formily/json-schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
64
|
+
additionalProperties?: import("@formily/json-schema").Stringify<any>;
|
|
66
65
|
"x-value"?: any;
|
|
67
66
|
"x-index"?: number;
|
|
68
67
|
"x-pattern"?: any;
|
|
@@ -72,7 +71,7 @@ export declare class CheckboxGroupFieldInterface extends CollectionFieldInterfac
|
|
|
72
71
|
"x-decorator-props"?: any;
|
|
73
72
|
"x-component"?: any;
|
|
74
73
|
"x-component-props"?: any;
|
|
75
|
-
"x-reactions"?: import("@formily/
|
|
74
|
+
"x-reactions"?: import("@formily/json-schema").SchemaReactions<any>;
|
|
76
75
|
"x-content"?: any;
|
|
77
76
|
"x-data"?: any;
|
|
78
77
|
"x-visible"?: boolean;
|
|
@@ -102,37 +101,6 @@ export declare class CheckboxGroupFieldInterface extends CollectionFieldInterfac
|
|
|
102
101
|
};
|
|
103
102
|
};
|
|
104
103
|
filterable: {
|
|
105
|
-
operators:
|
|
106
|
-
label: string;
|
|
107
|
-
value: string;
|
|
108
|
-
selected: boolean;
|
|
109
|
-
schema: {
|
|
110
|
-
'x-component': string;
|
|
111
|
-
'x-component-props': {
|
|
112
|
-
mode: string;
|
|
113
|
-
};
|
|
114
|
-
};
|
|
115
|
-
noValue?: undefined;
|
|
116
|
-
} | {
|
|
117
|
-
label: string;
|
|
118
|
-
value: string;
|
|
119
|
-
schema: {
|
|
120
|
-
'x-component': string;
|
|
121
|
-
'x-component-props': {
|
|
122
|
-
mode: string;
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
selected?: undefined;
|
|
126
|
-
noValue?: undefined;
|
|
127
|
-
} | {
|
|
128
|
-
label: string;
|
|
129
|
-
value: string;
|
|
130
|
-
noValue: boolean;
|
|
131
|
-
selected?: undefined;
|
|
132
|
-
schema?: undefined;
|
|
133
|
-
})[];
|
|
104
|
+
operators: string;
|
|
134
105
|
};
|
|
135
|
-
schemaInitialize(schema: ISchema, { block }: {
|
|
136
|
-
block: string;
|
|
137
|
-
}): void;
|
|
138
106
|
}
|