/**
* {@inheritdoc}
*/
protected function buildInputElement(array
$form, FormStateInterface
$form_state) { // Create a file item to get the upload validators.
$media_type =
$this->
getMediaType($form_state);
$item =
$this->
createFileItem($media_type);
/** @var \Drupal\media_library\MediaLibraryState $state */
$state =
$this->
getMediaLibraryState($form_state);
if (!
$state->
hasSlotsAvailable()) { return $form;
} $slots =
$state->
getAvailableSlots();
// Add a container to group the input elements for styling purposes.
$form['container'
] =
[ '#type' => 'container',
];
$process =
(array) $this->elementInfo->
getInfoProperty('managed_file', '#process',
[]);