zy-react-library 1.0.150 → 1.0.151

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.
@@ -52,7 +52,7 @@ export interface FormListUniqueProps {
52
52
  /** 删除按钮的文本,默认 '删除' */
53
53
  removeButtonText?: string;
54
54
  /** 表单配置项 */
55
- options: (field: FormListFieldData) => FormOption[];
55
+ options: (field: FormListFieldData, index: number) => FormOption[];
56
56
  /** 点击新增按钮时的默认值 */
57
57
  addDefaultValue?: FormValues;
58
58
  /** 点击新增按钮时插入的索引位置 */
@@ -223,9 +223,9 @@ const FormItemsRenderer = ({
223
223
  };
224
224
 
225
225
  // 获取 listOptions
226
- const getListOptions = (listOptions, field) => {
226
+ const getListOptions = (listOptions, field, fieldIndex) => {
227
227
  return typeof listOptions === "function"
228
- ? listOptions(field)
228
+ ? listOptions(field, fieldIndex)
229
229
  : (listOptions ?? []);
230
230
  };
231
231
 
@@ -452,7 +452,7 @@ const FormItemsRenderer = ({
452
452
  {(fields, { add, remove }) => (
453
453
  <>
454
454
  {fields.map((field, fieldIndex) => {
455
- const listOptions = getListOptions(option.formListUniqueProps.options, field);
455
+ const listOptions = getListOptions(option.formListUniqueProps.options, field, fieldIndex);
456
456
  return (
457
457
  <Row gutter={gutter} key={field.key}>
458
458
  {listOptions.map((listOption, listIndex) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zy-react-library",
3
3
  "private": false,
4
- "version": "1.0.150",
4
+ "version": "1.0.151",
5
5
  "type": "module",
6
6
  "description": "",
7
7
  "author": "LiuJiaNan",