@nocobase/client 2.1.0-alpha.1 → 2.1.0-alpha.2

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 (146) hide show
  1. package/.dumirc.ts +8 -0
  2. package/es/ai/ai-manager.d.ts +15 -0
  3. package/es/ai/index.d.ts +11 -0
  4. package/es/ai/tools-manager/hooks/context.d.ts +17 -0
  5. package/es/ai/tools-manager/hooks/index.d.ts +11 -0
  6. package/es/ai/tools-manager/hooks/provider.d.ts +16 -0
  7. package/es/ai/tools-manager/index.d.ts +21 -0
  8. package/es/ai/tools-manager/types.d.ts +80 -0
  9. package/es/ai/utils.d.ts +10 -0
  10. package/es/api-client/APIClient.d.ts +1 -0
  11. package/es/application/Application.d.ts +2 -0
  12. package/es/application/Plugin.d.ts +1 -0
  13. package/es/application/RouteRepository.d.ts +23 -0
  14. package/es/application/globalOperators.d.ts +11 -0
  15. package/es/block-provider/TableUidContext.d.ts +10 -0
  16. package/es/data-source/collection/utils.d.ts +2 -4
  17. package/es/flow/actions/aclCheckRefresh.d.ts +9 -0
  18. package/es/flow/actions/blockHeight.d.ts +9 -0
  19. package/es/flow/actions/filterFormDefaultValues.d.ts +9 -0
  20. package/es/flow/actions/formAssignRules.d.ts +9 -0
  21. package/es/flow/actions/index.d.ts +6 -0
  22. package/es/flow/actions/linkageRulesRefresh.d.ts +9 -0
  23. package/es/flow/actions/numberFormat.d.ts +9 -0
  24. package/es/flow/components/BlockItemCard.d.ts +1 -0
  25. package/es/flow/components/ConditionBuilder.d.ts +2 -0
  26. package/es/flow/components/DefaultValue.d.ts +1 -0
  27. package/es/flow/components/FieldAssignEditor.d.ts +32 -0
  28. package/es/flow/components/FieldAssignExactDatePicker.d.ts +23 -0
  29. package/es/flow/components/FieldAssignRulesEditor.d.ts +70 -0
  30. package/es/flow/components/FieldAssignValueInput.d.ts +42 -1
  31. package/es/flow/components/RunJSValueEditor.d.ts +19 -0
  32. package/es/flow/components/TextAreaWithContextSelector.d.ts +1 -0
  33. package/es/flow/components/code-editor/core/EditorCore.d.ts +3 -1
  34. package/es/flow/components/code-editor/formatDocInfo.d.ts +17 -0
  35. package/es/flow/components/code-editor/hooks/useCodeRunner.d.ts +3 -1
  36. package/es/flow/components/code-editor/index.d.ts +1 -0
  37. package/es/flow/components/code-editor/linter.d.ts +10 -2
  38. package/es/flow/components/code-editor/runjsCompletionSource.d.ts +20 -0
  39. package/es/flow/components/code-editor/runjsDiagnostics.d.ts +43 -0
  40. package/es/flow/components/fieldAssignOptions.d.ts +23 -0
  41. package/es/flow/components/filter/LinkageFilterItem.d.ts +4 -1
  42. package/es/flow/components/useAssociationTitleFieldSync.d.ts +13 -0
  43. package/es/flow/index.d.ts +2 -0
  44. package/es/flow/internal/utils/modelUtils.d.ts +23 -0
  45. package/es/flow/internal/utils/saveStepParamsWithSubModels.d.ts +11 -0
  46. package/es/flow/internal/utils/titleFieldQuickSync.d.ts +35 -0
  47. package/es/flow/models/base/AssociationFieldGroupModel.d.ts +1 -1
  48. package/es/flow/models/base/BlockModel.d.ts +3 -1
  49. package/es/flow/models/base/CollectionBlockModel.d.ts +29 -56
  50. package/es/flow/models/base/GridModel.d.ts +6 -0
  51. package/es/flow/models/base/PageModel/PageModel.d.ts +16 -0
  52. package/es/flow/models/blocks/details/DetailsGridModel.d.ts +1 -0
  53. package/es/flow/models/blocks/details/utils.d.ts +16 -0
  54. package/es/flow/models/blocks/filter-form/FieldOperatorSelect.d.ts +10 -0
  55. package/es/flow/models/blocks/filter-form/FilterFormBlockModel.d.ts +6 -0
  56. package/es/flow/models/blocks/filter-form/FilterFormItemModel.d.ts +5 -37
  57. package/es/flow/models/blocks/filter-form/customFieldOperators.d.ts +34 -0
  58. package/es/flow/models/blocks/filter-form/fields/FilterFormCustomFieldModel.d.ts +16 -0
  59. package/es/flow/models/blocks/filter-form/fields/FilterFormCustomRecordSelectFieldModel.d.ts +20 -0
  60. package/es/flow/models/blocks/filter-form/fields/FilterFormRecordSelectFieldModel.d.ts +12 -0
  61. package/es/flow/models/blocks/filter-form/fields/index.d.ts +2 -0
  62. package/es/flow/models/blocks/filter-form/index.d.ts +4 -0
  63. package/es/flow/models/blocks/filter-form/legacyDefaultValueMigration.d.ts +13 -0
  64. package/es/flow/models/blocks/filter-form/valueNormalization.d.ts +17 -0
  65. package/es/flow/models/blocks/filter-manager/flow-actions/defaultOperator.d.ts +1 -3
  66. package/es/flow/models/blocks/form/CreateFormModel.d.ts +2 -1
  67. package/es/flow/models/blocks/form/EditFormModel.d.ts +2 -1
  68. package/es/flow/models/blocks/form/FormAssociationFieldGroupModel.d.ts +12 -0
  69. package/es/flow/models/blocks/form/FormAssociationItemModel.d.ts +39 -0
  70. package/es/flow/models/blocks/form/FormBlockModel.d.ts +34 -2
  71. package/es/flow/models/blocks/form/FormGridModel.d.ts +1 -0
  72. package/es/flow/models/blocks/form/QuickEditFormModel.d.ts +4 -1
  73. package/es/flow/models/blocks/form/assignRulesUpdateAssociationValues.d.ts +18 -0
  74. package/es/flow/models/blocks/form/dynamicNamePath.d.ts +19 -0
  75. package/es/flow/models/blocks/form/index.d.ts +2 -0
  76. package/es/flow/models/blocks/form/legacyDefaultValueMigration.d.ts +13 -0
  77. package/es/flow/models/blocks/form/submitHandler.d.ts +1 -1
  78. package/es/flow/models/blocks/form/submitValues.d.ts +19 -0
  79. package/es/flow/models/blocks/form/value-runtime/conditions.d.ts +9 -0
  80. package/es/flow/models/blocks/form/value-runtime/deps.d.ts +23 -0
  81. package/es/flow/models/blocks/form/value-runtime/form-patch.d.ts +19 -0
  82. package/es/flow/models/blocks/form/value-runtime/index.d.ts +11 -0
  83. package/es/flow/models/blocks/form/value-runtime/path.d.ts +25 -0
  84. package/es/flow/models/blocks/form/value-runtime/rules.d.ts +129 -0
  85. package/es/flow/models/blocks/form/value-runtime/runtime.d.ts +75 -0
  86. package/es/flow/models/blocks/form/value-runtime/types.d.ts +62 -0
  87. package/es/flow/models/blocks/form/value-runtime/utils.d.ts +12 -0
  88. package/es/flow/models/blocks/shared/legacyDefaultValueMigrationBase.d.ts +20 -0
  89. package/es/flow/models/blocks/table/TableSelectModel.d.ts +0 -1
  90. package/es/flow/models/blocks/table/dragSort/dragSortComponents.d.ts +14 -0
  91. package/es/flow/models/blocks/table/dragSort/dragSortHooks.d.ts +13 -0
  92. package/es/flow/models/blocks/table/dragSort/dragSortSettings.d.ts +39 -0
  93. package/es/flow/models/blocks/table/dragSort/dragSortUtils.d.ts +37 -0
  94. package/es/flow/models/blocks/table/dragSort/index.d.ts +12 -0
  95. package/es/flow/models/blocks/table/utils.d.ts +8 -8
  96. package/es/flow/models/fields/AssociationFieldModel/CascadeSelectFieldModel.d.ts +16 -0
  97. package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableActionGroupModel.d.ts +11 -0
  98. package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableActionsColumnModel.d.ts +19 -0
  99. package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableFieldModel.d.ts +30 -0
  100. package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/PopupSubTableEditActionModel.d.ts +28 -0
  101. package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/PopupSubTableFormSubmitActionModel.d.ts +16 -0
  102. package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/PopupSubTableRemoveActionModel.d.ts +14 -0
  103. package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/blocks/PopupSubTableFormModel.d.ts +36 -0
  104. package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/index.d.ts +17 -0
  105. package/es/flow/models/fields/AssociationFieldModel/RecordPickerFieldModel.d.ts +8 -1
  106. package/es/flow/models/fields/AssociationFieldModel/RecordSelectFieldModel.d.ts +15 -0
  107. package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.d.ts +4 -1
  108. package/es/flow/models/fields/AssociationFieldModel/index.d.ts +1 -0
  109. package/es/flow/models/fields/AssociationFieldModel/itemChain.d.ts +94 -0
  110. package/es/flow/models/fields/AssociationFieldModel/recordSelectShared.d.ts +15 -5
  111. package/es/flow/models/fields/RichTextFieldModel/registerFontSize.d.ts +9 -0
  112. package/es/flow/models/fields/RichTextFieldModel/registerImageResize.d.ts +9 -0
  113. package/es/flow/models/fields/RichTextFieldModel/registerSmartBreak.d.ts +12 -0
  114. package/es/flow/models/fields/index.d.ts +0 -1
  115. package/es/flow/utils/dispatchEventDeep.d.ts +20 -0
  116. package/es/flow/utils/index.d.ts +1 -0
  117. package/es/flow/utils/useJsonTemplateResolver.d.ts +9 -0
  118. package/es/index.d.ts +1 -0
  119. package/es/index.mjs +36092 -24112
  120. package/es/route-switch/antd/admin-layout/index.d.ts +1 -1
  121. package/es/schema-component/antd/form-item/hooks/useLazyLoadDisplayAssociationFieldsOfForm.d.ts +26 -0
  122. package/es/user/CurrentUserProvider.d.ts +1 -1
  123. package/es/variables/index.d.ts +1 -1
  124. package/lib/index.js +449 -290
  125. package/lib/locale/de-DE.json +2 -0
  126. package/lib/locale/en-US.json +51 -0
  127. package/lib/locale/es-ES.json +2 -0
  128. package/lib/locale/fr-FR.json +2 -0
  129. package/lib/locale/hu-HU.json +2 -0
  130. package/lib/locale/id-ID.json +2 -0
  131. package/lib/locale/it-IT.json +2 -0
  132. package/lib/locale/ja-JP.json +2 -0
  133. package/lib/locale/ko-KR.json +2 -0
  134. package/lib/locale/nl-NL.json +2 -0
  135. package/lib/locale/pt-BR.json +2 -0
  136. package/lib/locale/ru-RU.json +2 -0
  137. package/lib/locale/tr-TR.json +2 -0
  138. package/lib/locale/uk-UA.json +2 -0
  139. package/lib/locale/vi-VN.json +2 -0
  140. package/lib/locale/zh-CN.json +78 -7
  141. package/lib/locale/zh-TW.json +12 -0
  142. package/package.json +8 -7
  143. package/es/flow/models/fields/UploadFieldModel.d.ts +0 -22
  144. package/es/index-C3fHjsMw.mjs +0 -279
  145. package/lib/index-C3fHjsMw-CDWZlvuM.js +0 -2237
  146. package/lib/style.css +0 -1
