'array', 'options' => 'array', 'defaultValue' => 'array', ]; /** * @var array */ protected array $options = []; /** * @var list */ protected array $defaultValue = []; #[Override] public function render(): string { $this->mergeClass('w-full bg-elevated border-3 border-contrast rounded-lg relative'); $defaultAttributes = [ 'multiple' => 'multiple', 'data-select-text' => lang('Common.forms.multiSelect.selectText'), 'data-loading-text' => lang('Common.forms.multiSelect.loadingText'), 'data-no-results-text' => lang('Common.forms.multiSelect.noResultsText'), 'data-no-choices-text' => lang('Common.forms.multiSelect.noChoicesText'), 'data-max-item-text' => lang('Common.forms.multiSelect.maxItemText'), ]; $this->attributes = [...$defaultAttributes, ...$this->attributes]; $options = ''; $selected = $this->value ?? $this->defaultValue; foreach ($this->options as $option) { $options .= ''; } $this->attributes['name'] = $this->name . '[]'; return <<getStringifiedAttributes()}>{$options} HTML; } }