zy-react-library 1.0.178 → 1.0.179
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.
|
@@ -39,7 +39,7 @@ export interface FormListOperations {
|
|
|
39
39
|
/** 当前表单项的数据字段信息 */
|
|
40
40
|
field: FormListFieldData;
|
|
41
41
|
/** 当前项在列表中的索引位置 */
|
|
42
|
-
|
|
42
|
+
fieldIndex: number;
|
|
43
43
|
/** 新增方法 */
|
|
44
44
|
add: (defaultValue?: FormValues, insertIndex?: number) => void;
|
|
45
45
|
/** 删除方法 */
|
|
@@ -61,7 +61,7 @@ export interface FormListUniqueProps {
|
|
|
61
61
|
/** 删除按钮的文本,默认 '删除' */
|
|
62
62
|
removeButtonText?: string;
|
|
63
63
|
/** 表单配置项 */
|
|
64
|
-
options: (field: FormListFieldData, operations: FormListOperations) => FormOption[];
|
|
64
|
+
options: (field: FormListFieldData, fieldIndex: number, operations: FormListOperations) => FormOption[];
|
|
65
65
|
/** 点击新增按钮时的默认值 */
|
|
66
66
|
addDefaultValue?: FormValues;
|
|
67
67
|
/** 点击新增按钮时插入的索引位置 */
|
|
@@ -225,7 +225,7 @@ const FormItemsRenderer = ({
|
|
|
225
225
|
// 获取 listOptions
|
|
226
226
|
const getListOptions = (listOptions, field, fieldIndex, add, remove, move) => {
|
|
227
227
|
return typeof listOptions === "function"
|
|
228
|
-
? listOptions(field, { field, fieldIndex, add, remove, move })
|
|
228
|
+
? listOptions(field, fieldIndex, { field, fieldIndex, add, remove, move })
|
|
229
229
|
: (listOptions ?? []);
|
|
230
230
|
};
|
|
231
231
|
|