package/.dumirc.ts CHANGED
@@ -156,6 +156,10 @@ export default defineConfig({
156
156
  title: '生命周期',
157
157
  link: '/examples/flow-models/lifecycle',
158
158
  },
159
+ {
160
+ title: 'scheduleModelOperation',
161
+ link: '/examples/flow-models/schedule-model-operation',
162
+ },
159
163
  {
160
164
  title: 'hidden 属性演示',
161
165
  link: '/examples/flow-model-hidden',
@@ -398,6 +402,10 @@ export default defineConfig({
398
402
  title: 'ctx.exit()',
399
403
  link: '/examples/flow-context/exit',
400
404
  },
405
+ {
406
+ title: 'ctx.customRepository',
407
+ link: '/examples/flow-context/custom-repository',
408
+ },
401
409
  ],
402
410
  },
403
411
  {
@@ -0,0 +1,15 @@
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 { Application } from '../application';
10
+ import { ToolsManager } from './tools-manager';
11
+ export declare class AIManager {
12
+ protected readonly app: Application;
13
+ toolsManager: ToolsManager;
14
+ constructor(app: Application);
15
+ }
@@ -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 * from './ai-manager';
10
+ export * from './tools-manager';
11
+ export * from './utils';
@@ -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
+ import React from 'react';
10
+ import { ToolsEntry } from '../types';
11
+ export interface ToolsContextValue {
12
+ tools: ToolsEntry[];
13
+ loading: boolean;
14
+ error: Error | null;
15
+ refresh: () => Promise<void>;
16
+ }
17
+ export declare const ToolsContext: React.Context<ToolsContextValue>;
@@ -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 useTools: () => import("./context").ToolsContextValue;
10
+ export * from './context';
11
+ export * from './provider';
@@ -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
+ import React, { ReactNode } from 'react';
10
+ import { ToolsManager } from '../types';
11
+ interface ToolsProviderProps {
12
+ toolsManager: ToolsManager;
13
+ children: ReactNode;
14
+ }
15
+ export declare const ToolsProvider: React.FC<ToolsProviderProps>;
16
+ export {};
@@ -0,0 +1,21 @@
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 { Registry } from '@nocobase/utils/client';
10
+ import { FrontendTools, ToolsEntry, ToolsFilter, ToolsManager, ToolsOptions } from './types';
11
+ import { Application } from '../../application';
12
+ export declare class DefaultToolsManager implements ToolsManager {
13
+ protected readonly app: Application;
14
+ private readonly tools;
15
+ constructor(app: Application, tools?: any);
16
+ listTools(filter?: ToolsFilter): Promise<ToolsEntry[]>;
17
+ useTools(): Registry<FrontendTools>;
18
+ registerTools(name: string, options: ToolsOptions): void;
19
+ }
20
+ export * from './types';
21
+ export * from './hooks';
@@ -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 } from 'react';
10
+ import type { Application } from '../../application';
11
+ import { Registry } from '@nocobase/utils/client';
12
+ export interface ToolsManager extends ToolsRegistration {
13
+ listTools(filter?: ToolsFilter): Promise<ToolsEntry[]>;
14
+ useTools(): Registry<FrontendTools>;
15
+ }
16
+ export interface ToolsRegistration {
17
+ registerTools(name: string, options: ToolsOptions): void;
18
+ }
19
+ export type ToolsOptions = {
20
+ ui?: {
21
+ card?: ComponentType<ToolsUIProperties>;
22
+ modal?: {
23
+ title?: string;
24
+ okText?: string;
25
+ useOnOk?: (decisions: ToolsUIProperties['decisions'], adjustArgs: Record<string, any>) => {
26
+ onOk: () => void | Promise<void>;
27
+ };
28
+ Component?: ComponentType<{
29
+ tool: ToolCall;
30
+ saveToolArgs?: (args: unknown) => Promise<void>;
31
+ }>;
32
+ };
33
+ };
34
+ invoke?: (ctx: Application, params: any) => any | Promise<any>;
35
+ useHooks?: () => ToolsOptions;
36
+ };
37
+ export type ToolCall<T = unknown> = {
38
+ id: string;
39
+ type: string;
40
+ name: string;
41
+ status?: 'success' | 'error';
42
+ invokeStatus: 'init' | 'interrupted' | 'waiting' | 'pending' | 'done' | 'confirmed';
43
+ auto: boolean;
44
+ args: T;
45
+ [key: string]: any;
46
+ };
47
+ export type FrontendTools = ToolsOptions;
48
+ export type BackendTools = {
49
+ scope: Scope;
50
+ defaultPermission?: Permission;
51
+ silence?: boolean;
52
+ introduction?: {
53
+ title: string;
54
+ about: string;
55
+ };
56
+ definition: {
57
+ name: string;
58
+ description: string;
59
+ schema?: any;
60
+ };
61
+ };
62
+ export type ToolsEntry = BackendTools & FrontendTools;
63
+ export type ToolsUIProperties<ToolCallArgs = unknown> = {
64
+ messageId: string;
65
+ tools: ToolsEntry;
66
+ toolCall: ToolCall<ToolCallArgs>;
67
+ decisions: DecisionActions;
68
+ };
69
+ export type DecisionActions = {
70
+ approve: () => Promise<void>;
71
+ edit: (args: any) => Promise<void>;
72
+ reject: (message: string) => Promise<void>;
73
+ };
74
+ export type ToolsFilter = {
75
+ scope?: Scope;
76
+ defaultPermission?: Permission;
77
+ silence?: boolean;
78
+ };
79
+ export type Scope = 'SPECIFIED' | 'GENERAL' | 'CUSTOM';
80
+ export type Permission = 'ASK' | 'ALLOW';
@@ -0,0 +1,10 @@
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 { ToolsEntry } from './tools-manager';
10
+ export declare const toToolsMap: (tools: ToolsEntry[]) => Map<string, ToolsEntry>;
@@ -16,6 +16,7 @@ export declare class APIClient extends APIClientSDK {
16
16
  /** 该值会在 AntdAppProvider 中被重新赋值 */
17
17
  notification: any;
18
18
  cloneInstance(): APIClient;
19
+ getHostname(): string;
19
20
  getHeaders(): {};
20
21
  service(uid: string): Result<any, any>;
21
22
  interceptors(): void;
@@ -22,6 +22,7 @@ import { FlowEngine, FlowEngineContext } from '@nocobase/flow-engine';
22
22
  import type { CollectionFieldInterfaceFactory } from '../data-source';
23
23
  import type { Plugin } from './Plugin';
24
24
  import type { RequireJS } from './utils/requirejs';
25
+ import { AIManager } from '../ai';
25
26
  type JsonLogic = {
26
27
  addOperation: (name: string, fn?: any) => void;
27
28
  rmOperation: (name: string) => void;
@@ -82,6 +83,7 @@ interface Variable {
82
83
  export declare class Application {
83
84
  protected options: ApplicationOptions;
84
85
  eventBus: EventTarget;
86
+ aiManager: AIManager;
85
87
  providers: ComponentAndProps[];
86
88
  router: RouterManager;
87
89
  scopes: Record<string, any>;
@@ -19,6 +19,7 @@ export declare class Plugin<T = any> {
19
19
  };
20
20
  get flowEngine(): import("@nocobase/flow-engine").FlowEngine;
21
21
  get engine(): import("@nocobase/flow-engine").FlowEngine;
22
+ get ai(): import("..").AIManager;
22
23
  get pm(): import("./PluginManager").PluginManager;
23
24
  get router(): import("./RouterManager").RouterManager;
24
25
  get pluginSettingsManager(): import("./PluginSettingsManager").PluginSettingsManager;
@@ -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
+ type RouteOptions = {
10
+ id: string;
11
+ schemaUid: string;
12
+ children?: RouteOptions[];
13
+ };
14
+ export declare class RouteRepository {
15
+ protected ctx: any;
16
+ routes: Array<RouteOptions>;
17
+ constructor(ctx: any);
18
+ setRoutes(routes: Array<any>): void;
19
+ listAccessible(): RouteOptions[];
20
+ getRouteBySchemaUid(schemaUid: string): RouteOptions | undefined;
21
+ private findRoute;
22
+ }
23
+ export {};
@@ -0,0 +1,11 @@
1
+ export function getOperators(): {
2
+ is_logic(logic: any): boolean;
3
+ truthy(value: any): boolean;
4
+ getOperator(logic: any): string;
5
+ getValues(logic: any): any;
6
+ apply(logic: any, data: any): any;
7
+ uses_data(logic: any): any[];
8
+ addOperation(name: any, code: any): void;
9
+ rmOperation(name: any): void;
10
+ rule_like(rule: any, pattern: any): any;
11
+ };
@@ -0,0 +1,10 @@
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 TableUidContext: import("react").Context<string>;
@@ -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 aclCheckRefresh: 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 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>;
@@ -25,9 +25,15 @@ export * from './layout';
25
25
  export * from './required';
26
26
  export * from './fieldComponent';
27
27
  export * from './aclCheck';
28
+ export * from './aclCheckRefresh';
28
29
  export * from './pattern';
29
30
  export * from './validation';
30
31
  export * from './columnFixed';
32
+ export * from './formAssignRules';
33
+ export * from './filterFormDefaultValues';
34
+ export * from './linkageRulesRefresh';
35
+ export * from './blockHeight';
31
36
  export { fieldLinkageRules, subFormFieldLinkageRules, detailsFieldLinkageRules, linkageSetDetailsFieldProps, actionLinkageRules, blockLinkageRules, linkageSetBlockProps, linkageSetActionProps, linkageSetFieldProps, subFormLinkageSetFieldProps, linkageAssignField, linkageRunjs, subFormLinkageAssignField, } from './linkageRules';
32
37
  export { displayFieldComponent } from './displayFieldComponent';
33
38
  export * from './overflowMode';
39
+ export * from './numberFormat';
@@ -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 linkageRulesRefresh: 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 numberFormat: import("@nocobase/flow-engine").ActionDefinition<import("@nocobase/flow-engine").FlowModel<import("@nocobase/flow-engine").DefaultStructure>, import("@nocobase/flow-engine").FlowContext>;
@@ -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;
@@ -14,6 +14,7 @@ interface Props {
14
14
  onChange: (value: any) => void;
15
15
  metaTree: MetaTreeNode[] | (() => Promise<MetaTreeNode[]>);
16
16
  model: FieldModel;
17
+ flags?: Record<string, any>;
17
18
  }
18
19
  export declare const DefaultValue: React.ForwardRefExoticComponent<Partial<Props> & React.RefAttributes<unknown>>;
19
20
  export {};
@@ -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,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 React from 'react';
10
+ import { dayjs } from '@nocobase/utils/client';
11
+ export type ExactDatePickerMode = 'year' | 'quarter' | 'month' | 'date';
12
+ export type ExactDatePickerValue = dayjs.Dayjs | [dayjs.Dayjs, dayjs.Dayjs] | null;
13
+ export interface FieldAssignExactDatePickerProps {
14
+ picker?: ExactDatePickerMode;
15
+ format?: string;
16
+ showTime?: boolean;
17
+ timeFormat?: string;
18
+ value?: unknown;
19
+ isRange?: boolean;
20
+ onChange?: (value: ExactDatePickerValue) => void;
21
+ style?: React.CSSProperties;
22
+ }
23
+ export declare const FieldAssignExactDatePicker: React.FC<FieldAssignExactDatePickerProps>;
@@ -0,0 +1,70 @@
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
+ type CollectionFieldLike = {
15
+ name?: unknown;
16
+ title?: unknown;
17
+ type?: unknown;
18
+ interface?: unknown;
19
+ targetKey?: unknown;
20
+ targetCollectionTitleFieldName?: unknown;
21
+ targetCollection?: any;
22
+ isAssociationField?: () => boolean;
23
+ };
24
+ export type SyncAssociationTitleFieldParams = {
25
+ ruleItem: FieldAssignRuleItem;
26
+ ruleIndex: number;
27
+ targetPath?: string;
28
+ associationField: CollectionFieldLike;
29
+ targetCollection: any;
30
+ titleField: string;
31
+ };
32
+ export interface FieldAssignRuleItem {
33
+ key: string;
34
+ enable?: boolean;
35
+ /** 赋值目标路径,例如 `title` / `users.nickname` / `user.name` */
36
+ targetPath?: string;
37
+ /** 仅当前规则生效的 title field 覆盖(不改 collection 全局配置) */
38
+ valueTitleField?: string;
39
+ mode?: AssignMode;
40
+ condition?: FilterGroupType;
41
+ value?: any;
42
+ }
43
+ export interface FieldAssignRulesEditorProps {
44
+ t: (key: string) => string;
45
+ fieldOptions: FieldAssignCascaderOption[] | any[];
46
+ /** 根集合(用于构建“上级对象/属性”变量树) */
47
+ rootCollection?: any;
48
+ value?: FieldAssignRuleItem[];
49
+ onChange?: (value: FieldAssignRuleItem[]) => void;
50
+ /** 默认 mode(新建条目时使用) */
51
+ defaultMode?: AssignMode;
52
+ /** 固定 mode:用于“仅默认值/仅赋值”的场景 */
53
+ fixedMode?: AssignMode;
54
+ /** 是否显示 condition */
55
+ showCondition?: boolean;
56
+ /** 是否显示 enable 开关 */
57
+ showEnable?: boolean;
58
+ /** 未选字段时也展示 Value 编辑器(用于表单设置里的占位体验) */
59
+ showValueEditorWhenNoField?: boolean;
60
+ /** 为 Value 编辑器补充额外 props(例如按筛选操作符适配输入组件) */
61
+ getValueInputProps?: (item: FieldAssignRuleItem, index: number) => Partial<React.ComponentProps<typeof FieldAssignValueInput>>;
62
+ /** 可选:用于筛选关系集合中可作为 Title field 的候选字段 */
63
+ isTitleFieldCandidate?: (field: any, targetCollection: any) => boolean;
64
+ /** 可选:点击同步按钮后,将选中的 title field 持久化到关系集合 */
65
+ onSyncAssociationTitleField?: (params: SyncAssociationTitleFieldParams) => Promise<void> | void;
66
+ /** 在日期字段下启用“日期变量替换 Constant 位”。 */
67
+ enableDateVariableAsConstant?: boolean;
68
+ }
69
+ export declare const FieldAssignRulesEditor: React.FC<FieldAssignRulesEditorProps>;
70
+ export {};
@@ -7,12 +7,53 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import React from 'react';
10
+ import { dayjs } from '@nocobase/utils/client';
11
+ import { type MetaTreeNode } from '@nocobase/flow-engine';
12
+ import { type ExactDatePickerMode } from './FieldAssignExactDatePicker';
13
+ export type DateVariableExactNormalizeMode = 'none' | 'date' | 'datetimeNoTz' | 'iso';
14
+ export declare function toExactPickerDisplayValue(rawValue: unknown, options: {
15
+ format: string;
16
+ isRange: boolean;
17
+ }): dayjs.Dayjs | [dayjs.Dayjs, dayjs.Dayjs] | null;
18
+ export declare function normalizeDateVariableExactValue(rawValue: any, options: {
19
+ exactNormalizeMode: DateVariableExactNormalizeMode;
20
+ format: string;
21
+ showTime: boolean;
22
+ }): any;
23
+ type DateVariableComponentProps = {
24
+ picker: ExactDatePickerMode;
25
+ showTime: boolean;
26
+ timeFormat: string;
27
+ format: string;
28
+ exactNormalizeMode: DateVariableExactNormalizeMode;
29
+ };
30
+ export declare function normalizeDateVariableOutput(rawValue: any, options: DateVariableComponentProps): any;
10
31
  interface Props {
11
- fieldUid: string;
32
+ /** 赋值目标路径,例如 `title` / `users.nickname` / `user.name` */
33
+ targetPath: string;
12
34
  value: any;
13
35
  onChange: (value: any) => void;
14
36
  placeholder?: string;
37
+ /** 额外变量树(置于 Constant/Null/RunJS 与 base metaTree 之间) */
38
+ extraMetaTree?: MetaTreeNode[];
39
+ /** 可选:当前字段的筛选操作符,用于在默认值/赋值编辑器中按 operator schema 适配输入组件 */
40
+ operator?: string;
41
+ /** 可选:操作符元数据列表(通常来自 collectionField.filterable.operators) */
42
+ operatorMetaList?: Array<any>;
43
+ /** 可选:当字段已存在于表单时,优先复用表单字段的模型(用于筛选表单默认值等场景) */
44
+ preferFormItemFieldModel?: boolean;
45
+ /** 可选:关系字段显示映射覆盖(用于值编辑器内预览 title field) */
46
+ associationFieldNamesOverride?: {
47
+ label?: string;
48
+ value?: string;
49
+ };
50
+ /**
51
+ * 在日期字段场景下,用日期变量编辑器替换 Constant 位。
52
+ * 默认 false,保持历史行为。
53
+ */
54
+ enableDateVariableAsConstant?: boolean;
15
55
  }
56
+ export declare function mergeItemMetaTreeForAssignValue(baseTree: MetaTreeNode[], extraTree: MetaTreeNode[]): MetaTreeNode[];
16
57
  /**
17
58
  * 根据所选字段渲染对应的赋值编辑器:
18
59
  * - 使用临时的 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>;
@@ -20,6 +20,7 @@ export interface TextAreaWithContextSelectorProps {
20
20
  onChange?: (v: string) => void;
21
21
  placeholder?: string;
22
22
  rows?: number;
23
+ maxRows?: number;
23
24
  style?: React.CSSProperties;
24
25
  }
25
26
  /**