@nocobase/client-v2 2.1.0-alpha.45 → 2.1.0-alpha.47

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.
Files changed (99) hide show
  1. package/es/authRedirect.d.ts +12 -0
  2. package/es/collection-manager/filter-operators/index.d.ts +1 -0
  3. package/es/components/form/TypedVariableInput.d.ts +75 -0
  4. package/es/components/form/filter/CollectionFilterItem.d.ts +5 -1
  5. package/es/components/form/filter/FilterValueInput.d.ts +5 -0
  6. package/es/components/form/index.d.ts +1 -0
  7. package/es/flow/admin-shell/admin-layout/AdminLayoutMenuModels.d.ts +1 -0
  8. package/es/flow/components/ConditionBuilder.d.ts +1 -0
  9. package/es/flow/components/FieldAssignRulesEditor.d.ts +3 -1
  10. package/es/flow/components/FieldAssignValueInput.d.ts +1 -0
  11. package/es/flow/components/fieldAssignOptions.d.ts +10 -0
  12. package/es/flow/components/filter/LinkageFilterItem.d.ts +1 -0
  13. package/es/flow/components/filter/VariableFilterItem.d.ts +1 -0
  14. package/es/flow/components/filter/metaTreeAssociationDepth.d.ts +13 -0
  15. package/es/flow/internal/utils/operatorSchemaHelper.d.ts +26 -3
  16. package/es/flow/models/base/AssociationFieldGroupModel.d.ts +2 -33
  17. package/es/flow/models/blocks/assign-form/assignFieldValuesFlow.d.ts +8 -0
  18. package/es/flow/models/blocks/filter-manager/utils.d.ts +23 -1
  19. package/es/flow/models/blocks/table/TableColumnModel.d.ts +2 -0
  20. package/es/index.mjs +106 -106
  21. package/lib/index.js +106 -106
  22. package/package.json +7 -7
  23. package/src/__tests__/browserChecker.test.ts +103 -0
  24. package/src/__tests__/dataSourceRuntime.test.tsx +22 -1
  25. package/src/__tests__/nocobase-buildin-plugin-auth.test.tsx +5 -0
  26. package/src/authRedirect.ts +43 -0
  27. package/src/collection-field-interface/CollectionFieldInterface.ts +14 -7
  28. package/src/collection-manager/filter-operators/index.ts +29 -2
  29. package/src/components/README.md +48 -0
  30. package/src/components/README.zh-CN.md +48 -0
  31. package/src/components/form/TypedVariableInput.tsx +441 -0
  32. package/src/components/form/__tests__/TypedVariableInput.test.tsx +152 -0
  33. package/src/components/form/filter/CollectionFilterItem.tsx +10 -2
  34. package/src/components/form/filter/FilterValueInput.tsx +27 -2
  35. package/src/components/form/filter/__tests__/FilterValueInput.test.tsx +39 -0
  36. package/src/components/form/index.tsx +1 -0
  37. package/src/flow/__tests__/FlowRoute.test.tsx +8 -1
  38. package/src/flow/actions/__tests__/linkageRules.hiddenSync.restore.test.ts +100 -0
  39. package/src/flow/actions/__tests__/linkageRules.subFormSetFieldProps.test.ts +369 -2
  40. package/src/flow/actions/__tests__/linkageRulesRefresh.test.ts +23 -1
  41. package/src/flow/actions/dataScope.tsx +8 -1
  42. package/src/flow/actions/linkageRules.tsx +61 -5
  43. package/src/flow/actions/linkageRulesRefresh.tsx +2 -3
  44. package/src/flow/actions/setTargetDataScope.tsx +1 -1
  45. package/src/flow/admin-shell/admin-layout/AdminLayoutMenuModels.tsx +15 -1
  46. package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutMenuModels.test.ts +75 -1
  47. package/src/flow/admin-shell/admin-layout/resolveAdminRouteRuntimeTarget.test.ts +11 -0
  48. package/src/flow/admin-shell/admin-layout/resolveAdminRouteRuntimeTarget.ts +2 -4
  49. package/src/flow/common/Markdown/Edit.tsx +32 -4
  50. package/src/flow/components/ConditionBuilder.tsx +12 -2
  51. package/src/flow/components/DefaultValue.tsx +14 -8
  52. package/src/flow/components/FieldAssignRulesEditor.tsx +37 -46
  53. package/src/flow/components/FieldAssignValueInput.tsx +14 -14
  54. package/src/flow/components/__tests__/FieldAssignRulesEditor.test.tsx +112 -1
  55. package/src/flow/components/__tests__/fieldAssignOptions.test.ts +71 -1
  56. package/src/flow/components/code-editor/__tests__/runjsCompletions.test.ts +272 -27
  57. package/src/flow/components/code-editor/runjsCompletions.ts +490 -9
  58. package/src/flow/components/fieldAssignOptions.ts +23 -6
  59. package/src/flow/components/filter/LinkageFilterItem.tsx +26 -12
  60. package/src/flow/components/filter/VariableFilterItem.tsx +32 -13
  61. package/src/flow/components/filter/__tests__/fieldsToOptions.test.ts +48 -0
  62. package/src/flow/components/filter/__tests__/metaTreeAssociationDepth.test.ts +60 -0
  63. package/src/flow/components/filter/fieldsToOptions.ts +9 -4
  64. package/src/flow/components/filter/metaTreeAssociationDepth.ts +69 -0
  65. package/src/flow/internal/utils/operatorSchemaHelper.ts +112 -5
  66. package/src/flow/models/actions/FilterActionModel.tsx +15 -3
  67. package/src/flow/models/actions/__tests__/AssignFormRefill.test.ts +90 -0
  68. package/src/flow/models/base/AssociationFieldGroupModel.tsx +20 -3
  69. package/src/flow/models/base/GridModel.tsx +1 -1
  70. package/src/flow/models/base/PageModel/ChildPageModel.tsx +5 -1
  71. package/src/flow/models/base/PageModel/__tests__/ChildPageModel.test.ts +12 -0
  72. package/src/flow/models/base/__tests__/AssociationFieldGroupModel.test.ts +86 -0
  73. package/src/flow/models/base/__tests__/GridModel.render.test.tsx +53 -0
  74. package/src/flow/models/blocks/assign-form/AssignFormGridModel.tsx +12 -3
  75. package/src/flow/models/blocks/assign-form/AssignFormItemModel.tsx +14 -4
  76. package/src/flow/models/blocks/assign-form/__tests__/assignFieldValuesFlow.editor.test.tsx +216 -0
  77. package/src/flow/models/blocks/assign-form/assignFieldValuesFlow.tsx +142 -40
  78. package/src/flow/models/blocks/filter-form/FilterFormItemModel.tsx +14 -12
  79. package/src/flow/models/blocks/filter-form/__tests__/FilterFormItemModel.defineChildren.test.ts +6 -1
  80. package/src/flow/models/blocks/filter-manager/__tests__/getDefaultOperator.test.ts +35 -1
  81. package/src/flow/models/blocks/filter-manager/flow-actions/__tests__/customizeFilterRender.test.tsx +148 -0
  82. package/src/flow/models/blocks/filter-manager/flow-actions/__tests__/defaultOperator.test.tsx +85 -0
  83. package/src/flow/models/blocks/filter-manager/flow-actions/connectFields.tsx +48 -6
  84. package/src/flow/models/blocks/filter-manager/flow-actions/customizeFilterRender.tsx +14 -44
  85. package/src/flow/models/blocks/filter-manager/flow-actions/defaultOperator.tsx +3 -5
  86. package/src/flow/models/blocks/filter-manager/flow-actions/operatorComponentProps.tsx +2 -12
  87. package/src/flow/models/blocks/filter-manager/utils.ts +143 -4
  88. package/src/flow/models/blocks/form/FormAssociationItemModel.tsx +9 -0
  89. package/src/flow/models/blocks/form/FormItemModel.tsx +9 -0
  90. package/src/flow/models/blocks/form/__tests__/FormBlockModel.test.tsx +17 -0
  91. package/src/flow/models/blocks/form/__tests__/FormItemModel.defineChildren.test.ts +27 -2
  92. package/src/flow/models/blocks/form/value-runtime/__tests__/runtime.test.ts +29 -0
  93. package/src/flow/models/blocks/form/value-runtime/runtime.ts +5 -1
  94. package/src/flow/models/blocks/table/TableColumnModel.tsx +15 -5
  95. package/src/flow/models/blocks/table/TableCustomColumnModel.tsx +2 -2
  96. package/src/flow/models/blocks/table/__tests__/TableColumnModel.test.tsx +18 -0
  97. package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.tsx +6 -7
  98. package/src/flow/models/fields/mobile-components/MobileLazySelect.tsx +5 -3
  99. package/src/flow/models/fields/mobile-components/__tests__/MobileSelect.test.tsx +70 -0
