Replace the per-field `section` text property with a dedicated HEADING field type that organizers add as a separate block for visual grouping. Also fixes duplicate heading bug on portal radio fields, replaces cramped VBtnToggle with VSelect for field width, and adds grouped field type dropdown with structure/input categories. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
40 lines
1017 B
PHP
40 lines
1017 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Enums;
|
|
|
|
enum FieldDisplayWidth: string
|
|
{
|
|
case FULL = 'full';
|
|
case HALF = 'half';
|
|
|
|
public function label(): string
|
|
{
|
|
return match ($this) {
|
|
self::FULL => 'Volledige breedte',
|
|
self::HALF => 'Halve breedte',
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Return the default display width for a given field type.
|
|
*/
|
|
public static function defaultForFieldType(RegistrationFieldType $fieldType): self
|
|
{
|
|
return match ($fieldType) {
|
|
RegistrationFieldType::TEXT,
|
|
RegistrationFieldType::NUMBER,
|
|
RegistrationFieldType::SELECT,
|
|
RegistrationFieldType::BOOLEAN => self::HALF,
|
|
|
|
RegistrationFieldType::TEXTAREA,
|
|
RegistrationFieldType::RADIO,
|
|
RegistrationFieldType::CHECKBOX,
|
|
RegistrationFieldType::MULTISELECT,
|
|
RegistrationFieldType::TAG_PICKER,
|
|
RegistrationFieldType::HEADING => self::FULL,
|
|
};
|
|
}
|
|
}
|