@props([ /** PATCH endpoint that accepts {field, value} JSON. Required. */ 'updateUrl', /** Backend column name, e.g. "sector_option_id". Required. */ 'fieldName', /** [id => localized name] map of allowed options. Required. */ 'options' => [], /** Currently selected option_id (or null). */ 'currentId' => null, /** Currently displayed name (already localized) — falls back to em-dash. */ 'currentName' => null, /** Allow choosing "None" / clearing the value. */ 'nullable' => true, /** Optional human-readable field label, used in the confirm dialog. */ 'fieldLabel' => null, /** * Value type sent to the backend. 'int' (default) for label_options FKs, * 'string' for fields like monday_group_id whose ids are non-numeric. */ 'valueType' => 'int', ]) @php // Stable, deterministic instance id (used for ARIA + Alpine refs). $uid = 'el-' . substr(md5($fieldName . '|' . (string) $currentId . '|' . microtime(true) . '|' . random_int(0, PHP_INT_MAX)), 0, 8); $dash = '—'; $displayName = $currentName !== null && $currentName !== '' ? $currentName : $dash; @endphp
{{-- ── DISPLAY MODE ─────────────────────────────────────────────── --}} {{-- transient saved-feedback hint --}} {{-- ── EDIT MODE ────────────────────────────────────────────────── --}} {{-- ── CONFIRMATION MODAL (component-local) ─────────────────────── --}}
@once @push('scripts') @endpush @push('styles') @endpush @endonce