@nocobase/client-v2 2.1.0-beta.44 → 2.1.0-beta.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/BaseApplication.d.ts +9 -0
- package/es/authRedirect.d.ts +12 -0
- package/es/collection-manager/filter-operators/index.d.ts +1 -0
- package/es/components/form/filter/CollectionFilterItem.d.ts +5 -1
- package/es/components/form/filter/FilterValueInput.d.ts +5 -0
- package/es/flow/admin-shell/admin-layout/AppListRender.d.ts +11 -0
- package/es/flow/admin-shell/admin-layout/index.d.ts +1 -0
- package/es/flow/admin-shell/admin-layout/useApplications.d.ts +3 -2
- 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/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/metaTreeAssociationDepth.d.ts +13 -0
- package/es/flow/internal/utils/operatorSchemaHelper.d.ts +26 -3
- package/es/flow/models/base/AssociationFieldGroupModel.d.ts +2 -33
- package/es/flow/models/blocks/filter-manager/utils.d.ts +23 -1
- package/es/flow/models/blocks/table/TableColumnModel.d.ts +2 -0
- package/es/index.mjs +178 -100
- package/lib/index.js +187 -109
- package/package.json +7 -7
- package/src/BaseApplication.tsx +13 -0
- package/src/__tests__/browserChecker.test.ts +103 -0
- package/src/__tests__/dataSourceRuntime.test.tsx +22 -1
- package/src/__tests__/nocobase-buildin-plugin-auth.test.tsx +5 -0
- package/src/authRedirect.ts +43 -0
- package/src/collection-field-interface/CollectionFieldInterface.ts +14 -7
- package/src/collection-manager/filter-operators/index.ts +29 -2
- package/src/components/form/filter/CollectionFilterItem.tsx +10 -2
- package/src/components/form/filter/FilterValueInput.tsx +27 -2
- package/src/components/form/filter/__tests__/FilterValueInput.test.tsx +39 -0
- package/src/flow/__tests__/FlowRoute.test.tsx +8 -1
- package/src/flow/actions/__tests__/linkageRules.subFormSetFieldProps.test.ts +369 -2
- package/src/flow/actions/dataScope.tsx +8 -1
- package/src/flow/actions/linkageRules.tsx +56 -1
- package/src/flow/actions/setTargetDataScope.tsx +1 -1
- package/src/flow/admin-shell/admin-layout/AdminLayoutComponent.tsx +31 -3
- package/src/flow/admin-shell/admin-layout/AppListRender.tsx +139 -0
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutMenuModels.test.ts +8 -1
- package/src/flow/admin-shell/admin-layout/index.ts +1 -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/common/Markdown/Edit.tsx +32 -4
- package/src/flow/components/ConditionBuilder.tsx +12 -2
- package/src/flow/components/DefaultValue.tsx +14 -8
- package/src/flow/components/FieldAssignRulesEditor.tsx +37 -46
- package/src/flow/components/FieldAssignValueInput.tsx +14 -14
- package/src/flow/components/__tests__/FieldAssignRulesEditor.test.tsx +112 -1
- package/src/flow/components/__tests__/fieldAssignOptions.test.ts +71 -1
- package/src/flow/components/fieldAssignOptions.ts +23 -6
- package/src/flow/components/filter/LinkageFilterItem.tsx +26 -12
- package/src/flow/components/filter/VariableFilterItem.tsx +32 -13
- 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/metaTreeAssociationDepth.ts +69 -0
- package/src/flow/internal/utils/operatorSchemaHelper.ts +112 -5
- package/src/flow/models/actions/FilterActionModel.tsx +15 -3
- package/src/flow/models/base/AssociationFieldGroupModel.tsx +20 -3
- package/src/flow/models/base/__tests__/AssociationFieldGroupModel.test.ts +86 -0
- package/src/flow/models/blocks/assign-form/AssignFormGridModel.tsx +11 -0
- package/src/flow/models/blocks/filter-form/FilterFormItemModel.tsx +14 -12
- package/src/flow/models/blocks/filter-form/__tests__/FilterFormItemModel.defineChildren.test.ts +6 -1
- package/src/flow/models/blocks/filter-manager/__tests__/getDefaultOperator.test.ts +35 -1
- package/src/flow/models/blocks/filter-manager/flow-actions/__tests__/customizeFilterRender.test.tsx +148 -0
- package/src/flow/models/blocks/filter-manager/flow-actions/__tests__/defaultOperator.test.tsx +85 -0
- package/src/flow/models/blocks/filter-manager/flow-actions/connectFields.tsx +48 -6
- package/src/flow/models/blocks/filter-manager/flow-actions/customizeFilterRender.tsx +14 -44
- package/src/flow/models/blocks/filter-manager/flow-actions/defaultOperator.tsx +3 -5
- package/src/flow/models/blocks/filter-manager/flow-actions/operatorComponentProps.tsx +2 -12
- package/src/flow/models/blocks/filter-manager/utils.ts +143 -4
- package/src/flow/models/blocks/form/FormAssociationItemModel.tsx +9 -0
- package/src/flow/models/blocks/form/FormItemModel.tsx +9 -0
- package/src/flow/models/blocks/form/__tests__/FormItemModel.defineChildren.test.ts +27 -2
- 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__/TableColumnModel.test.tsx +18 -0
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.tsx +6 -7
package/es/BaseApplication.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ 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';
|
|
15
16
|
import { LayoutManager } from './layout-manager/LayoutManager';
|
|
@@ -25,6 +26,7 @@ declare global {
|
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
type AnyComponent = RenderableComponentType<any>;
|
|
29
|
+
type AppListLoader = (app: BaseApplication<any>) => Promise<AppListProps> | AppListProps;
|
|
28
30
|
type AuthTokenPayload = {
|
|
29
31
|
token: string;
|
|
30
32
|
authenticator: string | null;
|
|
@@ -104,6 +106,7 @@ export declare abstract class BaseApplication<TOptions extends BaseApplicationOp
|
|
|
104
106
|
private wsAuthorized;
|
|
105
107
|
apps: {
|
|
106
108
|
Component?: AnyComponent | null;
|
|
109
|
+
loadAppList?: AppListLoader | null;
|
|
107
110
|
};
|
|
108
111
|
get pm(): TPluginManager;
|
|
109
112
|
get disableAcl(): boolean;
|
|
@@ -153,6 +156,12 @@ export declare abstract class BaseApplication<TOptions extends BaseApplicationOp
|
|
|
153
156
|
*/
|
|
154
157
|
protected addComponent(component: AnyComponent, name?: string): void;
|
|
155
158
|
addComponents(components: Record<string, AnyComponent>): void;
|
|
159
|
+
setAppsComponent({ Component }: {
|
|
160
|
+
Component: AnyComponent;
|
|
161
|
+
}): void;
|
|
162
|
+
setAppsProvider({ loadAppList }: {
|
|
163
|
+
loadAppList: AppListLoader;
|
|
164
|
+
}): void;
|
|
156
165
|
protected getRootFallback(): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
157
166
|
getRootComponent(): React.FC<{
|
|
158
167
|
children?: React.ReactNode;
|
package/es/authRedirect.d.ts
CHANGED
|
@@ -17,6 +17,18 @@ type LocationLike = {
|
|
|
17
17
|
search?: string;
|
|
18
18
|
hash?: string;
|
|
19
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* The runtime URL segment under which the modern (v2) client is served.
|
|
22
|
+
* Injected by the server as `window.__nocobase_modern_client_prefix__`. Falls
|
|
23
|
+
* back to the trailing segment of `window.__nocobase_public_path__`, then to
|
|
24
|
+
* the default `v`. Returns a bare segment (no slashes).
|
|
25
|
+
*/
|
|
26
|
+
export declare function getModernClientPrefix(): string;
|
|
27
|
+
/**
|
|
28
|
+
* Strip the trailing modern-client prefix segment from a public path,
|
|
29
|
+
* recovering the app root public path (e.g. `/nocobase/v/` -> `/nocobase/`).
|
|
30
|
+
*/
|
|
31
|
+
export declare function stripModernClientPrefix(publicPath?: string): string;
|
|
20
32
|
export declare function getV2EffectiveBasePath(app: AppLike): string;
|
|
21
33
|
declare function getDefaultV2AdminRedirectPath(app: AppLike): string;
|
|
22
34
|
/**
|
|
@@ -16,6 +16,7 @@ export type FieldFilterOperatorList<TMeta = unknown> = FieldFilterOperator<TMeta
|
|
|
16
16
|
export type FieldFilterable<TMeta = unknown> = {
|
|
17
17
|
operators?: FieldFilterOperatorList<TMeta>;
|
|
18
18
|
operatorGroup?: string;
|
|
19
|
+
operatorOverrides?: FieldFilterOperator<TMeta>[];
|
|
19
20
|
children?: unknown[];
|
|
20
21
|
nested?: boolean;
|
|
21
22
|
[key: string]: unknown;
|
|
@@ -33,6 +33,10 @@ export interface CollectionFilterItemProps {
|
|
|
33
33
|
noIgnore?: boolean;
|
|
34
34
|
/** Translator; defaults to identity so callers can omit it. */
|
|
35
35
|
t?: (key: string) => string;
|
|
36
|
+
/** Optional v2 app registry used to resolve plugin-provided operator components. */
|
|
37
|
+
app?: {
|
|
38
|
+
getComponent?: (name: string) => React.ComponentType<any> | undefined;
|
|
39
|
+
};
|
|
36
40
|
}
|
|
37
41
|
/**
|
|
38
42
|
* 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)`.
|
|
@@ -43,7 +47,7 @@ export declare const CollectionFilterItem: FC<CollectionFilterItemProps>;
|
|
|
43
47
|
/**
|
|
44
48
|
* 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
49
|
*/
|
|
46
|
-
export declare function createCollectionFilterItem(collection: Collection, bound?: Pick<CollectionFilterItemProps, 'filterableFieldNames' | 'nonfilterableFieldNames' | 'noIgnore' | 't'>): React.FC<{
|
|
50
|
+
export declare function createCollectionFilterItem(collection: Collection, bound?: Pick<CollectionFilterItemProps, 'filterableFieldNames' | 'nonfilterableFieldNames' | 'noIgnore' | 't' | 'app'>): React.FC<{
|
|
47
51
|
value: CollectionFilterItemValue;
|
|
48
52
|
}>;
|
|
49
53
|
export default CollectionFilterItem;
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import type { FilterOperator, FilterOption } from '../../../flow/components/filter/useFilterOptions';
|
|
11
|
+
type ComponentRegistryApp = {
|
|
12
|
+
getComponent?: (name: string) => React.ComponentType<any> | undefined;
|
|
13
|
+
};
|
|
11
14
|
export interface FilterValueInputProps {
|
|
12
15
|
/** The currently selected leaf field option from the field picker. */
|
|
13
16
|
field?: FilterOption;
|
|
@@ -21,6 +24,8 @@ export interface FilterValueInputProps {
|
|
|
21
24
|
t?: (key: string) => string;
|
|
22
25
|
/** Optional placeholder for the fallback `Input`. */
|
|
23
26
|
placeholder?: string;
|
|
27
|
+
/** Optional v2 app registry used to resolve plugin-provided operator components. */
|
|
28
|
+
app?: ComponentRegistryApp;
|
|
24
29
|
}
|
|
25
30
|
/**
|
|
26
31
|
* 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.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import type { AppListProps } from '@ant-design/pro-layout/es/components/AppsLogoComponents/types';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
export declare function useAppListRender(): (appList: AppListProps) => React.JSX.Element;
|
|
@@ -17,5 +17,6 @@ export * from './resolveAdminRouteRuntimeTarget';
|
|
|
17
17
|
export * from './constants';
|
|
18
18
|
export * from './ResetThemeTokenAndKeepAlgorithm';
|
|
19
19
|
export * from './useApplications';
|
|
20
|
+
export * from './AppListRender';
|
|
20
21
|
export * from './PinnedPluginListLite';
|
|
21
22
|
export * from './mobile-layout';
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
import React from 'react';
|
|
10
10
|
export declare const useApplications: () => {
|
|
11
|
-
Component:
|
|
11
|
+
Component: React.JSXElementConstructor<any> | React.ExoticComponent<any>;
|
|
12
|
+
appList: any[];
|
|
12
13
|
};
|
|
@@ -13,5 +13,6 @@ export declare const ConditionBuilder: React.MemoExoticComponent<import("@formil
|
|
|
13
13
|
value: FilterGroupType;
|
|
14
14
|
onChange: (value: FilterGroupType) => void;
|
|
15
15
|
extraMetaTree?: MetaTreeNode[];
|
|
16
|
+
maxAssociationFieldDepth?: number;
|
|
16
17
|
}>>;
|
|
17
18
|
export declare const commonConditionHandler: (ctx: any, params: any) => void;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import type { FilterGroupType } from '@nocobase/utils/client';
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { FieldAssignValueInput } from './FieldAssignValueInput';
|
|
12
|
-
import type
|
|
12
|
+
import { type FieldAssignCascaderOption } from './fieldAssignOptions';
|
|
13
13
|
export type AssignMode = 'default' | 'assign';
|
|
14
14
|
type CollectionFieldLike = {
|
|
15
15
|
name?: unknown;
|
|
@@ -17,6 +17,7 @@ type CollectionFieldLike = {
|
|
|
17
17
|
type?: unknown;
|
|
18
18
|
interface?: unknown;
|
|
19
19
|
uiSchema?: unknown;
|
|
20
|
+
target?: unknown;
|
|
20
21
|
targetKey?: unknown;
|
|
21
22
|
targetCollectionTitleFieldName?: unknown;
|
|
22
23
|
targetCollection?: any;
|
|
@@ -66,6 +67,7 @@ export interface FieldAssignRulesEditorProps {
|
|
|
66
67
|
onSyncAssociationTitleField?: (params: SyncAssociationTitleFieldParams) => Promise<void> | void;
|
|
67
68
|
/** 在日期字段下启用“日期变量替换 Constant 位”。 */
|
|
68
69
|
enableDateVariableAsConstant?: boolean;
|
|
70
|
+
maxAssociationFieldDepth?: number;
|
|
69
71
|
}
|
|
70
72
|
export declare const FieldAssignRulesEditor: React.FC<FieldAssignRulesEditorProps>;
|
|
71
73
|
export {};
|
|
@@ -52,6 +52,7 @@ interface Props {
|
|
|
52
52
|
* 默认 false,保持历史行为。
|
|
53
53
|
*/
|
|
54
54
|
enableDateVariableAsConstant?: boolean;
|
|
55
|
+
maxAssociationFieldDepth?: number;
|
|
55
56
|
}
|
|
56
57
|
export declare function mergeItemMetaTreeForAssignValue(baseTree: MetaTreeNode[], extraTree: MetaTreeNode[]): MetaTreeNode[];
|
|
57
58
|
export declare function resolveAssignValueFieldPath(itemModel: any): string | undefined;
|
|
@@ -15,9 +15,19 @@ export type FieldAssignCascaderOption = {
|
|
|
15
15
|
loading?: boolean;
|
|
16
16
|
children?: FieldAssignCascaderOption[];
|
|
17
17
|
};
|
|
18
|
+
type CollectionLike = {
|
|
19
|
+
getField?: (name: string) => unknown;
|
|
20
|
+
getFields?: () => unknown[];
|
|
21
|
+
};
|
|
22
|
+
export declare function buildFieldAssignCascaderOptionsFromCollection(collection: CollectionLike | null, t: (key: string) => string, options?: {
|
|
23
|
+
associationDepth?: number;
|
|
24
|
+
maxAssociationFieldDepth?: number;
|
|
25
|
+
}): FieldAssignCascaderOption[];
|
|
18
26
|
export declare function collectFieldAssignCascaderOptions(options: {
|
|
19
27
|
formBlockModel: any;
|
|
20
28
|
t: (key: string) => string;
|
|
21
29
|
/** 子表单模型递归深度(FormItemModel 层级);默认不限制(只受实际配置与循环引用约束) */
|
|
22
30
|
maxFormItemDepth?: number;
|
|
31
|
+
maxAssociationFieldDepth?: number;
|
|
23
32
|
}): FieldAssignCascaderOption[];
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
export declare function limitAssociationMetaTree(nodes: MetaTreeNode[] | undefined, options?: {
|
|
11
|
+
associationDepth?: number;
|
|
12
|
+
maxAssociationDepth?: number;
|
|
13
|
+
}): MetaTreeNode[];
|
|
@@ -6,10 +6,33 @@
|
|
|
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 React, { type ComponentType, type CSSProperties } from 'react';
|
|
10
|
+
type OperatorMeta = {
|
|
11
|
+
value?: string;
|
|
12
|
+
schema?: {
|
|
13
|
+
'x-component'?: string;
|
|
14
|
+
'x-component-props'?: Record<string, unknown>;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
type ComponentRegistry = {
|
|
18
|
+
getComponent?: (name: string) => ComponentType<Record<string, unknown>> | undefined;
|
|
19
|
+
};
|
|
20
|
+
type OperatorComponentRenderOptions = {
|
|
21
|
+
app?: ComponentRegistry;
|
|
22
|
+
fieldModel: unknown;
|
|
23
|
+
operator: string;
|
|
24
|
+
operators?: OperatorMeta[];
|
|
25
|
+
propsPriority?: 'field' | 'operator';
|
|
26
|
+
style?: CSSProperties;
|
|
27
|
+
};
|
|
28
|
+
export declare function pickOperatorStyle(value: unknown): CSSProperties | undefined;
|
|
9
29
|
/**
|
|
10
30
|
* 根据操作符的 schema 定位组件及其 props。
|
|
11
31
|
*/
|
|
12
|
-
export declare function resolveOperatorComponent(app:
|
|
13
|
-
Comp:
|
|
14
|
-
props: Record<string,
|
|
32
|
+
export declare function resolveOperatorComponent(app: ComponentRegistry | undefined, operator: string, operators?: OperatorMeta[]): {
|
|
33
|
+
Comp: React.ComponentType<Record<string, unknown>>;
|
|
34
|
+
props: Record<string, unknown>;
|
|
15
35
|
};
|
|
36
|
+
export declare function restoreOperatorComponentRender(fieldModel?: unknown): boolean;
|
|
37
|
+
export declare function applyOperatorComponentRender({ app, fieldModel, operator, operators, propsPriority, style, }: OperatorComponentRenderOptions): boolean;
|
|
38
|
+
export {};
|
|
@@ -9,41 +9,10 @@
|
|
|
9
9
|
import { FlowModel, FlowModelContext } from '@nocobase/flow-engine';
|
|
10
10
|
export declare class AssociationFieldGroupModel extends FlowModel {
|
|
11
11
|
static itemModelName: string;
|
|
12
|
+
static maxAssociationFieldDepth: number;
|
|
12
13
|
static defineChildren(ctx: FlowModelContext): {
|
|
13
14
|
key: string;
|
|
14
15
|
label: string;
|
|
15
|
-
children: () =>
|
|
16
|
-
key: string;
|
|
17
|
-
label: string;
|
|
18
|
-
type: string;
|
|
19
|
-
children: {
|
|
20
|
-
key: string;
|
|
21
|
-
label: string;
|
|
22
|
-
useModel: string;
|
|
23
|
-
toggleable: (subModel: any) => boolean;
|
|
24
|
-
createModelOptions: {
|
|
25
|
-
stepParams: {
|
|
26
|
-
fieldSettings: {
|
|
27
|
-
init: {
|
|
28
|
-
dataSourceKey: any;
|
|
29
|
-
collectionName: any;
|
|
30
|
-
fieldPath: string;
|
|
31
|
-
associationPathName: any;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
subModels: {
|
|
36
|
-
field: {
|
|
37
|
-
use: string;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
}[];
|
|
42
|
-
} | {
|
|
43
|
-
key: string;
|
|
44
|
-
label: string;
|
|
45
|
-
type: string;
|
|
46
|
-
children: any[];
|
|
47
|
-
})[];
|
|
16
|
+
children: () => any;
|
|
48
17
|
}[];
|
|
49
18
|
}
|
|
@@ -7,8 +7,29 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import { FlowModel } from '@nocobase/flow-engine';
|
|
10
|
+
import { type FieldFilterable, type FieldFilterOperator } from '../../../../collection-manager/filter-operators';
|
|
10
11
|
import { BlockGridModel } from '../../base';
|
|
11
|
-
|
|
12
|
+
type FilterFormFieldMeta = {
|
|
13
|
+
filterable?: FieldFilterable<unknown> | false;
|
|
14
|
+
interface?: string;
|
|
15
|
+
type?: string;
|
|
16
|
+
};
|
|
17
|
+
type FilterFormOperatorModel = FlowModel & {
|
|
18
|
+
operator?: string;
|
|
19
|
+
collectionField?: FilterFormFieldMeta;
|
|
20
|
+
filterField?: FilterFormFieldMeta;
|
|
21
|
+
subModels?: {
|
|
22
|
+
field?: {
|
|
23
|
+
operator?: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
getStepParams?: (flowKey: string, stepKey: string) => {
|
|
27
|
+
value?: string;
|
|
28
|
+
} | undefined;
|
|
29
|
+
};
|
|
30
|
+
export declare function getFilterFormOperatorList(model: FlowModel): FieldFilterOperator<unknown>[];
|
|
31
|
+
export declare function getFilterFormOperatorMeta(model: FlowModel, operator?: any): FieldFilterOperator<unknown>;
|
|
32
|
+
export declare function getDefaultOperator(model: FilterFormOperatorModel): any;
|
|
12
33
|
/**
|
|
13
34
|
* 判断筛选值是否为空
|
|
14
35
|
*
|
|
@@ -19,3 +40,4 @@ export declare function getDefaultOperator(model: any): any;
|
|
|
19
40
|
*/
|
|
20
41
|
export declare function isFilterValueEmpty(value: any): boolean;
|
|
21
42
|
export declare function getAllDataModels(gridModel: BlockGridModel): FlowModel[];
|
|
43
|
+
export {};
|
|
@@ -10,6 +10,8 @@ import { DisplayItemModel, FlowModelContext, ModelRenderMode } from '@nocobase/f
|
|
|
10
10
|
import { TableColumnProps } from 'antd';
|
|
11
11
|
import React from 'react';
|
|
12
12
|
export declare function FieldDeletePlaceholder(props: any): React.JSX.Element;
|
|
13
|
+
export declare const TABLE_COLUMN_MIN_WIDTH = 10;
|
|
14
|
+
export declare function normalizeTableColumnWidth(width: number | null | undefined): number;
|
|
13
15
|
export declare const CustomWidth: ({ setOpen, t, handleChange, defaultValue }: {
|
|
14
16
|
setOpen: any;
|
|
15
17
|
t: any;
|