Skip to content

Commit

Permalink
Added powergrid
Browse files Browse the repository at this point in the history
  • Loading branch information
ChimpGamer committed Oct 23, 2024
1 parent dcf13a7 commit 944ba3d
Show file tree
Hide file tree
Showing 6 changed files with 244 additions and 3 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"laravel/ui": "^4.0",
"livewire/livewire": "^3.4",
"mhmiton/laravel-modules-livewire": "^3.0.0",
"nwidart/laravel-modules": "^11.0"
"nwidart/laravel-modules": "^11.0",
"power-components/livewire-powergrid": "^6.0"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.13",
Expand Down
83 changes: 81 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

156 changes: 156 additions & 0 deletions config/livewire-powergrid.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Theme
|--------------------------------------------------------------------------
|
| PowerGrid supports Tailwind and Bootstrap 5 themes.
| Configure here the theme of your choice.
*/

//'theme' => \PowerComponents\LivewirePowerGrid\Themes\Tailwind::class,
'theme' => \PowerComponents\LivewirePowerGrid\Themes\Bootstrap5::class,

/*
|--------------------------------------------------------------------------
| Plugins
|--------------------------------------------------------------------------
|
| Plugins used: flatpickr.js to datepicker.
|
*/

'plugins' => [
/*
* https://flatpickr.js.org
*/
'flatpickr' => [
'locales' => [
'pt_BR' => [
'locale' => 'pt',
'dateFormat' => 'd/m/Y H:i',
'enableTime' => true,
'time_24hr' => true,
],
],
],

'select' => [
'default' => 'tom',

/*
* TomSelect Options
* https://tom-select.js.org
*/
'tom' => [
'plugins' => [
'clear_button' => [
'title' => 'Remove all selected options',
],
],
],

/*
* Slim Select options
* https://slimselectjs.com/
*/
'slim' => [
'settings' => [
'alwaysOpen' => false,
],
],
],
],

/*
|--------------------------------------------------------------------------
| Filters
|--------------------------------------------------------------------------
|
| PowerGrid supports inline and outside filters.
| 'inline': Filters data inside the table.
| 'outside': Filters data outside the table.
| 'null'
|
*/

'filter' => 'inline',

/*
|--------------------------------------------------------------------------
| Persisting
|--------------------------------------------------------------------------
|
| PowerGrid supports persisting of the filters, columns and sorting.
| 'session': persist in the session.
| 'cache': persist with cache.
| 'cookies': persist with cookies (default).
|
*/

'persist_driver' => 'cookies',

/*
|--------------------------------------------------------------------------
| Cache
|--------------------------------------------------------------------------
|
| Cache is enabled by default to improve search performance when using collections.
| When enabled, data is reloaded whenever the page is refreshed or a field is updated.
|
*/

'cached_data' => true,

/*
|--------------------------------------------------------------------------
| New Release Notification
|--------------------------------------------------------------------------
|
| PowerGrid can verify if a new release is available when you create a new PowerGrid Table.
|
| This feature depends on composer/composer.
| To install, run: `composer require composer/composer --dev`
|
*/

'check_version' => false,

/*
|--------------------------------------------------------------------------
| Exportable class
|--------------------------------------------------------------------------
|
|
*/

'exportable' => [
'default' => 'openspout_v4',
'openspout_v4' => [
'xlsx' => \PowerComponents\LivewirePowerGrid\Components\Exports\OpenSpout\v4\ExportToXLS::class,
'csv' => \PowerComponents\LivewirePowerGrid\Components\Exports\OpenSpout\v4\ExportToCsv::class,
],
'openspout_v3' => [
'xlsx' => \PowerComponents\LivewirePowerGrid\Components\Exports\OpenSpout\v3\ExportToXLS::class,
'csv' => \PowerComponents\LivewirePowerGrid\Components\Exports\OpenSpout\v3\ExportToCsv::class,
],
],

/*
|--------------------------------------------------------------------------
| Auto-Discover Models
|--------------------------------------------------------------------------
|
| PowerGrid will search for Models in the directories listed below.
| These Models be listed as options when you run the
| "artisan powergrid:create" command.
|
*/

'auto_discover_models_paths' => [
app_path('Models'),
],
];
1 change: 1 addition & 0 deletions resources/css/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "../../vendor/power-components/livewire-powergrid/dist/bootstrap5.css";
2 changes: 2 additions & 0 deletions resources/js/app.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
import './bootstrap';

import './../../vendor/power-components/livewire-powergrid/dist/powergrid'
2 changes: 2 additions & 0 deletions resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
<!-- Tippy -->
<link rel="stylesheet" href="https://unpkg.com/tippy.js@6/dist/tippy.css"/>

@vite(['resources/css/app.css', 'resources/js/app.js'])

@stack('styles')
</head>

Expand Down

0 comments on commit 944ba3d

Please sign in to comment.