@nocobase/client 2.1.0-beta.2 → 2.1.0-beta.21
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/LICENSE +201 -661
- package/README.md +79 -10
- package/es/ai/index.d.ts +1 -0
- package/es/ai/skills-manager/index.d.ts +9 -0
- package/es/ai/skills-manager/types.d.ts +23 -0
- package/es/ai/tools-manager/index.d.ts +0 -1
- package/es/ai/tools-manager/types.d.ts +11 -1
- package/es/application/Application.d.ts +5 -1
- package/es/block-provider/BlockProvider.d.ts +1 -0
- package/es/collection-manager/templates/view.d.ts +11 -11
- package/es/flow/actions/afterSuccess.d.ts +9 -0
- package/es/flow/actions/index.d.ts +1 -0
- package/es/flow/components/FieldAssignValueInput.d.ts +26 -1
- package/es/flow/components/RunJSValueEditor.d.ts +1 -1
- package/es/flow/components/code-editor/core/tooltipParent.d.ts +9 -0
- package/es/flow/components/code-editor/resolveScenes.d.ts +10 -0
- package/es/flow/components/code-editor/runjsDiagnostics.d.ts +5 -2
- package/es/flow/components/filter/LinkageFilterItem.d.ts +23 -0
- package/es/flow/internal/utils/modelUtils.d.ts +4 -0
- package/es/flow/models/actions/AddChildActionModel.d.ts +1 -0
- package/es/flow/models/actions/BulkDeleteActionModel.d.ts +1 -0
- package/es/flow/models/actions/JSItemActionModel.d.ts +19 -0
- package/es/flow/models/actions/LinkActionModel.d.ts +1 -4
- package/es/flow/models/actions/LinkActionUtils.d.ts +34 -0
- package/es/flow/models/actions/UpdateRecordActionUtils.d.ts +12 -0
- package/es/flow/models/actions/index.d.ts +1 -0
- package/es/flow/models/actions/joinUrlSearch.d.ts +12 -0
- package/es/flow/models/base/ActionGroupModel.d.ts +8 -0
- package/es/flow/models/base/BlockGridModel.d.ts +2 -1
- package/es/flow/models/base/BlockModel.d.ts +26 -0
- package/es/flow/models/base/CollectionBlockModel.d.ts +9 -27
- package/es/flow/models/base/GridModel.d.ts +1 -0
- package/es/flow/models/base/PageModel/ChildPageModel.d.ts +1 -0
- package/es/flow/models/base/PageModel/PageModel.d.ts +1 -1
- package/es/flow/models/base/PageModel/RootPageModel.d.ts +8 -0
- package/es/flow/models/blocks/details/DetailsBlockModel.d.ts +4 -0
- package/es/flow/models/blocks/details/DetailsItemModel.d.ts +7 -0
- package/es/flow/models/blocks/filter-form/FilterFormGridModel.d.ts +12 -1
- package/es/flow/models/blocks/form/CreateFormModel.d.ts +1 -0
- package/es/flow/models/blocks/form/EditFormModel.d.ts +2 -0
- package/es/flow/models/blocks/form/FormBlockModel.d.ts +1 -0
- package/es/flow/models/blocks/form/submitValues.d.ts +21 -0
- package/es/flow/models/blocks/form/value-runtime/rules.d.ts +8 -0
- package/es/flow/models/blocks/form/value-runtime/runtime.d.ts +13 -0
- package/es/flow/models/blocks/table/TableBlockModel.d.ts +1 -23
- package/es/flow/models/blocks/table/TableColumnModel.d.ts +3 -1
- package/es/flow/models/blocks/table/sortUtils.d.ts +32 -0
- package/es/flow/models/fields/AssociationFieldModel/AssociationFieldModel.d.ts +1 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/popupSubTableBeforeClose.d.ts +25 -0
- package/es/flow/models/fields/AssociationFieldModel/RecordPickerFieldModel.d.ts +10 -0
- package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/index.d.ts +1 -0
- package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/rowIdentity.d.ts +18 -0
- package/es/flow/models/fields/AssociationFieldModel/itemChain.d.ts +5 -0
- package/es/flow/models/fields/AssociationFieldModel/recordSelectShared.d.ts +2 -13
- package/es/flow/models/fields/DisplayAssociationField/displaySubListUtils.d.ts +14 -0
- package/es/flow/models/fields/DisplayTextFieldModel.d.ts +1 -0
- package/es/flow/utils/actionCapability.d.ts +60 -0
- package/es/flow/utils/index.d.ts +1 -0
- package/es/flow/utils/pagination.d.ts +29 -0
- package/es/index.css +1 -1
- package/es/index.mjs +2225 -107889
- package/es/index.mjs.LICENSE.txt +8 -0
- package/es/lazy-helper/index.d.ts +8 -6
- package/es/pm/AdminSettingsLayoutModel.d.ts +13 -0
- package/es/pm/PluginSetting.d.ts +2 -1
- package/es/pm/index.d.ts +1 -0
- package/es/route-switch/antd/admin-layout/AdminLayoutModel.d.ts +27 -0
- package/es/route-switch/antd/admin-layout/AdminLayoutRouteCoordinator.d.ts +50 -0
- package/es/route-switch/antd/admin-layout/index.d.ts +4 -0
- package/es/route-switch/antd/admin-layout/mobileMenuNavigation.d.ts +15 -0
- package/es/schema-component/antd/association-field/Table.d.ts +0 -57
- package/es/schema-component/antd/date-picker/DatePicker.d.ts +26 -0
- package/es/schema-settings/SchemaSettings.d.ts +2 -0
- package/es/schema-settings/SchemaSettingsDefaultValue.d.ts +18 -0
- package/es/schema-settings/VariableInput/hooks/useParentIterationVariable.d.ts +3 -3
- package/lib/index.css +1 -1
- package/lib/index.js +2032 -2018
- package/lib/index.js.LICENSE.txt +1 -0
- package/lib/locale/de-DE.json +5 -1
- package/lib/locale/en-US.json +5 -0
- package/lib/locale/es-ES.json +5 -1
- package/lib/locale/fr-FR.json +5 -1
- package/lib/locale/hu-HU.json +5 -1
- package/lib/locale/id-ID.json +5 -1
- package/lib/locale/it-IT.json +5 -1
- package/lib/locale/ja-JP.json +5 -1
- package/lib/locale/ko-KR.json +5 -1
- package/lib/locale/nl-NL.json +5 -1
- package/lib/locale/pt-BR.json +5 -1
- package/lib/locale/ru-RU.json +5 -1
- package/lib/locale/tr-TR.json +5 -1
- package/lib/locale/uk-UA.json +5 -1
- package/lib/locale/vi-VN.json +5 -1
- package/lib/locale/zh-CN.json +6 -1
- package/lib/locale/zh-TW.json +5 -1
- package/package.json +9 -9
- package/es/md-BbvRKckr.mjs +0 -61
- package/es/md-oH2RssNY.mjs +0 -61
- package/lib/md-BbvRKckr-IQIU5F3r.js +0 -1
- package/lib/md-oH2RssNY-IQIU5F3r.js +0 -1
|
@@ -21,17 +21,20 @@ export declare class CollectionBlockModel<T = DefaultStructure> extends DataBloc
|
|
|
21
21
|
private previousBeforeRenderHash;
|
|
22
22
|
private lastSeenDirtyVersion;
|
|
23
23
|
private dirtyRefreshing;
|
|
24
|
-
/**
|
|
25
|
-
* 记录各筛选来源是否活跃(有有效筛选值)
|
|
26
|
-
* key: filterId (筛选器 uid), value: boolean (是否有有效筛选)
|
|
27
|
-
*/
|
|
28
|
-
private activeFilterSources;
|
|
29
24
|
protected onMount(): void;
|
|
30
|
-
|
|
25
|
+
private getDirtyTrackingVersion;
|
|
26
|
+
onActive(forceRefresh?: boolean): void;
|
|
31
27
|
/**
|
|
32
28
|
* 子菜单过滤函数
|
|
33
29
|
*/
|
|
34
30
|
static filterCollection(_collection: Collection): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* 判断当前区块模型在 collection 选择菜单中是否应该展示指定数据表。
|
|
33
|
+
*
|
|
34
|
+
* @param collection 数据表
|
|
35
|
+
* @returns 是否显示
|
|
36
|
+
*/
|
|
37
|
+
static isCollectionAvailable(collection: Collection | undefined): boolean;
|
|
35
38
|
/**
|
|
36
39
|
* 定义子菜单选项
|
|
37
40
|
*/
|
|
@@ -61,27 +64,6 @@ export declare class CollectionBlockModel<T = DefaultStructure> extends DataBloc
|
|
|
61
64
|
}[]>;
|
|
62
65
|
getResourceSettingsInitParams(): ResourceSettingsInitParams;
|
|
63
66
|
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;
|
|
85
67
|
createResource(ctx: any, params: any): SingleRecordResource | MultiRecordResource;
|
|
86
68
|
refresh(): Promise<void>;
|
|
87
69
|
protected defaultBlockTitle(): string;
|
|
@@ -45,6 +45,7 @@ export declare class GridModel<T extends {
|
|
|
45
45
|
mergeRowsWithItems(rows: Record<string, string[][]>): Record<string, string[][]>;
|
|
46
46
|
resetRows(syncProps?: boolean): void;
|
|
47
47
|
private computePointerPosition;
|
|
48
|
+
private getDragContainer;
|
|
48
49
|
private updateLayoutSnapshot;
|
|
49
50
|
private scheduleSnapshotRefresh;
|
|
50
51
|
/**
|
|
@@ -14,6 +14,7 @@ export declare class ChildPageModel extends PageModel {
|
|
|
14
14
|
tabBarExtraContent: {
|
|
15
15
|
left: React.JSX.Element;
|
|
16
16
|
};
|
|
17
|
+
renderBackButtonWhenTabsDisabled(): React.JSX.Element;
|
|
17
18
|
createPageTabModelOptions: () => CreateModelOptions;
|
|
18
19
|
handleDragEnd(event: DragEndEvent): Promise<void>;
|
|
19
20
|
render(): React.JSX.Element;
|
|
@@ -30,7 +30,7 @@ export declare class PageModel extends FlowModel<PageModelStructure> {
|
|
|
30
30
|
private scheduleActiveLifecycleRefresh;
|
|
31
31
|
onMount(): void;
|
|
32
32
|
protected onUnmount(): void;
|
|
33
|
-
invokeTabModelLifecycleMethod(tabActiveKey: string, method: 'onActive' | 'onInactive'): void;
|
|
33
|
+
invokeTabModelLifecycleMethod(tabActiveKey: string, method: 'onActive' | 'onInactive', forceRefresh?: boolean): void;
|
|
34
34
|
/**
|
|
35
35
|
* Resolve configured document title template and update browser tab title.
|
|
36
36
|
* Priority:
|
|
@@ -10,6 +10,14 @@ import { DragEndEvent } from '@dnd-kit/core';
|
|
|
10
10
|
import { PageModel } from './PageModel';
|
|
11
11
|
export declare class RootPageModel extends PageModel {
|
|
12
12
|
mounted: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* 新建 tab 在首次保存完成前,前端 route 里可能还没有数据库 id。
|
|
15
|
+
* 拖拽前兜底触发一次保存,确保 move 接口拿到真实主键。
|
|
16
|
+
*
|
|
17
|
+
* @param model - 当前参与拖拽的 tab model
|
|
18
|
+
* @returns 可用于排序接口的 route id
|
|
19
|
+
*/
|
|
20
|
+
private ensurePersistedRouteId;
|
|
13
21
|
onMount(): void;
|
|
14
22
|
saveStepParams(): Promise<void>;
|
|
15
23
|
handleDragEnd(event: DragEndEvent): Promise<void>;
|
|
@@ -18,6 +18,8 @@ export declare class DetailsBlockModel extends CollectionBlockModel<{
|
|
|
18
18
|
};
|
|
19
19
|
}> {
|
|
20
20
|
static scene: import("../../base").BlockSceneType;
|
|
21
|
+
private hadSingleRecordData;
|
|
22
|
+
private hasMultiRefreshDispatched;
|
|
21
23
|
_defaultCustomModelClasses: {
|
|
22
24
|
RecordActionGroupModel: string;
|
|
23
25
|
DetailsItemModel: string;
|
|
@@ -28,7 +30,9 @@ export declare class DetailsBlockModel extends CollectionBlockModel<{
|
|
|
28
30
|
createResource(ctx: any, params: any): SingleRecordResource<unknown> | MultiRecordResource<unknown>;
|
|
29
31
|
onInit(options: any): void;
|
|
30
32
|
isMultiRecordResource(): boolean;
|
|
33
|
+
hasDispatchedMultiRefresh(): boolean;
|
|
31
34
|
getCurrentRecord(): any;
|
|
35
|
+
hasAvailableData(): boolean;
|
|
32
36
|
handlePageChange: (page: number) => Promise<void>;
|
|
33
37
|
refresh(): Promise<void>;
|
|
34
38
|
renderPagination(): React.JSX.Element;
|
|
@@ -17,6 +17,13 @@ import { DetailsGridModel } from './DetailsGridModel';
|
|
|
17
17
|
* @param idx Form.List 的索引
|
|
18
18
|
*/
|
|
19
19
|
export declare function getValueWithIndex(record: any, fieldPath: string, idx?: string[]): any;
|
|
20
|
+
export declare function getDetailsItemValue(options: {
|
|
21
|
+
record: any;
|
|
22
|
+
currentObject?: any;
|
|
23
|
+
fieldPath: string;
|
|
24
|
+
prefixFieldPath?: string;
|
|
25
|
+
idx?: string[];
|
|
26
|
+
}): any;
|
|
20
27
|
export declare class DetailsItemModel extends DisplayItemModel<{
|
|
21
28
|
parent: DetailsGridModel;
|
|
22
29
|
subModels: {
|
|
@@ -22,10 +22,21 @@ export declare class FilterFormGridModel extends GridModel {
|
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
dragOverlayConfig: DragOverlayConfig;
|
|
25
|
-
private hiddenRows;
|
|
26
25
|
readonly loading: {
|
|
27
26
|
value: boolean;
|
|
28
27
|
};
|
|
28
|
+
private getAssociationFilterTargetKey;
|
|
29
|
+
/**
|
|
30
|
+
* 获取筛选表单当前“完整布局”。
|
|
31
|
+
* 折叠态会临时裁剪 props.rows,因此这里优先选取行数更多的那份布局,
|
|
32
|
+
* 避免拖拽排序或重新挂载后只拿到被裁剪过的运行时 rows。
|
|
33
|
+
*/
|
|
34
|
+
private getFullLayout;
|
|
35
|
+
/**
|
|
36
|
+
* 按“可视字段行数”裁剪布局,而不是只按 grid row 数裁剪。
|
|
37
|
+
* 这样即使拖拽后多个字段被排进同一个 cell,也仍然可以正确折叠。
|
|
38
|
+
*/
|
|
39
|
+
private limitRowsByVisibleCount;
|
|
29
40
|
toggleFormFieldsCollapse(collapse: boolean, visibleRows: number): void;
|
|
30
41
|
onModelCreated(subModel: FilterFormItemModel): Promise<void>;
|
|
31
42
|
renderAddSubModelButton(): React.JSX.Element;
|
|
@@ -11,6 +11,7 @@ import React from 'react';
|
|
|
11
11
|
import { FormBlockModel } from './FormBlockModel';
|
|
12
12
|
export declare class CreateFormModel extends FormBlockModel {
|
|
13
13
|
static scene: import("../../base/BlockModel").BlockSceneType;
|
|
14
|
+
static blockCapabilityActionName: string;
|
|
14
15
|
private actionFlowSettings;
|
|
15
16
|
private actionExtraToolbarItems;
|
|
16
17
|
createResource(ctx: any, params: any): SingleRecordResource<unknown>;
|
|
@@ -11,11 +11,13 @@ import React from 'react';
|
|
|
11
11
|
import { FormBlockModel } from './FormBlockModel';
|
|
12
12
|
export declare class EditFormModel extends FormBlockModel {
|
|
13
13
|
static scene: import("../../base").BlockSceneType;
|
|
14
|
+
static blockCapabilityActionName: string;
|
|
14
15
|
private actionFlowSettings;
|
|
15
16
|
private actionExtraToolbarItems;
|
|
16
17
|
createResource(_ctx: FlowModelContext, params: any): SingleRecordResource<unknown> | MultiRecordResource<unknown>;
|
|
17
18
|
isMultiRecordResource(): boolean;
|
|
18
19
|
getCurrentRecord(): any;
|
|
20
|
+
hasAvailableData(): boolean;
|
|
19
21
|
getAclActionName(): string;
|
|
20
22
|
handlePageChange: (page: number) => Promise<void>;
|
|
21
23
|
submitHandler(ctx: any, params: any, cb?: (values?: any, filterByTk?: any) => void): Promise<void>;
|
|
@@ -32,6 +32,7 @@ export declare class FormBlockModel<T extends DefaultCollectionBlockModelStructu
|
|
|
32
32
|
FormAssociationFieldGroupModel: string;
|
|
33
33
|
};
|
|
34
34
|
customModelClasses: CustomFormBlockModelClassesEnum;
|
|
35
|
+
private syncRuntimeAssignRules;
|
|
35
36
|
renderConfigureActions(): React.JSX.Element;
|
|
36
37
|
setFieldsValue(values: any): void;
|
|
37
38
|
setFieldValue(fieldName: any, value: any): void;
|
|
@@ -6,7 +6,28 @@
|
|
|
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 { NamePath } from './value-runtime/types';
|
|
9
10
|
import type { FormBlockModel } from './FormBlockModel';
|
|
11
|
+
/**
|
|
12
|
+
* 生成提交前的校验字段列表:
|
|
13
|
+
* - 在配置态下可用于绕开“联动隐藏字段”的必填校验;
|
|
14
|
+
* - 仅排除 `model.hidden=true` 的字段路径;
|
|
15
|
+
* - 返回 null 表示无法安全推断,调用方应回退到 `validateFields()` 全量校验。
|
|
16
|
+
*/
|
|
17
|
+
export declare function getValidationNamePathsExcludingHiddenModels(blockModel: FormBlockModel): NamePath[] | null;
|
|
18
|
+
export declare function shouldSkipSubmitValidation(model: {
|
|
19
|
+
getStepParams?: (flowKey: string, stepKey: string) => {
|
|
20
|
+
skipValidator?: boolean;
|
|
21
|
+
} | undefined;
|
|
22
|
+
} | null | undefined): boolean;
|
|
23
|
+
export declare function validateSubmitForm(options: {
|
|
24
|
+
form?: {
|
|
25
|
+
validateFields?: (nameList?: any) => Promise<any>;
|
|
26
|
+
} | null;
|
|
27
|
+
blockModel?: FormBlockModel | null;
|
|
28
|
+
flowSettingsEnabled?: boolean;
|
|
29
|
+
skipValidator?: boolean;
|
|
30
|
+
}): Promise<void>;
|
|
10
31
|
/**
|
|
11
32
|
* 提交前过滤:移除当前表单 block 中被「联动规则隐藏」的字段值(`model.hidden === true`)。
|
|
12
33
|
*
|
|
@@ -11,6 +11,7 @@ import { DepCollector } from './deps';
|
|
|
11
11
|
import type { FormAssignRuleItem, FormValueWriteMeta, NamePath, Patch, SetOptions, ValueSource } from './types';
|
|
12
12
|
type ObservableBinding = {
|
|
13
13
|
source: ValueSource;
|
|
14
|
+
pathKey: string;
|
|
14
15
|
dispose: () => void;
|
|
15
16
|
};
|
|
16
17
|
export type RuleEngineOptions = {
|
|
@@ -83,6 +84,8 @@ export declare class RuleEngine {
|
|
|
83
84
|
private getUpdateAssociationForTargetPath;
|
|
84
85
|
private getDefaultRuleId;
|
|
85
86
|
private getModelTargetNamePath;
|
|
87
|
+
private getAssignTemplateTargetPathForModel;
|
|
88
|
+
private hasAssignTemplateForTargetPath;
|
|
86
89
|
private tryRegisterDefaultRuleInstance;
|
|
87
90
|
private getModelTargetPath;
|
|
88
91
|
private getAssignRuleInstanceId;
|
|
@@ -94,6 +97,7 @@ export declare class RuleEngine {
|
|
|
94
97
|
private tryUnregisterDefaultRuleInstance;
|
|
95
98
|
private bindMasterInitialValue;
|
|
96
99
|
private removeRule;
|
|
100
|
+
rescheduleAllRules(): void;
|
|
97
101
|
private scheduleRule;
|
|
98
102
|
private flushRules;
|
|
99
103
|
private runRule;
|
|
@@ -107,6 +111,10 @@ export declare class RuleEngine {
|
|
|
107
111
|
private normalizeResolvedValueForAssociationTarget;
|
|
108
112
|
private prepareRuleContext;
|
|
109
113
|
private shouldApplyDefaultRuleInCurrentState;
|
|
114
|
+
private isStaleToManyItemContext;
|
|
115
|
+
private getItemContext;
|
|
116
|
+
private getRowTargetKey;
|
|
117
|
+
private isMismatchedToManyItemContext;
|
|
110
118
|
private shouldRunRule;
|
|
111
119
|
private createRuleCollectorAndContext;
|
|
112
120
|
private evaluateRuleCondition;
|
|
@@ -51,11 +51,24 @@ export declare class FormValueRuntime {
|
|
|
51
51
|
sync?: boolean;
|
|
52
52
|
}): void;
|
|
53
53
|
dispose(): void;
|
|
54
|
+
resetAfterFormReset(): void;
|
|
54
55
|
isSuppressed(): boolean;
|
|
55
56
|
handleFormFieldsChange(changedFields: Array<{
|
|
56
57
|
name?: NamePath | string | number;
|
|
57
58
|
touched?: boolean;
|
|
58
59
|
}>): void;
|
|
60
|
+
private shouldIgnoreSyntheticTouchedInit;
|
|
61
|
+
private isDeletedArrayItemPath;
|
|
62
|
+
private pruneDeletedArrayItemState;
|
|
63
|
+
private getArrayItemTargetKey;
|
|
64
|
+
private getArrayItemIdentity;
|
|
65
|
+
private reconcileArrayItemState;
|
|
66
|
+
private getReconciledArrayItemPath;
|
|
67
|
+
private reconcileArrayItemSet;
|
|
68
|
+
private reconcileArrayItemMap;
|
|
69
|
+
private reconcileObservableBindings;
|
|
70
|
+
private getObservedChangedValue;
|
|
71
|
+
private getObservedSnapshot;
|
|
59
72
|
handleFormValuesChange(changedValues: any, allValues: any): void;
|
|
60
73
|
private deriveExplicitPaths;
|
|
61
74
|
private collectExplicitDiffPaths;
|
|
@@ -62,29 +62,7 @@ export declare class TableBlockModel extends CollectionBlockModel<TableBlockMode
|
|
|
62
62
|
};
|
|
63
63
|
renderCell: (checked: any, record: any, index: any, originNode: any) => any;
|
|
64
64
|
renderConfigureActions(): React.JSX.Element;
|
|
65
|
-
pagination():
|
|
66
|
-
current: number;
|
|
67
|
-
pageSize: number;
|
|
68
|
-
total: any;
|
|
69
|
-
showTotal: (total: any) => any;
|
|
70
|
-
showSizeChanger: boolean;
|
|
71
|
-
simple?: undefined;
|
|
72
|
-
showTitle?: undefined;
|
|
73
|
-
hideOnSinglePage?: undefined;
|
|
74
|
-
className?: undefined;
|
|
75
|
-
itemRender?: undefined;
|
|
76
|
-
} | {
|
|
77
|
-
simple: boolean;
|
|
78
|
-
showTitle: boolean;
|
|
79
|
-
showSizeChanger: boolean;
|
|
80
|
-
hideOnSinglePage: boolean;
|
|
81
|
-
pageSize: number;
|
|
82
|
-
total: number;
|
|
83
|
-
className: string;
|
|
84
|
-
itemRender: (_: any, type: any, originalElement: any) => any;
|
|
85
|
-
current?: undefined;
|
|
86
|
-
showTotal?: undefined;
|
|
87
|
-
};
|
|
65
|
+
pagination(): import("antd").PaginationProps;
|
|
88
66
|
renderComponent(): React.JSX.Element;
|
|
89
67
|
}
|
|
90
68
|
export {};
|
|
@@ -21,7 +21,9 @@ export declare class TableColumnModel extends DisplayItemModel {
|
|
|
21
21
|
afterAddAsSubModel(): Promise<void>;
|
|
22
22
|
renderHiddenInConfig(): React.ReactNode | undefined;
|
|
23
23
|
static defineChildren(ctx: FlowModelContext): any;
|
|
24
|
-
getColumnProps(): TableColumnProps
|
|
24
|
+
getColumnProps(): TableColumnProps & {
|
|
25
|
+
sortField?: string;
|
|
26
|
+
};
|
|
25
27
|
onInit(options: any): void;
|
|
26
28
|
renderItem(): any;
|
|
27
29
|
}
|
|
@@ -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
|
+
type AssociationTitleFieldModel = {
|
|
10
|
+
fieldPath?: string;
|
|
11
|
+
props?: {
|
|
12
|
+
dataIndex?: string;
|
|
13
|
+
titleField?: string;
|
|
14
|
+
};
|
|
15
|
+
collectionField?: {
|
|
16
|
+
name?: string;
|
|
17
|
+
targetCollectionTitleFieldName?: string;
|
|
18
|
+
isAssociationField?: () => boolean;
|
|
19
|
+
};
|
|
20
|
+
getStepParams?: (flowKey: string, stepKey: string) => {
|
|
21
|
+
label?: string;
|
|
22
|
+
} | undefined;
|
|
23
|
+
};
|
|
24
|
+
export declare function getSavedAssociationTitleField(model: AssociationTitleFieldModel): string;
|
|
25
|
+
export declare function getTableColumnSortField(model: AssociationTitleFieldModel): string;
|
|
26
|
+
export declare function resolveTableSorterField(sorter: {
|
|
27
|
+
field?: string;
|
|
28
|
+
column?: {
|
|
29
|
+
sortField?: string;
|
|
30
|
+
};
|
|
31
|
+
}): string;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
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 { FlowModel } from '@nocobase/flow-engine';
|
|
10
|
+
import type { HookAPI } from 'antd/es/modal/useModal';
|
|
11
|
+
type PopupBeforeClosePayload = {
|
|
12
|
+
result?: any;
|
|
13
|
+
force?: boolean;
|
|
14
|
+
ignoredDirtyFormModelUids?: string[];
|
|
15
|
+
};
|
|
16
|
+
type PopupViewLike = {
|
|
17
|
+
beforeClose?: (payload: PopupBeforeClosePayload) => Promise<boolean | void> | boolean | void;
|
|
18
|
+
};
|
|
19
|
+
export declare function bindPopupSubTableBeforeClose({ view, model, modal, t, }: {
|
|
20
|
+
view: PopupViewLike;
|
|
21
|
+
model?: FlowModel | null;
|
|
22
|
+
modal: Pick<HookAPI, 'confirm'>;
|
|
23
|
+
t: (key: string) => string;
|
|
24
|
+
}): () => void;
|
|
25
|
+
export {};
|
|
@@ -16,6 +16,16 @@ export declare function buildRecordPickerParentItemContext(ctx: any): {
|
|
|
16
16
|
parentItemResolver: ((subPath: string) => boolean) | undefined;
|
|
17
17
|
};
|
|
18
18
|
export declare function injectRecordPickerPopupContext(model: FlowModel, viewCtx: any, fieldModel?: any): void;
|
|
19
|
+
export declare function buildRecordPickerPopupContextInputArgs(ctx: any, options?: {
|
|
20
|
+
currentItemValue?: any;
|
|
21
|
+
extraInputArgs?: Record<string, any>;
|
|
22
|
+
}): {
|
|
23
|
+
parentItem: ItemChain;
|
|
24
|
+
parentItemMeta: any;
|
|
25
|
+
parentItemResolver: (subPath: string) => boolean;
|
|
26
|
+
currentItemValue: any;
|
|
27
|
+
openerUids: string[];
|
|
28
|
+
};
|
|
19
29
|
export declare function RecordPickerContent({ model, toOne }: {
|
|
20
30
|
model: any;
|
|
21
31
|
toOne?: boolean;
|
|
@@ -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
|
+
type FilterTargetKey = string | string[] | null | undefined;
|
|
10
|
+
type SubTableRow = {
|
|
11
|
+
__is_new__?: boolean;
|
|
12
|
+
id?: any;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
};
|
|
15
|
+
export declare const SUB_TABLE_TEMP_ROW_KEY = "__index__";
|
|
16
|
+
export declare function getSubTableRowIdentity(record: SubTableRow, filterTargetKey: FilterTargetKey): string;
|
|
17
|
+
export declare function normalizeSubTableRows(rows: SubTableRow[]): SubTableRow[];
|
|
18
|
+
export {};
|
|
@@ -46,6 +46,8 @@ export declare function createItemChainMetaFactory(options: {
|
|
|
46
46
|
title: string;
|
|
47
47
|
showIndex?: boolean;
|
|
48
48
|
showParentIndex?: boolean;
|
|
49
|
+
disableValueBranch?: boolean;
|
|
50
|
+
valueBranchDisabledReason?: string;
|
|
49
51
|
collectionAccessor: () => any;
|
|
50
52
|
propertiesAccessor: (ctx: any) => any;
|
|
51
53
|
parentCollectionAccessor?: () => any;
|
|
@@ -54,6 +56,7 @@ export declare function createItemChainMetaFactory(options: {
|
|
|
54
56
|
}): any;
|
|
55
57
|
export declare function createItemChainResolver(options: {
|
|
56
58
|
collectionAccessor: () => any;
|
|
59
|
+
disableValueBranch?: boolean;
|
|
57
60
|
propertiesAccessor?: () => unknown;
|
|
58
61
|
parentCollectionAccessor?: () => any;
|
|
59
62
|
parentPropertiesAccessor?: () => unknown;
|
|
@@ -72,6 +75,8 @@ export type AssociationItemChainContextPropertyOptions = {
|
|
|
72
75
|
title: string;
|
|
73
76
|
showIndex?: boolean;
|
|
74
77
|
showParentIndex?: boolean;
|
|
78
|
+
disableValueBranch?: boolean;
|
|
79
|
+
valueBranchDisabledReason?: string;
|
|
75
80
|
collectionAccessor: () => any;
|
|
76
81
|
propertiesAccessor: (ctx: any) => any;
|
|
77
82
|
resolverPropertiesAccessor?: () => unknown;
|
|
@@ -13,6 +13,7 @@ export interface AssociationFieldNames {
|
|
|
13
13
|
label: string;
|
|
14
14
|
value: string;
|
|
15
15
|
}
|
|
16
|
+
export declare function normalizeAssociationFieldNames(fieldNames: Partial<AssociationFieldNames> | undefined, targetCollection?: any): AssociationFieldNames;
|
|
16
17
|
export type AssociationOption = Record<string, any>;
|
|
17
18
|
export type PopupScrollEvent = Parameters<NonNullable<SelectProps<any>['onPopupScroll']>>[0];
|
|
18
19
|
export declare function buildOpenerUids(ctx: FlowRuntimeContext, inputArgs?: Record<string, unknown>): string[];
|
|
@@ -43,17 +44,5 @@ export interface LabelByFieldProps {
|
|
|
43
44
|
fieldNames: AssociationFieldNames;
|
|
44
45
|
}
|
|
45
46
|
export declare function LabelByField(props: Readonly<LabelByFieldProps>): React.JSX.Element;
|
|
46
|
-
export declare function toSelectValue(record: AssociationOption | AssociationOption[] | string | string[] | number | number[] | undefined, fieldNames: AssociationFieldNames, multiple?: boolean, valueMode?: 'record' | 'value', options?: AssociationOption[]):
|
|
47
|
-
label: React.JSX.Element;
|
|
48
|
-
value: any;
|
|
49
|
-
} | {
|
|
50
|
-
label: string | number | AssociationOption;
|
|
51
|
-
value: string | number | AssociationOption;
|
|
52
|
-
} | ({
|
|
53
|
-
label: React.JSX.Element;
|
|
54
|
-
value: any;
|
|
55
|
-
} | {
|
|
56
|
-
label: string | number | AssociationOption;
|
|
57
|
-
value: string | number | AssociationOption;
|
|
58
|
-
})[];
|
|
47
|
+
export declare function toSelectValue(record: AssociationOption | AssociationOption[] | string | string[] | number | number[] | undefined, fieldNames: AssociationFieldNames, multiple?: boolean, valueMode?: 'record' | 'value', options?: AssociationOption[]): any;
|
|
59
48
|
export declare function resolveOptions(options: AssociationOption[] | undefined, value: AssociationOption | AssociationOption[] | string | string[] | number | number[] | undefined, isMultiple: boolean): AssociationOption[];
|
|
@@ -0,0 +1,14 @@
|
|
|
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 normalizeFieldIndexChain: (fieldIndex: unknown) => string[];
|
|
10
|
+
export declare const buildDisplaySubListForkKey: ({ parentFieldIndex, index, blockPage, }: {
|
|
11
|
+
parentFieldIndex: string[];
|
|
12
|
+
index: number;
|
|
13
|
+
blockPage: number;
|
|
14
|
+
}) => string;
|
|
@@ -9,5 +9,6 @@
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import { ClickableFieldModel } from './ClickableFieldModel';
|
|
11
11
|
export declare class DisplayTextFieldModel extends ClickableFieldModel {
|
|
12
|
+
t(value: string | undefined | null): any;
|
|
12
13
|
renderComponent(value: any, wrap: any): React.JSX.Element;
|
|
13
14
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
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 CapabilityCollection = {
|
|
10
|
+
options?: Record<string, any>;
|
|
11
|
+
};
|
|
12
|
+
type CapabilityModelClass = {
|
|
13
|
+
prototype?: {
|
|
14
|
+
getAclActionName?: () => string | null | undefined;
|
|
15
|
+
};
|
|
16
|
+
capabilityActionName?: string | null;
|
|
17
|
+
capabilityActionNames?: string[] | null;
|
|
18
|
+
blockCapabilityActionName?: string | null;
|
|
19
|
+
blockCapabilityActionNames?: string[] | null;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* 统一动作能力名,保证 v2 与 v1 使用同一套数据源动作键。
|
|
23
|
+
*
|
|
24
|
+
* @param actionName 动作名
|
|
25
|
+
* @returns 归一化后的动作能力名
|
|
26
|
+
*/
|
|
27
|
+
export declare const normalizeCapabilityActionName: (actionName?: string | null) => string;
|
|
28
|
+
/**
|
|
29
|
+
* 判断 collection 是否支持指定动作能力。
|
|
30
|
+
*
|
|
31
|
+
* @param collection 数据表
|
|
32
|
+
* @param capabilityName 动作能力键
|
|
33
|
+
* @returns 是否支持
|
|
34
|
+
*/
|
|
35
|
+
export declare const isCapabilitySupported: (collection: CapabilityCollection | null | undefined, capabilityName?: string | null) => boolean;
|
|
36
|
+
/**
|
|
37
|
+
* 判断 collection 是否支持一组动作能力。
|
|
38
|
+
*
|
|
39
|
+
* @param collection 数据表
|
|
40
|
+
* @param capabilityNames 动作能力键数组
|
|
41
|
+
* @returns 是否全部支持
|
|
42
|
+
*/
|
|
43
|
+
export declare const areCapabilitiesSupported: (collection: CapabilityCollection | null | undefined, capabilityNames?: Array<string | null | undefined> | null) => boolean;
|
|
44
|
+
/**
|
|
45
|
+
* 推导动作模型使用的数据源动作能力键。
|
|
46
|
+
* 默认会回落到 getAclActionName,但允许通过静态字段显式覆写。
|
|
47
|
+
*
|
|
48
|
+
* @param ModelClass 动作模型类
|
|
49
|
+
* @returns 动作能力键数组或 null
|
|
50
|
+
*/
|
|
51
|
+
export declare const getActionCapabilityNamesFromModelClass: (ModelClass: CapabilityModelClass) => string[];
|
|
52
|
+
/**
|
|
53
|
+
* 推导区块模型在“选择 collection”时需要满足的数据源动作能力键。
|
|
54
|
+
* 仅对显式声明的区块生效,避免误把所有区块都套上 view/create/update 过滤。
|
|
55
|
+
*
|
|
56
|
+
* @param ModelClass 区块模型类
|
|
57
|
+
* @returns 动作能力键数组或 null
|
|
58
|
+
*/
|
|
59
|
+
export declare const getBlockCapabilityNamesFromModelClass: (ModelClass: CapabilityModelClass) => string[];
|
|
60
|
+
export {};
|
package/es/flow/utils/index.d.ts
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
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 { PaginationProps } from 'antd';
|
|
10
|
+
/**
|
|
11
|
+
* 计算未知总数场景下的 Pagination total:
|
|
12
|
+
* - 本页不足 pageSize 或 hasNext=false,说明到末页
|
|
13
|
+
* - 否则用 +1 触发“还有下一页”
|
|
14
|
+
*/
|
|
15
|
+
export declare const getUnknownCountPaginationTotal: (options: {
|
|
16
|
+
dataLength?: number;
|
|
17
|
+
pageSize?: number;
|
|
18
|
+
current?: number;
|
|
19
|
+
hasNext?: boolean;
|
|
20
|
+
}) => number;
|
|
21
|
+
export declare const getSimpleModePaginationClassName: (withLineHeight?: boolean) => string;
|
|
22
|
+
export declare const getMobileCompactPaginationClassName: () => string;
|
|
23
|
+
export declare const mergePaginationClassName: (...classNames: Array<string | undefined | false>) => string;
|
|
24
|
+
export declare const createCompactSimpleItemRender: (options: {
|
|
25
|
+
current?: number;
|
|
26
|
+
controlHeight?: number;
|
|
27
|
+
currentTextMarginLeft?: number;
|
|
28
|
+
}) => PaginationProps['itemRender'];
|
|
29
|
+
export declare const applyMobilePaginationProps: <T extends PaginationProps>(pagination: T, isMobileLayout: boolean) => PaginationProps;
|
package/es/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:var(--colorBgScrollTrack)}::-webkit-scrollbar-thumb{background:var(--colorBgScrollBar);border-radius:4px}::-webkit-scrollbar-thumb:hover{background:var(--colorBgScrollBarHover)}::-webkit-scrollbar-thumb:active{background:var(--colorBgScrollBarActive)}.rc-virtual-list-scrollbar-thumb{background:var(--colorBgScrollBar)!important}.rc-virtual-list-scrollbar-thumb:hover{background:var(--colorBgScrollBarHover)!important}.rc-virtual-list-scrollbar-thumb:active{background:var(--colorBgScrollBarActive)!important}.ant-menu-submenu-popup{-webkit-backdrop-filter:none;backdrop-filter:none}.ant-menu-item.ant-menu-item-only-child.ant-pro-base-menu-horizontal-menu-item:active{background-color:var(--colorBgMenuItemSelected)!important}.nb-hidden{display:none}.nb-dialog-overflow-hidden .ant-modal-content{overflow:hidden}.ant-layout-sider .ant-menu{background:var(--colorBgSider)!important}.ant-layout-sider .ant-menu .ant-menu-item{color:var(--colorTextSiderMenu)!important}.ant-layout-sider .ant-menu .ant-menu-item:hover{background-color:var(--colorBgSiderMenuHover)!important;color:var(--colorTextSiderMenuHover)!important}.ant-layout-sider .ant-menu .ant-menu-item:active{background-color:var(--colorBgSiderMenuActive)!important}.ant-layout-sider .ant-menu .ant-menu-item.ant-menu-item-selected{background-color:var(--colorBgSiderMenuActive)!important;color:var(--colorTextSiderMenuActive)!important}.ant-layout-sider .ant-menu .ant-menu-submenu .ant-menu-submenu-title{color:var(--colorTextSiderMenu)!important}.ant-layout-sider .ant-menu .ant-menu-submenu .ant-menu-submenu-title:hover{background-color:var(--colorBgSiderMenuHover)!important;color:var(--colorTextSiderMenuHover)!important}.ant-layout-sider .ant-menu .ant-menu-submenu.ant-menu-submenu-selected .ant-menu-submenu-title{color:var(--
|
|
1
|
+
::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:var(--colorBgScrollTrack)}::-webkit-scrollbar-thumb{background:var(--colorBgScrollBar);border-radius:4px}::-webkit-scrollbar-thumb:hover{background:var(--colorBgScrollBarHover)}::-webkit-scrollbar-thumb:active{background:var(--colorBgScrollBarActive)}.rc-virtual-list-scrollbar-thumb{background:var(--colorBgScrollBar)!important}.rc-virtual-list-scrollbar-thumb:hover{background:var(--colorBgScrollBarHover)!important}.rc-virtual-list-scrollbar-thumb:active{background:var(--colorBgScrollBarActive)!important}.ant-menu-submenu-popup{-webkit-backdrop-filter:none;backdrop-filter:none}.ant-menu-item.ant-menu-item-only-child.ant-pro-base-menu-horizontal-menu-item:active{background-color:var(--colorBgMenuItemSelected)!important}.nb-hidden{display:none}.nb-dialog-overflow-hidden .ant-modal-content{overflow:hidden}.ant-layout-sider .ant-menu{background:var(--colorBgSider)!important}.ant-layout-sider .ant-menu .ant-menu-item{color:var(--colorTextSiderMenu)!important}.ant-layout-sider .ant-menu .ant-menu-item:hover{background-color:var(--colorBgSiderMenuHover)!important;color:var(--colorTextSiderMenuHover)!important}.ant-layout-sider .ant-menu .ant-menu-item:active{background-color:var(--colorBgSiderMenuActive)!important}.ant-layout-sider .ant-menu .ant-menu-item.ant-menu-item-selected{background-color:var(--colorBgSiderMenuActive)!important;color:var(--colorTextSiderMenuActive)!important}.ant-layout-sider .ant-menu .ant-menu-submenu .ant-menu-submenu-title{color:var(--colorTextSiderMenu)!important}.ant-layout-sider .ant-menu .ant-menu-submenu .ant-menu-submenu-title:hover{background-color:var(--colorBgSiderMenuHover)!important;color:var(--colorTextSiderMenuHover)!important}.ant-layout-sider .ant-menu .ant-menu-submenu.ant-menu-submenu-selected .ant-menu-submenu-title{color:var(--colorTextSiderMenu)!important}.ant-layout-sider .ant-menu .ant-menu-submenu.ant-menu-submenu-selected .ant-menu-submenu-title:hover{background-color:var(--colorBgSiderMenuHover)!important;color:var(--colorTextSiderMenuHover)!important}.ant-layout-sider .ant-menu .ant-menu-submenu.ant-menu-submenu-selected.ant-menu-submenu-selected>.ant-menu-submenu-title{color:var(--colorTextSiderMenuActive)!important}.ant-btn.ant-btn-danger{text-shadow:none;box-shadow:none}.ant-formily-item-label{color:#000000d9;font-weight:600}.ant-table-pagination.ant-pagination{margin-bottom:0!important}.ant-formily-item{font-size:inherit!important}.ant-formily-item-bordered-none .ant-formily-item-feedback-layout-loose{margin-bottom:0!important}.ant-formily-item-control-content-component .ant-tag{white-space:pre-wrap}html body{--adm-font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"}
|