@nocobase/client 1.2.32-alpha → 1.2.33-alpha

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.
@@ -17,6 +17,7 @@ import { WebSocketClient, WebSocketClientOptions } from './WebSocketClient';
17
17
  import { SchemaInitializer, SchemaInitializerManager } from './schema-initializer';
18
18
  import { SchemaSettings, SchemaSettingsManager } from './schema-settings';
19
19
  import { DataSourceManager, type DataSourceManagerOptions } from '../data-source/data-source/DataSourceManager';
20
+ import { CollectionFieldInterfaceComponentOption } from '../data-source/collection-field-interface/CollectionFieldInterface';
20
21
  import type { Plugin } from './Plugin';
21
22
  import type { RequireJS } from './utils/requirejs';
22
23
  declare global {
@@ -103,4 +104,5 @@ export declare class Application {
103
104
  children?: React.ReactNode;
104
105
  }>;
105
106
  mount(containerOrSelector: Element | ShadowRoot | string): any;
107
+ addFieldInterfaceComponentOption(fieldName: string, componentOption: CollectionFieldInterfaceComponentOption): void;
106
108
  }
@@ -6,18 +6,24 @@
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 { SchemaSettingsItemType } from '@nocobase/client';
10
9
  import { ISchema } from '@formily/react';
11
10
  import { TFunction } from 'react-i18next';
11
+ import { SchemaSettingsItemType } from '../types';
12
12
  export interface CreateModalSchemaSettingsItemProps {
13
13
  name: string;
14
14
  title: string | ((t: TFunction<'translation', undefined>) => string);
15
- parentSchemaKey: string;
15
+ parentSchemaKey?: string;
16
16
  defaultValue?: any;
17
17
  useDefaultValue?: () => any;
18
18
  schema: (defaultValue: any) => ISchema;
19
19
  valueKeys?: string[];
20
20
  useVisible?: () => boolean;
21
+ width?: number | string;
22
+ useSubmit?: () => (values: any) => void;
23
+ /**
24
+ * @default 'common'
25
+ */
26
+ type?: 'common' | 'field';
21
27
  }
22
28
  /**
23
29
  * create `switch` type schema settings item
@@ -6,8 +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 { SelectProps } from '@nocobase/client';
10
9
  import { TFunction } from 'react-i18next';
10
+ import { SchemaSettingsItemType } from '../types';
11
+ import { SelectProps } from '../../../schema-component/antd/select';
11
12
  interface CreateSelectSchemaSettingsItemProps {
12
13
  name: string;
13
14
  title: string | ((t: TFunction<'translation', undefined>) => string);
@@ -17,6 +18,10 @@ interface CreateSelectSchemaSettingsItemProps {
17
18
  defaultValue?: string | number;
18
19
  useDefaultValue?: () => string | number;
19
20
  useVisible?: () => boolean;
21
+ /**
22
+ * @default 'common'
23
+ */
24
+ type?: 'common' | 'field';
20
25
  }
21
26
  /**
22
27
  * create `select` type schema settings item
@@ -6,8 +6,8 @@
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 { SchemaSettingsItemType } from '@nocobase/client';
10
9
  import { TFunction } from 'react-i18next';
10
+ import { SchemaSettingsItemType } from '../types';
11
11
  export interface CreateSwitchSchemaSettingsItemProps {
12
12
  name: string;
13
13
  title: string | ((t: TFunction<'translation', undefined>) => string);
@@ -15,6 +15,10 @@ export interface CreateSwitchSchemaSettingsItemProps {
15
15
  defaultValue?: boolean;
16
16
  useDefaultValue?: () => boolean;
17
17
  useVisible?: () => boolean;
18
+ /**
19
+ * @default 'common'
20
+ */
21
+ type?: 'common' | 'field';
18
22
  }
