18 declare(strict_types=1);
40 abstract class File implements FileDropzone
60 $this->clear_signal = $signal_generator->
create();
62 if (null !== $additional_input) {
63 $inputs = [$file_input, $additional_input];
91 return $this->
modal->getTitle();
98 $clone->modal = $clone->modal->withOnClose($signal);
104 $clone = clone $this;
106 $clone->modal = $clone->modal->appendOnClose($signal);
112 return $this->
modal->getAsyncRenderUrl();
117 $clone = clone $this;
118 $clone->modal = $clone->modal->withAsyncRenderUrl($url);
124 $clone = clone $this;
125 $clone->modal = $clone->modal->withCloseWithKeyboard($state);
131 return $this->
modal->getCloseWithKeyboard();
136 return $this->
modal->getShowSignal();
141 return $this->
modal->getCloseSignal();
146 $clone = clone $this;
147 $clone->modal = $clone->modal->withOnLoad($signal);
153 $clone = clone $this;
154 $clone->modal = $clone->modal->appendOnLoad($signal);
160 return $this->
modal->getContent();
165 return $this->
modal->getActionButtons();
170 return $this->
modal->getCancelButtonLabel();
175 $clone = clone $this;
176 $clone->modal = $clone->modal->withActionButtons($buttons);
182 $clone = clone $this;
183 $clone->modal = $clone->modal->withCancelButtonLabel($label);
189 return $this->
modal->getReplaceSignal();
194 return $this->
modal->getPostURL();
199 $clone = clone $this;
200 $clone->modal = $clone->modal->withSubmitCaption($caption);
206 return $this->
modal->getSubmitCaption();
211 return $this->
modal->getInputs();
214 public function withRequest(ServerRequestInterface $request): self
216 $clone = clone $this;
217 $clone->modal = $clone->modal->withRequest($request);
223 $clone = clone $this;
224 $clone->modal = $clone->modal->withAdditionalTransformation($trafo);
230 return $this->
modal->getData();
235 return $this->
modal->getError();
250 $clone = clone $this;
251 $clone->initSignals();
257 $this->clear_signal = $this->signal_generator->create();
258 $this->
modal->initSignals();
withCloseWithKeyboard(bool $state)
Get a modal like this which can or cannot be closed by keyboard (ESC), depending on the given $state...
appendTriggeredSignal(C\Signal $signal, string $event)
Append a triggered signal to other signals of the same event.
withOnDrop(Signal $signal)
Get a component like this, triggering a signal of another component when files have been dropped...
getShowSignal()
Get the signal to show this modal in the frontend.
getCancelButtonLabel()
Get the label of the cancel button in the footer, as language key.
withTriggeredSignal(C\Signal $signal, string $event)
Add a triggered signal, replacing any other signals registered on the same event. ...
withSubmitCaption(string $caption)
withCancelButtonLabel(string $label)
Get the modal like this with the provided cancel button string.
initSignals()
Init the default signals plus extra signals like Replace.
withRequest(ServerRequestInterface $request)
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
getClearSignal()
Returns a signal that can be used to clear the current file queue.
getReplaceSignal()
Get the signal to replace the content of this modal.
getContent()
Get the components representing the content of the modal.
withAdditionalDrop(Signal $signal)
Get a component like this, triggering a signal of another component when files have been dropped...
appendOnLoad(Signal $signal)
Get a component like this, triggering a signal of another component on load.
withOnLoad(Signal $signal)
Trigger a signal of another component on load.
getAsyncRenderUrl()
Get the url returning the rendered modal, if the modals content should be rendered via ajax...
getCloseSignal()
Get the signal to close this modal in the frontend.
withOnClose(Signal $signal)
Get a component like this, triggering a signal of another component on close.
withAdditionalTransformation(Transformation $trafo)
This signal replaces a component by ajax.
SignalGeneratorInterface $signal_generator
getTitle()
Get the custom title if set.
create(string $class='')
Create a signal, each created signal MUST have a unique ID.
getActionButtons()
Get all action buttons in the footer of the modal.
__construct(SignalGeneratorInterface $signal_generator, FieldFactory $field_factory, NameSource $name_source, string $title, string $post_url, FileInput $file_input, ?FormInput $additional_input)
withResetSignals()
Get a component like this but reset (regenerate) its signals.
withActionButtons(array $buttons)
Get a modal like this with the provided action buttons in the footer.
appendOnClose(Signal $signal)
Get a component like this, triggering a signal of another component on close.
getCloseWithKeyboard()
Returns if this modal can be closed with the keyboard (ESC key)
withAsyncRenderUrl(string $url)
Get a modal like this who's content is rendered via ajax by the given $url before the modal is shown...
withDedicatedName(string $dedicated_name)
No dedicated name can be set for this subform.