- {rows.length > 0 && rows.map((row, i) => {
- const rowNumber = i + 1;
- const fallbackLabel = `${getTranslation(labels.singular, i18n)} ${String(rowNumber).padStart(2, '0')}`;
-
- return (
-
- {(providedDrag) => (
-
-
setCollapse(row.id, collapsed)}
- className={`${baseClass}__row`}
- key={row.id}
- dragHandleProps={providedDrag.dragHandleProps}
- header={(
-
- )}
- actions={!readOnly ? (
-
- ) : undefined}
- >
-
- ({
- ...field,
- path: createNestedFieldPath(`${path}.${i}`, field),
- }))}
- />
-
-
-
- )}
-
- );
- })}
- {!checkSkipValidation(value) && (
-
- {(rows.length < minRows || (required && rows.length === 0)) && (
-
- {t('validation:requiresAtLeast', {
- count: minRows,
- label: getTranslation(minRows ? labels.plural : labels.singular, i18n) || t(minRows > 1 ? 'general:row' : 'general:rows'),
- })}
-
- )}
- {(rows.length === 0 && readOnly) && (
-
- {t('validation:fieldHasNo', { label: getTranslation(labels.plural, i18n) })}
-
- )}
-
- )}
- {provided.placeholder}
-
- )}
-