@nocobase/client 1.0.0-alpha.5 → 1.0.0-alpha.8

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/.dumirc.ts CHANGED
@@ -27,10 +27,7 @@ export default defineConfig({
27
27
  { type: 'component', dir: 'src/schema-component/antd' },
28
28
  ],
29
29
  },
30
- locales: [
31
- { id: 'en-US', name: 'English' },
32
- { id: 'zh-CN', name: '中文' },
33
- ],
30
+ locales: lang === 'zh-CN' ? [{ id: 'zh-CN', name: '中文' },] : [{ id: 'en-US', name: 'English' }],
34
31
  themeConfig: defineThemeConfig({
35
32
  title: 'NocoBase',
36
33
  logo: 'https://www.nocobase.com/images/logo.png',
@@ -45,6 +42,10 @@ export default defineConfig({
45
42
  {
46
43
  title: 'Components',
47
44
  link: '/components/action',
45
+ },
46
+ {
47
+ title: 'Home site',
48
+ link: lang === 'zh-CN' ? 'https://docs-cn.nocobase.com' : 'https://docs.nocobase.com',
48
49
  }
49
50
  // {
50
51
  // title: 'UI Schema',
@@ -667,5 +668,9 @@ export default defineConfig({
667
668
  // },
668
669
  // ],
669
670
  },
671
+ localesEnhance: [
672
+ { id: 'zh-CN', switchPrefix: '中', hostname: 'client.docs-cn.nocobase.com' },
673
+ { id: 'en-US', switchPrefix: 'en', hostname: 'client.docs.nocobase.com' }
674
+ ],
670
675
  }),
671
676
  });
@@ -0,0 +1,13 @@
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 { ISchema as FormilySchema } from '@formily/json-schema';
10
+ export interface ISchema extends FormilySchema {
11
+ 'x-use-component-props'?: string | Function;
12
+ 'x-use-decorator-props'?: string;
13
+ }
@@ -7,6 +7,7 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import React from 'react';
10
+ export declare function useDynamicComponentProps(useComponentPropsStr?: string, props?: any): any;
10
11
  interface WithSchemaHookOptions {
11
12
  displayName?: string;
12
13
  }
@@ -18,3 +18,4 @@ export * from './schema-toolbar';
18
18
  export * from './PluginSettingsManager';
19
19
  export * from './hoc';
20
20
  export { ApplicationContext } from './context';
21
+ export * from './globalType';
@@ -11,14 +11,19 @@ export declare const DeleteCollection: (props: any) => React.JSX.Element;
11
11
  export declare const useDestroyActionAndRefreshCM: () => {
12
12
  run(): Promise<void>;
13
13
  };
14
- export declare const useBulkDestroyActionAndRefreshCM: () => {
14
+ /**
15
+ * 是否关闭弹窗
16
+ * @param flag
17
+ * @returns
18
+ */
19
+ export declare const useBulkDestroyActionAndRefreshCM: (flag?: any) => {
15
20
  run(): Promise<void>;
16
21
  };
17
22
  export declare const useDestroyAction: () => {
18
23
  run(): Promise<void>;
19
24
  };
20
25
  export declare const useBulkDestroyAction: () => {
21
- run(): Promise<boolean>;
26
+ run(flag?: any): Promise<boolean>;
22
27
  };
23
28
  export declare const DeleteCollectionAction: {
24
29
  (props: any): React.JSX.Element;
@@ -28,14 +28,14 @@ export declare class SqlCollectionTemplate extends CollectionTemplate {
28
28
  name: any;
29
29
  title: any;
30
30
  description: any;
31
+ inherits: any;
32
+ sortable: any;
31
33
  autoGenId: any;
34
+ category: any;
32
35
  createdBy: any;
33
36
  updatedBy: any;
34
37
  createdAt: any;
35
38
  updatedAt: any;
36
- sortable: any;
37
- inherits: any;
38
- category: any;
39
39
  presetFields: any;
40
40
  config: {
41
41
  type: string;
@@ -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;
24
26
  autoGenId: any;
27
+ category: any;
25
28
  createdBy: any;
26
29
  updatedBy: any;
27
30
  createdAt: any;
28
31
  updatedAt: any;
29
- sortable: any;
30
- inherits: any;
31
- category: any;
32
32
  presetFields: any;
33
33
  databaseView: {
34
34
  title: string;
@@ -38,6 +38,7 @@ export declare class ViewCollectionTemplate extends CollectionTemplate {
38
38
  'x-component': string;
39
39
  'x-reactions': string[];
40
40
  'x-disabled': string;
41
+ 'x-visible': string;
41
42
  };
42
43
  schema: {
43
44
  type: string;
@@ -81,6 +82,7 @@ export declare class ViewCollectionTemplate extends CollectionTemplate {
81
82
  'x-decorator': string;
82
83
  'x-component': string;
83
84
  default: boolean;
85
+ 'x-visible': string;
84
86
  };
85
87
  sources: {
86
88
  type: string;
@@ -92,6 +94,7 @@ export declare class ViewCollectionTemplate extends CollectionTemplate {
92
94
  };
93
95
  'x-reactions': string[];
94
96
  'x-disabled': boolean;
97
+ 'x-visible': string;
95
98
  };
96
99
  fields: {
97
100
  type: string;
@@ -49,4 +49,5 @@ export declare abstract class CollectionFieldInterface {
49
49
  validateSchema?(fieldSchema: ISchema): Record<string, ISchema>;
50
50
  usePathOptions?(field: CollectionFieldOptions): any;
51
51
  schemaInitialize?(schema: ISchema, data: any): void;
52
+ hidden?: boolean;
52
53
  }
@@ -18,26 +18,25 @@ interface AvailableFieldInterfacesExclude {
18
18
  }
19
19
  interface CollectionTemplateDefaultOptions {
20
20
  /**
21
- * 自动生成 id
21
+ * Auto-generate id
22
22
  * @default true
23
23
  * */
24
24
  autoGenId?: boolean;
25
- /** 创建人 */
25
+ /** Created by */
26
26
  createdBy?: boolean;
27
- /** 最后更新人 */
27
+ /** Updated by */
28
28
  updatedBy?: boolean;
29
- /** 创建日期 */
29
+ /** Created at */
30
30
  createdAt?: boolean;
31
- /** 更新日期 */
31
+ /** Updated at */
32
32
  updatedAt?: boolean;
33
- /** 可排序 */
33
+ /** Sortable */
34
34
  sortable?: boolean;
35
35
  tree?: string;
36
36
  logging?: boolean;
37
- /** 继承 */
37
+ /** Inherits */
38
38
  inherits?: string | string[];
39
39
  fields?: CollectionOptions['fields'];
40
- [key: string]: any;
41
40
  }
42
41
  export type CollectionTemplateFactory = new (collectionTemplateManager: CollectionTemplateManager) => CollectionTemplate;
43
42
  export declare abstract class CollectionTemplate {
@@ -47,20 +46,20 @@ export declare abstract class CollectionTemplate {
47
46
  Collection?: typeof Collection;
48
47
  title?: string;
49
48
  color?: string;
50
- /** 排序 */
49
+ /** Sorting */
51
50
  order?: number;
52
- /** 默认配置 */
51
+ /** Default configuration */
53
52
  default?: CollectionTemplateDefaultOptions;
54
53
  events?: any;
55
- /** UI 可配置的 CollectionOptions 参数(添加或编辑的 Collection 表单的字段) */
54
+ /** UI configurable CollectionOptions parameters (fields for adding or editing Collection forms) */
56
55
  configurableProperties?: Record<string, ISchema>;
57
- /** 当前模板可用的字段类型 */
56
+ /** Available field types for the current template */
58
57
  availableFieldInterfaces?: AvailableFieldInterfacesInclude | AvailableFieldInterfacesExclude;
59
- /** 是否分割线 */
58
+ /** Whether it is a divider */
60
59
  divider?: boolean;
61
- /** 模板描述 */
60
+ /** Template description */
62
61
  description?: string;
63
- /**配置字段中的操作按钮 */
62
+ /** Configure buttons in the configuration fields */
64
63
  configureActions?: Record<string, ISchema>;
65
64
  forbidDeletion?: boolean;
66
65
  supportDataSourceType?: string[];
@@ -0,0 +1,22 @@
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 { AxiosInstance } from 'axios';
10
+ import { Application, ApplicationOptions } from '../index';
11
+ type URL = string;
12
+ type ResponseData = any;
13
+ type MockApis = Record<URL, ResponseData>;
14
+ export declare const mockApi: (axiosInstance: AxiosInstance, apis?: MockApis, delayResponse?: number) => (apis?: MockApis) => void;
15
+ export declare const mockAppApi: (app: Application, apis?: MockApis, delayResponse?: number) => (apis?: MockApis) => void;
16
+ export interface MockAppOptions extends ApplicationOptions {
17
+ apis?: MockApis;
18
+ delayResponse?: number;
19
+ enableMultipleDataSource?: boolean;
20
+ }
21
+ export declare const mockApp: (options: MockAppOptions) => Application;
22
+ export {};