19
23
  /**
20
24
  * create `switch` type schema settings item
@@ -9,13 +9,12 @@
9
9
  import { ISchema } from '@formily/json-schema';
10
10
  type IGetNewSchema = {
11
11
  fieldSchema: ISchema;
12
- schemaKey: string;
12
+ schemaKey?: string;
13
+ parentSchemaKey?: string;
13
14
  value: any;
14
15
  valueKeys?: string[];
15
16
  };
16
- export declare function getNewSchema(options: IGetNewSchema): {
17
- [x: number]: any;
18
- 'x-uid': any;
19
- };
17
+ export declare function getNewSchema(options: IGetNewSchema): any;
20
18
  export declare const useHookDefault: (defaultValues?: any) => any;
19
+ export declare const useSchemaByType: (type?: 'common' | 'field') => any;
21
20
  export {};
@@ -21,6 +21,10 @@ export declare class UrlFieldInterface extends CollectionFieldInterface {
21
21
  'x-component': string;
22
22
  };
23
23
  };
24
+ componentOptions: {
25
+ label: string;
26
+ value: string;
27
+ }[];
24
28
  availableTypes: string[];
25
29
  schemaInitialize(schema: ISchema, { block }: {
26
30
  block: any;
@@ -10,6 +10,12 @@ import type { ISchema } from '@formily/react';
10
10
  import type { CollectionFieldOptions } from '../collection';
11
11
  import { CollectionFieldInterfaceManager } from './CollectionFieldInterfaceManager';
12
12
  export type CollectionFieldInterfaceFactory = new (collectionFieldInterfaceManager: CollectionFieldInterfaceManager) => CollectionFieldInterface;
13
+ export interface CollectionFieldInterfaceComponentOption {
14
+ label: string;
15
+ value: string;
16
+ useVisible?: () => boolean;
17
+ useProps?: () => any;
18
+ }
13
19
  export declare abstract class CollectionFieldInterface {
14
20
  collectionFieldInterfaceManager: CollectionFieldInterfaceManager;
15
21
  constructor(collectionFieldInterfaceManager: CollectionFieldInterfaceManager);
@@ -28,6 +34,7 @@ export declare abstract class CollectionFieldInterface {
28
34
  supportDataSourceType?: string[];
29
35
  notSupportDataSourceType?: string[];
30
36
  hasDefaultValue?: boolean;
37
+ componentOptions?: CollectionFieldInterfaceComponentOption[];
31
38
  isAssociation?: boolean;
32
39
  operators?: any[];
33
40
  /**
@@ -50,4 +57,5 @@ export declare abstract class CollectionFieldInterface {
50
57
  usePathOptions?(field: CollectionFieldOptions): any;
51
58
  schemaInitialize?(schema: ISchema, data: any): void;
52
59
  hidden?: boolean;
60
+ addComponentOption(componentOption: CollectionFieldInterfaceComponentOption): void;
53
61
  }
@@ -7,7 +7,11 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import type { DataSourceManager } from '../data-source';
10
- import type { CollectionFieldInterface, CollectionFieldInterfaceFactory } from './CollectionFieldInterface';
10
+ import type { CollectionFieldInterface, CollectionFieldInterfaceComponentOption, CollectionFieldInterfaceFactory } from './CollectionFieldInterface';
11
+ interface ActionType {
12
+ type: 'addComponentOption';
13
+ data: any;
14
+ }
11
15
  export declare class CollectionFieldInterfaceManager {
12
16
  dataSourceManager: DataSourceManager;
13
17
  protected collectionFieldInterfaceInstances: Record<string, CollectionFieldInterface>;
@@ -15,11 +19,13 @@ export declare class CollectionFieldInterfaceManager {
15
19
  label: string;
16
20
  order?: number;
17
21
  }>;
22
+ protected actionList: Record<string, ActionType[]>;
18
23
  constructor(fieldInterfaceClasses: CollectionFieldInterfaceFactory[], fieldInterfaceGroups: Record<string, {
19
24
  label: string;
20
25
  order?: number;
21
26
  }>, dataSourceManager: DataSourceManager);
22
27
  addFieldInterfaces(fieldInterfaceClasses?: CollectionFieldInterfaceFactory[]): void;
28
+ addFieldInterfaceComponentOption(interfaceName: string, componentOption: CollectionFieldInterfaceComponentOption): void;
23
29
  getFieldInterface<T extends CollectionFieldInterface>(name: string): T;
24
30
  getFieldInterfaces(dataSourceType?: string): CollectionFieldInterface[];
25
31
  addFieldInterfaceGroups(groups: Record<string, {
@@ -35,3 +41,4 @@ export declare class CollectionFieldInterfaceManager {
35
41
  order?: number;
36
42
  };
37
43
  }
44
+ export {};
@@ -6,6 +6,5 @@
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 { SchemaSettings } from '../../../../application/schema-settings/SchemaSettings';
10
- export declare const fieldComponent: any;
11
- export declare const inputURLComponentFieldSettings: SchemaSettings<{}>;
9
+ import type { SchemaSettingsItemType } from '../../application';
10
+ export declare const fieldComponentSettingsItem: SchemaSettingsItemType;
@@ -6,5 +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
- import React from 'react';
10
- export declare const DeleteEventActionInitializer: (props: any) => React.JSX.Element;
9
+ export * from './fieldComponent';
@@ -16,3 +16,4 @@ export * from './data-source';
16
16
  export * from './collection-record';
17
17
  export * from './utils';
18
18
  export * from './collection-fields-to-initializer-items';
19
+ export * from './commonsSettingsItem';