@nocobase/client 0.21.0-alpha.6 → 0.21.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/Application.d.ts +6 -3
- package/es/application/RouterManager.d.ts +1 -1
- package/es/application/components/MainComponent.d.ts +1 -1
- package/es/application/components/defaultComponents.d.ts +1 -1
- package/es/application/schema-initializer/components/SchemaInitializerActionModal.d.ts +1 -0
- package/es/application/schema-initializer/components/SchemaInitializerItem.d.ts +3 -0
- package/es/application/schema-initializer/components/SchemaInitializerItemGroup.d.ts +4 -0
- package/es/application/schema-initializer/components/SchemaInitializerSelect.d.ts +3 -0
- package/es/application/schema-initializer/components/SchemaInitializerSubMenu.d.ts +9 -1
- package/es/application/schema-initializer/components/SchemaInitializerSwitch.d.ts +3 -0
- package/es/application/schema-initializer/hooks/index.d.ts +2 -18
- package/es/application/schema-initializer/hooks/useGetSchemaInitializerMenuItems.d.ts +8 -0
- package/es/application/schema-initializer/hooks/useSchemaInitializerRender.d.ts +10 -0
- package/es/application/schema-initializer/index.d.ts +1 -1
- package/es/application/schema-initializer/{hoc/index.d.ts → withInitializer.d.ts} +1 -1
- package/es/application/schema-settings/context/SchemaSettingItemContext.d.ts +4 -0
- package/es/application/schema-settings/context/index.d.ts +1 -4
- package/es/application/schema-settings/hooks/index.d.ts +1 -19
- package/es/application/schema-settings/hooks/useSchemaSettingsRender.d.ts +19 -0
- package/es/data-source/collection/AssociationProvider.d.ts +1 -0
- package/es/data-source/collection/CollectionManager.d.ts +1 -1
- package/es/data-source/components/CollectionDeletedPlaceholder.d.ts +1 -1
- package/es/data-source/data-source/DataSourceManager.d.ts +1 -1
- package/es/index.d.ts +0 -1
- package/es/index.mjs +3706 -3674
- package/es/modules/blocks/data-blocks/details-multi/DetailsBlockInitializer.d.ts +3 -0
- package/es/modules/blocks/data-blocks/form/FormBlockInitializer.d.ts +69 -1
- package/es/modules/blocks/data-blocks/grid-card/GridCardBlockInitializer.d.ts +5 -0
- package/es/modules/blocks/data-blocks/grid-card/{createGridCardBlockSchema.d.ts → createGridCardBlockUISchema.d.ts} +1 -1
- package/es/modules/blocks/data-blocks/list/ListBlockInitializer.d.ts +5 -0
- package/es/modules/blocks/data-blocks/list/{createListBlockSchema.d.ts → createListBlockUISchema.d.ts} +1 -1
- package/es/modules/blocks/data-blocks/table/TableBlockInitializer.d.ts +5 -0
- package/es/modules/blocks/data-blocks/table/TreeRecordProvider.d.ts +12 -0
- package/es/modules/blocks/useParentRecordCommon.d.ts +1 -1
- package/es/schema-component/antd/association-filter/AssociationFilterProvider.d.ts +1 -1
- package/es/schema-component/types.d.ts +1 -0
- package/es/schema-initializer/items/DataBlockInitializer.d.ts +11 -2
- package/es/schema-initializer/utils.d.ts +5 -1
- package/lib/index.js +95 -113
- package/lib/locale/en_US.js +3 -0
- package/lib/locale/es_ES.js +3 -0
- package/lib/locale/fr_FR.js +3 -0
- package/lib/locale/ja_JP.js +5 -2
- package/lib/locale/ko_KR.js +4 -1
- package/lib/locale/pt_BR.js +4 -1
- package/lib/locale/ru_RU.js +3 -1
- package/lib/locale/tr_TR.js +4 -1
- package/lib/locale/uk_UA.js +4 -1
- package/lib/locale/zh-CN.js +3 -0
- package/lib/locale/zh-TW.js +5 -0
- package/package.json +5 -5
- package/es/formula/Expression.d.ts +0 -3
- package/es/formula/Result.d.ts +0 -3
- package/es/formula/index.d.ts +0 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { APIClientOptions } from '@nocobase/sdk';
|
|
2
2
|
import { i18n as i18next } from 'i18next';
|
|
3
|
-
import React, { ComponentType, ReactElement } from 'react';
|
|
3
|
+
import React, { ComponentType, ReactElement, ReactNode } from 'react';
|
|
4
4
|
import { APIClient } from '../api-client';
|
|
5
5
|
import { PluginManager, PluginType } from './PluginManager';
|
|
6
6
|
import { PluginSettingOptions, PluginSettingsManager } from './PluginSettingsManager';
|
|
@@ -69,6 +69,7 @@ export declare class Application {
|
|
|
69
69
|
private addRoutes;
|
|
70
70
|
getOptions(): ApplicationOptions;
|
|
71
71
|
getPublicPath(): string;
|
|
72
|
+
getApiUrl(pathname?: string): string;
|
|
72
73
|
getRouteUrl(pathname: string): string;
|
|
73
74
|
getCollectionManager(dataSource?: string): import("..").CollectionManager;
|
|
74
75
|
/**
|
|
@@ -80,13 +81,15 @@ export declare class Application {
|
|
|
80
81
|
addProviders(providers: (ComponentType | [ComponentType, any])[]): void;
|
|
81
82
|
load(): Promise<void>;
|
|
82
83
|
getComponent<T = any>(Component: ComponentTypeAndString<T>, isShowError?: boolean): ComponentType<T> | undefined;
|
|
83
|
-
renderComponent<T extends {}>(Component: ComponentTypeAndString, props?: T): ReactElement;
|
|
84
|
+
renderComponent<T extends {}>(Component: ComponentTypeAndString, props?: T, children?: ReactNode): ReactElement;
|
|
84
85
|
/**
|
|
85
86
|
* @internal use addComponents({ SomeComponent }) instead
|
|
86
87
|
*/
|
|
87
88
|
protected addComponent(component: ComponentType, name?: string): void;
|
|
88
89
|
addComponents(components: Record<string, ComponentType>): void;
|
|
89
90
|
addScopes(scopes: Record<string, any>): void;
|
|
90
|
-
getRootComponent(): React.FC
|
|
91
|
+
getRootComponent(): React.FC<{
|
|
92
|
+
children?: React.ReactNode;
|
|
93
|
+
}>;
|
|
91
94
|
mount(containerOrSelector: Element | ShadowRoot | string): any;
|
|
92
95
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const MainComponent: React.
|
|
2
|
+
export declare const MainComponent: React.NamedExoticComponent<object>;
|
|
@@ -6,6 +6,7 @@ export interface SchemaInitializerActionModalProps {
|
|
|
6
6
|
onSubmit?: (values: any) => void;
|
|
7
7
|
buttonText?: any;
|
|
8
8
|
component?: any;
|
|
9
|
+
isItem?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare const SchemaInitializerActionModal: FC<SchemaInitializerActionModalProps>;
|
|
11
12
|
export declare const SchemaInitializerActionModalInternal: () => React.JSX.Element;
|
|
@@ -11,4 +11,7 @@ export interface SchemaInitializerItemProps {
|
|
|
11
11
|
children?: ReactNode;
|
|
12
12
|
}
|
|
13
13
|
export declare const SchemaInitializerItem: React.MemoExoticComponent<React.ForwardRefExoticComponent<SchemaInitializerItemProps & React.RefAttributes<any>>>;
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
14
17
|
export declare const SchemaInitializerItemInternal: () => React.JSX.Element;
|
|
@@ -3,7 +3,11 @@ import { SchemaInitializerOptions } from '../types';
|
|
|
3
3
|
export interface SchemaInitializerItemGroupProps {
|
|
4
4
|
title: string;
|
|
5
5
|
children?: SchemaInitializerOptions['items'];
|
|
6
|
+
items?: SchemaInitializerOptions['items'];
|
|
6
7
|
divider?: boolean;
|
|
7
8
|
}
|
|
8
9
|
export declare const SchemaInitializerItemGroup: FC<SchemaInitializerItemGroupProps>;
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
9
13
|
export declare const SchemaInitializerItemGroupInternal: () => React.JSX.Element;
|
|
@@ -8,4 +8,7 @@ export interface SchemaInitializerSelectItemProps extends SchemaInitializerItemP
|
|
|
8
8
|
openOnHover?: boolean;
|
|
9
9
|
}
|
|
10
10
|
export declare const SchemaInitializerSelect: FC<SchemaInitializerSelectItemProps>;
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
11
14
|
export declare const SchemaInitializerSelectInternal: () => React.JSX.Element;
|
|
@@ -2,16 +2,24 @@ import { MenuProps } from 'antd';
|
|
|
2
2
|
import React, { FC, ReactNode } from 'react';
|
|
3
3
|
import { SchemaInitializerOptions } from '../types';
|
|
4
4
|
export interface SchemaInitializerSubMenuProps {
|
|
5
|
-
name
|
|
5
|
+
name?: string;
|
|
6
6
|
title?: string;
|
|
7
7
|
onClick?: (args: any) => void;
|
|
8
8
|
onOpenChange?: (openKeys: string[]) => void;
|
|
9
9
|
icon?: string | ReactNode;
|
|
10
10
|
children?: SchemaInitializerOptions['items'];
|
|
11
|
+
items?: SchemaInitializerOptions['items'];
|
|
11
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare const SchemaInitializerMenuProvider: (props: any) => React.JSX.Element;
|
|
12
17
|
export declare const useSchemaInitializerSubMenuContext: () => {
|
|
13
18
|
isInMenu?: true;
|
|
14
19
|
};
|
|
15
20
|
export declare const SchemaInitializerMenu: FC<MenuProps>;
|
|
16
21
|
export declare const SchemaInitializerSubMenu: FC<SchemaInitializerSubMenuProps>;
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
17
25
|
export declare const SchemaInitializerSubMenuInternal: () => React.JSX.Element;
|
|
@@ -5,4 +5,7 @@ export interface SchemaInitializerSwitchItemProps extends SchemaInitializerItemP
|
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare const SchemaInitializerSwitch: FC<SchemaInitializerSwitchItemProps>;
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
8
11
|
export declare const SchemaInitializerSwitchInternal: () => React.JSX.Element;
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
import { ButtonProps } from 'antd';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { SchemaInitializerOptions } from '../types';
|
|
4
1
|
export * from './useAriaAttributeOfMenuItem';
|
|
5
|
-
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
export declare function useSchemaInitializerMenuItems(items: any[], name?: string, onClick?: (args: any) => void): any;
|
|
9
|
-
/**
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
12
|
-
export declare function useGetSchemaInitializerMenuItems(onClick?: (args: any) => void): any;
|
|
13
|
-
export declare function useSchemaInitializerRender<P1 = ButtonProps, P2 = {}>(name: string, options?: Omit<SchemaInitializerOptions<P1, P2>, 'name'>): {
|
|
14
|
-
exists: boolean;
|
|
15
|
-
render: () => any;
|
|
16
|
-
} | {
|
|
17
|
-
exists: boolean;
|
|
18
|
-
render: (props?: Omit<SchemaInitializerOptions<P1, P2>, 'name'>) => React.FunctionComponentElement<any> | React.FunctionComponentElement<SchemaInitializerOptions<any, any>>;
|
|
19
|
-
};
|
|
2
|
+
export * from './useSchemaInitializerRender';
|
|
3
|
+
export * from './useGetSchemaInitializerMenuItems';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ButtonProps } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { SchemaInitializerOptions } from '../types';
|
|
4
|
+
export declare function useSchemaInitializerRender<P1 = ButtonProps, P2 = {}>(name: string, options?: Omit<SchemaInitializerOptions<P1, P2>, 'name'>): {
|
|
5
|
+
exists: boolean;
|
|
6
|
+
render: () => any;
|
|
7
|
+
} | {
|
|
8
|
+
exists: boolean;
|
|
9
|
+
render: (props?: Omit<SchemaInitializerOptions<P1, P2>, 'name'>) => React.FunctionComponentElement<SchemaInitializerOptions<any, any>>;
|
|
10
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React, { ComponentType } from 'react';
|
|
2
|
-
import { SchemaInitializerOptions } from '
|
|
2
|
+
import { SchemaInitializerOptions } from './types';
|
|
3
3
|
export declare function withInitializer<T>(C: ComponentType<T>): React.MemoExoticComponent<import("@formily/react").ReactFC<Omit<SchemaInitializerOptions<T, {}>, "ref">>>;
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { SchemaSettingsItemType } from '../types';
|
|
3
|
-
export declare const SchemaSettingItemContext: import("react").Context<SchemaSettingsItemType>;
|
|
4
|
-
export declare function useSchemaSettingsItem(): SchemaSettingsItemType;
|
|
1
|
+
export * from './SchemaSettingItemContext';
|
|
@@ -1,19 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { SchemaSettingsProps } from '../../../schema-settings';
|
|
4
|
-
import { Schema } from '@formily/json-schema';
|
|
5
|
-
import { GeneralField } from '@formily/core';
|
|
6
|
-
import { Designable } from '../../../schema-component';
|
|
7
|
-
type UseSchemaSettingsRenderOptions<T = {}> = Omit<SchemaSettingOptions<T>, 'name' | 'items'> & Omit<SchemaSettingsProps, 'title' | 'children'> & {
|
|
8
|
-
fieldSchema?: Schema;
|
|
9
|
-
field?: GeneralField;
|
|
10
|
-
dn?: Designable;
|
|
11
|
-
};
|
|
12
|
-
export declare function useSchemaSettingsRender<T = {}>(name: string, options?: UseSchemaSettingsRenderOptions<T>): {
|
|
13
|
-
exists: boolean;
|
|
14
|
-
render: () => any;
|
|
15
|
-
} | {
|
|
16
|
-
exists: boolean;
|
|
17
|
-
render: (options2?: UseSchemaSettingsRenderOptions) => React.FunctionComponentElement<any> | React.FunctionComponentElement<SchemaSettingOptions<any>>;
|
|
18
|
-
};
|
|
19
|
-
export {};
|
|
1
|
+
export * from './useSchemaSettingsRender';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SchemaSettingOptions } from '../types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { SchemaSettingsProps } from '../../../schema-settings';
|
|
4
|
+
import { Schema } from '@formily/json-schema';
|
|
5
|
+
import { GeneralField } from '@formily/core';
|
|
6
|
+
import { Designable } from '../../../schema-component';
|
|
7
|
+
type UseSchemaSettingsRenderOptions<T = {}> = Omit<SchemaSettingOptions<T>, 'name' | 'items'> & Omit<SchemaSettingsProps, 'title' | 'children'> & {
|
|
8
|
+
fieldSchema?: Schema;
|
|
9
|
+
field?: GeneralField;
|
|
10
|
+
dn?: Designable;
|
|
11
|
+
};
|
|
12
|
+
export declare function useSchemaSettingsRender<T = {}>(name: string, options?: UseSchemaSettingsRenderOptions<T>): {
|
|
13
|
+
exists: boolean;
|
|
14
|
+
render: () => any;
|
|
15
|
+
} | {
|
|
16
|
+
exists: boolean;
|
|
17
|
+
render: (options2?: UseSchemaSettingsRenderOptions) => React.FunctionComponentElement<SchemaSettingOptions<any>>;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -32,7 +32,7 @@ export declare class CollectionManager {
|
|
|
32
32
|
*/
|
|
33
33
|
getCollectionField(path: SchemaKey | CollectionFieldOptions): any;
|
|
34
34
|
getCollectionFields(collectionName: string, predicate?: GetCollectionFieldPredicate): CollectionFieldOptions[];
|
|
35
|
-
|
|
35
|
+
getSourceKeyByAssociation(associationName: string): any;
|
|
36
36
|
/**
|
|
37
37
|
* @internal
|
|
38
38
|
*/
|
|
@@ -26,7 +26,7 @@ export declare class DataSourceManager {
|
|
|
26
26
|
collectionFieldInterfaceManager: CollectionFieldInterfaceManager;
|
|
27
27
|
constructor(options: DataSourceManagerOptions, app: Application);
|
|
28
28
|
addCollectionMixins(mixins?: (typeof Collection)[]): void;
|
|
29
|
-
getDataSources(
|
|
29
|
+
getDataSources(filterDataSource?: (dataSource: DataSource) => boolean): DataSource[];
|
|
30
30
|
getDataSource(key?: string): DataSource;
|
|
31
31
|
removeDataSources(keys: string[]): void;
|
|
32
32
|
addDataSource(DataSource: DataSourceFactory, options: DataSourceOptions): DataSource;
|
package/es/index.d.ts
CHANGED