19 declare(strict_types=1);
43 'delete' => [
' ',
'',
'1%',
true],
44 ...$this->table->columns(),
45 'actions' => [$this->table->ui()->txt(
'actions'),
'',
'10%'],
51 $config->
addMultiCommand(
'deleteDocuments', $this->table->ui()->txt(
'delete'));
52 $config->
addCommandButton(
'saveOrder', $this->table->ui()->txt(
'sorting_save'));
53 $this->table->config($config);
58 return $this->table->mapSelection($this->
row(...), $select);
63 $link = $this->table->ui()->create()->link()->standard(...);
68 ...array_slice($this->table->row($document, $sorting), 1),
69 'criteria' => $this->table->showCriteria($document, $this->willShowCriterion($document)),
70 'actions' => $this->table->ui()->create()->dropdown()->standard([
71 $link($this->table->ui()->txt(
'edit'), $this->edit_links->editDocument($document)),
72 $link($this->table->ui()->txt(
'tbl_docs_action_add_criterion'), $this->edit_links->addCriterion($document)),
73 $link($this->table->ui()->txt(
'delete'), $this->edit_links->deleteDocument($document)),
78 public function name(): string
85 return function (
Criterion $criterion) use ($document) {
86 $modal = $this->table->ui()->create()->modal()->interruptive(
87 $this->table->ui()->txt(
'doc_detach_crit_confirm_title'),
88 $this->table->ui()->txt(
'doc_sure_detach_crit'),
89 $this->edit_links->deleteCriterion($document, $criterion)
93 $this->table->ui()->create()->legacy(
'<div style="display: flex">'),
94 $this->table->criterionName($criterion),
95 $this->table->ui()->create()->legacy(
' '),
97 $this->table->ui()->create()->dropdown()->standard([
98 $this->table->ui()->create()->link()->standard($this->table->ui()->txt(
'edit'), $this->edit_links->editCriterion($document, $criterion)),
99 $this->table->ui()->create()->button()->shy($this->table->ui()->txt(
'delete'),
'')->withOnClick($modal->getShowSignal()),
101 $this->table->ui()->create()->legacy(
'</div>'),
108 $input = $this->table->orderInputGui($document, $step);
109 $input->setDisabled(
false);
111 return $input->render(...);
row(Document $document, int $sorting)
config(TableConfig $config)
rows(TableSelection $select)
willShowCriterion($document)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
__construct(private readonly DocumentTable $table, private readonly EditLinks $edit_links)
orderInputGui($document, $step)
addMultiCommand(string $a_cmd, string $a_text)