@if ($fieldset_id) @endif
@if ($add_default_values) @if ($this->fields) @foreach ($this->fields as $field)
@if ($field->format == "DATE" || $field->element == "date_picker")
{{-- wire:model + the input-event dispatch on change is the usual Livewire workaround so the picker's value change flows back to the component. See https://laracasts.com/discuss/channels/livewire/livewire-and-bootstrap-datepicker?page=1&replyId=623122 format=DATE and element=date_picker both render a datepicker here; the difference (native DATE column vs plain TEXT column that allows encryption) is handled at the model level, not on the default-value widget. --}}
@elseif ($field->format == "DATETIME" || $field->element == "datetime_picker") {{-- Same rationale as the datepicker branch above, applied to the datetimepicker widget. default_now=false so an empty "no default" stays empty rather than pre-filling with today's datetime. --}}
@elseif ($field->element == "text") @elseif($field->element == "textarea" || $field->element == "markdown-textarea") @elseif($field->element == "listbox") {{-- Iterate CustomField::formatFieldValuesAsArray so line-ending handling and the `key|label` split flow through the same helper the asset-edit form uses. Skip the '' key the helper prepends for listbox ("Select ") because on the model default-values page we want a truly blank "no default set" option, not a "please pick one" prompt. See #19429. --}} @elseif($field->element == "radio") {{-- Radio/checkbox mirror the asset-edit form's convention: use the display label as both the submitted value and the visible text, so stored defaults match what the asset form will render as pre-selected. --}} @foreach($field->formatFieldValuesAsArray() as $field_value) @endforeach @elseif($field->element == "checkbox") @foreach($field->formatFieldValuesAsArray() as $field_value) @endforeach @else Unknown field element: {{ $field->element }} @endif