@nocobase/client 2.0.0-beta.21 → 2.0.0-beta.23

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 (74) hide show
  1. package/es/data-source/collection/utils.d.ts +2 -4
  2. package/es/flow/actions/blockHeight.d.ts +9 -0
  3. package/es/flow/actions/filterFormDefaultValues.d.ts +9 -0
  4. package/es/flow/actions/formAssignRules.d.ts +9 -0
  5. package/es/flow/actions/index.d.ts +3 -0
  6. package/es/flow/components/BlockItemCard.d.ts +1 -0
  7. package/es/flow/components/ConditionBuilder.d.ts +2 -0
  8. package/es/flow/components/FieldAssignEditor.d.ts +32 -0
  9. package/es/flow/components/FieldAssignRulesEditor.d.ts +43 -0
  10. package/es/flow/components/FieldAssignValueInput.d.ts +12 -1
  11. package/es/flow/components/RunJSValueEditor.d.ts +19 -0
  12. package/es/flow/components/fieldAssignOptions.d.ts +23 -0
  13. package/es/flow/components/filter/LinkageFilterItem.d.ts +4 -1
  14. package/es/flow/index.d.ts +1 -0
  15. package/es/flow/internal/utils/modelUtils.d.ts +23 -0
  16. package/es/flow/internal/utils/saveStepParamsWithSubModels.d.ts +11 -0
  17. package/es/flow/models/base/BlockModel.d.ts +2 -1
  18. package/es/flow/models/base/PageModel/PageModel.d.ts +8 -0
  19. package/es/flow/models/blocks/details/DetailsGridModel.d.ts +1 -0
  20. package/es/flow/models/blocks/details/utils.d.ts +16 -0
  21. package/es/flow/models/blocks/filter-form/FilterFormBlockModel.d.ts +6 -0
  22. package/es/flow/models/blocks/filter-form/FilterFormItemModel.d.ts +2 -0
  23. package/es/flow/models/blocks/filter-form/fields/FilterFormRecordSelectFieldModel.d.ts +12 -0
  24. package/es/flow/models/blocks/filter-form/fields/index.d.ts +1 -0
  25. package/es/flow/models/blocks/filter-form/legacyDefaultValueMigration.d.ts +13 -0
  26. package/es/flow/models/blocks/filter-form/valueNormalization.d.ts +17 -0
  27. package/es/flow/models/blocks/form/FormBlockModel.d.ts +16 -0
  28. package/es/flow/models/blocks/form/FormGridModel.d.ts +1 -0
  29. package/es/flow/models/blocks/form/assignRulesUpdateAssociationValues.d.ts +18 -0
  30. package/es/flow/models/blocks/form/dynamicNamePath.d.ts +19 -0
  31. package/es/flow/models/blocks/form/legacyDefaultValueMigration.d.ts +13 -0
  32. package/es/flow/models/blocks/form/submitValues.d.ts +19 -0
  33. package/es/flow/models/blocks/form/value-runtime/conditions.d.ts +9 -0
  34. package/es/flow/models/blocks/form/value-runtime/deps.d.ts +23 -0
  35. package/es/flow/models/blocks/form/value-runtime/form-patch.d.ts +19 -0
  36. package/es/flow/models/blocks/form/value-runtime/index.d.ts +11 -0
  37. package/es/flow/models/blocks/form/value-runtime/path.d.ts +25 -0
  38. package/es/flow/models/blocks/form/value-runtime/rules.d.ts +121 -0
  39. package/es/flow/models/blocks/form/value-runtime/runtime.d.ts +75 -0
  40. package/es/flow/models/blocks/form/value-runtime/types.d.ts +60 -0
  41. package/es/flow/models/blocks/form/value-runtime/utils.d.ts +12 -0
  42. package/es/flow/models/blocks/shared/legacyDefaultValueMigrationBase.d.ts +20 -0
  43. package/es/flow/models/blocks/table/TableSelectModel.d.ts +0 -1
  44. package/es/flow/models/blocks/table/dragSort/dragSortComponents.d.ts +14 -0
  45. package/es/flow/models/blocks/table/dragSort/dragSortHooks.d.ts +13 -0
  46. package/es/flow/models/blocks/table/dragSort/dragSortSettings.d.ts +39 -0
  47. package/es/flow/models/blocks/table/dragSort/dragSortUtils.d.ts +37 -0
  48. package/es/flow/models/blocks/table/dragSort/index.d.ts +12 -0
  49. package/es/flow/models/blocks/table/utils.d.ts +8 -8
  50. package/es/flow/models/fields/AssociationFieldModel/RecordPickerFieldModel.d.ts +8 -1
  51. package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.d.ts +1 -1
  52. package/es/flow/models/fields/AssociationFieldModel/itemChain.d.ts +94 -0
  53. package/es/flow/models/fields/AssociationFieldModel/recordSelectShared.d.ts +1 -0
  54. package/es/index.mjs +30308 -24976
  55. package/es/route-switch/antd/admin-layout/index.d.ts +1 -1
  56. package/lib/index.js +359 -333
  57. package/lib/locale/de-DE.json +2 -0
  58. package/lib/locale/en-US.json +24 -0
  59. package/lib/locale/es-ES.json +2 -0
  60. package/lib/locale/fr-FR.json +2 -0
  61. package/lib/locale/hu-HU.json +2 -0
  62. package/lib/locale/id-ID.json +2 -0
  63. package/lib/locale/it-IT.json +2 -0
  64. package/lib/locale/ja-JP.json +2 -0
  65. package/lib/locale/ko-KR.json +2 -0
  66. package/lib/locale/nl-NL.json +2 -0
  67. package/lib/locale/pt-BR.json +2 -0
  68. package/lib/locale/ru-RU.json +2 -0
  69. package/lib/locale/tr-TR.json +2 -0
  70. package/lib/locale/uk-UA.json +2 -0
  71. package/lib/locale/vi-VN.json +2 -0
  72. package/lib/locale/zh-CN.json +33 -4
  73. package/lib/locale/zh-TW.json +12 -0
  74. package/package.json +6 -6
