@nocobase/client 2.0.0-beta.8 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dumirc.ts +8 -0
- package/es/ai/ai-manager.d.ts +15 -0
- package/es/ai/index.d.ts +11 -0
- package/es/ai/tools-manager/hooks/context.d.ts +17 -0
- package/es/ai/tools-manager/hooks/index.d.ts +11 -0
- package/es/ai/tools-manager/hooks/provider.d.ts +16 -0
- package/es/ai/tools-manager/index.d.ts +21 -0
- package/es/ai/tools-manager/types.d.ts +80 -0
- package/es/ai/utils.d.ts +10 -0
- package/es/api-client/APIClient.d.ts +1 -0
- package/es/application/Application.d.ts +2 -0
- package/es/application/Plugin.d.ts +1 -0
- package/es/application/globalOperators.d.ts +11 -0
- package/es/block-provider/TableUidContext.d.ts +10 -0
- package/es/data-source/collection/utils.d.ts +2 -4
- package/es/flow/actions/blockHeight.d.ts +9 -0
- package/es/flow/actions/filterFormDefaultValues.d.ts +9 -0
- package/es/flow/actions/formAssignRules.d.ts +9 -0
- package/es/flow/actions/index.d.ts +4 -0
- package/es/flow/actions/numberFormat.d.ts +9 -0
- package/es/flow/components/BlockItemCard.d.ts +1 -0
- package/es/flow/components/ConditionBuilder.d.ts +2 -0
- package/es/flow/components/DefaultValue.d.ts +1 -0
- package/es/flow/components/FieldAssignEditor.d.ts +32 -0
- package/es/flow/components/FieldAssignExactDatePicker.d.ts +23 -0
- package/es/flow/components/FieldAssignRulesEditor.d.ts +70 -0
- package/es/flow/components/FieldAssignValueInput.d.ts +42 -1
- package/es/flow/components/RunJSValueEditor.d.ts +19 -0
- package/es/flow/components/code-editor/core/EditorCore.d.ts +3 -1
- package/es/flow/components/code-editor/formatDocInfo.d.ts +17 -0
- package/es/flow/components/code-editor/hooks/useCodeRunner.d.ts +3 -1
- package/es/flow/components/code-editor/index.d.ts +1 -0
- package/es/flow/components/code-editor/linter.d.ts +10 -2
- package/es/flow/components/code-editor/runjsCompletionSource.d.ts +20 -0
- package/es/flow/components/code-editor/runjsDiagnostics.d.ts +43 -0
- package/es/flow/components/fieldAssignOptions.d.ts +23 -0
- package/es/flow/components/filter/LinkageFilterItem.d.ts +4 -1
- package/es/flow/components/useAssociationTitleFieldSync.d.ts +13 -0
- package/es/flow/index.d.ts +1 -0
- package/es/flow/internal/utils/modelUtils.d.ts +23 -0
- package/es/flow/internal/utils/saveStepParamsWithSubModels.d.ts +11 -0
- package/es/flow/internal/utils/titleFieldQuickSync.d.ts +35 -0
- package/es/flow/models/base/BlockModel.d.ts +3 -1
- package/es/flow/models/base/CollectionBlockModel.d.ts +29 -56
- package/es/flow/models/base/PageModel/PageModel.d.ts +16 -0
- package/es/flow/models/blocks/details/DetailsGridModel.d.ts +1 -0
- package/es/flow/models/blocks/details/utils.d.ts +16 -0
- package/es/flow/models/blocks/filter-form/FieldOperatorSelect.d.ts +10 -0
- package/es/flow/models/blocks/filter-form/FilterFormBlockModel.d.ts +6 -0
- package/es/flow/models/blocks/filter-form/FilterFormItemModel.d.ts +5 -37
- package/es/flow/models/blocks/filter-form/customFieldOperators.d.ts +34 -0
- package/es/flow/models/blocks/filter-form/fields/FilterFormCustomFieldModel.d.ts +16 -0
- package/es/flow/models/blocks/filter-form/fields/FilterFormCustomRecordSelectFieldModel.d.ts +20 -0
- package/es/flow/models/blocks/filter-form/fields/FilterFormRecordSelectFieldModel.d.ts +12 -0
- package/es/flow/models/blocks/filter-form/fields/index.d.ts +2 -0
- package/es/flow/models/blocks/filter-form/index.d.ts +4 -0
- package/es/flow/models/blocks/filter-form/legacyDefaultValueMigration.d.ts +13 -0
- package/es/flow/models/blocks/filter-form/valueNormalization.d.ts +17 -0
- package/es/flow/models/blocks/filter-manager/flow-actions/defaultOperator.d.ts +1 -3
- package/es/flow/models/blocks/form/CreateFormModel.d.ts +2 -1
- package/es/flow/models/blocks/form/EditFormModel.d.ts +2 -1
- package/es/flow/models/blocks/form/FormAssociationFieldGroupModel.d.ts +12 -0
- package/es/flow/models/blocks/form/FormAssociationItemModel.d.ts +39 -0
- package/es/flow/models/blocks/form/FormBlockModel.d.ts +34 -2
- package/es/flow/models/blocks/form/FormGridModel.d.ts +1 -0
- package/es/flow/models/blocks/form/QuickEditFormModel.d.ts +4 -1
- package/es/flow/models/blocks/form/assignRulesUpdateAssociationValues.d.ts +18 -0
- package/es/flow/models/blocks/form/dynamicNamePath.d.ts +19 -0
- package/es/flow/models/blocks/form/index.d.ts +2 -0
- package/es/flow/models/blocks/form/legacyDefaultValueMigration.d.ts +13 -0
- package/es/flow/models/blocks/form/submitHandler.d.ts +1 -1
- package/es/flow/models/blocks/form/submitValues.d.ts +19 -0
- package/es/flow/models/blocks/form/value-runtime/conditions.d.ts +9 -0
- package/es/flow/models/blocks/form/value-runtime/deps.d.ts +23 -0
- package/es/flow/models/blocks/form/value-runtime/form-patch.d.ts +19 -0
- package/es/flow/models/blocks/form/value-runtime/index.d.ts +11 -0
- package/es/flow/models/blocks/form/value-runtime/path.d.ts +25 -0
- package/es/flow/models/blocks/form/value-runtime/rules.d.ts +129 -0
- package/es/flow/models/blocks/form/value-runtime/runtime.d.ts +75 -0
- package/es/flow/models/blocks/form/value-runtime/types.d.ts +62 -0
- package/es/flow/models/blocks/form/value-runtime/utils.d.ts +12 -0
- package/es/flow/models/blocks/shared/legacyDefaultValueMigrationBase.d.ts +20 -0
- package/es/flow/models/blocks/table/TableSelectModel.d.ts +0 -1
- package/es/flow/models/blocks/table/dragSort/dragSortComponents.d.ts +14 -0
- package/es/flow/models/blocks/table/dragSort/dragSortHooks.d.ts +13 -0
- package/es/flow/models/blocks/table/dragSort/dragSortSettings.d.ts +39 -0
- package/es/flow/models/blocks/table/dragSort/dragSortUtils.d.ts +37 -0
- package/es/flow/models/blocks/table/dragSort/index.d.ts +12 -0
- package/es/flow/models/blocks/table/utils.d.ts +8 -8
- package/es/flow/models/fields/AssociationFieldModel/CascadeSelectFieldModel.d.ts +16 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableActionGroupModel.d.ts +11 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableActionsColumnModel.d.ts +19 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableFieldModel.d.ts +30 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/PopupSubTableEditActionModel.d.ts +28 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/PopupSubTableFormSubmitActionModel.d.ts +16 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/PopupSubTableRemoveActionModel.d.ts +14 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/blocks/PopupSubTableFormModel.d.ts +36 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/index.d.ts +17 -0
- package/es/flow/models/fields/AssociationFieldModel/RecordPickerFieldModel.d.ts +8 -1
- package/es/flow/models/fields/AssociationFieldModel/RecordSelectFieldModel.d.ts +15 -0
- package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.d.ts +4 -1
- package/es/flow/models/fields/AssociationFieldModel/index.d.ts +1 -0
- package/es/flow/models/fields/AssociationFieldModel/itemChain.d.ts +94 -0
- package/es/flow/models/fields/AssociationFieldModel/recordSelectShared.d.ts +15 -5
- package/es/flow/models/fields/RichTextFieldModel/registerFontSize.d.ts +9 -0
- package/es/flow/models/fields/RichTextFieldModel/registerImageResize.d.ts +9 -0
- package/es/flow/models/fields/RichTextFieldModel/registerSmartBreak.d.ts +12 -0
- package/es/flow/models/fields/index.d.ts +0 -1
- package/es/flow/utils/useJsonTemplateResolver.d.ts +9 -0
- package/es/index.d.ts +1 -0
- package/es/index.mjs +35756 -24112
- package/es/route-switch/antd/admin-layout/index.d.ts +1 -1
- package/es/schema-component/antd/form-item/hooks/useLazyLoadDisplayAssociationFieldsOfForm.d.ts +26 -0
- package/es/variables/index.d.ts +1 -1
- package/lib/index.js +455 -296
- package/lib/locale/de-DE.json +2 -0
- package/lib/locale/en-US.json +51 -0
- package/lib/locale/es-ES.json +2 -0
- package/lib/locale/fr-FR.json +2 -0
- package/lib/locale/hu-HU.json +2 -0
- package/lib/locale/id-ID.json +2 -0
- package/lib/locale/it-IT.json +2 -0
- package/lib/locale/ja-JP.json +2 -0
- package/lib/locale/ko-KR.json +2 -0
- package/lib/locale/nl-NL.json +2 -0
- package/lib/locale/pt-BR.json +2 -0
- package/lib/locale/ru-RU.json +2 -0
- package/lib/locale/tr-TR.json +2 -0
- package/lib/locale/uk-UA.json +2 -0
- package/lib/locale/vi-VN.json +2 -0
- package/lib/locale/zh-CN.json +77 -7
- package/lib/locale/zh-TW.json +12 -0
- package/package.json +8 -7
- package/es/flow/models/fields/UploadFieldModel.d.ts +0 -22
- package/es/index-C3fHjsMw.mjs +0 -279
- package/lib/index-C3fHjsMw-2UyqyjSq.js +0 -2237
- package/lib/style.css +0 -1
|
@@ -7,5 +7,13 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import { Diagnostic } from '@codemirror/lint';
|
|
10
|
-
export declare const computeDiagnosticsFromText: (text: string
|
|
11
|
-
|
|
10
|
+
export declare const computeDiagnosticsFromText: (text: string, options?: {
|
|
11
|
+
/**
|
|
12
|
+
* When provided, treat `ctx.<name>` / `ctx.<name>()` where `<name>` is NOT in this list as a lint issue.
|
|
13
|
+
* This enables context-aware unknown ctx API detection in CodeEditor (best-effort).
|
|
14
|
+
*/
|
|
15
|
+
knownCtxMemberRoots?: Iterable<string>;
|
|
16
|
+
}) => Diagnostic[];
|
|
17
|
+
export declare const createJavaScriptLinter: (options?: {
|
|
18
|
+
knownCtxMemberRoots?: Iterable<string>;
|
|
19
|
+
}) => import("@codemirror/state").Extension;
|
|
@@ -0,0 +1,20 @@
|
|
|
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 { Completion, CompletionSource } from '@codemirror/autocomplete';
|
|
10
|
+
type CreateRunJSCompletionSourceOptions = {
|
|
11
|
+
hostCtx: any;
|
|
12
|
+
staticOptions?: Completion[];
|
|
13
|
+
/**
|
|
14
|
+
* Roots that should use FlowContext meta tree to provide deep completions.
|
|
15
|
+
* When omitted/empty, all `ctx.*` roots are enabled.
|
|
16
|
+
*/
|
|
17
|
+
metaRoots?: string[];
|
|
18
|
+
};
|
|
19
|
+
export declare function createRunJSCompletionSource({ hostCtx, staticOptions, metaRoots, }: CreateRunJSCompletionSourceOptions): CompletionSource;
|
|
20
|
+
export {};
|
|
@@ -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 { FlowContext } from '@nocobase/flow-engine';
|
|
10
|
+
export type RunJSIssue = {
|
|
11
|
+
type: 'lint' | 'runtime';
|
|
12
|
+
message: string;
|
|
13
|
+
ruleId?: string;
|
|
14
|
+
location?: {
|
|
15
|
+
start?: {
|
|
16
|
+
line: number;
|
|
17
|
+
column: number;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
stack?: string;
|
|
21
|
+
};
|
|
22
|
+
export type RunJSLog = {
|
|
23
|
+
level: 'log' | 'info' | 'warn' | 'error';
|
|
24
|
+
message: string;
|
|
25
|
+
};
|
|
26
|
+
export type DiagnoseRunJSResult = {
|
|
27
|
+
issues: RunJSIssue[];
|
|
28
|
+
logs: RunJSLog[];
|
|
29
|
+
execution?: {
|
|
30
|
+
started: boolean;
|
|
31
|
+
finished: boolean;
|
|
32
|
+
timeout: boolean;
|
|
33
|
+
durationMs?: number;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export type PreviewRunJSResult = {
|
|
37
|
+
success: boolean;
|
|
38
|
+
message: string;
|
|
39
|
+
};
|
|
40
|
+
export declare const MAX_MESSAGE_CHARS = 4000;
|
|
41
|
+
export declare function formatRunJSPreviewMessage(result: DiagnoseRunJSResult): string;
|
|
42
|
+
export declare function diagnoseRunJS(code: string, ctx: FlowContext): Promise<DiagnoseRunJSResult>;
|
|
43
|
+
export declare function previewRunJS(code: string, ctx: FlowContext): Promise<PreviewRunJSResult>;
|
|
@@ -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
|
*/
|
|
@@ -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 { SyncAssociationTitleFieldParams } from './FieldAssignRulesEditor';
|
|
10
|
+
export declare function useAssociationTitleFieldSync(t: (key: string) => string): {
|
|
11
|
+
isTitleFieldCandidate: (field: any) => boolean;
|
|
12
|
+
onSyncAssociationTitleField: ({ targetCollection, titleField }: SyncAssociationTitleFieldParams) => Promise<void>;
|
|
13
|
+
};
|
package/es/flow/index.d.ts
CHANGED
|
@@ -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>;
|
|
@@ -0,0 +1,35 @@
|
|
|
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 { CollectionFieldOptions, DataSourceManager } from '../../../data-source';
|
|
10
|
+
type CollectionLike = {
|
|
11
|
+
name?: unknown;
|
|
12
|
+
dataSource?: unknown;
|
|
13
|
+
dataSourceKey?: unknown;
|
|
14
|
+
setOption?: (key: string, value: any) => any;
|
|
15
|
+
};
|
|
16
|
+
type ApiClientLike = {
|
|
17
|
+
request?: (options: {
|
|
18
|
+
url: string;
|
|
19
|
+
method?: string;
|
|
20
|
+
params?: Record<string, any>;
|
|
21
|
+
data?: Record<string, any>;
|
|
22
|
+
}) => Promise<any>;
|
|
23
|
+
};
|
|
24
|
+
export declare function isTitleUsableField(dm: DataSourceManager | undefined, field: CollectionFieldOptions | undefined): boolean;
|
|
25
|
+
export declare function syncCollectionTitleField(options: {
|
|
26
|
+
api: ApiClientLike;
|
|
27
|
+
dataSourceManager?: DataSourceManager;
|
|
28
|
+
targetCollection: CollectionLike | null | undefined;
|
|
29
|
+
titleField: string;
|
|
30
|
+
}): Promise<{
|
|
31
|
+
dataSourceKey: string;
|
|
32
|
+
collectionName: string;
|
|
33
|
+
titleField: string;
|
|
34
|
+
}>;
|
|
35
|
+
export {};
|
|
@@ -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' | 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;
|
|
@@ -8,6 +8,8 @@ export declare const BlockSceneEnum: {
|
|
|
8
8
|
select: BlockSceneType;
|
|
9
9
|
filter: BlockSceneType;
|
|
10
10
|
oam: BlockSceneType;
|
|
11
|
+
subForm: BlockSceneType;
|
|
12
|
+
bulkEditForm: BlockSceneType;
|
|
11
13
|
};
|
|
12
14
|
export declare class BlockModel<T = DefaultStructure> extends FlowModel<T> {
|
|
13
15
|
decoratorProps: Record<string, any>;
|
|
@@ -19,6 +19,13 @@ export declare class CollectionBlockModel<T = DefaultStructure> extends DataBloc
|
|
|
19
19
|
isManualRefresh: boolean;
|
|
20
20
|
collectionRequired: boolean;
|
|
21
21
|
private previousBeforeRenderHash;
|
|
22
|
+
private lastSeenDirtyVersion;
|
|
23
|
+
private dirtyRefreshing;
|
|
24
|
+
/**
|
|
25
|
+
* 记录各筛选来源是否活跃(有有效筛选值)
|
|
26
|
+
* key: filterId (筛选器 uid), value: boolean (是否有有效筛选)
|
|
27
|
+
*/
|
|
28
|
+
private activeFilterSources;
|
|
22
29
|
protected onMount(): void;
|
|
23
30
|
onActive(): void;
|
|
24
31
|
/**
|
|
@@ -28,62 +35,7 @@ export declare class CollectionBlockModel<T = DefaultStructure> extends DataBloc
|
|
|
28
35
|
/**
|
|
29
36
|
* 定义子菜单选项
|
|
30
37
|
*/
|
|
31
|
-
static defineChildren(ctx: FlowModelContext): Promise<
|
|
32
|
-
key: string;
|
|
33
|
-
label: any;
|
|
34
|
-
searchable: boolean;
|
|
35
|
-
searchPlaceholder: string;
|
|
36
|
-
children: (ctx: any) => {
|
|
37
|
-
key: string;
|
|
38
|
-
label: any;
|
|
39
|
-
useModel: string;
|
|
40
|
-
createModelOptions: any;
|
|
41
|
-
}[];
|
|
42
|
-
}[] | {
|
|
43
|
-
key: string;
|
|
44
|
-
label: any;
|
|
45
|
-
useModel: string;
|
|
46
|
-
createModelOptions: any;
|
|
47
|
-
}[] | ({
|
|
48
|
-
key: string;
|
|
49
|
-
label: string;
|
|
50
|
-
useModel: string;
|
|
51
|
-
createModelOptions: any;
|
|
52
|
-
children?: undefined;
|
|
53
|
-
} | {
|
|
54
|
-
key: string;
|
|
55
|
-
label: string;
|
|
56
|
-
children: () => {
|
|
57
|
-
key: string;
|
|
58
|
-
label: string;
|
|
59
|
-
useModel: string;
|
|
60
|
-
createModelOptions: any;
|
|
61
|
-
}[];
|
|
62
|
-
useModel?: undefined;
|
|
63
|
-
createModelOptions?: undefined;
|
|
64
|
-
} | {
|
|
65
|
-
key: string;
|
|
66
|
-
label: string;
|
|
67
|
-
children: {
|
|
68
|
-
key: string;
|
|
69
|
-
label: any;
|
|
70
|
-
searchable: boolean;
|
|
71
|
-
searchPlaceholder: string;
|
|
72
|
-
children: (ctx: any) => {
|
|
73
|
-
key: string;
|
|
74
|
-
label: any;
|
|
75
|
-
useModel: string;
|
|
76
|
-
createModelOptions: any;
|
|
77
|
-
}[];
|
|
78
|
-
}[] | {
|
|
79
|
-
key: string;
|
|
80
|
-
label: any;
|
|
81
|
-
useModel: string;
|
|
82
|
-
createModelOptions: any;
|
|
83
|
-
}[];
|
|
84
|
-
useModel?: undefined;
|
|
85
|
-
createModelOptions?: undefined;
|
|
86
|
-
})[]>;
|
|
38
|
+
static defineChildren(ctx: FlowModelContext): Promise<any[]>;
|
|
87
39
|
get dataSource(): DataSource;
|
|
88
40
|
get collection(): Collection;
|
|
89
41
|
get resource(): BaseRecordResource;
|
|
@@ -109,6 +61,27 @@ export declare class CollectionBlockModel<T = DefaultStructure> extends DataBloc
|
|
|
109
61
|
}[]>;
|
|
110
62
|
getResourceSettingsInitParams(): ResourceSettingsInitParams;
|
|
111
63
|
onInit(options: any): void;
|
|
64
|
+
/**
|
|
65
|
+
* 获取数据加载模式
|
|
66
|
+
* @returns 'auto' | 'manual'
|
|
67
|
+
*/
|
|
68
|
+
getDataLoadingMode(): 'auto' | 'manual';
|
|
69
|
+
/**
|
|
70
|
+
* 设置指定筛选来源的活跃状态
|
|
71
|
+
* @param filterId 筛选器 uid
|
|
72
|
+
* @param active 是否有有效筛选值
|
|
73
|
+
*/
|
|
74
|
+
setFilterActive(filterId: string, active: boolean): void;
|
|
75
|
+
/**
|
|
76
|
+
* 检查是否有任何活跃的筛选来源
|
|
77
|
+
* @returns boolean
|
|
78
|
+
*/
|
|
79
|
+
hasActiveFilters(): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* 移除指定筛选来源
|
|
82
|
+
* @param filterId 筛选器 uid
|
|
83
|
+
*/
|
|
84
|
+
removeFilterSource(filterId: string): void;
|
|
112
85
|
createResource(ctx: any, params: any): SingleRecordResource | MultiRecordResource;
|
|
113
86
|
refresh(): Promise<void>;
|
|
114
87
|
protected defaultBlockTitle(): string;
|
|
@@ -20,8 +20,24 @@ export declare class PageModel extends FlowModel<PageModelStructure> {
|
|
|
20
20
|
left?: ReactNode;
|
|
21
21
|
right?: ReactNode;
|
|
22
22
|
};
|
|
23
|
+
private viewActivatedListener?;
|
|
24
|
+
private dataSourceDirtyListener?;
|
|
25
|
+
private lastSeenEmitterViewActivatedVersion;
|
|
26
|
+
private dirtyRefreshScheduled;
|
|
27
|
+
private unmounted;
|
|
28
|
+
private documentTitleUpdateVersion;
|
|
29
|
+
private getActiveTabKey;
|
|
30
|
+
private scheduleActiveLifecycleRefresh;
|
|
23
31
|
onMount(): void;
|
|
32
|
+
protected onUnmount(): void;
|
|
24
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>;
|
|
25
41
|
createPageTabModelOptions: () => CreateModelOptions;
|
|
26
42
|
mapTabs(): {
|
|
27
43
|
key: string;
|
|
@@ -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;
|
|
@@ -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 React from 'react';
|
|
10
|
+
export declare const FieldOperatorSelect: React.MemoExoticComponent<import("@formily/react").ReactFC<Omit<any, "ref">>>;
|
|
@@ -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: {
|
|
@@ -19,43 +20,7 @@ export declare class FilterFormItemModel extends FilterableItemModel<{
|
|
|
19
20
|
static defineChildren(ctx: FlowModelContext): {
|
|
20
21
|
key: string;
|
|
21
22
|
label: React.JSX.Element;
|
|
22
|
-
children: () => Promise<
|
|
23
|
-
key: string;
|
|
24
|
-
label: string;
|
|
25
|
-
type: "group";
|
|
26
|
-
searchable: boolean;
|
|
27
|
-
searchPlaceholder: string;
|
|
28
|
-
children: {
|
|
29
|
-
key: any;
|
|
30
|
-
label: any;
|
|
31
|
-
useModel: string;
|
|
32
|
-
refreshTargets: string[];
|
|
33
|
-
createModelOptions: () => {
|
|
34
|
-
use: string;
|
|
35
|
-
stepParams: {
|
|
36
|
-
fieldSettings: {
|
|
37
|
-
init: {
|
|
38
|
-
dataSourceKey: any;
|
|
39
|
-
collectionName: any;
|
|
40
|
-
fieldPath: any;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
filterFormItemSettings: {
|
|
44
|
-
init: {
|
|
45
|
-
filterField: Pick<any, "name" | "title" | "type" | "interface">;
|
|
46
|
-
defaultTargetUid: string;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
subModels: {
|
|
51
|
-
field: {
|
|
52
|
-
use: string;
|
|
53
|
-
props: any;
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
}[];
|
|
58
|
-
}[]>;
|
|
23
|
+
children: () => Promise<any[]>;
|
|
59
24
|
}[] | {
|
|
60
25
|
key: string;
|
|
61
26
|
label: React.JSX.Element;
|
|
@@ -64,6 +29,8 @@ export declare class FilterFormItemModel extends FilterableItemModel<{
|
|
|
64
29
|
operator: string;
|
|
65
30
|
mounted: boolean;
|
|
66
31
|
private debouncedDoFilter;
|
|
32
|
+
private lastAutoTriggerValue;
|
|
33
|
+
private autoTriggerInitialized;
|
|
67
34
|
get defaultTargetUid(): string;
|
|
68
35
|
private getCurrentOperatorMeta;
|
|
69
36
|
onInit(options: any): void;
|
|
@@ -76,6 +43,7 @@ export declare class FilterFormItemModel extends FilterableItemModel<{
|
|
|
76
43
|
* @returns
|
|
77
44
|
*/
|
|
78
45
|
getFilterValue(): any;
|
|
46
|
+
normalizeAssociationFilterValue(value: any, fieldModel: FieldModel): any;
|
|
79
47
|
getDefaultValue(): any;
|
|
80
48
|
/**
|
|
81
49
|
* 处理回车事件
|
|
@@ -0,0 +1,34 @@
|
|
|
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 OperatorMeta = {
|
|
10
|
+
label: string;
|
|
11
|
+
value: string;
|
|
12
|
+
selected?: boolean;
|
|
13
|
+
noValue?: boolean;
|
|
14
|
+
schema?: Record<string, any>;
|
|
15
|
+
visible?: (meta: any) => boolean;
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
18
|
+
type ResolveOperatorParams = {
|
|
19
|
+
flowEngine: any;
|
|
20
|
+
fieldModel?: string;
|
|
21
|
+
source?: string[];
|
|
22
|
+
fieldModelProps?: Record<string, any>;
|
|
23
|
+
};
|
|
24
|
+
export declare function resolveCustomFieldOperatorList(params: ResolveOperatorParams): OperatorMeta[];
|
|
25
|
+
export declare function resolveDefaultCustomFieldOperator(params: ResolveOperatorParams): string | undefined;
|
|
26
|
+
export declare function toOperatorSelectOptions(operatorList?: OperatorMeta[], translate?: (text: string) => string): {
|
|
27
|
+
label: string;
|
|
28
|
+
value: string;
|
|
29
|
+
selected?: boolean;
|
|
30
|
+
noValue?: boolean;
|
|
31
|
+
schema?: Record<string, any>;
|
|
32
|
+
visible?: (meta: any) => boolean;
|
|
33
|
+
}[];
|
|
34
|
+
export {};
|
|
@@ -7,12 +7,27 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
|
+
import { CollectionField, FlowModelContext } from '@nocobase/flow-engine';
|
|
10
11
|
import { FilterFormCustomItemModel } from '../FilterFormCustomItemModel';
|
|
11
12
|
export declare class FilterFormCustomFieldModel extends FilterFormCustomItemModel {
|
|
12
13
|
customFieldModelInstance: any;
|
|
13
14
|
customFieldProps: any;
|
|
14
15
|
operator: string;
|
|
15
16
|
private debouncedDoFilter;
|
|
17
|
+
private lastAutoTriggerValue;
|
|
18
|
+
private autoTriggerInitialized;
|
|
19
|
+
/**
|
|
20
|
+
* Resolve or build collection field context for RecordSelect custom fields.
|
|
21
|
+
*
|
|
22
|
+
* When user creates a custom RecordSelect field, there is no real collection field.
|
|
23
|
+
* We build a lightweight CollectionField with target metadata so downstream
|
|
24
|
+
* flows can render select settings and load remote options.
|
|
25
|
+
*
|
|
26
|
+
* @param ctx - Flow context for current model
|
|
27
|
+
* @param props - Field model props from settings
|
|
28
|
+
* @returns CollectionField instance or undefined when not applicable
|
|
29
|
+
*/
|
|
30
|
+
buildRecordSelectCollectionField(ctx: FlowModelContext, props: Record<string, any>): CollectionField;
|
|
16
31
|
get defaultTargetUid(): string;
|
|
17
32
|
onInit(options: any): void;
|
|
18
33
|
onUnmount(): void;
|
|
@@ -23,6 +38,7 @@ export declare class FilterFormCustomFieldModel extends FilterFormCustomItemMode
|
|
|
23
38
|
* @returns
|
|
24
39
|
*/
|
|
25
40
|
getFilterValue(): any;
|
|
41
|
+
private getCurrentOperatorMeta;
|
|
26
42
|
/**
|
|
27
43
|
* 处理回车事件
|
|
28
44
|
* 当用户在输入框中按下回车键时触发筛选
|
|
@@ -0,0 +1,20 @@
|
|
|
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 { RecordSelectFieldModel } from '../../../fields/AssociationFieldModel/RecordSelectFieldModel';
|
|
11
|
+
export declare class FilterFormCustomRecordSelectFieldModel extends RecordSelectFieldModel {
|
|
12
|
+
private valueOptionsSyncKey;
|
|
13
|
+
private valueOptionsSyncedKey;
|
|
14
|
+
private valueOptionsSyncTask;
|
|
15
|
+
private buildValueOptionsSyncKey;
|
|
16
|
+
private ensureValueOptionsSynced;
|
|
17
|
+
onDispatchEventStart(eventName: string): Promise<void>;
|
|
18
|
+
getFilterValue(): any;
|
|
19
|
+
render(): React.JSX.Element;
|
|
20
|
+
}
|
|
@@ -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,7 @@
|
|
|
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';
|
|
13
|
+
export * from './FilterFormCustomRecordSelectFieldModel';
|
|
@@ -14,6 +14,10 @@ export * from './FilterFormCollapseActionModel';
|
|
|
14
14
|
export * from './FilterFormGridModel';
|
|
15
15
|
export * from './FilterFormItemModel';
|
|
16
16
|
export * from './FilterFormCustomItemModel';
|
|
17
|
+
export * from './FieldModelSelect';
|
|
18
|
+
export * from './FieldOperatorSelect';
|
|
19
|
+
export * from './SourceCascader';
|
|
20
|
+
export * from './customFieldOperators';
|
|
17
21
|
export * from './FilterFormJSActionModel';
|
|
18
22
|
export * from './FilterFormResetActionModel';
|
|
19
23
|
export * from './FilterFormSubmitActionModel';
|
|
@@ -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;
|