import PlusSquareOutlined from '@ant-design/icons/PlusSquareOutlined'; import Button, { ButtonProps } from 'antd/lib/button'; import cloneDeep from 'lodash/cloneDeep'; import React from 'react'; import { ConnectedField, FieldProps, connectField, filterDOMProps, joinName, useField, } from 'uniforms'; export type ListAddFieldProps = FieldProps; const defaultStyle = { width: '100%' }; function ListAdd({ disabled, icon = , name, readOnly, size = 'small', style = defaultStyle, type = 'dashed', value, ...props }: ListAddFieldProps) { const nameParts = joinName(null, name); const parentName = joinName(nameParts.slice(0, -1)); const parent = useField<{ maxCount?: number }, unknown[]>( parentName, {}, { absoluteName: true }, )[0]; const limitNotReached = !disabled && !(parent.maxCount! <= parent.value!.length); return (