Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
{props.children ? (
Children.map(props.children, child =>
React.cloneElement(child, {
className: 'col-xs-11',
name: joinName(props.name, child.props.name),
label: null,
}),
)
) : (
)}
);
export default connectField(ListItem, {
includeInChain: false,
includeParent: true,
});
id={props.id}
name={props.name}
onChange={value => props.onChange(value && value.toDate())}
placeholder={props.placeholder}
ref={props.inputRef}
value={props.value && moment(props.value)}
{...filterDOMProps(props)}
/>,
);
Date.defaultProps = {
showTime: true,
style: { width: '100%' },
};
export default connectField(Date, { ensureValue: false });
}
{...filterDOMProps(props)}
>
{icon}
);
};
ListAdd.defaultProps = {
fullWidth: true,
icon: '+',
margin: 'dense',
};
export default connectField(ListAdd, {
includeParent: true,
initialValue: false,
});
case Date: component = DateField; break;
case Array: component = ListField; break;
case Number: component = NumField; break;
case Object: component = NestField; break;
case String: component = TextField; break;
case Boolean: component = BoolField; break;
default: throw new Error(`Unsupported field type: ${props.type.toString()}`);
}
}
}
return createElement(component, props);
};
export default connectField(Auto, {includeInChain: false});
{Array.from({length: max}, (_, index) => index + 1)
.map(index => (
<span style="{{">
disabled || onChange(!required && value === index ? null : index)
}
>
{index <= value ? '★' : '☆'}
</span>
))}
);
const RatingField = connectField(Rating);
export default function ExamplesRangeField() {
return (
alert(JSON.stringify(model, null, 2))}
>
<br>
);
}
<div>
limitNotReached &&
parent.onChange(parent.value.concat([cloneDeep(value)]))
}
{...filterDOMProps(props)}
>
{addIcon}
</div>
);
};
ListAdd.defaultProps = { addIcon: <i> };
export default connectField(ListAdd, {
includeParent: true,
initialValue: false,
});
</i>
{legend || label}
),
children,
);
};
const Select = ({ checkboxes, ...props }: any) =>
checkboxes ? renderCheckboxes(props) : renderSelect(props);
Select.defaultProps = {
appearance: 'checkbox',
fullWidth: true,
margin: 'dense',
};
export default connectField(Select);
{props.children ? (
Children.map(props.children, child =>
React.cloneElement(child, {
name: joinName(props.name, child.props.name),
label: null,
}),
)
) : (
)}
);
export default connectField(ListItem, {
includeInChain: false,
includeParent: true,
});
className={classnames('panel panel-danger text-danger', className)}
{...filterDOMProps(props)}
>
<div>
{children ? (
children
) : (
<div>
<h4>{errorMessage}</h4>
</div>
)}
</div>
);
export default connectField(Error, { initialValue: false });
limitNotReached ? 'link' : 'disabled',
'fitted close icon',
)}
onClick={() =>
limitNotReached &&
parent.onChange(
[]
.concat(parent.value.slice(0, fieldIndex))
.concat(parent.value.slice(1 + fieldIndex)),
)
}
/>
);
};
export default connectField(ListDel, {
includeParent: true,
initialValue: false,
});