@php $fieldWrapperView = $getFieldWrapperView(); $id = $getId(); $isDisabled = $isDisabled(); $isMultiple = $isMultiple(); $statePath = $getStatePath(); $areButtonLabelsHidden = $areButtonLabelsHidden(); $wireModelAttribute = $applyStateBindingModifiers('wire:model'); $extraInputAttributeBag = $getExtraInputAttributeBag()->class(['fi-fo-toggle-buttons-input']); @endphp
class(['fi-fo-toggle-buttons fi-btn-group']) }} x-data="{ pendingValue: null, init() { const cleanup = Livewire.hook('commit', ({ succeed }) => { succeed(() => { this.pendingValue = null; }); }); this.$cleanup = cleanup; }, destroy() { if (this.$cleanup) this.$cleanup(); } }" > @foreach ($getOptions() as $value => $label) @php $inputId = "{$id}-{$value}"; $shouldOptionBeDisabled = $isDisabled || $isOptionDisabled($value, $label); $color = $getColor($value); $icon = $getIcon($value); @endphp {{-- Label text: hides only on the clicked button while loading --}} {{ $label }} {{-- Dot-pulse spinner: shows only on the clicked button while loading --}} @endforeach