@@ -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;
@@ -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;
@@ -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.
@@ -15,4 +15,5 @@ export * from './FileSizeInput';
15
15
  export * from './JsonTextArea';
16
16
  export * from './PasswordInput';
17
17
  export * from './RemoteSelect';
18
+ export * from './TypedVariableInput';
18
19
  export * from './VariableInput';
@@ -45,6 +45,7 @@ export declare class AdminLayoutMenuItemModel extends FlowModel<AdminLayoutMenuI
45
45
  * @returns {boolean} 是否需要走 FlowModel 默认保存链路
46
46
  */
47
47
  hasPersistableInstanceFlows(): boolean;
48
+ serialize(): ReturnType<FlowModel['serialize']>;
48
49
  setHidden(value: boolean): void;
49
50
  protected renderHiddenInConfig(): React.ReactNode | undefined;
50
51
  createMenuRoute(route: NocoBaseDesktopRoute, options?: {
@@ -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 { FieldAssignCascaderOption } from './fieldAssignOptions';
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 {};
@@ -20,6 +20,7 @@ export interface LinkageFilterItemProps {
20
20
  model: FlowModel;
21
21
  /** 向变量树额外注入节点(置于根部) */
22
22
  extraMetaTree?: MetaTreeNode[];
23
+ maxAssociationFieldDepth?: number;
23
24
  }
24
25
  type OperatorMeta = {
25
26
  value: string;
@@ -30,6 +30,7 @@ export interface VariableFilterItemProps {
30
30
  */
31
31
  rightMetaTree?: MetaTreeNode[] | (() => MetaTreeNode[] | Promise<MetaTreeNode[]>);
32
32
  ignoreFieldNames?: string[];
33
+ maxAssociationFieldDepth?: number;
33
34
  }
34
35
  /**
35
36
  * 上下文筛选项组件
@@ -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: any, operator: string, operators?: Array<any>): {
13
- Comp: any;
14
- props: Record<string, any>;
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
  }
@@ -23,6 +23,9 @@ type AssignFieldValuesModel = {
23
23
  uid: string;
24
24
  assignFormUid?: string;
25
25
  context?: AssignFieldValuesContext;
26
+ subModels?: {
27
+ assignForm?: AssignFormModel;
28
+ };
26
29
  getStepParams?: (flowKey: string, stepKey: string) => {
27
30
  assignedValues?: AssignedValues;
28
31
  } | undefined;
@@ -77,7 +80,12 @@ export declare function createAssignFieldValuesStep(options: AssignFieldValuesSt
77
80
  model: AssignFieldValuesModel;
78
81
  engine: {
79
82
  getModel?: (uid: string, fromRoot?: boolean) => AssignFormModel | undefined;
83
+ findModelByParentId?: (parentId: string, subKey: string) => AssignFormModel | undefined | null;
80
84
  };
85
+ }, params?: {
86
+ assignedValues?: AssignedValues;
87
+ }, previousParams?: {
88
+ assignedValues?: AssignedValues;
81
89
  }): Promise<void>;
82
90
  handler(): void;
83
91
  };
@@ -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
- export declare function getDefaultOperator(model: any): any;
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;