Added a public duplicateComponent function and a duplicate button in the field widget.
Closes #3206928