-
Notifications
You must be signed in to change notification settings - Fork 554
/
MultiSelect.php
64 lines (60 loc) · 1.78 KB
/
MultiSelect.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
namespace A17\Twill\View\Components\Fields;
use Illuminate\Contracts\View\View;
class MultiSelect extends FieldWithOptions
{
public function __construct(
string $name,
string $label,
bool $renderForBlocks = false,
bool $renderForModal = false,
bool $translated = false,
bool $required = false,
?string $note = '',
mixed $default = null,
bool $disabled = false,
bool $readOnly = false,
bool $inModal = false,
// FieldWithOptions
mixed $options = null,
bool $unpack = false,
int $columns = 0,
bool $searchable = false,
?string $placeholder = null,
bool $addNew = false,
?string $moduleName = null,
?string $storeUrl = null,
// Component specific
public ?int $min = null,
public ?int $max = null,
public ?string $endpoint = null,
public bool $taggable = false,
public bool $pushTags = false
) {
parent::__construct(
name: $name,
label: $label,
renderForBlocks: $renderForBlocks,
renderForModal: $renderForModal,
translated: $translated,
required: $required,
note: $note,
default: $default,
disabled: $disabled,
readOnly: $readOnly,
inModal: $inModal,
options: $options,
unpack: $unpack,
columns: $columns,
searchable: $searchable,
placeholder: $placeholder,
addNew: $addNew,
moduleName: $moduleName,
storeUrl: $storeUrl,
);
}
public function render(): View
{
return view('twill::partials.form._multi_select', $this->data());
}
}