Skip to content

Commit

Permalink
Merge pull request #2 from bfiessinger/features/config
Browse files Browse the repository at this point in the history
Features/config
  • Loading branch information
bfiessinger authored Aug 27, 2021
2 parents d1afabb + 9936848 commit 4fb8bf4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
18 changes: 17 additions & 1 deletion config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,21 @@
* You can place your custom package configuration in here.
*/
return [
'styles' => [
'default' => 'p-2 rounded border w-full appearance-none',

];
'searchSelectedOption' => 'p-2 rounded border w-full bg-white flex items-center',
'searchSelectedOptionTitle' => 'w-full text-gray-900 text-left',
'searchSelectedOptionReset' => 'h-4 w-4 text-gray-500',

'search' => 'relative',
'searchInput' => 'p-2 rounded border w-full rounded',
'searchOptionsContainer' => 'absolute top-0 left-0 mt-12 w-full z-10',

'searchOptionItem' => 'p-3 hover:bg-gray-100 cursor-pointer text-sm',
'searchOptionItemActive' => 'bg-indigo-600 text-white font-medium',
'searchOptionItemInactive' => 'bg-white text-gray-600',

'searchNoResults' => 'p-8 w-full bg-white border text-center text-xs text-gray-600',
]
];
18 changes: 1 addition & 17 deletions src/LivewireSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,23 +212,7 @@ public function allDependenciesMet()

public function styles()
{
return [
'default' => 'p-2 rounded border w-full appearance-none',

'searchSelectedOption' => 'p-2 rounded border w-full bg-white flex items-center',
'searchSelectedOptionTitle' => 'w-full text-gray-900 text-left',
'searchSelectedOptionReset' => 'h-4 w-4 text-gray-500',

'search' => 'relative',
'searchInput' => 'p-2 rounded border w-full rounded',
'searchOptionsContainer' => 'absolute top-0 left-0 mt-12 w-full z-10',

'searchOptionItem' => 'p-3 hover:bg-gray-100 cursor-pointer text-sm',
'searchOptionItemActive' => 'bg-indigo-600 text-white font-medium',
'searchOptionItemInactive' => 'bg-white text-gray-600',

'searchNoResults' => 'p-8 w-full bg-white border text-center text-xs text-gray-600',
];
return config('livewire-select')['styles'];
}

public function css($options = null) {
Expand Down
6 changes: 5 additions & 1 deletion src/LivewireSelectServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ public function boot()
], 'livewire-select-views');
}

$this->publishes([
__DIR__ . '/../config/config.php' => config_path('livewire-select.php'),
], 'livewire-select-config');

$livewireSelect = new LivewireSelect;
Blade::directive('livewireSelectScripts', function ($options) use ($livewireSelect) {
return $livewireSelect->js($options);
Expand All @@ -34,6 +38,6 @@ public function boot()
*/
public function register()
{
$this->mergeConfigFrom(__DIR__.'/../config/config.php', 'livewire-select');
$this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'livewire-select');
}
}

0 comments on commit 4fb8bf4

Please sign in to comment.