@hzab/list-render 1.10.20-alpha.3 → 1.10.20-alpha.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hzab/list-render",
3
- "version": "1.10.20-alpha.3",
3
+ "version": "1.10.20-alpha.5",
4
4
  "description": "",
5
5
  "main": "src",
6
6
  "scripts": {
@@ -26,7 +26,7 @@
26
26
  "devDependencies": {
27
27
  "@ant-design/icons": "^4.8.1",
28
28
  "@hzab/data-model": "^2.0.2",
29
- "@hzab/form-render": "^1.7.13",
29
+ "@hzab/form-render": "^1.7.14",
30
30
  "@hzab/formily-result-utils": "^1.2.0",
31
31
  "@hzab/permissions": "^1.0.0",
32
32
  "@hzab/schema-descriptions": "^1.3.0",
@@ -51,7 +51,7 @@
51
51
  "@formily/react": "2.3.1",
52
52
  "@formily/reactive-react": "2.3.1",
53
53
  "@hzab/data-model": ">=1.7.4",
54
- "@hzab/form-render": ">=1.0.0",
54
+ "@hzab/form-render": ">=1.7.14",
55
55
  "@hzab/formily-result-utils": ">=1.2.0",
56
56
  "@hzab/schema-descriptions": ">=1.0.0",
57
57
  "@hzab/utils": ">=1.0.7",
@@ -41,8 +41,10 @@ export const useSlotsComponents = (props) => {
41
41
  Object.keys(formilyComponents || {}).forEach((key) => {
42
42
  formilyComponents[key] = function (cProps) {
43
43
  const field = useField();
44
- const index = useIndex();
45
- const record = useRecord();
44
+ // useIndex 适用于 ArrayTable 默认表单从 props 获取
45
+ const index = useIndex() ?? cProps.index;
46
+ // useRecord 适用于 ArrayTable 默认表单从 props 获取
47
+ const record = useRecord() ?? cProps.record;
46
48
 
47
49
  const fieldSchema = useFieldSchema();
48
50
  const name = fieldSchema.name;
@@ -59,7 +61,7 @@ export const useSlotsComponents = (props) => {
59
61
  ...cProps,
60
62
  index,
61
63
  record,
62
- text: cProps.value,
64
+ text: cProps.value || cProps.text,
63
65
  field: field,
64
66
  fieldSchema: fieldSchema,
65
67
  /** 原始组件 */
@@ -103,7 +103,7 @@ const TableRender = forwardRef(function (props, tableRef) {
103
103
  });
104
104
 
105
105
  useEffect(() => {
106
- if (!propsSchema.properties) {
106
+ if (!propsSchema?.properties) {
107
107
  return;
108
108
  }
109
109
  const fieldList = getFieldList(propsSchema, [], { ...props.getFieldListOpt, formilyRef }, isTableSortXIdex);
@@ -313,6 +313,7 @@ const TableRender = forwardRef(function (props, tableRef) {
313
313
  return {
314
314
  ..._onRowRes,
315
315
  record,
316
+ index,
316
317
  id: record[props.idKey || "id"],
317
318
  rowFormMapRef,
318
319
  editingInofRef,