@fe-free/core 1.4.3 → 1.4.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @fe-free/core
2
2
 
3
+ ## 1.4.5
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: curd types
8
+ - @fe-free/tool@1.4.5
9
+
10
+ ## 1.4.4
11
+
12
+ ### Patch Changes
13
+
14
+ - fix: crud types
15
+ - @fe-free/tool@1.4.4
16
+
3
17
  ## 1.4.3
4
18
 
5
19
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fe-free/core",
3
- "version": "1.4.3",
3
+ "version": "1.4.5",
4
4
  "description": "",
5
5
  "main": "./src/index.ts",
6
6
  "author": "",
@@ -35,7 +35,7 @@
35
35
  "react-syntax-highlighter": "^15.5.0",
36
36
  "vanilla-jsoneditor": "^0.23.1",
37
37
  "zustand": "^4.5.4",
38
- "@fe-free/tool": "1.4.3"
38
+ "@fe-free/tool": "1.4.5"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@ant-design/pro-components": "^2.8.7",
@@ -86,7 +86,7 @@ async function fakeDeleteByRecord(record) {
86
86
 
87
87
  fakeData = fakeData.filter((item) => item.id !== record.id);
88
88
 
89
- return Promise.resolve({});
89
+ return Promise.resolve();
90
90
  }
91
91
 
92
92
  async function fakeGetByRecord(record) {
@@ -107,7 +107,7 @@ async function fakeCreate(params) {
107
107
  ...params,
108
108
  });
109
109
 
110
- return Promise.resolve({});
110
+ return Promise.resolve();
111
111
  }
112
112
 
113
113
  async function fakeUpdateById(params) {
@@ -123,7 +123,7 @@ async function fakeUpdateById(params) {
123
123
  return item;
124
124
  });
125
125
 
126
- return Promise.resolve({});
126
+ return Promise.resolve();
127
127
  }
128
128
 
129
129
  function fakeRequestCity(): Promise<string[]> {
@@ -25,7 +25,7 @@ interface CRUDProps<DataSource = any, Key = string> {
25
25
  // *** Create 新建 ***
26
26
 
27
27
  /** 新增接口 */
28
- requestCreateByValues?: (values: Partial<DataSource>) => Promise<any>;
28
+ requestCreateByValues?: (values: Partial<DataSource>) => Promise<false | void>;
29
29
  /** 新建按钮,默认新建 */
30
30
  createButton?: ReactNode;
31
31
  /** create 更多设置 */
@@ -54,7 +54,7 @@ interface CRUDProps<DataSource = any, Key = string> {
54
54
  // *** Read 详情 ***
55
55
 
56
56
  /** 获取详情接口 */
57
- requestGetByRecord?: (record: DataSource) => Promise<any>;
57
+ requestGetByRecord?: (record: DataSource) => Promise<DataSource>;
58
58
  /** 跳转到详情的索引 ,默认 id */
59
59
  detailIdIndex?: string;
60
60
  /** read 更多设置 */
@@ -71,10 +71,10 @@ interface CRUDProps<DataSource = any, Key = string> {
71
71
 
72
72
  // *** Update 更新 ***
73
73
 
74
- /** 更新接口 */
75
- requestUpdateByValues?: (values: Partial<DataSource>) => Promise<any>;
74
+ /** 更新接口,返回 false 则不关闭弹窗 */
75
+ requestUpdateByValues?: (values: Partial<DataSource>) => Promise<false | void>;
76
76
  /** @deprecated 请使用 requestUpdateByValues 替代 */
77
- requestUpdateById?: (values: Partial<DataSource>) => Promise<any>;
77
+ requestUpdateById?: (values: Partial<DataSource>) => Promise<false | void>;
78
78
  updateProps?: {
79
79
  /** 文本 */
80
80
  operateText?: string;
@@ -89,7 +89,7 @@ interface CRUDProps<DataSource = any, Key = string> {
89
89
  // *** Delete 删除 ***
90
90
 
91
91
  /** 删除接口 */
92
- requestDeleteByRecord?: (record: DataSource) => Promise<any>;
92
+ requestDeleteByRecord?: (record: DataSource) => Promise<void>;
93
93
  /** 删除相关 */
94
94
  deleteProps?: {
95
95
  /** 显示名称索引 */
@@ -112,7 +112,7 @@ interface CRUDProps<DataSource = any, Key = string> {
112
112
  onClick: (
113
113
  event: React.MouseEvent<HTMLElement>,
114
114
  options: { selectedRowKeys: Key[]; selectedRows: DataSource[] },
115
- ) => Promise<any>;
115
+ ) => Promise<void>;
116
116
  }[];
117
117
  }
118
118