@nocobase/client 2.1.0-beta.13 → 2.1.0-beta.15
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/es/block-provider/BlockProvider.d.ts +1 -0
- package/es/flow/components/FieldAssignValueInput.d.ts +23 -4
- package/es/flow/models/blocks/form/submitValues.d.ts +13 -0
- package/es/flow/models/blocks/form/value-runtime/rules.d.ts +1 -0
- package/es/flow/models/blocks/form/value-runtime/runtime.d.ts +1 -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/itemChain.d.ts +5 -0
- package/es/flow/models/fields/AssociationFieldModel/recordSelectShared.d.ts +2 -13
- package/es/index.mjs +7286 -6956
- package/lib/index.js +177 -191
- package/lib/locale/de-DE.json +2 -1
- package/lib/locale/en-US.json +1 -0
- package/lib/locale/es-ES.json +2 -1
- package/lib/locale/fr-FR.json +2 -1
- package/lib/locale/hu-HU.json +2 -1
- package/lib/locale/id-ID.json +2 -1
- package/lib/locale/it-IT.json +2 -1
- package/lib/locale/ja-JP.json +2 -1
- package/lib/locale/ko-KR.json +2 -1
- package/lib/locale/nl-NL.json +2 -1
- package/lib/locale/pt-BR.json +2 -1
- package/lib/locale/ru-RU.json +2 -1
- package/lib/locale/tr-TR.json +2 -1
- package/lib/locale/uk-UA.json +2 -1
- package/lib/locale/vi-VN.json +2 -1
- package/lib/locale/zh-CN.json +1 -0
- package/lib/locale/zh-TW.json +2 -1
- package/package.json +7 -7
|
@@ -102,6 +102,7 @@ export declare const BlockProvider: (props: {
|
|
|
102
102
|
* @returns
|
|
103
103
|
*/
|
|
104
104
|
export declare const useBlockAssociationContext: () => any;
|
|
105
|
+
export declare const getFilterByTkByCollection: (collection: any, recordData: Record<string, any>) => any;
|
|
105
106
|
export declare const useFilterByTk: (blockProps?: any) => any;
|
|
106
107
|
/**
|
|
107
108
|
* @deprecated
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import { dayjs } from '@nocobase/utils/client';
|
|
11
|
-
import { type MetaTreeNode } from '@nocobase/flow-engine';
|
|
11
|
+
import { type CollectionField, type MetaTreeNode } from '@nocobase/flow-engine';
|
|
12
12
|
import { type ExactDatePickerMode } from './FieldAssignExactDatePicker';
|
|
13
13
|
export type DateVariableExactNormalizeMode = 'none' | 'date' | 'datetimeNoTz' | 'iso';
|
|
14
14
|
export declare function toExactPickerDisplayValue(rawValue: unknown, options: {
|
|
@@ -55,11 +55,30 @@ interface Props {
|
|
|
55
55
|
}
|
|
56
56
|
export declare function mergeItemMetaTreeForAssignValue(baseTree: MetaTreeNode[], extraTree: MetaTreeNode[]): MetaTreeNode[];
|
|
57
57
|
export declare function resolveAssignValueFieldPath(itemModel: any): string | undefined;
|
|
58
|
-
|
|
58
|
+
type AssignValueFieldSettingsInit = {
|
|
59
|
+
dataSourceKey?: string;
|
|
60
|
+
collectionName?: string;
|
|
61
|
+
fieldPath?: string;
|
|
62
|
+
};
|
|
63
|
+
type AssignValueFieldSource = {
|
|
64
|
+
originFieldModel?: any;
|
|
65
|
+
originProps: Record<string, any>;
|
|
66
|
+
customFieldName?: string;
|
|
67
|
+
customFieldProps: Record<string, any>;
|
|
68
|
+
currentAllowMultiple?: boolean;
|
|
69
|
+
currentFieldModelUse?: string;
|
|
70
|
+
};
|
|
71
|
+
export declare function resolveAssignValueFieldModelConfig(options: {
|
|
59
72
|
itemModel: any;
|
|
60
|
-
|
|
73
|
+
defaultBindingUse?: string;
|
|
74
|
+
collectionField?: Pick<CollectionField, 'isAssociationField'> | null;
|
|
75
|
+
fieldSource?: AssignValueFieldSource;
|
|
61
76
|
preferFormItemFieldModel?: boolean;
|
|
62
|
-
|
|
77
|
+
fieldSettingsInit?: AssignValueFieldSettingsInit;
|
|
78
|
+
}): {
|
|
79
|
+
use?: string;
|
|
80
|
+
stepParams: Record<string, any>;
|
|
81
|
+
};
|
|
63
82
|
/**
|
|
64
83
|
* 根据所选字段渲染对应的赋值编辑器:
|
|
65
84
|
* - 使用临时的 VariableFieldFormModel 包裹字段模型,确保常量编辑为真实字段组件
|
|
@@ -15,6 +15,19 @@ import type { FormBlockModel } from './FormBlockModel';
|
|
|
15
15
|
* - 返回 null 表示无法安全推断,调用方应回退到 `validateFields()` 全量校验。
|
|
16
16
|
*/
|
|
17
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>;
|
|
18
31
|
/**
|
|
19
32
|
* 提交前过滤:移除当前表单 block 中被「联动规则隐藏」的字段值(`model.hidden === true`)。
|
|
20
33
|
*
|
|
@@ -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;
|
|
@@ -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[];
|