@nocobase/client 0.21.0-alpha.1 → 0.21.0-alpha.3

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 (92) hide show
  1. package/es/acl/ACLProvider.d.ts +1 -1
  2. package/es/block-provider/BlockProvider.d.ts +36 -3
  3. package/es/block-provider/DetailsBlockProvider.d.ts +5 -2
  4. package/es/block-provider/FormBlockProvider.d.ts +11 -0
  5. package/es/block-provider/FormFieldProvider.d.ts +15 -0
  6. package/es/block-provider/TableBlockProvider.d.ts +9 -0
  7. package/es/block-provider/TableFieldProvider.d.ts +15 -0
  8. package/es/block-provider/TableSelectorProvider.d.ts +3 -0
  9. package/es/block-provider/TemplateBlockProvider.d.ts +3 -0
  10. package/es/block-provider/hooks/index.d.ts +5 -5
  11. package/es/block-provider/hooks/useDataBlockParentRecord.d.ts +17 -0
  12. package/es/block-provider/hooks/useFormActiveFields.d.ts +1 -0
  13. package/es/block-provider/hooks/useParsedFilter.d.ts +5 -0
  14. package/es/collection-manager/interfaces/nanoid.d.ts +7 -0
  15. package/es/collection-manager/interfaces/properties/index.d.ts +7 -0
  16. package/es/collection-manager/interfaces/uuid.d.ts +7 -0
  17. package/es/collection-manager/templates/sql.d.ts +8 -0
  18. package/es/collection-manager/templates/view.d.ts +9 -1
  19. package/es/index.d.ts +4 -3
  20. package/es/index.mjs +6338 -6168
  21. package/es/modules/actions/add-new/createFormBlockInitializers.d.ts +1 -0
  22. package/es/modules/actions/add-record/customizeCreateFormBlockInitializers.d.ts +1 -0
  23. package/es/modules/blocks/data-blocks/details-multi/DetailsActionInitializers.d.ts +1 -0
  24. package/es/modules/blocks/data-blocks/details-multi/hooks/useDetailsWithPaginationDecoratorProps.d.ts +1 -1
  25. package/es/modules/blocks/data-blocks/details-single/ReadPrettyFormActionInitializers.d.ts +1 -0
  26. package/es/modules/blocks/data-blocks/details-single/ReadPrettyFormItemInitializers.d.ts +1 -1
  27. package/es/modules/blocks/data-blocks/details-single/createDetailsUISchema.d.ts +4 -0
  28. package/es/modules/blocks/data-blocks/details-single/hooks/useDetailsDecoratorProps.d.ts +7 -1
  29. package/es/modules/blocks/data-blocks/form/createEditFormBlockUISchema.d.ts +4 -0
  30. package/es/modules/blocks/data-blocks/form/createFormActionInitializers.d.ts +1 -0
  31. package/es/modules/blocks/data-blocks/form/formItemInitializers.d.ts +1 -0
  32. package/es/modules/blocks/data-blocks/form/hooks/useCreateFormBlockDecoratorProps.d.ts +1 -1
  33. package/es/modules/blocks/data-blocks/form/hooks/useEditFormBlockDecoratorProps.d.ts +1 -1
  34. package/es/modules/blocks/data-blocks/form/updateFormActionInitializers.d.ts +1 -0
  35. package/es/modules/blocks/data-blocks/grid-card/GridCardActionInitializers.d.ts +1 -0
  36. package/es/modules/blocks/data-blocks/grid-card/gridCardItemActionInitializers.d.ts +1 -0
  37. package/es/modules/blocks/data-blocks/grid-card/hooks/useGridCardBlockDecoratorProps.d.ts +1 -1
  38. package/es/modules/blocks/data-blocks/list/ListActionInitializers.d.ts +1 -0
  39. package/es/modules/blocks/data-blocks/list/hooks/useListBlockDecoratorProps.d.ts +1 -1
  40. package/es/modules/blocks/data-blocks/list/listItemActionInitializers.d.ts +1 -0
  41. package/es/modules/blocks/data-blocks/table/TableActionColumnInitializers.d.ts +1 -0
  42. package/es/modules/blocks/data-blocks/table/TableActionInitializers.d.ts +1 -0
  43. package/es/modules/blocks/data-blocks/table/TableColumnInitializers.d.ts +1 -0
  44. package/es/modules/blocks/data-blocks/table/hooks/useTableBlockDecoratorProps.d.ts +1 -1
  45. package/es/modules/blocks/data-blocks/table/hooks/useTableBlockProps.d.ts +6 -15
  46. package/es/modules/blocks/filter-blocks/collapse/filterCollapseItemInitializer.d.ts +1 -0
  47. package/es/modules/blocks/filter-blocks/form/FilterFormActionInitializers.d.ts +1 -0
  48. package/es/modules/blocks/filter-blocks/form/filterFormItemInitializers.d.ts +1 -0
  49. package/es/modules/blocks/useParentRecordCommon.d.ts +7 -0
  50. package/es/modules/blocks/useSourceKey.d.ts +6 -0
  51. package/es/modules/fields/component/Picker/TableSelectorInitializers.d.ts +1 -0
  52. package/es/modules/page/BlockInitializers.d.ts +1 -0
  53. package/es/route-switch/antd/admin-layout/index.d.ts +1 -1
  54. package/es/schema-component/antd/action/Action.Designer.d.ts +1 -0
  55. package/es/schema-component/antd/action/context.d.ts +2 -0
  56. package/es/schema-component/antd/action/hooks.d.ts +2 -0
  57. package/es/schema-component/antd/association-field/schema.d.ts +4 -1
  58. package/es/schema-component/antd/association-filter/AssociationFilter.Item.d.ts +1 -1
  59. package/es/schema-component/antd/association-filter/AssociationFilter.d.ts +1 -1
  60. package/es/schema-component/antd/filter/FilterAction.d.ts +1 -1
  61. package/es/schema-component/antd/input-number/ReadPretty.d.ts +1 -1
  62. package/es/schema-component/antd/table-v2/Table.d.ts +57 -0
  63. package/es/schema-component/antd/table-v2/index.d.ts +1 -0
  64. package/es/schema-component/core/SchemaComponent.d.ts +8 -1
  65. package/es/schema-component/hooks/useTableSize.d.ts +1 -1
  66. package/es/schema-component/types.d.ts +1 -0
  67. package/es/schema-initializer/buttons/CustomFormItemInitializers.d.ts +1 -0
  68. package/es/schema-initializer/buttons/RecordBlockInitializers.d.ts +1 -0
  69. package/es/schema-initializer/buttons/SubTableActionInitializers.d.ts +1 -0
  70. package/es/schema-initializer/buttons/TabPaneInitializers.d.ts +4 -4
  71. package/es/schema-initializer/items/DataBlockInitializer.d.ts +2 -0
  72. package/es/schema-initializer/utils.d.ts +9 -37
  73. package/es/schema-settings/DataTemplates/FormDataTemplates.d.ts +1 -1
  74. package/es/schema-settings/EnableChildCollections/index.d.ts +1 -1
  75. package/es/schema-settings/LinkageRules/LinkageRuleActionGroup.d.ts +1 -9
  76. package/es/schema-settings/LinkageRules/index.d.ts +1 -21
  77. package/es/schema-settings/index.d.ts +1 -0
  78. package/lib/index.js +301 -334
  79. package/lib/locale/en_US.js +1 -0
  80. package/lib/locale/es_ES.js +1 -0
  81. package/lib/locale/fr_FR.js +1 -0
  82. package/lib/locale/ja_JP.js +1 -0
  83. package/lib/locale/ko_KR.js +1 -0
  84. package/lib/locale/ru_RU.js +1 -0
  85. package/lib/locale/tr_TR.js +1 -0
  86. package/lib/locale/uk_UA.js +1 -0
  87. package/lib/locale/zh-CN.js +7 -1
  88. package/lib/locale/zh-TW.js +1 -0
  89. package/package.json +6 -5
  90. package/es/acl/Configuration/schemas/roleCollections.d.ts +0 -2
  91. package/es/block-provider/hooks/useDataBlockSourceId.d.ts +0 -11
  92. package/es/modules/blocks/data-blocks/form/hooks/useFormBlockSourceId.d.ts +0 -1