@@ -12,7 +12,7 @@ import type { CollectionOptions } from './Collection';
12
12
  * @internal
13
13
  */
14
14
  export declare const collectionTransform: (collection: CollectionOptions, app: Application) => {
15
- title: string;
15
+ title: any;
16
16
  rawTitle: any;
17
17
  fields: {
18
18
  name?: any;
@@ -28,9 +28,7 @@ export declare const collectionTransform: (collection: CollectionOptions, app: A
28
28
  with?: string | string[];
29
29
  delayRestore?: any;
30
30
  };
31
- tableName?: string; /**
32
- * @internal
33
- */
31
+ tableName?: string;
34
32
  inherits?: string | string[];
35
33
  inherit?: string;
36
34
  key?: string;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare const blockHeight: import("@nocobase/flow-engine").ActionDefinition<import("@nocobase/flow-engine").FlowModel<import("@nocobase/flow-engine").DefaultStructure>, import("@nocobase/flow-engine").FlowContext>;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare const filterFormDefaultValues: import("@nocobase/flow-engine").ActionDefinition<import("@nocobase/flow-engine").FlowModel<import("@nocobase/flow-engine").DefaultStructure>, import("@nocobase/flow-engine").FlowContext>;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare const formAssignRules: import("@nocobase/flow-engine").ActionDefinition<import("@nocobase/flow-engine").FlowModel<import("@nocobase/flow-engine").DefaultStructure>, import("@nocobase/flow-engine").FlowContext>;
@@ -29,7 +29,10 @@ export * from './aclCheckRefresh';
29
29
  export * from './pattern';
30
30
  export * from './validation';
31
31
  export * from './columnFixed';
32
+ export * from './formAssignRules';
33
+ export * from './filterFormDefaultValues';
32
34
  export * from './linkageRulesRefresh';
35
+ export * from './blockHeight';
33
36
  export { fieldLinkageRules, subFormFieldLinkageRules, detailsFieldLinkageRules, linkageSetDetailsFieldProps, actionLinkageRules, blockLinkageRules, linkageSetBlockProps, linkageSetActionProps, linkageSetFieldProps, subFormLinkageSetFieldProps, linkageAssignField, linkageRunjs, subFormLinkageAssignField, } from './linkageRules';
34
37
  export { displayFieldComponent } from './displayFieldComponent';
35
38
  export * from './overflowMode';
@@ -12,4 +12,5 @@ export declare const BlockItemCard: React.ForwardRefExoticComponent<CardProps &
12
12
  beforeContent?: React.ReactNode;
13
13
  afterContent?: React.ReactNode;
14
14
  description?: any;
15
+ heightMode?: string;
15
16
  } & React.RefAttributes<unknown>>;
@@ -6,10 +6,12 @@
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 MetaTreeNode } from '@nocobase/flow-engine';
9
10
  import React from 'react';
