Skip to content

Commit 421f434

Browse files
committed
feat: button group
1 parent 1f9f15b commit 421f434

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

source/php/Module/FormatSteps.php

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -156,26 +156,10 @@ private function mapUrl(array $field): array
156156

157157
return $mapped;
158158
}
159-
160-
// TODO: We do not have anything like this
159+
161160
private function mapButtonGroup(array $field): array
162161
{
163-
$mapped = $this->mapBasic($field, 'buttonGroup');
164-
$mapped['type'] = 'radio';
165-
166-
$mapped['choices'] = [];
167-
foreach ($field['choices'] as $key => $value) {
168-
$mapped['choices'][$key] = [
169-
'type' => $mapped['type'],
170-
'label' => $value,
171-
'required' => $mapped['required'] ?? false,
172-
'name' => $field['key'],
173-
'value' => $key,
174-
'checked' => ($field['default_value'] ?? '') === $key,
175-
];
176-
}
177-
178-
return $mapped;
162+
return $this->mapRadio($field);
179163
}
180164

181165
private function mapTimePicker(array $field): array

0 commit comments

Comments
 (0)