@@ -20,7 +20,7 @@ export declare const useRecordPkValue: () => any;
20
20
  export declare const ACLActionProvider: (props: any) => React.JSX.Element;
21
21
  export declare const useACLFieldWhitelist: () => {
22
22
  whitelist: any[];
23
- schemaInWhitelist(fieldSchema: Schema, isSkip?: any): boolean;
23
+ schemaInWhitelist: (fieldSchema: Schema, isSkip?: any) => boolean;
24
24
  };
25
25
  export declare const ACLCollectionFieldProvider: (props: any) => React.JSX.Element;
26
26
  export declare const ACLMenuItemProvider: (props: any) => React.JSX.Element;
@@ -18,16 +18,28 @@ export declare const BlockRequestContext_deprecated: React.Context<{
18
18
  __parent?: any;
19
19
  updateAssociationValues?: any[];
20
20
  }>;
21
+ /**
22
+ * @deprecated
23
+ * use `useDataBlockResource` instead
24
+ * @returns
25
+ */
21
26
  export declare const useBlockResource: () => any;
27
+ /**
28
+ * @internal
29
+ * @param props
30
+ * @returns
31
+ */
22
32
  export declare const MaybeCollectionProvider: (props: any) => any;
23
33
  /**
24
34
  * @deprecated
35
+ * use `DataBlockRequestProvider` instead
25
36
  * @param props
26
37
  * @returns
27
38
  */