10
11
  import { FilterGroupType } from '@nocobase/utils/client';
11
12
  export declare const ConditionBuilder: React.MemoExoticComponent<import("@formily/reactive-react").ReactFC<{
12
13
  value: FilterGroupType;
13
14
  onChange: (value: FilterGroupType) => void;
15
+ extraMetaTree?: MetaTreeNode[];
14
16
  }>>;
15
17
  export declare const commonConditionHandler: (ctx: any, params: any) => void;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ export interface FieldAssignEditorProps {
11
+ t: (key: string) => string;
12
+ fieldOptions: Array<{
13
+ label: string;
14
+ value: string;
15
+ }>;
16
+ /** 赋值目标路径(例如 `title` / `user.name`) */
17
+ field?: string;
18
+ onFieldChange: (targetPath?: string) => void;
19
+ value: any;
20
+ onValueChange: (value: any) => void;
21
+ fieldLabel?: React.ReactNode;
22
+ valueLabel?: React.ReactNode;
23
+ showValueEditorWhenNoField?: boolean;
24
+ }
25
+ /**
26
+ * 通用“字段赋值”编辑器:
27
+ * - 选择字段
28
+ * - 编辑赋值(支持变量引用 + 常量)
29
+ *
30
+ * 可在“表单赋值配置”和“联动规则赋值动作”等场景复用。
31
+ */
32
+ export declare const FieldAssignEditor: React.FC<FieldAssignEditorProps>;
@@ -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 { FilterGroupType } from '@nocobase/utils/client';
10
+ import React from 'react';
11
+ import { FieldAssignValueInput } from './FieldAssignValueInput';
12
+ import type { FieldAssignCascaderOption } from './fieldAssignOptions';
13
+ export type AssignMode = 'default' | 'assign';
14
+ export interface FieldAssignRuleItem {
15
+ key: string;
16
+ enable?: boolean;
17
+ /** 赋值目标路径,例如 `title` / `users.nickname` / `user.name` */
18
+ targetPath?: string;
19
+ mode?: AssignMode;
20
+ condition?: FilterGroupType;
21
+ value?: any;
22
+ }
23
+ export interface FieldAssignRulesEditorProps {
24
+ t: (key: string) => string;
25
+ fieldOptions: FieldAssignCascaderOption[] | any[];
26
+ /** 根集合(用于构建“上级对象/属性”变量树) */
27
+ rootCollection?: any;
28
+ value?: FieldAssignRuleItem[];
29
+ onChange?: (value: FieldAssignRuleItem[]) => void;
30
+ /** 默认 mode(新建条目时使用) */
31
+ defaultMode?: AssignMode;
32
+ /** 固定 mode:用于“仅默认值/仅赋值”的场景 */
33
+ fixedMode?: AssignMode;
34
+ /** 是否显示 condition */
35
+ showCondition?: boolean;
36
+ /** 是否显示 enable 开关 */
37
+ showEnable?: boolean;
38
+ /** 未选字段时也展示 Value 编辑器(用于表单设置里的占位体验) */
39
+ showValueEditorWhenNoField?: boolean;
40
+ /** 为 Value 编辑器补充额外 props(例如按筛选操作符适配输入组件) */
41
+ getValueInputProps?: (item: FieldAssignRuleItem, index: number) => Partial<React.ComponentProps<typeof FieldAssignValueInput>>;
42
+ }
43
+ export declare const FieldAssignRulesEditor: React.FC<FieldAssignRulesEditorProps>;
@@ -7,12 +7,23 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import React from 'react';
10
+ import { type MetaTreeNode } from '@nocobase/flow-engine';
10
11
  interface Props {
11
- fieldUid: string;
12
+ /** 赋值目标路径,例如 `title` / `users.nickname` / `user.name` */
13
+ targetPath: string;
12
14
  value: any;
13
15
  onChange: (value: any) => void;
14
16
  placeholder?: string;
17
+ /** 额外变量树(置于 Constant/Null/RunJS 与 base metaTree 之间) */
18
+ extraMetaTree?: MetaTreeNode[];
19
+ /** 可选:当前字段的筛选操作符,用于在默认值/赋值编辑器中按 operator schema 适配输入组件 */
20
+ operator?: string;
21
+ /** 可选:操作符元数据列表(通常来自 collectionField.filterable.operators) */
22
+ operatorMetaList?: Array<any>;
23
+ /** 可选:当字段已存在于表单时,优先复用表单字段的模型(用于筛选表单默认值等场景) */
24
+ preferFormItemFieldModel?: boolean;
15
25
  }
