@props([ 'placeholder' => null, 'unavailable' => null, 'clearable' => null, 'dropdown' => null, 'type' => 'button', 'invalid' => null, 'value' => null, 'name' => null, 'size' => null, ]) @php // We only want to show the name attribute if it has been set manually // but not if it has been set from the `wire:model` attribute... $showName = isset($name); if (! isset($name)) { $name = $attributes->whereStartsWith('wire:model')->first(); } // Support adding the .self modifier to the wire:model directive... if (($wireModel = $attributes->wire('model')) && $wireModel->directive && ! $wireModel->hasModifier('self')) { unset($attributes[$wireModel->directive]); $wireModel->directive .= '.self'; $attributes = $attributes->merge([$wireModel->directive => $wireModel->value]); } $placeholder ??= __('Select a time'); // Mark it invalid if the property or any of it's nested attributes have errors... $invalid ??= ($name && ($errors->has($name) || $errors->has($name . '.*'))); $classes = Flux::classes() ->add('block min-w-0') // The below reverts styles added by Tailwind Forms plugin... ->add('border-0 p-0 bg-transparent') ; $optionsClasses = Flux::classes() ->add('[:where(&)]:min-w-48 [:where(&)]:max-h-[20rem] p-[.3125rem] scroll-py-[.3125rem]') ->add('rounded-lg shadow-xs') ->add('border border-zinc-200 dark:border-zinc-600') ->add('bg-white dark:bg-zinc-700') ; // Add support for `$value` being an array, if for example it's coming from // the `old()` helper or if a user prefers to pass data in as an array... if (is_array($value)) { $value = collect($value)->join(','); } if (isset($unavailable)) { $unavailable = collect($unavailable)->join(','); } if (isset($dropdown) && $dropdown === false) { $dropdown = 'false'; } @endphp class($classes) }} data-flux-control data-flux-time-picker @if (isset($dropdown)) dropdown="{{ $dropdown }}" @endif @if ($unavailable) unavailable="{{ $unavailable }}" @endif @if ($showName) name="{{ $name }}" @endif @if (isset($value)) value="{{ $value }}" @endif {{ $attributes }} >