28
39
  export declare const BlockRequestProvider_deprecated: (props: any) => React.JSX.Element;
29
40
  /**
30
41
  * @deprecated
42
+ * use `useDataBlockRequest` instead
31
43
  */
32
44
  export declare const useBlockRequestContext: () => {
33
45
  block?: string;
@@ -39,13 +51,23 @@ export declare const useBlockRequestContext: () => {
39
51
  __parent?: any;
40
52
  updateAssociationValues?: any[];
41
53
  };
54
+ /**
55
+ * @internal
56
+ * @param props
57
+ * @returns
58
+ */
42
59
  export declare const RenderChildrenWithAssociationFilter: React.FC<any>;
60
+ /**
61
+ * @internal
62
+ * @returns
63
+ */
43
64
  export declare const useBlockContext: () => {
44
65
  /** 用以区分区块的标识 */
45
66
  name: string;
46
67
  };
47
68
  /**
48
- * @deprecated use `DataBlockProvider` instead
69
+ * @deprecated
70
+ * use `DataBlockProvider` instead
49
71
  */
50
72
  export declare const BlockProvider: (props: {
51
73
  name: string;
@@ -61,15 +83,26 @@ export declare const BlockProvider: (props: {
61
83
  /** @deprecated */
62
84
  useParams?: any;
63
85
  }) => React.JSX.Element;
86
+ /**
87
+ * @deprecated
88
+ * use `useDataBlockProps` instead
89
+ * @returns
90
+ */
64
91
  export declare const useBlockAssociationContext: () => any;
65
92
  export declare const useFilterByTk: () => any;
66
93
  /**
67
94
  * @deprecated
68
- * 已弃用,应使用 useSourceIdFromParentRecord
69
- * @returns
70
95
  */
71
96
  export declare const useSourceIdFromRecord: () => any;
97
+ /**
98
+ * @deprecated
99
+ * @returns
100
+ */
72
101
  export declare const useSourceIdFromParentRecord: () => any;
102
+ /**
103
+ * @internal
104
+ * @returns
105
+ */
73
106
  export declare const useParamsFromRecord: () => {
74
107
  filterByTk: any;
75
108
  };
@@ -1,13 +1,16 @@
1
1
  import React from 'react';
2
+ /**
3
+ * @internal
4
+ */
2
5
  export declare const DetailsBlockContext: React.Context<any>;
3
6
  export declare const DetailsBlockProvider: React.FunctionComponent<any>;
4
7
  /**
5
- * @deprecated
8
+ * @internal
6
9
  */
7
10
  export declare const useDetailsBlockContext: () => any;
8
11
  /**
9
12
  * @deprecated
10
- * 即将废弃,请用 useDetailsWithPaginationProps 或者 useDetailsProps
13
+ * use `useDetailsWithPaginationProps` or `useDetailsProps` instead
11
14
  * @returns
12
15
  */
13
16
  export declare const useDetailsBlockProps: () => {
@@ -16,6 +16,7 @@ export declare const FormBlockContext: React.Context<{
16
16
  formRecord?: CollectionRecord;
17
17
  }>;
18
18
  /**
19
+ * @internal
19
20
  * 获取表单区块的类型:update 表示是表单编辑区块,create 表示是表单新增区块
20
21
  * @returns
21
22
  */
@@ -24,6 +25,10 @@ export declare const useFormBlockType: () => {
24
25
  };
25
26
  export declare const useIsDetailBlock: () => boolean;
26
27
  export declare const FormBlockProvider: React.FunctionComponent<any>;
28
+ /**
29
+ * @internal
30
+ * @returns
31
+ */
27
32
  export declare const useFormBlockContext: () => {
28
33
  [key: string]: any;
29
34
  form?: any;
@@ -38,7 +43,13 @@ export declare const useFormBlockContext: () => {
38
43
  params?: any;
39
44
  formRecord?: CollectionRecord;
40
45
  };
46
+ /**
47
+ * @internal
48
+ */
41
49
  export declare const useFormBlockProps: () => {
42
50
  form: any;
43
51
  };
52
+ /**
53
+ * @internal
54
+ */
44
55
  export declare const findFormBlock: (schema: Schema) => Schema<any, any, any, any, any, any, any, any, any>;
@@ -1,8 +1,23 @@
1
1
  import React from 'react';
2
+ /**
3
+ * @internal
4
+ */
2
5
  export declare const FormFieldContext: React.Context<any>;
6
+ /**
7
+ * @internal
8
+ */
3
9
  export declare const WithoutFormFieldResource: React.Context<any>;
10
+ /**
11
+ * @internal
12
+ */
4
13
  export declare const FormFieldProvider: (props: any) => React.JSX.Element;
14
+ /**
15
+ * @internal
16
+ */
5
17
  export declare const useFormFieldContext: () => any;
18
+ /**
19
+ * @internal
20
+ */
6
21
  export declare const useFormFieldProps: () => {
7
22
  form: any;
8
23
  };
@@ -1,5 +1,14 @@
1
1
  import React from 'react';
2
+ /**
3
+ * @internal
4
+ */
2
5
  export declare const TableBlockContext: React.Context<any>;
6
+ /**
7
+ * @internal
8
+ */
3
9
  export declare function getIdsWithChildren(nodes: any): any[];
4
10
  export declare const TableBlockProvider: React.FunctionComponent<any>;
11
+ /**
12
+ * @internal
13
+ */
5
14
  export declare const useTableBlockContext: () => any;
@@ -1,6 +1,9 @@
1
1
  import { Field } from '@formily/core';
2
2
  import React from 'react';
3
3
  import { APIClient } from '../api-client';
4
+ /**
5
+ * @internal
6
+ */
4
7
  export declare const TableFieldContext: React.Context<any>;
5
8
  export declare class TableFieldResource {
6
9
  field: Field;
@@ -22,9 +25,21 @@ export declare class TableFieldResource {
22
25
  update(options: any): Promise<void>;
23
26
  destroy(options: any): Promise<void>;
24
27
  }
28
+ /**
29
+ * @internal
30
+ */
25
31
  export declare const WithoutTableFieldResource: React.Context<any>;
32
+ /**
33
+ * @internal
34
+ */
26
35
  export declare const TableFieldProvider: (props: any) => React.JSX.Element;
36
+ /**
37
+ * @internal
38
+ */
27
39
  export declare const useTableFieldContext: () => any;
40
+ /**
41
+ * @internal
42
+ */
28
43
  export declare const useTableFieldProps: () => {
29
44
  size: string;
30
45
  loading: any;
@@ -6,6 +6,9 @@ type Params = {
6
6
  page?: number;
7
7
  sort?: any;
8
8
  };
9
+ /**
10
+ * @internal
11
+ */
9
12
  export declare const TableSelectorContext: React.Context<any>;
10
13
  export declare const TableSelectorParamsProvider: ({ params, children }: {
11
14
  params: Params;
@@ -1,4 +1,7 @@
1
1
  import React from 'react';
2
+ /**
3
+ * @internal
4
+ */
2
5
  export declare const useTemplateBlockContext: () => {
3
6
  templateFinshed?: boolean;
4
7
  onTemplateSuccess?: Function;
@@ -1,7 +1,7 @@
1
1
  import { ChangeEvent } from 'react';
2
+ export * from './useDataBlockParentRecord';
2
3
  export * from './useFormActiveFields';
3
4
  export * from './useParsedFilter';
4
- export * from './useDataBlockSourceId';
5
5
  export declare const usePickActionProps: () => {
6
6
  onClick(): void;
7
7
  };
@@ -39,7 +39,7 @@ export declare const useResetBlockActionProps: () => {
39
39
  onClick(): Promise<void>;
40
40
  };
41
41
  export declare const useCustomizeUpdateActionProps: () => {
42
- onClick(): Promise<void>;
42
+ onClick(e?: any, callBack?: any): Promise<void>;
43
43
  };
44
44
  export declare const useCustomizeBulkUpdateActionProps: () => {
45
45
  onClick(): Promise<void>;
@@ -51,19 +51,19 @@ export declare const useUpdateActionProps: () => {
51
51
  onClick(): Promise<void>;
52
52
  };
53
53
  export declare const useDestroyActionProps: () => {
54
- onClick(): Promise<void>;
54
+ onClick(e?: any, callBack?: any): Promise<void>;
55
55
  };
56
56
  export declare const useRemoveActionProps: (associationName: any) => {
57
57
  onClick(value: any): Promise<void>;
58
58
  };
59
59
  export declare const useDisassociateActionProps: () => {
60
- onClick(): Promise<void>;
60
+ onClick(e?: any, callBack?: any): Promise<void>;
61
61
  };
62
62
  export declare const useDetailPrintActionProps: () => {
63
63
  onClick(): Promise<void>;
64
64
  };
65
65
  export declare const useBulkDestroyActionProps: () => {
66
- onClick(): Promise<void>;
66
+ onClick(e?: any, callBack?: any): Promise<void>;
67
67
  };
68
68
  export declare const useRefreshActionProps: () => {
69
69
  onClick(): Promise<void>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @internal
3
+ * @deprecated
4
+ * 已弃用(该方法现在只是用来兼容旧版 Schema 的),请通过各个区块的 x-use-decorator-props 中获取 parentRecord
5
+ *
6
+ * 注意:这里有一个需要更改 schema 才能解决的问题,就是在获取 parentRecord 的时候无法确定(在关系字段和当前表同表时)
7
+ * 是需要从 recordData 还是 parentRecordData 中获取;解决方法是通过更改 schema,在不同类型的关系区块中
8
+ * (`通过点击关系字段按钮打开的弹窗中创建的非关系字段区块`和`关系字段区块`)使用不同的 hook。
9
+ *
10
+ * 更新:上面所说的“需要更改 schema 才能解决的问题”已在这个任务中更改:https://nocobase.height.app/T-3848/description
11
+ *
12
+ * @param param0
13
+ * @returns
14
+ */
15
+ export declare const useDataBlockParentRecord: ({ association }: {
16
+ association: string;
17
+ }) => any;
@@ -10,6 +10,7 @@ interface ProviderProps extends Partial<FormActiveFieldsProviderValue> {
10
10
  children: React.ReactNode;
11
11
  }
12
12
  /**
13
+ * @internal
13
14
  * 用于提供获取和更新当前表单区块中已显示出来的字段
14
15
  * @param param0
15
16
  * @returns
@@ -1,3 +1,8 @@
1
+ /**
2
+ * @internal
3
+ * @param param0
4
+ * @returns
5
+ */
1
6
  export declare function useParsedFilter({ filterOption }: {
2
7
  filterOption: any;
3
8
  }): {
@@ -46,6 +46,13 @@ export declare class NanoidFieldInterface extends CollectionFieldInterface {
46
46
  'x-decorator': string;
47
47
  'x-component': string;
48
48
  };
49
+ autoFill: {
50
+ type: string;
51
+ title: string;
52
+ 'x-content': string;
53
+ 'x-decorator': string;
54
+ 'x-component': string;
55
+ };
49
56
  };
50
57
  filterable: {
51
58
  operators: ({
@@ -41,6 +41,13 @@ export declare const autoIncrement: {
41
41
  'x-component': string;
42
42
  'x-disabled': string;
43
43
  };
44
+ export declare const autoFill: {
45
+ type: string;
46
+ title: string;
47
+ 'x-content': string;
48
+ 'x-decorator': string;
49
+ 'x-component': string;
50
+ };
44
51
  export declare const relationshipType: ISchema;
45
52
  export declare const constraintsProps: {
46
53
  onDelete: {
@@ -33,6 +33,13 @@ export declare class UUIDFieldInterface extends CollectionFieldInterface {
33
33
  'x-disabled': string;
34
34
  description: string;
35
35
  };
36
+ autoFill: {
37
+ type: string;
38
+ title: string;
39
+ 'x-content': string;
40
+ 'x-decorator': string;
41
+ 'x-component': string;
42
+ };
36
43
  };
37
44
  filterable: {
38
45
  operators: ({
@@ -9,6 +9,14 @@ export declare class SqlCollectionTemplate extends CollectionTemplate {
9
9
  fields: any[];
10
10
  };
11
11
  configurableProperties: {
12
+ filterTargetKey: {
13
+ title: string;
14
+ type: string;
15
+ description: string;
16
+ 'x-decorator': string;
17
+ 'x-component': string;
18
+ 'x-reactions': string[];
19
+ };
12
20
  name: any;
13
21
  title: any;
14
22
  description: any;
@@ -88,7 +88,7 @@ export declare class ViewCollectionTemplate extends CollectionTemplate {
88
88
  fields: {
89
89
  type: string;
90
90
  'x-component': import("react").MemoExoticComponent<(props: any) => import("react").JSX.Element>;
91
- 'x-visible': string;
91
+ 'x-hidden': string;
92
92
  'x-reactions': {
93
93
  dependencies: string[];
94
94
  fulfill: {
@@ -111,5 +111,13 @@ export declare class ViewCollectionTemplate extends CollectionTemplate {
111
111
  };
112
112
  };
113
113
  };
114
+ filterTargetKey: {
115
+ title: string;
116
+ type: string;
117
+ description: string;
118
+ 'x-decorator': string;
119
+ 'x-component': string;
120
+ 'x-reactions': string[];
121
+ };
114
122
  };
115
123
  }
package/es/index.d.ts CHANGED
@@ -20,6 +20,7 @@ export * from './china-region';
20
20
  export * from './collection-manager';
21
21
  export * from './common';
22
22
  export * from './css-variable';
23
+ export * from './data-source';
23
24
  export * from './document-title';
24
25
  export * from './filter-provider';
25
26
  export * from './flag-provider';
@@ -45,10 +46,10 @@ export * from './system-settings';
45
46
  export * from './testUtils';
46
47
  export * from './user';
47
48
  export * from './variables';
48
- export * from './data-source';
49
49
  export { withDynamicSchemaProps } from './application/hoc/withDynamicSchemaProps';
50
50
  export * from './modules/blocks/BlockSchemaToolbar';
51
- export * from './modules/blocks/data-blocks/table';
51
+ export * from './modules/blocks/data-blocks/details-multi/setDataLoadingModeSettingsItem';
52
52
  export * from './modules/blocks/data-blocks/form';
53
+ export * from './modules/blocks/data-blocks/table';
53
54
  export * from './modules/blocks/data-blocks/table-selector';
54
- export * from './modules/blocks/data-blocks/details-multi/setDataLoadingModeSettingsItem';
55
+ export * from './modules/blocks/useParentRecordCommon';