26
+ export declare function mergeItemMetaTreeForAssignValue(baseTree: MetaTreeNode[], extraTree: MetaTreeNode[]): MetaTreeNode[];
16
27
  /**
17
28
  * 根据所选字段渲染对应的赋值编辑器:
18
29
  * - 使用临时的 VariableFieldFormModel 包裹字段模型,确保常量编辑为真实字段组件
@@ -0,0 +1,19 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ import { type RunJSValue } from '@nocobase/flow-engine';
11
+ export interface RunJSValueEditorProps {
12
+ t?: (key: string) => string;
13
+ value: unknown;
14
+ onChange?: (value: RunJSValue) => void;
15
+ height?: string;
16
+ scene?: string;
17
+ containerStyle?: React.CSSProperties;
18
+ }
19
+ export declare const RunJSValueEditor: React.FC<RunJSValueEditorProps>;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export type FieldAssignCascaderOption = {
10
+ label: string;
11
+ value: string;
12
+ /** antd Cascader lazy-load marker */
13
+ isLeaf?: boolean;
14
+ /** antd Cascader loading marker */
15
+ loading?: boolean;
16
+ children?: FieldAssignCascaderOption[];
17
+ };
18
+ export declare function collectFieldAssignCascaderOptions(options: {
19
+ formBlockModel: any;
20
+ t: (key: string) => string;
21
+ /** 子表单模型递归深度(FormItemModel 层级);默认不限制(只受实际配置与循环引用约束) */
22
+ maxFormItemDepth?: number;
23
+ }): FieldAssignCascaderOption[];
@@ -7,7 +7,7 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import React from 'react';
10
- import { FlowModel } from '@nocobase/flow-engine';
10
+ import { type MetaTreeNode, FlowModel } from '@nocobase/flow-engine';
11
11
  export interface LinkageFilterItemValue {
12
12
  path: string | null;
13
13
  operator: string;
@@ -18,7 +18,10 @@ export interface LinkageFilterItemProps {
18
18
  /** 条件值对象(响应式) */
19
19
  value: LinkageFilterItemValue;
20
20
  model: FlowModel;
21
+ /** 向变量树额外注入节点(置于根部) */
22
+ extraMetaTree?: MetaTreeNode[];
21
23
  }
24
+ export declare function mergeExtraMetaTreeWithBase(baseMetaTree: MetaTreeNode[] | undefined, extraMetaTree?: MetaTreeNode[]): MetaTreeNode[];
22
25
  /**
23
26
  * LinkageFilterItem:左/右均为可变量输入,适用于联动规则等“前端逻辑”场景
24
27
  */
@@ -18,6 +18,7 @@ export * from './FlowModelRepository';
18
18
  export * from './FlowPage';
19
19
  export * from './models';
20
20
  export * from './utils';
21
+ export * from './actions';
21
22
  export { openViewFlow } from './flows/openViewFlow';
22
23
  export { editMarkdownFlow } from './flows/editMarkdownFlow';
23
24
  export { TextAreaWithContextSelector } from './components/TextAreaWithContextSelector';
@@ -0,0 +1,23 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { FormItemModel } from '../../models';
10
+ export interface CollectionLike {
11
+ getField?: (name: string) => unknown;
12
+ getFields?: () => unknown[];
13
+ dataSourceKey?: string;
14
+ name?: string;
15
+ }
16
+ export declare function isToManyAssociationField(field: unknown): boolean;
17
+ export declare function getCollectionFromModel(model: unknown): CollectionLike | undefined;
18
+ /**
19
+ * Find a configured FormItemModel by its `fieldSettings.init.fieldPath` (or `fieldPath`) in the current form grid,
20
+ * including nested subform items. Also supports combined path matching when a model stores
21
+ * `associationPathName + fieldPath` separately (e.g. wrapper field children builders).
22
+ */
23
+ export declare function findFormItemModelByFieldPath(root: unknown, targetPath: string): FormItemModel | null;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare const SAVE_STEP_PARAMS_WITH_SUB_MODELS_FLAG: "__saveStepParamsWithSubModels";
10
+ export declare function markSaveStepParamsWithSubModels(model: unknown): void;
11
+ export declare function saveStepParamsWithSubModelsIfNeeded<T>(model: unknown, fallback: () => Promise<T>): Promise<T>;
@@ -1,6 +1,6 @@
1
1
  import { DefaultStructure, FlowModel } from '@nocobase/flow-engine';
2
2
  import React from 'react';
3
- export type BlockSceneType = 'new' | 'filter' | 'one' | 'many' | 'select' | 'subForm' | BlockSceneType[];
3
+ export type BlockSceneType = 'new' | 'filter' | 'one' | 'many' | 'select' | 'subForm' | 'bulkEditForm' | BlockSceneType[];
4
4
  export declare const BlockSceneEnum: {
5
5
  new: BlockSceneType;
6
6
  one: BlockSceneType;
@@ -9,6 +9,7 @@ export declare const BlockSceneEnum: {
9
9
  filter: BlockSceneType;
10
10
  oam: BlockSceneType;
11
11
  subForm: BlockSceneType;
12
+ bulkEditForm: BlockSceneType;
12
13
  };
13
14
  export declare class BlockModel<T = DefaultStructure> extends FlowModel<T> {
14
15
  decoratorProps: Record<string, any>;
@@ -25,11 +25,19 @@ export declare class PageModel extends FlowModel<PageModelStructure> {
25
25
  private lastSeenEmitterViewActivatedVersion;
26
26
  private dirtyRefreshScheduled;
27
27
  private unmounted;
28
+ private documentTitleUpdateVersion;
28
29
  private getActiveTabKey;
29
30
  private scheduleActiveLifecycleRefresh;
30
31
  onMount(): void;
31
32
  protected onUnmount(): void;
32
33
  invokeTabModelLifecycleMethod(tabActiveKey: string, method: 'onActive' | 'onInactive'): void;
34
+ /**
35
+ * Resolve configured document title template and update browser tab title.
36
+ * Priority:
37
+ * 1) page without tabs: page.documentTitle > page title
38
+ * 2) page with tabs: activeTab.documentTitle > active tab name
39
+ */
40
+ updateDocumentTitle(preferredActiveTabKey?: string, retryCount?: number): Promise<void>;
33
41
  createPageTabModelOptions: () => CreateModelOptions;
34
42
  mapTabs(): {
35
43
  key: string;
@@ -29,4 +29,5 @@ export declare class DetailsGridModel extends GridModel<{
29
29
  };
30
30
  dragOverlayConfig: DragOverlayConfig;
31
31
  renderAddSubModelButton(): React.JSX.Element;
32
+ render(): React.JSX.Element;
32
33
  }
@@ -0,0 +1,16 @@
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
+ /// <reference types="react" />
10
+ export declare const useDetailsGridHeight: ({ heightMode, containerRef, actionsRef, paginationRef, deps, }: {
11
+ heightMode?: string;
12
+ containerRef: React.RefObject<HTMLDivElement>;
13
+ actionsRef: React.RefObject<HTMLDivElement>;
14
+ paginationRef: React.RefObject<HTMLDivElement>;
15
+ deps?: import("react").DependencyList;
16
+ }) => number;
@@ -23,10 +23,16 @@ export declare class FilterFormBlockModel extends FilterBlockModel<{
23
23
  get form(): any;
24
24
  get title(): string;
25
25
  useHooksBeforeRender(): void;
26
+ saveStepParams(): Promise<any>;
26
27
  addAppends(): void;
27
28
  onInit(options: any): void;
28
29
  onMount(): void;
29
30
  onUnmount(): void;
31
+ private applyDefaultsAndInitialFilter;
32
+ private ensureFilterItemsBeforeRender;
33
+ applyFormDefaultValues(options?: {
34
+ force?: boolean;
35
+ }): Promise<void>;
30
36
  private handleTargetBlockRemoved;
31
37
  destroy(): Promise<boolean>;
32
38
  renderComponent(): React.JSX.Element;
@@ -8,6 +8,7 @@
8
8
  */
9
9
  import { FilterableItemModel, FlowModelContext } from '@nocobase/flow-engine';
10
10
  import React from 'react';
11
+ import { FieldModel } from '../../base';
11
12
  import { FilterFormFieldModel } from './fields';
12
13
  export declare class FilterFormItemModel extends FilterableItemModel<{
13
14
  subModels: {
@@ -76,6 +77,7 @@ export declare class FilterFormItemModel extends FilterableItemModel<{
76
77
  * @returns
77
78
  */
78
79
  getFilterValue(): any;
80
+ normalizeAssociationFilterValue(value: any, fieldModel: FieldModel): any;
79
81
  getDefaultValue(): any;
80
82
  /**
81
83
  * 处理回车事件
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { RecordSelectFieldModel } from '../../../fields/AssociationFieldModel';
10
+ export declare class FilterFormRecordSelectFieldModel extends RecordSelectFieldModel {
11
+ onInit(options: any): void;
12
+ }
@@ -7,5 +7,6 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  export * from './FilterFormFieldModel';
10
+ export * from './FilterFormRecordSelectFieldModel';
10
11
  export * from './date-time';
11
12
  export * from './FilterFormCustomFieldModel';
@@ -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 { mergeAssignRulesWithLegacyDefaults } from '../shared/legacyDefaultValueMigrationBase';
10
+ import type { FieldAssignRuleItem } from '../../../components/FieldAssignRulesEditor';
11
+ export declare function collectLegacyDefaultValueRulesFromFilterFormModel(filterFormModel: any): FieldAssignRuleItem[];
12
+ export declare function clearLegacyDefaultValuesFromFilterFormModel(filterFormModel: any): any[];
13
+ export { mergeAssignRulesWithLegacyDefaults };
@@ -0,0 +1,17 @@
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
+ /**
10
+ * Normalize filter value based on operator expected shape.
11
+ *
12
+ * - Multi-value operators: normalize scalar -> [value]
13
+ * - $dateBetween: normalize scalar date -> [date, date]
14
+ *
15
+ * Note: For date variables (object with `type`), keep as-is because operators can resolve it to ranges.
16
+ */
17
+ export declare function normalizeFilterValueByOperator(operator: string | undefined, rawValue: any): any;
@@ -13,6 +13,7 @@ import { BlockGridModel } from '../../base/BlockGridModel';
13
13
  import { CollectionBlockModel } from '../../base/CollectionBlockModel';
14
14
  import { FormActionModel } from './FormActionModel';
15
15
  import { FormGridModel } from './FormGridModel';
16
+ import { FormValueRuntime } from './value-runtime';
16
17
  type DefaultCollectionBlockModelStructure = {
17
18
  parent?: BlockGridModel;
18
19
  subModels?: {
@@ -22,6 +23,7 @@ type DefaultCollectionBlockModelStructure = {
22
23
  };
23
24
  type CustomFormBlockModelClassesEnum = {};
24
25
  export declare class FormBlockModel<T extends DefaultCollectionBlockModelStructure = DefaultCollectionBlockModelStructure> extends CollectionBlockModel<T> {
26
+ formValueRuntime?: FormValueRuntime;
25
27
  private userModifiedTopLevelFields;
26
28
  get form(): FormInstance<any>;
27
29
  _defaultCustomModelClasses: {
@@ -60,6 +62,7 @@ export declare class FormBlockModel<T extends DefaultCollectionBlockModelStructu
60
62
  useHooksBeforeRender(): void;
61
63
  onInit(options: any): void;
62
64
  protected onMount(): void;
65
+ onUnmount(): void;
63
66
  getCurrentRecord(): {};
64
67
  renderComponent(): void;
65
68
  }
@@ -69,7 +72,20 @@ export declare function FormComponent({ model, children, layoutProps, initialVal
69
72
  layoutProps?: any;
70
73
  initialValues?: any;
71
74
  onFinish?: (values: any) => void;
75
+ [key: string]: any;
72
76
  }): React.JSX.Element;
77
+ type FormBlockContentProps = {
78
+ model: FormBlockModel;
79
+ gridModel: FormGridModel;
80
+ layoutProps?: any;
81
+ onFinish?: (values: any) => void;
82
+ grid: React.ReactNode;
83
+ actions?: React.ReactNode;
84
+ footer?: React.ReactNode;
85
+ heightMode?: string;
86
+ height?: number;
87
+ };
88
+ export declare const FormBlockContent: ({ model, gridModel, layoutProps, onFinish, grid, actions, footer, heightMode, height, }: FormBlockContentProps) => React.JSX.Element;
73
89
  /**
74
90
  * 兼容旧版本
75
91
  * @deprecated use FormBlockModel instead
@@ -30,4 +30,5 @@ export declare class FormGridModel<T extends DefaultFormGridStructure = DefaultF
30
30
  };
31
31
  dragOverlayConfig: DragOverlayConfig;
32
32
  renderAddSubModelButton(): React.JSX.Element;
33
+ render(): React.JSX.Element;
33
34
  }
@@ -0,0 +1,18 @@
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
+ /**
10
+ * 从 assignRules 的 targetPath 推导需要注入到请求中的 updateAssociationValues。
11
+ *
12
+ * 规则:仅当 targetPath 穿过至少一段关联字段(association)时返回该关联路径:
13
+ * - user.name -> user
14
+ * - user.profile.name -> user.profile
15
+ */
16
+ export declare function collectUpdateAssociationValuesFromAssignRules(items: Array<{
17
+ targetPath?: string;
18
+ } | any>, rootCollection: any): string[];
@@ -0,0 +1,19 @@
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 DynamicNamePart = string | number;
10
+ /**
11
+ * Build a dynamic NamePath based on current subform list row index.
12
+ *
13
+ * fieldIndex is an array like: ["products:0", "products:2"] (nested lists allowed, including same-name lists).
14
+ *
15
+ * For example:
16
+ * - nameParts: ["products", "products"] + fieldIndex: ["products:0"] => [0, "products"]
17
+ * - nameParts: ["products", "products", "id"] + fieldIndex: ["products:1", "products:0"] => [0, "id"]
18
+ */
19
+ export declare function buildDynamicNamePath(nameParts: DynamicNamePart[], fieldIndex?: string[]): DynamicNamePart[];
@@ -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 { mergeAssignRulesWithLegacyDefaults } from '../shared/legacyDefaultValueMigrationBase';
10
+ import type { FieldAssignRuleItem } from '../../../components/FieldAssignRulesEditor';
11
+ export declare function collectLegacyDefaultValueRulesFromFormModel(formModel: any): FieldAssignRuleItem[];
12
+ export declare function clearLegacyDefaultValuesFromFormModel(formModel: any): any[];
13
+ export { mergeAssignRulesWithLegacyDefaults };
@@ -0,0 +1,19 @@
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 { FormBlockModel } from './FormBlockModel';
10
+ /**
11
+ * 提交前过滤:移除当前表单 block 中被「联动规则隐藏」的字段值(`model.hidden === true`)。
12
+ *
13
+ * 说明:
14
+ * - 仅对 “隐藏 / Hidden” 生效(对应 `model.hidden=true`)。
15
+ * - “隐藏并保留值 / Hidden (reserved value)” 在实现上是 `props.hidden=true` 但 `model.hidden=false`,
16
+ * 因此仍会提交(保持现有语义)。
17
+ * - 不会清空 antd Form 的内部 store,只影响本次提交 payload。
18
+ */
19
+ export declare function omitHiddenModelValuesFromSubmit<T = any>(values: T, blockModel: FormBlockModel): T;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare function evaluateCondition(ctx: any, condition: any): boolean;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import type { NamePath } from './types';
10
+ export type DepCollector = {
11
+ deps: Set<string>;
12
+ wildcard: boolean;
13
+ };
14
+ export declare function recordDep(namePath: NamePath, collector: DepCollector | undefined): void;
15
+ export declare function createFormValuesProxy(options: {
16
+ valuesMirror: any;
17
+ basePath: NamePath;
18
+ collector?: DepCollector;
19
+ getFormValuesSnapshot: () => any;
20
+ getFormValueAtPath: (namePath: NamePath) => any;
21
+ }): any;
22
+ export declare function collectStaticDepsFromTemplateValue(value: any, collector: DepCollector): void;
23
+ export declare function collectStaticDepsFromRunJSValue(value: any, collector: DepCollector): void;
@@ -0,0 +1,19 @@
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 { FormInstance } from 'antd';
10
+ import type { Patch, SetOptions } from './types';
11
+ export type FormPatcher = {
12
+ patch: (form: FormInstance) => void;
13
+ restore: () => void;
14
+ };
15
+ export declare function createFormPatcher(options: {
16
+ isSuppressed: () => boolean;
17
+ getCallerContext: () => any;
18
+ setFormValues: (callerCtx: any, patch: Patch, options?: SetOptions) => Promise<void>;
19
+ }): FormPatcher;