@hzab/list-render 1.12.6 → 1.12.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/docs/table.md ADDED
@@ -0,0 +1,86 @@
1
+ # 表格相关
2
+
3
+ ## query 相关
4
+
5
+ #### 设置过滤项
6
+
7
+ ```JSX
8
+ <ListRender
9
+ schema={schema}
10
+ model={listDM}
11
+ // 字段为 search 的 query
12
+ search="模糊搜索"
13
+ // 传入 schema 中所需表单项的 name
14
+ filters={["userId"]}
15
+ />
16
+ ```
17
+
18
+ #### 开启重置按钮
19
+
20
+ ```JSX
21
+ <ListRender
22
+ schema={schema}
23
+ model={listDM}
24
+ // 字段为 search 的 query
25
+ search="模糊搜索"
26
+ // 传入 schema 中所需表单项的 name
27
+ filters={["userId"]}
28
+ queryConf={{
29
+ hasReset: true
30
+ }}
31
+ />
32
+ ```
33
+
34
+ ## 顶部操作栏(新增按钮附近)
35
+
36
+ #### 新增按钮右侧添加其他组件
37
+
38
+ - 使用 Slots 实现
39
+
40
+ ```JSX
41
+ const Slots = {
42
+ headerActionSuffix() {
43
+ return (<div>headerActionPrefix</div>)
44
+ },
45
+ };
46
+
47
+ <ListRender schema={schema} model={listDM} Slots={Slots} />
48
+ ```
49
+
50
+ ## table 相关
51
+
52
+ #### 手动发起请求
53
+
54
+ ```JSX
55
+
56
+ // 手动发起请求
57
+ useEffect(() => {
58
+ // 重置 pageNum 为1,并发起请求
59
+ listRef.current?.onSearch();
60
+ // 请求当前页数据
61
+ listRef.current?.getList();
62
+ }, []);
63
+
64
+ <ListRender
65
+ ref={listRef}
66
+ schema={schema}
67
+ model={listDM}
68
+ // 关闭自动发起请求
69
+ closeAutoRequest={false}
70
+ />
71
+ ```
72
+
73
+ #### 编辑按钮左侧添加组件
74
+
75
+ ```JSX
76
+ const Slots = {
77
+ actionPrefixSlot(props) {
78
+ const { text, record, index, onEdit, onDel } = props;
79
+ return (<div>actionPrefixSlot</div>)
80
+ },
81
+ };
82
+
83
+ <ListRender schema={schema} model={listDM} Slots={Slots} />
84
+ ```
85
+
86
+ ## 新增、编辑表单相关
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "@hzab/list-render",
3
- "version": "1.12.6",
3
+ "version": "1.12.8",
4
4
  "private": false,
5
5
  "src-direct": true,
6
- "type": "module",
7
6
  "description": "列表与表格渲染",
8
7
  "license": "ISC",
9
8
  "author": "CaiYansong",
@@ -25,6 +24,12 @@
25
24
  "@formily/json-schema": ">=2.0.0",
26
25
  "@formily/react": ">=2.0.0",
27
26
  "@formily/reactive": ">=2.0.0",
27
+ "@hzab/data-model": ">=2.0.5",
28
+ "@hzab/edit-table": ">=0.1.7",
29
+ "@hzab/form-render": ">=1.7.21",
30
+ "@hzab/formily-result-utils": ">=1.2.6",
31
+ "@hzab/schema-descriptions": ">=1.3.5",
32
+ "@hzab/utils": ">=1.1.9",
28
33
  "antd": ">=4.0.0",
29
34
  "array-move": "^4.0.0",
30
35
  "c-formily-antd": ">=2.0.0",
@@ -35,20 +40,14 @@
35
40
  "dependencies": {
36
41
  "@ant-design/icons": "^4.8.0",
37
42
  "dayjs": "^1.11.7",
38
- "lodash": "^4.17.21",
39
- "@hzab/data-model": ">=1.7.4",
40
- "@hzab/edit-table": ">=0.0.1",
41
- "@hzab/form-render": ">=1.0.0",
42
- "@hzab/formily-result-utils": ">=1.2.0",
43
- "@hzab/schema-descriptions": ">=1.0.0",
44
- "@hzab/utils": ">=1.0.7"
43
+ "lodash": "^4.17.21"
45
44
  },
46
45
  "devDependencies": {
47
46
  "@ant-design/icons": "^4.8.0",
48
47
  "@formily/core": "2.3.1",
49
48
  "@formily/json-schema": "^2.3.1",
50
- "@formily/reactive": "^2.3.1",
51
49
  "@formily/react": "2.3.1",
50
+ "@formily/reactive": "^2.3.1",
52
51
  "@types/lodash": "^4.17.12",
53
52
  "@types/react": "^17.0.62",
54
53
  "@types/react-dom": "^17.0.20",
@@ -64,9 +63,15 @@
64
63
  "typescript": "^5.9.3",
65
64
  "vite": "^8.0.0",
66
65
  "vitest": "^4.1.10",
66
+ "@hzab/data-model": "^2.0.5",
67
+ "@hzab/edit-table": "^0.1.7",
68
+ "@hzab/form-render": "^1.7.21",
67
69
  "@hzab/eslint-config": "^0.0.0",
68
70
  "@hzab/typescript-config": "^0.0.0",
69
- "@hzab/vite-config": "^0.0.3-alpha.0"
71
+ "@hzab/formily-result-utils": "^1.2.6",
72
+ "@hzab/utils": "^1.1.9",
73
+ "@hzab/vite-config": "^0.0.3-alpha.0",
74
+ "@hzab/schema-descriptions": "^1.3.5"
70
75
  },
71
76
  "scripts": {
72
77
  "build": "vite build && tsc -p tsconfig.build.json",