@nocobase/client 1.5.0-beta.1 → 1.5.0-beta.10

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.
Files changed (97) hide show
  1. package/es/acl/style.d.ts +1 -1
  2. package/es/api-client/hooks/useRequest.d.ts +1 -1
  3. package/es/application/CustomRouterContextProvider.d.ts +30 -2
  4. package/es/application/hooks/index.d.ts +0 -1
  5. package/es/application/schema-initializer/context/index.d.ts +1 -1
  6. package/es/application/schema-initializer/types.d.ts +1 -1
  7. package/es/block-provider/BlockProvider.d.ts +0 -2
  8. package/es/block-provider/TableBlockProvider.d.ts +11 -0
  9. package/es/block-provider/TemplateBlockProvider.d.ts +4 -2
  10. package/es/block-provider/hooks/index.d.ts +1 -4
  11. package/es/collection-manager/CollectionManagerProvider.d.ts +1 -0
  12. package/es/collection-manager/action-hooks.d.ts +3 -3
  13. package/es/collection-manager/hooks/useDialect.d.ts +1 -1
  14. package/es/collection-manager/interfaces/index.d.ts +0 -1
  15. package/es/collection-manager/templates/sql.d.ts +5 -5
  16. package/es/collection-manager/templates/view.d.ts +7 -5
  17. package/es/data-source/collection-field/CollectionField.d.ts +0 -5
  18. package/es/data-source/data-block/DataBlockRequestProvider.d.ts +37 -1
  19. package/es/data-source/data-source/DataSourceManagerProvider.d.ts +7 -0
  20. package/es/document-title/index.d.ts +2 -2
  21. package/es/filter-provider/FilterProvider.d.ts +4 -7
  22. package/es/formily/NocoBaseField.d.ts +18 -0
  23. package/es/formily/NocoBaseReactiveField.d.ts +21 -0
  24. package/es/formily/NocoBaseRecursionField.d.ts +58 -0
  25. package/es/formily/createNocoBaseField.d.ts +61 -0
  26. package/es/hoc/withSkeletonComponent.d.ts +27 -0
  27. package/es/index.d.ts +3 -0
  28. package/es/index.mjs +21538 -19856
  29. package/es/lazy-helper/index.d.ts +48 -0
  30. package/es/modules/actions/associate/AssociateActionInitializer.d.ts +10 -0
  31. package/es/{schema-component/antd/page/FixedBlockDesignerItem.d.ts → modules/actions/associate/AssociateActionProvider.d.ts} +1 -1
  32. package/es/modules/actions/associate/associateActionSettings.d.ts +10 -0
  33. package/es/modules/blocks/data-blocks/table/TableColumnSchemaToolbar.d.ts +1 -1
  34. package/es/modules/blocks/data-blocks/table/hooks/useTableBlockProps.d.ts +10 -5
  35. package/es/modules/fields/component/Input/inputComponentSettings.d.ts +2 -0
  36. package/es/plugin-manager/PinnedPluginListProvider.d.ts +1 -1
  37. package/es/route-switch/antd/admin-layout/KeepAlive.d.ts +33 -0
  38. package/es/route-switch/antd/admin-layout/index.d.ts +3 -0
  39. package/es/schema-component/antd/action/Action.Page.style.d.ts +1 -3
  40. package/es/schema-component/antd/action/Action.d.ts +1 -0
  41. package/es/schema-component/antd/action/ActionBar.d.ts +1 -3
  42. package/es/schema-component/antd/action/context.d.ts +5 -1
  43. package/es/schema-component/antd/action/hooks.d.ts +2 -2
  44. package/es/schema-component/antd/action/types.d.ts +2 -1
  45. package/es/schema-component/antd/association-field/FileManager.d.ts +1 -1
  46. package/es/schema-component/antd/association-field/InternalViewer.d.ts +11 -2
  47. package/es/schema-component/antd/association-field/Table.d.ts +66 -0
  48. package/es/schema-component/antd/block-item/BlockItem.style.d.ts +9 -0
  49. package/es/schema-component/antd/block-item/BlockItemCard.d.ts +2 -1
  50. package/es/schema-component/antd/card-item/CardItem.d.ts +0 -9
  51. package/es/schema-component/antd/details/Details.d.ts +1 -1
  52. package/es/schema-component/antd/filter/FilterAction.d.ts +1 -3
  53. package/es/schema-component/antd/filter/useFilterActionProps.d.ts +9 -9
  54. package/es/schema-component/antd/form-v2/Templates.d.ts +3 -3
  55. package/es/schema-component/antd/grid/Grid.style.d.ts +1 -4
  56. package/es/schema-component/antd/grid-card/GridCard.d.ts +3 -1
  57. package/es/schema-component/antd/input/EllipsisWithTooltip.d.ts +1 -0
  58. package/es/schema-component/antd/list/List.d.ts +3 -1
  59. package/es/schema-component/antd/menu/MenuItemInitializers/index.d.ts +1 -6
  60. package/es/schema-component/antd/page/Page.d.ts +6 -4
  61. package/es/schema-component/antd/page/PagePopups.d.ts +1 -1
  62. package/es/{application/hooks/useRouterBasename.d.ts → schema-component/antd/page/PopupRouteContextResetter.d.ts} +3 -3
  63. package/es/schema-component/antd/page/index.d.ts +0 -2
  64. package/es/schema-component/antd/page/pagePopupUtils.d.ts +1 -1
  65. package/es/schema-component/antd/page/popupState.d.ts +26 -0
  66. package/es/schema-component/antd/select/ReadPretty.d.ts +1 -1
  67. package/es/schema-component/antd/table-v2/DelayRender.d.ts +13 -0
  68. package/es/schema-component/antd/table-v2/RenderTextInCell.d.ts +13 -0
  69. package/es/schema-component/antd/table-v2/Table.d.ts +3 -57
  70. package/es/schema-component/antd/table-v2/TableSkeleton.d.ts +15 -0
  71. package/es/schema-component/antd/time-picker/TimePicker.d.ts +2 -0
  72. package/es/schema-component/common/dnd-context/index.d.ts +1 -1
  73. package/es/schema-component/common/high-performance-spin/HighPerformanceSpin.d.ts +14 -0
  74. package/es/schema-component/common/sortable-item/SortableItem.d.ts +1 -0
  75. package/es/schema-component/common/withPopupWrapper/index.d.ts +11 -0
  76. package/es/schema-component/common/withPopupWrapper/schema.d.ts +43 -0
  77. package/es/schema-component/core/SchemaComponent.d.ts +7 -1
  78. package/es/schema-component/hooks/useDesignable.d.ts +9 -3
  79. package/es/schema-component/types.d.ts +3 -1
  80. package/es/schema-items/OpenModeSchemaItems.d.ts +2 -0
  81. package/es/schema-settings/DataTemplates/components/DataTemplateTitle.style.d.ts +1 -5
  82. package/es/schema-settings/GeneralSchemaDesigner.d.ts +5 -0
  83. package/es/schema-settings/LinkageRules/components/LinkageHeader.style.d.ts +3 -5
  84. package/es/schema-settings/LinkageRules/useActionValues.d.ts +7 -0
  85. package/es/schema-settings/VariableInput/hooks/useParentIterationVariable.d.ts +1 -0
  86. package/es/schema-settings/VariableInput/hooks/useRecordVariable.d.ts +1 -0
  87. package/es/schema-settings/styles.d.ts +1 -51
  88. package/es/schema-templates/SchemaTemplateManagerProvider.d.ts +8 -9
  89. package/es/user/CurrentUserProvider.d.ts +1 -0
  90. package/es/variables/constants.d.ts +2 -0
  91. package/lib/index.js +395 -362
  92. package/lib/locale/en-US.js +1 -1
  93. package/lib/locale/zh-CN.js +7 -3
  94. package/package.json +5 -5
  95. package/es/collection-manager/interfaces/sort.d.ts +0 -131
  96. package/es/schema-component/antd/page/FixedBlock.d.ts +0 -23
  97. package/es/schema-initializer/style.d.ts +0 -20
