@nocobase/client 0.14.0-alpha.6 → 0.14.0-alpha.7
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/application/utils/remotePlugins.d.ts +2 -2
- package/es/block-provider/BlockProvider.d.ts +21 -3
- package/es/block-provider/hooks/index.d.ts +2 -1
- package/es/block-provider/hooks/useFormActiveFields.d.ts +18 -0
- package/es/collection-manager/Configuration/SyncSQLFieldsAction.d.ts +4 -0
- package/es/collection-manager/Configuration/index.d.ts +1 -0
- package/es/collection-manager/hooks/useCollection.d.ts +23 -9
- package/es/collection-manager/hooks/useCollectionManager.d.ts +7 -7
- package/es/collection-manager/interfaces/properties/operators.d.ts +9 -0
- package/es/collection-manager/interfaces/types.d.ts +15 -3
- package/es/collection-manager/templates/components/sql-collection/FieldsConfigure.d.ts +2 -0
- package/es/collection-manager/templates/components/sql-collection/PreviewTable.d.ts +2 -0
- package/es/collection-manager/templates/components/sql-collection/SQLInput.d.ts +4 -0
- package/es/collection-manager/templates/components/sql-collection/SQLRequestProvider.d.ts +4 -0
- package/es/collection-manager/templates/components/sql-collection/index.d.ts +4 -0
- package/es/collection-manager/templates/index.d.ts +1 -0
- package/es/collection-manager/templates/sql.d.ts +2 -0
- package/es/collection-manager/types.d.ts +46 -19
- package/es/filter-provider/FilterProvider.d.ts +3 -2
- package/es/filter-provider/utils.d.ts +1 -1
- package/es/flag-provider/FlagProvider.d.ts +18 -0
- package/es/flag-provider/hooks/useFlag.d.ts +1 -0
- package/es/flag-provider/index.d.ts +2 -0
- package/es/hooks/useMenuItem.d.ts +1 -1
- package/es/index.mjs +20442 -18038
- package/es/locale/en_US.d.ts +364 -360
- package/es/locale/ja_JP.d.ts +1 -0
- package/es/locale/zh_CN.d.ts +33 -28
- package/es/schema-component/antd/action/utils.d.ts +9 -1
- package/es/schema-component/antd/association-field/InternalCascadeSelect.d.ts +3 -0
- package/es/schema-component/antd/association-field/util.d.ts +5 -6
- package/es/schema-component/antd/date-picker/util.d.ts +10 -4
- package/es/schema-component/antd/filter/DynamicComponent.d.ts +18 -1
- package/es/schema-component/antd/filter/context.d.ts +3 -1
- package/es/schema-component/antd/filter/useValues.d.ts +14 -1
- package/es/schema-component/antd/form-item/FormItem.d.ts +1 -4
- package/es/schema-component/antd/form-item/hooks/useLazyLoadAssociationFieldOfForm.d.ts +5 -0
- package/es/schema-component/antd/form-item/hooks/useLazyLoadAssociationFieldOfSubForm.d.ts +5 -0
- package/es/schema-component/antd/form-item/hooks/useParseDefaultValue.d.ts +5 -0
- package/es/schema-component/antd/form-item/hooks/useSpecialCase.d.ts +62 -0
- package/es/schema-component/antd/form-v2/utils.d.ts +13 -2
- package/es/schema-component/antd/table-v2/Table.Column.Decorator.d.ts +1 -1
- package/es/schema-component/antd/table-v2/index.d.ts +0 -1
- package/es/schema-component/antd/table-v2/utils.d.ts +0 -5
- package/es/schema-component/antd/variable/Variable.d.ts +0 -2
- package/es/schema-component/common/utils/uitls.d.ts +7 -3
- package/es/schema-component/hooks/useCompile.d.ts +8 -1
- package/es/schema-initializer/SchemaInitializer.d.ts +0 -2
- package/es/schema-initializer/{SelectCollection.d.ts → SearchCollections.d.ts} +1 -1
- package/es/schema-initializer/buttons/BlockInitializers.d.ts +1 -0
- package/es/schema-initializer/buttons/CalendarActionInitializers.d.ts +1 -0
- package/es/schema-initializer/buttons/CalendarFormActionInitializers.d.ts +1 -0
- package/es/schema-initializer/buttons/DetailsActionInitializers.d.ts +1 -0
- package/es/schema-initializer/buttons/FilterFormActionInitializers.d.ts +1 -0
- package/es/schema-initializer/buttons/FormActionInitializers.d.ts +4 -0
- package/es/schema-initializer/buttons/GanttActionInitializers.d.ts +1 -0
- package/es/schema-initializer/buttons/GridCardActionInitializers.d.ts +2 -0
- package/es/schema-initializer/buttons/KanbanActionInitializers.d.ts +1 -0
- package/es/schema-initializer/buttons/ListActionInitializers.d.ts +2 -0
- package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.d.ts +1 -0
- package/es/schema-initializer/buttons/SubTableActionInitializers.d.ts +1 -0
- package/es/schema-initializer/buttons/TableActionInitializers.d.ts +1 -0
- package/es/schema-initializer/components/assigned-field/AssignedField.d.ts +7 -1
- package/es/schema-initializer/types.d.ts +6 -0
- package/es/schema-initializer/utils.d.ts +10 -16
- package/es/schema-settings/DataTemplates/hooks/useCollectionState.d.ts +1 -1
- package/es/schema-settings/EnableChildCollections/DynamicComponent.d.ts +0 -1
- package/es/schema-settings/LinkageRules/LinkageRuleActionGroup.d.ts +9 -1
- package/es/schema-settings/LinkageRules/ValueDynamicComponent.d.ts +8 -1
- package/es/schema-settings/LinkageRules/index.d.ts +17 -1
- package/es/schema-settings/SchemaSettings.d.ts +19 -1
- package/es/schema-settings/VariableInput/VariableInput.d.ts +75 -6
- package/es/schema-settings/VariableInput/hooks/useBaseVariable.d.ts +46 -0
- package/es/schema-settings/VariableInput/hooks/useBlockCollection.d.ts +3 -0
- package/es/schema-settings/VariableInput/hooks/useDateVariable.d.ts +16 -3
- package/es/schema-settings/VariableInput/hooks/useFormVariable.d.ts +16 -16
- package/es/schema-settings/VariableInput/hooks/useIterationVariable.d.ts +13 -16
- package/es/schema-settings/VariableInput/hooks/useRecordVariable.d.ts +12 -0
- package/es/schema-settings/VariableInput/hooks/useUserVariable.d.ts +14 -4
- package/es/schema-settings/VariableInput/hooks/useVariableOptions.d.ts +32 -11
- package/es/schema-settings/VariableInput/type.d.ts +1 -0
- package/es/schema-settings/VariableInput/utils/formatVariableScop.d.ts +2 -0
- package/es/schema-settings/hooks/useIsAllowToSetDefaultValue.d.ts +31 -0
- package/es/schema-settings/hooks/useParseDataScopeFilter.d.ts +11 -0
- package/es/schema-settings/index.d.ts +2 -0
- package/es/schema-settings/types.d.ts +34 -0
- package/es/variables/VariablesProvider.d.ts +10 -0
- package/es/variables/constants.d.ts +1 -0
- package/es/variables/hooks/useBuiltinVariables.d.ts +5 -0
- package/es/variables/hooks/useContextVariable.d.ts +3 -0
- package/es/variables/hooks/useLocalVariables.d.ts +14 -0
- package/es/variables/hooks/useVariables.d.ts +2 -0
- package/es/variables/index.d.ts +6 -0
- package/es/variables/types.d.ts +68 -0
- package/es/variables/utils/filterEmptyValues.d.ts +1 -0
- package/es/variables/utils/getAction.d.ts +1 -0
- package/es/variables/utils/getPath.d.ts +6 -0
- package/es/variables/utils/getVariableName.d.ts +6 -0
- package/es/variables/utils/hasRequested.d.ts +9 -0
- package/es/variables/utils/isVariable.d.ts +2 -0
- package/es/variables/utils/transformVariableValue.d.ts +12 -0
- package/es/variables/utils/uniq.d.ts +6 -0
- package/lib/index.js +21037 -18633
- package/lib/locale/en_US.js +117 -113
- package/lib/locale/ja_JP.js +1 -0
- package/lib/locale/zh_CN.js +19 -14
- package/package.json +5 -5
- package/es/schema-component/antd/table-v2/FilterDynamicComponent.d.ts +0 -2
- package/es/schema-settings/LinkageRules/FilterDynamicComponent.d.ts +0 -9
- /package/es/{test → testUtils}/AppContextProvider.d.ts +0 -0
- /package/es/{test → testUtils}/collections.d.ts +0 -0
- /package/es/{test → testUtils}/index.d.ts +0 -0
- /package/es/{test → testUtils}/mainCollections.d.ts +0 -0
- /package/es/{test → testUtils}/mockAPIClient.d.ts +0 -0
|
@@ -3,11 +3,11 @@ import type { PluginData } from '../PluginManager';
|
|
|
3
3
|
import type { RequireJS } from './requirejs';
|
|
4
4
|
import type { DevDynamicImport } from '../Application';
|
|
5
5
|
export declare function defineDevPlugins(plugins: Record<string, typeof Plugin>): void;
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function definePluginClient(packageName: string): void;
|
|
7
|
+
export declare function getRemotePlugins(requirejs: any, pluginData?: PluginData[]): Promise<Array<typeof Plugin>>;
|
|
7
8
|
interface GetPluginsOption {
|
|
8
9
|
requirejs: RequireJS;
|
|
9
10
|
pluginData: PluginData[];
|
|
10
|
-
baseURL?: string;
|
|
11
11
|
devDynamicImport?: DevDynamicImport;
|
|
12
12
|
}
|
|
13
13
|
export declare function getPlugins(options: GetPluginsOption): Promise<Array<typeof Plugin>>;
|
|
@@ -1,13 +1,31 @@
|
|
|
1
|
+
import { GeneralField } from '@formily/core';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
export declare const BlockResourceContext: React.Context<any>;
|
|
3
4
|
export declare const BlockAssociationContext: React.Context<any>;
|
|
4
|
-
export declare const BlockRequestContext: React.Context<
|
|
5
|
+
export declare const BlockRequestContext: React.Context<{
|
|
6
|
+
block?: string;
|
|
7
|
+
props?: any;
|
|
8
|
+
field?: GeneralField;
|
|
9
|
+
service?: any;
|
|
10
|
+
resource?: any;
|
|
11
|
+
allowedActions?: any;
|
|
12
|
+
__parent?: any;
|
|
13
|
+
updateAssociationValues?: any[];
|
|
14
|
+
}>;
|
|
5
15
|
export declare const useBlockResource: () => any;
|
|
6
16
|
export declare const useAssociation: (props: any) => import("../").CollectionFieldOptions;
|
|
7
|
-
export declare const useResourceAction: (props: any, opts?: {}) => import("ahooks/lib/useRequest/src/types").Result<unknown, any[]>;
|
|
8
17
|
export declare const MaybeCollectionProvider: (props: any) => any;
|
|
9
18
|
export declare const BlockRequestProvider: (props: any) => React.JSX.Element;
|
|
10
|
-
export declare const useBlockRequestContext: () =>
|
|
19
|
+
export declare const useBlockRequestContext: () => {
|
|
20
|
+
block?: string;
|
|
21
|
+
props?: any;
|
|
22
|
+
field?: GeneralField;
|
|
23
|
+
service?: any;
|
|
24
|
+
resource?: any;
|
|
25
|
+
allowedActions?: any;
|
|
26
|
+
__parent?: any;
|
|
27
|
+
updateAssociationValues?: any[];
|
|
28
|
+
};
|
|
11
29
|
export declare const RenderChildrenWithAssociationFilter: React.FC<any>;
|
|
12
30
|
export declare const BlockProvider: (props: any) => React.JSX.Element;
|
|
13
31
|
export declare const useBlockAssociationContext: () => any;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ChangeEvent } from 'react';
|
|
2
|
+
export * from './useFormActiveFields';
|
|
2
3
|
export declare const usePickActionProps: () => {
|
|
3
4
|
onClick(): void;
|
|
4
5
|
};
|
|
@@ -77,7 +78,7 @@ export declare const useAssociationFilterProps: () => {
|
|
|
77
78
|
params: any;
|
|
78
79
|
run: (...params: any) => void;
|
|
79
80
|
};
|
|
80
|
-
export declare const useOptionalFieldList: () =>
|
|
81
|
+
export declare const useOptionalFieldList: () => any[];
|
|
81
82
|
export declare const useAssociationFilterBlockProps: () => {
|
|
82
83
|
/** 渲染 Collapse 的列表数据 */
|
|
83
84
|
list?: undefined;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface FormActiveFieldsProviderValue {
|
|
3
|
+
getActiveFieldsName: (name: string) => string[];
|
|
4
|
+
addActiveFieldName: (fieldName: string) => void;
|
|
5
|
+
removeActiveFieldName: (fieldName: string) => void;
|
|
6
|
+
name: string;
|
|
7
|
+
parent: FormActiveFieldsProviderValue;
|
|
8
|
+
}
|
|
9
|
+
interface ProviderProps extends Partial<FormActiveFieldsProviderValue> {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const FormActiveFieldsProvider: ({ children, name, getActiveFieldsName, addActiveFieldName, removeActiveFieldName, }: ProviderProps) => React.JSX.Element;
|
|
13
|
+
/**
|
|
14
|
+
* 用于获取和更新当前表单区块中已显示出来的字段
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
export declare const useFormActiveFields: () => FormActiveFieldsProviderValue;
|
|
18
|
+
export {};
|
|
@@ -4,19 +4,33 @@ export type Collection = ReturnType<typeof useCollection>;
|
|
|
4
4
|
export declare const useCollection: () => {
|
|
5
5
|
resource: import("@nocobase/sdk").IResource;
|
|
6
6
|
getField(name: SchemaKey): CollectionFieldOptions | undefined;
|
|
7
|
-
getTreeParentField():
|
|
8
|
-
fields:
|
|
7
|
+
getTreeParentField(): any;
|
|
8
|
+
fields: any[];
|
|
9
9
|
getPrimaryKey: () => any;
|
|
10
|
-
currentFields:
|
|
10
|
+
currentFields: any[];
|
|
11
11
|
inheritedFields: any[];
|
|
12
|
-
foreignKeyFields:
|
|
13
|
-
name
|
|
12
|
+
foreignKeyFields: any[];
|
|
13
|
+
name: string;
|
|
14
14
|
title?: string;
|
|
15
|
+
namespace?: string;
|
|
16
|
+
duplicator?: ("required" | "optional" | "skip") | {
|
|
17
|
+
dumpable: "required" | "optional" | "skip";
|
|
18
|
+
with?: string | string[];
|
|
19
|
+
delayRestore?: any;
|
|
20
|
+
};
|
|
21
|
+
tableName?: string;
|
|
22
|
+
inherits?: string | string[];
|
|
23
|
+
viewName?: string;
|
|
24
|
+
writableView?: boolean;
|
|
15
25
|
filterTargetKey?: string;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
26
|
+
model?: any;
|
|
27
|
+
repository?: any;
|
|
28
|
+
sortable?: string | boolean | {
|
|
29
|
+
name?: string;
|
|
30
|
+
scopeKey?: string;
|
|
31
|
+
};
|
|
32
|
+
autoGenId?: boolean;
|
|
33
|
+
magicAttribute?: string;
|
|
19
34
|
tree?: string;
|
|
20
35
|
template?: string;
|
|
21
|
-
writableView?: boolean;
|
|
22
36
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { CollectionFieldOptions } from '../types';
|
|
1
|
+
import { CollectionFieldOptions, CollectionOptions } from '../types';
|
|
2
2
|
export declare const useCollectionManager: () => {
|
|
3
3
|
service: any;
|
|
4
4
|
interfaces: any;
|
|
5
|
-
collections:
|
|
5
|
+
collections: CollectionOptions[];
|
|
6
6
|
getInheritCollections: (name: any) => any[];
|
|
7
7
|
getChildrenCollections: (name: any, isSupportView?: boolean) => any[];
|
|
8
8
|
refreshCM: () => Promise<void>;
|
|
9
9
|
updateCollection: (collection: any) => void;
|
|
10
|
-
get(name: string):
|
|
10
|
+
get(name: string): CollectionOptions;
|
|
11
11
|
getInheritedFields: (name: any) => any[];
|
|
12
12
|
getCollectionField: (name: string) => CollectionFieldOptions;
|
|
13
13
|
getCollectionFields: (name: any) => CollectionFieldOptions[];
|
|
@@ -37,12 +37,12 @@ export declare const useCollectionManager: () => {
|
|
|
37
37
|
*/
|
|
38
38
|
usePrefix?: boolean;
|
|
39
39
|
}) => any;
|
|
40
|
-
getCurrentCollectionFields: (name: string) => any;
|
|
41
|
-
getCollection: (name: any) =>
|
|
42
|
-
getCollectionJoinField(name: string):
|
|
40
|
+
getCurrentCollectionFields: (name: string) => any[];
|
|
41
|
+
getCollection: (name: any) => CollectionOptions;
|
|
42
|
+
getCollectionJoinField(name: string): CollectionFieldOptions;
|
|
43
43
|
getInterface: (name: string) => any;
|
|
44
44
|
getTemplate(name?: string): any;
|
|
45
|
-
getParentCollectionFields: (parentCollection: any, currentCollection: any) => any;
|
|
45
|
+
getParentCollectionFields: (parentCollection: any, currentCollection: any) => any[];
|
|
46
46
|
getAllCollectionsInheritChain: (collectionName: string) => string[];
|
|
47
47
|
getInheritCollectionsChain: (collectionName: string) => string[];
|
|
48
48
|
isTitleField: (field: any) => any;
|
|
@@ -43,6 +43,15 @@ export declare const array: ({
|
|
|
43
43
|
selected?: undefined;
|
|
44
44
|
schema?: undefined;
|
|
45
45
|
})[];
|
|
46
|
+
export declare const object: ({
|
|
47
|
+
label: string;
|
|
48
|
+
value: string;
|
|
49
|
+
selected: boolean;
|
|
50
|
+
} | {
|
|
51
|
+
label: string;
|
|
52
|
+
value: string;
|
|
53
|
+
selected?: undefined;
|
|
54
|
+
})[];
|
|
46
55
|
export declare const datetime: ({
|
|
47
56
|
label: string;
|
|
48
57
|
value: string;
|
|
@@ -7,9 +7,21 @@ interface IDefault {
|
|
|
7
7
|
export interface IField extends ISchema {
|
|
8
8
|
default?: IDefault;
|
|
9
9
|
operators?: any[];
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
/**
|
|
11
|
+
* - 如果该值为空,则在 Filter 组件中该字段会被过滤掉
|
|
12
|
+
* - 如果该值为空,则不会在变量列表中看到该字段
|
|
13
|
+
*/
|
|
14
|
+
filterable?: {
|
|
15
|
+
/**
|
|
16
|
+
* 字段所支持的操作符,会在 Filter 组件中显示,比如设置 `数据范围` 的时候可以看见
|
|
17
|
+
*/
|
|
18
|
+
operators?: any[];
|
|
19
|
+
/**
|
|
20
|
+
* 为当前字段添加子选项,这个子选项会在 Filter 组件中显示,比如设置 `数据范围` 的时候可以看见
|
|
21
|
+
*/
|
|
22
|
+
children?: any[];
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
};
|
|
13
25
|
titleUsable?: boolean;
|
|
14
26
|
[key: string]: any;
|
|
15
27
|
}
|
|
@@ -1,32 +1,58 @@
|
|
|
1
1
|
import { ISchema } from '@formily/react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
type dumpable = 'required' | 'optional' | 'skip';
|
|
4
|
+
type CollectionSortable = string | boolean | {
|
|
5
|
+
name?: string;
|
|
6
|
+
scopeKey?: string;
|
|
7
|
+
};
|
|
8
|
+
export interface CollectionOptions {
|
|
9
|
+
name: string;
|
|
10
|
+
title?: string;
|
|
11
|
+
namespace?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Used for @nocobase/plugin-duplicator
|
|
14
|
+
* @see packages/core/database/src/collection-group-manager.tss
|
|
15
|
+
*
|
|
16
|
+
* @prop {'required' | 'optional' | 'skip'} dumpable - Determine whether the collection is dumped
|
|
17
|
+
* @prop {string[] | string} [with] - Collections dumped with this collection
|
|
18
|
+
* @prop {any} [delayRestore] - A function to execute after all collections are restored
|
|
19
|
+
*/
|
|
20
|
+
duplicator?: dumpable | {
|
|
21
|
+
dumpable: dumpable;
|
|
22
|
+
with?: string[] | string;
|
|
23
|
+
delayRestore?: any;
|
|
24
|
+
};
|
|
25
|
+
tableName?: string;
|
|
26
|
+
inherits?: string[] | string;
|
|
27
|
+
viewName?: string;
|
|
28
|
+
writableView?: boolean;
|
|
29
|
+
filterTargetKey?: string;
|
|
30
|
+
fields?: FieldOptions[];
|
|
31
|
+
model?: any;
|
|
32
|
+
repository?: any;
|
|
33
|
+
sortable?: CollectionSortable;
|
|
34
|
+
/**
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
37
|
+
autoGenId?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* @default 'options'
|
|
40
|
+
*/
|
|
41
|
+
magicAttribute?: string;
|
|
42
|
+
tree?: string;
|
|
43
|
+
template?: string;
|
|
44
|
+
[key: string]: any;
|
|
45
|
+
}
|
|
3
46
|
export interface CollectionManagerOptions {
|
|
4
47
|
service?: any;
|
|
5
48
|
interfaces?: any;
|
|
6
|
-
collections?:
|
|
49
|
+
collections?: CollectionOptions[];
|
|
7
50
|
templates?: any;
|
|
8
51
|
refreshCM?: () => Promise<void>;
|
|
9
52
|
children?: ReactNode;
|
|
10
53
|
updateCollection?: (collection: any) => void;
|
|
11
54
|
}
|
|
12
|
-
export
|
|
13
|
-
type: string;
|
|
14
|
-
interface?: string;
|
|
15
|
-
uiSchema?: ISchema;
|
|
16
|
-
[key: string]: any;
|
|
17
|
-
}
|
|
18
|
-
export interface CollectionOptions {
|
|
19
|
-
name?: string;
|
|
20
|
-
title?: string;
|
|
21
|
-
filterTargetKey?: string;
|
|
22
|
-
targetKey?: string;
|
|
23
|
-
sortable?: any;
|
|
24
|
-
fields?: FieldOptions[];
|
|
25
|
-
inherits?: string[];
|
|
26
|
-
tree?: string;
|
|
27
|
-
template?: string;
|
|
28
|
-
writableView?: boolean;
|
|
29
|
-
}
|
|
55
|
+
export type FieldOptions = any;
|
|
30
56
|
export interface ICollectionProviderProps {
|
|
31
57
|
name?: string;
|
|
32
58
|
fields?: any;
|
|
@@ -39,3 +65,4 @@ export interface CollectionFieldOptions {
|
|
|
39
65
|
target?: string;
|
|
40
66
|
[key: string]: any;
|
|
41
67
|
}
|
|
68
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SharedFilter } from '../block-provider/SharedFilterProvider';
|
|
3
|
-
import { CollectionFieldOptions,
|
|
4
|
-
export interface ForeignKeyField
|
|
3
|
+
import { CollectionFieldOptions, useCollection } from '../collection-manager';
|
|
4
|
+
export interface ForeignKeyField {
|
|
5
5
|
/** 外键字段所在的数据表的名称 */
|
|
6
6
|
collectionName: string;
|
|
7
7
|
isForeignKey: boolean;
|
|
@@ -9,6 +9,7 @@ export interface ForeignKeyField extends FieldOptions {
|
|
|
9
9
|
name: string;
|
|
10
10
|
parentKey: null | string;
|
|
11
11
|
reverseKey: null | string;
|
|
12
|
+
[key: string]: any;
|
|
12
13
|
}
|
|
13
14
|
type Collection = ReturnType<typeof useCollection>;
|
|
14
15
|
export interface DataBlock {
|
|
@@ -23,7 +23,7 @@ export declare const transformToFilter: (values: Record<string, any>, fieldSchem
|
|
|
23
23
|
};
|
|
24
24
|
}[];
|
|
25
25
|
};
|
|
26
|
-
export declare const useAssociatedFields: () =>
|
|
26
|
+
export declare const useAssociatedFields: () => any[];
|
|
27
27
|
export declare const isAssocField: (field?: FieldOptions) => boolean;
|
|
28
28
|
export declare const isSameCollection: (c1: Collection, c2: Collection) => boolean;
|
|
29
29
|
export declare const useFilterAPI: () => {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface FlagProviderProps {
|
|
3
|
+
/**
|
|
4
|
+
* 字段是否存在于 `字段赋值` 弹窗中
|
|
5
|
+
*/
|
|
6
|
+
isInAssignFieldValues?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* 是否存在于 `设置默认值` 弹窗中
|
|
9
|
+
*/
|
|
10
|
+
isInSetDefaultValueDialog?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* 是否存在于 `表单数据模板` 中
|
|
13
|
+
*/
|
|
14
|
+
isInFormDataTemplate?: boolean;
|
|
15
|
+
children: any;
|
|
16
|
+
}
|
|
17
|
+
export declare const FlagContext: React.Context<Omit<FlagProviderProps, "children">>;
|
|
18
|
+
export declare const FlagProvider: (props: FlagProviderProps) => React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useFlag: () => Omit<import("../FlagProvider").FlagProviderProps, "children">;
|
|
@@ -29,7 +29,7 @@ export declare const useCollectMenuItems: () => {
|
|
|
29
29
|
* @returns
|
|
30
30
|
*/
|
|
31
31
|
export declare const useMenuItem: () => {
|
|
32
|
-
Component: () => React.JSX.Element;
|
|
32
|
+
Component: ({ limitCount }: any) => React.JSX.Element;
|
|
33
33
|
getMenuItems: (Com: () => ReactNode) => Item[];
|
|
34
34
|
getMenuItem: (Com: () => JSX.Element) => Item;
|
|
35
35
|
clean: () => void;
|