package/es/acl/style.d.ts CHANGED
@@ -6,4 +6,4 @@
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
- export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<import("antd-style").SerializedStyles>;
9
+ export declare const antTableCell: string;
@@ -7,8 +7,8 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import { Options, Result } from 'ahooks/es/useRequest/src/types';
10
- import { AxiosRequestConfig } from 'axios';
11
10
  import { SetState } from 'ahooks/lib/useSetState';
11
+ import { AxiosRequestConfig } from 'axios';
12
12
  type FunctionService = (...args: any[]) => Promise<any>;
13
13
  export type ReturnTypeOfUseRequest<TData = any> = ReturnType<typeof useRequest<TData>>;
14
14
  export type ResourceActionOptions<P = any> = {
@@ -6,18 +6,46 @@
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 { Schema } from '@formily/json-schema';
9
10
  import React, { FC } from 'react';
10
11
  import { Location, NavigateFunction } from 'react-router-dom';
11
12
  export declare const LocationSearchContext: React.Context<string>;
12
13
  /**
13
- * use `useNavigateNoUpdate` to avoid components that use `useNavigateNoUpdate` re-rendering.
14
+ * @internal
15
+ */
16
+ export declare const CurrentPageUidContext: React.Context<string>;
17
+ /**
18
+ * @internal
19
+ */
20
+ export declare const CurrentTabUidContext: React.Context<string>;
21
+ export declare const IsSubPageClosedByPageMenuProvider: FC;
22
+ export declare const CurrentPageUidProvider: FC;
23
+ export declare const CurrentTabUidProvider: FC;
24
+ /**
25
+ * use `useNavigateNoUpdate` to avoid components re-rendering.
14
26
  * @returns
15
27
  */
16
28
  export declare const useNavigateNoUpdate: () => NavigateFunction;
17
29
  /**
18
- * use `useLocationNoUpdate` to avoid components that use `useLocationNoUpdate` re-rendering.
30
+ * use `useLocationNoUpdate` to avoid components re-rendering.
19
31
  * @returns
20
32
  */
21
33
  export declare const useLocationNoUpdate: () => Location<any>;
22
34
  export declare const useLocationSearch: () => string;
35
+ export declare const useIsAdminPage: () => boolean;
36
+ export declare const useCurrentPageUid: () => string;
37
+ export declare const useMatchAdmin: () => boolean;
38
+ export declare const useMatchAdminName: () => boolean;
39
+ export declare const useIsInSettingsPage: () => boolean;
40
+ /**
41
+ * @internal
42
+ */
43
+ export declare const useCurrentTabUid: () => string;
44
+ export declare const useCurrentSearchParams: () => URLSearchParams;
45
+ export declare const useRouterBasename: () => string;
46
+ /**
47
+ * Used to determine if the user closed the sub-page by clicking on the page menu
48
+ * @returns
49
+ */
50
+ export declare const useIsSubPageClosedByPageMenu: (fieldSchema: Schema) => boolean;
23
51
  export declare const CustomRouterContextProvider: FC;
@@ -10,4 +10,3 @@ export * from './useApp';
10
10
  export * from './useAppSpin';
11
11
  export * from './usePlugin';
12
12
  export * from './useRouter';
13
- export * from './useRouterBasename';
@@ -20,5 +20,5 @@ export declare const useSchemaInitializer: () => {
20
20
  visible: boolean;
21
21
  setVisible: (v: boolean) => void;
22
22
  };
23
- export declare const SchemaInitializerItemContext: React.Context<Omit<SchemaInitializerItemType, "type" | "sort" | "component" | "Component" | "componentProps" | "useVisible" | "useChildren" | "hideIfNoChildren">>;
23
+ export declare const SchemaInitializerItemContext: React.Context<Omit<SchemaInitializerItemType, "type" | "sort" | "component" | "componentProps" | "Component" | "useVisible" | "useChildren" | "hideIfNoChildren">>;
24
24
  export declare const useSchemaInitializerItem: <T = any>() => T;
@@ -75,7 +75,7 @@ export interface SchemaInitializerOptions<P1 = ButtonProps, P2 = {}> {
75
75
  insertPosition?: 'beforeBegin' | 'afterBegin' | 'beforeEnd' | 'afterEnd';
76
76
  designable?: boolean;
77
77
  wrap?: (s: ISchema, options?: any) => ISchema;
78
- useWrap?: () => ((s: ISchema, options?: any) => ISchema);
78
+ useWrap?: () => (s: ISchema, options?: any) => ISchema;
79
79
  onSuccess?: (data: any) => void;
80
80
  insert?: InsertType;
81
81
  useInsert?: () => InsertType;
@@ -23,7 +23,6 @@ export declare const BlockRequestContext_deprecated: React.Context<{
23
23
  field?: GeneralField;
24
24
  service?: any;
25
25
  resource?: any;
26
- allowedActions?: any;
27
26
  __parent?: any;
28
27
  updateAssociationValues?: any[];
29
28
  }>;
@@ -56,7 +55,6 @@ export declare const useBlockRequestContext: () => {
56
55
  field?: GeneralField;
57
56
  service?: any;
58
57
  resource?: any;
59
- allowedActions?: any;
60
58
  __parent?: any;
61
59
  updateAssociationValues?: any[];
62
60
  };
@@ -20,3 +20,14 @@ export declare const TableBlockProvider: React.FunctionComponent<any>;
20
20
  * @internal
21
21
  */
22
22
  export declare const useTableBlockContext: () => any;
23
+ /**
24
+ * @internal
25
+ */
26
+ export declare const useTableBlockContextBasicValue: () => {
27
+ field: any;
28
+ rowKey: string;
29
+ dragSortBy?: string;
30
+ childrenColumnName?: string;
31
+ showIndex?: boolean;
32
+ dragSort?: boolean;
33
+ };
@@ -6,7 +6,7 @@
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 React from 'react';
9
+ import { FC } from 'react';
10
10
  /**
11
11
  * @internal
12
12
  */
@@ -14,5 +14,7 @@ export declare const useTemplateBlockContext: () => {
14
14
  templateFinished?: boolean;
15
15
  onTemplateSuccess?: Function;
16
16
  };
17
- declare const TemplateBlockProvider: (props: any) => React.JSX.Element;
17
+ declare const TemplateBlockProvider: FC<{
18
+ onTemplateLoaded?: () => void;
19
+ }>;
18
20
  export { TemplateBlockProvider };
@@ -74,9 +74,6 @@ export declare const useRemoveActionProps: (associationName: any) => {
74
74
  export declare const useDisassociateActionProps: () => {
75
75
  onClick(e?: any, callBack?: any): Promise<void>;
76
76
  };
77
- export declare const useDetailPrintActionProps: () => {
78
- onClick(): Promise<void>;
79
- };
80
77
  export declare const useBulkDestroyActionProps: () => {
81
78
  onClick(e?: any, callBack?: any): Promise<void>;
82
79
  };
@@ -156,7 +153,7 @@ export declare const getAppends: ({ schema, prefix: defaultPrefix, updateAssocia
156
153
  }) => void;
157
154
  export declare const useAssociationNames: (dataSource?: string) => {
158
155
  getAssociationAppends: () => {
159
- appends: any[];
156
+ appends: any;
160
157
  updateAssociationValues: any[];
161
158
  };
162
159
  };
@@ -12,5 +12,6 @@ import { CollectionManagerOptions } from './types';
12
12
  * @deprecated use `CollectionManagerProvider` instead
13
13
  */
14
14
  export declare const CollectionManagerProvider_deprecated: React.FC<CollectionManagerOptions>;
15
+ export declare const useRemoteCollectionManagerLoading: () => boolean;
15
16
  export declare const RemoteCollectionManagerProvider: (props: any) => React.JSX.Element;
16
17
  export declare const CollectionCategoriesProvider: (props: any) => React.JSX.Element;
@@ -84,7 +84,7 @@ export declare const useBulkDestroyActionAndRefreshCM: () => {
84
84
  run(): Promise<void>;
85
85
  };
86
86
  export declare const useFilterActionProps: () => {
87
- options: any;
88
- onSubmit(values: any): any;
89
- onReset(): any;
87
+ options: any[];
88
+ onSubmit: (values: any) => any;
89
+ onReset: () => any;
90
90
  };
@@ -8,6 +8,6 @@
8
8
  */
9
9
  declare const useDialect: () => {
10
10
  isDialect: (dialect: string) => boolean;
11
- dialect: string;
11
+ dialect: any;
12
12
  };
13
13
  export default useDialect;
@@ -40,7 +40,6 @@ export * from './time';
40
40
  export * from './updatedAt';
41
41
  export * from './updatedBy';
42
42
  export * from './url';
43
- export * from './sort';
44
43
  export * from './uuid';
45
44
  export * from './nanoid';
46
45
  export * from './unixTimestamp';
@@ -31,14 +31,14 @@ export declare class SqlCollectionTemplate extends CollectionTemplate {
31
31
  name: any;
32
32
  title: any;
33
33
  description: any;
34
- inherits: any;
35
- sortable: any;
36
- autoGenId: any;
37
- category: any;
38
34
  createdBy: any;
39
- updatedBy: any;
40
35
  createdAt: any;
36
+ updatedBy: any;
41
37
  updatedAt: any;
38
+ category: any;
39
+ sortable: any;
40
+ inherits: any;
41
+ autoGenId: any;
42
42
  simplePaginate: any;
43
43
  presetFields: any;
44
44
  config: {
@@ -21,14 +21,14 @@ export declare class ViewCollectionTemplate extends CollectionTemplate {
21
21
  name: any;
22
22
  title: any;
23
23
  description: any;
24
- inherits: any;
25
- sortable: any;
26
- autoGenId: any;
27
- category: any;
28
24
  createdBy: any;
29
- updatedBy: any;
30
25
  createdAt: any;
26
+ updatedBy: any;
31
27
  updatedAt: any;
28
+ category: any;
29
+ sortable: any;
30
+ inherits: any;
31
+ autoGenId: any;
32
32
  simplePaginate: any;
33
33
  presetFields: any;
34
34
  databaseView: {
@@ -101,6 +101,7 @@ export declare class ViewCollectionTemplate extends CollectionTemplate {
101
101
  type: string;
102
102
  'x-component': import("react").MemoExoticComponent<(props: any) => import("react").JSX.Element>;
103
103
  'x-hidden': string;
104
+ 'x-decorator': string;
104
105
  'x-reactions': {
105
106
  dependencies: string[];
106
107
  fulfill: {
@@ -109,6 +110,7 @@ export declare class ViewCollectionTemplate extends CollectionTemplate {
109
110
  };
110
111
  };
111
112
  };
113
+ description: string;
112
114
  };
113
115
  preview: {
114
116
  type: string;
@@ -7,9 +7,4 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import React from 'react';
10
- /**
11
- * TODO: 初步适配
12
- * @internal
13
- */
14
- export declare const CollectionFieldInternalField: React.FC;
15
10
  export declare const CollectionField: React.ForwardRefExoticComponent<Omit<Partial<any>, "ref"> & React.RefAttributes<unknown>>;
@@ -8,7 +8,10 @@
8
8
  */
9
9
  import React, { FC } from 'react';
10
10
  import { UseRequestResult } from '../../api-client';
11
- export declare const BlockRequestContext: React.Context<UseRequestResult<any>>;
11
+ /**
12
+ * @internal
13
+ */
14
+ export declare const BlockRequestLoadingContext: React.Context<boolean>;
12
15
  export declare function requestParentRecordData({ sourceId, association, parentRecord, api, headers, sourceKey, }: {
13
16
  sourceId?: number;
14
17
  association?: string;
@@ -17,7 +20,40 @@ export declare function requestParentRecordData({ sourceId, association, parentR
17
20
  headers?: any;
18
21
  sourceKey?: string;
19
22
  }): Promise<any>;
23
+ export declare const BlockRequestContextProvider: FC<{
24
+ recordRequest: UseRequestResult<any>;
25
+ }>;
20
26
  export declare const BlockRequestProvider: FC;
21
27
  export declare const useDataBlockRequest: <T extends {}>() => UseRequestResult<{
22
28
  data: T;
23
29
  }>;
30
+ /**
31
+ * Compared to `useDataBlockRequest`, this Hook helps prevent unnecessary re-renders.
32
+ *
33
+ * This Hook returns a stable function reference that won't change between renders. When you only need
34
+ * methods like `refresh` or `run`, using this Hook is recommended because:
35
+ *
36
+ * 1. It returns a memoized object containing only the getter function
37
+ * 2. The getter function accesses the latest request data through a ref, avoiding re-renders
38
+ * 3. Unlike useDataBlockRequest which returns request state directly, this Hook provides indirect access
39
+ * through a getter, breaking the reactive dependency chain
40
+ *
41
+ * For example:
42
+ * ```ts
43
+ * // This will re-render when request state changes
44
+ * const { refresh } = useDataBlockRequest();
45
+ *
46
+ * // This won't re-render when request state changes
47
+ * const { getDataBlockRequest } = useDataBlockRequestGetter();
48
+ * const refresh = getDataBlockRequest().refresh;
49
+ * ```
50
+ *
51
+ * @returns An object containing the getDataBlockRequest method that provides access to the request instance
52
+ */
53
+ export declare const useDataBlockRequestGetter: () => {
54
+ getDataBlockRequest: () => UseRequestResult<any>;
55
+ };
56
+ /**
57
+ * When only data is needed, it's recommended to use this hook to avoid unnecessary re-renders
58
+ */
59
+ export declare const useDataBlockRequestData: () => any;
@@ -15,3 +15,10 @@ export interface DataSourceManagerProviderProps {
15
15
  }
16
16
  export declare const DataSourceManagerProvider: FC<DataSourceManagerProviderProps>;
17
17
  export declare function useDataSourceManager(): DataSourceManager;
18
+ /**
19
+ * 获取当前 collection 继承链路上的所有 collection
20
+ * @returns
21
+ */
22
+ export declare function useAllCollectionsInheritChainGetter(): {
23
+ getAllCollectionsInheritChain: (collectionName: string, customDataSource?: string) => string[];
24
+ };
@@ -9,8 +9,8 @@
9
9
  import React from 'react';
10
10
  import { Plugin } from '../application/Plugin';
11
11
  interface DocumentTitleContextProps {
12
- title?: any;
13
- setTitle?: (title?: any) => void;
12
+ getTitle: () => string;
13
+ setTitle: (title?: any) => void;
14
14
  }
15
15
  export declare const DocumentTitleContext: React.Context<DocumentTitleContextProps>;
16
16
  export declare const DocumentTitleProvider: React.FC<{
@@ -6,9 +6,9 @@
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 React from 'react';
10
9
  import { CollectionFieldOptions_deprecated } from '../collection-manager';
11
10
  import { Collection } from '../data-source/collection/Collection';
11
+ import React from 'react';
12
12
  declare enum FILTER_OPERATOR {
13
13
  AND = "$and",
14
14
  OR = "$or"
@@ -77,12 +77,9 @@ export declare const DataBlockCollector: ({ children, params, }: {
77
77
  * @returns
78
78
  */
79
79
  export declare const useFilterBlock: () => {
80
- recordDataBlocks: (block: DataBlock) => void;
81
- getDataBlocks: () => DataBlock[];
82
- removeDataBlock: (uid: string) => void;
83
- /**
84
- * running in FilterBlockProvider
85
- */
86
80
  inProvider: boolean;
81
+ recordDataBlocks: (...args: any[]) => void;
82
+ getDataBlocks: () => DataBlock[];
83
+ removeDataBlock: (...args: any[]) => void;
87
84
  };
88
85
  export {};
@@ -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
+ import { IFieldProps, JSXComponent, Schema } from '@formily/react';
10
+ import React from 'react';
11
+ /**
12
+ * To maintain high performance of Table, this component removes Formily-related components
13
+ * @param props component props
14
+ * @returns
15
+ */
16
+ export declare const NocoBaseField: <D extends JSXComponent, C extends JSXComponent>(props: IFieldProps<D, C, import("@formily/core").Field<any, any, any, any>> & {
17
+ schema: Schema;
18
+ }) => React.JSX.Element;
@@ -0,0 +1,21 @@
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 { GeneralField } from '@formily/core';
10
+ import { RenderPropsChildren } from '@formily/react';
11
+ import React from 'react';
12
+ interface IReactiveFieldProps {
13
+ field: GeneralField;
14
+ children?: RenderPropsChildren<GeneralField>;
15
+ }
16
+ /**
17
+ * Based on @formily/react v2.3.2 NocoBaseReactiveField component
18
+ * Modified to better adapt to NocoBase's needs
19
+ */
20
+ export declare const NocoBaseReactiveField: React.FC<IReactiveFieldProps>;
21
+ export {};
@@ -0,0 +1,58 @@
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 { IRecursionFieldProps, ISchema, ReactFC, Schema } from '@formily/react';
10
+ import React, { FC } from 'react';
11
+ import { CollectionFieldOptions } from '../data-source/collection/Collection';
12
+ interface INocoBaseRecursionFieldProps extends IRecursionFieldProps {
13
+ /**
14
+ * Default Schema for collection fields
15
+ */
16
+ uiSchema?: ISchema;
17
+ /**
18
+ * Value for fields
19
+ */
20
+ values?: Record<string, any>;
21
+ /**
22
+ * @default true
23
+ * Whether to use Formily Field class - performance will be reduced but provides better compatibility with Formily
24
+ */
25
+ isUseFormilyField?: boolean;
26
+ }
27
+ export declare const RefreshComponentProvider: FC<{
28
+ refresh: () => void;
29
+ }>;
30
+ export declare const useRefreshComponent: () => () => void;
31
+ /**
32
+ * Create a new fieldSchema instance to refresh the component after modifying fieldSchema
33
+ * @returns
34
+ */
35
+ export declare const useRefreshFieldSchema: () => (options?: {
36
+ refreshParentSchema?: boolean;
37
+ }) => void;
38
+ /**
39
+ * @internal
40
+ * The difference from `useCollectionField` is that it returns empty if the current schema is not a collection field,
41
+ * while the value of `useCollectionField` is determined by the context in the component tree.
42
+ */
43
+ export declare const useCollectionFieldUISchema: () => CollectionFieldOptions;
44
+ export declare const CollectionFieldUISchemaProvider: FC<{
45
+ fieldSchema: Schema;
46
+ }>;
47
+ export declare const IsInNocoBaseRecursionFieldContext: React.Context<boolean>;
48
+ /**
49
+ * @internal
50
+ * Note: Only suitable for use within the CollectionField component
51
+ */
52
+ export declare const useIsInNocoBaseRecursionFieldContext: () => boolean;
53
+ /**
54
+ * Based on @formily/react v2.3.2 RecursionField component
55
+ * Modified to better adapt to NocoBase's needs
56
+ */
57
+ export declare const NocoBaseRecursionField: ReactFC<INocoBaseRecursionFieldProps>;
58
+ export {};
@@ -0,0 +1,61 @@
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 { IFieldProps } from '@formily/core';
10
+ import { JSXComponent, Schema } from '@formily/react';
11
+ export declare function createNocoBaseField<Decorator extends JSXComponent, Component extends JSXComponent>(props: any): NocoBaseField<any, any, any, any>;
12
+ /**
13
+ * Compared to the Field class, NocoBaseField has better performance
14
+ */
15
+ declare class NocoBaseField<Decorator extends JSXComponent = any, Component extends JSXComponent = any, TextType = any, ValueType = any> {
16
+ props: IFieldProps<Decorator, Component, TextType, ValueType> & {
17
+ schema: Schema;
18
+ compile: (source: any) => any;
19
+ };
20
+ initialized: boolean;
21
+ loading: boolean;
22
+ validating: boolean;
23
+ submitting: boolean;
24
+ selfModified: boolean;
25
+ active: boolean;
26
+ visited: boolean;
27
+ mounted: boolean;
28
+ unmounted: boolean;
29
+ inputValues: any[];
30
+ inputValue: any;
31
+ feedbacks: any[];
32
+ title: string;
33
+ description: string;
34
+ display: string;
35
+ pattern: string;
36
+ editable: boolean;
37
+ disabled: boolean;
38
+ readOnly: boolean;
39
+ readPretty: boolean;
40
+ visible: boolean;
41
+ hidden: boolean;
42
+ dataSource: any[];
43
+ validator: any;
44
+ required: boolean;
45
+ content: string;
46
+ initialValue: any;
47
+ value: any;
48
+ data: any;
49
+ decorator: any[];
50
+ component: any[];
51
+ decoratorProps: any;
52
+ componentProps: any;
53
+ decoratorType: any;
54
+ componentType: any;
55
+ path: any;
56
+ form: any;
57
+ address: any;
58
+ constructor(props: any);
59
+ protected initialize(): void;
60
+ }
61
+ export {};
@@ -0,0 +1,27 @@
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
+ interface Options {
11
+ displayName?: string;
12
+ useLoading?: () => boolean;
13
+ SkeletonComponent?: React.ComponentType;
14
+ /**
15
+ * @default 300
16
+ * Delay time of skeleton component
17
+ */
18
+ delay?: number;
19
+ }
20
+ /**
21
+ * Display skeleton component while component is making API requests
22
+ * @param Component
23
+ * @param options
24
+ * @returns
25
+ */
26
+ export declare const withSkeletonComponent: (Component: React.ComponentType<any>, options?: Options) => React.MemoExoticComponent<(props: any) => React.JSX.Element>;
27
+ export {};
package/es/index.d.ts CHANGED
@@ -35,6 +35,7 @@ export * from './global-theme';
35
35
  export * from './hooks';
36
36
  export * from './i18n';
37
37
  export * from './icon';
38
+ export * from './lazy-helper';
38
39
  export { default as locale } from './locale';
39
40
  export * from './nocobase-buildin-plugin';
40
41
  export * from './plugin-manager';
@@ -53,6 +54,7 @@ export * from './testUtils';
53
54
  export * from './user';
54
55
  export * from './variables';
55
56
  export { withDynamicSchemaProps } from './hoc/withDynamicSchemaProps';
57
+ export { withSkeletonComponent } from './hoc/withSkeletonComponent';
56
58
  export { SchemaSettingsActionLinkItem } from './modules/actions/link/customizeLinkActionSettings';
57
59
  export { useURLAndHTMLSchema } from './modules/actions/link/useURLAndHTMLSchema';
58
60
  export * from './modules/blocks/BlockSchemaToolbar';
@@ -68,3 +70,4 @@ export { SwitchLanguage } from './i18n/SwitchLanguage';
68
70
  export { VariablePopupRecordProvider } from './modules/variable/variablesProvider/VariablePopupRecordProvider';
69
71
  export { useCurrentPopupRecord } from './modules/variable/variablesProvider/VariablePopupRecordProvider';
70
72
  export { languageCodes } from './locale';
73
+ export { CollectionFieldUISchemaProvider, IsInNocoBaseRecursionFieldContext, NocoBaseRecursionField, RefreshComponentProvider, useRefreshFieldSchema, } from './formily/NocoBaseRecursionField';